@ingit/cli-darwin-x64 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,615 @@
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,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},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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})),u=o(((e,t)=>{t.exports=l()})),d=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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return ee(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 oe(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,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=oe(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(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 se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var D=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)},O={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=O,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 ee(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)T.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 ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=E,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,D)}catch(e){D(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),f=o(((e,t)=>{t.exports=d()})),p=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,E());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function te(){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&&ee());){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&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(te)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=te,E=function(){re.postMessage(null)}}else E=function(){_(te,0)};function ie(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,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),g=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=h()})),_=o((e=>{var t=m(),n=f(),r=g();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case ne:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ue=[],de=-1;function fe(e){return{current:e}}function pe(e){0>de||(e.current=ue[de],ue[de]=null,de--)}function me(e,t){de++,ue[de]=e.current,e.current=t}var he=fe(null),ge=fe(null),_e=fe(null),ve=fe(null);function ye(e,t){switch(me(_e,t),me(ge,e),me(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(he),me(he,e)}function be(){pe(he),pe(ge),pe(_e)}function xe(e){e.memoizedState!==null&&me(ve,e);var t=he.current,n=qd(t,e.type);t!==n&&(me(ge,e),me(he,n))}function Se(e){ge.current===e&&(pe(he),pe(ge)),ve.current===e&&(pe(ve),tp._currentValue=le)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+Ce+e+we}var Ee=!1;function De(e,t){if(!e||Ee)return``;Ee=!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}e.call(n.prototype)}}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{Ee=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Te(n):``}function Oe(e,t){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te(`Lazy`);case 13:return e.child!==t&&t!==null?Te(`Suspense Fallback`):Te(`Suspense`);case 19:return Te(`SuspenseList`);case 0:case 15:return De(e.type,!1);case 11:return De(e.type.render,!1);case 1:return De(e.type,!0);case 31:return Te(`Activity`);default:return``}}function ke(e){try{var t=``,n=null;do t+=Oe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var k=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,A=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,He=null,Ue=null;function We(e){if(typeof Be==`function`&&Ve(e),Ue&&typeof Ue.setStrictMode==`function`)try{Ue.setStrictMode(He,e)}catch{}}var Ge=Math.clz32?Math.clz32:Je,Ke=Math.log,qe=Math.LN2;function Je(e){return e>>>=0,e===0?32:31-(Ke(e)/qe|0)|0}var Ye=256,Xe=262144,Ze=4194304;function Qe(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&261888;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 $e(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=Qe(n))):i=Qe(o):i=Qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Qe(n))):i=Qe(o)):i=Qe(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 et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tt(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 nt(){var e=Ze;return Ze<<=1,!(Ze&62914560)&&(Ze=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function it(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function at(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-Ge(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&&ot(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ot(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ge(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function j(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ge(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 M(){var e=O.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function ut(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var dt=Math.random().toString(36).slice(2),N=`__reactFiber$`+dt,ft=`__reactProps$`+dt,pt=`__reactContainer$`+dt,mt=`__reactEvents$`+dt,ht=`__reactListeners$`+dt,gt=`__reactHandles$`+dt,_t=`__reactResources$`+dt,vt=`__reactMarker$`+dt;function yt(e){delete e[N],delete e[ft],delete e[mt],delete e[ht],delete e[gt]}function bt(e){var t=e[N];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pt]||n[N]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[N])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function xt(e){if(e=e[N]||e[pt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function St(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function P(e){var t=e[_t];return t||=e[_t]={hoistableStyles:new Map,hoistableScripts:new Map},t}function F(e){e[vt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=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]*$`),Ot={},kt={};function At(e){return k.call(kt,e)?!0:k.call(Ot,e)?!1:Dt.test(e)?kt[e]=!0:(Ot[e]=!0,!1)}function jt(e,t,n){if(At(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 Mt(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 Nt(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 Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(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 I(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(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=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Pt(n)):Ut(e,o,Pt(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=``+Pt(s):e.removeAttribute(`name`)}function Ht(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)){I(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(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),I(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(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=``+Pt(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 Gt(e,t,n){if(t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Pt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ce(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),I(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=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 Yt(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||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(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 Qt=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`],[`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`]]),$t=/^[\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 en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=xt(e);if(t&&(e=t.stateNode)){var n=e[ft]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(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="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ft]||null;if(!a)throw Error(i(90));Vt(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&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(Cu(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ft]||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 dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.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 gn=i.slice(e,1<r?1-r:void 0)}function vn(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 yn(){return!0}function bn(){return!1}function xn(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)?yn:bn,this.isPropagationStopped=bn,this}return p(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=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=p({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=p({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,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!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(p({},kn,{dataTransfer:0})),Mn=xn(p({},wn,{relatedTarget:0})),Nn=xn(p({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(p({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(p({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=xn(p({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=xn(p({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=xn(p({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=xn(p({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=xn(p({},kn,{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})),Kn=xn(p({},Sn,{newState:0,oldState:0})),L=[9,13,27,32],qn=dn&&`CompositionEvent`in window,Jn=null;dn&&`documentMode`in document&&(Jn=document.documentMode);var Yn=dn&&`TextEvent`in window&&!Jn,Xn=dn&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return L.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=_n(),gn=hn=mn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=Ad(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){Cd(e,0)}function ur(e){if(Lt(St(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(dn){var pr;if(dn){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,rn(e)),ln(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(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(!k.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(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=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(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=Rt(e.document)}return t}function kr(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 Ar=dn&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Rt(r)||(r=jr,`selectionStart`in r&&kr(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}),Nr&&wr(Nr,r)||(Nr=r,r=Ad(Mr,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};dn&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),Tt(t,[e])}var Zr=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)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ge(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(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 li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(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&65011712,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 fi(e,t){e.flags&=65011714;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 pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=Kf(e,n,he.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ne:return e=li(31,n,t,a),e.elementType=ne,e.lanes=o,e;case y:return mi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=li(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=li(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=li(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case te:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:ke(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:ke(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,R=1,Di=``;function Oi(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function ki(e,t,n){wi[Ti++]=R,wi[Ti++]=Di,wi[Ti++]=Ei,Ei=e;var r=R;e=Di;var i=32-Ge(r)-1;r&=~(1<<i),n+=1;var a=32-Ge(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,R=1<<32-Ge(t)+i|n<<i|r,Di=a+e}else R=1<<a|n<<i|r,Di=e}function Ai(e){e.return!==null&&(Oi(e,1),ki(e,1,0))}function ji(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null,R=wi[--Ti],wi[Ti]=null}function Mi(e,t){wi[Ti++]=R,wi[Ti++]=Di,wi[Ti++]=Ei,R=t.id,Di=t.overflow,Ei=e}var Ni=null,Pi=null,z=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[N]=e,t[ft]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)J(xd[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),Kt(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||Id(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Ni=Ni.return}}function Vi(e){if(e!==Ni)return!1;if(!z)return Bi(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Jd(e.type,e.memoizedProps)),n=!n),n&&Pi&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=hf(e)}else t===27?(t=Pi,nf(e.type)?(e=mf,mf=null,Pi=e):Pi=t):Pi=Ni?pf(e.stateNode.nextSibling):null;return!0}function Hi(){Pi=Ni=null,z=!1}function Ui(){var e=Fi;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=fe(null),Ki=null,qi=null;function Ji(e,t,n){me(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,pe(Gi)}function B(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 Xi(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),B(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),B(s,n,e),s=null}else 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 Zi(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;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ve.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[tp]:e.push(tp))}a=a.return}e!==null&&Xi(t,e,n,r),t.flags|=262144}function Qi(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $i(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ea(e){return na(Ki,e)}function ta(e,t){return Ki===null&&$i(e),na(e,t)}function na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ra=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()})}},ia=t.unstable_scheduleCallback,aa=t.unstable_NormalPriority,oa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new ra,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ia(aa,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=hd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function V(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 ha=D.S;D.S=function(e,t){ru=A(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ha!==null&&ha(e,t)};var H=fe(null);function ga(){var e=H.current;return e===null?Vl.pooledCache:e}function _a(e,t){t===null?me(H,H.current):me(H,t.pool)}function va(){var e=ga();return e===null?null:{parent:oa._currentValue,pool:e}}var ya=Error(i(460)),ba=Error(i(474)),xa=Error(i(542)),Sa={then:function(){}};function Ca(e){return e=e.status,e===`fulfilled`||e===`rejected`}function wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=Vl,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,Oa(e),e}throw Ea=t,ya}}function Ta(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ea=e,ya):e}}var Ea=null;function Da(){if(Ea===null)throw Error(i(459));var e=Ea;return Ea=null,e}function Oa(e){if(e===ya||e===xa)throw Error(i(483))}var ka=null,Aa=0;function ja(e){var t=Aa;return Aa+=1,ka===null&&(ka=[]),wa(ka,e,t)}function Ma(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Na(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Pa(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=di(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===E&&Ta(i)===t.type)?(t=a(t,n.props),Ma(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Ma(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=_i(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=mi(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=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=pi(t.type,t.key,t.props,null,e.mode,n),Ma(n,t),n.return=e,n;case v:return t=_i(t,e.mode,n),t.return=e,t;case E:return t=Ta(t),f(e,t,n)}if(ce(t)||ae(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ja(t),n);if(t.$$typeof===C)return f(e,ta(e,t),n);Na(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 _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case E:return n=Ta(n),p(e,t,n,r)}if(ce(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ja(n),r);if(n.$$typeof===C)return p(e,t,ta(e,n),r);Na(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 _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Ta(r),m(e,t,n,r,i)}if(ce(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ja(r),i);if(r.$$typeof===C)return m(e,t,n,ta(t,r),i);Na(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),z&&Oi(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 z&&Oi(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(g.key===null?h:g.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)}),z&&Oi(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),z&&Oi(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 z&&Oi(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(v.key===null?g:v.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)}),z&&Oi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Ta(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ma(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Ma(c,o),c.return=e,e=c)}return s(e);case v: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Ta(o),b(e,r,o,c)}if(ce(o))return h(e,r,o,c);if(ae(o)){if(l=ae(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ja(o),c);if(o.$$typeof===C)return b(e,r,ta(e,o),c);Na(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=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Aa=0;var i=b(e,t,n,r);return ka=null,i}catch(t){if(t===ya||t===xa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Fa=Pa(!0),Ia=Pa(!1),La=!1;function Ra(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function za(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 Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Va(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Ha(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,j(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Wa=!1;function Ga(){if(Wa){var e=fa;if(e!==null)throw e}}function Ka(e,t,n,r){Wa=!1;var i=e.updateQueue;La=!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,m=f!==s.lane;if(m?(K&f)===f:(r&f)===f){f!==0&&f===da&&(Wa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:La=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),Jl|=o,e.lanes=o,e.memoizedState=d}}function qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ja(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qa(n[e],t)}var Ya=fe(null),Xa=fe(0);function Za(e,t){e=ql,me(Xa,e),me(Ya,t),ql=e|t.baseLanes}function Qa(){me(Xa,ql),me(Ya,Ya.current)}function $a(){ql=Xa.current,pe(Ya),pe(Xa)}var eo=fe(null),to=null;function no(e){var t=e.alternate;me(so,so.current&1),me(eo,e),to===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(to=e)}function ro(e){me(so,so.current),me(eo,e),to===null&&(to=e)}function io(e){e.tag===22?(me(so,so.current),me(eo,e),to===null&&(to=e)):ao(e)}function ao(){me(so,so.current),me(eo,eo.current)}function oo(e){pe(eo),to===e&&(to=null),pe(so)}var so=fe(0);function co(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lo=0,U=null,uo=null,fo=null,po=!1,mo=!1,ho=!1,go=0,_o=0,vo=null,yo=0;function bo(){throw Error(i(321))}function xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function So(e,t,n,r,i,a){return lo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?zs:Bs,ho=!1,a=n(r,i),ho=!1,mo&&(a=wo(t,n,r,i)),Co(e),a}function Co(e){D.H=Rs;var t=uo!==null&&uo.next!==null;if(lo=0,fo=uo=U=null,po=!1,_o=0,vo=null,t)throw Error(i(300));e===null||rc||(e=e.dependencies,e!==null&&Qi(e)&&(rc=!0))}function wo(e,t,n,r){U=e;var a=0;do{if(mo&&(vo=null),_o=0,mo=!1,25<=a)throw Error(i(301));if(a+=1,fo=uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}D.H=Vs,o=t(n,r)}while(mo);return o}function To(){var e=D.H,t=e.useState()[0];return t=typeof t.then==`function`?Mo(t):t,e=e.useState()[0],(uo===null?null:uo.memoizedState)!==e&&(U.flags|=1024),t}function Eo(){var e=go!==0;return go=0,e}function Do(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Oo(e){if(po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}po=!1}lo=0,fo=uo=U=null,mo=!1,_o=go=0,vo=null}function ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fo===null?U.memoizedState=fo=e:fo=fo.next=e,fo}function Ao(){if(uo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=uo.next;var t=fo===null?U.memoizedState:fo.next;if(t!==null)fo=t,uo=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));uo=e,e={memoizedState:uo.memoizedState,baseState:uo.baseState,baseQueue:uo.baseQueue,queue:uo.queue,next:null},fo===null?U.memoizedState=fo=e:fo=fo.next=e}return fo}function jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mo(e){var t=_o;return _o+=1,vo===null&&(vo=[]),e=wa(vo,e,t),t=U,(fo===null?t.memoizedState:fo.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?zs:Bs),e}function No(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Mo(e);if(e.$$typeof===C)return ea(e)}throw Error(i(438,String(e)))}function Po(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.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=jo(),U.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]=re;return t.index++,n}function Fo(e,t){return typeof t==`function`?t(e):t}function Io(e){return Lo(Ao(),uo,e)}function Lo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(lo&f)===f:(K&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===da&&(d=!0);else if((lo&p)===p){u=u.next,p===da&&(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,U.lanes|=p,Jl|=p;f=u.action,ho&&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,U.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(rc=!0,d&&(n=fa,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 Ro(e){var t=Ao(),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);Cr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function zo(e,t,n){var r=U,a=Ao(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((uo||a).memoizedState,n);if(s&&(a.memoizedState=n,rc=!0),a=a.queue,us(Ho.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||fo!==null&&fo.memoizedState.tag&1){if(r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,a,n,t),null),Vl===null)throw Error(i(349));o||lo&127||Bo(r,t,n)}return n}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=jo(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Vo(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Wo(e){var t=ii(e,2);t!==null&&vu(t,e,2)}function Go(e){var t=ko();if(typeof e==`function`){var n=e;if(e=n(),ho){We(!0);try{n()}finally{We(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Lo(e,uo,typeof r==`function`?r:Fo)}function qo(e,t,n,r,a){if(Fs(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)}};D.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=D.T,o={};D.T=o;try{var s=n(i,r),c=D.S;c!==null&&c(o,s),Yo(e,t,s)}catch(n){Zo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),D.T=a}}else try{a=n(i,r),Yo(e,t,a)}catch(n){Zo(e,t,n)}}function Yo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Xo(e,t,n)},function(n){return Zo(e,t,n)}):Xo(e,t,n)}function Xo(e,t,n){t.status=`fulfilled`,t.value=n,Qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jo(e,n)))}function Zo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Qo(t),t=t.next;while(t!==r)}e.action=null}function Qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $o(e,t){return t}function es(e,t){if(z){var n=Vl.formState;if(n!==null){a:{var r=U;if(z){if(Pi){b:{for(var i=Pi,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=pf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=ko(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t},n.queue=r,n=Ms.bind(null,U,r),r.dispatch=n,r=Go(!1),a=Ps.bind(null,U,!1,r.queue),r=ko(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ts(e){return ns(Ao(),uo,e)}function ns(e,t,n){if(t=Lo(e,t,$o)[0],e=Io(Fo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Mo(t)}catch(e){throw e===ya?xa:e}else r=t;t=Ao();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,as(9,{destroy:void 0},rs.bind(null,i,n),null)),[r,a,e]}function rs(e,t){e.action=t}function is(e){var t=Ao(),n=uo;if(n!==null)return ns(t,n,e);Ao(),t=t.memoizedState,n=Ao();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function as(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=jo(),U.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 os(){return Ao().memoizedState}function ss(e,t,n,r){var i=ko();U.flags|=e,i.memoizedState=as(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=Ao();r=r===void 0?null:r;var a=i.memoizedState.inst;uo!==null&&r!==null&&xo(r,uo.memoizedState.deps)?i.memoizedState=as(t,a,n,r):(U.flags|=e,i.memoizedState=as(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=jo(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=Ao().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(W&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ms(e,t){return cs(4,4,e,t)}function hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,hs.bind(null,t,e),n)}function _s(){}function vs(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ys(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&xo(t,r[1]))return r[0];if(r=e(),ho){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r}function bs(e,t,n){return n===void 0||lo&1073741824&&!(K&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),U.lanes|=e,Jl|=e,n)}function xs(e,t,n,r){return Cr(n,t)?n:Ya.current===null?!(lo&42)||lo&1073741824&&!(K&261930)?(rc=!0,e.memoizedState=n):(e=_u(),U.lanes|=e,Jl|=e,t):(e=bs(e,n,r),Cr(e,t)||(rc=!0),e)}function Ss(e,t,n,r,i){var a=O.p;O.p=a!==0&&8>a?a:8;var o=D.T,s={};D.T=s,Ps(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,V(c,r),gu(e)):Ns(e,t,r,gu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{O.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ts(e).queue;Ss(e,a,t,le,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},gu())}function Ds(){return ea(tp)}function Os(){return Ao().memoizedState}function ks(){return Ao().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Ba(n);var r=Va(t,e,n);r!==null&&(vu(r,t,n),Ha(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=ri(e,t,n,r),n!==null&&(vu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,gu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(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,Cr(s,o))return ni(e,t,i,0),Vl===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return vu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&vu(t,e,2)}function Fs(e){var t=e.alternate;return e===U||t!==null&&t===U}function Is(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,j(e,n)}}var Rs={readContext:ea,use:No,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo};Rs.useEffectEvent=bo;var zs={readContext:ea,use:No,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:ea,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=ko();t=t===void 0?null:t;var r=e();if(ho){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ko();if(n!==void 0){var i=n(t);if(ho){We(!0);try{n(t)}finally{We(!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=js.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=Ms.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_s,useDeferredValue:function(e,t){return bs(ko(),e,t)},useTransition:function(){var e=Go(!1);return e=Ss.bind(null,U,e.queue,!0,!1),ko().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=ko();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vl===null)throw Error(i(349));K&127||Bo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(Ho.bind(null,r,o,e),[e]),r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,o,n,t),null),n},useId:function(){var e=ko(),t=Vl.identifierPrefix;if(z){var n=Di,r=R;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:es,useActionState:es,useOptimistic:function(e){var t=ko();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:Po,useCacheRefresh:function(){return ko().memoizedState=As.bind(null,U)},useEffectEvent:function(e){var t=ko(),n={impl:e};return t.memoizedState=n,function(){if(W&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:ea,use:No,useCallback:vs,useContext:ea,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Io,useRef:os,useState:function(){return Io(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){return xs(Ao(),uo.memoizedState,e,t)},useTransition:function(){var e=Io(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){return Ko(Ao(),uo,e,t)},useMemoCache:Po,useCacheRefresh:ks};Bs.useEffectEvent=fs;var Vs={readContext:ea,use:No,useCallback:vs,useContext:ea,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Ro,useRef:os,useState:function(){return Ro(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){var n=Ao();return uo===null?bs(n,e,t):xs(n,uo.memoizedState,e,t)},useTransition:function(){var e=Ro(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:is,useActionState:is,useOptimistic:function(e,t){var n=Ao();return uo===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,uo,e,t)},useMemoCache:Po,useCacheRefresh:ks};Vs.useEffectEvent=fs;function Hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Us={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ba(r);i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(vu(t,e,r),Ha(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ba(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(vu(t,e,r),Ha(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Ba(n);r.tag=2,t!=null&&(r.callback=t),t=Va(e,r,n),t!==null&&(vu(t,e,n),Ha(t,e,n))}};function Ws(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?!wr(n,r)||!wr(i,a):!0}function Gs(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&&Us.enqueueReplaceState(t,t.state,null)}function Ks(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=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){Zr(e)}function Js(e){console.error(e)}function Ys(e){Zr(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(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 Qs(e,t,n){return n=Ba(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Ba(e),e.tag=3,e}function ec(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(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.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&&Zi(t,n,a,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?Au():n.alternate===null&&q===0&&(q=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===Sa?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)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(z)return t=eo.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=Qs(e.stateNode,r,a),Ua(e,a),q!==4&&(q=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),$l===null?$l=[o]:$l.push(o),q!==4&&(q=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Qs(n.stateNode,r,e),Ua(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`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=$s(a),ec(a,e,n,r),Ua(n,a),!1}n=n.return}while(n!==null);return!1}var nc=Error(i(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?Ia(t,null,n,r):Fa(t,e.child,n,r)}function ac(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 $i(t),r=So(e,t,n,o,a,i),s=Eo(),e!==null&&!rc?(Do(e,t,i),kc(e,t,i)):(z&&s&&Ai(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ac(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return kc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(rc=!1,t.pendingProps=r=a,Ac(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,kc(e,t,i)}return hc(e,t,n,r,i)}function cc(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 uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_a(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),io(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&_a(t,null),Qa(),ao(t)):(_a(t,a.cachePool),Za(t,a),ao(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=ga();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&_a(t,null),Qa(),io(t),e!==null&&Zi(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=wc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return Fa(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(ro(t),(e=Pi)?(e=lf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:R,overflow:Di},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),a)if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(rc||Zi(e,t,n,!1),a=(n&e.childLanes)!==0,rc||a){if(r=Vl,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),vu(r,e,s),nc;Au(),t=fc(e,t,n)}else e=o.treeContext,Pi=pf(s.nextSibling),Ni=t,z=!0,Fi=null,Ii=!1,e!==null&&Mi(t,e),t=dc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(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 hc(e,t,n,r,i){return $i(t),n=So(e,t,n,r,void 0,i),r=Eo(),e!==null&&!rc?(Do(e,t,i),kc(e,t,i)):(z&&r&&Ai(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return $i(t),t.updateQueue=null,n=wo(t,r,n,i),Co(e),r=Eo(),e!==null&&!rc?(Do(e,t,a),kc(e,t,a)):(z&&r&&Ai(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if($i(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Us,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ra(t),o=n.contextType,a.context=typeof o==`object`&&o?ea(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Hs(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&&Us.enqueueReplaceState(a,a.state,null),Ka(t,r,a,i),Ga(),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=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gs(t,a,r,o),La=!1;var f=t.memoizedState;a.state=f,Ka(t,r,a,i),Ga(),l=t.memoizedState,s||f!==l||La?(typeof d==`function`&&(Hs(t,n,d,r),l=t.memoizedState),(c=La||Ws(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,za(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gs(t,a,r,c),La=!1,f=t.memoizedState,a.state=f,Ka(t,r,a,i),Ga();var p=t.memoizedState;o!==d||f!==p||La||e!==null&&e.dependencies!==null&&Qi(e.dependencies)?(typeof s==`function`&&(Hs(t,n,s,r),p=t.memoizedState),(u=La||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Qi(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,mc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Fa(t,e.child,null,i),t.child=Fa(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=kc(e,t,i),e}function vc(e,t,n,r){return Hi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:va()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function Sc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(so.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(z){if(a?no(t):ao(t),(e=Pi)?(e=lf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:R,overflow:Di},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ao(t),a=t.mode,c=wc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(no(t),Cc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(no(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,a=t.mode,r=wc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Fa(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(no(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Tc(e,t,n)}else if(rc||Zi(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=Vl,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),vu(s,e,r),nc;uf(c)||Au(),t=Tc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=pf(c.nextSibling),Ni=t,z=!0,Fi=null,Ii=!1,e!==null&&Mi(t,e),t=Cc(t,r.children),t.flags|=4096);return t}return a?(ao(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(a=c.cachePool,a===null?a=va():(l=oa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Cc(e,t){return t=wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function wc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return Fa(t,e.child,null,n),e=Cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),B(e.return,t,n)}function Dc(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 Oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=so.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,me(so,o),ic(e,t,r,n),r=z?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,n,t);else if(e.tag===19)Ec(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,a,r);break;case`together`:Dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function kc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Zi(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=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ac(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Qi(e))):!0}function jc(e,t,n){switch(t.tag){case 3:ye(t,t.stateNode.containerInfo),Ji(t,oa,e.memoizedState.cache),Hi();break;case 27:case 5:xe(t);break;case 4:ye(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=kc(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Zi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(so,so.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Ji(t,oa,e.memoizedState.cache)}return kc(e,t,n)}function Mc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!Ac(e,n)&&!(t.flags&128))return rc=!1,jc(e,t,n);rc=!!(e.flags&131072)}else rc=!1,z&&t.flags&1048576&&ki(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ta(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ac(null,t,e,r,n);break a}else if(a===te){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=se(e)||e,Error(i(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ks(r,t.pendingProps),_c(e,t,r,a,n);case 3:a:{if(ye(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,za(e,t),Ka(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,oa,r),r!==o.cache&&Xi(t,[oa],n,!0),Ga(),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=vc(e,t,r,n);break a}else if(r!==a){a=yi(Error(i(424)),t),Wi(a),t=vc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Pi=pf(e.firstChild),Ni=t,z=!0,Fi=null,Ii=!0,n=Ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=kc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(n=t.type,e=t.pendingProps,r=Gd(_e.current).createElement(n),r[N]=t,r[ft]=e,zd(r,n,e),F(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xe(t),e===null&&z&&(r=t.stateNode=_f(t.type,t.pendingProps,_e.current),Ni=t,Ii=!0,a=Pi,nf(t.type)?(mf=a,Pi=pf(r.firstChild)):Pi=a),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=Pi)&&(r=sf(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Ni=t,Pi=pf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),xe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=So(e,t,To,null,null,n),tp._currentValue=a),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=Pi)&&(n=cf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||Ri(t)),null;case 13:return Sc(e,t,n);case 4:return ye(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fa(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,$i(t),a=ea(a),r=r(a),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Oc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return $i(t),r=ea(oa),e===null?(a=ga(),a===null&&(a=Vl,o=sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ra(t),Ji(t,oa,a)):((e.lanes&n)!==0&&(za(e,t),Ka(t,null,null,n),Ga()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,oa,r),r!==a.cache&&Xi(t,[oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,oa,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Nc(e){e.flags|=4}function Pc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Ea=Sa,ba}else e.flags&=-16777217}function Fc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t))if(Du())e.flags|=8192;else throw Ea=Sa,ba}function Ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:nt(),e.lanes|=t,Ql|=t)}function Lc(e,t){if(!z)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function Rc(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&65011712,r|=i.flags&65011712,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 zc(e,t,n){var r=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rc(t),null;case 1:return Rc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(oa),be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Nc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Rc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Nc(t),o===null?(Rc(t),Pc(t,a,null,r,n)):(Rc(t),Fc(t,o))):o?o===e.memoizedState?(Rc(t),t.flags&=-16777217):(Nc(t),Rc(t),Fc(t,o)):(e=e.memoizedProps,e!==r&&Nc(t),Rc(t),Pc(t,a,e,r,n)),null;case 27:if(Se(t),n=_e.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Rc(t),null}e=he.current,Vi(t)?zi(t,e):(e=_f(a,r,n),t.stateNode=e,Nc(t))}return Rc(t),null;case 5:if(Se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Rc(t),null}if(o=he.current,Vi(t))zi(t,o);else{var s=Gd(_e.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[N]=t,o[ft]=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(zd(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&&Nc(t)}}return Rc(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=_e.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[N]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Ri(t,!0)}else e=Gd(e).createTextNode(r),e[N]=t,t.stateNode=e}return Rc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(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[N]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),e=!1}else n=Ui(),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 Rc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(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[N]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),a=!1}else a=Ui(),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),Ic(t,t.updateQueue),Rc(t),null);case 4:return be(),e===null&&Ed(t.stateNode.containerInfo),Rc(t),null;case 10:return Yi(t.type),Rc(t),null;case 19:if(pe(so),r=t.memoizedState,r===null)return Rc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Lc(r,!1);else{if(q!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return me(so,so.current&1|2),z&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&A()>iu&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}else{if(!a)if(e=co(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!z)return Rc(t),null}else 2*A()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Lc(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)}return r.tail===null?(Rc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=A(),e.sibling=null,n=so.current,me(so,a?n&1|2:n&1),z&&Oi(t,r.treeForkCount),e);case 22:case 23:return oo(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Rc(t),t.subtreeFlags&6&&(t.flags|=8192)):Rc(t),n=t.updateQueue,n!==null&&Ic(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&&pe(H),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(oa),Rc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(oa),be(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(i(340));Hi()}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));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(so),null;case 4:return be(),null;case 10:return Yi(t.type),null;case 22:case 23:return oo(t),$a(),e!==null&&pe(H),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(oa),null;case 25:return null;default:return null}}function Vc(e,t){switch(ji(t),t.tag){case 3:Yi(oa),be();break;case 26:case 27:case 5:Se(t);break;case 4:be();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:pe(so);break;case 10:Yi(t.type);break;case 22:case 23:oo(t),$a(),e!==null&&pe(H);break;case 24:Yi(oa)}}function Hc(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){Ju(t,t.return,e)}}function Uc(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){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Ju(e,e.return,t)}}}function Gc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Kc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ju(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){Ju(e,t,n)}else n.current=null}function Jc(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){Ju(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[ft]=t}catch(t){Ju(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(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&&nf(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 Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[N]=e,t[ft]=n}catch(t){Ju(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Ud=up,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},up=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,al=e;break}al=t.return}}function sl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Sl(e,n),r&4&&Hc(5,n);break;case 1:if(Sl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Wc(n),r&512&&Kc(n,n.return);break;case 3:if(Sl(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{Ja(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&el(n);case 26:case 5:Sl(e,n),t===null&&r&4&&Jc(n),r&512&&Kc(n,n.return);break;case 12:Sl(e,n);break;case 31:Sl(e,n),r&4&&pl(e,n);break;case 13:Sl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||tl,!r){t=t!==null&&t.memoizedState!==null||nl,i=tl;var a=nl;tl=r,(nl=t)&&!a?wl(e,n,(n.subtreeFlags&8772)!=0):Sl(e,n),tl=i,nl=a}break;case 30:break;default:Sl(e,n)}}function cl(e){var t=e.alternate;t!==null&&(e.alternate=null,cl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&yt(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 ll=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(Ue&&typeof Ue.onCommitFiberUnmount==`function`)try{Ue.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:nl||qc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nl||qc(n,t);var r=ll,i=ul;nf(n.type)&&(ll=n.stateNode,ul=!1),dl(e,t,n),vf(n.stateNode),ll=r,ul=i;break;case 5:nl||qc(n,t);case 6:if(r=ll,i=ul,ll=null,dl(e,t,n),ll=r,ul=i,ll!==null)if(ul)try{(ll.nodeType===9?ll.body:ll.nodeName===`HTML`?ll.ownerDocument.body:ll).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{ll.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:ll!==null&&(ul?(e=ll,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Ip(e)):rf(ll,n.stateNode));break;case 4:r=ll,i=ul,ll=n.stateNode.containerInfo,ul=!0,dl(e,t,n),ll=r,ul=i;break;case 0:case 11:case 14:case 15:Uc(2,n,t),nl||Uc(4,n,t),dl(e,t,n);break;case 1:nl||(qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Gc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:nl=(r=nl)||n.memoizedState!==null,dl(e,t,n),nl=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){Ju(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){Ju(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new il),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new il),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function _l(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){ll=c.stateNode,ul=!1;break a}break;case 5:ll=c.stateNode,ul=!1;break a;case 3:case 4:ll=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(ll===null)throw Error(i(160));fl(o,s,a),ll=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Uc(3,e,e.return),Hc(3,e),Uc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),r&64&&tl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vl;if(_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[vt]||o[N]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[N]=e,F(o),r=o;break a;case`link`:var s=Wf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Wf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[N]=e,F(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode);else e.stateNode=X(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):X(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Yc(e,a,n===null?a:n.memoizedProps)),r&1024&&(rl=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Uf=null,a=vl,vl=bf(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){Ju(e,e.return,t)}rl&&(rl=!1,xl(e));break;case 4:r=vl,vl=bf(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=A()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=tl,d=nl;if(tl=u||a,nl=d||l,_l(t,e),nl=d,tl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||tl||nl||Cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;$c(e,Zc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),$c(e,Zc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Qc(e,Zc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sl(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Uc(4,t,t.return),Cl(t);break;case 1:qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Gc(t,t.return,n),Cl(t);break;case 27:vf(t.stateNode);case 26:case 5:qc(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:wl(i,a,n),Hc(4,a);break;case 1:if(wl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)qa(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Wc(a),Kc(a,a.return);break;case 27:el(a);case 26:case 5:wl(i,a,n),n&&r===null&&o&4&&Jc(a),Kc(a,a.return);break;case 12:wl(i,a,n);break;case 31:wl(i,a,n),n&&o&4&&pl(i,a);break;case 13:wl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&wl(i,a,n),Kc(a,a.return);break;case 30:break;default:wl(i,a,n)}t=t.sibling}}function Tl(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&&ca(n))}function El(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function Dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ol(e,t,n,r),t=t.sibling}function Ol(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Dl(e,t,n,r),i&2048&&Hc(9,t);break;case 1:Dl(e,t,n,r);break;case 3:Dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e)));break;case 12:if(i&2048){Dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else Dl(e,t,n,r);break;case 31:Dl(e,t,n,r);break;case 13:Dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Dl(e,t,n,r):(a._visibility|=2,kl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Dl(e,t,n,r):Al(e,t),i&2048&&Tl(o,t);break;case 24:Dl(e,t,n,r),i&2048&&El(t.alternate,t);break;default:Dl(e,t,n,r)}}function kl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:kl(a,o,s,c,i),Hc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,kl(a,o,s,c,i)):u._visibility&2?kl(a,o,s,c,i):Al(a,o),i&&l&2048&&Tl(o.alternate,o);break;case 24:kl(a,o,s,c,i),i&&l&2048&&El(o.alternate,o);break;default:kl(a,o,s,c,i)}t=t.sibling}}function Al(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:Al(n,r),i&2048&&Tl(r.alternate,r);break;case 24:Al(n,r),i&2048&&El(r.alternate,r);break;default:Al(n,r)}t=t.sibling}}var jl=8192;function Ml(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)Nl(e,t,n),e=e.sibling}function Nl(e,t,n){switch(e.tag){case 26:Ml(e,t,n),e.flags&jl&&e.memoizedState!==null&&Jf(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,n);break;case 3:case 4:var r=vl;vl=bf(e.stateNode.containerInfo),Ml(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jl,jl=16777216,Ml(e,t,n),jl=r):Ml(e,t,n));break;default:Ml(e,t,n)}}function Pl(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 Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Rl(r,e)}Pl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Il(e),e=e.sibling}function Il(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Uc(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):Fl(e);break;default:Fl(e)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Rl(r,e)}Pl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Uc(8,t,t.return),Ll(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function Rl(e,t){for(;al!==null;){var n=al;switch(n.tag){case 0:case 11:case 15:Uc(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:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,al=r;else a:for(n=e;al!==null;){r=al;var i=r.sibling,a=r.return;if(cl(r),r===n){al=null;break a}if(i!==null){i.return=a,al=i;break a}al=a}}}var zl={getCacheForType:function(e){var t=ea(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ea(oa).controller.signal}},Bl=typeof WeakMap==`function`?WeakMap:Map,W=0,Vl=null,G=null,K=0,Hl=0,Ul=null,Wl=!1,Gl=!1,Kl=!1,ql=0,q=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return W&2&&K!==0?K&-K:D.T===null?M():hd()}function _u(){if(Zl===0)if(!(K&536870912)||z){var e=Xe;Xe<<=1,!(Xe&3932160)&&(Xe=262144),Zl=e}else Zl=536870912;return e=eo.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Vl&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,K,Zl,!1)),it(e,n),(!(W&2)||e!==Vl)&&(e===Vl&&(!(W&2)&&(Yl|=n),q===4&&Su(e,K,Zl,!1)),sd(e))}function yu(e,t,n){if(W&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||et(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Gl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Kl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(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)break;case 6:Su(r,t,Zl,!Wl);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-A(),10<a)){if(Su(r,t,Zl,!Wl),$e(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Zd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Wl,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Wl,o,null,-0,0)}}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Nl(t,a,d);var m=(a&62914560)===a?nu-A():(a&4194048)===a?ru-A():0;if(m=Xf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(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(!Cr(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 Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ge(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ot(e,n,t)}function Cu(){return W&6?!0:(cd(0,!1),!1)}function wu(){if(G!==null){if(Hl===0)var e=G.return;else e=G,qi=Ki=null,Oo(e),ka=null,Aa=0,e=G;for(;e!==null;)Vc(e.alternate,e),e=e.return;G=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Vl=e,G=n=di(e.current,null),K=t,Hl=0,Ul=null,Wl=!1,Gl=et(e,t),Kl=!1,Ql=Zl=Xl=Yl=Jl=q=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ge(r),a=1<<i;t|=e[i],r&=~a}return ql=t,ti(),n}function Eu(e,t){U=null,D.H=Rs,t===ya||t===xa?(t=Da(),Hl=3):t===ba?(t=Da(),Hl=4):Hl=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ul=t,G===null&&(q=1,Xs(e,yi(t,e.current)))}function Du(){var e=eo.current;return e===null?!0:(K&4194048)===K?to===null:(K&62914560)===K||K&536870912?e===to:!1}function Ou(){var e=D.H;return D.H=Rs,e===null?Rs:e}function ku(){var e=D.A;return D.A=zl,e}function Au(){q=4,Wl||(K&4194048)!==K&&eo.current!==null||(Gl=!0),!(Jl&134217727)&&!(Yl&134217727)||Vl===null||Su(Vl,K,Zl,!1)}function ju(e,t,n){var r=W;W|=2;var i=Ou(),a=ku();(Vl!==e||K!==t)&&(au=null,Tu(e,t)),t=!1;var o=q;a:do try{if(Hl!==0&&G!==null){var s=G,c=Ul;switch(Hl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=Hl;if(Hl=0,Ul=null,Lu(e,s,c,l),n&&Gl){o=0;break a}break;default:l=Hl,Hl=0,Ul=null,Lu(e,s,c,l)}}Mu(),o=q;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,W=r,D.H=i,D.A=a,G===null&&(Vl=null,K=0,ti()),o}function Mu(){for(;G!==null;)Fu(G)}function Nu(e,t){var n=W;W|=2;var r=Ou(),a=ku();Vl!==e||K!==t?(au=null,iu=A()+500,Tu(e,t)):Gl=et(e,t);a:do try{if(Hl!==0&&G!==null){t=G;var o=Ul;b:switch(Hl){case 1:Hl=0,Ul=null,Lu(e,t,o,1);break;case 2:case 9:if(Ca(o)){Hl=0,Ul=null,Iu(t);break}t=function(){Hl!==2&&Hl!==9||Vl!==e||(Hl=7),sd(e)},o.then(t,t);break a;case 3:Hl=7;break a;case 4:Hl=5;break a;case 7:Ca(o)?(Hl=0,Ul=null,Iu(t)):(Hl=0,Ul=null,Lu(e,t,o,7));break;case 5:var s=null;switch(G.tag){case 26:s=G.memoizedState;case 5:case 27:var c=G;if(s?qf(s):c.stateNode.complete){Hl=0,Ul=null;var l=c.sibling;if(l!==null)G=l;else{var u=c.return;u===null?G=null:(G=u,Ru(u))}break b}}Hl=0,Ul=null,Lu(e,t,o,5);break;case 6:Hl=0,Ul=null,Lu(e,t,o,6);break;case 8:wu(),q=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return qi=Ki=null,D.H=r,D.A=a,W=n,G===null?(Vl=null,K=0,ti(),q):0}function Pu(){for(;G!==null&&!Me();)Fu(G)}function Fu(e){var t=Mc(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?Ru(e):G=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,K);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,K);break;case 5:Oo(t);default:Vc(n,t),t=G=fi(t,ql),t=Mc(n,t,ql)}e.memoizedProps=e.pendingProps,t===null?Ru(e):G=t}function Lu(e,t,n,r){qi=Ki=null,Oo(t),ka=null,Aa=0;var i=t.return;try{if(tc(e,i,t,n,K)){q=1,Xs(e,yi(n,e.current)),G=null;return}}catch(t){if(i!==null)throw G=i,t;q=1,Xs(e,yi(n,e.current)),G=null;return}t.flags&32768?(z||r===1?e=!0:Gl||K&536870912?e=!1:(Wl=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Wl);return}e=t.return;var n=zc(t.alternate,t,ql);if(n!==null){G=n;return}if(t=t.sibling,t!==null){G=t;return}G=t=e}while(t!==null);q===0&&(q=5)}function zu(e,t){do{var n=Bc(e.alternate,e);if(n!==null){n.flags&=32767,G=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){G=e;return}G=e=n}while(e!==null);q=6,G=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(W&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,at(e,n,o,s,c,l),e===Vl&&(G=Vl=null,K=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(Le,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=D.T,D.T=null,a=O.p,O.p=2,s=W,W|=4;try{ol(e,t,n)}finally{W=s,O.p=a,D.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=W;W|=4;try{yl(t,e);var a=Wd,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(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 _=Er(s,h),v=Er(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}}up=!!Ud,Wd=Ud=null}finally{W=i,O.p=r,D.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=W;W|=4;try{sl(e,t.alternate,t)}finally{W=i,O.p=r,D.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,Ne();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),lt(n),t=t.stateNode,Ue&&typeof Ue.onCommitFiberRoot==`function`)try{Ue.onCommitFiberRoot(He,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=D.T,i=O.p,O.p=2,D.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{D.T=t,O.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=lt(uu),r=D.T,a=O.p;try{O.p=32>n?32:n,D.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,W&6)throw Error(i(331));var c=W;if(W|=4,Il(o.current),Ol(o,o.current,s,n),W=c,cd(0,!1),Ue&&typeof Ue.onPostCommitFiberRoot==`function`)try{Ue.onPostCommitFiberRoot(He,o)}catch{}return!0}finally{O.p=a,D.T=r,Wu(e,t)}}function qu(e,t,n){t=yi(n,t),t=Qs(e.stateNode,t,2),e=Va(e,t,2),e!==null&&(it(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=yi(n,e),n=$s(2),r=Va(t,n,2),r!==null&&(ec(n,r,t,e),it(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;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)||(Kl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(K&n)===n&&(q===4||q===3&&(K&62914560)===K&&300>A()-nu?!(W&2)&&Tu(e,0):Xl|=n,Ql===K&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=nt()),e=ii(e,t),e!==null&&(it(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(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),Zu(e,n)}function ed(e,t){return Ae(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;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-Ge(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=K,a=$e(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,pd(r,a));r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Xd()&&(e=od);for(var t=A(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ge(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=tt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Vl,n=K,n=$e(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||et(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&je(r),lt(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=fd.bind(null,e),n=Ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&je(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=K;return r=$e(e,e===Vl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,A()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){ef(function(){W&6?Ae(Fe,ld):ud()})}function hd(){if(od===0){var e=da;e===0&&(e=Ye,Ye<<=1,!(Ye&261888)&&(Ye=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[ft]||null).action),o=r.submitter;o&&(t=(t=o[ft]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);ws(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),ws(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Yr.length;yd++){var bd=Yr[yd];Xr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),Et(`onMouseEnter`,[`mouseout`,`mouseover`]),Et(`onMouseLeave`,[`mouseout`,`mouseover`]),Et(`onPointerEnter`,[`pointerout`,`pointerover`]),Et(`onPointerLeave`,[`pointerout`,`pointerover`]),Tt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Tt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Tt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Tt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=(t&4)!=0;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){Zr(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){Zr(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[mt];n===void 0&&(n=t[mt]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,Ct.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(_p(t)){case 2:var i=dp;break;case 8:i=fp;break;default:i=pp}n=i.bind(null,t,n,e),i=void 0,!fn||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 Od(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=bt(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}ln(function(){var r=a,i=rn(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;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=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case Vr:case Hr:case Ur:l=Nn;break;case qr:l=Wn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}var d=(t&4)!=0,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=un(m,p),g!=null&&d.push(kd(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(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(bt(u)||u[pt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?bt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:St(l),h=u==null?c:St(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,bt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?St(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c))if(fr)v=xr;else{v=yr;var y=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?St(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,tr=!0)),y=Ad(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(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=un(e,n),i!=null&&r.unshift(kd(e,i,a)),i=un(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(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=un(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=un(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
9
+ `).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;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));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=en(``+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`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`:J(`beforetoggle`,e),J(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,jt(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ft]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):jt(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`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:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:J(`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:Ld(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in J(`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:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in J(`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:Ld(e,t,s,c,n,null)}Kt(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:Ld(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)J(xd[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`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:Ld(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(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)||Ld(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Vt(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)||Ld(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(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:Ld(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Gt(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:Ld(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(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)&&Ld(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:Ld(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(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||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(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||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){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&&Vd(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&&Vd(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 Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(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 qd(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 Jd(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 Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e===Yd?!1:(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(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),Ip(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[vt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body);n=i}while(n);Ip(t)}function af(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 of(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`:of(n),yt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(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[vt])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=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(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 pf(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 mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(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 _f(e,t,n){switch(t=Gd(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 vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);yt(e)}var Y=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=O.d;O.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=Cu();return e||t}function Cf(e){var t=xt(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),F(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Pf(e);break;case`script`:a=Rf(e)}Y.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Y.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),zd(t,`link`,e),F(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!Y.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Y.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),F(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=P(r).hoistableStyles,a=Pf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Y.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);F(c),zd(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,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=P(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=p({src:e,async:!0},t),(t=Y.get(i))&&Hf(e,t),a=n.createElement(`script`),F(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=P(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Y.get(i))&&Hf(e,t),a=n.createElement(`script`),F(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=_e.current)?bf(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`?(t=Pf(n.href),n=P(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Pf(n.href);var o=P(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(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Y.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Y.set(e,n),o||Lf(a,e,n,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`?(t=Rf(n),n=P(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pf(e){return`href="`+Bt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),F(t),e.head.appendChild(t))}function Rf(e){return`[src="`+Bt(e)+`"]`}function zf(e){return`script[async]`+e}function X(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,F(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),F(r),zd(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pf(n.href);var o=e.querySelector(Ff(a));if(o)return t.state.loading|=4,t.instance=o,F(o),o;r=If(n),(a=Y.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),F(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,F(a),a):(r=n,(a=Y.get(o))&&(r=p({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),F(a),zd(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,Bf(r,n.precedence,e));return t.instance}function Bf(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 Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,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[vt]||a[N]||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 Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Kf(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 qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Jf(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=Pf(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,F(a);return}a=t.ownerDocument||t,r=If(r),(i=Y.get(i))&&Vf(r,i),a=a.createElement(`link`),F(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(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=Zf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Yf===0&&(Yf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.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=Zf.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 tp={$$typeof:C,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function np(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=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function rp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new np(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ra(a),e}function ip(e){return e?(e=si,e):si}function ap(e,t,n,r,i,a){i=ip(i),r.context===null?r.context=i:r.pendingContext=i,r=Ba(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Va(e,r,t),n!==null&&(vu(n,e,t),Ha(n,e,t))}function op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sp(e,t){op(e,t),(e=e.alternate)&&op(e,t)}function cp(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&vu(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=gu();t=ct(t);var n=ii(e,t);n!==null&&vu(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=2,pp(e,t,n,r)}finally{O.p=a,D.T=i}}function fp(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=8,pp(e,t,n,r)}finally{O.p=a,D.T=i}}function pp(e,t,n,r){if(up){var i=mp(r);if(i===null)Od(e,t,r,hp,n),Ep(e,r);else if(Op(i,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<Tp.indexOf(e)){for(;i!==null;){var a=xt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ge(o);s.entanglements[1]|=c,o&=~c}sd(a),!(W&6)&&(iu=A()+500,cd(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&vu(s,a,2),Cu(),sp(a,2)}if(a=mp(r),a===null&&Od(e,t,r,hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function mp(e){return e=rn(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=bt(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 hp=e,null}function _p(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var vp=!1,yp=null,bp=null,xp=null,Sp=new Map,Cp=new Map,wp=[],Tp=`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 Ep(e,t){switch(e){case`focusin`:case`focusout`:yp=null;break;case`dragenter`:case`dragleave`:bp=null;break;case`mouseover`:case`mouseout`:xp=null;break;case`pointerover`:case`pointerout`:Sp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Cp.delete(t.pointerId)}}function Dp(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=xt(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Op(e,t,n,r,i){switch(t){case`focusin`:return yp=Dp(yp,e,t,n,r,i),!0;case`dragenter`:return bp=Dp(bp,e,t,n,r,i),!0;case`mouseover`:return xp=Dp(xp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Sp.set(a,Dp(Sp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Cp.set(a,Dp(Cp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=bt(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,ut(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ut(e.priority,function(){lp(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 Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=xt(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){vp=!1,yp!==null&&Ap(yp)&&(yp=null),bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp.forEach(jp),Cp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,vp||(vp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=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(gp(r||n)===null)continue;break}var a=xt(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}yp!==null&&Np(yp,e),bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp.forEach(t),Cp.forEach(t);for(var n=0;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wp.length&&(n=wp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&wp.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[ft]||null;if(typeof a==`function`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ft]||null)s=o.formAction;else if(gp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){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 Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ap(n,gu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),Cu(),t[pt]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=M();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wp.length&&t!==0&&t<wp[n].priority;n++);wp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==`19.2.7`)throw Error(i(527,Bp,`19.2.7`));O.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:d(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:D,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{He=Hp.inject(Vp),Ue=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=qs,s=Js,c=Ys;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=rp(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[pt]=t.current,Ed(e),new Rp(t)}})),v=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=_()})),y=u(),b=c(f(),1),x=v(),S=e=>Symbol.iterator in e,C=e=>`entries`in e,w=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},T=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function ee(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:S(e)&&S(t)?C(e)&&C(t)?w(e,t):T(e,t):w({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function te(e){let t=b.useRef(void 0);return n=>{let r=e(n);return ee(t.current,r)?t.current:t.current=r}}var E=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},ne=(e=>e?E(e):E),re=e=>e;function ie(e,t=re){let n=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(n),n}var ae=e=>{let t=ne(e),n=e=>ie(t,e);return Object.assign(n,t),n},oe=(e=>e?ae(e):ae);function se(e){return e[0]??{}}function ce(e){return Array.isArray(e)?e:e==null?[]:[e]}function D(e){return typeof e.bytes==`function`?e.bytes():e.arrayBuffer()}var O=`orpc`,le=`@orpc/shared`,ue=`1.14.8`,de=class extends Error{constructor(...e){super(...e),this.name=`AbortError`}};function fe(e){let t=Promise.resolve();return(...n)=>t=t.catch(()=>{}).then(()=>e(...n))}var pe=2,me=`__${le}@${ue}/otel/config__`;function he(){return globalThis[me]}function ge(e,t={},n){return(he()?.tracer)?.startSpan(e,t,n)}function _e(e,t,n={}){if(!e)return;let r=ve(t);e.recordException(r),(!n.signal?.aborted||n.signal.reason!==t)&&e.setStatus({code:pe,message:r.message})}function ve(e){if(e instanceof Error){let t={message:e.message,name:e.name,stack:e.stack};return`code`in e&&(typeof e.code==`string`||typeof e.code==`number`)&&(t.code=e.code),t}return{message:String(e)}}async function ye({name:e,context:t,...n},r){let i=he()?.tracer;if(!i)return r();let a=async e=>{try{return await r(e)}catch(t){throw _e(e,t,n),t}finally{e.end()}};return t?i.startActiveSpan(e,n,t,a):i.startActiveSpan(e,n,a)}async function be(e,t){let n=he();if(!e||!n)return t();let r=n.trace.setSpan(n.context.active(),e);return n.context.with(r,t)}var xe=class{openIds=new Set;queues=new Map;waiters=new Map;get length(){return this.openIds.size}get waiterIds(){return Array.from(this.waiters.keys())}hasBufferedItems(e){return!!this.queues.get(e)?.length}open(e){this.openIds.add(e)}isOpen(e){return this.openIds.has(e)}push(e,t){this.assertOpen(e);let n=this.waiters.get(e);if(n?.length)n.shift()[0](t),n.length===0&&this.waiters.delete(e);else{let n=this.queues.get(e);n?n.push(t):this.queues.set(e,[t])}}async pull(e){this.assertOpen(e);let t=this.queues.get(e);if(t?.length){let n=t.shift();return t.length===0&&this.queues.delete(e),n}return new Promise((t,n)=>{let r=this.waiters.get(e),i=[t,n];r?r.push(i):this.waiters.set(e,[i])})}close({id:e,reason:t}={}){if(e===void 0){this.waiters.forEach((e,n)=>{let r=t??new de(`[AsyncIdQueue] Queue[${n}] was closed or aborted while waiting for pulling.`);e.forEach(([,e])=>e(r))}),this.waiters.clear(),this.openIds.clear(),this.queues.clear();return}let n=t??new de(`[AsyncIdQueue] Queue[${e}] was closed or aborted while waiting for pulling.`);this.waiters.get(e)?.forEach(([,e])=>e(n)),this.waiters.delete(e),this.openIds.delete(e),this.queues.delete(e)}assertOpen(e){if(!this.isOpen(e))throw Error(`[AsyncIdQueue] Cannot access queue[${e}] because it is not open or aborted.`)}};function Se(e){return!e||typeof e!=`object`?!1:`next`in e&&typeof e.next==`function`&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]==`function`}var Ce=Symbol.asyncDispose??Symbol.for(`asyncDispose`),we=class{#e=!1;#t=!1;#n;#r;constructor(e,t){this.#n=t,this.#r=fe(async()=>{if(this.#e)return{done:!0,value:void 0};try{let t=await e();return t.done&&(this.#e=!0),t}catch(e){throw this.#e=!0,e}finally{this.#e&&!this.#t&&(this.#t=!0,await this.#n(`next`))}})}next(){return this.#r()}async return(e){return this.#e=!0,this.#t||(this.#t=!0,await this.#n(`return`)),{done:!0,value:e}}async throw(e){throw this.#e=!0,this.#t||(this.#t=!0,await this.#n(`throw`)),e}async[Ce](){this.#e=!0,this.#t||(this.#t=!0,await this.#n(`dispose`))}[Symbol.asyncIterator](){return this}};function Te({name:e,...t},n){let r;return new we(async()=>{r??=ge(e);try{let e=await be(r,()=>n.next());return r?.addEvent(e.done?`completed`:`yielded`),e}catch(e){throw _e(r,e,t),e}},async e=>{try{e!==`next`&&await be(r,()=>n.return?.())}catch(e){throw _e(r,e,t),e}finally{r?.end()}})}var Ee=class{index=BigInt(1);generate(){let e=this.index.toString(36);return this.index++,e}};function De(e,t,n){let r=(t,i)=>{let a=e[i];return a?a({...t,next:(e=t)=>r(e,i+1)}):n(t)};return r(t,0)}function Oe(e){return JSON.stringify(e)}function ke(e){return Ae(e)?Object.getPrototypeOf(e)?.constructor:null}function k(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function Ae(e){return!!e&&(typeof e==`object`||typeof e==`function`)}function je(e){if(Array.isArray(e))return e.map(je);if(k(e)){let t={};for(let n in e)t[n]=je(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=je(e[n]);return t}return e}function Me(e,...t){return typeof e==`function`?e(...t):e}function Ne(e){return new Proxy(e,{get(e,t,n){let r=Reflect.get(e,t,n);return t!==`then`||typeof r!=`function`?r:new Proxy(r,{apply(t,n,r){if(r.length!==2||r.some(e=>!Pe(e)))return Reflect.apply(t,n,r);let i=!0;r[0].call(n,Ne(new Proxy(e,{get:(e,t,n)=>{if(i&&t===`then`){i=!1;return}return Reflect.get(e,t,n)}})))}})}})}var A=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/;function Pe(e){return typeof e==`function`&&A.test(e.toString())}function Fe(e){try{return decodeURIComponent(e)}catch{return e}}var Ie=`@orpc/client`,Le=`1.14.8`,Re={BAD_REQUEST:{status:400,message:`Bad Request`},UNAUTHORIZED:{status:401,message:`Unauthorized`},FORBIDDEN:{status:403,message:`Forbidden`},NOT_FOUND:{status:404,message:`Not Found`},METHOD_NOT_SUPPORTED:{status:405,message:`Method Not Supported`},NOT_ACCEPTABLE:{status:406,message:`Not Acceptable`},TIMEOUT:{status:408,message:`Request Timeout`},CONFLICT:{status:409,message:`Conflict`},PRECONDITION_FAILED:{status:412,message:`Precondition Failed`},PAYLOAD_TOO_LARGE:{status:413,message:`Payload Too Large`},UNSUPPORTED_MEDIA_TYPE:{status:415,message:`Unsupported Media Type`},UNPROCESSABLE_CONTENT:{status:422,message:`Unprocessable Content`},TOO_MANY_REQUESTS:{status:429,message:`Too Many Requests`},CLIENT_CLOSED_REQUEST:{status:499,message:`Client Closed Request`},INTERNAL_SERVER_ERROR:{status:500,message:`Internal Server Error`},NOT_IMPLEMENTED:{status:501,message:`Not Implemented`},BAD_GATEWAY:{status:502,message:`Bad Gateway`},SERVICE_UNAVAILABLE:{status:503,message:`Service Unavailable`},GATEWAY_TIMEOUT:{status:504,message:`Gateway Timeout`}};function ze(e,t){return t??Re[e]?.status??500}function Be(e,t){return t||Re[e]?.message||e}var Ve,He=class e extends Error{defined;code;status;data;static{let t=Symbol.for(`__${Ie}@${Le}/error/ORPC_ERROR_CONSTRUCTORS__`);globalThis[t]??=new WeakSet,Ve=globalThis[t],Ve.add(e)}constructor(e,...t){let n=se(t);if(n.status!==void 0&&!We(n.status))throw Error(`[ORPCError] Invalid error status code.`);let r=Be(e,n.message);super(r,n),this.code=e,this.status=ze(e,n.status),this.defined=n.defined??!1,this.data=n.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(Ve.has(this)){let t=ke(e);if(t&&Ve.has(t))return!0}return super[Symbol.hasInstance](e)}};function Ue(e){return e instanceof He?e:new He(`INTERNAL_SERVER_ERROR`,{message:`Internal server error`,cause:e})}function We(e){return e<200||e>=400}function Ge(e){if(!k(e))return!1;let t=[`defined`,`code`,`status`,`message`,`data`];return!Object.keys(e).some(e=>!t.includes(e))&&`defined`in e&&typeof e.defined==`boolean`&&`code`in e&&typeof e.code==`string`&&`status`in e&&typeof e.status==`number`&&We(e.status)&&`message`in e&&typeof e.message==`string`}function Ke(e,t={}){return new He(e.code,{...t,...e})}var qe=class extends TypeError{},Je=class extends Error{data;constructor(e){super(e?.message??`An error event was received`,e),this.data=e?.data}};TransformStream;function Ye(e){if(e.includes(`
10
+ `))throw new qe(`Event's id must not contain a newline character`)}function Xe(e){if(!Number.isInteger(e)||e<0)throw new qe(`Event's retry must be a integer and >= 0`)}function Ze(e){if(e.includes(`
11
+ `))throw new qe(`Event's comment must not contain a newline character`)}var Qe=Symbol(`ORPC_EVENT_SOURCE_META`);function $e(e,t){if(t.id===void 0&&t.retry===void 0&&!t.comments?.length)return e;if(t.id!==void 0&&Ye(t.id),t.retry!==void 0&&Xe(t.retry),t.comments!==void 0)for(let e of t.comments)Ze(e);return new Proxy(e,{get(e,n,r){return n===Qe?t:Reflect.get(e,n,r)}})}function et(e){return Ae(e)?Reflect.get(e,Qe):void 0}function tt(e,t=`inline`){return`${t}; filename="${e.replace(/[^\x20-\x7E]/g,`_`).replace(/"/g,`\\"`)}"; filename*=utf-8''${encodeURIComponent(e).replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(e,t)=>String.fromCharCode(Number.parseInt(t,16)))}`}function nt(e){let t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&typeof t[2]==`string`)return Fe(t[2]);let n=e.match(/filename="((?:\\"|[^"])*)"/i);if(n&&typeof n[1]==`string`)return n[1].replace(/\\"/g,`"`)}function rt(e,t){let n={...e};for(let e in t)Array.isArray(t[e])?n[e]=[...ce(n[e]),...t[e]]:t[e]!==void 0&&(Array.isArray(n[e])?n[e]=[...n[e],t[e]]:n[e]===void 0?n[e]=t[e]:n[e]=[n[e],t[e]]);return n}function it(e){if(typeof e==`string`||e===void 0)return e;if(e.length!==0)return e.join(`, `)}function at(e){return!!(it(e[`content-type`])?.startsWith(`text/event-stream`)&&it(e[`content-disposition`])===void 0)}function ot(e,t){let n=async e=>{let n=await t.error(e);if(n!==e){let t=et(e);t&&Ae(n)&&(n=$e(n,t))}return n};return new we(async()=>{let{done:r,value:i}=await(async()=>{try{return await e.next()}catch(e){throw await n(e)}})(),a=await t.value(i,r);if(a!==i){let e=et(i);e&&Ae(a)&&(a=$e(a,e))}return{done:r,value:a}},async()=>{try{await e.return?.()}catch(e){throw await n(e)}})}function j(e){return{...e,context:e.context??{}}}function st(e,t={}){let n=t.path??[];return Ne(new Proxy(async(...[t,r={}])=>await e.call(n,t,j(r)),{get(r,i){return typeof i==`string`?st(e,{...t,path:[...n,i]}):Reflect.get(r,i)}}))}var ct=/^http:\/\/orpc\//,lt=(e=>(e[e.REQUEST=1]=`REQUEST`,e[e.RESPONSE=2]=`RESPONSE`,e[e.EVENT_ITERATOR=3]=`EVENT_ITERATOR`,e[e.ABORT_SIGNAL=4]=`ABORT_SIGNAL`,e))(lt||{});function M(e,t,n){if(t===3){let r=n;return{i:e,t,p:{e:r.event,d:r.data,m:r.meta}}}if(t===4)return{i:e,t,p:n};let r=n;return{i:e,p:{u:r.url.toString().replace(ct,`/`),b:r.body,h:Object.keys(r.headers).length>0?r.headers:void 0,m:r.method===`POST`?void 0:r.method}}}function ut(e){let t=e.i,n=e.t;if(n===3){let r=e.p;return[t,n,{event:r.e,data:r.d,meta:r.m}]}if(n===4)return[t,n,e.p];let r=e.p;return[t,2,{status:r.s??200,headers:r.h??{},body:r.b}]}async function dt(e,t,n){if(t===3||t===4)return ht(M(e,t,n));let r=n,{body:i,headers:a}=await ft(r.body,r.headers),o=M(e,1,{...r,body:i instanceof Blob?void 0:i,headers:a});return i instanceof Blob?ht(o,i):ht(o)}async function N(e){let{json:t,buffer:n}=await gt(e),[r,i,a]=ut(t);if(i===3||i===4)return[r,i,a];let o=a,s=await pt(o.headers,o.body,n);return[r,i,{...o,body:s}]}async function ft(e,t){let n={...t},r=n[`content-disposition`];if(delete n[`content-type`],delete n[`content-disposition`],e instanceof Blob)return n[`content-type`]=e.type,n[`content-disposition`]=r??tt(e instanceof File?e.name:`blob`),{body:e,headers:n};if(e instanceof FormData){let t=new Response(e);return n[`content-type`]=t.headers.get(`content-type`),{body:await t.blob(),headers:n}}return e instanceof URLSearchParams?(n[`content-type`]=`application/x-www-form-urlencoded`,{body:e.toString(),headers:n}):Se(e)?(n[`content-type`]=`text/event-stream`,{body:void 0,headers:n}):{body:e,headers:n}}async function pt(e,t,n){let r=it(e[`content-type`]),i=it(e[`content-disposition`]);if(typeof i==`string`){let e=nt(i)??`blob`;return new File(n===void 0?[]:[n],e,{type:r})}return r?.startsWith(`multipart/form-data`)?new Response(n,{headers:{"content-type":r}}).formData():r?.startsWith(`application/x-www-form-urlencoded`)&&typeof t==`string`?new URLSearchParams(t):t}var mt=255;async function ht(e,t){let n=Oe(e);return t===void 0||t.size===0?n:D(new Blob([new TextEncoder().encode(n),new Uint8Array([mt]),t]))}async function gt(e){if(typeof e==`string`)return{json:JSON.parse(e)};let t=e instanceof Uint8Array?e:new Uint8Array(e),n=t.indexOf(mt);if(n===-1){let e=new TextDecoder().decode(t);return{json:JSON.parse(e)}}let r=new TextDecoder().decode(t.subarray(0,n)),i=t.subarray(n+1);return{json:JSON.parse(r),buffer:i}}function _t(e,t,n,r={}){let i;return new we(async()=>{i??=ge(`consume_event_iterator_stream`);try{let n=await be(i,()=>e.pull(t));switch(n.event){case`message`:{let e=n.data;return n.meta&&Ae(e)&&(e=$e(e,n.meta)),i?.addEvent(`message`),{value:e,done:!1}}case`error`:{let e=new Je({data:n.data});throw n.meta&&(e=$e(e,n.meta)),i?.addEvent(`error`),e}case`done`:{let e=n.data;return n.meta&&Ae(e)&&(e=$e(e,n.meta)),i?.addEvent(`done`),{value:e,done:!0}}}}catch(e){throw e instanceof Je||_e(i,e,r),e}},async e=>{try{e!==`next`&&i?.addEvent(`cancelled`),await be(i,()=>n(e))}catch(e){throw _e(i,e,r),e}finally{i?.end()}})}function vt(e,t){return ye({name:`stream_event_iterator`},async n=>{for(;;){let r=await(async()=>{try{let{value:t,done:r}=await e.next();return r?(n?.addEvent(`done`),{event:`done`,data:t,meta:et(t)}):(n?.addEvent(`message`),{event:`message`,data:t,meta:et(t)})}catch(e){if(e instanceof Je)return n?.addEvent(`error`),{event:`error`,data:e.data,meta:et(e)};try{await t({event:`error`,data:void 0})}catch(t){throw _e(n,e),t}throw e}})(),i=!1;try{let n=await t(r);if(r.event===`done`||r.event===`error`)return;if(n===`abort`){i=!0,await e.return?.();return}}catch(t){if(!i)try{await e.return?.()}catch(e){throw _e(n,t),e}throw t}}})}var yt=class{peer;constructor(e){this.peer=new bt(async([t,n,r])=>{await e(await dt(t,n,r))})}get length(){return this.peer.length}open(e){return this.peer.open(e)}async request(e){return this.peer.request(e)}async message(e){return this.peer.message(await N(e))}close(e={}){return this.peer.close(e)}},bt=class{idGenerator=new Ee;responseQueue=new xe;serverEventIteratorQueue=new xe;serverControllers=new Map;cleanupFns=new Map;send;constructor(e){this.send=async t=>{let n=t[0];this.serverControllers.has(n)&&await e(t)}}get length(){return(+this.responseQueue.length+this.serverEventIteratorQueue.length+this.serverControllers.size+this.cleanupFns.size)/4}open(e){this.serverEventIteratorQueue.open(e),this.responseQueue.open(e);let t=new AbortController;return this.serverControllers.set(e,t),this.cleanupFns.set(e,[]),t}async request(e){let t=e.signal;return ye({name:`send_peer_request`,signal:t},async()=>{if(t?.aborted)throw t.reason;let n=this.idGenerator.generate(),r=this.open(n);try{let i=he();if(i){let t=je(e.headers);i.propagation.inject(i.context.active(),t),e={...e,headers:t}}if(await this.send([n,lt.REQUEST,e]),t?.aborted)throw await this.send([n,lt.ABORT_SIGNAL,void 0]),t.reason;let a;if(t?.addEventListener(`abort`,a=async()=>{await this.send([n,lt.ABORT_SIGNAL,void 0]),this.close({id:n,reason:t.reason})},{once:!0}),this.cleanupFns.get(n)?.push(()=>{t?.removeEventListener(`abort`,a)}),Se(e.body)){let t=e.body;vt(t,async e=>r.signal.aborted?`abort`:(await this.send([n,lt.EVENT_ITERATOR,e]),`next`))}let o=await this.responseQueue.pull(n);if(at(o.headers)){let e=_t(this.serverEventIteratorQueue,n,async e=>{try{e!==`next`&&await this.send([n,lt.ABORT_SIGNAL,void 0])}finally{this.close({id:n})}},{signal:t});return{...o,body:e}}return this.close({id:n}),o}catch(e){throw this.close({id:n,reason:e}),e}})}async message([e,t,n]){if(t===lt.ABORT_SIGNAL){this.serverControllers.get(e)?.abort();return}if(t===lt.EVENT_ITERATOR){this.serverEventIteratorQueue.isOpen(e)&&this.serverEventIteratorQueue.push(e,n);return}this.responseQueue.isOpen(e)&&this.responseQueue.push(e,n)}close(e={}){e.id===void 0?(this.serverControllers.forEach(t=>t.abort(e.reason)),this.serverControllers.clear(),this.cleanupFns.forEach(e=>e.forEach(e=>e())),this.cleanupFns.clear()):(this.serverControllers.get(e.id)?.abort(e.reason),this.serverControllers.delete(e.id),this.cleanupFns.get(e.id)?.forEach(e=>e()),this.cleanupFns.delete(e.id)),this.responseQueue.close(e),this.serverEventIteratorQueue.close(e)}};function xt(e,t={}){return e.forEach((e,n)=>{Array.isArray(t[n])?t[n].push(e):t[n]===void 0?t[n]=e:t[n]=[t[n],e]}),t}var St=class{plugins;constructor(e=[]){this.plugins=[...e].sort((e,t)=>(e.order??0)-(t.order??0))}init(e){for(let t of this.plugins)t.init?.(e)}},P=class{constructor(e,t,n={}){this.codec=e,this.sender=t,new St(n.plugins).init(n),this.interceptors=ce(n.interceptors),this.clientInterceptors=ce(n.clientInterceptors)}interceptors;clientInterceptors;call(e,t,n){return ye({name:`${O}.${e.join(`/`)}`,signal:n.signal},r=>(r?.setAttribute(`rpc.system`,O),r?.setAttribute(`rpc.method`,e.join(`.`)),Se(t)&&(t=Te({name:`consume_event_iterator_input`,signal:n.signal},t)),De(this.interceptors,{...n,path:e,input:t},async({path:e,input:t,...n})=>{let i=he(),a,o=i?.trace.getActiveSpan()??r;o&&i&&(a=i?.trace.setSpan(i.context.active(),o));let s=await ye({name:`encode_request`,context:a},()=>this.codec.encode(e,t,n)),c=await De(this.clientInterceptors,{...n,input:t,path:e,request:s},({input:e,path:t,request:n,...r})=>ye({name:`send_request`,signal:r.signal,context:a},()=>this.sender.call(n,r,t,e))),l=await ye({name:`decode_response`,context:a},()=>this.codec.decode(c,n,e,t));return Se(l)?Te({name:`consume_event_iterator_output`,signal:n.signal},l):l})))}},F={BIGINT:0,DATE:1,NAN:2,UNDEFINED:3,URL:4,REGEXP:5,SET:6,MAP:7},Ct=class{customSerializers;constructor(e={}){if(this.customSerializers=e.customJsonSerializers??[],this.customSerializers.length!==new Set(this.customSerializers.map(e=>e.type)).size)throw Error(`Custom serializer type must be unique.`)}serialize(e,t=[],n=[],r=[],i=[]){for(let a of this.customSerializers)if(a.condition(e)){let o=this.serialize(a.serialize(e),t,n,r,i);return n.push([a.type,...t]),o}if(e instanceof Blob)return r.push(t),i.push(e),[e,n,r,i];if(typeof e==`bigint`)return n.push([F.BIGINT,...t]),[e.toString(),n,r,i];if(e instanceof Date)return n.push([F.DATE,...t]),Number.isNaN(e.getTime())?[null,n,r,i]:[e.toISOString(),n,r,i];if(Number.isNaN(e))return n.push([F.NAN,...t]),[null,n,r,i];if(e instanceof URL)return n.push([F.URL,...t]),[e.toString(),n,r,i];if(e instanceof RegExp)return n.push([F.REGEXP,...t]),[e.toString(),n,r,i];if(e instanceof Set){let a=this.serialize(Array.from(e),t,n,r,i);return n.push([F.SET,...t]),a}if(e instanceof Map){let a=this.serialize(Array.from(e.entries()),t,n,r,i);return n.push([F.MAP,...t]),a}if(Array.isArray(e))return[e.map((e,a)=>e===void 0?(n.push([F.UNDEFINED,...t,a]),null):this.serialize(e,[...t,a],n,r,i)[0]),n,r,i];if(k(e)){let a={};for(let o in e)o===`toJSON`&&typeof e[o]==`function`||(a[o]=this.serialize(e[o],[...t,o],n,r,i)[0]);return[a,n,r,i]}return[e,n,r,i]}deserialize(e,t,n,r){let i={data:e};n&&r&&n.forEach((e,t)=>{let n=i,a=`data`;e.forEach(e=>{if(n=n[a],a=e,!Object.hasOwn(n,a))throw Error(`Security error: accessing non-existent path during deserialization. Path segment: ${a}`)}),n[a]=r(t)});for(let e of t){let t=e[0],n=i,r=`data`;for(let t=1;t<e.length;t++)if(n=n[r],r=e[t],!Object.hasOwn(n,r))throw Error(`Security error: accessing non-existent path during deserialization. Path segment: ${r}`);for(let e of this.customSerializers)if(e.type===t){n[r]=e.deserialize(n[r]);break}switch(t){case F.BIGINT:n[r]=BigInt(n[r]);break;case F.DATE:n[r]=new Date(n[r]??`Invalid Date`);break;case F.NAN:n[r]=NaN;break;case F.UNDEFINED:n[r]=void 0;break;case F.URL:n[r]=new URL(n[r]);break;case F.REGEXP:{let[,e,t]=n[r].match(/^\/(.*)\/([a-z]*)$/);n[r]=new RegExp(e,t);break}case F.SET:n[r]=new Set(n[r]);break;case F.MAP:n[r]=new Map(n[r]);break}}return i.data}};function wt(e){return`/${e.map(encodeURIComponent).join(`/`)}`}function Tt(e){return typeof e.forEach==`function`?xt(e):e}function Et(e){return Object.entries(Re).find(([,t])=>t.status===e)?.[0]??`MALFORMED_ORPC_ERROR_RESPONSE`}var Dt=class{constructor(e,t){this.serializer=e,this.baseUrl=t.url,this.maxUrlLength=t.maxUrlLength??2083,this.fallbackMethod=t.fallbackMethod??`POST`,this.expectedMethod=t.method??this.fallbackMethod,this.headers=t.headers??{}}baseUrl;maxUrlLength;fallbackMethod;expectedMethod;headers;async encode(e,t,n){let r=Tt(await Me(this.headers,n,e,t));n.lastEventId!==void 0&&(r=rt(r,{"last-event-id":n.lastEventId}));let i=await Me(this.expectedMethod,n,e,t),a=await Me(this.baseUrl,n,e,t),o=new URL(a);o.pathname=`${o.pathname.replace(/\/$/,``)}${wt(e)}`;let s=this.serializer.serialize(t);if(i===`GET`&&!(s instanceof FormData)&&!Se(s)){let a=await Me(this.maxUrlLength,n,e,t),c=new URL(o);if(c.searchParams.append(`data`,Oe(s)),c.toString().length<=a)return{body:void 0,method:i,headers:r,url:c,signal:n.signal}}return{url:o,method:i===`GET`?this.fallbackMethod:i,headers:r,body:s,signal:n.signal}}async decode(e){let t=!We(e.status),n=await(async()=>{let t=!1;try{let n=await e.body();return t=!0,this.serializer.deserialize(n)}catch(e){throw Error(t?`Invalid RPC response format.`:`Cannot parse response body, please check the response body and content-type.`,{cause:e})}})();if(!t)throw Ge(n)?Ke(n):new He(Et(e.status),{status:e.status,data:{...e,body:n}});return n}},Ot=class{constructor(e){this.jsonSerializer=e}serialize(e){return Se(e)?ot(e,{value:async e=>this.#e(e,!1),error:async e=>new Je({data:this.#e(Ue(e).toJSON(),!1),cause:e})}):this.#e(e,!0)}#e(e,t){let[n,r,i,a]=this.jsonSerializer.serialize(e),o=r.length===0?void 0:r;if(!t||a.length===0)return{json:n,meta:o};let s=new FormData;return s.set(`data`,Oe({json:n,meta:o,maps:i})),a.forEach((e,t)=>{s.set(t.toString(),e)}),s}deserialize(e){return Se(e)?ot(e,{value:async e=>this.#t(e),error:async e=>{if(!(e instanceof Je))return e;let t=this.#t(e.data);return Ge(t)?Ke(t,{cause:e}):new Je({data:t,cause:e})}}):this.#t(e)}#t(e){if(e===void 0)return;if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e.json,e.meta??[]);let t=JSON.parse(e.get(`data`));return this.jsonSerializer.deserialize(t.json,t.meta??[],t.maps,t=>e.get(t.toString()))}},kt=class extends P{constructor(e,t){let n=new Dt(new Ot(new Ct(t)),t);super(n,e,t)}},At=0,jt=1,Mt=class{peer;constructor(e){this.peer=new yt(async t=>{if(e.websocket.readyState===At&&await new Promise(t=>{let n=()=>{e.websocket.removeEventListener(`open`,n),e.websocket.removeEventListener(`close`,n),t()};e.websocket.addEventListener(`open`,n,{once:!0}),e.websocket.addEventListener(`close`,n,{once:!0})}),e.websocket.readyState!==jt)throw Error(`Cannot send message, WebSocket is not open.`);return e.websocket.send(t)}),e.websocket.addEventListener(`message`,async e=>{let t=e.data instanceof Blob?await D(e.data):e.data;this.peer.message(t)}),e.websocket.addEventListener(`close`,()=>{this.peer.close()})}async call(e,t,n,r){let i=await this.peer.request(e);return{...i,body:()=>Promise.resolve(i.body)}}},Nt=class extends kt{constructor(e){let t=new Mt(e);super(t,{...e,url:`http://orpc`})}},Pt=null,Ft=null;function It(){return`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}/rpc`}function I(){if(Pt&&Ft&&Ft.readyState<=WebSocket.OPEN)return Pt;let e=new WebSocket(It());return e.addEventListener(`close`,()=>{Ft===e&&(Ft=null,Pt=null)}),Ft=e,Pt=st(new Nt({websocket:e})),Pt}function Lt(e){return e instanceof Error&&/AsyncIdQueue|closed or aborted|WebSocket/i.test(e.message)}function Rt(e){return I().openRepo(e)}async function zt(e){let t=await I().openTerminal({repoId:e});if(!t.ok)throw Error(t.error??`Could not open a terminal`)}function Bt(){return I().getRecentRepos({})}function Vt(e){return I().discoverRepos({folder:e})}function Ht(e){return I().listDirectory({folder:e})}function Ut(e){return I().getRefs({repoId:e})}function Wt(e){return I().getWorktrees({repoId:e})}function Gt(e){return I().getWorktreeChanges({repoId:e})}function Kt(e){return I().getStashes({repoId:e})}function qt(e,t){return I().getStashDiff({repoId:e,stashSha:t})}function Jt(e,t,n,r){return I().getStashFileDiff({repoId:e,stashSha:t,path:n,oldPath:r})}function Yt(e,t){return I().stashAction({repoId:e,action:`create`,message:t})}function Xt(e,t){return I().stashAction({repoId:e,action:`apply`,stashSha:t})}function Zt(e,t){return I().stashAction({repoId:e,action:`drop`,stashSha:t})}function Qt(e,t,n){return I().stageAction({repoId:e,action:t,paths:n})}function $t(e,t,n,r){return I().getWorktreeFileDiff({repoId:e,path:t,area:n,oldPath:r})}function en(e,t,n,r){return I().commit({repoId:e,message:t,noVerify:n,amend:r})}function tn(e,t){return I().queryHistory(t)}function nn(e,t){return I().getCommitDetail({repoId:e,sha:t})}function rn(e,t){return I().getCommitAuthor({repoId:e,sha:t})}function an(e,t){return I().getCommitDiff({repoId:e,sha:t})}function on(e,t,n,r){return I().getCommitFileDiff({repoId:e,sha:t,path:n,oldPath:r})}function sn(e,t){return I().getCommitPRs({repoId:e,sha:t})}function cn(e,t){return I().getCommitCIStatuses({repoId:e,shas:t})}function ln(e,t,n){return I().commitAction({repoId:e,action:t,sha:n})}function un(e,t){return I().getMergePreview({repoId:e,refName:t})}function dn(e,t){return I().mergeRef({repoId:e,refName:t})}function fn(e,t){return I().rebaseRef({repoId:e,refName:t})}function pn(e,t){return I().abortOperation({repoId:e,operation:t})}function mn(e,t){return I().continueOperation({repoId:e,operation:t})}function hn(e,t,n,r,i){return I().refAction({repoId:e,action:t,refName:n,sha:r,force:i})}function gn(e,t,n){return I().getReflog({repoId:e,ref:t,maxCount:n})}function _n(){return I().listAgentSessions({})}function vn(e,t){return I().focusAgentSession({pid:e,cwd:t})}function yn(){return I().installWindowCalls({})}var bn=class{activeLanes=new Map;reserved=new Map;nextSideFromCenter=`right`;constructor(e){}reserveLane(e,t){this.reserved.set(e,t),this.activeLanes.set(t,e)}assignLane(e,t){let n=this.reserved.get(e);if(n!==void 0)this.reserved.delete(e),this.activeLanes.set(n,e);else{let r=t[0],i=r?this.reserved.get(r):void 0;n=i===void 0?this.findFreeLane():this.findFreeLaneNear(i),this.activeLanes.set(n,e)}if(t.length===0)return this.activeLanes.delete(n),n;let r=t[0];this.reserved.has(r)?this.reserved.get(r)===n?this.activeLanes.set(n,r):this.activeLanes.delete(n):(this.reserved.set(r,n),this.activeLanes.set(n,r));for(let e=1;e<t.length;e++){let n=t[e];if(!this.reserved.has(n)){let e=this.findFreeLaneOutsideCluster();this.reserved.set(n,e),this.activeLanes.set(e,n)}}return n}findFreeLane(){if(!this.activeLanes.has(0))return 0;for(let e=1;;e++){let t=this.activeLanes.has(-e)?void 0:-e,n=this.activeLanes.has(e)?void 0:e;if(!(t===void 0&&n===void 0))return this.pickLaneFromCenter(t,n)}}findFreeLaneNear(e){for(let t=1;;t++){let n=e-t,r=e+t,i=!this.activeLanes.has(n),a=!this.activeLanes.has(r);if(!(!i&&!a))return e<0?i?n:r:e>0?a?r:n:this.pickLaneFromCenter(i?n:void 0,a?r:void 0)}}findFreeLaneOutsideCluster(){if(this.activeLanes.size===0)return this.findFreeLane();let e=1/0,t=-1/0;for(let n of this.activeLanes.keys())n<e&&(e=n),n>t&&(t=n);return this.pickLaneFromCenter(e-1,t+1)}pickLaneFromCenter(e,t){if(e===void 0&&t===void 0)throw Error(`pickLaneFromCenter requires at least one candidate lane`);if(e===void 0)return this.recordChosenSide(`right`),t;if(t===void 0)return this.recordChosenSide(`left`),e;let n=this.sideLoad(`left`),r=this.sideLoad(`right`);if(n<r)return this.recordChosenSide(`left`),e;if(r<n)return this.recordChosenSide(`right`),t;let i=this.nextSideFromCenter;return this.recordChosenSide(i),i===`left`?e:t}sideLoad(e){let t=0;for(let n of this.activeLanes.keys())e===`left`&&n<0&&t++,e===`right`&&n>0&&t++;return t}recordChosenSide(e){this.nextSideFromCenter=e===`left`?`right`:`left`}snapshot(){return{activeLanes:[...this.activeLanes.entries()].sort((e,t)=>e[0]-t[0]).map(([e,t])=>({lane:e,sha:t})),nextSideFromCenter:this.nextSideFromCenter}}restore(e){this.activeLanes=new Map,this.reserved=new Map,this.nextSideFromCenter=e.nextSideFromCenter;for(let t of e.activeLanes)this.activeLanes.set(t.lane,t.sha),this.reserved.set(t.sha,t.lane)}};function xn(e,t){let n=t===void 0?void 0:Math.max(0,Math.floor(t));if(n===0)return new Map(e.map(e=>[e.sha,0]));let r=Sn(e),i=new Map(r.map(e=>[e.id,e])),a=wn(r,i,n),o=new Map;for(let e of r)if(e.lane===0)for(let t of e.shas)o.set(t,0);return On(r.filter(e=>a.get(e.id)===`left`),`left`,o,i,n),On(r.filter(e=>a.get(e.id)===`right`),`right`,o,i,n),o}function Sn(e){let t=new Map(e.map(e=>[e.sha,e])),n=new Map(e.map(e=>[e.sha,e.sha])),r=e=>{let t=n.get(e);if(t===e)return e;let i=r(t);return n.set(e,i),i},i=(e,t)=>{let i=r(e),a=r(t);i!==a&&n.set(a,i)};for(let n of e){let e=n.parentShas[0],r=e?t.get(e):void 0;r?.lane===n.lane&&i(n.sha,r.sha)}let a=new Map;for(let n of e){let e=r(n.sha),i=a.get(e);i||(i={id:e,lane:n.lane,shas:[],startRow:n.row,endRow:n.row,continuity:0,maxConcurrency:1},a.set(e,i)),i.shas.push(n.sha),i.startRow=Math.min(i.startRow,n.row),i.endRow=Math.max(i.endRow,n.row);let o=n.parentShas[0],s=o?t.get(o):void 0;s&&(i.continuity+=Math.abs(s.row-n.row),s.lane!==n.lane&&Cn(i,s.row))}for(let n of e)for(let e of n.parentShas.slice(1)){let i=t.get(e);if(!i)continue;let o=a.get(r(i.sha));o&&(o.continuity+=Math.abs(i.row-n.row),Cn(o,n.row))}for(let n of e){let e=n.parentShas[0],i=e?t.get(e):void 0;if(!i)continue;let o=a.get(r(n.sha)),s=a.get(r(i.sha));o&&s&&o.id!==s.id&&o.lane!==0&&s.lane!==0&&(o.inwardSegmentId??=s.id)}return[...a.values()]}function Cn(e,t){e.startRow=Math.min(e.startRow,t),e.endRow=Math.max(e.endRow,t)}function wn(e,t,n){let r=new Map,i=new Set,a=e=>{let n=r.get(e.id);if(n)return n;if(i.has(e.id))return e.lane<0?`left`:`right`;i.add(e.id);let o=e.inwardSegmentId?t.get(e.inwardSegmentId):void 0,s=o&&o.lane!==0?a(o):e.lane<0?`left`:`right`;return i.delete(e.id),r.set(e.id,s),s};for(let t of e)t.lane!==0&&a(t);return n!==void 0&&Tn(e,t,n,r),r}function Tn(e,t,n,r){let i={left:new Map,right:new Map},a=new Map,o=new Set,s=e=>{let n=a.get(e.id);if(n)return n;if(o.has(e.id))return e.id;o.add(e.id);let r=e.inwardSegmentId?t.get(e.inwardSegmentId):void 0,i=r&&r.lane!==0?s(r):e.id;return o.delete(e.id),a.set(e.id,i),i},c=new Map;for(let t of e){if(t.lane===0)continue;let e=s(t),n=c.get(e);n?n.push(t):c.set(e,[t])}let l=[...c.entries()].sort((e,n)=>{let r=e[1].reduce((e,t)=>e+t.continuity,0);return n[1].reduce((e,t)=>e+t.continuity,0)-r||kn(t.get(e[0]),t.get(n[0]))});for(let[e,a]of l){let o=t.get(e).lane<0?`left`:`right`,s=o===`left`?`right`:`left`,c=En(a,i[o],n),l=En(a,i[s],n)<c?s:o;for(let e of a)r.set(e.id,l);Dn(a,i[l],n)}}function En(e,t,n){return Dn(e,new Map([...t].map(([e,t])=>[e,[...t]])),n)}function Dn(e,t,n){let r=0;for(let i of[...e].sort(kn)){let e=Nn(i,t,n,Math.min(Math.abs(i.lane),n)),a=t.get(e)??[];r+=a.reduce((e,t)=>e+Ln(i,t),0),a.length>0?a.push(i):t.set(e,[i])}return r}function On(e,t,n,r,i){if(e.length===0)return;let a=new Map,o=new Map,s=e.filter(e=>{let t=e.inwardSegmentId?r.get(e.inwardSegmentId):void 0;return t!==void 0&&t.lane!==0}),c=new Set(s.map(e=>e.id)),l=e.filter(e=>!c.has(e.id));An(l);let u=i??Math.max(0,...l.map(e=>Math.abs(e.lane))),d=[...l].sort(kn);for(let e of d){let r=i===void 0?e.maxConcurrency:Math.min(e.maxConcurrency,u),s=Fn(e,a,r,1,-1);s===void 0&&(s=Fn(e,a,r+1,u,1)),s??=i===void 0?Math.abs(e.lane):Nn(e,a,u,Math.min(Math.abs(e.lane),u)),jn(e,s,t,n,a,o)}let f=new Set(s);for(;f.size>0;){let e=[...f].filter(e=>e.inwardSegmentId!==void 0&&o.has(e.inwardSegmentId)).sort((e,t)=>o.get(e.inwardSegmentId)-o.get(t.inwardSegmentId)||e.continuity-t.continuity||e.endRow-e.startRow-(t.endRow-t.startRow)||e.startRow-t.startRow||e.id.localeCompare(t.id));if(e.length===0){for(let e of f){let r=Math.max(1,Math.abs(e.lane));jn(e,i===void 0?Pn(e,a,r):Mn(e,a,i,Math.min(r,i)),t,n,a,o)}break}for(let r of e){let e=o.get(r.inwardSegmentId);jn(r,i===void 0?Pn(r,a,e+1):Mn(r,a,i,Math.min(e+1,i),e),t,n,a,o),f.delete(r)}}}function kn(e,t){return t.continuity-e.continuity||t.endRow-t.startRow-(e.endRow-e.startRow)||e.startRow-t.startRow||Math.abs(e.lane)-Math.abs(t.lane)||e.id.localeCompare(t.id)}function An(e){let t=[...e].sort((e,t)=>e.startRow-t.startRow),n=[];for(let e of t){n=n.filter(t=>t.endRow>=e.startRow),n.push(e);let t=n.length;for(let e of n)e.maxConcurrency=Math.max(e.maxConcurrency,t)}}function jn(e,t,n,r,i,a){let o=i.get(t);o?o.push(e):i.set(t,[e]),a.set(e.id,t);let s=n===`left`?-t:t;for(let t of e.shas)r.set(t,s)}function Mn(e,t,n,r,i){let a=Fn(e,t,r,n,1);return a===i&&(a=void 0),a===void 0&&(a=Fn(e,t,1,r-1,1),a===i&&(a=void 0)),a??Nn(e,t,n,r,i)}function Nn(e,t,n,r,i){let a=1,o=1/0,s=1/0;for(let c=1;c<=n;c++){if(n>1&&c===i)continue;let l=(t.get(c)??[]).reduce((t,n)=>t+Ln(e,n),0),u=Math.abs(c-r);(l<o||l===o&&u<s||l===o&&u===s&&c<a)&&(a=c,o=l,s=u)}return a}function Pn(e,t,n){for(let r=n;;r++)if((t.get(r)??[]).every(t=>!In(e,t)))return r}function Fn(e,t,n,r,i){for(let a=n;i>0?a<=r:a>=r;a+=i)if((t.get(a)??[]).every(t=>!In(e,t)))return a}function In(e,t){return e.startRow<=t.endRow&&t.startRow<=e.endRow}function Ln(e,t){let n=Math.max(e.startRow,t.startRow),r=Math.min(e.endRow,t.endRow);return r<n?0:r-n+1}function Rn(e,t,n){let r=[];for(let{sha:i,parentShas:a,row:o,lane:s}of e)for(let e=0;e<a.length;e++){let i=a[e],c=t.get(i)??-1,l=n.get(i)??s,u;u=e===0?s===l?`linear`:`fork`:`merge`,r.push({fromRow:o,toRow:c,fromLane:s,toLane:l,kind:u})}return r}var zn=class{id;repoId;scope;ordering;entries=[];shaIndex=new Map;constructor(e,t,n,r){this.id=e,this.repoId=t,this.scope=n,this.ordering=r}appendEntries(e){let t=this.entries.length;for(let n=0;n<e.length;n++){let{sha:r,parentShas:i}=e[n],a=t+n;this.entries.push({sha:r,parentShas:i,row:a}),this.shaIndex.set(r,a)}}getWindow(e,t,n){let r=Math.max(0,e-t),i=Math.min(this.entries.length-1,e+n);return{entries:this.entries.slice(r,i+1),startRow:r,endRow:i}}findRow(e){return this.shaIndex.get(e)}totalRows(){return this.entries.length}getKnownParentShas(e){return e.filter(e=>this.shaIndex.has(e))}checkpoint(e=256){let t=[],n=new bn;for(let r=0;r<this.entries.length;r++){let i=this.entries[r];r%e===0&&t.push({row:i.row,sha:i.sha,laneSnapshot:n.snapshot()}),n.assignLane(i.sha,this.getKnownParentShas(i.parentShas))}return t}restoreFrom(e,t){t.restore(e.laneSnapshot)}computeGeometry(e,t,n,r){let i=Math.max(0,e),a=Math.min(this.entries.length-1,t),o=new bn;if(r){let e=r;for(;e!==void 0;){o.reserveLane(e,0);let t=this.shaIndex.get(e);if(t===void 0)break;let n=this.entries[t];e=n.parentShas.length>0?n.parentShas[0]:void 0}}let s=0;n&&n.row<=i&&(this.restoreFrom(n,o),s=n.row);for(let e=s;e<i;e++){let t=this.entries[e];o.assignLane(t.sha,this.getKnownParentShas(t.parentShas))}let c=new Map,l=[];for(let e=i;e<=a;e++){let t=this.entries[e],n=o.assignLane(t.sha,this.getKnownParentShas(t.parentShas));c.set(t.sha,n),l.push({sha:t.sha,parentShas:t.parentShas,row:t.row,lane:n})}let u=xn(l);for(let e of l)e.lane=u.get(e.sha)??e.lane,c.set(e.sha,e.lane);let d=new Map,f=new Map(c);for(let e of this.entries)d.set(e.sha,e.row);return{lanes:c,edges:Rn(l,d,f)}}};function Bn(e,t){return{...e,headSha:t,staged:[]}}function Vn(e,t,n){let r={...e,headSha:t};if(n)return{...r,branch:n};let{branch:i,...a}=r;return a}var Hn=0;function Un(e){return Hn+=1,`optimistic-${e}-${Date.now().toString(36)}-${Hn}`}function Wn(e){return{authorName:e.authorName,authorEmail:e.authorEmail,authorUnix:e.authorUnix,committerUnix:e.committerUnix,subject:e.subject,additions:e.additions,deletions:e.deletions,locChanged:e.locChanged,bodyPreview:e.bodyPreview}}function Gn(e){return e.find(e=>e.kind===`head`&&e.isCurrent)??null}function Kn(e,t){return e.find(e=>e.shortName===t)??null}function L(e){return e.peeledSha??e.targetSha}function qn(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(n.has(e))continue;n.add(e);let i=t.get(e);if(i)for(let e of i)n.has(e)||r.push(e)}return n}function Jn(e,t,n){let r=new zn(`optimistic`,`optimistic`,{kind:`all`},`date`);r.appendEntries(e.map(e=>({sha:e.sha,parentShas:e.parentShas})));let{lanes:i}=r.computeGeometry(0,e.length-1,void 0,n??void 0),a=new Map;for(let e of t){let t=L(e),n=a.get(t);n?n.push(e.shortName):a.set(t,[e.shortName])}return e.map((e,t)=>({row:t,sha:e.sha,parentShas:e.parentShas,authorName:e.meta.authorName,authorEmail:e.meta.authorEmail,authorUnix:e.meta.authorUnix,committerUnix:e.meta.committerUnix,subject:e.meta.subject,additions:e.meta.additions,deletions:e.meta.deletions,locChanged:e.meta.locChanged,bodyPreview:e.meta.bodyPreview,refNames:a.get(e.sha)??[],lane:i.get(e.sha)??0}))}function Yn(e){return e.map(e=>({sha:e.sha,parentShas:e.parentShas,meta:Wn(e)}))}function Xn(e,t){return e.map(e=>{if(e.kind!==`head`)return e;let n=t!==null&&e.shortName===t;return!!e.isCurrent===n?e:{...e,isCurrent:n}})}function Zn(e,t,n){return e.map(e=>e.kind===`head`&&e.shortName===t?{...e,targetSha:n,peeledSha:void 0}:e)}function Qn(e,t,n,r){if(e.length===0)return null;let i=Xn(t,n);return{rows:Jn(Yn(e),i,r),refs:i,headSha:r}}function $n(e,t,n,r){if(e.length===0)return null;let i=Kn(t,n);if(!i||i.kind!==`head`)return null;let a=Zn(t,n,r),o=Gn(a),s=o?o.targetSha:null;return{rows:Jn(Yn(e),a,s),refs:a,headSha:s}}function er(e,t,n){let r=Gn(t);if(!r)return null;let i=e.find(e=>e.sha===n);if(!i)return null;let a=i.parentShas[0];if(!a)return null;let o=t.some(e=>e!==r&&L(e)===n&&e.shortName!==r.shortName),s=Yn(e);o||(s=s.filter(e=>e.sha!==n));let c=Zn(t,r.shortName,a);return{rows:Jn(s,c,a),refs:c,headSha:a}}function tr(e,t,n,r){let i=Gn(t);if(!i)return null;let a=i.targetSha;if(!e.some(e=>e.sha===a))return null;let o=Math.floor(Date.now()/1e3),s=Un(r),c=[{sha:s,parentShas:[a],meta:{authorName:``,authorEmail:``,authorUnix:o,committerUnix:o,subject:n,additions:0,deletions:0,locChanged:0}},...Yn(e)],l=Zn(t,i.shortName,s);return{rows:Jn(c,l,s),refs:l,headSha:s}}function nr(e,t,n){let r=Gn(t);if(!r)return null;let i=r.targetSha,a=e.find(e=>e.sha===i);if(!a)return null;let o=Un(`amend`),s={sha:o,parentShas:a.parentShas,meta:{...Wn(a),subject:n}},c=t.some(e=>e!==r&&e.shortName!==r.shortName&&L(e)===i)?[s,...Yn(e)]:Yn(e).map(e=>e.sha===i?s:e),l=Zn(t,r.shortName,o);return{rows:Jn(c,l,o),refs:l,headSha:o}}function rr(e,t,n){let r=Gn(t);if(!r)return null;let i=Kn(t,n);if(!i)return null;let a=r.targetSha,o=L(i);if(!e.some(e=>e.sha===a))return null;let s=new Map(e.map(e=>[e.sha,e.parentShas])),c=qn(o,s);if(qn(a,s).has(o))return null;if(c.has(a)){if(!e.some(e=>e.sha===o))return null;let n=Zn(t,r.shortName,o);return{rows:Jn(Yn(e),n,o),refs:n,headSha:o}}if(!e.some(e=>e.sha===o))return null;let l=Math.floor(Date.now()/1e3),u=Un(`merge`),d=[{sha:u,parentShas:[a,o],meta:{authorName:``,authorEmail:``,authorUnix:l,committerUnix:l,subject:`Merge ${n}`,additions:0,deletions:0,locChanged:0}},...Yn(e)],f=Zn(t,r.shortName,u);return{rows:Jn(d,f,u),refs:f,headSha:u}}function ir(e,t,n){let r=Gn(t);if(!r)return null;let i=Kn(t,n);if(!i)return null;let a=r.targetSha,o=L(i);if(!e.some(e=>e.sha===a)||!e.some(e=>e.sha===o))return null;let s=new Map(e.map(e=>[e.sha,e.parentShas])),c=qn(a,s),l=qn(o,s);if(l.has(a)){let n=Zn(t,r.shortName,o);return{rows:Jn(Yn(e),n,o),refs:n,headSha:o}}let u=e.filter(e=>c.has(e.sha)&&!l.has(e.sha));if(u.length===0||u.some(e=>e.parentShas.length>1))return null;let d=new Set(u.map(e=>e.sha)),f=u[u.length-1],p=Yn(e).filter(e=>!d.has(e.sha));if(!p.some(e=>e.sha===o))return null;let m=Math.floor(Date.now()/1e3),h=[...u.map(e=>({sha:e.sha,parentShas:e.sha===f.sha?[o]:e.parentShas,meta:{...Wn(e),committerUnix:m}})),...p],g=t.slice();return{rows:Jn(h,g,a),refs:g,headSha:a}}function ar(e,t,n){return e+t>=n/2}function or(e,t,n){return n&&e!==t}function sr(e,t){if(!e||e.rows.every((e,n)=>t.rows[n]?.sha===e.sha))return t;let n=new Set(e.rows.map(e=>e.sha)),r=t.rows.filter(e=>!n.has(e.sha));return r.length===0?{...e,hasMoreAfter:t.hasMoreAfter}:{...t,rows:[...e.rows,...r],edges:[...e.edges,...t.edges],hasMoreBefore:e.hasMoreBefore}}var cr=80,lr=.2,ur=3,dr=[`#89b4fa`,`#a6e3a1`,`#f9e2af`,`#f38ba8`,`#cba6f7`,`#94e2d5`,`#fab387`,`#74c7ec`,`#f5c2e7`,`#b4befe`];function fr(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return t}function pr(e){return dr[(e%dr.length+dr.length)%dr.length]}function mr(e){return dr[fr(e)%dr.length]}function hr(e,t){let n=Math.max(0,e),r=n/2,i=(n>=480?Math.floor(ur/2):0)*80+80/2,a=Math.max(0,r-i),o=Math.min(Math.max(0,t),Math.max(0,a-120)),s=Math.min(520,Math.max(cr,n*lr)),c=Math.min(s,Math.max(0,a-80)),l=120+o,u=80+c,d=Math.max(80/2,Math.min(r-l,n-r-u));return{extraLeftGutter:o,rightGutter:c,maxLaneRadius:Math.max(0,Math.floor((d-80/2)/80)),laneCenterX:r,layoutWidth:n}}function gr(e,t,n,r){let i=Math.max(n,.1),a=Math.max(0,e),o=Math.max(0,t);return{...hr(a/i,r),laneCenterX:(a/2-o)/i,layoutWidth:Math.max(0,a-o)/i}}function _r(e,t){let n=xn(e,t),r=!1,i=e.map(e=>{let t=n.get(e.sha)??0;return t===e.lane?e:(r=!0,{...e,lane:t})});return r?i:e}function vr(e,t){let n=t.get(e);return n?mr(n):dr[fr(e)%dr.length]}function yr(e){return e.length===0?null:e.find(e=>!e.includes(`/`))||(e.find(e=>e.includes(`/`)&&e!==`origin`&&e!==`HEAD`)??null)}function br(e,t=0,n=520,r){let i=1/0,a=-1/0,o=[],s=new Map,c=new Map;for(let t=0;t<e.length;t++){let n=e[t];n.lane<i&&(i=n.lane),n.lane>a&&(a=n.lane),c.set(n.sha,n)}let l=Number.isFinite(i)?i:0,u=Number.isFinite(a)?a:0,d=r?.laneRadius??Math.max(Math.abs(l),Math.abs(u)),f=160+t;for(let t=0;t<e.length;t++){let n=e[t],i={row:n,x:r?r.laneCenterX+n.lane*80:f+(n.lane+d)*80,y:152+t*56,idx:t};o.push(i),s.set(n.sha,i)}let p=new Map;for(let t of e){let e=yr(t.refNames);if(!e)continue;let n=t.sha;for(;n&&!p.has(n);){p.set(n,e);let t=c.get(n);if(!t||t.parentShas.length===0)break;n=t.parentShas[0]}}let m=new Map;for(let e of o)m.set(e.row.sha,vr(e.row.sha,p));return{nodes:o,shaToNode:s,shaToBranch:p,shaToColor:m,maxLane:a,totalWidth:r?.totalWidth??200+t+(d*2+1)*80+n,totalHeight:e.length*56+80+112}}function xr(e,t){let n=e.nodes.map((e,n)=>({...e,row:t[n]}));return{...e,nodes:n,shaToNode:new Map(n.map(e=>[e.row.sha,e]))}}function Sr(e,t){if(!t)return e;let n=e.findIndex(e=>e.refNames.includes(t));if(n<=0)return e;let r=e[n],i=r.lane,a=new Map;for(let t=0;t<n;t++){let n=e[t].parentShas[0];if(!n)continue;let r=a.get(n);r?r.push(t):a.set(n,[t])}let o=new Set,s=[r.sha],c=new Set;for(;s.length>0;){let t=s.pop();if(!c.has(t)){c.add(t);for(let n of a.get(t)??[]){let t=e[n];t.lane===i&&(o.add(n),s.push(t.sha))}}}if(o.size===0)return e;let l=Math.min(...o),u=Math.max(0,l-1),d=n-1,f=new Map(e.map((e,t)=>[e.sha,t])),p=t=>{for(let n=0;n<e.length;n++){if(o.has(n))continue;let r=e[n];if(r.lane===t&&u<=n&&n<=d)return!1;let i=f.get(r.parentShas[0]??``);if(!(i===void 0||r.lane!==t)&&e[i].lane===t&&Math.min(n,i)<=d&&u<=Math.max(n,i))return!1}return!0},m=Math.max(i,...e.map(e=>e.lane)),h=Math.max(i+1,m);for(;!p(h);)h++;return e.map((e,t)=>o.has(t)?{...e,lane:h}:e)}var Cr=12,wr=new WeakMap,Tr=new Map,Er={requests:0,referenceHits:0,topologyHits:0,builds:0,totalBuildMs:0};function Dr(e){return e?e.staged.length+e.unstaged.length:0}function Or(e){return e.find(e=>e.isCurrent)?.shortName??null}function kr(e,t,n){return`${e??``}\u0000${+!!t}\u0000${n}`}function Ar(e,t){let n=`${t}|${e.length}`;for(let t of e)n+=`\u0001${t.sha}\u0002${t.lane}\u0002${t.parentShas.join(`,`)}\u0002${t.refNames.join(`,`)}`;return n}function jr(){return typeof performance>`u`?Date.now():performance.now()}function Mr(e,t){if(Tr.delete(e),Tr.set(e,t),Tr.size>Cr){let e=Tr.keys().next().value;e!==void 0&&Tr.delete(e)}}function Nr(e,t,n,r){if(!e||e.rows.length===0)return null;Er.requests++;let i=e.rows,a=Or(t),o=Dr(n)>0,s=r?260:0,c=kr(a,o,s),l=wr.get(i),u=l?.get(c);if(u)return Er.referenceHits++,u;let d=o?Sr(i,a):i,f=Ar(d,s),p=Tr.get(f),m;if(p)Er.topologyHits++,m=p.rows===d?p.layout:xr(p.layout,d),Mr(f,{rows:d,layout:m});else{let e=jr();m=br(d,s),Er.totalBuildMs+=jr()-e,Er.builds++,Mr(f,{rows:d,layout:m})}let h={currentBranch:a,renderedRows:d,layout:m},g=l??new Map;return g.set(c,h),l||wr.set(i,g),h}function Pr(){return{status:`no-repo`,repoId:null,repoPath:null,currentWorktreePath:null,totalCommitCount:0,recentRepos:[],discoveredFolder:null,discoveredRepos:[],githubUrl:null,openError:null}}function Fr(){return{refs:[],historyWindow:null,graphModel:null,reflog:null,reflogLoading:!1,reflogMaxCount:300,selectedSha:null,selectedRefName:null,scrollToSha:null,scrollToKey:0,commitDetail:null,commitDiff:null,commitPRs:[],commitAuthorAvatars:{},mergePreview:null,loadingMore:!1,commitCIStatus:{},pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:0}}function Ir(e,t){return`${e}:${t}`}function Lr(e,t){return`${e}:${t}`}function Rr(e,t){return`${e}:${t}`}function zr(){return{stashes:[],selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktrees:[],worktreeChanges:null,worktreeSelected:!1,worktreeCommitMessage:``,worktreeFileDiffs:{},commitFileDiffs:{}}}function Br(e,t){try{let n=localStorage.getItem(e);return n===null?t:n===`true`}catch{return t}}function Vr(){return{viewMode:`history`,errorDialog:null,showCommitMessages:Br(`showCommitMessages`,!0),showGutterColors:Br(`showGutterColors`,!1)}}var Hr=100,Ur=1e3,Wr=500,Gr=12,Kr=3e4,qr=13e4,Jr=class extends Error{constructor(){super(`The operation timed out`),this.name=`MutationTimeoutError`}};function Yr(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>r(new Jr),t);e.then(e=>{clearTimeout(i),n(e)},e=>{clearTimeout(i),r(e)})})}function Xr(e){return e.startsWith(`optimistic-`)||e.startsWith(`preview:`)}function Zr(e){return new Set(e.unstaged.filter(e=>e.status===`U`).map(e=>e.path)).size}function Qr(e){return e.staged.length+e.unstaged.length}function $r(e,t,n,r){if(!n){e({pendingMutation:!0,...r?{selectedSha:null,selectedRefName:r,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}:{}});return}e(e=>({pendingMutation:!0,refs:n.refs,historyWindow:ti(t.historyWindow,n.rows),selectedSha:r?null:n.headSha,selectedRefName:r??null,scrollToSha:n.headSha,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}))}function ei(e){return{refs:e.refs,historyWindow:e.historyWindow,worktreeChanges:e.worktreeChanges,selectedSha:e.selectedSha,selectedRefName:e.selectedRefName,scrollToSha:e.scrollToSha,totalCommitCount:e.totalCommitCount,mergePreview:e.mergePreview,commitDetail:e.commitDetail,commitDiff:e.commitDiff,commitPRs:e.commitPRs,commitFileDiffs:e.commitFileDiffs}}function ti(e,t){return e?{...e,rows:t,totalRowsKnown:t.length,checkpointsKnownUntilRow:Math.max(0,t.length-1)}:null}function ni(e){return Promise.all([Ut(e),tn(e,{repoId:e,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:Ur,firstParent:!1,topoOrder:!0})])}async function ri(e){let[[t,n],r,i]=await Promise.all([ni(e),Gt(e),Wt(e)]);return[t,n,r,i]}function ii(e){return Promise.all([Ut(e),tn(e,{repoId:e,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:Ur,firstParent:!1,topoOrder:!0}),Gt(e),Wt(e),Kt(e)])}function ai(e,t){Promise.all([nn(e,t),an(e,t)]).then(([e,n])=>{R.getState().selectedSha===t&&R.setState({commitDetail:e,commitDiff:n})}).catch(e=>console.error(`Failed to load commit detail:`,e)),R.getState().githubUrl&&(oi(e,t),sn(e,t).then(e=>{R.getState().selectedSha===t&&R.setState({commitPRs:e})}).catch(()=>{})),R.getState().fetchCommitCIStatusesIfNeeded([t])}function oi(e,t){let n=R.getState();!n.githubUrl||t in n.commitAuthorAvatars||rn(e,t).then(({avatarUrl:n})=>{R.getState().repoId===e&&R.setState(e=>({commitAuthorAvatars:{...e.commitAuthorAvatars,[t]:n}}))}).catch(()=>{})}function si(e){let t=e.find(e=>e.kind===`head`&&e.isCurrent);if(!t)return null;if(t.upstream){let n=e.find(e=>e.kind===`remote`&&e.name===t.upstream);if(n)return n.peeledSha??n.targetSha}return t.peeledSha??t.targetSha}function ci(e,t){return e.rows.some(e=>e.sha===t)}function li(){let e=window.location.hash;return e.startsWith(`#/repository`)?new URLSearchParams(e.split(`?`)[1]??``).get(`path`):null}function ui(e){window.location.hash=`#/repository?path=${encodeURIComponent(e)}`}function di(){window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}`)}var fi=0;function pi(e){return e instanceof Error&&e.message.includes(`No session found`)}function mi(e,t){return[t,...e.filter(e=>e!==t)].slice(0,Gr)}async function hi(e,t,n,r){let i=++fi;t({status:`loading`,repoId:null,repoPath:null,currentWorktreePath:null,totalCommitCount:0,refs:[],stashes:[],selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktrees:[],historyWindow:null,selectedSha:null,selectedRefName:null,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitAuthorAvatars:{},commitCIStatus:{},mergePreview:null,githubUrl:null,openError:null,loadingMore:!1,worktreeChanges:null,worktreeSelected:!1,worktreeCommitMessage:``,worktreeFileDiffs:{},commitFileDiffs:{},reflog:null,reflogLoading:!1,pendingMutation:!1,pendingCheckout:!1});try{let r=await Rt({path:e});if(i!==fi)return;let[a,o,s,c]=await Promise.all([Ut(r.repoId),tn(r.repoId,{repoId:r.repoId,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:Hr,firstParent:!1,topoOrder:!0}),Wt(r.repoId),Kt(r.repoId)]);if(i!==fi)return;let l=a.find(e=>e.isCurrent)?.targetSha??r.head.sha;ui(r.currentWorktreePath),yi.clear(),xi(),t(e=>({status:`ready`,repoId:r.repoId,repoPath:r.currentWorktreePath,currentWorktreePath:r.currentWorktreePath,totalCommitCount:Math.max(r.totalCommitCount,o.rows.length),recentRepos:mi(n().recentRepos,r.currentWorktreePath),githubUrl:r.githubUrl,refs:a,stashes:c,worktrees:s,historyWindow:o,commitAuthorAvatars:{},commitCIStatus:{},openError:null,selectedRefName:null,scrollToSha:l,scrollToKey:e.scrollToKey+1,mergePreview:null,worktreeChanges:null,worktreeSelected:!1,worktreeFileDiffs:{},commitFileDiffs:{},reflog:null,reflogMaxCount:300})),n().viewMode===`reflog`&&n().loadReflog(),n().loadWorktreeChanges()}catch(e){if(i!==fi)return;let a=n().recentRepos;try{a=await Bt()}catch(e){console.error(`Failed to load recent repositories:`,e)}if(i!==fi)return;t({status:`no-repo`,recentRepos:a,openError:r.showOpenError?e instanceof Error?e.message:`Failed to open repository`:null})}}var gi=1e4,_i=10*6e4,vi=new Set([`success`,`failure`,`neutral`]),yi=new Map,bi=null;function xi(){bi!==null&&(clearInterval(bi),bi=null)}function Si(){bi===null&&(bi=setInterval(wi,gi))}function Ci(e){let{repoId:t}=R.getState();!t||e.length===0||cn(t,e).then(n=>{R.getState().repoId===t&&R.setState(t=>{let r={...t.commitCIStatus};for(let t of e){let e=n[t];r[t]=e?{state:e.state,runs:e.runs??[]}:{state:`none`,runs:[]}}return{commitCIStatus:r}})}).catch(e=>console.warn(`[CI] poll fetch failed`,e))}function wi(){let{repoId:e,commitCIStatus:t}=R.getState();if(!e){xi();return}let n=Date.now(),r=new Set;for(let[e,i]of yi){let a=t[e]?.state;n>i||a!==void 0&&vi.has(a)?yi.delete(e):r.add(e)}for(let[e,n]of Object.entries(t))n.state===`pending`&&r.add(e);if(r.size===0){xi();return}Ci([...r])}var Ti=new Set([`historyWindow`,`refs`,`worktreeChanges`,`showCommitMessages`]);function Ei(e){return Object.keys(e).some(e=>Ti.has(e))}var R=oe((e,t)=>{let n=t=>{e(e=>{let n=typeof t==`function`?t(e):t;if(!Ei(n))return n;let r={...e,...n};return{...n,graphModel:Nr(r.historyWindow,r.refs,r.worktreeChanges,r.showCommitMessages)}})};return{...Pr(),...Fr(),...zr(),...Vr(),setShowCommitMessages:e=>{try{localStorage.setItem(`showCommitMessages`,String(e))}catch{}n({showCommitMessages:e})},setShowGutterColors:e=>{try{localStorage.setItem(`showGutterColors`,String(e))}catch{}n({showGutterColors:e})},setWorktreeCommitMessage:e=>n({worktreeCommitMessage:e}),reloadFromServer:async()=>{let{repoPath:e}=t(),r=t().repoId;if(!(!r||!e)&&!t().pendingMutation)try{let i,a,o,s,c;try{[i,a,o,s,c]=await ii(r)}catch(t){if(pi(t)||Lt(t)){let t=await Rt({path:e});r=t.repoId,n({repoId:r,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount});let l=await ii(r);i=l[0],a=l[1],o=l[2],s=l[3],c=l[4]}else throw t}n(e=>({refs:i,stashes:c,selectedStashSha:e.selectedStashSha&&c.some(t=>t.sha===e.selectedStashSha)?e.selectedStashSha:null,stashDiff:e.selectedStashSha&&c.some(t=>t.sha===e.selectedStashSha)?e.stashDiff:null,stashFileDiffs:e.selectedStashSha&&c.some(t=>t.sha===e.selectedStashSha)?e.stashFileDiffs:{},worktrees:s,historyWindow:a,totalCommitCount:Math.max(e.totalCommitCount,a.rows.length),mergePreview:null,worktreeChanges:o,worktreeFileDiffs:{},worktreeSelected:Zr(o)>0||Qr(o)>0&&e.worktreeSelected})),t().viewMode===`reflog`&&t().loadReflog()}catch(e){console.error(`Failed to reload repository state:`,e)}},loadWorktrees:async()=>{let{repoId:e}=t();if(e)try{let r=await Wt(e);t().repoId===e&&n({worktrees:r})}catch(e){console.error(`Failed to load linked worktrees:`,e)}},loadWorktreeChanges:async()=>{let{repoId:e}=t();if(e)try{let r=await Gt(e);if(t().repoId!==e)return;n(e=>({worktreeChanges:r,worktreeFileDiffs:{},worktreeSelected:Zr(r)>0||Qr(r)>0&&e.worktreeSelected}))}catch(e){console.error(`Failed to load worktree changes:`,e)}},createStash:async e=>{let{repoId:r}=t();if(!r||t().pendingMutation)return!1;n({pendingMutation:!0});try{let i=await Yr(Yt(r,e?.trim()||void 0),Kr);return t().repoId===r?(n(e=>({pendingMutation:!1,stashes:i.stashes,worktreeChanges:i.changes,worktreeFileDiffs:{},worktreeSelected:Qr(i.changes)>0&&e.worktreeSelected})),!0):!1}catch(e){return t().repoId===r&&n({pendingMutation:!1}),t().showError(`Stash failed`,e),!1}},applyStash:async e=>{let{repoId:r}=t();if(!r||t().pendingMutation)return!1;n({pendingMutation:!0});try{let i=await Yr(Xt(r,e),Kr);return t().repoId===r?(n({pendingMutation:!1,stashes:i.stashes,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeChanges:i.changes,worktreeFileDiffs:{},worktreeSelected:Qr(i.changes)>0}),!0):!1}catch(e){try{let[e,i]=await Promise.all([Kt(r),Gt(r)]);t().repoId===r&&n({pendingMutation:!1,stashes:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeChanges:i,worktreeFileDiffs:{},worktreeSelected:Qr(i)>0})}catch{t().repoId===r&&n({pendingMutation:!1})}return t().showError(`Apply stash failed`,e),!1}},dropStash:async e=>{let{repoId:r}=t();if(!r||t().pendingMutation)return!1;n({pendingMutation:!0});try{let i=await Yr(Zt(r,e),Kr);return t().repoId===r?(n(t=>({pendingMutation:!1,stashes:i.stashes,worktreeChanges:i.changes,selectedStashSha:t.selectedStashSha===e?null:t.selectedStashSha,stashDiff:t.selectedStashSha===e?null:t.stashDiff,stashFileDiffs:t.selectedStashSha===e?{}:t.stashFileDiffs})),!0):!1}catch(e){return t().repoId===r&&n({pendingMutation:!1}),t().showError(`Drop stash failed`,e),!1}},selectStash:e=>{let{repoId:r}=t();n({selectedStashSha:e,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,selectedSha:null,selectedRefName:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}),r&&qt(r,e).then(i=>{t().repoId===r&&t().selectedStashSha===e&&n({stashDiff:i})}).catch(n=>{t().repoId===r&&t().selectedStashSha===e&&t().showError(`Load stash details failed`,n)})},loadStashFileDiff:async(e,r)=>{let{repoId:i}=t();if(!i)return;let a=Rr(e,r.path),o=t().stashFileDiffs[a];if(!(o&&(o.loading||o.patchText!==void 0))){n(e=>({stashFileDiffs:{...e.stashFileDiffs,[a]:{loading:!0}}}));try{let o=await Jt(i,e,r.path,r.oldPath);if(t().repoId!==i||t().selectedStashSha!==e)return;n(e=>({stashFileDiffs:{...e.stashFileDiffs,[a]:{loading:!1,patchText:o.patchText,isBinary:o.isBinary,imageDiff:o.imageDiff}}}))}catch(r){if(t().repoId!==i||t().selectedStashSha!==e)return;n(e=>({stashFileDiffs:{...e.stashFileDiffs,[a]:{loading:!1,error:r instanceof Error?r.message:`Failed to load diff`}}}))}}},loadWorktreeFileDiff:async(e,r)=>{let{repoId:i}=t();if(!i)return;let a=Ir(r,e.path),o=t().worktreeFileDiffs[a];if(!(o&&(o.loading||o.patchText!==void 0))){n(e=>({worktreeFileDiffs:{...e.worktreeFileDiffs,[a]:{loading:!0}}}));try{let t=await $t(i,e.path,r,e.oldPath);n(e=>({worktreeFileDiffs:{...e.worktreeFileDiffs,[a]:{loading:!1,patchText:t.patchText,isBinary:t.isBinary,imageDiff:t.imageDiff}}}))}catch(e){n(t=>({worktreeFileDiffs:{...t.worktreeFileDiffs,[a]:{loading:!1,error:e instanceof Error?e.message:`Failed to load diff`}}}))}}},loadCommitFileDiff:async(e,r)=>{let{repoId:i}=t();if(!i)return;let a=Lr(e,r.path),o=t().commitFileDiffs[a];if(!(o&&(o.loading||o.patchText!==void 0))){n(e=>({commitFileDiffs:{...e.commitFileDiffs,[a]:{loading:!0}}}));try{let t=await on(i,e,r.path,r.oldPath);n(e=>({commitFileDiffs:{...e.commitFileDiffs,[a]:{loading:!1,patchText:t.patchText,isBinary:t.isBinary,imageDiff:t.imageDiff}}}))}catch(e){n(t=>({commitFileDiffs:{...t.commitFileDiffs,[a]:{loading:!1,error:e instanceof Error?e.message:`Failed to load diff`}}}))}}},performCommit:async(e,r,i=!1)=>{let{repoPath:a}=t(),o=t().repoId;if(!o||!a||t().pendingMutation)return!1;let s=ei(t()),c=s.historyWindow?.rows??[],l=e.split(`
12
+ `)[0],u=i?nr(c,s.refs,l):tr(c,s.refs,l,`commit`),d=t().worktreeChanges,f=t().worktreeFileDiffs,p=d?Bn(d,u?.headSha??d.headSha):null;n(u?{pendingMutation:!0,refs:u.refs,historyWindow:ti(s.historyWindow,u.rows),worktreeChanges:p,worktreeFileDiffs:{}}:{pendingMutation:!0,worktreeChanges:p,worktreeFileDiffs:{}});let m;try{m=await Yr((async()=>{try{return await en(o,e,r,i)}catch(t){if(pi(t)){let t=await Rt({path:a});return o=t.repoId,n({repoId:o,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await en(o,e,r,i)}throw t}})(),qr)}catch(e){return n({...s,pendingMutation:!1,worktreeChanges:d,worktreeFileDiffs:f}),t().showError(`Commit failed`,e),!1}let[h,g]=await ni(o);return n(e=>({pendingMutation:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:h,historyWindow:g,totalCommitCount:Math.max(i?e.totalCommitCount:e.totalCommitCount+1,g.rows.length),worktreeChanges:m.changes,worktreeFileDiffs:{}})),t().viewMode===`reflog`&&t().loadReflog(),!0},selectWorktree:()=>{n({worktreeSelected:!0,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedSha:null,selectedRefName:null,commitDetail:null,commitDiff:null,commitPRs:[],mergePreview:null,commitFileDiffs:{}}),t().loadWorktreeChanges()},runStageAction:async(e,r)=>{let{repoPath:i}=t(),a=t().repoId;if(!a||!i)return!1;try{let t;try{t=await Qt(a,e,r)}catch(o){if(!pi(o)&&!Lt(o))throw o;let s=await Rt({path:i});a=s.repoId,n({repoId:a,githubUrl:s.githubUrl,totalCommitCount:s.totalCommitCount}),t=await Qt(a,e,r)}return n({worktreeChanges:t,worktreeFileDiffs:{}}),!0}catch(n){return t().showError(e.startsWith(`discard`)?`Discard changes failed`:`Staging action failed`,n),!1}},setViewMode:e=>{n({viewMode:e}),e===`reflog`&&!t().reflog&&t().loadReflog()},loadReflog:async()=>{let{repoPath:e,reflogMaxCount:r}=t(),i=t().repoId;if(!(!i||!e)){n({reflogLoading:!0});try{let t;try{t=await gn(i,`HEAD`,r)}catch(a){if(pi(a)||Lt(a)){let a=await Rt({path:e});i=a.repoId,n({repoId:i,githubUrl:a.githubUrl,totalCommitCount:a.totalCommitCount}),t=await gn(i,`HEAD`,r)}else throw a}n({reflog:t})}catch(e){console.error(`Failed to load reflog:`,e),t().showError(`Failed to load reflog`,e)}finally{n({reflogLoading:!1})}}},loadMoreReflog:async()=>{t().reflogLoading||(n({reflogMaxCount:t().reflogMaxCount+300}),await t().loadReflog())},recoverBranch:async(e,r)=>{await t().performRefAction(`create`,e,r),n({selectedSha:r}),t().loadReflog()},fetchCommitCIStatusesIfNeeded:e=>{let{repoId:r,commitCIStatus:i}=t();if(!r)return;let a=e.filter(e=>!Xr(e)&&i[e]===void 0);a.length!==0&&(n(e=>{let t={...e.commitCIStatus};for(let e of a)t[e]={state:`loading`,runs:[]};return{commitCIStatus:t}}),cn(r,a).then(e=>{n(t=>{let n={...t.commitCIStatus};for(let t of a){let r=e[t];n[t]=r?{state:r.state,runs:r.runs??[]}:{state:`none`,runs:[]}}return{commitCIStatus:n}})}).catch(e=>{console.warn(`[CI] batch fetch failed`,e),n(e=>{let t={...e.commitCIStatus};for(let e of a)t[e]={state:`none`,runs:[]};return{commitCIStatus:t}})}))},watchCommitCIStatus:e=>{yi.set(e,Date.now()+_i),Ci([e]),Si()},showError:(e,t,r)=>{let i=t instanceof Error?t.message:typeof t==`string`?t:`Unknown error`;n({errorDialog:{title:e,message:i,action:r}})},dismissError:()=>n({errorDialog:null}),openRepoByPath:async e=>{await hi(e,n,t,{showOpenError:!0})},closeRepo:()=>{fi+=1,yi.clear(),xi(),di(),n({status:`no-repo`,repoId:null,repoPath:null,currentWorktreePath:null,totalCommitCount:0,refs:[],stashes:[],selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktrees:[],historyWindow:null,selectedSha:null,selectedRefName:null,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitAuthorAvatars:{},mergePreview:null,githubUrl:null,openError:null,loadingMore:!1,commitCIStatus:{},worktreeChanges:null,worktreeSelected:!1,worktreeCommitMessage:``,worktreeFileDiffs:{},commitFileDiffs:{},pendingMutation:!1,pendingCheckout:!1,reflog:null,reflogLoading:!1,reflogMaxCount:300,viewMode:`history`})},loadRecentRepos:async()=>{try{n({recentRepos:await Bt()})}catch(e){console.error(`Failed to load recent repositories:`,e)}},loadDiscoveredRepos:async e=>{try{let{folder:t,repos:r}=await Vt(e);n({discoveredFolder:t,discoveredRepos:r})}catch(e){console.error(`Failed to discover repositories:`,e)}},openFromUrl:()=>{let e=li();t().loadRecentRepos(),t().loadDiscoveredRepos(),!(e&&e===t().repoPath)&&(e?t().openRepoByPath(e):hi(`.`,n,t,{showOpenError:!1}))},selectCommit:e=>{n({selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,scrollToSha:null,scrollToKey:t().scrollToKey,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{}});let{repoId:r,githubUrl:i}=t();r&&(t().fetchCommitCIStatusesIfNeeded([e]),Promise.all([nn(r,e),an(r,e)]).then(([r,i])=>{t().selectedSha===e&&n({commitDetail:r,commitDiff:i})}).catch(e=>console.error(`Failed to load commit detail:`,e)),i&&(oi(r,e),sn(r,e).then(r=>{t().selectedSha===e&&n({commitPRs:r})}).catch(()=>{})))},selectRef:e=>{t().selectCommit(e.targetSha)},selectGraphRef:e=>{let{repoId:r}=t();n({selectedSha:null,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,selectedRefName:e,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}),r&&un(r,e).then(r=>{t().selectedRefName===e&&n({mergePreview:r})}).catch(()=>{})},clearGraphRefSelection:()=>{n({selectedSha:null,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,selectedRefName:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})},ensureMergePreview:async e=>{let{repoId:r,mergePreview:i}=t();if(!r)return null;if(i?.sourceRefName===e)return i;let a=await un(r,e);return t().selectedRefName===e&&n({mergePreview:a}),a},navigateTo:async e=>{let{historyWindow:r,repoId:i}=t();if(r?.rows.some(t=>t.sha===e))n(t=>({viewMode:`history`,selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedRefName:null,worktreeSelected:!1,scrollToSha:e,scrollToKey:t.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}));else if(i){let r=!1,a=t().historyWindow?.rows.length??Ur;for(let t=0;t<3&&!r;t++){a=Math.min(a*3,1e4);try{let t=await tn(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:a,firstParent:!1,topoOrder:!0});if(r=t.rows.some(t=>t.sha===e||t.sha.startsWith(e)),n(n=>({viewMode:`history`,historyWindow:r?t:sr(n.historyWindow,t),selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedRefName:null,worktreeSelected:!1,scrollToSha:r?e:null,scrollToKey:r?n.scrollToKey+1:n.scrollToKey,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),!r&&!t.hasMoreAfter)break}catch(e){console.error(`Failed to load history for navigation:`,e);break}}if(!r)try{let t=await tn(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`sha`,value:e},beforeRows:0,afterRows:Ur,firstParent:!1,topoOrder:!0});r=t.rows.some(t=>t.sha===e||t.sha.startsWith(e)),r&&n(n=>({viewMode:`history`,historyWindow:t,selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedRefName:null,worktreeSelected:!1,scrollToSha:e,scrollToKey:n.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}))}catch(e){console.error(`Failed to load history anchored at commit:`,e)}r||console.warn(`Commit ${e} not found in history`)}let{repoId:a}=t();a&&(t().fetchCommitCIStatusesIfNeeded([e]),oi(a,e),Promise.all([nn(a,e),an(a,e)]).then(([r,i])=>{t().selectedSha===e&&n({commitDetail:r,commitDiff:i})}).catch(()=>{}))},requestMore:async e=>{let{repoId:r,historyWindow:i,loadingMore:a}=t();if(!(!r||!i||a)&&!(e===`down`&&!i.hasMoreAfter)){n({loadingMore:!0});try{let e=await tn(r,{repoId:r,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:i.rows.length+Wr,firstParent:!1,topoOrder:!0});n(t=>({historyWindow:sr(t.historyWindow,e)}))}catch(e){console.error(`Failed to load more history:`,e)}finally{n({loadingMore:!1})}}},performRefAction:async(e,r,i,a)=>{let{repoPath:o}=t(),s=t().repoId;if(!s||!o||t().pendingMutation)return;let c=ei(t()),l=c.historyWindow?.rows??[],u=null;e===`checkout`?u=Qn(l,c.refs,r,i):(e===`move`||e===`reset`)&&(u=$n(l,c.refs,r,i));let d=e===`checkout`?u?.refs.find(e=>e.kind===`head`&&e.isCurrent)?.shortName??null:null,f=e===`checkout`&&c.worktreeChanges?Vn(c.worktreeChanges,i,d):c.worktreeChanges;n(u?{pendingMutation:!0,...e===`checkout`?{pendingCheckout:!0,worktreeChanges:f}:{},refs:u.refs,historyWindow:ti(c.historyWindow,u.rows),mergePreview:null,...e===`move`?{selectedRefName:r,selectedSha:i,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{}}:{selectedRefName:null}}:{pendingMutation:!0,...e===`checkout`?{pendingCheckout:!0,worktreeChanges:f}:{}});try{await Yr((async()=>{try{await hn(s,e,r,i,a)}catch(t){if(e!==`checkout`&&(pi(t)||Lt(t))){let t=await Rt({path:o});s=t.repoId,n({repoId:s,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await hn(s,e,r,i,a)}else throw t}})(),Kr)}catch(t){if(e===`checkout`)try{if(pi(t)||Lt(t)){let e=await Rt({path:o});s=e.repoId,n({repoId:s,githubUrl:e.githubUrl,totalCommitCount:e.totalCommitCount})}let[e,r,i,a,l]=await ii(s),u=c.refs.find(e=>e.kind===`head`&&e.isCurrent),d=e.find(e=>e.kind===`head`&&e.isCurrent),f=d?.shortName!==u?.shortName||d?.targetSha!==u?.targetSha,p=d?.targetSha??i.headSha;n(t=>({...f?{selectedSha:p,selectedRefName:null,scrollToSha:p,scrollToKey:t.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}:c,pendingMutation:!1,pendingCheckout:!1,refs:e,stashes:l,worktrees:a,historyWindow:r,totalCommitCount:Math.max(t.totalCommitCount,r.rows.length),worktreeChanges:i,worktreeFileDiffs:{},worktreeSelected:Qr(i)>0?f||t.worktreeSelected:!1})),f&&ai(s,p)}catch{n({...c,pendingMutation:!1,pendingCheckout:!1})}else n({...c,pendingMutation:!1});throw t}if(e===`checkout`){let[e,r,i,a]=await ri(s);n(t=>({pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:u?t.graphAnimationSuppressToken+1:t.graphAnimationSuppressToken,refs:e,historyWindow:r,totalCommitCount:Math.max(t.totalCommitCount,r.rows.length),worktreeChanges:i,worktreeFileDiffs:{},worktreeSelected:Zr(i)>0||Qr(i)>0&&t.worktreeSelected,worktrees:a,selectedRefName:null,mergePreview:null})),t().viewMode===`reflog`&&t().loadReflog();return}let[p,m]=await ni(s);if(t().loadWorktreeChanges(),t().loadWorktrees(),e===`fetch`){let e=si(p),r=e&&ci(m,e)?e:null;n(e=>({pendingMutation:!1,refs:p,historyWindow:m,totalCommitCount:Math.max(e.totalCommitCount,m.rows.length),selectedSha:r??e.selectedSha,selectedRefName:null,scrollToSha:r??e.scrollToSha,scrollToKey:r?e.scrollToKey+1:e.scrollToKey,commitDetail:r?null:e.commitDetail,commitDiff:r?null:e.commitDiff,commitPRs:r?[]:e.commitPRs,commitFileDiffs:r?{}:e.commitFileDiffs,mergePreview:null})),r&&ai(s,r),t().viewMode===`reflog`&&t().loadReflog();return}if(e===`move`){n(e=>({pendingMutation:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:p,historyWindow:m,selectedRefName:r,selectedSha:i,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),ai(s,i);return}if(e===`push`&&t().watchCommitCIStatus(i),e===`create`||e===`create-tag`){n(e=>({pendingMutation:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:p,historyWindow:m,selectedRefName:r,selectedSha:i,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),ai(s,i);return}n(e=>({pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:p,historyWindow:m,selectedRefName:null,mergePreview:null}))},performCommitAction:async(e,r)=>{let{repoPath:i}=t(),a=t().repoId;if(!a||!i||t().pendingMutation)return;let o=ei(t()),s=o.historyWindow?.rows??[],c=null;if(e===`uncommit`)c=er(s,o.refs,r);else{let t=s.find(e=>e.sha===r),n=e===`revert`?`Revert "${t?.subject??r.slice(0,8)}"`:t?.subject??r.slice(0,8);c=tr(s,o.refs,n,e)}$r(n,o,c);let l;try{l=await Yr((async()=>{try{return await ln(a,e,r)}catch(t){if(pi(t)){let t=await Rt({path:i});return a=t.repoId,n({repoId:a,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await ln(a,e,r)}throw t}})(),Kr)}catch(e){throw n({...o,pendingMutation:!1}),e}let[u,d]=await ni(a),f=l.headSha,p=e===`uncommit`?-1:1;n(e=>({pendingMutation:!1,graphAnimationSuppressToken:c?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:u,historyWindow:d,totalCommitCount:Math.max(e.totalCommitCount+p,d.rows.length),selectedSha:f,selectedRefName:null,scrollToSha:f,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),ai(a,f),t().loadWorktreeChanges(),t().viewMode===`reflog`&&t().loadReflog()},performMergeRef:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!i||!r||t().pendingMutation)return;let a=ei(t()),o=rr(a.historyWindow?.rows??[],a.refs,e),s=a.refs.find(e=>e.kind===`head`&&e.isCurrent)?.shortName;$r(n,a,o,s);let c;try{c=await Yr((async()=>{try{return await dn(i,e)}catch(t){if(pi(t)){let t=await Rt({path:r});return i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await dn(i,e)}throw t}})(),Kr)}catch(e){let t=null;try{t=await Gt(i)}catch(e){console.error(`Failed to load worktree after failed merge:`,e)}throw n({...a,pendingMutation:!1,...t?{worktreeChanges:t,worktreeFileDiffs:{},worktreeSelected:Zr(t)>0}:{}}),e}let[l,u]=await ni(i),d=c.headSha,f=l.find(e=>e.kind===`head`&&e.isCurrent)?.shortName??s;n(e=>({pendingMutation:!1,graphAnimationSuppressToken:o?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:l,historyWindow:u,totalCommitCount:Math.max(e.totalCommitCount+1,u.rows.length),selectedSha:f?null:d,selectedRefName:f??null,scrollToSha:d,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),f||ai(i,d),t().loadWorktreeChanges()},performRebaseRef:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!i||!r||t().pendingMutation)return;let a=ei(t()),o=ir(a.historyWindow?.rows??[],a.refs,e);$r(n,a,o);let s;try{s=await Yr((async()=>{try{return await fn(i,e)}catch(t){if(pi(t)){let t=await Rt({path:r});return i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await fn(i,e)}throw t}})(),Kr)}catch(e){let t=null,r=null,o=null;try{[t,r,o]=await Promise.all([Ut(i),tn(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:Ur,firstParent:!1,topoOrder:!0}),Gt(i)])}catch(e){console.error(`Failed to load graph after failed rebase:`,e)}throw n(e=>!t||!r?{...a,pendingMutation:!1,...o?{worktreeChanges:o,worktreeFileDiffs:{},worktreeSelected:Zr(o)>0}:{}}:{pendingMutation:!1,refs:t,historyWindow:r,totalCommitCount:Math.max(e.totalCommitCount,r.rows.length),selectedSha:null,selectedRefName:null,scrollToSha:o?.headSha??null,scrollToKey:o?e.scrollToKey+1:e.scrollToKey,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null,worktreeChanges:o,worktreeFileDiffs:{},worktreeSelected:o?Zr(o)>0:e.worktreeSelected}),e}let[c,l]=await ni(i),u=s.headSha;n(e=>({pendingMutation:!1,graphAnimationSuppressToken:o?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:c,historyWindow:l,totalCommitCount:Math.max(e.totalCommitCount,l.rows.length),selectedSha:u,selectedRefName:null,scrollToSha:u,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),ai(i,u),t().loadWorktreeChanges()},abortInProgressOperation:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!(!i||!r)&&!t().pendingMutation){n({pendingMutation:!0});try{let a;try{a=await pn(i,e)}catch(t){if(pi(t)){let t=await Rt({path:r});i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),a=await pn(i,e)}else throw t}let[o,s]=await ni(i),c=a.headSha;n(e=>({pendingMutation:!1,refs:o,historyWindow:s,totalCommitCount:Math.max(e.totalCommitCount,s.rows.length),selectedSha:c,selectedRefName:null,scrollToSha:c,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null,worktreeChanges:a.changes,worktreeFileDiffs:{},worktreeSelected:Qr(a.changes)>0})),ai(i,c),t().viewMode===`reflog`&&t().loadReflog()}catch(r){n({pendingMutation:!1}),t().showError(`Abort ${e} failed`,r)}}},continueInProgressOperation:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!(!i||!r)&&!t().pendingMutation){n({pendingMutation:!0});try{let a;try{a=await mn(i,e)}catch(t){if(pi(t)){let t=await Rt({path:r});i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),a=await mn(i,e)}else throw t}let[o,s]=await ni(i),c=a.headSha;n(e=>({pendingMutation:!1,refs:o,historyWindow:s,totalCommitCount:Math.max(e.totalCommitCount,s.rows.length),selectedSha:c,selectedRefName:null,scrollToSha:c,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null,worktreeChanges:a.changes,worktreeFileDiffs:{},worktreeSelected:Qr(a.changes)>0})),ai(i,c),t().viewMode===`reflog`&&t().loadReflog()}catch(r){let a=null,o=null,s=null;try{[a,o,s]=await Promise.all([Ut(i),tn(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:Ur,firstParent:!1,topoOrder:!0}),Gt(i)])}catch(e){console.error(`Failed to reload state after failed continue:`,e)}n(e=>({pendingMutation:!1,...a&&o?{refs:a,historyWindow:o,totalCommitCount:Math.max(e.totalCommitCount,o.rows.length)}:{},...s?{worktreeChanges:s,worktreeFileDiffs:{},worktreeSelected:Zr(s)>0||e.worktreeSelected}:{}})),t().showError(`Continue ${e} failed`,r)}}},checkoutSha:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!i||!r||t().pendingMutation)return;let a=ei(t()),o=Qn(a.historyWindow?.rows??[],a.refs,null,e),s=a.worktreeChanges?Vn(a.worktreeChanges,e,null):null;n(o?{pendingMutation:!0,pendingCheckout:!0,refs:o.refs,historyWindow:ti(a.historyWindow,o.rows),worktreeChanges:s,selectedRefName:null,mergePreview:null}:{pendingMutation:!0,pendingCheckout:!0,worktreeChanges:s});try{await Yr((async()=>{try{await hn(i,`checkout`,e,e)}catch(t){if(pi(t))i=(await Rt({path:r})).repoId,n({repoId:i}),await hn(i,`checkout`,e,e);else throw t}})(),Kr)}catch(e){throw n({...a,pendingMutation:!1,pendingCheckout:!1}),e}let[c,l,u,d]=await ri(i);n(e=>({pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:o?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:c,historyWindow:l,totalCommitCount:Math.max(e.totalCommitCount,l.rows.length),worktreeChanges:u,worktreeFileDiffs:{},worktreeSelected:Zr(u)>0||Qr(u)>0&&e.worktreeSelected,worktrees:d,selectedRefName:null,mergePreview:null})),t().viewMode===`reflog`&&t().loadReflog()}}}),Di=5e3;function Oi(e){let t=[],n=new Map;for(let r of e){if(r.kind!==`ide`){t.push({...r,count:1});continue}let e=`${r.agent}\0${r.ide}\0${r.cwd}`,i=n.get(e);if(i)i.count+=1;else{let i={...r,count:1};n.set(e,i),t.push(i)}}return t}function ki(e,t=e=>e.cwd){let n=new Map;for(let r of Oi(e)){let e=t(r),i=n.get(e);i||(i={cwd:e,sessions:[]},n.set(e,i)),i.sessions.push(r)}return[...n.values()]}function Ai(e){return e.kind===`ide`?e.ide??`ide`:e.kind===`terminal`?e.tty?.replace(`/dev/`,``)??`terminal`:`background`}function ji(){let[e,t]=(0,b.useState)([]),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(!1),c=R(e=>e.showError),l=(0,b.useCallback)(async()=>{let e=await _n();t(e.sessions),r(e.capabilities)},[]);return(0,b.useEffect)(()=>{let e=!1,n=()=>{_n().then(n=>{e||(t(n.sessions),r(n.capabilities))}).catch(()=>{})};n();let i=setInterval(n,Di);return()=>{e=!0,clearInterval(i)}},[]),{sessions:e,capabilities:n,focusingPid:i,installing:o,focus:(0,b.useCallback)(async e=>{a(e.pid),console.info(`[agent-focus] click`,{pid:e.pid,cwd:e.cwd,tty:e.tty,kind:e.kind});try{let t=await vn(e.pid,e.cwd);return console.info(`[agent-focus] response`,t),t.ok?!0:(c(`Could not focus agent session`,t.error??`Unknown error`),!1)}catch(e){return console.error(`[agent-focus] request failed`,e),c(`Could not focus agent session`,e),!1}finally{a(null)}},[c]),install:(0,b.useCallback)(async()=>{s(!0);try{let e=await yn();if(!e.ok){c(`Extension install failed`,e.error??`Unknown error`);return}await l().catch(()=>{})}catch(e){c(`Extension install failed`,e)}finally{s(!1)}},[l,c]),canInstallWindowCalls:n?.canInstallWindowCalls===!0&&!n.canFocusTerminals&&e.some(e=>e.kind===`terminal`)}}var Mi=`#D97757`,Ni=[[12,6.6],[16.2,8.6],[17.3,13.2],[14.3,16.9],[9.7,16.9],[6.7,13.2],[7.8,8.6]];function Pi({agent:e,size:t=12,busy:n=!1}){let r=(0,b.useId)(),i={width:t,height:t,style:{flexShrink:0,animation:n?`agent-icon-pulse 1.2s ease-in-out infinite`:void 0},"aria-label":e,role:`img`};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`style`,{children:`@keyframes agent-icon-pulse { 50% { opacity: 0.25; } }`}),e===`claude`?(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,...i,children:(0,y.jsxs)(`g`,{stroke:Mi,strokeWidth:`2.8`,strokeLinecap:`round`,children:[(0,y.jsx)(`line`,{x1:`12`,y1:`2.5`,x2:`12`,y2:`21.5`}),(0,y.jsx)(`line`,{x1:`2.5`,y1:`12`,x2:`21.5`,y2:`12`}),(0,y.jsx)(`line`,{x1:`5.3`,y1:`5.3`,x2:`18.7`,y2:`18.7`}),(0,y.jsx)(`line`,{x1:`18.7`,y1:`5.3`,x2:`5.3`,y2:`18.7`})]})}):(0,y.jsxs)(`svg`,{viewBox:`0 0 24 24`,...i,children:[(0,y.jsx)(`defs`,{children:(0,y.jsxs)(`linearGradient`,{id:r,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,y.jsx)(`stop`,{offset:`0`,stopColor:`#9a86ee`}),(0,y.jsx)(`stop`,{offset:`1`,stopColor:`#3d31ee`})]})}),(0,y.jsxs)(`g`,{fill:`url(#${r})`,children:[Ni.map(([e,t])=>(0,y.jsx)(`circle`,{cx:e,cy:t,r:5},`${e}-${t}`)),(0,y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`6.5`})]}),(0,y.jsxs)(`g`,{stroke:`#fff`,strokeWidth:`2.1`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,children:[(0,y.jsx)(`path`,{d:`M8.8 9 L11.8 12 L8.8 15`}),(0,y.jsx)(`line`,{x1:`13.4`,y1:`15`,x2:`16.8`,y2:`15`})]})]})]})}var z=8;function Fi(e){return e.replace(/[\\/]+$/,``).split(/[\\/]/).filter(Boolean).pop()??e}function Ii(e){return e.replace(/[^a-z0-9_-]/gi,`_`)}function Li(e){if(e.trim().length===0)return null;let t=e.lastIndexOf(`/`),n=e.lastIndexOf(`\\`),r=Math.max(t,n);if(r===-1)return{folder:`.`,prefix:e};let i=e.slice(r+1),a=e[r],o=e.slice(0,r);return/^[A-Za-z]:$/.test(o)&&(o+=a),o||=e.startsWith(`/`)||e.startsWith(`\\`)?a:`.`,{folder:o,prefix:i}}function Ri(e){let t=e.replace(/[\\/]+$/,``)||e,n=t.includes(`\\`)&&!t.includes(`/`)?`\\`:`/`;if(/^[A-Za-z]:[\\/]/.test(t)){let e=`${t.slice(0,2)}${n}`,r=[{label:e,path:e}],i=e;for(let e of t.slice(3).split(/[\\/]+/).filter(Boolean))i=i.endsWith(n)?`${i}${e}`:`${i}${n}${e}`,r.push({label:e,path:i});return r}if(t.startsWith(`/`)||t.startsWith(`\\`)){let e=[{label:`/`,path:`/`}],n=``;for(let r of t.split(/[\\/]+/).filter(Boolean))n=`${n}/${r}`,e.push({label:r,path:n});return e}let r=``;return t.split(/[\\/]+/).filter(Boolean).map(e=>(r=r?`${r}${n}${e}`:e,{label:e,path:r}))}function zi({onOpen:e,error:t,recentRepos:n,discoveredFolder:r,discoveredRepos:i=[]}){let{sessions:a,focusingPid:o,focus:s}=ji(),[c,l]=(0,b.useState)(``),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)({}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),[v,x]=(0,b.useState)(!1),[S,C]=(0,b.useState)([]),[w,T]=(0,b.useState)(0),ee=(0,b.useCallback)(async(e,t)=>{e&&p(t=>({...t,[e]:{...t[e],expanded:!0,loading:!0,error:void 0}}));try{let n=await Ht(e);p(e=>({...e,[n.path]:{listing:n,expanded:!0,loading:!1,error:n.error}})),(!e||t?.makeRoot)&&d(n.path)}catch(t){let n=t instanceof Error?t.message:`Unable to read directory`;e&&p(t=>({...t,[e]:{...t[e],expanded:!0,loading:!1,error:n}}))}},[]);(0,b.useEffect)(()=>{ee(void 0,{makeRoot:!0})},[ee]),(0,b.useEffect)(()=>{if(!m){_(!1),x(!1);return}let e=Li(c);if(!e){C([]),_(!1),x(!1);return}let t=!1,n=window.setTimeout(()=>{x(!0),Ht(e.folder).then(n=>{if(t)return;let r=e.prefix.toLowerCase(),i=n.entries.filter(e=>r.length===0||e.name.toLowerCase().startsWith(r)).slice(0,z);C(i),T(0),_(m&&i.length>0)}).catch(()=>{t||(C([]),_(!1))}).finally(()=>{t||x(!1)})},120);return()=>{t=!0,window.clearTimeout(n)}},[c,m]);function te(t){t.preventDefault();let n=c.trim();n&&e(n)}function E(e){l(e.path),_(!1),T(0)}function ne(e){if(!g||S.length===0){e.key===`Escape`&&_(!1);return}if(e.key===`ArrowDown`){e.preventDefault(),T(e=>(e+1)%S.length);return}if(e.key===`ArrowUp`){e.preventDefault(),T(e=>(e-1+S.length)%S.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),E(S[w]);return}e.key===`Escape`&&(e.preventDefault(),_(!1))}function re(e){let t=f[e.path];if(t?.expanded){p(n=>({...n,[e.path]:{...t,expanded:!1}}));return}if(t?.listing){p(n=>({...n,[e.path]:{...t,expanded:!0}}));return}ee(e.path)}function ie(t,n){let r=f[t],i=r?.listing?.entries??[];return r?.error?(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:34+n*18},children:r.error}):!r?.loading&&i.length===0?(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:34+n*18},children:`No folders`}):i.map(t=>{let r=f[t.path],i=r?.expanded??!1,a=r?.loading??!1;return(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:`repo-open-tree-row${t.isGitRepo?` repo-open-tree-row-repo`:``}`,onClick:()=>l(t.path),onDoubleClick:()=>{t.isGitRepo&&e(t.path)},style:{paddingLeft:10+n*18},children:[(0,y.jsx)(`button`,{type:`button`,className:`repo-open-expand`,onClick:e=>{e.stopPropagation(),re(t)},"aria-label":i?`Collapse ${t.name}`:`Expand ${t.name}`,"aria-controls":`folder-${Ii(t.path)}`,title:i?`Collapse`:`Expand`,children:a?`...`:i?`-`:`+`}),(0,y.jsx)(`span`,{className:`repo-open-folder-name`,children:t.name}),t.isGitRepo&&(0,y.jsx)(`span`,{className:`repo-open-repo-badge`,children:`repo`}),t.isGitRepo&&(0,y.jsx)(`button`,{type:`button`,className:`repo-open-row-action`,onClick:n=>{n.stopPropagation(),e(t.path)},children:`Open`})]}),i&&(0,y.jsx)(`div`,{id:`folder-${Ii(t.path)}`,children:r?.loading?(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:34+(n+1)*18},children:`Loading...`}):ie(t.path,n+1)})]},t.path)})}let ae=ki(a.filter(e=>e.gitRoot!==null),e=>e.gitRoot),oe=u?f[u]?.listing:null,se=!u||f[u]?.loading,ce=m&&(v||g&&S.length>0);return(0,y.jsxs)(`div`,{className:`repo-open-page`,children:[(0,y.jsx)(`style`,{children:`
13
+ .repo-open-page {
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ height: 100%;
18
+ width: 100%;
19
+ background: #171820;
20
+ color: #d7dae5;
21
+ padding: 24px;
22
+ box-sizing: border-box;
23
+ }
24
+
25
+ .repo-open-stack {
26
+ width: min(1360px, 100%);
27
+ max-height: 100%;
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: 16px;
31
+ min-height: 0;
32
+ }
33
+
34
+ .repo-open-agents-card {
35
+ flex-shrink: 0;
36
+ max-height: 42%;
37
+ overflow: auto;
38
+ overscroll-behavior: contain;
39
+ background: linear-gradient(180deg, #262a3a 0%, #222430 100%);
40
+ border: 1px solid #4a5366;
41
+ border-radius: 8px;
42
+ box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
43
+ padding: 14px 16px 16px;
44
+ }
45
+
46
+ .repo-open-agents-brand {
47
+ display: flex;
48
+ justify-content: center;
49
+ margin-bottom: 8px;
50
+ }
51
+
52
+ .repo-open-agents-logo {
53
+ width: 34px;
54
+ height: 34px;
55
+ display: block;
56
+ }
57
+
58
+ .repo-open-agents-title {
59
+ color: #eef0f6;
60
+ font-size: 14px;
61
+ font-weight: 650;
62
+ margin-bottom: 10px;
63
+ }
64
+
65
+ .repo-open-agents-grid {
66
+ display: grid;
67
+ grid-template-columns: repeat(auto-fill, minmax(min(760px, 100%), 1fr));
68
+ gap: 8px;
69
+ }
70
+
71
+ .repo-open-shell {
72
+ flex: 1;
73
+ width: 100%;
74
+ min-height: 380px;
75
+ background: #222430;
76
+ border: 1px solid #343847;
77
+ border-radius: 8px;
78
+ box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
79
+ display: flex;
80
+ flex-direction: column;
81
+ overflow: hidden;
82
+ }
83
+
84
+ .repo-open-version {
85
+ flex-shrink: 0;
86
+ align-self: center;
87
+ color: #777d8e;
88
+ font-size: 12px;
89
+ line-height: 1;
90
+ }
91
+
92
+ .repo-open-header {
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: space-between;
96
+ gap: 16px;
97
+ padding: 18px 20px;
98
+ border-bottom: 1px solid #343847;
99
+ background: #1d1f29;
100
+ }
101
+
102
+ .repo-open-title {
103
+ margin: 0;
104
+ font-size: 18px;
105
+ line-height: 1.2;
106
+ font-weight: 650;
107
+ color: #eef0f6;
108
+ }
109
+
110
+ .repo-open-form {
111
+ display: flex;
112
+ align-items: center;
113
+ gap: 8px;
114
+ min-width: min(520px, 58%);
115
+ }
116
+
117
+ .repo-open-input-wrap {
118
+ position: relative;
119
+ flex: 1;
120
+ min-width: 0;
121
+ }
122
+
123
+ .repo-open-input {
124
+ flex: 1;
125
+ min-width: 0;
126
+ width: 100%;
127
+ height: 32px;
128
+ background: #171820;
129
+ border: 1px solid #3d4253;
130
+ border-radius: 5px;
131
+ color: #eef0f6;
132
+ font-size: 13px;
133
+ padding: 0 10px;
134
+ outline: none;
135
+ font-family: inherit;
136
+ }
137
+
138
+ .repo-open-input:focus {
139
+ border-color: #6ea8fe;
140
+ }
141
+
142
+ .repo-open-path-suggestions {
143
+ position: absolute;
144
+ z-index: 20;
145
+ top: calc(100% + 6px);
146
+ left: 0;
147
+ right: 0;
148
+ max-height: 238px;
149
+ overflow: auto;
150
+ overscroll-behavior: contain;
151
+ padding: 5px;
152
+ border: 1px solid #3d4253;
153
+ border-radius: 6px;
154
+ background: #171820;
155
+ box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
156
+ }
157
+
158
+ .repo-open-path-suggestion {
159
+ width: 100%;
160
+ min-width: 0;
161
+ min-height: 34px;
162
+ display: flex;
163
+ align-items: center;
164
+ gap: 8px;
165
+ padding: 6px 8px;
166
+ border: none;
167
+ border-radius: 4px;
168
+ background: transparent;
169
+ color: #d7dae5;
170
+ font: inherit;
171
+ text-align: left;
172
+ cursor: pointer;
173
+ }
174
+
175
+ .repo-open-path-suggestion-active,
176
+ .repo-open-path-suggestion:hover {
177
+ background: #2a2e3b;
178
+ }
179
+
180
+ .repo-open-path-suggestion-main {
181
+ flex: 1;
182
+ min-width: 0;
183
+ display: flex;
184
+ flex-direction: column;
185
+ gap: 2px;
186
+ }
187
+
188
+ .repo-open-path-suggestion-name,
189
+ .repo-open-path-suggestion-path {
190
+ max-width: 100%;
191
+ overflow: hidden;
192
+ text-overflow: ellipsis;
193
+ white-space: nowrap;
194
+ }
195
+
196
+ .repo-open-path-suggestion-name {
197
+ color: #eef0f6;
198
+ font-size: 13px;
199
+ font-weight: 650;
200
+ }
201
+
202
+ .repo-open-path-suggestion-path {
203
+ color: #8f96a8;
204
+ font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
205
+ }
206
+
207
+ .repo-open-path-suggestions-loading {
208
+ min-height: 30px;
209
+ display: flex;
210
+ align-items: center;
211
+ padding: 0 8px;
212
+ color: #8f96a8;
213
+ font-size: 12px;
214
+ }
215
+
216
+ .repo-open-button,
217
+ .repo-open-row-action,
218
+ .repo-open-root-action,
219
+ .repo-open-root-nav {
220
+ border: 1px solid #4a5366;
221
+ border-radius: 5px;
222
+ background: #2b3140;
223
+ color: #f1f3f8;
224
+ font: inherit;
225
+ font-size: 12px;
226
+ cursor: pointer;
227
+ }
228
+
229
+ .repo-open-button {
230
+ height: 32px;
231
+ padding: 0 14px;
232
+ font-weight: 650;
233
+ }
234
+
235
+ .repo-open-button:disabled {
236
+ cursor: default;
237
+ color: #777d8e;
238
+ background: #242733;
239
+ border-color: #343847;
240
+ }
241
+
242
+ .repo-open-body {
243
+ flex: 1;
244
+ min-height: 0;
245
+ display: grid;
246
+ grid-template-columns: minmax(0, 1fr) 460px;
247
+ }
248
+
249
+ .repo-open-explorer {
250
+ min-width: 0;
251
+ min-height: 0;
252
+ display: flex;
253
+ flex-direction: column;
254
+ overflow: hidden;
255
+ border-right: 1px solid #343847;
256
+ }
257
+
258
+ .repo-open-explorer-head {
259
+ display: flex;
260
+ align-items: center;
261
+ gap: 8px;
262
+ min-height: 44px;
263
+ padding: 0 12px;
264
+ border-bottom: 1px solid #343847;
265
+ background: #20232d;
266
+ }
267
+
268
+ .repo-open-root-nav {
269
+ width: 30px;
270
+ height: 26px;
271
+ padding: 0;
272
+ }
273
+
274
+ .repo-open-root-nav:disabled {
275
+ cursor: default;
276
+ color: #5f6575;
277
+ border-color: #343847;
278
+ background: #222430;
279
+ }
280
+
281
+ .repo-open-root-path {
282
+ flex: 1;
283
+ min-width: 0;
284
+ display: flex;
285
+ align-items: center;
286
+ gap: 2px;
287
+ overflow: auto hidden;
288
+ scrollbar-width: none;
289
+ white-space: nowrap;
290
+ font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
291
+ color: #aeb5c6;
292
+ }
293
+
294
+ .repo-open-root-path::-webkit-scrollbar {
295
+ display: none;
296
+ }
297
+
298
+ .repo-open-root-crumb {
299
+ flex: 0 0 auto;
300
+ max-width: 160px;
301
+ overflow: hidden;
302
+ text-overflow: ellipsis;
303
+ white-space: nowrap;
304
+ border: 1px solid transparent;
305
+ border-radius: 4px;
306
+ background: transparent;
307
+ color: #aeb5c6;
308
+ font: inherit;
309
+ padding: 3px 5px;
310
+ cursor: pointer;
311
+ }
312
+
313
+ .repo-open-root-crumb:hover {
314
+ border-color: #3d4253;
315
+ background: #2a2e3b;
316
+ color: #eef0f6;
317
+ }
318
+
319
+ .repo-open-root-separator {
320
+ flex: 0 0 auto;
321
+ color: #596072;
322
+ font-size: 11px;
323
+ }
324
+
325
+ .repo-open-root-action {
326
+ height: 26px;
327
+ padding: 0 10px;
328
+ color: #b7f0c0;
329
+ border-color: #3f7350;
330
+ background: #213229;
331
+ }
332
+
333
+ .repo-open-tree {
334
+ flex: 1;
335
+ min-width: 0;
336
+ min-height: 0;
337
+ overflow: auto;
338
+ overscroll-behavior: contain;
339
+ padding: 8px 0;
340
+ }
341
+
342
+ .repo-open-tree-row {
343
+ display: flex;
344
+ align-items: center;
345
+ gap: 8px;
346
+ min-height: 30px;
347
+ padding-top: 0;
348
+ padding-right: 10px;
349
+ padding-bottom: 0;
350
+ color: #c7ccd8;
351
+ cursor: default;
352
+ box-sizing: border-box;
353
+ }
354
+
355
+ .repo-open-tree-row:hover {
356
+ background: #2a2e3b;
357
+ }
358
+
359
+ .repo-open-tree-row-repo {
360
+ color: #eef0f6;
361
+ }
362
+
363
+ .repo-open-expand {
364
+ width: 20px;
365
+ height: 20px;
366
+ flex: 0 0 20px;
367
+ display: inline-flex;
368
+ align-items: center;
369
+ justify-content: center;
370
+ border: 1px solid transparent;
371
+ border-radius: 4px;
372
+ background: transparent;
373
+ color: #8f96a8;
374
+ font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
375
+ cursor: pointer;
376
+ }
377
+
378
+ .repo-open-expand:hover {
379
+ border-color: #3d4253;
380
+ background: #20232d;
381
+ color: #d7dae5;
382
+ }
383
+
384
+ .repo-open-folder-name {
385
+ flex: 1;
386
+ min-width: 0;
387
+ overflow: hidden;
388
+ text-overflow: ellipsis;
389
+ white-space: nowrap;
390
+ font-size: 13px;
391
+ }
392
+
393
+ .repo-open-repo-badge {
394
+ flex: 0 0 auto;
395
+ border: 1px solid #3f7350;
396
+ border-radius: 4px;
397
+ padding: 2px 6px;
398
+ color: #b7f0c0;
399
+ background: #213229;
400
+ font-size: 11px;
401
+ line-height: 1;
402
+ }
403
+
404
+ .repo-open-row-action {
405
+ height: 24px;
406
+ padding: 0 9px;
407
+ color: #eef0f6;
408
+ }
409
+
410
+ .repo-open-tree-empty {
411
+ min-height: 28px;
412
+ display: flex;
413
+ align-items: center;
414
+ color: #777d8e;
415
+ font-size: 12px;
416
+ box-sizing: border-box;
417
+ }
418
+
419
+ .repo-open-side {
420
+ min-width: 0;
421
+ min-height: 0;
422
+ display: flex;
423
+ flex-direction: column;
424
+ gap: 18px;
425
+ padding: 16px;
426
+ overflow: auto;
427
+ }
428
+
429
+ .repo-open-section {
430
+ display: flex;
431
+ flex-direction: column;
432
+ gap: 8px;
433
+ }
434
+
435
+ .repo-open-section-title {
436
+ color: #8f96a8;
437
+ font-size: 12px;
438
+ font-weight: 650;
439
+ }
440
+
441
+ .repo-open-list {
442
+ display: flex;
443
+ flex-direction: column;
444
+ gap: 6px;
445
+ }
446
+
447
+ .repo-open-list-button {
448
+ display: flex;
449
+ flex-direction: column;
450
+ align-items: flex-start;
451
+ gap: 3px;
452
+ min-width: 0;
453
+ border: 1px solid #343847;
454
+ border-radius: 6px;
455
+ background: #1d1f29;
456
+ color: #d7dae5;
457
+ cursor: pointer;
458
+ padding: 9px 10px;
459
+ text-align: left;
460
+ font: inherit;
461
+ }
462
+
463
+ .repo-open-list-button:hover {
464
+ border-color: #4a5366;
465
+ background: #242835;
466
+ }
467
+
468
+ .repo-open-list-name {
469
+ max-width: 100%;
470
+ overflow: hidden;
471
+ text-overflow: ellipsis;
472
+ white-space: nowrap;
473
+ font-size: 13px;
474
+ font-weight: 650;
475
+ }
476
+
477
+ .repo-open-list-path,
478
+ .repo-open-folder-caption {
479
+ max-width: 100%;
480
+ overflow: hidden;
481
+ text-overflow: ellipsis;
482
+ white-space: nowrap;
483
+ font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
484
+ color: #8f96a8;
485
+ }
486
+
487
+ .repo-open-claude-row {
488
+ position: relative;
489
+ padding-right: 62px;
490
+ }
491
+
492
+ .repo-open-agent-name {
493
+ display: inline-flex;
494
+ align-items: center;
495
+ gap: 7px;
496
+ }
497
+
498
+ .repo-open-claude-chips {
499
+ display: flex;
500
+ flex-wrap: wrap;
501
+ gap: 5px;
502
+ margin-top: 3px;
503
+ min-width: 0;
504
+ max-width: 100%;
505
+ align-self: stretch;
506
+ }
507
+
508
+ .repo-open-claude-chip {
509
+ border: 1px solid #3d4253;
510
+ border-radius: 4px;
511
+ background: #20232d;
512
+ color: #aeb5c6;
513
+ padding: 3px 8px;
514
+ font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
515
+ cursor: pointer;
516
+ flex: 1 1 80%;
517
+ min-width: 0;
518
+ max-width: 80%;
519
+ overflow: hidden;
520
+ text-overflow: ellipsis;
521
+ white-space: nowrap;
522
+ text-align: left;
523
+ }
524
+
525
+ .repo-open-claude-chip:hover:not(:disabled) {
526
+ border-color: #6ea8fe;
527
+ color: #eef0f6;
528
+ background: #262c3c;
529
+ }
530
+
531
+ .repo-open-claude-chip-busy {
532
+ border-color: #d8b45a;
533
+ color: #ecd08a;
534
+ animation: repo-open-chip-pulse 1.2s ease-in-out infinite;
535
+ }
536
+
537
+ @keyframes repo-open-chip-pulse {
538
+ 50% { opacity: 0.55; }
539
+ }
540
+
541
+ .repo-open-claude-chip:disabled {
542
+ cursor: default;
543
+ color: #5f6575;
544
+ border-color: #2c2f3b;
545
+ }
546
+
547
+ .repo-open-claude-open {
548
+ position: absolute;
549
+ top: 50%;
550
+ right: 10px;
551
+ transform: translateY(-50%);
552
+ height: 24px;
553
+ }
554
+
555
+ .repo-open-error {
556
+ margin: 0;
557
+ color: #ff9ca8;
558
+ font-size: 12px;
559
+ line-height: 1.4;
560
+ }
561
+
562
+ @media (max-width: 760px) {
563
+ .repo-open-page {
564
+ padding: 12px;
565
+ }
566
+
567
+ .repo-open-shell {
568
+ height: 100%;
569
+ min-height: 0;
570
+ }
571
+
572
+ .repo-open-header {
573
+ align-items: stretch;
574
+ flex-direction: column;
575
+ }
576
+
577
+ .repo-open-form {
578
+ min-width: 0;
579
+ width: 100%;
580
+ }
581
+
582
+ .repo-open-body {
583
+ grid-template-columns: 1fr;
584
+ }
585
+
586
+ .repo-open-explorer {
587
+ min-height: 340px;
588
+ border-right: none;
589
+ border-bottom: 1px solid #343847;
590
+ }
591
+
592
+ .repo-open-agents-grid {
593
+ grid-template-columns: 1fr;
594
+ }
595
+ }
596
+ `}),(0,y.jsxs)(`div`,{className:`repo-open-stack`,children:[ae.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-agents-card`,children:[(0,y.jsx)(`div`,{className:`repo-open-agents-brand`,children:(0,y.jsx)(`img`,{className:`repo-open-agents-logo`,src:`/press-kit/ingit-icon-mark-light.svg`,alt:`ingit`})}),(0,y.jsx)(`div`,{className:`repo-open-agents-title`,children:`Running agent sessions`}),(0,y.jsx)(`div`,{className:`repo-open-agents-grid`,children:ae.map(t=>(0,y.jsxs)(`div`,{className:`repo-open-list-button repo-open-claude-row`,children:[(0,y.jsxs)(`span`,{className:`repo-open-list-name repo-open-agent-name`,children:[[...new Set(t.sessions.map(e=>e.agent))].map(e=>(0,y.jsx)(Pi,{agent:e,size:15,busy:t.sessions.some(t=>t.agent===e&&t.busy)},e)),Fi(t.cwd)]}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t.cwd}),(0,y.jsx)(`span`,{className:`repo-open-claude-chips`,children:t.sessions.map(e=>(0,y.jsx)(`button`,{type:`button`,className:`repo-open-claude-chip${e.busy?` repo-open-claude-chip-busy`:``}`,disabled:!e.focusable||o!==null,title:e.focusable?`Focus this session's window — ${Ai(e)} (pid ${e.pid})`:`${Ai(e)} (pid ${e.pid}) — window focus unavailable for this session`,onClick:()=>void s(e),children:o===e.pid?`focusing…`:`${e.title??`${e.agent===`codex`?`codex `:``}${Ai(e)}`}${e.count>1?` ×${e.count}`:``}`},`${e.pid}:${e.cwd}`))}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-row-action repo-open-claude-open`,onClick:()=>e(t.cwd),children:`Open`})]},t.cwd))})]}),(0,y.jsxs)(`div`,{className:`repo-open-shell`,children:[(0,y.jsxs)(`div`,{className:`repo-open-header`,children:[(0,y.jsx)(`h1`,{className:`repo-open-title`,children:`Open repository`}),(0,y.jsxs)(`form`,{onSubmit:te,className:`repo-open-form`,children:[(0,y.jsxs)(`div`,{className:`repo-open-input-wrap`,children:[(0,y.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),onFocus:()=>{h(!0),S.length>0&&_(!0)},onBlur:()=>{h(!1),_(!1)},onKeyDown:ne,placeholder:`/home/user/my-project`,className:`repo-open-input`,autoComplete:`off`,role:`combobox`,"aria-expanded":ce,"aria-controls":`repo-open-path-suggestions`,"aria-autocomplete":`list`}),ce&&(0,y.jsx)(`div`,{id:`repo-open-path-suggestions`,className:`repo-open-path-suggestions`,role:`listbox`,children:v&&S.length===0?(0,y.jsx)(`div`,{className:`repo-open-path-suggestions-loading`,children:`Loading...`}):S.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===w,className:`repo-open-path-suggestion${t===w?` repo-open-path-suggestion-active`:``}`,onMouseEnter:()=>T(t),onMouseDown:t=>{t.preventDefault(),E(e)},children:[(0,y.jsxs)(`span`,{className:`repo-open-path-suggestion-main`,children:[(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-name`,children:e.name}),(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-path`,children:e.path})]}),e.isGitRepo&&(0,y.jsx)(`span`,{className:`repo-open-repo-badge`,children:`repo`})]},e.path))})]}),(0,y.jsx)(`button`,{type:`submit`,disabled:!c.trim(),className:`repo-open-button`,children:`Open`})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-body`,children:[(0,y.jsxs)(`section`,{className:`repo-open-explorer`,"aria-label":`Folder tree`,children:[(0,y.jsxs)(`div`,{className:`repo-open-explorer-head`,children:[(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-nav`,disabled:!oe?.parentPath,onClick:()=>{oe?.parentPath&&ee(oe.parentPath,{makeRoot:!0})},title:`Parent folder`,"aria-label":`Parent folder`,children:`..`}),(0,y.jsx)(`div`,{className:`repo-open-root-path`,children:oe?Ri(oe.path).map((e,t,n)=>(0,y.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,minWidth:0},children:[t>0&&!/^(\/|[A-Za-z]:[\\/])$/.test(n[t-1].label)&&(0,y.jsx)(`span`,{className:`repo-open-root-separator`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-crumb`,onClick:()=>void ee(e.path,{makeRoot:!0}),title:e.path,children:e.label})]},e.path)):`Loading...`}),oe?.isGitRepo&&(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-action`,onClick:()=>e(oe.path),children:`Open`})]}),(0,y.jsxs)(`div`,{className:`repo-open-tree`,children:[se&&(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:16},children:`Loading...`}),u&&!se&&ie(u,0)]})]}),(0,y.jsxs)(`aside`,{className:`repo-open-side`,children:[t&&(0,y.jsx)(`p`,{className:`repo-open-error`,children:t}),n.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Recent repositories`}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:n.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:Fi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]}),i.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Repositories`}),r&&(0,y.jsx)(`div`,{className:`repo-open-folder-caption`,children:r}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:i.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:Fi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]})]})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-version`,children:[`v`,`0.2.3`]})]})]})}var Bi={head:`Branches`,remote:`Remotes`,tag:`Tags`},Vi=[`head`,`remote`,`tag`];function Hi({refs:e,stashes:t,onSelectRef:n,onSelectStash:r,onSelectStashParent:i,selectedStashSha:a,selectedSha:o,onClose:s,onOpenSettings:c,settingsOpen:l=!1}){let[u,d]=(0,b.useState)({head:!0,remote:!0,tag:!0}),[f,p]=(0,b.useState)(``),[m,h]=(0,b.useState)(!1),g=f.toLowerCase(),_={head:[],remote:[],tag:[]};for(let t of e)g&&!t.shortName.toLowerCase().includes(g)||_[t.kind].push(t);function v(e){d(t=>({...t,[e]:!t[e]}))}return(0,y.jsxs)(`div`,{style:{width:250,flexShrink:0,height:`100%`,background:`#181825`,borderRight:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflowY:`auto`,userSelect:`none`},children:[(0,y.jsxs)(`div`,{style:{padding:`8px 14px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,borderBottom:`1px solid #313244`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[`Refs`,(0,y.jsx)(`button`,{onClick:s,title:`Hide refs`,style:{background:`none`,border:`none`,color:`#6c7086`,cursor:`pointer`,fontSize:14,padding:`0 2px`,lineHeight:1},children:`✕`})]}),(0,y.jsx)(`div`,{style:{padding:`6px 10px`,borderBottom:`1px solid #313244`},children:(0,y.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`Filter branches...`,style:{width:`100%`,background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:12,padding:`5px 8px`,outline:`none`,fontFamily:`inherit`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#45475a`}})}),(0,y.jsxs)(`div`,{style:{margin:`8px 10px 4px`,border:`1px solid #704752`,borderRadius:7,background:`#55323c`,overflow:`hidden`,flexShrink:0},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`stretch`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-expanded":m,style:{flex:1,minWidth:0,display:`flex`,alignItems:`center`,gap:7,padding:`7px 9px`,border:`none`,background:`transparent`,color:`#f5e0dc`,fontFamily:`inherit`,fontSize:12,fontWeight:700,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,transform:m?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,color:`#d7a6b2`,fontSize:9},children:`▶`}),`Stashes`,(0,y.jsx)(`span`,{style:{marginLeft:`auto`,minWidth:16,padding:`1px 5px`,borderRadius:8,background:`#311f25aa`,color:`#d7a6b2`,fontSize:10,fontWeight:600,textAlign:`center`},children:t.length})]})}),m&&(0,y.jsx)(`div`,{style:{borderTop:`1px solid #704752`},children:t.length===0?(0,y.jsx)(`div`,{style:{padding:`9px 10px 5px`,color:`#c4939f`,fontSize:11},children:`No stashed changes`}):(0,y.jsx)(`div`,{children:t.map(e=>{let t=Ui(e.message);return(0,y.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":a===e.sha,onClick:()=>r(e.sha),onKeyDown:t=>{t.target===t.currentTarget&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e.sha))},style:{padding:`8px 9px`,borderBottom:`1px solid #704752`,display:`flex`,flexDirection:`column`,gap:5,background:a===e.sha?`#f5c2e71a`:`transparent`,boxShadow:a===e.sha?`inset 3px 0 #f5c2e7`:`none`,cursor:`pointer`},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:7},children:(0,y.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,y.jsx)(`div`,{title:e.message,style:{color:`#f5e0dc`,fontSize:11,fontWeight:650,lineHeight:1.35,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.message||e.selector}),(0,y.jsxs)(`div`,{style:{marginTop:2,color:`#c4939f`,fontSize:9.5},children:[e.selector,t.context?` · ${t.context}`:``,` · `,Wi(e.createdAt)]})]})}),(0,y.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),i(e.parentSha)},title:`Go to ${e.parentSha}`,style:{alignSelf:`flex-start`,padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:10,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:2},children:[`parent `,e.parentSha.slice(0,8)]})]},e.sha)})})})]}),Vi.map(e=>{let t=_[e];if(t.length===0)return null;let r=!f&&u[e];return(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{onClick:()=>v(e),style:{width:`100%`,display:`flex`,alignItems:`center`,gap:6,padding:`6px 14px`,background:`none`,border:`none`,color:`#a6adc8`,fontSize:12,fontWeight:600,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,transform:r?`rotate(-90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,fontSize:10,lineHeight:1},children:`▼`}),Bi[e],(0,y.jsx)(`span`,{style:{marginLeft:`auto`,background:`#313244`,borderRadius:8,padding:`1px 6px`,fontSize:10,color:`#6c7086`,fontWeight:500},children:t.length})]}),!r&&(0,y.jsx)(`div`,{children:t.map(e=>{let t=e.targetSha===o;return(0,y.jsxs)(`button`,{onClick:()=>n(e),title:e.name,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 14px 5px 28px`,background:t?`#313244`:`none`,border:`none`,color:t?`#89b4fa`:`#cdd6f4`,fontSize:13,fontWeight:e.isCurrent?700:`normal`,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`,overflow:`hidden`},children:[(0,y.jsx)(Gi,{kind:e.kind,isCurrent:e.isCurrent}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.shortName}),(e.ahead!=null||e.behind!=null)&&(0,y.jsxs)(`span`,{style:{display:`flex`,gap:4,flexShrink:0,fontSize:11},children:[e.ahead!=null&&e.ahead>0&&(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`↑`,e.ahead]}),e.behind!=null&&e.behind>0&&(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`↓`,e.behind]})]})]},e.name)})})]},e)}),(0,y.jsx)(`div`,{style:{marginTop:`auto`,padding:`10px`,borderTop:`1px solid #313244`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:c,title:`Open settings`,"aria-label":`Open settings`,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderRadius:5,border:`1px solid #313244`,background:l?`#89b4fa20`:`transparent`,color:l?`#89b4fa`:`#a6adc8`,fontSize:12,fontWeight:600,fontFamily:`inherit`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{color:l?`#89b4fa`:`#6c7086`},children:`⚙`}),`Settings`]})})]})}function Ui(e){let t=/^(?:WIP )?on ([^:]+):\s*(.*)$/i.exec(e);return t?{message:t[2]??e,context:`on ${t[1]}`}:{message:e,context:``}}function Wi(e){return new Date(e*1e3).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Gi({kind:e,isCurrent:t}){let n={flexShrink:0,fontSize:11,width:14,textAlign:`center`};return e===`head`?(0,y.jsx)(`span`,{style:{...n,color:t?`#a6e3a1`:`#89b4fa`},children:t?`●`:`⎇`}):e===`remote`?(0,y.jsx)(`span`,{style:{...n,color:`#94e2d5`},children:`◉`}):(0,y.jsx)(`span`,{style:{...n,color:`#f9e2af`},children:`◆`})}var Ki=g(),qi=Object.defineProperty,Ji=(e,t)=>{let n={};for(var r in e)qi(n,r,{get:e[r],enumerable:!0});return t||qi(n,Symbol.toStringTag,{value:`Module`}),n},Yi=da(),B=e=>oa(e,Yi),Xi=da();B.write=e=>oa(e,Xi);var Zi=da();B.onStart=e=>oa(e,Zi);var Qi=da();B.onFrame=e=>oa(e,Qi);var $i=da();B.onFinish=e=>oa(e,$i);var ea=[];B.setTimeout=(e,t)=>{let n=B.now()+t,r=()=>{let e=ea.findIndex(e=>e.cancel==r);~e&&ea.splice(e,1),ia-=+!!~e},i={time:n,handler:e,cancel:r};return ea.splice(ta(n),0,i),ia+=1,sa(),i};var ta=e=>~(~ea.findIndex(t=>t.time>e)||~ea.length);B.cancel=e=>{Zi.delete(e),Qi.delete(e),$i.delete(e),Yi.delete(e),Xi.delete(e)},B.sync=e=>{aa=!0,B.batchedUpdates(e),aa=!1},B.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,B.onStart(n)}return r.handler=e,r.cancel=()=>{Zi.delete(n),t=null},r};var na=typeof window<`u`?window.requestAnimationFrame:()=>{};B.use=e=>na=e,B.now=typeof performance<`u`?()=>performance.now():Date.now,B.batchedUpdates=e=>e(),B.catch=console.error,B.frameLoop=`always`,B.onDemand=()=>{},B.advance=()=>{B.frameLoop===`demand`?ua():console.warn(`Cannot call the manual advancement of rafz whilst frameLoop is not set as demand`)};var ra=-1,ia=0,aa=!1;function oa(e,t){aa?(t.delete(e),e(0)):(t.add(e),sa(),B.frameLoop===`demand`&&B.onDemand())}function sa(){ra<0&&(ra=0,B.frameLoop!==`demand`&&na(la))}function ca(){ra=-1}function la(){~ra&&(na(la),B.batchedUpdates(ua))}function ua(){let e=ra;ra=B.now();let t=ta(ra);if(t&&(fa(ea.splice(0,t),e=>e.handler()),ia-=t),!ia){ca();return}Zi.flush(),Yi.flush(e?Math.min(64,ra-e):16.667),Qi.flush(),Xi.flush(),$i.flush(),B.frameLoop===`demand`&&ia>0&&B.onDemand()}function da(){let e=new Set,t=e;return{add(n){ia+=+(t==e&&!e.has(n)),e.add(n)},delete(n){return ia-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ia-=t.size,fa(t,t=>t(n)&&e.add(t)),ia+=e.size,t=e)}}}function fa(e,t){e.forEach(e=>{try{t(e)}catch(e){B.catch(e)}})}function pa(){}var ma=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),V={arr:Array.isArray,obj:e=>!!e&&e.constructor.name===`Object`,fun:(e=>typeof e==`function`),str:e=>typeof e==`string`,num:e=>typeof e==`number`,und:e=>e===void 0};function ha(e,t){if(V.arr(e)){if(!V.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var H=(e,t)=>e.forEach(t);function ga(e,t,n){if(V.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var _a=e=>V.und(e)?[]:V.arr(e)?e:[e];function va(e,t){if(e.size){let n=Array.from(e);e.clear(),H(n,t)}}var ya=(e,...t)=>va(e,e=>e(...t)),ba=()=>typeof window>`u`||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),xa=Ji({assign:()=>Da,colors:()=>wa,createStringInterpolator:()=>Sa,skipAnimation:()=>Ta,to:()=>Ca,willAdvance:()=>Ea}),Sa,Ca,wa=null,Ta=!1,Ea=pa,Da=e=>{e.to&&(Ca=e.to),e.now&&(B.now=e.now),e.colors!==void 0&&(wa=e.colors),e.skipAnimation!=null&&(Ta=e.skipAnimation),e.createStringInterpolator&&(Sa=e.createStringInterpolator),e.requestAnimationFrame&&B.use(e.requestAnimationFrame),e.batchedUpdates&&(B.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ea=e.willAdvance),e.frameLoop&&(B.frameLoop=e.frameLoop),e.onDemand&&(B.onDemand=e.onDemand)},Oa=new Set,ka=[],Aa=[],ja=0,Ma={get idle(){return!Oa.size&&!ka.length},start(e){ja>e.priority?(Oa.add(e),B.onStart(Na)):(Pa(e),B(Ia))},advance:Ia,sort(e){if(ja)B.onFrame(()=>Ma.sort(e));else{let t=ka.indexOf(e);~t&&(ka.splice(t,1),Fa(e))}},clear(){ka=[],Oa.clear()}};function Na(){Oa.forEach(Pa),Oa.clear(),B(Ia)}function Pa(e){ka.includes(e)||Fa(e)}function Fa(e){ka.splice(La(ka,t=>t.priority>e.priority),0,e)}function Ia(e){let t=Aa;for(let n=0;n<ka.length;n++){let r=ka[n];ja=r.priority,r.idle||(Ea(r),r.advance(e),r.idle||t.push(r))}return ja=0,Aa=ka,Aa.length=0,ka=t,ka.length>0}function La(e,t){let n=e.findIndex(t);return n<0?e.length:n}var Ra=(e,t,n)=>Math.min(Math.max(n,e),t),za={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ba=`[-+]?\\d*\\.?\\d+`,Va=`[-+]?\\d*\\.?\\d+%`;function Ha(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var Ua=RegExp(`rgb`+Ha(Ba,Ba,Ba)),Wa=RegExp(`rgba`+Ha(Ba,Ba,Ba,Ba)),Ga=RegExp(`hsl`+Ha(Ba,Va,Va)),Ka=RegExp(`hsla`+Ha(Ba,Va,Va,Ba)),qa=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ja=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ya=/^#([0-9a-fA-F]{6})$/,Xa=/^#([0-9a-fA-F]{8})$/;function Za(e){let t;return typeof e==`number`?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ya.exec(e))?parseInt(t[1]+`ff`,16)>>>0:wa&&wa[e]!==void 0?wa[e]:(t=Ua.exec(e))?(eo(t[1])<<24|eo(t[2])<<16|eo(t[3])<<8|255)>>>0:(t=Wa.exec(e))?(eo(t[1])<<24|eo(t[2])<<16|eo(t[3])<<8|no(t[4]))>>>0:(t=qa.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+`ff`,16)>>>0:(t=Xa.exec(e))?parseInt(t[1],16)>>>0:(t=Ja.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Ga.exec(e))?($a(to(t[1]),ro(t[2]),ro(t[3]))|255)>>>0:(t=Ka.exec(e))?($a(to(t[1]),ro(t[2]),ro(t[3]))|no(t[4]))>>>0:null}function Qa(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 $a(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=Qa(i,r,e+1/3),o=Qa(i,r,e),s=Qa(i,r,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function eo(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function to(e){return(parseFloat(e)%360+360)%360/360}function no(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function ro(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function io(e){let t=Za(e);return t===null?e:(t||=0,`rgba(${(t&4278190080)>>>24}, ${(t&16711680)>>>16}, ${(t&65280)>>>8}, ${(t&255)/255})`)}var ao=(e,t,n)=>{if(V.fun(e))return e;if(V.arr(e))return ao({range:e,output:t,extrapolate:n});if(V.str(e.output[0]))return Sa(e);let r=e,i=r.output,a=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||`extend`,s=r.extrapolateRight||r.extrapolate||`extend`,c=r.easing||(e=>e);return e=>{let t=so(e,a);return oo(e,a[t],a[t+1],i[t],i[t+1],c,o,s,r.map)}};function oo(e,t,n,r,i,a,o,s,c){let l=c?c(e):e;if(l<t){if(o===`identity`)return l;o===`clamp`&&(l=t)}if(l>n){if(s===`identity`)return l;s===`clamp`&&(l=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t),l=a(l),r===-1/0?l=-l:i===1/0?l+=r:l=l*(i-r)+r,l)}function so(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var co=(e,t=`end`)=>n=>{n=t===`end`?Math.min(n,.999):Math.max(n,.001);let r=n*e;return Ra(0,1,(t===`end`?Math.floor(r):Math.ceil(r))/e)},lo=1.70158,U=lo*1.525,uo=2.70158,fo=2*Math.PI/3,po=2*Math.PI/4.5,mo=e=>{let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},ho={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-(1-e)**4,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-(-2*e+2)**4/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-(1-e)**5,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-(-2*e+2)**5/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:2**(10*e-10),easeOutExpo:e=>e===1?1:1-2**(-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-e**2),easeOutCirc:e=>Math.sqrt(1-(e-1)**2),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,easeInBack:e=>uo*e*e*e-lo*e*e,easeOutBack:e=>1+uo*(e-1)**3+lo*(e-1)**2,easeInOutBack:e=>e<.5?(2*e)**2*(3.5949095*2*e-U)/2:((2*e-2)**2*(3.5949095*(e*2-2)+U)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*fo),easeOutElastic:e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*fo)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*po))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*po)/2+1,easeInBounce:e=>1-mo(1-e),easeOutBounce:mo,easeInOutBounce:e=>e<.5?(1-mo(1-2*e))/2:(1+mo(2*e-1))/2,steps:co},go=Symbol.for(`FluidValue.get`),_o=Symbol.for(`FluidValue.observers`),vo=e=>!!(e&&e[go]),yo=e=>e&&e[go]?e[go]():e,bo=e=>e[_o]||null;function xo(e,t){e.eventObserved?e.eventObserved(t):e(t)}function So(e,t){let n=e[_o];n&&n.forEach(e=>{xo(e,t)})}var Co=class{constructor(e){if(!e&&!(e=this.get))throw Error(`Unknown getter`);wo(this,e)}},wo=(e,t)=>Do(e,go,t);function To(e,t){if(e[go]){let n=e[_o];n||Do(e,_o,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Eo(e,t){let n=e[_o];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[_o]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var Do=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Oo=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ko=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ao=RegExp(`(${Oo.source})(%|[a-z]+)`,`i`),jo=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Mo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,No=e=>{let[t,n]=Po(e);if(!t||ba())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith(`--`)?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&Mo.test(n)?No(n):n||e},Po=e=>{let t=Mo.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},Fo,Io=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,Lo=e=>e.match(Oo)??[],Ro=e=>{Fo||=wa?RegExp(`(${Object.keys(wa).join(`|`)})(?!\\w)`,`g`):/^\b$/;let t=e.output.map(e=>yo(e).replace(Mo,No).replace(ko,io).replace(Fo,io)),n=t.map(e=>Lo(e).map(Number)),r=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error(`The arity of each "output" value must be equal`);return e[t]})).map(t=>ao({...e,output:t})),i=e.range||[0,1],a=t.map(e=>Lo(e)),o=a[0].map((e,t)=>{let n=a.map(e=>{let n=e[t],r=n.indexOf(`.`);return r===-1?0:n.length-r-1});return n.every(e=>e===n[0])&&n[0]>0?n[0]:null});return e=>{let n=i.indexOf(e);if(n!==-1)return t[n];let a=!Ao.test(t[0])&&t.find(e=>Ao.test(e))?.replace(Oo,``),s=0;return t[0].replace(Oo,()=>{let t=s++,n=r[t](e),i=o[t];return`${i==null?n:n.toFixed(i)}${a||``}`}).replace(jo,Io)}},zo=`react-spring: `,Bo=e=>{let t=e,n=!1;if(typeof t!=`function`)throw TypeError(`${zo}once requires a function parameter`);return(...e)=>{n||=(t(...e),!0)}},Vo=Bo(console.warn);function Ho(){Vo(`${zo}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Uo=Bo(console.warn);function Wo(){Uo(`${zo}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Go(e){return V.str(e)&&(e[0]==`#`||/\d/.test(e)||!ba()&&Mo.test(e)||e in(wa||{}))}var Ko=ba()?b.useEffect:b.useLayoutEffect,qo=()=>{let e=(0,b.useRef)(!1);return Ko(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Jo(){let e=(0,b.useState)()[1],t=qo();return()=>{t.current&&e(Math.random())}}var Yo=e=>(0,b.useEffect)(e,Xo),Xo=[];function Zo(e){let t=(0,b.useRef)(void 0);return(0,b.useEffect)(()=>{t.current=e}),t.current}var Qo=Symbol.for(`Animated:node`),$o=e=>!!e&&e[Qo]===e,es=e=>e&&e[Qo],ts=(e,t)=>ma(e,Qo,t),ns=e=>e&&e[Qo]&&e[Qo].getPayload(),rs=class{constructor(){ts(this,this)}getPayload(){return this.payload||[]}},is=class e extends rs{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,V.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new e(t)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return V.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,V.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},as=class e extends is{constructor(e){super(0),this._string=null,this._toString=ao({output:[e,e]})}static create(t){return new e(t)}getValue(){return this._string??=this._toString(this._value)}setValue(e){if(V.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=ao({output:[this.getValue(),e]})),this._value=0,super.reset()}},os={dependencies:null},ss=class extends rs{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return ga(this.source,(n,r)=>{$o(n)?t[r]=n.getValue(e):vo(n)?t[r]=yo(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&H(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return ga(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){os.dependencies&&vo(e)&&os.dependencies.add(e);let t=ns(e);t&&H(t,e=>this.add(e))}},cs=class e extends ss{constructor(e){super(e)}static create(t){return new e(t)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let t=this.getPayload();return e.length==t.length?t.map((t,n)=>t.setValue(e[n])).some(Boolean):(super.setValue(e.map(ls)),!0)}};function ls(e){return(Go(e)?as:is).create(e)}function us(e){let t=es(e);return t?t.constructor:V.arr(e)?cs:Go(e)?as:is}var ds=(e,t)=>{let n=!V.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,b.forwardRef)((r,i)=>{let a=(0,b.useRef)(null),o=n&&(0,b.useCallback)(e=>{a.current=ms(i,e)},[i]),[s,c]=ps(r,t),l=Jo(),u=()=>{let e=a.current;n&&!e||(e?t.applyAnimatedValues(e,s.getValue(!0)):!1)===!1&&l()},d=new fs(u,c),f=(0,b.useRef)(void 0);Ko(()=>(f.current=d,H(c,e=>To(e,d)),()=>{f.current&&(H(f.current.deps,e=>Eo(e,f.current)),B.cancel(f.current.update))})),(0,b.useEffect)(u,[]),Yo(()=>()=>{let e=f.current;H(e.deps,t=>Eo(t,e))});let p=t.getComponentProps(s.getValue());return b.createElement(e,{...p,ref:o})})},fs=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type==`change`&&B.write(this.update)}};function ps(e,t){let n=new Set;return os.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new ss(e),os.dependencies=null,[e,n]}function ms(e,t){return e&&(V.fun(e)?e(t):e.current=t),t}var hs=Symbol.for(`AnimatedComponent`),gs=new WeakMap,_s=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new ss(e),getComponentProps:r=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},a=e=>{let t=vs(e)||`Anonymous`;if(V.str(e))e=a[e]||(a[e]=ds(e,i));else{let t=e[hs]??gs.get(e);if(!t){t=ds(e,i);try{e[hs]=t}catch{}gs.set(e,t)}e=t}return e.displayName=`Animated(${t})`,e};return ga(e,(t,n)=>{V.arr(e)&&(n=vs(t)),a[n]=a(t)}),{animated:a}},vs=e=>V.str(e)?e:e&&V.str(e.displayName)?e.displayName:V.fun(e)&&e.name||null;function ys(e,...t){return V.fun(e)?e(...t):e}var bs=(e,t)=>e===!0||!!(t&&e&&(V.fun(e)?e(t):_a(e).includes(t))),xs=(e,t)=>V.obj(e)?t&&e[t]:e,Ss=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Cs=e=>e,ws=(e,t=Cs)=>{let n=Ts;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));let r={};for(let i of n){let n=t(e[i],i);V.und(n)||(r[i]=n)}return r},Ts=[`config`,`onProps`,`onStart`,`onChange`,`onPause`,`onResume`,`onRest`],Es={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Ds(e){let t={},n=0;if(ga(e,(e,r)=>{Es[r]||(t[r]=e,n++)}),n)return t}function Os(e){let t=Ds(e);if(t){let n={to:t};return ga(e,(e,r)=>r in t||(n[r]=e)),n}return{...e}}function ks(e){let t=yo(e);return V.arr(t)?t.map(ks):Go(t)?xa.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function As(e){for(let t in e)return!0;return!1}function js(e){return V.fun(e)||V.arr(e)&&V.obj(e[0])}function Ms(e,t){e.ref?.delete(e),t?.delete(e)}function Ns(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var Ps={...{default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}}.default,mass:1,damping:1,easing:ho.linear,clamp:!1},Fs=class{constructor(){this.velocity=0,Object.assign(this,Ps)}};function Is(e,t,n){n&&(n={...n},Ls(n,t),t={...n,...t}),Ls(e,t),Object.assign(e,t);for(let t in Ps)e[t]??(e[t]=Ps[t]);let{frequency:r,damping:i}=e,{mass:a}=e;return V.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=(2*Math.PI/r)**2*a,e.friction=4*Math.PI*i*a/r),e}function Ls(e,t){if(!V.und(t.decay))e.duration=void 0;else{let n=!V.und(t.tension)||!V.und(t.friction);(n||!V.und(t.frequency)||!V.und(t.damping)||!V.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var Rs=[],zs=class{constructor(){this.changed=!1,this.values=Rs,this.toValues=null,this.fromValues=Rs,this.config=new Fs,this.immediate=!1}};function Bs(e,{key:t,props:n,defaultProps:r,state:i,actions:a}){return new Promise((o,s)=>{let c,l,u=bs(n.cancel??r?.cancel,t);if(u)p();else{V.und(n.pause)||(i.paused=bs(n.pause,t));let e=r?.pause;e!==!0&&(e=i.paused||bs(e,t)),c=ys(n.delay||0,t),e?(i.resumeQueue.add(f),a.pause()):(a.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(l),l.cancel(),c=l.time-B.now()}function f(){c>0&&!xa.skipAnimation?(i.delayed=!0,l=B.setTimeout(p,c),i.pauseQueue.add(d),i.timeouts.add(l)):p()}function p(){i.delayed&&=!1,i.pauseQueue.delete(d),i.timeouts.delete(l),e<=(i.cancelId||0)&&(u=!0);try{a.start({...n,callId:e,cancel:u},o)}catch(e){s(e)}}})}var Vs=(e,t)=>t.length==1?t[0]:t.some(e=>e.cancelled)?Ws(e.get()):t.every(e=>e.noop)?Hs(e.get()):Us(e.get(),t.every(e=>e.finished)),Hs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Us=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Ws=e=>({value:e,cancelled:!0,finished:!1});function Gs(e,t,n,r){let{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:c}=n;return!a&&e===s&&!t.reset?c:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;let l=ws(t,(e,t)=>t===`onRest`?void 0:e),u,d,f=new Promise((e,t)=>(u=e,d=t)),p=e=>{let t=i<=(n.cancelId||0)&&Ws(r)||i!==n.asyncId&&Us(r,!1);if(t)throw e.result=t,d(e),e},m=0,h=(e,t)=>{let a=new qs,o=new Js;return(async()=>{p(a);let s=V.obj(e)?{...e}:{...t,to:e};if(s.parentId=i,ga(l,(e,t)=>{V.und(s[t])&&(s[t]=e)}),xa.skipAnimation){if(++m>1024)throw Ks(n),o.result=Us(r,!1),d(o),o;return s.immediate=!0,await r.start(s)}let c=await r.start(s);return p(a),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),c})()},g;try{let t;t=V.arr(e)?(async e=>{for(let t of e)await h(t)})(e):Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([t.then(u),f]),g=Us(r.get(),!0,!1)}catch(e){if(e instanceof qs)g=e.result;else if(e instanceof Js)g=e.result;else throw e}finally{i==n.asyncId&&(n.asyncId=a,n.asyncTo=a?s:void 0,n.promise=a?c:void 0)}return V.fun(o)&&B.batchedUpdates(()=>{o(g,r,r.item)}),g})()}function Ks(e,t){va(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var qs=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Js=class extends Error{constructor(){super(`SkipAnimationSignal`)}},Ys=e=>e instanceof Zs,Xs=1,Zs=class extends Co{constructor(...e){super(...e),this.id=Xs++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=es(this);return e&&e.getValue()}to(...e){return xa.to(this,e)}interpolate(...e){return Ho(),xa.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){So(this,{type:`change`,parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ma.sort(this),So(this,{type:`priority`,parent:this,priority:e})}},Qs=Symbol.for(`SpringPhase`),$s=1,ec=2,tc=4,nc=e=>(e[Qs]&$s)>0,rc=e=>(e[Qs]&ec)>0,ic=e=>(e[Qs]&tc)>0,ac=(e,t)=>t?e[Qs]|=3:e[Qs]&=-3,oc=(e,t)=>t?e[Qs]|=tc:e[Qs]&=-5,sc=class extends Zs{constructor(e,t){if(super(),this.animation=new zs,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!V.und(e)||!V.und(t)){let n=V.obj(e)?{...e}:{...t,from:e};V.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(rc(this)||this._state.asyncTo)||ic(this)}get goal(){return yo(this.animation.to)}get velocity(){let e=es(this);return e instanceof is?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return nc(this)}get isAnimating(){return rc(this)}get isPaused(){return ic(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{toValues:i}=r,{config:a}=r,o=ns(r.to);!o&&vo(r.to)&&(i=_a(yo(r.to))),r.values.forEach((s,c)=>{if(s.done)return;let l=s.constructor==as?1:o?o[c].lastPosition:i[c],u=r.immediate,d=l;if(!u){if(d=s.lastPosition,a.tension<=0){s.done=!0;return}let t=s.elapsedTime+=e,n=r.fromValues[c],i=s.v0==null?s.v0=V.arr(a.velocity)?a.velocity[c]:a.velocity:s.v0,o,f=a.precision||(n==l?.005:Math.max(Math.max(Math.abs(l),Math.abs(n),1)*2**-52,Math.min(1,Math.abs(l-n)*.001)));if(!V.und(a.duration)){let r=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,s.durationProgress>0&&(s.elapsedTime=a.duration*s.durationProgress,t=s.elapsedTime+=e)),r=(a.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=n+a.easing(r)*(l-n),o=(d-s.lastPosition)/e,u=r==1}else if(a.decay){let e=a.decay===!0?.998:a.decay,r=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-r),u=Math.abs(s.lastPosition-d)<=f,o=i*r}else{o=s.lastVelocity==null?i:s.lastVelocity;let t=a.restVelocity||f/10,r=a.clamp?0:a.bounce,c=!V.und(r),p=n==l?s.v0>0:n<l,m,h=!1,g=Math.ceil(e/1);for(let e=0;e<g&&(m=Math.abs(o)>t,!(!m&&(u=Math.abs(l-d)<=f,u)));++e){c&&(h=d==l||d>l==p,h&&(o=-o*r,d=l));let e=(-a.tension*1e-6*(d-l)+-a.friction*.001*o)/a.mass;o+=e*1,d+=o*1}}s.lastVelocity=o,Number.isNaN(d)&&(console.warn(`Got NaN while animating:`,this),u=!0)}o&&!o[c].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,a.round)&&(n=!0)});let s=es(this),c=s.getValue();if(t){let e=yo(r.to);(c!==e||n)&&!a.decay?(s.setValue(e),this._onChange(e)):n&&a.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return B.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(rc(this)){let{to:e,config:t}=this.animation;B.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||=[]).push(e),this}start(e,t){let n;return V.und(e)?(n=this.queue||[],this.queue=[]):n=[V.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>Vs(this,e))}stop(e){let{to:t}=this.animation;return V.und(t)||this._focus(this.get()),Ks(this._state,e&&this._lastCallId),B.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type==`change`?this._start():e.type==`priority`&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||``,{to:n,from:r}=e;n=V.obj(n)?n[t]:n,(n==null||js(n))&&(n=void 0),r=V.obj(r)?r[t]:r,r??=void 0;let i={to:n,from:r};return nc(this)||(e.reverse&&([n,r]=[r,n]),r=yo(r),V.und(r)?es(this)||this._set(n):this._set(r)),i}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,ws(e,(e,t)=>/^on/.test(t)?xs(e,n):e)),mc(this,e,`onProps`),hc(this,`onProps`,e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return Bs(++this._lastCallId,{key:n,props:e,defaultProps:r,state:a,actions:{pause:()=>{ic(this)||(oc(this,!0),ya(a.pauseQueue),hc(this,`onPause`,Us(this,cc(this,this.animation.to)),this))},resume:()=>{ic(this)&&(oc(this,!1),rc(this)&&this._resume(),ya(a.resumeQueue),hc(this,`onResume`,Us(this,cc(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(n=>{if(e.loop&&n.finished&&!(t&&n.noop)){let t=lc(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Ws(this));let r=!V.und(e.to),i=!V.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(Ws(this));let{key:a,defaultProps:o,animation:s}=this,{to:c,from:l}=s,{to:u=c,from:d=l}=e;i&&!r&&(!t.default||V.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let f=!ha(d,l);f&&(s.from=d),d=yo(d);let p=!ha(u,c);p&&this._focus(u);let m=js(t.to),{config:h}=s,{decay:g,velocity:_}=h;(r||i)&&!h.decay&&(h.velocity=0),t.config&&!m&&Is(h,ys(t.config,a),t.config===o.config?void 0:ys(o.config,a));let v=es(this);if(!v||V.und(u))return n(Us(this,!0));let y=V.und(t.reset)?i&&!t.default:!V.und(d)&&bs(t.reset,a),b=y?d:this.get(),x=ks(u),S=V.num(x)||V.arr(x)||Go(x),C=!m&&(!S||bs(o.immediate||t.immediate,a));if(p){let e=us(u);if(e!==v.constructor)if(C)v=this._set(x);else throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`)}let w=v.constructor,T=vo(u),ee=!1;if(!T){let e=y||!nc(this)&&f;(p||e)&&(ee=ha(ks(b),x),T=!ee),(!ha(s.immediate,C)&&!C||!ha(h.decay,g)||!ha(h.velocity,_))&&(T=!0)}if(ee&&rc(this)&&(s.changed&&!y?T=!0:T||this._stop(c)),!m&&((T||vo(c))&&(s.values=v.getPayload(),s.toValues=vo(u)?null:w==as?[1]:_a(x)),s.immediate!=C&&(s.immediate=C,!C&&!y&&this._set(c)),T)){let{onRest:e}=s;H(pc,e=>mc(this,t,e));let r=Us(this,cc(this,c));ya(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&B.batchedUpdates(()=>{s.changed=!y,e?.(r,this),y?ys(o.onRest,r):s.onStart?.(r,this)})}y&&this._set(b),m?n(Gs(t.to,t,this._state,this)):T?this._start():rc(this)&&!p?this._pendingCalls.add(n):n(Hs(b))}_focus(e){let t=this.animation;e!==t.to&&(bo(this)&&this._detach(),t.to=e,bo(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;vo(t)&&(To(t,this),Ys(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;vo(e)&&Eo(e,this)}_set(e,t=!0){let n=yo(e);if(!V.und(n)){let e=es(this);if(!e||!ha(n,e.getValue())){let r=us(n);!e||e.constructor!=r?ts(this,r.create(n)):e.setValue(n),e&&B.batchedUpdates(()=>{this._onChange(n,t)})}}return es(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,hc(this,`onStart`,Us(this,cc(this,e.to)),this))}_onChange(e,t){let n=Us(e,!1);t||(this._onStart(),ys(this.animation.onChange,n,this)),ys(this.defaultProps.onChange,n,this),super._onChange(e,t)}_start(){let e=this.animation;es(this).reset(yo(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),rc(this)||(ac(this,!0),ic(this)||this._resume())}_resume(){xa.skipAnimation?this.finish():Ma.start(this)}_stop(e,t){if(rc(this)){ac(this,!1);let n=this.animation;H(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),So(this,{type:`idle`,parent:this});let r=t?Ws(this.get()):Us(this.get(),cc(this,e??n.to));ya(this._pendingCalls,r),n.changed=!1,hc(this,`onRest`,r,this)}}};function cc(e,t){let n=ks(t);return ha(ks(e.get()),n)}function lc(e,t=e.loop,n=e.to){let r=ys(t);if(r){let i=r!==!0&&Os(r),a=(i||e).reverse,o=!i||i.reset;return uc({...e,loop:t,default:!1,pause:void 0,to:!a||js(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function uc(e){let{to:t,from:n}=e=Os(e),r=new Set;return V.obj(t)&&fc(t,r),V.obj(n)&&fc(n,r),e.keys=r.size?Array.from(r):null,e}function dc(e){let t=uc(e);return V.und(t.default)&&(t.default=ws(t)),t}function fc(e,t){ga(e,(e,n)=>e!=null&&t.add(n))}var pc=[`onStart`,`onRest`,`onChange`,`onPause`,`onResume`];function mc(e,t,n){e.animation[n]=t[n]===Ss(t,n)?void 0:xs(t[n],e.key)}function hc(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var gc=[`onStart`,`onChange`,`onRest`],_c=1,vc=class{constructor(e,t){this.id=_c++,this.springs={},this.queue=[],this._lastAsyncId=0,this._lastLoopId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(let t in e){let n=e[t];V.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(uc(e)),this}start(e){let{queue:t}=this;return e?t=_a(e).map(uc):this.queue=[],this._flush?this._flush(this,t):(Tc(this,t),yc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;H(_a(t),t=>n[t].stop(!!e))}else Ks(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(V.und(e))this.start({pause:!0});else{let t=this.springs;H(_a(e),e=>t[e].pause())}return this}resume(e){if(V.und(e))this.start({pause:!1});else{let t=this.springs;H(_a(e),e=>t[e].resume())}return this}each(e){ga(this.springs,e)}onLoopReset(e){let t=this._onLoopReset??=new Set;return t.add(e),()=>{t.delete(e)}}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,va(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let a=!r&&this._started,o=i||a&&n.size?this.get():null;i&&t.size&&va(t,([e,t])=>{t.value=o,e(t,this,this._item)}),a&&(this._started=!1,va(n,([e,t])=>{t.value=o,e(t,this,this._item)}))}eventObserved(e){if(e.type==`change`)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type==`idle`)this._active.delete(e.parent);else return;B.onFrame(this._onFrame)}};function yc(e,t){return Promise.all(t.map(t=>bc(e,t))).then(t=>Vs(e,t))}async function bc(e,t,n){let{keys:r,to:i,from:a,loop:o,onRest:s,onResolve:c}=t,l=V.obj(t.default)&&t.default;o&&(t.loop=!1);let u=t,d=!n&&!u.parentId&&`loop`in t?++e._lastLoopId:n?u.loopId:e._lastLoopId;i===!1&&(t.to=null),a===!1&&(t.from=null);let f=V.arr(i)||V.fun(i)?i:void 0;f?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):H(gc,n=>{let r=t[n];if(V.fun(r)){let i=e._events[n];t[n]=(({finished:e,cancelled:t})=>{let n=i.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(r,{value:null,finished:e||!1,cancelled:t||!1})}),l&&(l[n]=t[n])}});let p=e._state;t.pause===!p.paused?(p.paused=t.pause,ya(t.pause?p.pauseQueue:p.resumeQueue)):p.paused&&(t.pause=!0);let m=(r||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),h=t.cancel===!0||Ss(t,`cancel`)===!0;(f||h&&p.asyncId)&&m.push(Bs(++e._lastAsyncId,{props:t,state:p,actions:{pause:pa,resume:pa,start(t,n){h?(Ks(p,e._lastAsyncId),n(Ws(e))):(t.onRest=s,n(Gs(f,t,p,e)))}}})),p.paused&&await new Promise(e=>{p.resumeQueue.add(e)});let g=Vs(e,await Promise.all(m));if(o&&g.finished&&!(n&&g.noop)&&d===e._lastLoopId){let n=lc(t,o,i);if(n)return n.loopId=d,e._onLoopReset?.forEach(e=>e()),Tc(e,[n]),bc(e,n,!0)}return c&&B.batchedUpdates(()=>c(g,e,e.item)),g}function xc(e,t){let n={...e.springs};return t&&H(_a(t),e=>{V.und(e.keys)&&(e=uc(e)),V.obj(e.to)||(e={...e,to:void 0}),wc(n,e,e=>Cc(e))}),Sc(e,n),n}function Sc(e,t){ga(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,To(t,e))})}function Cc(e,t){let n=new sc;return n.key=e,t&&To(n,t),n}function wc(e,t,n){t.keys&&H(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function Tc(e,t){H(t,t=>{wc(e.springs,t,t=>Cc(t,e))})}var Ec=b.createContext({pause:!1,immediate:!1}),Dc=()=>{let e=[],t=function(t){Wo();let r=[];return H(e,(e,i)=>{if(V.und(t))r.push(e.start());else{let a=n(t,e,i);a&&r.push(e.start(a))}}),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return H(e,e=>e.pause(...arguments)),this},t.resume=function(){return H(e,e=>e.resume(...arguments)),this},t.set=function(t){H(e,(e,n)=>{let r=V.fun(t)?t(n,e):t;r&&e.set(r)})},t.start=function(t){let n=[];return H(e,(e,r)=>{if(V.und(t))n.push(e.start());else{let i=this._getProps(t,e,r);i&&n.push(e.start(i))}}),n},t.stop=function(){return H(e,e=>e.stop(...arguments)),this},t.update=function(t){return H(e,(e,n)=>e.update(this._getProps(t,e,n))),this};let n=function(e,t,n){return V.fun(e)?e(n,t):e};return t._getProps=n,t};function Oc(e,t,n){let r=V.fun(t)&&t;r&&!n&&(n=[]);let i=(0,b.useMemo)(()=>r||arguments.length==3?Dc():void 0,[]),a=(0,b.useRef)(0),o=Jo(),s=(0,b.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){let n=xc(e,t);return a.current>0&&!s.queue.length&&!Object.keys(n).some(t=>!e.springs[t])?yc(e,t):new Promise(r=>{Sc(e,n),s.queue.push(()=>{r(yc(e,t))}),o()})}}),[]),c=(0,b.useRef)([...s.ctrls]),l=(0,b.useRef)([]),u=(0,b.useRef)([]);u.current=[];let d=Zo(e)||0;(0,b.useMemo)(()=>{H(c.current.slice(e,d),e=>{Ms(e,i),e.stop(!0)}),c.current.length=e,f(d,e)},[e]),(0,b.useMemo)(()=>{f(0,Math.min(d,e))},n);function f(e,n){for(let i=e;i<n;i++){let e=c.current[i]||(c.current[i]=new vc(null,s.flush)),n=r?r(i,e):t[i];n&&(l.current[i]=dc(n))}}let p=c.current.map((e,t)=>xc(e,l.current[t])),m=(0,b.useContext)(Ec),h=m!==Zo(m)&&As(m);Ko(()=>{a.current++,s.ctrls=c.current;let{queue:e}=s;e.length&&(s.queue=[],H(e,e=>e()));let t=l.current.length>0?l.current:u.current;H(c.current,(e,n)=>{i?.add(e),h&&e.start({default:m});let r=t[n];r&&(Ns(e,r.ref),e.ref?e.queue.push({...r,default:V.obj(r.default)?{...r.default}:r.default}):e.start(r))}),l.current.length>0&&(u.current=l.current),l.current=[]}),Yo(()=>()=>{H(s.ctrls,e=>e.stop(!0))});let g=p.map(e=>({...e}));return i?[g,i]:g}function kc(e,t){let n=V.fun(e),[[r],i]=Oc(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,i]:r}var Ac=class extends Zs{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=ao(...t);let n=this._get(),r=us(n);ts(this,r.create(n))}advance(e){let t=this._get();ha(t,this.get())||(es(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Mc(this._active)&&Nc(this)}_get(){let e=V.arr(this.source)?this.source.map(yo):_a(yo(this.source));return this.calc(...e)}_start(){this.idle&&!Mc(this._active)&&(this.idle=!1,H(ns(this),e=>{e.done=!1}),xa.skipAnimation?(B.batchedUpdates(()=>this.advance()),Nc(this)):Ma.start(this))}_attach(){let e=1;H(_a(this.source),t=>{vo(t)&&To(t,this),Ys(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){H(_a(this.source),e=>{vo(e)&&Eo(e,this)}),this._active.clear(),Nc(this)}eventObserved(e){e.type==`change`?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type==`idle`?this._active.delete(e.parent):e.type==`priority`&&(this.priority=_a(this.source).reduce((e,t)=>Math.max(e,(Ys(t)?t.priority:0)+1),0))}};function jc(e){return e.idle!==!1}function Mc(e){return!e.size||Array.from(e).every(jc)}function Nc(e){e.idle||(e.idle=!0,H(ns(e),e=>{e.done=!0}),So(e,{type:`idle`,parent:e}))}var Pc=(e,...t)=>new Ac(e,t);xa.assign({createStringInterpolator:Ro,to:(e,t)=>new Ac(e,t)}),Ma.advance;var Fc=/^--/;function Ic(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t==`number`&&t!==0&&!Fc.test(e)&&!(zc.hasOwnProperty(e)&&zc[e])?t+`px`:(``+t).trim()}var Lc={};function Rc(e,t){if(!e.nodeType||!e.setAttribute||!e.removeAttribute)return!1;let n=e.nodeName===`filter`||e.parentNode&&e.parentNode.nodeName===`filter`,{className:r,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:c,...l}=t,u=Object.values(l),d=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:Lc[t]||(Lc[t]=t.replace(/([A-Z])/g,e=>`-`+e.toLowerCase())));t.hasOwnProperty(`children`)&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){let n=Ic(t,i[t]);Fc.test(t)?e.style.setProperty(t,n):e.style[t]=n}d.forEach((t,n)=>{let r=u[n];r===void 0?e.removeAttribute(t):e.setAttribute(t,r)}),t.hasOwnProperty(`className`)&&(r===void 0?e.removeAttribute(`class`):e.className=r),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),t.hasOwnProperty(`viewBox`)&&(c===void 0?e.removeAttribute(`viewBox`):e.setAttribute(`viewBox`,c))}var zc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bc=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Vc=[`Webkit`,`Ms`,`Moz`,`O`];zc=Object.keys(zc).reduce((e,t)=>(Vc.forEach(n=>e[Bc(n,t)]=e[t]),e),zc);var Hc=/^(matrix3d|matrix|translate3d|translate[XYZ]?|scale3d|scale[XYZ]?|rotate3d|rotate[XYZ]?|skew[XY]?)$/,Uc=/^(translate)/,Wc=/^(rotate|skew)/,Gc=(e,t)=>V.num(e)&&e!==0?e+t:e,Kc=(e,t)=>V.arr(e)?e.every(e=>Kc(e,t)):V.num(e)?e===t:parseFloat(e)===t,qc=class extends ss{constructor({x:e,y:t,z:n,...r}){let i=[],a=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),a.push(e=>[`translate3d(${e.map(e=>Gc(e,`px`)).join(`,`)})`,Kc(e,0)])),ga(r,(e,t)=>{if(t===`transform`)i.push([e||``]),a.push(e=>[e,e===``]);else if(Hc.test(t)){if(delete r[t],V.und(e))return;let n=Uc.test(t)?`px`:Wc.test(t)?`deg`:``;i.push(_a(e)),a.push(t===`rotate3d`?([e,t,r,i])=>[`rotate3d(${e},${t},${r},${Gc(i,n)})`,Kc(i,0)]:e=>[`${t}(${e.map(e=>Gc(e,n)).join(`,`)})`,Kc(e,+!!t.startsWith(`scale`))])}}),i.length&&(r.transform=new Jc(i,a)),super(r)}},Jc=class extends Co{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||=this._get()}_get(){let e=``,t=!0;return H(this.inputs,(n,r)=>{let i=yo(n[0]),[a,o]=this.transforms[r](V.arr(i)?i:n.map(yo));e+=` `+a,t&&=o}),t?`none`:e}observerAdded(e){e==1&&H(this.inputs,e=>H(e,e=>vo(e)&&To(e,this)))}observerRemoved(e){e==0&&H(this.inputs,e=>H(e,e=>vo(e)&&Eo(e,this)))}eventObserved(e){e.type==`change`&&(this._value=null),So(this,e)}},Yc=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`);xa.assign({batchedUpdates:Ki.unstable_batchedUpdates,createStringInterpolator:Ro,colors:za});var Xc=_s(Yc,{applyAnimatedValues:Rc,createAnimatedStyle:e=>new qc(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}).animated,Zc=`BN.BN.BN.BN.BN.BN.BN.BN.BN.S.B.S.WS.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.B.B.B.S.WS.ON.ON.ET.ET.ET.ON.ON.ON.ON.ON.ES.CS.ES.CS.CS.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.CS.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.BN.BN.BN.BN.BN.BN.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.CS.ON.ET.ET.ET.ET.ON.ON.ON.ON.L.ON.ON.BN.ON.ON.ET.ET.EN.EN.ON.L.ON.ON.ON.EN.L.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L`.split(`.`),Qc=[[697,698,`ON`],[706,719,`ON`],[722,735,`ON`],[741,749,`ON`],[751,767,`ON`],[768,879,`NSM`],[884,885,`ON`],[894,894,`ON`],[900,901,`ON`],[903,903,`ON`],[1014,1014,`ON`],[1155,1161,`NSM`],[1418,1418,`ON`],[1421,1422,`ON`],[1423,1423,`ET`],[1424,1424,`R`],[1425,1469,`NSM`],[1470,1470,`R`],[1471,1471,`NSM`],[1472,1472,`R`],[1473,1474,`NSM`],[1475,1475,`R`],[1476,1477,`NSM`],[1478,1478,`R`],[1479,1479,`NSM`],[1480,1535,`R`],[1536,1541,`AN`],[1542,1543,`ON`],[1544,1544,`AL`],[1545,1546,`ET`],[1547,1547,`AL`],[1548,1548,`CS`],[1549,1549,`AL`],[1550,1551,`ON`],[1552,1562,`NSM`],[1563,1610,`AL`],[1611,1631,`NSM`],[1632,1641,`AN`],[1642,1642,`ET`],[1643,1644,`AN`],[1645,1647,`AL`],[1648,1648,`NSM`],[1649,1749,`AL`],[1750,1756,`NSM`],[1757,1757,`AN`],[1758,1758,`ON`],[1759,1764,`NSM`],[1765,1766,`AL`],[1767,1768,`NSM`],[1769,1769,`ON`],[1770,1773,`NSM`],[1774,1775,`AL`],[1776,1785,`EN`],[1786,1808,`AL`],[1809,1809,`NSM`],[1810,1839,`AL`],[1840,1866,`NSM`],[1867,1957,`AL`],[1958,1968,`NSM`],[1969,1983,`AL`],[1984,2026,`R`],[2027,2035,`NSM`],[2036,2037,`R`],[2038,2041,`ON`],[2042,2044,`R`],[2045,2045,`NSM`],[2046,2069,`R`],[2070,2073,`NSM`],[2074,2074,`R`],[2075,2083,`NSM`],[2084,2084,`R`],[2085,2087,`NSM`],[2088,2088,`R`],[2089,2093,`NSM`],[2094,2136,`R`],[2137,2139,`NSM`],[2140,2143,`R`],[2144,2191,`AL`],[2192,2193,`AN`],[2194,2198,`AL`],[2199,2207,`NSM`],[2208,2249,`AL`],[2250,2273,`NSM`],[2274,2274,`AN`],[2275,2306,`NSM`],[2362,2362,`NSM`],[2364,2364,`NSM`],[2369,2376,`NSM`],[2381,2381,`NSM`],[2385,2391,`NSM`],[2402,2403,`NSM`],[2433,2433,`NSM`],[2492,2492,`NSM`],[2497,2500,`NSM`],[2509,2509,`NSM`],[2530,2531,`NSM`],[2546,2547,`ET`],[2555,2555,`ET`],[2558,2558,`NSM`],[2561,2562,`NSM`],[2620,2620,`NSM`],[2625,2626,`NSM`],[2631,2632,`NSM`],[2635,2637,`NSM`],[2641,2641,`NSM`],[2672,2673,`NSM`],[2677,2677,`NSM`],[2689,2690,`NSM`],[2748,2748,`NSM`],[2753,2757,`NSM`],[2759,2760,`NSM`],[2765,2765,`NSM`],[2786,2787,`NSM`],[2801,2801,`ET`],[2810,2815,`NSM`],[2817,2817,`NSM`],[2876,2876,`NSM`],[2879,2879,`NSM`],[2881,2884,`NSM`],[2893,2893,`NSM`],[2901,2902,`NSM`],[2914,2915,`NSM`],[2946,2946,`NSM`],[3008,3008,`NSM`],[3021,3021,`NSM`],[3059,3064,`ON`],[3065,3065,`ET`],[3066,3066,`ON`],[3072,3072,`NSM`],[3076,3076,`NSM`],[3132,3132,`NSM`],[3134,3136,`NSM`],[3142,3144,`NSM`],[3146,3149,`NSM`],[3157,3158,`NSM`],[3170,3171,`NSM`],[3192,3198,`ON`],[3201,3201,`NSM`],[3260,3260,`NSM`],[3276,3277,`NSM`],[3298,3299,`NSM`],[3328,3329,`NSM`],[3387,3388,`NSM`],[3393,3396,`NSM`],[3405,3405,`NSM`],[3426,3427,`NSM`],[3457,3457,`NSM`],[3530,3530,`NSM`],[3538,3540,`NSM`],[3542,3542,`NSM`],[3633,3633,`NSM`],[3636,3642,`NSM`],[3647,3647,`ET`],[3655,3662,`NSM`],[3761,3761,`NSM`],[3764,3772,`NSM`],[3784,3790,`NSM`],[3864,3865,`NSM`],[3893,3893,`NSM`],[3895,3895,`NSM`],[3897,3897,`NSM`],[3898,3901,`ON`],[3953,3966,`NSM`],[3968,3972,`NSM`],[3974,3975,`NSM`],[3981,3991,`NSM`],[3993,4028,`NSM`],[4038,4038,`NSM`],[4141,4144,`NSM`],[4146,4151,`NSM`],[4153,4154,`NSM`],[4157,4158,`NSM`],[4184,4185,`NSM`],[4190,4192,`NSM`],[4209,4212,`NSM`],[4226,4226,`NSM`],[4229,4230,`NSM`],[4237,4237,`NSM`],[4253,4253,`NSM`],[4957,4959,`NSM`],[5008,5017,`ON`],[5120,5120,`ON`],[5760,5760,`WS`],[5787,5788,`ON`],[5906,5908,`NSM`],[5938,5939,`NSM`],[5970,5971,`NSM`],[6002,6003,`NSM`],[6068,6069,`NSM`],[6071,6077,`NSM`],[6086,6086,`NSM`],[6089,6099,`NSM`],[6107,6107,`ET`],[6109,6109,`NSM`],[6128,6137,`ON`],[6144,6154,`ON`],[6155,6157,`NSM`],[6158,6158,`BN`],[6159,6159,`NSM`],[6277,6278,`NSM`],[6313,6313,`NSM`],[6432,6434,`NSM`],[6439,6440,`NSM`],[6450,6450,`NSM`],[6457,6459,`NSM`],[6464,6464,`ON`],[6468,6469,`ON`],[6622,6655,`ON`],[6679,6680,`NSM`],[6683,6683,`NSM`],[6742,6742,`NSM`],[6744,6750,`NSM`],[6752,6752,`NSM`],[6754,6754,`NSM`],[6757,6764,`NSM`],[6771,6780,`NSM`],[6783,6783,`NSM`],[6832,6877,`NSM`],[6880,6891,`NSM`],[6912,6915,`NSM`],[6964,6964,`NSM`],[6966,6970,`NSM`],[6972,6972,`NSM`],[6978,6978,`NSM`],[7019,7027,`NSM`],[7040,7041,`NSM`],[7074,7077,`NSM`],[7080,7081,`NSM`],[7083,7085,`NSM`],[7142,7142,`NSM`],[7144,7145,`NSM`],[7149,7149,`NSM`],[7151,7153,`NSM`],[7212,7219,`NSM`],[7222,7223,`NSM`],[7376,7378,`NSM`],[7380,7392,`NSM`],[7394,7400,`NSM`],[7405,7405,`NSM`],[7412,7412,`NSM`],[7416,7417,`NSM`],[7616,7679,`NSM`],[8125,8125,`ON`],[8127,8129,`ON`],[8141,8143,`ON`],[8157,8159,`ON`],[8173,8175,`ON`],[8189,8190,`ON`],[8192,8202,`WS`],[8203,8205,`BN`],[8207,8207,`R`],[8208,8231,`ON`],[8232,8232,`WS`],[8233,8233,`B`],[8234,8238,`BN`],[8239,8239,`CS`],[8240,8244,`ET`],[8245,8259,`ON`],[8260,8260,`CS`],[8261,8286,`ON`],[8287,8287,`WS`],[8288,8303,`BN`],[8304,8304,`EN`],[8308,8313,`EN`],[8314,8315,`ES`],[8316,8318,`ON`],[8320,8329,`EN`],[8330,8331,`ES`],[8332,8334,`ON`],[8352,8399,`ET`],[8400,8432,`NSM`],[8448,8449,`ON`],[8451,8454,`ON`],[8456,8457,`ON`],[8468,8468,`ON`],[8470,8472,`ON`],[8478,8483,`ON`],[8485,8485,`ON`],[8487,8487,`ON`],[8489,8489,`ON`],[8494,8494,`ET`],[8506,8507,`ON`],[8512,8516,`ON`],[8522,8525,`ON`],[8528,8543,`ON`],[8585,8587,`ON`],[8592,8721,`ON`],[8722,8722,`ES`],[8723,8723,`ET`],[8724,9013,`ON`],[9083,9108,`ON`],[9110,9257,`ON`],[9280,9290,`ON`],[9312,9351,`ON`],[9352,9371,`EN`],[9450,9899,`ON`],[9901,10239,`ON`],[10496,11123,`ON`],[11126,11263,`ON`],[11493,11498,`ON`],[11503,11505,`NSM`],[11513,11519,`ON`],[11647,11647,`NSM`],[11744,11775,`NSM`],[11776,11869,`ON`],[11904,11929,`ON`],[11931,12019,`ON`],[12032,12245,`ON`],[12272,12287,`ON`],[12288,12288,`WS`],[12289,12292,`ON`],[12296,12320,`ON`],[12330,12333,`NSM`],[12336,12336,`ON`],[12342,12343,`ON`],[12349,12351,`ON`],[12441,12442,`NSM`],[12443,12444,`ON`],[12448,12448,`ON`],[12539,12539,`ON`],[12736,12773,`ON`],[12783,12783,`ON`],[12829,12830,`ON`],[12880,12895,`ON`],[12924,12926,`ON`],[12977,12991,`ON`],[13004,13007,`ON`],[13175,13178,`ON`],[13278,13279,`ON`],[13311,13311,`ON`],[19904,19967,`ON`],[42128,42182,`ON`],[42509,42511,`ON`],[42607,42610,`NSM`],[42611,42611,`ON`],[42612,42621,`NSM`],[42622,42623,`ON`],[42654,42655,`NSM`],[42736,42737,`NSM`],[42752,42785,`ON`],[42888,42888,`ON`],[43010,43010,`NSM`],[43014,43014,`NSM`],[43019,43019,`NSM`],[43045,43046,`NSM`],[43048,43051,`ON`],[43052,43052,`NSM`],[43064,43065,`ET`],[43124,43127,`ON`],[43204,43205,`NSM`],[43232,43249,`NSM`],[43263,43263,`NSM`],[43302,43309,`NSM`],[43335,43345,`NSM`],[43392,43394,`NSM`],[43443,43443,`NSM`],[43446,43449,`NSM`],[43452,43453,`NSM`],[43493,43493,`NSM`],[43561,43566,`NSM`],[43569,43570,`NSM`],[43573,43574,`NSM`],[43587,43587,`NSM`],[43596,43596,`NSM`],[43644,43644,`NSM`],[43696,43696,`NSM`],[43698,43700,`NSM`],[43703,43704,`NSM`],[43710,43711,`NSM`],[43713,43713,`NSM`],[43756,43757,`NSM`],[43766,43766,`NSM`],[43882,43883,`ON`],[44005,44005,`NSM`],[44008,44008,`NSM`],[44013,44013,`NSM`],[64285,64285,`R`],[64286,64286,`NSM`],[64287,64296,`R`],[64297,64297,`ES`],[64298,64335,`R`],[64336,64450,`AL`],[64451,64466,`ON`],[64467,64829,`AL`],[64830,64847,`ON`],[64848,64911,`AL`],[64912,64913,`ON`],[64914,64967,`AL`],[64968,64975,`ON`],[64976,65007,`BN`],[65008,65020,`AL`],[65021,65023,`ON`],[65024,65039,`NSM`],[65040,65049,`ON`],[65056,65071,`NSM`],[65072,65103,`ON`],[65104,65104,`CS`],[65105,65105,`ON`],[65106,65106,`CS`],[65108,65108,`ON`],[65109,65109,`CS`],[65110,65118,`ON`],[65119,65119,`ET`],[65120,65121,`ON`],[65122,65123,`ES`],[65124,65126,`ON`],[65128,65128,`ON`],[65129,65130,`ET`],[65131,65131,`ON`],[65136,65278,`AL`],[65279,65279,`BN`],[65281,65282,`ON`],[65283,65285,`ET`],[65286,65290,`ON`],[65291,65291,`ES`],[65292,65292,`CS`],[65293,65293,`ES`],[65294,65295,`CS`],[65296,65305,`EN`],[65306,65306,`CS`],[65307,65312,`ON`],[65339,65344,`ON`],[65371,65381,`ON`],[65504,65505,`ET`],[65506,65508,`ON`],[65509,65510,`ET`],[65512,65518,`ON`],[65520,65528,`BN`],[65529,65533,`ON`],[65534,65535,`BN`],[65793,65793,`ON`],[65856,65932,`ON`],[65936,65948,`ON`],[65952,65952,`ON`],[66045,66045,`NSM`],[66272,66272,`NSM`],[66273,66299,`EN`],[66422,66426,`NSM`],[67584,67870,`R`],[67871,67871,`ON`],[67872,68096,`R`],[68097,68099,`NSM`],[68100,68100,`R`],[68101,68102,`NSM`],[68103,68107,`R`],[68108,68111,`NSM`],[68112,68151,`R`],[68152,68154,`NSM`],[68155,68158,`R`],[68159,68159,`NSM`],[68160,68324,`R`],[68325,68326,`NSM`],[68327,68408,`R`],[68409,68415,`ON`],[68416,68863,`R`],[68864,68899,`AL`],[68900,68903,`NSM`],[68904,68911,`AL`],[68912,68921,`AN`],[68922,68927,`AL`],[68928,68937,`AN`],[68938,68968,`R`],[68969,68973,`NSM`],[68974,68974,`ON`],[68975,69215,`R`],[69216,69246,`AN`],[69247,69290,`R`],[69291,69292,`NSM`],[69293,69311,`R`],[69312,69327,`AL`],[69328,69336,`ON`],[69337,69369,`AL`],[69370,69375,`NSM`],[69376,69423,`R`],[69424,69445,`AL`],[69446,69456,`NSM`],[69457,69487,`AL`],[69488,69505,`R`],[69506,69509,`NSM`],[69510,69631,`R`],[69633,69633,`NSM`],[69688,69702,`NSM`],[69714,69733,`ON`],[69744,69744,`NSM`],[69747,69748,`NSM`],[69759,69761,`NSM`],[69811,69814,`NSM`],[69817,69818,`NSM`],[69826,69826,`NSM`],[69888,69890,`NSM`],[69927,69931,`NSM`],[69933,69940,`NSM`],[70003,70003,`NSM`],[70016,70017,`NSM`],[70070,70078,`NSM`],[70089,70092,`NSM`],[70095,70095,`NSM`],[70191,70193,`NSM`],[70196,70196,`NSM`],[70198,70199,`NSM`],[70206,70206,`NSM`],[70209,70209,`NSM`],[70367,70367,`NSM`],[70371,70378,`NSM`],[70400,70401,`NSM`],[70459,70460,`NSM`],[70464,70464,`NSM`],[70502,70508,`NSM`],[70512,70516,`NSM`],[70587,70592,`NSM`],[70606,70606,`NSM`],[70608,70608,`NSM`],[70610,70610,`NSM`],[70625,70626,`NSM`],[70712,70719,`NSM`],[70722,70724,`NSM`],[70726,70726,`NSM`],[70750,70750,`NSM`],[70835,70840,`NSM`],[70842,70842,`NSM`],[70847,70848,`NSM`],[70850,70851,`NSM`],[71090,71093,`NSM`],[71100,71101,`NSM`],[71103,71104,`NSM`],[71132,71133,`NSM`],[71219,71226,`NSM`],[71229,71229,`NSM`],[71231,71232,`NSM`],[71264,71276,`ON`],[71339,71339,`NSM`],[71341,71341,`NSM`],[71344,71349,`NSM`],[71351,71351,`NSM`],[71453,71453,`NSM`],[71455,71455,`NSM`],[71458,71461,`NSM`],[71463,71467,`NSM`],[71727,71735,`NSM`],[71737,71738,`NSM`],[71995,71996,`NSM`],[71998,71998,`NSM`],[72003,72003,`NSM`],[72148,72151,`NSM`],[72154,72155,`NSM`],[72160,72160,`NSM`],[72193,72198,`NSM`],[72201,72202,`NSM`],[72243,72248,`NSM`],[72251,72254,`NSM`],[72263,72263,`NSM`],[72273,72278,`NSM`],[72281,72283,`NSM`],[72330,72342,`NSM`],[72344,72345,`NSM`],[72544,72544,`NSM`],[72546,72548,`NSM`],[72550,72550,`NSM`],[72752,72758,`NSM`],[72760,72765,`NSM`],[72850,72871,`NSM`],[72874,72880,`NSM`],[72882,72883,`NSM`],[72885,72886,`NSM`],[73009,73014,`NSM`],[73018,73018,`NSM`],[73020,73021,`NSM`],[73023,73029,`NSM`],[73031,73031,`NSM`],[73104,73105,`NSM`],[73109,73109,`NSM`],[73111,73111,`NSM`],[73459,73460,`NSM`],[73472,73473,`NSM`],[73526,73530,`NSM`],[73536,73536,`NSM`],[73538,73538,`NSM`],[73562,73562,`NSM`],[73685,73692,`ON`],[73693,73696,`ET`],[73697,73713,`ON`],[78912,78912,`NSM`],[78919,78933,`NSM`],[90398,90409,`NSM`],[90413,90415,`NSM`],[92912,92916,`NSM`],[92976,92982,`NSM`],[94031,94031,`NSM`],[94095,94098,`NSM`],[94178,94178,`ON`],[94180,94180,`NSM`],[113821,113822,`NSM`],[113824,113827,`BN`],[117760,117973,`ON`],[118e3,118009,`EN`],[118010,118012,`ON`],[118016,118451,`ON`],[118458,118480,`ON`],[118496,118512,`ON`],[118528,118573,`NSM`],[118576,118598,`NSM`],[119143,119145,`NSM`],[119155,119162,`BN`],[119163,119170,`NSM`],[119173,119179,`NSM`],[119210,119213,`NSM`],[119273,119274,`ON`],[119296,119361,`ON`],[119362,119364,`NSM`],[119365,119365,`ON`],[119552,119638,`ON`],[120513,120513,`ON`],[120539,120539,`ON`],[120571,120571,`ON`],[120597,120597,`ON`],[120629,120629,`ON`],[120655,120655,`ON`],[120687,120687,`ON`],[120713,120713,`ON`],[120745,120745,`ON`],[120771,120771,`ON`],[120782,120831,`EN`],[121344,121398,`NSM`],[121403,121452,`NSM`],[121461,121461,`NSM`],[121476,121476,`NSM`],[121499,121503,`NSM`],[121505,121519,`NSM`],[122880,122886,`NSM`],[122888,122904,`NSM`],[122907,122913,`NSM`],[122915,122916,`NSM`],[122918,122922,`NSM`],[123023,123023,`NSM`],[123184,123190,`NSM`],[123566,123566,`NSM`],[123628,123631,`NSM`],[123647,123647,`ET`],[124140,124143,`NSM`],[124398,124399,`NSM`],[124643,124643,`NSM`],[124646,124646,`NSM`],[124654,124655,`NSM`],[124661,124661,`NSM`],[124928,125135,`R`],[125136,125142,`NSM`],[125143,125251,`R`],[125252,125258,`NSM`],[125259,126063,`R`],[126064,126143,`AL`],[126144,126207,`R`],[126208,126287,`AL`],[126288,126463,`R`],[126464,126703,`AL`],[126704,126705,`ON`],[126706,126719,`AL`],[126720,126975,`R`],[126976,127019,`ON`],[127024,127123,`ON`],[127136,127150,`ON`],[127153,127167,`ON`],[127169,127183,`ON`],[127185,127221,`ON`],[127232,127242,`EN`],[127243,127247,`ON`],[127279,127279,`ON`],[127338,127343,`ON`],[127405,127405,`ON`],[127584,127589,`ON`],[127744,128728,`ON`],[128732,128748,`ON`],[128752,128764,`ON`],[128768,128985,`ON`],[128992,129003,`ON`],[129008,129008,`ON`],[129024,129035,`ON`],[129040,129095,`ON`],[129104,129113,`ON`],[129120,129159,`ON`],[129168,129197,`ON`],[129200,129211,`ON`],[129216,129217,`ON`],[129232,129240,`ON`],[129280,129623,`ON`],[129632,129645,`ON`],[129648,129660,`ON`],[129664,129674,`ON`],[129678,129734,`ON`],[129736,129736,`ON`],[129741,129756,`ON`],[129759,129770,`ON`],[129775,129784,`ON`],[129792,129938,`ON`],[129940,130031,`ON`],[130032,130041,`EN`],[130042,130042,`ON`],[131070,131071,`BN`],[196606,196607,`BN`],[262142,262143,`BN`],[327678,327679,`BN`],[393214,393215,`BN`],[458750,458751,`BN`],[524286,524287,`BN`],[589822,589823,`BN`],[655358,655359,`BN`],[720894,720895,`BN`],[786430,786431,`BN`],[851966,851967,`BN`],[917502,917759,`BN`],[917760,917999,`NSM`],[918e3,921599,`BN`],[983038,983039,`BN`],[1048574,1048575,`BN`],[1114110,1114111,`BN`]];function $c(e){if(e<=255)return Zc[e];let t=0,n=Qc.length-1;for(;t<=n;){let r=t+n>>1,i=Qc[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return`L`}function el(e){let t=e.length;if(t===0)return null;let n=Array(t),r=!1;for(let i=0;i<t;){let a=e.charCodeAt(i),o=a,s=1;if(a>=55296&&a<=56319&&i+1<t){let t=e.charCodeAt(i+1);t>=56320&&t<=57343&&(o=(a-55296<<10)+(t-56320)+65536,s=2)}let c=$c(o);(c===`R`||c===`AL`||c===`AN`)&&(r=!0);for(let e=0;e<s;e++)n[i+e]=c;i+=s}if(!r)return null;let i=0;for(let e=0;e<t;e++){let t=n[e];if(t===`L`){i=0;break}if(t===`R`||t===`AL`){i=1;break}}let a=new Int8Array(t);for(let e=0;e<t;e++)a[e]=i;let o=i&1?`R`:`L`,s=o,c=s;for(let e=0;e<t;e++)n[e]===`NSM`?n[e]=c:c=n[e];c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`AL`?`AN`:`EN`:(t===`R`||t===`L`||t===`AL`)&&(c=t)}for(let e=0;e<t;e++)n[e]===`AL`&&(n[e]=`R`);for(let e=1;e<t-1;e++)n[e]===`ES`&&n[e-1]===`EN`&&n[e+1]===`EN`&&(n[e]=`EN`),n[e]===`CS`&&(n[e-1]===`EN`||n[e-1]===`AN`)&&n[e+1]===n[e-1]&&(n[e]=n[e-1]);for(let e=0;e<t;e++){if(n[e]!==`EN`)continue;let r;for(r=e-1;r>=0&&n[r]===`ET`;r--)n[r]=`EN`;for(r=e+1;r<t&&n[r]===`ET`;r++)n[r]=`EN`}for(let e=0;e<t;e++){let t=n[e];(t===`WS`||t===`ES`||t===`ET`||t===`CS`)&&(n[e]=`ON`)}c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`L`?`L`:`EN`:(t===`R`||t===`L`)&&(c=t)}for(let e=0;e<t;e++){if(n[e]!==`ON`)continue;let r=e+1;for(;r<t&&n[r]===`ON`;)r++;let i=e>0?n[e-1]:s,a=r<t?n[r]:s,o=i===`L`?`L`:`R`;if(o===(a===`L`?`L`:`R`))for(let t=e;t<r;t++)n[t]=o;e=r-1}for(let e=0;e<t;e++)n[e]===`ON`&&(n[e]=o);for(let e=0;e<t;e++){let t=n[e];a[e]&1?(t===`L`||t===`AN`||t===`EN`)&&a[e]++:t===`R`?a[e]++:(t===`AN`||t===`EN`)&&(a[e]+=2)}return a}function tl(e,t){let n=el(e);if(n===null)return null;let r=new Int8Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];return r}var nl=/[ \t\n\r\f]+/g,rl=/[\t\n\r\f]| {2,}|^ | $/;function il(e){let t=e??`normal`;return t===`pre-wrap`?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function al(e){if(!rl.test(e))return e;let t=e.replace(nl,` `);return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function ol(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
597
+ `).replace(/[\r\f]/g,`
598
+ `):e}var sl=null,cl;function ll(){return sl===null&&(sl=new Intl.Segmenter(cl,{granularity:`word`})),sl}var ul=/\p{Script=Arabic}/u,dl=/\p{M}/u,fl=/\p{Nd}/u;function pl(e){return ul.test(e)}function ml(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function hl(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){if(ml((n-55296<<10)+(r-56320)+65536))return!0;t++;continue}}if(ml(n))return!0}}return!1}function gl(e){let t=Pl(e);return t!==null&&(Sl.has(t)||Tl.has(t))}var _l=new Set([`\xA0`,` `,`⁠`,``]),vl=new Set([`-`,`‐`,`–`,`—`]);function yl(e){let t=Pl(e);return t!==null&&_l.has(t)}function bl(e){let t=Pl(e);return t!==null&&vl.has(t)}function xl(e,t){return yl(e)?!1:!t||!(gl(e)||bl(e))}var Sl=new Set(`,...!.:.;.?.、.。.・.).〕.〉.》.」.』.】.〗.〙.〛.ー.々.〻.ゝ.ゞ.ヽ.ヾ`.split(`.`)),Cl=new Set([`"`,`(`,`[`,`{`,`¡`,`¿`,`“`,`‘`,`‚`,`„`,`«`,`‹`,`⸘`,`(`,`〔`,`〈`,`《`,`「`,`『`,`【`,`〖`,`〘`,`〚`]),wl=new Set([`'`,`’`]),Tl=new Set(`.(,(!(?(:(;(،(؛(؟(।(॥(၊(။(၌(၍(၏()(](}(%("(”(’(»(›(…`.split(`(`)),El=new Set([`:`,`.`,`،`,`؛`]),Dl=new Set([`၏`]),Ol=new Set([`”`,`’`,`»`,`›`,`」`,`』`,`】`,`》`,`〉`,`〕`,`)`]);function kl(e){if(Ml(e))return!0;let t=!1;for(let n of e){if(Tl.has(n)||zl(n)){t=!0;continue}if(!(t&&dl.test(n)))return!1}return t}function Al(e){for(let t of e)if(!Sl.has(t)&&!Tl.has(t))return!1;return e.length>0}function jl(e){if(Ml(e))return!0;for(let t of e)if(!Cl.has(t)&&!wl.has(t)&&!dl.test(t)&&!zl(t))return!1;return e.length>0}function Ml(e){let t=!1;for(let n of e)if(!(n===`\\`||dl.test(n))){if(Cl.has(n)||Tl.has(n)||wl.has(n)){t=!0;continue}return!1}return t}function Nl(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let a=e.charCodeAt(i);return a>=55296&&a<=56319?i:n}function Pl(e){if(e.length===0)return null;let t=Nl(e,e.length);return e.slice(t)}function Fl(e){for(let t of e)if(!dl.test(t))return t;return null}function Il(e){for(let t=e.length;t>0;){let n=Nl(e,t),r=e.slice(n,t);if(!dl.test(r))return r;t=n}return null}var Ll=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Rl(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function zl(e){let t=e.codePointAt(0);return t!==void 0&&Rl(t,Ll)}function Bl(e){let t=Il(e);return t!==null&&zl(t)}function W(e){let t=Fl(e);return t!==null&&fl.test(t)}function Vl(e){let t=Array.from(e),n=t.length;for(;n>0;){let e=t[n-1];if(dl.test(e)){n--;continue}if(Cl.has(e)||wl.has(e)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(``),tail:t.slice(n).join(``)}}function G(e,t,n){return n===`text`&&!t&&e.length===1&&e!==`-`&&e!==`—`?e:null}function K(e,t,n,r){let i=t[r],a=e[r];if(i==null)return a;let o=n[r];if(a.length===o)return a;let s=i.repeat(o);return e[r]=s,s}function Hl(e,t){return e&&t!==null&&El.has(t)}function Ul(e){let t=Pl(e);return t!==null&&Dl.has(t)}function Wl(e){if(e.length<2||e[0]!==` `)return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:` `,marks:t}:null}function Gl(e){let t=e.length;for(;t>0;){let n=Nl(e,t),r=e.slice(n,t);if(Ol.has(r))return!0;if(!Tl.has(r))return!1;t=n}return!1}function Kl(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===` `)return`preserved-space`;if(e===` `)return`tab`;if(t.preserveHardBreaks&&e===`
599
+ `)return`hard-break`}return e===` `?`space`:e===`\xA0`||e===` `||e===`⁠`||e===``?`glue`:e===`​`?`zero-width-break`:e===`­`?`soft-hyphen`:`text`}var ql=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function q(e){return e.length===1?e[0]:e.join(``)}function Jl(e,t){let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);return n.push(t),q(n)}function Yl(e,t,n,r){if(!ql.test(e))return[{text:e,isWordLike:t,kind:`text`,start:n}];let i=[],a=null,o=[],s=n,c=!1,l=0;for(let u of e){let e=Kl(u,r),d=e===`text`&&t;if(a!==null&&e===a&&d===c){o.push(u),l+=u.length;continue}a!==null&&i.push({text:q(o),isWordLike:c,kind:a,start:s}),a=e,o=[u],s=n+l,c=d,l+=u.length}return a!==null&&i.push({text:q(o),isWordLike:c,kind:a,start:s}),i}function Xl(e){return e===`space`||e===`preserved-space`||e===`zero-width-break`||e===`hard-break`}var Zl=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Ql(e,t){let n=e.texts[t];return n.startsWith(`www.`)?!0:Zl.test(n)&&t+1<e.len&&e.kinds[t+1]===`text`&&e.texts[t+1]===`//`}function $l(e){return e.includes(`?`)&&(e.includes(`://`)||e.startsWith(`www.`))}function eu(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let i=0;i<e.len;i++){if(r[i]!==`text`||!Ql(e,i))continue;let a=[t[i]],o=i+1;for(;o<e.len&&!Xl(r[o]);){a.push(t[o]),n[i]=!0;let e=t[o].includes(`?`);if(r[o]=`text`,t[o]=``,o++,e)break}t[i]=q(a)}let a=0;for(let e=0;e<t.length;e++){let o=t[e];o.length!==0&&(a!==e&&(t[a]=o,n[a]=n[e],r[a]=r[e],i[a]=i[e]),a++)}return t.length=a,n.length=a,r.length=a,i.length=a,{len:a,texts:t,isWordLike:n,kinds:r,starts:i}}function tu(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a]),!$l(o))continue;let s=a+1;if(s>=e.len||Xl(e.kinds[s]))continue;let c=[],l=e.starts[s],u=s;for(;u<e.len&&!Xl(e.kinds[u]);)c.push(e.texts[u]),u++;c.length>0&&(t.push(q(c)),n.push(!0),r.push(`text`),i.push(l),a=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var nu=new Set([`:`,`-`,`/`,`×`,`,`,`.`,`+`,`–`,`—`]),ru=/[\p{P}\p{S}\p{Co}]/u,iu=/\p{Emoji_Presentation}/u,au=new Set([`?`,`֊`,`-`,`‐`,`‒`,`–`,`—`,`…`,`‼`,`‽`,`⁉`]);function ou(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function su(e){let t=e.charCodeAt(0);return t<128?ou(t):!au.has(e)&&!iu.test(e)&&ru.test(e)}function cu(e){let t=!1;for(let n of e)if(!dl.test(n)){if(!su(n))return!1;t=!0}return t}function lu(e){for(let t=e.length;t>0;){let n=Nl(e,t),r=e.slice(n,t);if(dl.test(r)){t=n;continue}return su(r)||zl(r)}return!1}function uu(e,t,n,r){let i=!t&&cu(e),a=!r&&cu(n),o=Bl(e),s=(t||o)&&lu(e);return!i&&!a&&!s||hl(e)||hl(n)?!1:(t||i||o)&&(r||a)}function du(e){for(let t of e)if(fl.test(t))return!0;return!1}function fu(e){if(e.length===0)return!1;for(let t of e)if(!(fl.test(t)||nu.has(t)))return!1;return!0}function pu(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a],s=e.kinds[a];if(s===`text`&&fu(o)&&du(o)){let s=[o],c=a+1;for(;c<e.len&&e.kinds[c]===`text`&&fu(e.texts[c]);)s.push(e.texts[c]),c++;t.push(q(s)),n.push(!0),r.push(`text`),i.push(e.starts[a]),a=c-1;continue}t.push(o),n.push(e.isWordLike[a]),r.push(s),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function mu(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=e.texts[a],s=e.kinds[a],c=e.isWordLike[a];if(s===`text`){let s=[o],l=a+1,u=c;for(;l<e.len&&e.kinds[l]===`text`&&uu(e.texts[l-1],e.isWordLike[l-1],e.texts[l],e.isWordLike[l]);){let t=e.texts[l];s.push(t),u||=e.isWordLike[l],l++}if(l>a+1){t.push(q(s)),n.push(u),r.push(`text`),i.push(e.starts[a]),a=l;continue}}t.push(o),n.push(c),r.push(s),i.push(e.starts[a]),a++}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function hu(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(e.kinds[a]===`text`&&o.includes(`-`)){let s=o.split(`-`),c=s.length>1;for(let e=0;e<s.length;e++){let t=s[e];if(!c)break;(t.length===0||!du(t)||!fu(t))&&(c=!1)}if(c){let o=0;for(let c=0;c<s.length;c++){let l=s[c],u=c<s.length-1?`${l}-`:l;t.push(u),n.push(!0),r.push(`text`),i.push(e.starts[a]+o),o+=u.length}continue}}t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function gu(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=[e.texts[a]],s=e.isWordLike[a],c=e.kinds[a],l=e.starts[a];if(c===`glue`){let u=[o[0]],d=l;for(a++;a<e.len&&e.kinds[a]===`glue`;)u.push(e.texts[a]),a++;let f=q(u);if(a<e.len&&e.kinds[a]===`text`)o[0]=f,o.push(e.texts[a]),s=e.isWordLike[a],c=`text`,l=d,a++;else{t.push(f),n.push(!1),r.push(`glue`),i.push(d);continue}}else a++;if(c===`text`)for(;a<e.len&&e.kinds[a]===`glue`;){let t=[];for(;a<e.len&&e.kinds[a]===`glue`;)t.push(e.texts[a]),a++;let n=q(t);if(a<e.len&&e.kinds[a]===`text`){o.push(n,e.texts[a]),s||=e.isWordLike[a],a++;continue}o.push(n)}t.push(q(o)),n.push(s),r.push(c),i.push(l)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function _u(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let e=0;e<t.length-1;e++){if(r[e]!==`text`||r[e+1]!==`text`||!hl(t[e])||!hl(t[e+1]))continue;let n=Vl(t[e]);n!==null&&(t[e]=n.head,t[e+1]=n.tail+t[e+1],i[e+1]=i[e]+n.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function vu(e,t,n){let r=ll(),i=0,a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[];for(let _ of r.segment(e))for(let e of Yl(_.segment,_.isWordLike??!1,_.index,n)){let n=e.kind===`text`,r=G(e.text,e.isWordLike,e.kind),_=hl(e.text),v=pl(e.text),y=Pl(e.text),b=Gl(e.text),x=Ul(e.text),S=i-1;function C(){u[S]!==null&&(o[S]=[K(a,u,d,S)],u[S]=null),o[S].push(e.text),s[S]=s[S]||e.isWordLike,f[S]=f[S]||_,p[S]=p[S]||v,m[S]=b,h[S]=x,g[S]=Hl(p[S],y)}t.carryCJKAfterClosingQuote&&n&&i>0&&c[S]===`text`&&_&&f[S]&&m[S]||n&&i>0&&c[S]===`text`&&Al(e.text)&&f[S]||n&&i>0&&c[S]===`text`&&h[S]?C():n&&i>0&&c[S]===`text`&&e.isWordLike&&v&&g[S]?(C(),s[S]=!0):r!==null&&i>0&&c[S]===`text`&&u[S]===r?d[S]=(d[S]??1)+1:n&&!e.isWordLike&&i>0&&c[S]===`text`&&!f[S]&&(kl(e.text)||e.text===`-`&&s[S])?C():(a[i]=e.text,o[i]=[e.text],s[i]=e.isWordLike,c[i]=e.kind,l[i]=e.start,u[i]=r,d[i]=r===null?0:1,f[i]=_,p[i]=v,m[i]=b,h[i]=x,g[i]=Hl(v,y),i++)}for(let e=0;e<i;e++){if(u[e]!==null){a[e]=K(a,u,d,e);continue}a[e]=q(o[e])}for(let e=1;e<i;e++)c[e]===`text`&&!s[e]&&Ml(a[e])&&c[e-1]===`text`&&!f[e-1]&&(a[e-1]+=a[e],s[e-1]=s[e-1]||s[e],a[e]=``);let _=Array.from({length:i},()=>null),v=-1;for(let e=i-1;e>=0;e--){let t=a[e];if(t.length!==0){if(c[e]===`text`&&!s[e]&&v>=0&&c[v]===`text`&&(jl(t)||t===`-`&&W(a[v]))){let n=_[v]??[];n.push(t),_[v]=n,l[v]=l[e],a[e]=``;continue}v=e}}for(let e=0;e<i;e++){let t=_[e];t!=null&&(a[e]=Jl(t,a[e]))}let y=0;for(let e=0;e<i;e++){let t=a[e];t.length!==0&&(y!==e&&(a[y]=t,s[y]=s[e],c[y]=c[e],l[y]=l[e]),y++)}a.length=y,s.length=y,c.length=y,l.length=y;let b=_u(mu(hu(pu(tu(eu(gu({len:y,texts:a,isWordLike:s,kinds:c,starts:l})))))));for(let e=0;e<b.len-1;e++){let t=Wl(b.texts[e]);t!==null&&(b.kinds[e]!==`space`&&b.kinds[e]!==`preserved-space`||b.kinds[e+1]!==`text`||!pl(b.texts[e+1])||(b.texts[e]=t.space,b.isWordLike[e]=!1,b.kinds[e]=b.kinds[e]===`preserved-space`?`preserved-space`:`space`,b.texts[e+1]=t.marks+b.texts[e+1],b.starts[e+1]=b.starts[e]+t.space.length))}return b}function yu(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let t=0;t<e.len;t++)e.kinds[t]===`hard-break`&&(n.push({startSegmentIndex:r,endSegmentIndex:t,consumedEndSegmentIndex:t+1}),r=t+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function bu(e,t,n){if(t.len<=1)return t;let r=[],i=[],a=[],o=[],s=-1,c=!1;function l(e){r.push(t.texts[e]),i.push(t.isWordLike[e]),a.push(`text`),o.push(t.starts[e])}function u(n,s){let c=!1;for(let e=n;e<s;e++)c||=t.isWordLike[e];let l=t.starts[n],u=s<t.len?t.starts[s]:e.length;r.push(e.slice(l,u)),i.push(c),a.push(`text`),o.push(l)}function d(e){if(!(s<0)){if(c)s+1===e?l(s):u(s,e);else for(let t=s;t<e;t++)l(t);s=-1,c=!1}}for(let e=0;e<t.len;e++){let l=t.texts[e],u=t.kinds[e];if(u===`text`){s>=0&&!xl(t.texts[e-1],n)&&d(e),s<0&&(s=e),c||=hl(l);continue}d(e),r.push(l),i.push(t.isWordLike[e]),a.push(u),o.push(t.starts[e])}return d(t.len),{len:r.length,texts:r,isWordLike:i,kinds:a,starts:o}}function xu(e,t,n=`normal`,r=`normal`){let i=il(n),a=i.mode===`pre-wrap`?ol(e):al(e);if(a.length===0)return{normalized:a,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let o=vu(a,t,i),s=r===`keep-all`?bu(a,o,t.breakKeepAllAfterPunctuation):o;return{normalized:a,chunks:yu(s,i),...s}}var Su=null,Cu=new Map,wu=null,Tu=96,Eu=/\p{Emoji_Presentation}/u,Du=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,Ou=null,ku=new Map;function Au(){if(Su!==null)return Su;if(typeof OffscreenCanvas<`u`)return Su=new OffscreenCanvas(1,1).getContext(`2d`),Su;if(typeof document<`u`)return Su=document.createElement(`canvas`).getContext(`2d`),Su;throw Error(`Text measurement requires OffscreenCanvas or a DOM canvas context.`)}function ju(e){let t=Cu.get(e);return t||(t=new Map,Cu.set(e,t)),t}function Mu(e,t){let n=t.get(e);return n===void 0&&(n={width:Au().measureText(e).width,containsCJK:hl(e)},t.set(e,n)),n}function Nu(){if(wu!==null)return wu;if(typeof navigator>`u`)return wu={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},wu;let e=navigator.userAgent,t=navigator.vendor===`Apple Computer, Inc.`&&e.includes(`Safari/`)&&!e.includes(`Chrome/`)&&!e.includes(`Chromium/`)&&!e.includes(`CriOS/`)&&!e.includes(`FxiOS/`)&&!e.includes(`EdgiOS/`),n=e.includes(`Chrome/`)||e.includes(`Chromium/`)||e.includes(`CriOS/`)||e.includes(`Edg/`);return wu={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},wu}function Pu(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function Fu(){return Ou===null&&(Ou=new Intl.Segmenter(void 0,{granularity:`grapheme`})),Ou}function Iu(e){return Eu.test(e)||e.includes(`️`)}function Lu(e){return Du.test(e)}function Ru(e,t){let n=ku.get(e);if(n!==void 0)return n;let r=Au();r.font=e;let i=r.measureText(`😀`).width;if(n=0,i>t+.5&&typeof document<`u`&&document.body!==null){let t=document.createElement(`span`);t.style.font=e,t.style.display=`inline-block`,t.style.visibility=`hidden`,t.style.position=`absolute`,t.textContent=`😀`,document.body.appendChild(t);let r=t.getBoundingClientRect().width;document.body.removeChild(t),i-r>.5&&(n=i-r)}return ku.set(e,n),n}function zu(e){let t=0,n=Fu();for(let r of n.segment(e))Iu(r.segment)&&t++;return t}function Bu(e,t){return t.emojiCount===void 0&&(t.emojiCount=zu(e)),t.emojiCount}function Vu(e,t,n){return n===0?t.width:t.width-Bu(e,t)*n}function Hu(e,t,n,r,i){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===i)return t.breakableFitAdvances;t.breakableFitMode=i;let a=Fu(),o=[];for(let t of a.segment(e))o.push(t.segment);if(o.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i===`sum-graphemes`){let e=[];for(let t of o){let i=Mu(t,n);e.push(Vu(t,i,r))}return t.breakableFitAdvances=e,t.breakableFitAdvances}if(i===`pair-context`||o.length>Tu){let e=[],i=null,a=0;for(let t of o){let o=Vu(t,Mu(t,n),r);if(i===null)e.push(o);else{let o=i+t,s=Mu(o,n);e.push(Vu(o,s,r)-a)}i=t,a=o}return t.breakableFitAdvances=e,t.breakableFitAdvances}let s=[],c=``,l=0;for(let e of o){c+=e;let t=Mu(c,n),i=Vu(c,t,r);s.push(i-l),l=i}return t.breakableFitAdvances=s,t.breakableFitAdvances}function Uu(e,t){let n=Au();n.font=e;let r=ju(e),i=Pu(e);return{cache:r,fontSize:i,emojiCorrection:t?Ru(e,i):0}}function Wu(e){return e===`space`||e===`zero-width-break`||e===`soft-hyphen`}function Gu(e){return e===`space`||e===`preserved-space`||e===`tab`||e===`zero-width-break`||e===`soft-hyphen`}function Ku(e,t,n=e.widths.length){for(;t<n;){let n=e.kinds[t];if(!Wu(n))break;t++}return t}function qu(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Ju(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Yu(e,t){return t===0?0:e+t}function Xu(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Zu(e,t,n,r,i){return Yu(r,t===`tab`?i+Xu(e,n):e.lineEndFitAdvances[n])}function Qu(e,t,n,r){return Yu(r,t===`tab`?0:e.lineEndFitAdvances[n])}function $u(e,t,n,r,i){return Yu(r,t===`tab`?i:e.lineEndPaintAdvances[n])}function ed(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function td(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function nd(e,t,n){let r=t;for(;r<e.length&&e[r]<n;)r++;return r}function rd(e,t,n,r,i){if(e.letterSpacing===0)return 0;if(i>0)return e.spacingGraphemeCounts[r]>0?e.letterSpacing:0;for(let i=r-1;i>=t;i--){let a=e.kinds[i];if(!(a===`space`||a===`zero-width-break`||a===`hard-break`)){if(a===`soft-hyphen`){if(i===r-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function id(e,t,n,r,i,a){return t+rd(e,n,r,i,a)}function ad(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o}=e;if(r.length===0)return 0;let s=t+Nu().lineFitEpsilon,c=0,l=0,u=!1,d=0,f=0,p=0,m=0,h=-1,g=0;function _(){h=-1,g=0}function v(e=p,t=m,r=l){c++,n?.(r,d,f,e,t),l=0,u=!1,_()}function y(e,t){u=!0,d=e,f=0,p=e+1,m=0,l=t}function b(e,t,n){u=!0,d=e,f=t,p=e,m=t+1,l=n}function x(e,t){if(!u){y(e,t);return}l+=t,p=e+1,m=0}function S(e,t){let n=a[e],r=o[e]??null,i=r===null?-1:nd(r,0,t+1),c=-1,d=0,f=t;for(;f<n.length;){let a=n[f];if(!u)b(e,f,a);else if(l+a>s){if(r!==null&&c>t){v(e,c,d),f=c,i=nd(r,i,f+1),c=-1,d=0;continue}v(),b(e,f,a)}else l+=a,p=e,m=f+1;let o=f+1;r!==null&&r[i]===o&&(c=o,d=l,i++),f++}u&&p===e&&m===n.length&&(p=e+1,m=0)}let C=0;for(;C<r.length&&!(!u&&(C=Ku(e,C),C>=r.length));){let e=r[C],t=i[C],n=Gu(t);if(!u){e>s&&a[C]!==null?S(C,0):y(C,e),n&&(h=C+1,g=l-e),C++;continue}if(l+e>s){if(n){x(C,e),v(C+1,0,l-e),C++;continue}if(h>=0){if(p>h||p===h&&m>0){v();continue}v(h,0,g);continue}if(e>s&&a[C]!==null){v(),S(C,0),C++;continue}v();continue}x(C,e),n&&(h=C+1,g=l-e),C++}return u&&v(),c}function od(e,t,n){if(e.simpleLineWalkFastPath)return ad(e,t,n);let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o,discretionaryHyphenWidth:s,chunks:c}=e;if(r.length===0||c.length===0)return 0;let l=Nu(),u=t+l.lineFitEpsilon,d=0,f=0,p=!1,m=0,h=0,g=0,_=0,v=-1,y=0,b=0,x=null;function S(){v=-1,y=0,b=0,x=null}function C(){return x===`soft-hyphen`&&v===g&&_===0?b:f}function w(t=g,r=_,i){d++,n!==void 0&&n(id(e,i??C(),m,h,t,r),m,h,t,r),f=0,p=!1,S()}function T(e,t){p=!0,m=e,h=0,g=e+1,_=0,f=t}function ee(e,t,n){p=!0,m=e,h=t,g=e,_=t+1,f=n}function te(e,t){if(!p){T(e,t);return}f+=t,g=e+1,_=0}function E(t,n,r,i,a,o){if(!n)return;let s=Qu(e,t,r,a),c=$u(e,t,r,a,i);v=r+1,y=f-o+s,b=f-o+c,x=t}function ne(t,n){let r=a[t],i=o[t]??null,s=i===null?-1:nd(i,0,n+1),c=-1,l=0,d=n;for(;d<r.length;){let a=r[d];if(!p)ee(t,d,a);else{let r=ed(e,!0,a),o=f+r;if(td(e,o)>u){if(i!==null&&c>n){w(t,c,l),d=c,s=nd(i,s,d+1),c=-1,l=0;continue}w(),ee(t,d,a)}else f=o,g=t,_=d+1}let o=d+1;i!==null&&i[s]===o&&(c=o,l=f,s++),d++}p&&g===t&&_===r.length&&(g=t+1,_=0)}function re(e){d++,n?.(0,e.startSegmentIndex,0,e.consumedEndSegmentIndex,0),S()}for(let t=0;t<c.length;t++){let n=c[t];if(n.startSegmentIndex===n.endSegmentIndex){re(n);continue}p=!1,f=0,m=n.startSegmentIndex,h=0,g=n.startSegmentIndex,_=0,S();let o=n.startSegmentIndex;for(;o<n.endSegmentIndex&&!(!p&&(o=Ku(e,o,n.endSegmentIndex),o>=n.endSegmentIndex));){let t=i[o],n=Gu(t),c=Ju(e,p,o),d=t===`tab`?qu(f+c,e.tabStopAdvance):r[o],m=c+d,h=Zu(e,t,o,c,d);if(t===`soft-hyphen`){p&&(g=o+1,_=0,v=o+1,y=f+s,b=f+s,x=t),o++;continue}if(!p){h>u&&a[o]!==null?ne(o,0):T(o,d),E(t,n,o,d,c,m),o++;continue}if(f+h>u){let r=f+Qu(e,t,o,c),i=f+$u(e,t,o,c,d);if(x===`soft-hyphen`&&l.preferEarlySoftHyphenBreak&&y<=u){w(v,0,b);continue}if(n&&r<=u){te(o,m),w(o+1,0,i),o++;continue}if(v>=0&&y<=u){if(g>v||g===v&&_>0){w();continue}let e=v;w(e,0,b),o=e;continue}if(h>u&&a[o]!==null){w(),ne(o,0),o++;continue}w();continue}te(o,m),E(t,n,o,d,c,m),o++}if(p){let e=v===n.consumedEndSegmentIndex?b:f;w(n.consumedEndSegmentIndex,0,e)}}return d}var sd=null;function cd(){return sd===null&&(sd=new Intl.Segmenter(void 0,{granularity:`grapheme`})),sd}function ld(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function ud(e,t){let n=[],r=[],i=0,a=!1,o=!1,s=!1;function c(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(``),start:i}),r=[],a=!1,o=!1,s=!1)}function l(e,t,n){r=[e],i=t,a=n,o=Gl(e),s=Cl.has(e)}function u(e,t){r.push(e),a||=t;let n=Gl(e);e.length===1&&Tl.has(e)?o||=n:o=n,s=!1}for(let n of cd().segment(e)){let e=n.segment,i=hl(e);if(r.length===0){l(e,n.index,i);continue}if(s||Sl.has(e)||Tl.has(e)||t.carryCJKAfterClosingQuote&&i&&o){u(e,i);continue}if(!a&&!i){u(e,i);continue}c(),l(e,n.index,i)}return c(),n}function dd(e,t,n){if(t.length<=1)return t;let r=[],i=-1,a=!1;function o(n,i){let a=t[n].start,o=i<t.length?t[i].start:e.length;r.push({text:e.slice(a,o),start:a})}function s(e){if(!(i<0)){if(a)i+1===e?r.push(t[i]):o(i,e);else for(let n=i;n<e;n++)r.push(t[n]);i=-1,a=!1}}for(let e=0;e<t.length;e++){let r=t[e];i>=0&&!xl(t[e-1].text,n)&&s(e),i<0&&(i=e),a||=hl(r.text)}return s(t.length),r}function fd(e,t){if(t===`zero-width-break`||t===`soft-hyphen`||t===`hard-break`)return 0;if(t===`tab`)return 1;let n=0,r=cd();for(let t of r.segment(e))n++;return n}function pd(e){return e===`-`||e===`֊`||e===`‐`||e===`‒`||e===`–`||e===`—`}function md(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;let t=[],n=0;for(let r of cd().segment(e))n++,pd(r.segment)&&t.push(n);return t.length===0?null:t}function hd(e,t,n){return t>1?e+(t-1)*n:e}function gd(e,t,n,r,i){let a=Nu(),{cache:o,emojiCorrection:s}=Uu(t,Lu(e.normalized)),c=Vu(`-`,Mu(`-`,o),s)+(i===0?0:i*2),l=Vu(` `,Mu(` `,o),s)*8,u=i!==0;if(e.len===0)return ld(n);let d=[],f=[],p=[],m=[],h=e.chunks.length<=1&&!u,g=n?[]:null,_=[],v=[],y=[],b=n?[]:null,x=Array.from({length:e.len});function S(e,t,n,r,i,a,o,s,c){i!==`text`&&i!==`space`&&i!==`zero-width-break`&&(h=!1),d.push(t),f.push(n),p.push(r),m.push(i),g?.push(a),_.push(o),v.push(s),u&&y.push(c),b!==null&&b.push(e)}function C(e,t,n,c,l){let d=Mu(e,o),f=u?fd(e,t):0,p=hd(Vu(e,d,s),f,i),m=t===`space`||t===`preserved-space`||t===`zero-width-break`?0:p,h=m===0?0:m+(f>0?i:0),g=t===`space`||t===`zero-width-break`?0:p;if(l&&c&&e.length>1){let c=`sum-graphemes`;i===0?fu(e)?c=`pair-context`:a.preferPrefixWidthsForBreakableRuns&&(c=`segment-prefixes`):c=`segment-prefixes`;let l=Hu(e,d,o,s,c);S(e,p,h,g,t,n,l,l===null||r===`keep-all`?null:md(e),f);return}S(e,p,h,g,t,n,null,null,f)}for(let t=0;t<e.len;t++){x[t]=d.length;let n=e.texts[t],i=e.isWordLike[t],s=e.kinds[t],l=e.starts[t];if(s===`soft-hyphen`){S(n,0,c,c,s,l,null,null,0);continue}if(s===`hard-break`){S(n,0,0,0,s,l,null,null,0);continue}if(s===`tab`){S(n,0,0,0,s,l,null,null,u?fd(n,s):0);continue}let f=Mu(n,o);if(s===`text`&&f.containsCJK){let e=ud(n,a),t=r===`keep-all`?dd(n,e,a.breakKeepAllAfterPunctuation):e;for(let e=0;e<t.length;e++){let n=t[e];C(n.text,`text`,l+n.start,i,r===`keep-all`||!hl(n.text))}continue}C(n,s,l,i,!0)}let w=_d(e.chunks,x,d.length),T=g===null?null:tl(e.normalized,g);return b===null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w,segments:b}}function _d(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a.startSegmentIndex<t.length?t[a.startSegmentIndex]:n,s=a.endSegmentIndex<t.length?t[a.endSegmentIndex]:n,c=a.consumedEndSegmentIndex<t.length?t[a.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:c})}return r}function vd(e,t,n,r){let i=r?.wordBreak??`normal`,a=r?.letterSpacing??0;return gd(xu(e,Nu(),r?.whiteSpace,i),t,n,i,a)}function yd(e,t,n){return vd(e,t,!0,n)}function bd(e){return e}function xd(e){let t=0;return od(bd(e),1/0,e=>{e>t&&(t=e)}),t}function Sd(e){let t=e.toLowerCase().replace(/^←\s*/,``);return t.includes(`force push`)?`force-push`:t.includes(`cherry`)?`cherry-pick`:t.includes(`uncommit`)?`uncommit`:t.includes(`revert`)?`revert`:t.includes(`rebase`)?`rebase`:t.includes(`merge`)?`merge`:t.includes(`checkout`)?`checkout`:t.includes(`fetch`)?`fetch`:t.includes(`push`)?`push`:t.includes(`delete`)||t.includes(`discard`)?`delete`:t.includes(`unstage`)?`unstage`:t.includes(`stage`)?`stage`:t.includes(`stash`)?`stash`:t.includes(`move`)?`move`:t.includes(`reset`)?`reset`:t.includes(`branch`)?`branch`:t.includes(`tag`)?`tag`:`checkout`}function Cd({name:e,size:t=14}){let n={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};return(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:t,height:t,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:[e===`branch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v9`}),(0,y.jsx)(`path`,{...n,d:`M9 18h6`})]}),e===`checkout`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),(0,y.jsx)(`path`,{...n,d:`m13 6 6 6-6 6`}),(0,y.jsx)(`path`,{...n,d:`M5 5v14`})]}),e===`cherry-pick`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`7`,cy:`7`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`17`,cy:`17`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M10 7h2a5 5 0 0 1 5 5v2`})]}),e===`delete`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 6h18`}),(0,y.jsx)(`path`,{...n,d:`M8 6V4h8v2`}),(0,y.jsx)(`path`,{...n,d:`m19 6-1 14H6L5 6`}),(0,y.jsx)(`path`,{...n,d:`M10 11v5`}),(0,y.jsx)(`path`,{...n,d:`M14 11v5`})]}),e===`fetch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v12`}),(0,y.jsx)(`path`,{...n,d:`m7 12 5 5 5-5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`force-push`&&(0,y.jsx)(`path`,{...n,d:`M13 2 4 14h7l-1 8 10-13h-7l0-7Z`}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h1a8 8 0 0 1 8 8v1`})]}),e===`move`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12h18`}),(0,y.jsx)(`path`,{...n,d:`m8 7-5 5 5 5`}),(0,y.jsx)(`path`,{...n,d:`m16 7 5 5-5 5`})]}),e===`push`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 19V5`}),(0,y.jsx)(`path`,{...n,d:`m7 10 5-5 5 5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`rebase`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`12`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h2a7 7 0 0 1 7 7`})]}),e===`reset`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 7v6h6`}),(0,y.jsx)(`path`,{...n,d:`M20 17a8 8 0 0 1-14.9-4`}),(0,y.jsx)(`path`,{...n,d:`M4 13A8 8 0 0 1 19 8`})]}),e===`revert`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.7 2.7L3 8`}),(0,y.jsx)(`path`,{...n,d:`M3 3v5h5`})]}),e===`stage`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v14`}),(0,y.jsx)(`path`,{...n,d:`M5 12h14`})]}),e===`stash`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 4h16v6H4z`}),(0,y.jsx)(`path`,{...n,d:`M6 10v10h12V10`}),(0,y.jsx)(`path`,{...n,d:`M9 14h6`})]}),e===`tag`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M20 10 10 20 4 14V4h10l6 6Z`}),(0,y.jsx)(`circle`,{...n,cx:`9`,cy:`9`,r:`1`})]}),e===`unstage`&&(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),e===`uncommit`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M9 14 4 9l5-5`}),(0,y.jsx)(`path`,{...n,d:`M4 9h10a6 6 0 0 1 0 12h-1`})]})]})}function J({size:e=13}){return(0,y.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:e,height:e,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:(0,y.jsx)(`path`,{d:`M12 3a9 9 0 0 1 9 9`,fill:`none`,stroke:`currentColor`,strokeWidth:2.4,strokeLinecap:`round`,children:(0,y.jsx)(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 12 12`,to:`360 12 12`,dur:`0.8s`,repeatCount:`indefinite`})})})}function wd({label:e,onClick:t,tone:n,onMouseEnter:r,onMouseLeave:i}){let a=n===`success`?`#0b1020`:n===`warning`?`#fff7d6`:n===`merge`?`#fff7ff`:`#fff7ed`,o=n===`success`?`#6d9658`:n===`warning`?`#d8a43a`:n===`merge`?`#b764d9`:`#9a3412`,s=n===`success`?`#8dcf78`:n===`warning`?`#b88a25`:n===`merge`?`#c77de4`:`#b45309`,c=n===`success`?`#9cda89`:n===`warning`?`#c99a30`:n===`merge`?`#d08bea`:`#c26115`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),t()},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:104,height:30,padding:`0 12px`,background:s,border:`1px solid ${o}`,borderRadius:7,color:a,fontSize:10,fontWeight:700,cursor:`pointer`,fontFamily:`inherit`,whiteSpace:`nowrap`,position:`relative`,zIndex:8,boxShadow:`0 10px 24px rgba(0,0,0,0.35)`,gap:6,lineHeight:1},onMouseEnter:e=>{e.currentTarget.style.background=c},onMouseLeave:e=>{e.currentTarget.style.background=s},onPointerEnter:r,onPointerLeave:i,children:[(0,y.jsx)(Cd,{name:Sd(e)}),(0,y.jsx)(`span`,{children:e})]})}function Td({label:e,onClick:t,tone:n,size:r=`default`,variant:i=`solid`,disabled:a=!1,loading:o=!1,iconOnly:s=!1}){let c=r===`compact`,l=i===`ghost`,u=a||o,d=n===`danger`?`#5c2430`:n===`warning`?`#7a4e11`:n===`success`?`#2c4231`:`#2f3348`,f=n===`danger`?`#6a2b39`:n===`warning`?`#8a5a16`:n===`success`?`#37523d`:`#3a4058`,p=n===`danger`?`#8b3a4a`:n===`warning`?`#d19128`:n===`success`?`#588a5c`:`#4a4f68`,m=n===`danger`?`#f5a6b8`:n===`warning`?`#f9d28b`:n===`success`?`#a6e3a1`:l?`#bac2de`:`#cdd6f4`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),!u&&t()},disabled:u,"aria-busy":o||void 0,"aria-label":s?e:void 0,title:s?e:void 0,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:s?c?24:30:c?72:84,height:c?20:28,padding:s?0:c?`0 8px`:`0 10px`,background:l?`rgba(24,24,37,0.5)`:d,border:l?`1px solid transparent`:`1px solid ${p}`,color:m,fontSize:10,fontWeight:600,cursor:u?`default`:`pointer`,opacity:a&&!o?.62:1,borderRadius:c?6:7,fontFamily:`inherit`,whiteSpace:`nowrap`,gap:c?5:6,lineHeight:1},onMouseEnter:e=>{u||(e.currentTarget.style.background=l?`rgba(49,50,68,0.8)`:f)},onMouseLeave:e=>{u||(e.currentTarget.style.background=l?`rgba(24,24,37,0.5)`:d)},children:[o?(0,y.jsx)(J,{size:c?12:13}):(0,y.jsx)(Cd,{name:Sd(e),size:c?12:13}),!s&&(0,y.jsx)(`span`,{children:e})]})}var Ed=2e4,Dd=new Set([`g`,`path`,`circle`,`ellipse`,`line`,`polyline`,`polygon`,`rect`]),Od=new Set([`title`,`desc`,`metadata`]),kd={d:`d`,fill:`fill`,stroke:`stroke`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"stroke-miterlimit":`strokeMiterlimit`,"stroke-dasharray":`strokeDasharray`,"stroke-dashoffset":`strokeDashoffset`,"fill-rule":`fillRule`,"clip-rule":`clipRule`,opacity:`opacity`,"fill-opacity":`fillOpacity`,"stroke-opacity":`strokeOpacity`,transform:`transform`,cx:`cx`,cy:`cy`,r:`r`,rx:`rx`,ry:`ry`,x:`x`,y:`y`,x1:`x1`,x2:`x2`,y1:`y1`,y2:`y2`,width:`width`,height:`height`,points:`points`,"vector-effect":`vectorEffect`},Ad=new Set([`fill`,`stroke`]),jd=/^[+\-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?(?:px)?$/i,Md=/^[\d\s,.+\-eE]+$/,Nd=/^[\d\s,.+\-eEa-zA-Z]+$/,Pd=/^[\d\s,.+\-eEa-zA-Z()]+$/,Fd=new Map;function Id(e){let t=e.trim().toLowerCase();return t===`none`||t===`transparent`?`none`:`currentColor`}function Ld(e,t){let n=t.trim();return!n||n.length>5e3?null:Ad.has(e)?Id(n):e===`d`?Nd.test(n)?n:null:e===`points`?Md.test(n)?n:null:e===`transform`?Pd.test(n)?n:null:e===`vector-effect`?n===`non-scaling-stroke`?n:null:e===`fill-rule`||e===`clip-rule`?n===`evenodd`||n===`nonzero`?n:null:e===`stroke-linecap`?[`butt`,`round`,`square`].includes(n)?n:null:e===`stroke-linejoin`?[`arcs`,`bevel`,`miter`,`miter-clip`,`round`].includes(n)?n:null:e===`stroke-dasharray`?n===`none`||Md.test(n)?n:null:jd.test(n)?n.replace(/px$/i,``):null}function Rd(e){let t={};for(let n of e.attributes){let e=n.name.toLowerCase();if(e.startsWith(`on`)||e===`href`||e===`xlink:href`)continue;if(e===`style`){for(let e of n.value.split(`;`)){let n=e.indexOf(`:`);if(n===-1)continue;let r=e.slice(0,n).trim().toLowerCase(),i=kd[r];if(!i)continue;let a=Ld(r,e.slice(n+1));a!==null&&(t[i]=a)}continue}let r=kd[e];if(!r)continue;let i=Ld(e,n.value);i!==null&&(t[r]=i)}return t}function zd(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.trim().split(/[\s,]+/).map(Number);if(e.length===4&&e.every(Number.isFinite)&&e[2]>0&&e[3]>0)return e.join(` `)}let n=Number.parseFloat(e.getAttribute(`width`)??``),r=Number.parseFloat(e.getAttribute(`height`)??``);return Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0?`0 0 ${n} ${r}`:`0 0 24 24`}function Bd(e){let t=Fd.get(e);if(t)return t;let n;if(!e.trim())n={value:null,error:`Paste a complete <svg> element.`};else if(e.length>2e4)n={value:null,error:`SVG must be smaller than ${Ed.toLocaleString()} characters.`};else if(typeof DOMParser>`u`)n={value:null,error:`SVG parsing is unavailable in this environment.`};else try{let t=new DOMParser().parseFromString(e,`image/svg+xml`),r=t.querySelector(`parsererror`),i=t.documentElement;if(r||i.localName.toLowerCase()!==`svg`)n={value:null,error:`Paste one valid <svg> element.`};else{let e=0,t=null,r=n=>{let i=[];for(let a of n.children){let n=a.localName.toLowerCase();if(Od.has(n))continue;if(!Dd.has(n))return t=`Unsupported SVG element: <${n}>.`,[];if(e+=1,e>250)return t=`SVG contains too many elements (maximum 250).`,[];let o=r(a);if(t)return[];i.push({tag:n,props:Rd(a),children:o})}return i},a=r(i);n=t?{value:null,error:t}:a.length===0?{value:null,error:`SVG does not contain a supported shape.`}:{value:{viewBox:zd(i),rootProps:Rd(i),children:a},error:null}}}catch{n={value:null,error:`Could not parse this SVG.`}}return Fd.size>=100&&Fd.clear(),Fd.set(e,n),n}function Vd(e){return Bd(e).error}function Hd(e,t){return(0,b.createElement)(e.tag,{...e.props,key:t},e.children.map((e,n)=>Hd(e,`${t}-${n}`)))}function Ud({source:e,color:t,size:n=13}){let r=Bd(e);return r.value?(0,y.jsx)(`svg`,{fill:`currentColor`,stroke:`none`,...r.value.rootProps,"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:r.value.viewBox,style:{color:t,overflow:`visible`},children:r.value.children.map((e,t)=>Hd(e,`custom-svg-${t}`))}):null}var Wd=[`accessibility`,`api`,`build`,`chore`,`ci`,`config`,`database`,`dependencies`,`docs`,`feature`,`fix`,`i18n`,`infra`,`merge`,`move`,`performance`,`refactor`,`release`,`rename`,`revert`,`security`,`style`,`test`,`ui`];function Gd(e,t,n,...r){return{id:e,icon:e,label:t,enabled:!0,types:n,patterns:r}}var Kd=[Gd(`revert`,`Revert`,[`revert`],String.raw`\b(?:revert(?:ed|ing)?|rollbacks?)\b`),Gd(`merge`,`Merge`,[`merge`],String.raw`\bmerg(?:e|ed|ing)\b`),Gd(`security`,`Security`,[`security`,`sec`],String.raw`\b(?:security|vulnerabilit(?:y|ies)|cve|xss|csrf)\b`),Gd(`fix`,`Fix`,[`fix`,`bugfix`,`hotfix`],String.raw`\b(?:fix(?:es|ed|ing)?|bugs?|bugfix(?:es)?|hotfix(?:es)?)\b`),Gd(`feature`,`Feature`,[`feat`,`feature`],String.raw`\b(?:feat|feature)s?\b`),Gd(`performance`,`Performance`,[`perf`,`performance`],String.raw`\b(?:perf|performance|optimi[sz](?:e[ds]?|ing|ation)|speedups?)\b`),Gd(`refactor`,`Refactor`,[`refactor`],String.raw`\b(?:refactor(?:s|ed|ing)?|restructur(?:e[ds]?|ing))\b`),Gd(`move`,`Move`,[`move`],String.raw`\b(?:move[ds]?|moving|relocat(?:e[ds]?|ing))\b`),Gd(`rename`,`Rename`,[`rename`],String.raw`\b(?:rename[ds]?|renaming)\b`),Gd(`test`,`Tests`,[`test`,`tests`],String.raw`\b(?:tests?|specs?|coverage|e2e)\b`),Gd(`docs`,`Documentation`,[`docs`,`doc`],String.raw`\b(?:docs?|documentation|readme|changelog)\b`),Gd(`accessibility`,`Accessibility`,[`a11y`,`accessibility`],String.raw`\b(?:a11y|accessibility|aria|screen[\s-]?reader)\b`),Gd(`i18n`,`Localization`,[`i18n`,`l10n`],String.raw`\b(?:i18n|l10n|internationali[sz]ation|locali[sz]ation|translations?)\b`),Gd(`database`,`Database`,[`db`,`database`,`migration`],String.raw`\b(?:database|db|sql|schemas?|migrations?)\b`),Gd(`api`,`API`,[`api`],String.raw`\b(?:apis?|graphql|grpc|rpc|endpoints?|webhooks?)\b`),Gd(`ui`,`UI`,[`ui`,`ux`],String.raw`\b(?:ui|ux|frontend|layouts?|responsive)\b`),Gd(`infra`,`Infrastructure`,[`infra`,`infrastructure`,`deploy`],String.raw`\b(?:infra|infrastructure|terraform|kubernetes|k8s|docker|deploy(?:ment|s|ed|ing)?)\b`),Gd(`ci`,`CI`,[`ci`],String.raw`\b(?:ci|continuous[\s-]integration|github[\s-]actions?|workflows?|pipelines?)\b`),Gd(`build`,`Build`,[`build`],String.raw`\b(?:builds?|built|bundl(?:e[ds]?|er|ing)|compil(?:e[ds]?|er|ing)|webpack|vite)\b`),Gd(`dependencies`,`Dependencies`,[`deps`,`dependencies`,`dependency`],String.raw`\b(?:deps?|dependencies|dependency|packages?|lockfiles?|bump(?:s|ed|ing)?)\b`),Gd(`release`,`Release`,[`release`],String.raw`\b(?:releases?|version(?:ing)?|publish(?:es|ed|ing)?)\b`),Gd(`config`,`Configuration`,[`config`],String.raw`\b(?:config|configuration|settings?|environment)\b`,String.raw`(?:^|\s)\.env(?:\s|$)`),Gd(`style`,`Style`,[`style`,`format`,`lint`],String.raw`\b(?:styles?|styling|css|themes?|format(?:ted|ting)?|lint(?:ed|ing)?)\b`),Gd(`chore`,`Chore`,[`chore`],String.raw`\b(?:chores?|cleanup|housekeeping|maintenance)\b`)],qd=/^([a-z][a-z0-9-]*)(?:\([^)]*\))?!?:/i,Jd=new Map;function Yd(e){if(Jd.has(e))return Jd.get(e)??null;try{let t=new RegExp(e,`i`);return Jd.set(e,t),t}catch{return Jd.set(e,null),null}}function Xd(e){if(!e.trim())return`Pattern cannot be empty.`;try{return new RegExp(e,`i`),null}catch(e){return e instanceof Error?e.message:`Invalid regular expression.`}}function Zd(e,t=Kd){let n=qd.exec(e.trim())?.[1]?.toLowerCase();if(n){let e=t.find(e=>e.enabled&&e.types.some(e=>e.toLowerCase()===n));if(e)return e}return t.find(t=>t.enabled&&t.patterns.some(t=>Yd(t)?.test(e)===!0))??null}var Qd=`ingit.commitIconRules`,$d=1,ef=200,tf=50,nf=500;function rf(e){return e.map(e=>({...e,types:[...e.types],patterns:[...e.patterns]}))}function af(e){return JSON.stringify({version:$d,rules:e})}function of(e){return typeof e==`string`&&Wd.includes(e)}function sf(e,t){if(!Array.isArray(e)||e.length>tf)return null;let n=[];for(let r of e){if(typeof r!=`string`)return null;let e=r.trim();if(!e||e.length>t)return null;n.push(e)}return n}function cf(e){if(e===null)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let{version:n,rules:r}=t;if(n!==$d||!Array.isArray(r)||r.length>ef)return null;let i=new Set,a=[];for(let e of r){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.id==`string`?t.id.trim():``,r=typeof t.label==`string`?t.label.trim():``,o=sf(t.types,80),s=sf(t.patterns,nf),c=t.customSvg===void 0?void 0:typeof t.customSvg==`string`?t.customSvg.trim():null;if(!n||n.length>100||i.has(n)||!r||r.length>100||!of(t.icon)||typeof t.enabled!=`boolean`||o===null||s===null||c===null||c!==void 0&&(!c||c.length>2e4)||c!==void 0&&typeof DOMParser<`u`&&Vd(c)!==null||s.some(e=>Xd(e)!==null))return null;i.add(n),a.push({id:n,label:r,icon:t.icon,enabled:t.enabled,types:o,patterns:s,...c===void 0?{}:{customSvg:c}})}return a}catch{return null}}function lf(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function uf(){let e=lf();if(!e)return rf(Kd);try{return cf(e.getItem(Qd))??rf(Kd)}catch{return rf(Kd)}}var df=uf(),ff=new Set;function pf(e){df=e;for(let e of ff)e()}function mf(e){e.key!==null&&e.key!==Qd||pf(cf(e.newValue)??rf(Kd))}function hf(e){let t=ff.size===0;return ff.add(e),t&&typeof window<`u`&&window.addEventListener(`storage`,mf),()=>{ff.delete(e),ff.size===0&&typeof window<`u`&&window.removeEventListener(`storage`,mf)}}function gf(){return(0,b.useSyncExternalStore)(hf,()=>df,()=>Kd)}function _f(e){let t=cf(af(e));if(!t)return!1;let n=lf();if(!n)return!1;try{n.setItem(Qd,af(t))}catch{return!1}return pf(t),!0}function vf(){let e=lf();if(!e)return!1;try{e.removeItem(Qd)}catch{return!1}return pf(rf(Kd)),!0}var Y={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function yf({icon:e,color:t,size:n=13,customSvg:r}){return r?(0,y.jsx)(Ud,{source:r,color:t,size:n}):(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:`0 0 24 24`,style:{color:t,overflow:`visible`},children:[e===`accessibility`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`4`,r:`2`}),(0,y.jsx)(`path`,{...Y,d:`M5 8h14M12 6v7M8 21l4-8 4 8M7 13l5-2 5 2`})]}),e===`api`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M9 3v5M15 3v5M7 8h10v3a5 5 0 0 1-5 5v5`}),(0,y.jsx)(`path`,{...Y,d:`M8 12h8`})]}),e===`build`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m14 5 5 5M16 3l5 5-3 3-5-5 3-3Z`}),(0,y.jsx)(`path`,{...Y,d:`M14.5 8.5 4 19l1 1L15.5 9.5`})]}),e===`chore`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m20 3-9 9M11 10l3 3`}),(0,y.jsx)(`path`,{...Y,d:`m11 10-7 7 3 3 7-7-3-3ZM3 21h9`})]}),e===`ci`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...Y,cx:`18`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`18`,r:`2.5`}),(0,y.jsx)(`path`,{...Y,d:`M8.5 6h7M7.4 8.2l3.2 7.6M16.6 8.2l-3.2 7.6`})]}),e===`config`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M4 6h10M18 6h2M4 12h2M10 12h10M4 18h8M16 18h4`}),(0,y.jsx)(`circle`,{...Y,cx:`16`,cy:`6`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`8`,cy:`12`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`14`,cy:`18`,r:`2`})]}),e===`database`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`ellipse`,{...Y,cx:`12`,cy:`5`,rx:`7`,ry:`3`}),(0,y.jsx)(`path`,{...Y,d:`M5 5v6c0 1.7 3.1 3 7 3s7-1.3 7-3V5M5 11v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6`})]}),e===`dependencies`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m12 3 9 5-9 5-9-5 9-5Z`}),(0,y.jsx)(`path`,{...Y,d:`M3 8v8l9 5 9-5V8M12 13v8`})]}),e===`docs`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 6a6 6 0 0 0-8-2v15a6 6 0 0 1 8 2V6Z`}),(0,y.jsx)(`path`,{...Y,d:`M12 6a6 6 0 0 1 8-2v15a6 6 0 0 0-8 2V6Z`})]}),e===`feature`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3c.6 3.2 1.8 4.4 5 5-3.2.6-4.4 1.8-5 5-.6-3.2-1.8-4.4-5-5 3.2-.6 4.4-1.8 5-5Z`}),(0,y.jsx)(`path`,{...Y,d:`M19 15c.3 1.7 1 2.4 2.7 2.7-1.7.3-2.4 1-2.7 2.7-.3-1.7-1-2.4-2.7-2.7 1.7-.3 2.4-1 2.7-2.7Z`})]}),e===`fix`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`7`,y:`6`,width:`10`,height:`14`,rx:`5`}),(0,y.jsx)(`path`,{...Y,d:`M9 6 7 3M15 6l2-3M3 10h4M17 10h4M3 15h4M17 15h4M9 11h.01M15 11h.01M12 14v6`})]}),e===`i18n`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`12`,r:`9`}),(0,y.jsx)(`path`,{...Y,d:`M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18`})]}),e===`infra`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`3`,y:`4`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`rect`,{...Y,x:`3`,y:`14`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`path`,{...Y,d:`M7 7h.01M7 17h.01M11 7h7M11 17h7`})]}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`5`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`18`,cy:`19`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`19`,r:`2`}),(0,y.jsx)(`path`,{...Y,d:`M6 7v10M8 5h2a8 8 0 0 1 8 8v4`})]}),e===`move`&&(0,y.jsx)(`path`,{...Y,d:`M12 3v18M3 12h18M8 7l4-4 4 4M8 17l4 4 4-4M7 8l-4 4 4 4M17 8l4 4-4 4`}),e===`performance`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M4 18a8 8 0 1 1 16 0M12 18l4-5M6.5 10l1 1M12 7v2M17.5 10l-1 1`}),(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`18`,r:`1`})]}),e===`refactor`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...Y,d:`m8 7 4-4 4 4M12 3v7M18 10l3 4-3 4M21 14h-7M8 21l-4-4 4-4M4 17h7`})}),e===`release`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M14 4c3-2 5-1 6 0s2 3 0 6l-6 6-6-6 6-6Z`}),(0,y.jsx)(`circle`,{...Y,cx:`16`,cy:`8`,r:`1.5`}),(0,y.jsx)(`path`,{...Y,d:`M8 10H5l-2 4 5 1M14 16v3l-4 2-1-5M7 17l-2 2`})]}),e===`rename`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m14 5 5 5M4 20l3.5-.8L20 6.7 17.3 4 4.8 16.5 4 20Z`}),(0,y.jsx)(`path`,{...Y,d:`M3 22h9`})]}),e===`revert`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...Y,d:`m9 7-5 5 5 5M4 12h10a6 6 0 0 1 6 6v2`})}),e===`security`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3 20 6v6c0 5-3.4 8-8 10-4.6-2-8-5-8-10V6l8-3Z`}),(0,y.jsx)(`path`,{...Y,d:`m8.5 12 2.2 2.2 4.8-5`})]}),e===`style`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3a9 9 0 0 0 0 18h1.5a2 2 0 0 0 0-4H12a2 2 0 0 1 0-4h3a6 6 0 0 0 0-12h-3Z`}),(0,y.jsx)(`path`,{...Y,d:`M7.5 10h.01M9 6.5h.01M14 6.5h.01M17 9h.01`})]}),e===`test`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M9 3h6M10 3v6l-5 9a2 2 0 0 0 2 3h10a2 2 0 0 0 2-3l-5-9V3`}),(0,y.jsx)(`path`,{...Y,d:`M7.5 15h9`})]}),e===`ui`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,y.jsx)(`path`,{...Y,d:`M9 4v16M9 10h12`})]})]})}function bf(e,t,n,r,i){if(e.length===0)return null;let a=Math.min(t,n),o=Math.max(t,n),s=[...new Set(e.map(e=>e.x))].sort((e,t)=>e-t),c=new Set(e.filter(e=>e.idx>a&&e.idx<o).map(e=>e.x)),l=e.find(e=>e.idx===n)?.x,u=l===void 0?[]:s.filter(e=>i===`left`?e<=l:e>=l).sort((e,t)=>i===`left`?t-e:e-t);for(let e of u)if(!c.has(e))return e;return i===`left`?s[0]-r:s[s.length-1]+r}function xf(e,t,n){return e.map((r,i)=>{let a=e.length-i;return{...r,y:t.y-a*n,idx:t.idx-a}})}function Sf(e,t,n){let r=t??e;return{anchor:r,y:r.y-n,idx:r.idx-1}}function Cf(e,t){return[{x1:e.x-t,y1:e.y-t,x2:e.x+t,y2:e.y+t},{x1:e.x+t,y1:e.y-t,x2:e.x-t,y2:e.y+t}]}function wf({baseZoom:e,bounds:t,viewport:n,scroll:r,margin:i}){let a=t.minX*e-r.x,o=t.maxX*e-r.x,s=t.minY*e-r.y,c=t.maxY*e-r.y;if(a>=i&&o<=n.width-i&&s>=i&&c<=n.height-i)return{zoom:e,translateX:0,translateY:0};let l=Math.max(1,t.maxX-t.minX),u=Math.max(1,t.maxY-t.minY),d=Math.max(1,n.width-i*2),f=Math.max(1,n.height-i*2),p=Math.max(.05,Math.min(e,d/l,f/u)),m=t.minX*p-r.x,h=t.maxX*p-r.x,g=t.minY*p-r.y,_=t.maxY*p-r.y,v=(e,t,n)=>{let r=i-e,a=n-i-t;return Math.min(a,Math.max(r,0))};return{zoom:p,translateX:v(m,h,n.width),translateY:v(g,_,n.height)}}function Tf(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1;return{x:e.x+r/a*n,y:e.y+i/a*n}}function Ef(e,t,n,r,i){let a=1-i,o=a**3,s=3*a**2*i,c=3*a*i**2,l=i**3;return{x:e.x*o+t.x*s+n.x*c+r.x*l,y:e.y*o+t.y*s+n.y*c+r.y*l}}function Df(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return(e.x-t.x)**2+(e.y-t.y)**2;let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)),s=t.x+o*r,c=t.y+o*i;return(e.x-s)**2+(e.y-c)**2}function Of(e,t,n,r,i){let a=r.nodeRadius-1,o=Tf(e,t,a),s=Tf(t,e,a),c=s.y-o.y,l={x:o.x,y:o.y+c*r.curveControlRatio},u={x:s.x,y:s.y-c*r.curveControlRatio},d=(r.nodeRadius+r.clearance)**2,f=Math.max(32,Math.ceil(Math.hypot(s.x-o.x,s.y-o.y)/4)),p=Math.min(e.idx,t.idx)+1,m=Math.max(e.idx,t.idx)-1,h=[];for(let t=p;t<=m;t++){let a=n[t],o=[...a===void 0?[]:[a],...i?.get(t)??[]];for(let n of o)h.push({x:e.x+(n-e.lane)*r.laneWidth,y:e.y+(t-e.idx)*r.rowHeight})}let g=o;for(let e=1;e<=f;e++){let t=Ef(o,l,u,s,e/f);if(h.some(e=>Df(e,g,t)<=d))return!0;g=t}return!1}function kf(e,t,n,r,i){let a=r===`from`?e.lane:t.lane,o=Math.min(e.idx,t.idx)+1,s=Math.max(e.idx,t.idx)-1;for(let e=o;e<=s;e++)if(n[e]===a||i?.get(e)?.includes(a))return!1;return!0}function Af(e,t,n,r,i){if(!kf(e,t,n,r,i))return null;let a=r===`from`?e:t,o=r===`from`?t:e;return{side:a.x<=o.x?`left`:`right`,anchorLane:a.lane,innerLane:o.lane,outerRailX:a.x}}function jf(e,t,n,r,i,a){if(Math.abs(t.idx-e.idx)<2||!Of(e,t,n,r,a))return null;if(kf(e,t,n,i,a))return i;let o=i===`from`?`to`:`from`;return kf(e,t,n,o,a)?o:null}var Mf={position:`fixed`,inset:0,margin:`auto`,width:`min(420px, calc(100vw - 32px))`,padding:0,border:`1px solid #45475a`,borderRadius:8,background:`#1e1e2e`,color:`#cdd6f4`,boxShadow:`0 22px 64px rgba(0,0,0,0.58)`},Nf={display:`flex`,flexDirection:`column`,gap:14,padding:18,fontFamily:`system-ui, -apple-system, sans-serif`},Pf={margin:0,color:`#f5e0dc`,fontSize:16,fontWeight:700,lineHeight:1.25},Ff={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #45475a`,background:`#181825`,color:`#bac2de`,fontSize:12,fontWeight:700,fontFamily:`inherit`,cursor:`pointer`},If={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #6d9658`,background:`#8dcf78`,color:`#0b1020`,fontSize:12,fontWeight:800,fontFamily:`inherit`,cursor:`pointer`};function Lf({open:e,title:t,label:n,initialValue:r=``,confirmLabel:i,allowEmpty:a=!1,placeholder:o,onSubmit:s,onClose:c}){let l=(0,b.useRef)(null),u=(0,b.useRef)(null),[d,f]=(0,b.useState)(r);return(0,b.useEffect)(()=>{e&&f(r)},[r,e]),(0,b.useEffect)(()=>{let t=l.current;if(t){if(e){t.open||t.showModal(),requestAnimationFrame(()=>u.current?.focus());return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:l,"aria-labelledby":`text-input-dialog-title`,onCancel:c,onClose:c,onClick:e=>{e.target===e.currentTarget&&c()},style:Mf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault();let t=d.trim();if(!a&&!t){u.current?.focus();return}s(t)},onClick:e=>e.stopPropagation(),style:Nf,children:[(0,y.jsx)(`h2`,{id:`text-input-dialog-title`,style:Pf,children:t}),(0,y.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:7,color:`#bac2de`,fontSize:12,fontWeight:700},children:[n,(0,y.jsx)(`input`,{ref:u,value:d,onChange:e=>f(e.target.value),required:!a,placeholder:o,autoComplete:`off`,spellCheck:!1,style:{height:34,padding:`0 10px`,borderRadius:6,border:`1px solid #45475a`,background:`#11111b`,color:`#cdd6f4`,fontSize:13,fontFamily:`inherit`,outline:`none`}})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:c,style:Ff,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:If,children:i})]})]})})}function Rf({open:e,title:t,message:n,confirmLabel:r,onConfirm:i,onClose:a}){let o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let t=o.current;if(t){if(e){t.open||t.showModal();return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:o,"aria-labelledby":`confirm-dialog-title`,onCancel:a,onClose:a,onClick:e=>{e.target===e.currentTarget&&a()},style:Mf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault(),i()},onClick:e=>e.stopPropagation(),style:Nf,children:[(0,y.jsx)(`h2`,{id:`confirm-dialog-title`,style:Pf,children:t}),(0,y.jsx)(`p`,{style:{margin:0,color:`#bac2de`,fontSize:13,lineHeight:1.45},children:n}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:a,style:Ff,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:If,children:r})]})]})})}var zf=20,X=16,Bf=`#11111b`,Vf=20,Hf=30,Uf=28,Wf=Hf,Gf=400,Kf=112,qf=1e3,Jf=X-5,Yf=`#1e1e2e`,Xf=`#45475a`,Zf=`#cdd6f455`,Qf=`#cdd6f422`,$f=`#a6e3a1`,ep=`#f38ba8`,tp=`#a6e3a1`,np=`#f38ba8`,rp=2,ip=.85,ap=12,op=6,sp=30,cp=6,lp=6,up=3,dp={mass:2.1,tension:180,friction:28},fp=220,pp=900,mp=`cubic-bezier(0.22, 1, 0.36, 1)`,hp=6,gp=14,_p=`600 11px system-ui, -apple-system, sans-serif`,vp=6,yp=13,bp=150,xp=56*.55,Sp=56*.3,Cp=54,wp={laneWidth:80,rowHeight:56,nodeRadius:X,clearance:2,curveControlRatio:.3},Tp=new Map;function Ep(e){return Math.round((Vf-e)/2)}function Dp(e,t){return!!e&&e.action===t.action&&e.refName===t.refName&&e.sha===t.sha&&e.force===t.force}function Op(e){return!!e&&typeof e==`object`&&e.code===`CONFLICT`}function kp(e){if(!e||typeof e!=`object`)return null;let t=e.data;if(!t||typeof t!=`object`)return null;let n=t;return n.reason===`branch-in-use`&&typeof n.worktreePath==`string`?n.worktreePath:null}function Ap(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function jp({color:e,size:t=yp}){return(0,y.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,style:{display:`block`,flexShrink:0},children:[(0,y.jsx)(`path`,{d:`M8 13V9M8 9H4V5M8 9h4V5`,stroke:e,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,y.jsx)(`circle`,{cx:`4`,cy:`3.5`,r:`1.5`,fill:Bf,stroke:e,strokeWidth:`1.4`}),(0,y.jsx)(`circle`,{cx:`12`,cy:`3.5`,r:`1.5`,fill:Bf,stroke:e,strokeWidth:`1.4`}),(0,y.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`,fill:Bf,stroke:e,strokeWidth:`1.4`})]})}function Mp(e){let t=/^(v?)(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?{hasVPrefix:t[1]===`v`,major:Number(t[2]),minor:Number(t[3]),patch:Number(t[4])}:null}function Np(e,t){return e.major-t.major||e.minor-t.minor||e.patch-t.patch||Number(e.hasVPrefix)-Number(t.hasVPrefix)}function Pp(e){let t=null;for(let n of e){if(n.kind!==`tag`)continue;let e=Mp(n.shortName);e&&(!t||Np(e,t)>0)&&(t=e)}return t?`${t.hasVPrefix?`v`:``}${t.major}.${t.minor}.${t.patch+1}`:``}function Fp(e){return e?e.startsWith(`refs/remotes/`)?e.slice(13):e:null}function Ip(e,t){let n=Fp(e.upstream);if(n)return t.find(e=>e.kind===`remote`&&e.shortName===n)??null;let r=t.find(t=>t.kind===`remote`&&t.shortName===`origin/${e.shortName}`);if(r)return r;let i=t.filter(t=>t.kind===`remote`&&t.shortName.endsWith(`/${e.shortName}`));return i.length===1?i[0]:null}function Lp(e,t){return e.parentShas.length===t.parentShas.length&&e.parentShas.every((e,n)=>e===t.parentShas[n])}function Rp(e,t,n,r){if(r.kind===`uncommit`)return null;let i=br(_r(t.rows,n.maxLaneRadius),n.extraLeftGutter,n.rightGutter,{laneCenterX:n.laneCenterX,laneRadius:n.maxLaneRadius,totalWidth:n.layoutWidth});if(r.kind===`commit`){let t=i.nodes.find(t=>!e.shaToNode.has(t.row.sha));if(!t)return null;let n=e.shaToNode.get(t.row.parentShas[0]);if(!n)return null;let r=e.nodes[0]??n,a={...t,x:n.x,y:r.y-56,idx:r.idx-1},o=`${a.row.sha}-${n.row.sha}`,s=Xp(a,n,o,e.nodes.map(e=>e.row.lane));return{nodes:[{node:a,color:tp}],edges:[{key:o,path:Qp(a,n,s,0),color:tp,dashed:!0}]}}let a=new Set;for(let t of i.nodes){let n=e.shaToNode.get(t.row.sha);(!n||!Lp(n.row,t.row))&&a.add(t.row.sha)}let o=t.refs.find(e=>e.kind===`head`&&e.isCurrent),s=[],c=new Set,l=o?.targetSha;for(;l&&!c.has(l);){c.add(l);let e=i.shaToNode.get(l);if(!e)break;s.push(e),l=e.row.parentShas[0]}let u=s.findIndex(e=>a.has(e.row.sha)),d=u>=0?s.slice(0,u+1):t.headSha?[i.shaToNode.get(t.headSha)].filter(e=>!!e):[];if(d.length===0)return null;let f=t.refs.find(e=>e.shortName===r.targetRefName),p=f?.peeledSha??f?.targetSha,m=p?e.shaToNode.get(p)??i.shaToNode.get(p):null,h=m?d.map(e=>({...e,x:m.x,row:{...e.row,lane:m.row.lane}})):d,g=m??e.nodes[0];if(!g)return null;let _=xf(h,g,56),v=new Set(_.map(e=>e.row.sha)),y=new Map(_.map(e=>[e.row.sha,e])),b=i.nodes.map(e=>e.row.lane),x=[];for(let t of _)for(let n=0;n<t.row.parentShas.length;n++){let r=t.row.parentShas[n],a=v.has(r)?y.get(r):e.shaToNode.get(r)??i.shaToNode.get(r);if(!a)continue;let o=`action-preview:${t.row.sha}-${a.row.sha}`,s=Xp(t,a,o,b,{adjacentTrack:n>0?`to`:`from`});x.push({key:o,path:Qp(t,a,s,0),color:tp,dashed:!0})}return{nodes:[..._.map(e=>({node:e,color:tp}))],edges:x,gutterX:m?m.x-Cp/2:void 0}}function zp(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function Bp(e,t,n,r,i){let a=n-e,o=r-t,s=Math.hypot(a,o)||1;return{x:e+a/s*i,y:t+o/s*i}}function Vp(e,t){if(e.length===0)return``;if(e.length===1)return`M${e[0].x},${e[0].y}`;let n=`M${e[0].x},${e[0].y}`;for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=a.x-i.x,c=a.y-i.y,l=o.x-a.x,u=o.y-a.y,d=Math.hypot(s,c),f=Math.hypot(l,u);if(d<.001||f<.001){n+=`L${a.x},${a.y}`;continue}let p=Math.min(t,d/2,f/2),m=a.x-s/d*p,h=a.y-c/d*p,g=a.x+l/f*p,_=a.y+u/f*p;n+=`L${m},${h}Q${a.x},${a.y} ${g},${_}`}let r=e[e.length-1];return n+=`L${r.x},${r.y}`,n}function Hp(e,t,n){let r=Math.abs(t.idx-e.idx),i=Math.min(e.y,t.y),a=fr(n),o=r>12?[.28,.42,.56,.7]:[.35,.5,.65],s=o[a%o.length]??.5,c=Math.max(0,Math.min(r-1,Math.round((r-1)*s))),l=((a>>3)%3-1)*4;return i+56*(c+.5)+l}function Up(e,t,n,r){let i=Math.max(0,Math.min(t,n)+1),a=Math.min(e.length-1,Math.max(t,n)-1),o=0;for(let t=i;t<=a;t++){let n=e[t];r(n,t)&&o++}return o}function Wp(e,t,n,r,i){let a=Math.max(0,Math.min(t,n)),o=Math.min(r.length-1,Math.max(t,n));for(let t=a;t<=o;t++)if(r[t]===e||i?.get(t)?.includes(e))return!1;return!0}function Gp(e,t,n,r=!1,i=0,a=X){let o=t.y>e.y?1:-1,s=e.y+o*24,c=Math.max(1,a-1);if(!r&&Math.abs(n-t.x)<.001&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-o,i=c*Math.SQRT1_2,a={x:t.x+n*i,y:t.y+r*i},l={x:a.x+n*18*Math.SQRT1_2,y:a.y+r*18*Math.SQRT1_2},u=l.x;return Vp([Bp(e.x,e.y,u,s,X-1),{x:u,y:s},l,a],5)}let l=Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,u=n,d;if(l){let n=t.x<e.x?-1:1,r=(X-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+o*r},a={x:i.x+n*18*Math.SQRT1_2,y:i.y+o*18*Math.SQRT1_2};u=a.x,d=[i,a]}else d=[Bp(e.x,e.y,n,s,X-1),{x:n,y:s}];let f=r?Math.max(-c,Math.min(c,i)):i,p=r?t.y+f:t.y-o*24,m=r?{x:t.x+Math.sign(u-t.x||1)*Math.sqrt(Math.max(0,c**2-f**2)),y:p}:Bp(t.x,t.y,u,p,c);return Vp([...d,{x:u,y:p},m],ap)}function Kp(e,t,n,r=0,i=X){let a=t.y>e.y?1:-1,o=e.y+a*24,s=Math.abs(n-t.x)>.001,c=Math.max(1,i-1);if(!s&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-a,i=c*Math.SQRT1_2,s={x:t.x+n*i,y:t.y+r*i},l={x:s.x+n*18*Math.SQRT1_2,y:s.y+r*18*Math.SQRT1_2},u=l.x;return Vp([Bp(e.x,e.y,u,o,X-1),{x:u,y:o},l,s],5)}let l=Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,u=n,d;if(l){let n=t.x<e.x?-1:1,r=(X-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+a*r},o={x:i.x+n*18*Math.SQRT1_2,y:i.y+a*18*Math.SQRT1_2};u=o.x,d=[i,o]}else d=[Bp(e.x,e.y,n,t.y,X-1),{x:n,y:o}];let f=s?Math.max(-c,Math.min(c,r)):0,p=t.y+f,m=s?{x:t.x+Math.sign(u-t.x)*Math.sqrt(Math.max(0,c**2-f**2)),y:p}:Bp(t.x,t.y,u,p,c);return Vp([...d,{x:u,y:p},m],ap)}function qp(e,t,n,r,i){let a=Bp(e.x,e.y,t.x,t.y,X-1),o=Bp(t.x,t.y,e.x,e.y,X-1),s=t.y>e.y?1:-1,c=e.y+s*24,l=t.y-s*24;return Vp([a,{x:n,y:c},{x:n,y:i},{x:r,y:i},{x:r,y:l},o],ap)}function Jp(e,t,n=0,r=X,i){if(Math.abs(e.x-t.x)<.001&&Math.abs(n)>.001){let a=t.y>e.y?1:-1,o=X-1,s=Math.max(1,r-1),c=Math.max(-Math.min(o,s),Math.min(Math.min(o,s),n)),l=Math.sqrt(Math.max(0,s**2-c**2)),u=Math.abs(t.y-e.y),d=i===void 0?34:Math.abs(i-e.y),f=Math.min(u/2,34),p=Math.max(f,u-l-8),m=Math.max(f,Math.min(p,d)),h=e.y+a*m,g=h-a*10,_={x:t.x+c,y:t.y-a*l};return Vp([{x:e.x,y:e.y+a*o},{x:e.x,y:g},{x:e.x+c,y:h},_],Math.min(ap,6))}let a=Bp(e.x,e.y,t.x,t.y,X-1),o=Bp(t.x,t.y,e.x,e.y,Math.max(1,r-1));return`M${a.x},${a.y}L${o.x},${o.y}`}function Yp(e,t,n,r=X,i){if(n){let a=Math.max(1,r-1),o=t.y>=e.y?1:-1,s=X-1,c=s*Math.SQRT1_2,l=i?{x:e.x+(i===`left`?-c:c),y:e.y+o*c}:{x:e.x,y:e.y+o*s},u={x:t.x+(n===`left`?-a:a),y:t.y},d=Math.min(18,Math.hypot(u.x-l.x,u.y-l.y)*.2);return Vp([l,{x:l.x+(i===`left`?-d*Math.SQRT1_2:i===`right`?d*Math.SQRT1_2:0),y:l.y+o*(i?d*Math.SQRT1_2:d)},{x:u.x+(n===`left`?-d:d),y:u.y},u],Math.min(5,d/2))}let a=Bp(e.x,e.y,t.x,t.y,X-1),o=Bp(t.x,t.y,e.x,e.y,X-1);return zp(a.x,a.y,o.x,o.y)}function Xp(e,t,n,r,i={}){let a=Math.abs(e.row.lane-t.row.lane),o=Math.abs(t.idx-e.idx);if(a===0)return{mode:`straight`};if(a===1&&o>=op)return{mode:`adjacent-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:i.adjacentTrack??`from`};if(o<op){let n=i.adjacentTrack??`from`,a=jf({x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},{x:t.x,y:t.y,idx:t.idx,lane:t.row.lane},r,wp,n,i.additionalOccupiedLanes);return a?{mode:`occlusion-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:a}:{mode:`curve`}}let s=i.adjacentTrack??`from`,c={x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},l={x:t.x,y:t.y,idx:t.idx,lane:t.row.lane};if(s===`to`&&e.row.lane*t.row.lane<0){let n=e.row.lane<0?-1:1,a=e.row.lane+n;if(Wp(a,e.idx,t.idx,r,i.additionalOccupiedLanes))return{mode:`outer-rail`,side:n<0?`left`:`right`,anchorLane:a,innerLane:t.row.lane,outerRailX:e.x+n*80,horizontalTargetJoin:!0}}let u=Af(c,l,r,s,i.additionalOccupiedLanes);if(u)return{mode:`outer-rail`,...u,horizontalTargetJoin:!0};let d=Math.min(e.row.lane,t.row.lane),f=Math.max(e.row.lane,t.row.lane),p=fr(n)%3*cp,m=t.x>e.x?1:-1,h=sp+p,g=e.x+m*h,_=t.x-m*h,v=Hp(e,t,n),y=Math.max(e.x,t.x),b=Math.min(e.x,t.x),x=Up(r,e.idx,t.idx,e=>e>d&&e<f),S=Up(r,e.idx,t.idx,e=>e<d),C=Up(r,e.idx,t.idx,e=>e>f),w=e.x<t.x?`left`:(e.x,t.x,`right`),T=x*5+a,ee=S*2+(w===`left`?0:.5),te=C*2+(w===`right`?0:.5);return te<=ee&&te<T?{mode:`outer-rail`,side:`right`,anchorLane:f,innerLane:d,outerRailX:y}:ee<T?{mode:`outer-rail`,side:`left`,anchorLane:d,innerLane:f,outerRailX:b}:{mode:`inside-rail`,minLane:d,maxLane:f,sourceRailX:g,targetRailX:_,crossoverY:v}}function Zp(e,t){let n=e=>`vertical:${Math.round(e*1e3)/1e3}`;switch(t.mode){case`straight`:return n(e.from.x);case`outer-rail`:return n(t.outerRailX);case`inside-rail`:return`${t.mode}:${t.minLane}:${t.maxLane}`;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return n(t.track===`to`?e.to.x:e.from.x);default:return null}}function Qp(e,t,n,r,i=0,a=X){switch(n.mode){case`straight`:return Jp(e,t,r,a,n.bundleJoinY);case`curve`:return Yp(e,t,n.targetSide,a,n.sourceSide);case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return Kp(e,t,(n.track===`to`?t.x:e.x)+r,i,a);case`inside-rail`:return qp(e,t,n.sourceRailX+r,n.targetRailX+r,n.crossoverY);case`outer-rail`:return Gp(e,t,n.outerRailX+r,n.horizontalTargetJoin,i,a)}}function $p(e,t,n){if(e.mode!==t.mode)return n<.5?e:t;switch(t.mode){case`straight`:{let r=e;return{mode:`straight`,bundleJoinY:r.bundleJoinY===void 0?t.bundleJoinY:t.bundleJoinY===void 0?r.bundleJoinY:Z(r.bundleJoinY,t.bundleJoinY,n)}}case`curve`:return t;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return t;case`inside-rail`:{let r=e;return{...t,sourceRailX:Z(r.sourceRailX,t.sourceRailX,n),targetRailX:Z(r.targetRailX,t.targetRailX,n),crossoverY:Z(r.crossoverY,t.crossoverY,n)}}case`outer-rail`:{let r=e;return{...t,outerRailX:Z(r.outerRailX,t.outerRailX,n)}}}}function em(e,t){return Qp({x:Z(e.fromX1,e.toX1,t),y:Z(e.fromY1,e.toY1,t)},{x:Z(e.fromX2,e.toX2,t),y:Z(e.fromY2,e.toY2,t)},$p(e.fromPlan,e.toPlan,t),Z(e.fromBundleOffset,e.toBundleOffset,t),Z(e.fromTargetJoinOffset,e.toTargetJoinOffset,t),Z(e.fromTargetNodeRadius,e.toTargetNodeRadius,t))}function tm(e){if(e.length===0)return 0;let t=e.map(e=>e.locChanged).sort((e,t)=>e-t);return t[Math.max(0,Math.ceil(t.length*ip)-1)]??t[t.length-1]??0}function nm(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n} L ${e} ${t-n} Z`}function rm(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n}`}function im(e,t,n){if(e<=0||t<=0)return 0;let r=n*Math.min(e/t,1);return Math.max(rp,r)}var am=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function om(e){return e>=1.4}function sm(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function cm(e,t){return sm(e,t)&&e.getHours()===t.getHours()}function lm(e){return`${am[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`}function um(e){return`${`${e.getHours()}`.padStart(2,`0`)}:${`${e.getMinutes()}`.padStart(2,`0`)}`}function dm(e,t){return om(t)?`${lm(e)} ${um(e)}`:lm(e)}function fm(e,t){if(e.length===0)return[];let n=om(t),r=[],i=null,a=-1/0;for(let o of e){let e=new Date(o.row.committerUnix*1e3),s=o.y*t,c=!i||!sm(e,i),l=!i||e.getMonth()!==i.getMonth()||e.getFullYear()!==i.getFullYear(),u=!i||!cm(e,i);i=e;let d=null;if(n?c?d={key:`${o.row.sha}:day`,text:lm(e),y:s,kind:`month`}:u&&(d={key:`${o.row.sha}:hour`,text:um(e),y:s,kind:`hour`}):c&&(d={key:`${o.row.sha}:day`,text:l?lm(e):`${e.getDate()}`,y:s,kind:l?`month`:`day`}),!d)continue;let f=d.kind===`hour`?34:22;s-a<f||(r.push(d),a=s)}return r}function pm(e,t,n){if(e.length===0)return null;let r=t/n,i=Math.max(0,Math.min(e.length-1,Math.floor((r-40-112)/56)));for(;i+1<e.length&&e[i+1].y*n<=t;)i++;return e[i]??e[0]??null}function mm(e){return e.includes(`/`)}function hm(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function gm(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||r.parentShas.length!==i.parentShas.length||!hm(r.refNames,i.refNames))return!1;for(let e=0;e<r.parentShas.length;e++)if(r.parentShas[e]!==i.parentShas[e])return!1}return!0}function _m(e,t){if(t.length<=e.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||!hm(r.refNames,i.refNames))return!1}return!0}function vm(e,t){return!(!e||!t||e.length===0||t.length===0||gm(e,t)||_m(e,t))}function ym(e,t){return e?`☁ `:t?`● `:`⎇ `}var bm=new Map;function xm(e){let t=bm.get(e);if(t!==void 0)return t;let n=xd(yd(e,_p));return bm.set(e,n),n}function Sm(e,t,n){let r=ym(t,n)+e;return gp+Math.ceil(xm(r))}function Cm(e,t,n,r,i){let a=[],o=new Map;for(let s of e){let e=s.x+(i?.get(s.row.sha)??X)+8,c=s.y-10,l=e;for(let e of s.row.refNames){let i=t!==null&&e===t,o=mm(e);a.push({refName:e,nodeSha:s.row.sha,x:l,y:c,color:r.get(s.row.sha)??pr(s.row.lane),isCurrent:i,isSelected:e===n,isRemote:o}),l+=Sm(e,o,i)+hp}o.set(s.row.sha,s.row.refNames.length>0?l-e-hp:0)}return{placements:a,rowWidths:o}}function wm(e){return Math.min(bp,30+Math.ceil(xm(Ap(e.path))))}function Tm(e,t,n){let r=new Map;for(let e of t){if(!e.headSha||e.bare||e.prunable||e.isCurrent&&!e.detached)continue;let t=r.get(e.headSha)??[];t.push(e),r.set(e.headSha,t)}let i=[];for(let t of e){let e=r.get(t.row.sha);if(!e)continue;e.sort((e,t)=>Number(t.isCurrent)-Number(e.isCurrent)||e.path.localeCompare(t.path));let a=t.x-(n?.get(t.row.sha)??X)-8;for(let n of e){let e=wm(n);i.push({worktree:n,nodeSha:t.row.sha,x:a-e,y:t.y-Vf/2,width:e}),a-=e+vp}}return i}function Z(e,t,n){return e+(t-e)*n}function Em(e,t,n,r){let i=t*3,a=e-i,o=e+t+i,s=56*r,c=152*r;return{firstIdx:Math.max(0,Math.floor((a-c)/s)),lastIdx:Math.min(n-1,Math.ceil((o-c)/s))}}function Dm(e,t,n,r){return Math.max(e,t)>=n&&Math.min(e,t)<=r}function Om(e,t,n){let r=e.nodes.slice(t,n+1),i=[];for(let r of e.nodes)for(let a=0;a<r.row.parentShas.length;a++){let o=r.row.parentShas[a],s=e.shaToNode.get(o)??{row:{...r.row,sha:o,parentShas:[],refNames:[]},x:r.x,y:e.totalHeight,idx:e.nodes.length};Dm(r.idx,s.idx,t,n)&&i.push({from:r,to:s,isMerge:a>0,key:`${r.row.sha}-${s.row.sha}`})}return{visibleNodes:r,visibleEdges:i}}function km(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha,a=new Set;for(;i&&!a.has(i);){a.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r)break;n.add(`${t.row.sha}-${r}`);let o=e.shaToNode.get(r);if(!o)break;i=o.row.sha}return n}function Am(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha;for(;i&&!n.has(i);){n.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r||!e.shaToNode.get(r))break;i=r}return n}function jm(e,t){if(!e||!t)return null;let n=e.nodes.find(e=>e.row.refNames.includes(t));return n?{key:t,x:n.x-Cp/2,color:e.shaToColor.get(n.row.sha)??pr(n.row.lane)}:null}function Mm(e){return new Set(e.unstaged.filter(e=>e.status===`U`).map(e=>e.path)).size}function Nm(e,t){return Math.max(e.topIdx,t.topIdx)<Math.min(e.bottomIdx,t.bottomIdx)}function Pm(e,t=up){let n=new Map;for(let t of e){let e=n.get(t.railKey);e?e.push(t):n.set(t.railKey,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key));let n=e.map((e,t)=>t),i=e=>n[e]===e?e:(n[e]=i(n[e]),n[e]),a=(e,t)=>{let r=i(e),a=i(t);r!==a&&(n[a]=r)};for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length&&!(e[n].topIdx>e[t].bottomIdx);n++)Nm(e[t],e[n])&&a(t,n);let o=new Map;for(let t=0;t<e.length;t++){let n=i(t),r=o.get(n);r?r.push(e[t]):o.set(n,[e[t]])}for(let e of o.values()){let n=[...e].sort((e,t)=>(e.bundleOrder??0)-(t.bundleOrder??0)||e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key)),i=[],a=[],o=[];for(let e of n){let t=i.findIndex(t=>t.every(t=>!Nm(t,e)));t<0&&(t=i.length,i.push([])),i[t].push(e),a[t]=Math.max(a[t]??0,e.strokeWidth??3),o.push({key:e.key,slot:t})}let s=[0];for(let e=1;e<a.length;e++)s[e]=s[e-1]+a[e-1]/2+t+a[e]/2;let c=Math.floor(s.length/2),l=s.length%2==1?s[c]:(s[c-1]+s[c])/2;for(let e of o)r.set(e.key,s[e.slot]-l)}}return r}function Fm(e,t=lp){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.push(t):n.set(e,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>(e.side===`right`?e.railX-t.railX:t.railX-e.railX)||e.key.localeCompare(t.key));let n=(e.length-1)/2;for(let i=0;i<e.length;i++)r.set(e[i].key,(i-n)*t)}return r}function Im(e,t=lp){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.count++:n.set(e,{targetKey:t.targetKey,count:1})}let r=new Map;for(let{targetKey:e,count:i}of n.values()){if(i<5)continue;let n=X+Math.ceil((i-4)*t/2);r.set(e,Math.max(r.get(e)??X,n))}return r}function Lm(e,t,n=0){return t?.mode===`outer-rail`&&t.horizontalTargetJoin?t.outerRailX+n:t?.mode===`adjacent-hook`||t?.mode===`occlusion-hook`||t?.mode===`target-hook`?(t.track===`to`?e.to.x:e.from.x)+n:null}function Rm(e,t,n){let r=new Map;for(let i of e){let e=Xp(i.from,i.to,i.key,t,{adjacentTrack:i.isMerge?`to`:`from`,additionalOccupiedLanes:n});r.set(i.key,e)}let i=new Set,a=new Map;for(let t of e){let e=Lm(t,r.get(t.key));if(e===null||Math.abs(e-t.to.x)<.001)continue;let n=e<t.to.x?`left`:`right`;i.add(`${t.to.row.sha}:${n}`)}for(let t of e){if(r.get(t.key)?.mode!==`curve`)continue;let e=t.from.x<t.to.x?`left`:t.from.x>t.to.x?`right`:null;if(!e)continue;let n=`${t.to.row.sha}:${e}`;a.set(n,(a.get(n)??0)+1)}for(let[e,t]of a)t>1&&i.add(e);for(let a of e){if(r.get(a.key)?.mode!==`curve`)continue;let e=a.from.x<a.to.x?`left`:a.from.x>a.to.x?`right`:null;if(!e||!i.has(`${a.to.row.sha}:${e}`))continue;let o=Af({x:a.from.x,y:a.from.y,idx:a.from.idx,lane:a.from.row.lane},{x:a.to.x,y:a.to.y,idx:a.to.idx,lane:a.to.row.lane},t,`from`,n);!o||o.side!==e||r.set(a.key,{mode:`target-hook`,laneA:Math.min(a.from.row.lane,a.to.row.lane),laneB:Math.max(a.from.row.lane,a.to.row.lane),track:`from`})}let o=e.flatMap(e=>{let t=r.get(e.key);if(!t)return[];let n=Zp(e,t);return n?[{key:e.key,railKey:n,topIdx:Math.min(e.from.idx,e.to.idx),bottomIdx:Math.max(e.from.idx,e.to.idx),bundleOrder:+!!e.isMerge,railStartY:Math.min(e.from.y,e.to.y)+X+8,strokeWidth:e.isMerge?2:4.5}]:[]}),s=Pm(o);for(let e of o){if(r.get(e.key)?.mode!==`straight`||Math.abs(s.get(e.key)??0)<.001)continue;let t=o.filter(t=>t.key!==e.key&&t.railKey===e.railKey&&t.topIdx>e.topIdx&&t.topIdx<e.bottomIdx&&Nm(e,t)).sort((e,t)=>e.topIdx-t.topIdx||e.key.localeCompare(t.key))[0];t?.railStartY!==void 0&&r.set(e.key,{mode:`straight`,bundleJoinY:t.railStartY-8})}let c=new Map,l=new Set;for(let t of e){let e=r.get(t.key);if(e?.mode===`straight`&&t.from.idx<t.to.idx&&Math.abs(t.from.x-t.to.x)<.001&&l.add(t.from.row.sha),t.from.idx>=t.to.idx||!Zp(t,e??{mode:`curve`}))continue;let n=c.get(t.to.row.sha);n?n.push(t.key):c.set(t.to.row.sha,[t.key])}for(let t of e){if(r.get(t.key)?.mode!==`curve`||Math.abs(t.from.x-t.to.x)<.001)continue;let e=c.get(t.to.row.sha)??[];!(!(e.length<2)&&e.some(e=>Math.abs(s.get(e)??0)>.001))&&!l.has(t.to.row.sha)||r.set(t.key,{mode:`curve`,targetSide:t.from.x<t.to.x?`left`:`right`,...l.has(t.from.row.sha)?{sourceSide:t.to.x<t.from.x?`left`:`right`}:{}})}let u=e.flatMap(e=>{let t=Lm(e,r.get(e.key),s.get(e.key)??0);return t===null||Math.abs(t-e.to.x)<.001?[]:[{key:e.key,targetKey:e.to.row.sha,side:t<e.to.x?`left`:`right`,railX:t}]});return{plans:r,bundleOffsets:s,targetJoinOffsets:Fm(u),targetNodeRadii:Im(u)}}function zm(e,t,n,r,i){return e.map(e=>{let a=r.has(e.key),o=t.plans.get(e.key)??Xp(e.from,e.to,e.key,n,{adjacentTrack:e.isMerge?`to`:`from`}),s=t.bundleOffsets.get(e.key)??0,c=t.targetJoinOffsets.get(e.key)??0,l=t.targetNodeRadii.get(e.to.row.sha)??X,u=e.isMerge?e.to:e.from;return{key:e.key,fromSha:e.from.row.sha,toSha:e.to.row.sha,path:Qp(e.from,e.to,o,s,c,l),plan:o,bundleOffset:s,targetJoinOffset:c,targetNodeRadius:l,x1:e.from.x,y1:e.from.y,x2:e.to.x,y2:e.to.y,isMerge:e.isMerge,stroke:i.get(u.row.sha)??pr(u.row.lane),strokeWidth:a?4.5:e.isMerge?2:3,opacity:a?.95:.8}})}function Bm(e,t,n,r,i,a){return vm(e,t)?!0:!i||!a?!1:n!==r}function Vm(){let e=gf(),t=R(e=>e.historyWindow),n=R(e=>e.graphModel),r=R(e=>e.refs),i=R(e=>e.selectedSha),a=R(e=>e.selectedRefName),o=R(e=>e.mergePreview),s=R(e=>e.scrollToSha),c=R(e=>e.scrollToKey),l=R(e=>e.selectCommit),u=R(e=>e.selectGraphRef),d=R(e=>e.clearGraphRefSelection),f=R(e=>e.ensureMergePreview),p=R(e=>e.requestMore),m=R(e=>e.performRefAction),h=R(e=>e.performCommitAction),g=R(e=>e.performMergeRef),_=R(e=>e.performRebaseRef),v=R(e=>e.pendingMutation),x=R(e=>e.pendingCheckout),S=R(e=>e.graphAnimationSuppressToken),C=R(e=>e.showCommitMessages),w=R(e=>e.showGutterColors),T=R(e=>e.showError),ee=R(e=>e.commitCIStatus),te=R(e=>e.fetchCommitCIStatusesIfNeeded),E=R(e=>e.worktreeChanges),ne=R(e=>e.worktrees),re=R(e=>e.worktreeSelected),ie=R(e=>e.selectWorktree),ae=R(e=>e.openRepoByPath),oe=R(e=>e.repoId),[se,ce]=(0,b.useState)(null),D=(0,b.useRef)(null),O=(0,b.useRef)(null),le=(0,b.useRef)(null),ue=(0,b.useRef)({scrollTop:0,clientHeight:0}),de=(0,b.useRef)(0),fe=(0,b.useRef)(null),pe=(0,b.useRef)(null),me=(0,b.useRef)(null),he=(0,b.useRef)(!1),ge=(0,b.useRef)(null),_e=(0,b.useRef)(0),[ve,ye]=(0,b.useState)(1),[be,xe]=(0,b.useState)(!1),[Se,Ce]=(0,b.useState)(0),[we,Te]=(0,b.useState)(()=>typeof window>`u`?0:window.innerWidth),[Ee,De]=(0,b.useState)(0),[Oe,ke]=(0,b.useState)(0),[k,Ae]=(0,b.useState)(null),je=(0,b.useRef)(null),[Me,Ne]=(0,b.useState)(!1),[A,Pe]=(0,b.useState)(null),[Fe,Ie]=(0,b.useState)(null),[Le,Re]=(0,b.useState)(!1),[ze,Be]=(0,b.useState)(null),[Ve,He]=(0,b.useState)(null),[Ue,We]=(0,b.useState)(null),[Ge,Ke]=(0,b.useState)(null),[{graphProgress:qe},Je]=kc(()=>({graphProgress:1,config:dp})),Ye=(0,b.useRef)(1),Xe=(0,b.useRef)(null),Ze=(0,b.useRef)(0),Qe=(0,b.useRef)(null),$e=(0,b.useRef)(0),et=(0,b.useRef)(null),tt=(0,b.useRef)(null),nt=(0,b.useRef)(null),rt=(0,b.useRef)(S),[,it]=(0,b.useReducer)(e=>e+1,0),at=(0,b.useRef)({firstIdx:0,lastIdx:100});(0,b.useEffect)(()=>{let e=()=>Te(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,b.useEffect)(()=>{let e=e=>{e.code!==`KeyC`||!e.ctrlKey||!e.shiftKey||e.altKey||(e.preventDefault(),e.stopImmediatePropagation(),!(e.repeat||!oe)&&zt(oe).catch(e=>{T(`Open terminal failed`,e)}))};return document.addEventListener(`keydown`,e,{capture:!0}),()=>document.removeEventListener(`keydown`,e,{capture:!0})},[oe,T]);let ot=(0,b.useCallback)(()=>{Xe.current!==null&&clearTimeout(Xe.current),xe(!0),Xe.current=setTimeout(()=>{Xe.current=null,xe(!1)},qf)},[]);(0,b.useEffect)(()=>()=>{Xe.current!==null&&clearTimeout(Xe.current)},[]);let j=n?.currentBranch??r.find(e=>e.isCurrent)?.shortName??null,st=we>0?we:(n?.layout.totalWidth??0)*Math.max(ve,.1),ct=(0,b.useMemo)(()=>gr(st,Ee,ve,C?260:0),[st,Ee,C,ve]),lt=(0,b.useMemo)(()=>n?_r(n.renderedRows,ct.maxLaneRadius):null,[n,ct.maxLaneRadius]),M=(0,b.useMemo)(()=>lt?br(lt,ct.extraLeftGutter,ct.rightGutter,{laneCenterX:ct.laneCenterX,laneRadius:ct.maxLaneRadius,totalWidth:ct.layoutWidth}):null,[lt,ct.extraLeftGutter,ct.laneCenterX,ct.layoutWidth,ct.maxLaneRadius,ct.rightGutter]),ut=(0,b.useMemo)(()=>new Map(r.map(e=>[e.shortName,e])),[r]),dt=(0,b.useMemo)(()=>{let e=new Map;for(let t of ne){if(!t.branchShortName||t.bare||t.prunable)continue;let n=e.get(t.branchShortName)??[];n.push(t),e.set(t.branchShortName,n)}return e},[ne]),N=(0,b.useMemo)(()=>a?ut.get(a)??null:null,[ut,a]),ft=(0,b.useMemo)(()=>{if(!N)return null;if(N.kind===`head`)return dt.get(N.shortName)?.find(e=>!e.isCurrent)??null;if(N.kind===`remote`){let e=r.find(e=>e.kind===`head`&&e.upstream===N.name);return e?dt.get(e.shortName)?.find(e=>!e.isCurrent)??null:null}return null},[N,r,dt]),pt=(0,b.useMemo)(()=>Pp(r),[r]),mt=(0,b.useMemo)(()=>{if(!A||!t||A.kind===`uncommit`)return null;if(A.kind===`rebase`)return ir(t.rows,r,A.targetRefName);let e=t.rows.find(e=>e.sha===A.sha);if(!e)return null;let n=A.action===`revert`?`Revert "${e.subject}"`:e.subject;return tr(t.rows,r,n,A.action)},[A,t,r]),ht=(0,b.useMemo)(()=>!M||!A||!mt?null:Rp(M,mt,ct,A),[M,A,mt,ct]),gt=(0,b.useMemo)(()=>{if(!M||A?.kind!==`uncommit`)return null;let e=M.shaToNode.get(A.sha);return e?Cf(e,X*1.45):null},[M,A]),_t=(0,b.useMemo)(()=>{if(A?.kind!==`rebase`||!Fe||Fe.targetRefName!==A.targetRefName||!ht||ht.nodes.length===0)return null;let e=X*2,t=[...ht.nodes.map(({node:e})=>e),Fe.targetNode];return wf({baseZoom:Fe.baseZoom,bounds:{minX:Math.min(...t.map(e=>e.x))-e,minY:Math.min(...t.map(e=>e.y))-e,maxX:Math.max(...t.map(e=>e.x))+e,maxY:Math.max(...t.map(e=>e.y))+e},viewport:Fe.viewport,scroll:Fe.scroll,margin:12})},[A,ht,Fe]),vt=_t?.zoom??ve,yt=_t?.translateX??0,bt=_t?.translateY??0,xt=`${Le?pp:fp}ms ${mp}`,St=(0,b.useMemo)(()=>{if(!M||!E)return null;let e=E.staged.length+E.unstaged.length;if(e===0)return null;let t=(j?M.nodes.find(e=>e.row.refNames.includes(j)):void 0)??M.shaToNode.get(E.headSha);if(!t)return null;let n=E.mergeHeadShas?.length?`merge`:E.rebaseHeadSha?`rebase`:`worktree`,r=Mm(E),i=n===`worktree`?M.shaToColor.get(t.row.sha)??pr(t.row.lane):`#fab387`,a=Sf(t,n===`worktree`&&A?.kind===`commit`?ht?.nodes[0]?.node??null:null,56),o=a.anchor,s={row:{row:o.row.row-1,sha:`${n}:${E.headSha}:${E.mergeHeadShas?.[0]??E.rebaseHeadSha??`dirty`}`,parentShas:[o.row.sha,...E.mergeHeadShas?.slice(0,1)??[]],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:n===`merge`?`Merge in progress`:n===`rebase`?`Rebase in progress`:`Uncommitted changes`,additions:0,deletions:0,locChanged:0,refNames:[],lane:o.row.lane},x:o.x,y:a.y,idx:a.idx},c=M.nodes.map(e=>e.row.lane),l=Xp(s,o,`${s.row.sha}-${o.row.sha}`,c),u=E.mergeHeadShas?.[0],d=u?M.shaToNode.get(u)??null:null,f=d?Qp(s,d,Xp(s,d,`${s.row.sha}-${d.row.sha}`,c,{adjacentTrack:`to`}),0):null;return{kind:n,x:s.x,y:s.y,idx:s.idx,lane:s.row.lane,headX:o.x,headY:o.y,color:i,count:e,conflictedCount:r,targetPlan:l,sourcePath:f}},[M,E,j,A,ht]),P=St??(x?me.current:null),F=!!P&&!he.current,{worktreeX:Ct,worktreeY:wt,worktreeHeadX:Tt,worktreeHeadY:Et,worktreeOpacity:Dt}=kc({worktreeX:P?.x??0,worktreeY:P?.y??0,worktreeHeadX:P?.headX??0,worktreeHeadY:P?.headY??0,worktreeOpacity:P?x?.5:1:0,immediate:e=>e!==`worktreeOpacity`&&F,config:e=>e===`worktreeOpacity`?{mass:1,tension:210,friction:26,clamp:!0}:dp});(0,b.useEffect)(()=>{St?me.current=St:x||(me.current=null),P?he.current=!0:x||(he.current=!1)},[St,P,x]);let Ot=(0,b.useCallback)(e=>{_e.current=e,pe.current===null&&(pe.current=requestAnimationFrame(()=>{pe.current=null,Ce(_e.current)}))},[]),kt=(0,b.useCallback)(()=>{fe.current!==null&&(cancelAnimationFrame(fe.current),fe.current=null),je.current&&(Je.stop(),Je.set({graphProgress:1}),je.current=null,Ae(null))},[Je]),At=(0,b.useCallback)(e=>{fe.current!==null&&(cancelAnimationFrame(fe.current),fe.current=null),Je.stop(),Je.set({graphProgress:0}),je.current=e,Ae(e),fe.current=requestAnimationFrame(()=>{fe.current=requestAnimationFrame(()=>{fe.current=null,je.current===e&&Je.start({graphProgress:1,immediate:!1,config:dp,onRest:t=>{t.finished&&Ae(t=>t===e?(je.current=null,null):t)}})})})},[Je]),jt=(0,b.useCallback)(()=>{ge.current!==null&&(clearTimeout(ge.current),ge.current=null)},[]),Mt=(0,b.useCallback)(e=>{jt(),Be(e)},[jt]),Nt=(0,b.useCallback)(e=>{jt(),ge.current=setTimeout(()=>{Be(t=>t===e?null:t),ge.current=null},Gf)},[jt]);(0,b.useEffect)(()=>{Ne(!1),Pe(null),Ie(null),He(null)},[a,i]),(0,b.useEffect)(()=>{if(Fe||!Le)return;let e=window.setTimeout(()=>Re(!1),pp);return()=>window.clearTimeout(e)},[Fe,Le]),(0,b.useEffect)(()=>()=>{jt()},[jt]),(0,b.useEffect)(()=>{if(!M||!t){et.current=t?.rows??null,tt.current=M,nt.current=j,kt();return}let e=S!==rt.current;if(rt.current=S,e){et.current=t.rows,tt.current=M,nt.current=j;return}Bm(et.current,t.rows,nt.current,j,tt.current,M)&&tt.current?At({fromLayout:tt.current,toLayout:M,fromCurrentBranch:nt.current,toCurrentBranch:j}):kt(),et.current=t.rows,tt.current=M,nt.current=j},[j,t,M,S,At,kt]),(0,b.useEffect)(()=>()=>{Je.stop(),fe.current!==null&&cancelAnimationFrame(fe.current),pe.current!==null&&cancelAnimationFrame(pe.current)},[Je]);let Pt=(0,b.useMemo)(()=>t?tm(t.rows):0,[t]),Ft=(0,b.useMemo)(()=>M?M.nodes.map(e=>e.row.lane):[],[M]),It=(0,b.useMemo)(()=>P?new Map([[P.idx,[P.lane]]]):void 0,[P]),I=(0,b.useMemo)(()=>w?Array.from({length:ct.maxLaneRadius*2+1},(e,t)=>{let n=t-ct.maxLaneRadius;return{lane:n,x:ct.laneCenterX+n*80,color:pr(n)}}):[],[w,ct.laneCenterX,ct.maxLaneRadius]),Lt=(0,b.useMemo)(()=>km(M,j),[M,j]),Rt=(0,b.useCallback)((e,t)=>{if(!M)return;ue.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},de.current=e.scrollTop,Ot(e.scrollTop),O.current&&(O.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:n,lastIdx:r}=Em(e.scrollTop,e.clientHeight,M.nodes.length,t);at.current={firstIdx:n,lastIdx:r},it()},[M,Ot]);(0,b.useEffect)(()=>{if(!s||!M||!D.current||Date.now()<Ze.current)return;let e=M.shaToNode.get(s);if(!or(Qe.current,c,!!e)||!e)return;Qe.current=c;let t=D.current,n=e.y*ve-t.clientHeight/2;$e.current=Date.now()+700,t.scrollTo({top:Math.max(0,n),behavior:`smooth`})},[s,c,M,ve]),(0,b.useEffect)(()=>{let e=D.current;if(!e)return;let n=()=>{if(!M)return;let n=e.scrollTop,r=Math.abs(n-de.current)>.5;e.scrollLeft!==0&&(e.scrollLeft=0),ue.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},Te(window.innerWidth),De(e.getBoundingClientRect().left),ke(e.clientHeight),de.current=n,r&&Date.now()>=$e.current&&kt(),Ot(e.scrollTop),O.current&&(O.current.style.transform=`translateY(${-e.scrollTop}px)`),le.current&&(le.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:i,lastIdx:a}=Em(e.scrollTop,e.clientHeight,M.nodes.length,Ye.current),o=at.current,s=Math.floor((o.lastIdx-o.firstIdx)*.25);if((i<o.firstIdx+s||a>o.lastIdx-s)&&(at.current={firstIdx:i,lastIdx:a},it()),t&&t.hasMoreAfter&&M){let t=M.totalHeight*Ye.current;ar(e.scrollTop,e.clientHeight,t)&&p(`down`)}};e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>n());return r.observe(e),n(),()=>{e.removeEventListener(`scroll`,n),r.disconnect()}},[M,t,p,kt,Ot]),(0,b.useEffect)(()=>{let e=D.current;!e||!O.current||Rt(e,ve)},[M,ve,Rt]);let Bt=(0,b.useCallback)((e,t)=>{let n=D.current;if(!n)return;let r=Ye.current;if(ot(),e===r)return;let i=(n.scrollTop+t)/r;Ye.current=e,ye(e),n.scrollTop=Math.max(0,i*e-t)},[ot]),Vt=(0,b.useCallback)(()=>{let e=D.current;e&&Bt(1,e.clientHeight/2)},[Bt]);(0,b.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey)return;let t=D.current;if(!t||!t.contains(e.target))return;e.preventDefault(),e.stopPropagation();let n=t.getBoundingClientRect(),r=Ye.current,i=e.deltaY>0?-.1:.1,a=Math.max(.1,Math.min(3,Math.round((r+i)*10)/10));Bt(a,e.clientY-n.top)};return document.addEventListener(`wheel`,e,{passive:!1,capture:!0}),()=>document.removeEventListener(`wheel`,e,{capture:!0})},[Bt]),(0,b.useEffect)(()=>{!M||!D.current||!t?.hasMoreAfter||D.current.clientHeight/ve>M.nodes.length*56*.8&&p(`down`)},[ve,M,t,p]);let{visibleNodes:Ht,visibleEdges:Ut}=(0,b.useMemo)(()=>{if(!M)return{visibleNodes:[],visibleEdges:[]};let{firstIdx:e,lastIdx:t}=at.current;return Om(M,e,t)},[M,at.current.firstIdx,at.current.lastIdx]),Wt=(0,b.useMemo)(()=>Rm(Ut,Ft,It),[Ut,Ft,It]),{placements:Gt,rowWidths:Kt}=(0,b.useMemo)(()=>Cm(Ht,j,a,M?.shaToColor??Tp,Wt.targetNodeRadii),[Ht,j,a,M,Wt]),qt=(0,b.useMemo)(()=>Tm(Ht,ne,Wt.targetNodeRadii),[Ht,ne,Wt]),Jt=(0,b.useMemo)(()=>{let e=new Map;for(let t of qt)e.set(t.nodeSha,Math.min(e.get(t.nodeSha)??1/0,t.x));return e},[qt]),Yt=Kt,Xt=(0,b.useMemo)(()=>zm(Ut,Wt,Ft,Lt,M?.shaToColor??Tp),[Ut,Wt,Ft,Lt,M]),Zt=(0,b.useMemo)(()=>jm(M,j),[M,j]),Qt=(0,b.useMemo)(()=>{if(!k)return null;let e=ue.current.scrollTop,t=ue.current.clientHeight||D.current?.clientHeight||0,n=k.fromLayout.nodes.map(e=>e.row.lane),r=k.toLayout.nodes.map(e=>e.row.lane),i=Em(e,t,k.fromLayout.nodes.length,ve),o=Em(e,t,k.toLayout.nodes.length,ve),s=Om(k.fromLayout,i.firstIdx,i.lastIdx),c=Om(k.toLayout,o.firstIdx,o.lastIdx),l=Rm(s.visibleEdges,n),u=Rm(c.visibleEdges,r),d=zm(s.visibleEdges,l,n,km(k.fromLayout,k.fromCurrentBranch),k.fromLayout.shaToColor),f=zm(c.visibleEdges,u,r,km(k.toLayout,k.toCurrentBranch),k.toLayout.shaToColor),p=Cm(s.visibleNodes,k.fromCurrentBranch,a,k.fromLayout.shaToColor,l.targetNodeRadii).placements,m=Cm(c.visibleNodes,k.toCurrentBranch,a,k.toLayout.shaToColor,u.targetNodeRadii).placements,h=jm(k.fromLayout,k.fromCurrentBranch),g=jm(k.toLayout,k.toCurrentBranch),_=new Map(s.visibleNodes.map(e=>[e.row.sha,e])),v=new Map(c.visibleNodes.map(e=>[e.row.sha,e])),y=new Map(d.map(e=>[e.key,e])),b=new Map(f.map(e=>[e.key,e])),x=new Map(p.map(e=>[e.refName,e])),S=new Map(m.map(e=>[e.refName,e]));return{nodes:[...new Set([..._.keys(),...v.keys()])].map(e=>{let t=_.get(e),n=v.get(e),r=n??t;if(!r)return null;let i=n?k.toLayout:k.fromLayout;return{sortIdx:n?.idx??t?.idx??0,item:{key:e,row:r.row,interactive:!!n,color:i.shaToColor.get(e)??pr(r.row.lane),fromX:t?.x??r.x,fromY:t?t.y:r.y+xp,toX:n?.x??r.x,toY:n?n.y:r.y-Sp,fromOpacity:+!!t,toOpacity:+!!n,fromRadius:t?l.targetNodeRadii.get(e)??X:u.targetNodeRadii.get(e)??X,toRadius:n?u.targetNodeRadii.get(e)??X:l.targetNodeRadii.get(e)??X}}}).filter(e=>e!==null).sort((e,t)=>e.sortIdx-t.sortIdx).map(e=>e.item),edges:[...new Set([...y.keys(),...b.keys()])].map(e=>{let t=y.get(e),n=b.get(e),r=n??t;if(!r)return null;let i=n?k.fromLayout.shaToNode.get(n.fromSha):void 0,a=n?k.fromLayout.shaToNode.get(n.toSha):void 0,o=t?k.toLayout.shaToNode.get(t.fromSha):void 0,s=t?k.toLayout.shaToNode.get(t.toSha):void 0;return{sortY:Math.min(n?.y1??t?.y1??0,n?.y2??t?.y2??0),item:{key:e,fromSha:r.fromSha,toSha:r.toSha,path:n?.path??t?.path??``,fromPlan:t?.plan??n?.plan??{mode:`curve`},toPlan:n?.plan??t?.plan??{mode:`curve`},fromBundleOffset:t?.bundleOffset??n?.bundleOffset??0,toBundleOffset:n?.bundleOffset??t?.bundleOffset??0,fromTargetJoinOffset:t?.targetJoinOffset??n?.targetJoinOffset??0,toTargetJoinOffset:n?.targetJoinOffset??t?.targetJoinOffset??0,fromTargetNodeRadius:t?.targetNodeRadius??n?.targetNodeRadius??X,toTargetNodeRadius:n?.targetNodeRadius??t?.targetNodeRadius??X,stroke:n?.stroke??t?.stroke??`#cdd6f4`,fromStrokeWidth:t?.strokeWidth??r.strokeWidth,toStrokeWidth:n?.strokeWidth??r.strokeWidth,fromOpacity:t?.opacity??0,toOpacity:n?.opacity??0,fromX1:t?.x1??i?.x??r.x1,fromY1:t?.y1??i?.y??r.y1+xp,fromX2:t?.x2??a?.x??r.x2,fromY2:t?.y2??a?.y??r.y2+xp,toX1:n?.x1??o?.x??r.x1,toY1:n?.y1??o?.y??r.y1-Sp,toX2:n?.x2??s?.x??r.x2,toY2:n?.y2??s?.y??r.y2-Sp}}}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),refs:[...new Set([...x.keys(),...S.keys()])].map(e=>{let t=x.get(e),n=S.get(e),r=n??t;return r?{sortY:n?.y??t?.y??0,item:{key:e,placement:r,fromX:t?.x??r.x,fromY:t?t.y:r.y+xp,toX:n?.x??r.x,toY:n?n.y:r.y-Sp,fromOpacity:+!!t,toOpacity:+!!n,fromScale:t?1:.9,toScale:n?1:.92}}:null}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),lane:h||g?{key:g?.key??h?.key??`current-lane`,color:g?.color??h?.color??`#89b4fa`,fromX:h?.x??g?.x??0,toX:g?.x??h?.x??0,fromOpacity:+!!h,toOpacity:+!!g}:null}},[k,a,ve]),$t=(0,b.useMemo)(()=>Qt?.nodes??Ht.map(e=>({key:e.row.sha,row:e.row,interactive:!0,color:M?.shaToColor.get(e.row.sha)??pr(e.row.lane),fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromRadius:Wt.targetNodeRadii.get(e.row.sha)??X,toRadius:Wt.targetNodeRadii.get(e.row.sha)??X})),[Qt,Ht,M]),en=(0,b.useMemo)(()=>Qt?.edges??Xt.map(e=>({key:e.key,fromSha:e.fromSha,toSha:e.toSha,path:e.path,fromPlan:e.plan,toPlan:e.plan,fromBundleOffset:e.bundleOffset,toBundleOffset:e.bundleOffset,fromTargetJoinOffset:e.targetJoinOffset,toTargetJoinOffset:e.targetJoinOffset,fromTargetNodeRadius:e.targetNodeRadius,toTargetNodeRadius:e.targetNodeRadius,stroke:e.stroke,fromStrokeWidth:e.strokeWidth,toStrokeWidth:e.strokeWidth,fromOpacity:e.opacity,toOpacity:e.opacity,fromX1:e.x1,fromY1:e.y1,fromX2:e.x2,fromY2:e.y2,toX1:e.x1,toY1:e.y1,toX2:e.x2,toY2:e.y2})),[Qt,Xt]),tn=(0,b.useMemo)(()=>Qt?.refs??Gt.map(e=>({key:e.refName,placement:e,fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromScale:1,toScale:1})),[Qt,Gt]),nn=(0,b.useMemo)(()=>ht?.gutterX===void 0?Qt?Qt.lane:Zt?{key:Zt.key,color:Zt.color,fromX:Zt.x,toX:Zt.x,fromOpacity:1,toOpacity:1}:null:{key:`action-preview-gutter`,color:tp,fromX:ht.gutterX,toX:ht.gutterX,fromOpacity:1,toOpacity:1},[ht,Qt,Zt]),rn=(0,b.useMemo)(()=>M&&j?M.nodes.find(e=>e.row.refNames.includes(j))??null:null,[M,j]),an=(0,b.useMemo)(()=>!N||N.kind!==`head`?null:Ip(N,r),[N,r]),on=(0,b.useMemo)(()=>!N||N.kind!==`head`?!1:!an||an.targetSha!==N.targetSha,[N,an]),sn=(0,b.useMemo)(()=>!N||N.kind!==`head`||!an||an.targetSha===N.targetSha?!1:(N.ahead??0)>0,[N,an]),cn=(0,b.useMemo)(()=>{if(!N)return[];if(N.kind===`head`){let e=(N.behind??0)>0?{action:`push`,label:`Force push`,tone:`warning`,force:!0}:{action:`push`,label:`Push`,tone:`neutral`};return N.isCurrent?[...on?[e]:[],...sn?[{action:`reset`,label:`Reset`,tone:`warning`}]:[]]:ft?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:ft.path},...on?[e]:[]]:[{action:`checkout`,label:`Checkout`,tone:`neutral`},...on?[e]:[],...sn?[{action:`reset`,label:`Reset`,tone:`warning`}]:[],{action:`delete`,label:`Delete`,tone:`danger`}]}return N.kind===`remote`?[...ft?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:ft.path}]:[{action:`checkout`,label:`Checkout`,tone:`neutral`}],{action:`delete`,label:`Delete`,tone:`danger`}]:[{action:`push`,label:`Push`,tone:`neutral`}]},[N,ft,on,sn]),ln=(0,b.useMemo)(()=>!N||N.kind!==`head`||ft?null:N.shortName,[N,ft]),un=(0,b.useMemo)(()=>!!rn&&!!j&&!!a&&a!==j&&o?.sourceRefName===a&&o.mergeable,[rn,j,a,o]),dn=(0,b.useMemo)(()=>N&&N.kind===`head`&&N.isCurrent?N:null,[N]),fn=(0,b.useMemo)(()=>{if(!M||!a||!o?.mergeable||o.sourceRefName!==a||!o.sourceSha||!o.targetSha)return null;let e=M.shaToNode.get(o.sourceSha),t=M.shaToNode.get(o.targetSha);if(!e||!t)return null;let n=M.nodes[0]??t,r={row:{row:n.row.row-1,sha:`preview:${o.sourceSha}:${o.targetSha}`,parentShas:[t.row.sha,e.row.sha],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:`Merge preview`,additions:0,deletions:0,locChanged:0,refNames:[],lane:t.row.lane},x:t.x,y:n.y-56,idx:n.idx-1},i=`${r.row.sha}-${t.row.sha}`,s=`${r.row.sha}-${e.row.sha}`,c=Xp(r,t,i,Ft),l=e.x<r.x?`left`:`right`,u=bf(M.nodes,r.idx,e.idx,80,l),d=M.nodes.find(e=>e.x===u),f=u!==null&&u<Math.min(r.x,e.x)?`left`:`right`;return{previewNode:r,sourceNode:e,targetNode:t,sourcePath:Qp(r,e,u===null?Xp(r,e,s,Ft,{adjacentTrack:`to`}):{mode:`outer-rail`,side:f,anchorLane:d?.row.lane??(f===`left`?Math.min(...Ft)-1:Math.max(...Ft)+1),innerLane:f===`left`?Math.max(r.row.lane,e.row.lane):Math.min(r.row.lane,e.row.lane),outerRailX:u},Wt.bundleOffsets.get(s)??0),targetPath:Qp(r,t,c,Wt.bundleOffsets.get(i)??0),color:M.shaToColor.get(t.row.sha)??pr(t.row.lane)}},[M,a,o,Ft,Wt.bundleOffsets]),pn=(0,b.useMemo)(()=>Me?fn:null,[Me,fn]),mn=(0,b.useCallback)((e,t)=>{e.stopPropagation(),Ne(!1),Pe(null),Ie(null),u(t)},[u]),hn=(0,b.useCallback)(e=>(ce(e),m(e.action,e.refName,e.sha,e.force).finally(()=>{ce(t=>Dp(t,e)?null:t)})),[m]),gn=(0,b.useCallback)(e=>{if(!a||!N||v)return;if(Ne(!1),e.action===`open-worktree`){e.worktreePath&&ae(e.worktreePath);return}let t=e.action,n=N.targetSha,r=a,i={action:t,label:e.label,tone:e.tone,refName:r,sha:n,force:!!e.force};hn(i).catch(t=>{if(e.action===`push`&&!e.force&&Op(t))T(`Push rejected`,t,{label:`Force push`,run:()=>{hn({action:`push`,label:`Force push`,tone:`warning`,force:!0,refName:r,sha:n}).catch(e=>T(`Force push failed`,e))}});else{let n=e.action===`checkout`?kp(t):null;if(n){T(`Branch is already checked out`,t,{label:`Open worktree`,run:()=>{ae(n)}});return}T(`${e.action} failed`,t)}})},[a,N,hn,T,v,ae]),_n=(0,b.useCallback)(e=>{if(!ln||v)return;let t=N?.kind===`head`&&N.isCurrent;Ke({title:`Move branch`,message:t?`Move checked-out branch ${ln} to commit ${e.slice(0,8)}? This resets the working tree and discards tracked changes.`:`Move branch ${ln} to commit ${e.slice(0,8)}?`,confirmLabel:`Move`,onConfirm:()=>{Ne(!1),m(`move`,ln,e).catch(e=>{T(`Move failed`,e)})}})},[ln,N,m,T,v]),vn=(0,b.useCallback)((e,t)=>{v||(Ne(!1),He(null),Be(null),We({kind:e,targetSha:t}))},[v]),yn=(0,b.useCallback)(e=>{if(!Ue)return;let{kind:t,targetSha:n}=Ue;We(null),m(t===`branch`?`create`:`create-tag`,e,n).catch(e=>{T(`Create ${t} failed`,e)})},[Ue,m,T]),bn=(0,b.useCallback)(()=>We(null),[]),xn=Ue?.kind===`branch`?`Branch name`:`Tag name`,Sn=Ue?`Create ${Ue.kind} at ${Ue.targetSha.slice(0,8)}`:`Create ref`,Cn=Ue?.kind===`tag`?pt:``,wn=(0,b.useCallback)(()=>{a&&(Pe(null),Ie(null),Ne(!0),(!o||o.sourceRefName!==a)&&f(a))},[a,o,f]),Tn=(0,b.useCallback)(()=>{Ne(!1)},[]),En=(0,b.useCallback)((e,t)=>{Ne(!1),Ie(null),Pe(e===`uncommit`?{kind:`uncommit`,sha:t}:{kind:`commit`,action:e,sha:t})},[]),Dn=(0,b.useCallback)((e,t,n)=>{let r=D.current;if(!r)return;let i=n.currentTarget.getBoundingClientRect(),a=Ye.current;Ne(!1),Re(!0),Ie({targetRefName:e,buttonRect:{left:i.left,top:i.top,width:i.width,height:i.height},buttonScale:i.height/Hf,baseZoom:a,viewport:{width:r.clientWidth,height:r.clientHeight},scroll:{x:r.scrollLeft,y:r.scrollTop},targetNode:{x:t.x,y:t.y}}),Pe({kind:`rebase`,targetRefName:e})},[]),On=(0,b.useCallback)(()=>{Pe(null),Ie(null)},[]),kn=(0,b.useCallback)(()=>{Pe(e=>e?.kind===`rebase`?null:e),Ie(null)},[]),An=(0,b.useCallback)(()=>{let e=D.current;if(!e||!fn)return;let t=Math.max(fn.previewNode.y+X,fn.sourceNode.y+X,fn.targetNode.y+X),n=Math.max(t+40,224),r=Math.min(Ye.current,Math.max(.18,Math.min(1,e.clientHeight/n)));Ze.current=Date.now()+500,Ye.current=r,ye(r),e.scrollTo({top:0,behavior:`smooth`}),requestAnimationFrame(()=>Rt(e,r))},[fn,Rt]),jn=(0,b.useCallback)(()=>{a&&(v||(Ne(!0),An(),g(a).catch(e=>{T(`Merge failed`,e)})))},[a,g,An,T,v]),Mn=(0,b.useCallback)(e=>{Ne(!1),Pe(null),Ie(null),_(e).catch(e=>{T(`Rebase failed`,e)})},[_,T]),Nn=(0,b.useCallback)(e=>{dn&&(v||Mn(e))},[dn,Mn,v]),Pn=(0,b.useMemo)(()=>{if(!M||!D.current)return[];let e=D.current.scrollTop,t=new Map;for(let e of Ht){let n=t.get(e.row.lane);(!n||e.y<n.y)&&t.set(e.row.lane,e)}let n=new Map;for(let r of M.nodes){if(r.row.refNames.length===0||r.y*vt+bt>=e)continue;let i=r.row.lane;if(n.has(i))continue;let a=t.get(i);if(!a)continue;let o=yr(r.row.refNames);o&&M.shaToBranch.get(a.row.sha)===o&&n.set(i,{name:o,x:r.x,color:mr(o)})}let r=[...n.values()].sort((e,t)=>e.x-t.x),i=[],a=[];for(let e of r){let t=e.x*vt+yt-4,n=e.name.length*7+20,r=0;for(let e=0;e<a.length;e++){if(t>=a[e]){r=e;break}r=e+1}r>=a.length&&a.push(0),a[r]=t+n+4,i.push({...e,row:r})}return i},[M,Ht,vt,yt,bt]),Fn=(0,b.useMemo)(()=>M?fm(M.nodes,vt).map(e=>({...e,y:e.y+bt})):[],[M,vt,bt]),In=(0,b.useMemo)(()=>{if(!M)return null;let e=pm(M.nodes,Math.max(0,Se-bt),vt);return e?dm(new Date(e.row.committerUnix*1e3),vt):null},[M,Se,vt,bt]),Ln=(0,b.useMemo)(()=>Fn.filter(e=>e.y-Se>28),[Fn,Se]),Rn=(0,b.useMemo)(()=>Am(M,j),[M,j]),zn=(0,b.useMemo)(()=>!M||Rn.size===0||!C?[]:M.nodes.filter(e=>Rn.has(e.row.sha)).map(e=>({key:e.row.sha,sha:e.row.sha,y:e.y*vt+bt,text:e.row.subject})),[M,Rn,vt,bt,C]),Bn=(0,b.useMemo)(()=>zn.filter(e=>e.y-Se>28),[zn,Se]),Vn=(0,b.useMemo)(()=>Oe===0?[]:zn.filter(e=>{let t=e.y-Se;return t>0&&t<Oe}),[zn,Se,Oe]);(0,b.useEffect)(()=>{if(Vn.length===0)return;let e=window.setTimeout(()=>{let e=Vn.slice(0,zf).map(e=>e.sha);te(e)},200);return()=>window.clearTimeout(e)},[Vn,te]);let Hn=(0,b.useMemo)(()=>M&&i?M.shaToNode.get(i)??null:null,[M,i]),Un=(0,b.useMemo)(()=>{if(!M||!Hn||!j)return!1;let e=M.nodes.find(e=>e.row.refNames.includes(j));if(!e)return!1;let t=e.row.sha,n=new Set;for(;t&&!n.has(t);){if(t===Hn.row.sha)return!0;n.add(t);let e=M.shaToNode.get(t);if(!e||e.row.parentShas.length===0)break;t=e.row.parentShas[0]}return!1},[M,Hn,j]),Wn=(0,b.useMemo)(()=>!Hn||!j?!1:Hn.row.refNames.includes(j),[Hn,j]),Gn=(0,b.useMemo)(()=>{if(!Hn)return[];let e=[],t=Hn.row.parentShas.length===1;return Wn?(e.push({action:`uncommit`,label:`Uncommit`,tone:`uncommit`}),t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):Un?(t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):(t&&(e.push({action:`cherry-pick`,label:`Cherry pick`,tone:`success`}),e.push({action:`revert`,label:`Revert`,tone:`warning`})),e)},[Hn,Wn,Un]),Kn=(0,b.useCallback)(e=>{if(!Hn||v)return;if(Pe(null),Ie(null),e===`cherry-pick`){h(e,Hn.row.sha).catch(t=>{T(`${e} failed`,t)});return}let t=Hn.row.sha.slice(0,8),n=e===`uncommit`?`Uncommit`:`Revert commit`,r=e===`uncommit`?`Uncommit ${t}? This will move HEAD to its parent and keep the changes in your working tree.`:`Revert commit ${t} on the current branch?`;Ke({title:n,message:r,confirmLabel:e===`uncommit`?`Uncommit`:`Revert`,onConfirm:()=>{h(e,Hn.row.sha).catch(t=>{T(`${e} failed`,t)})}})},[Hn,h,T,v]),L=k!==null;if(!M)return(0,y.jsx)(`div`,{style:{flex:1,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No commits to display`});let qn=M.totalWidth,Jn=M.totalHeight,Yn=qn*ve,Xn=Jn*ve,Zn=P?Math.max(22,String(P.conflictedCount).length*7+14):0,Qn=P?.kind===`merge`?P.conflictedCount>0?`Merge conflicts`:`Merge in progress`:P?.kind===`rebase`?P.conflictedCount>0?`Rebase conflicts`:`Rebase in progress`:`Uncommitted changes`,$n=P?.kind===`worktree`?`Uncommitted changes — ${P.count} file${P.count===1?``:`s`}\nClick to stage / unstage`:`${Qn} — ${P?.conflictedCount??0} conflict${P?.conflictedCount===1?``:`s`}\nClick to review files`;return(0,y.jsxs)(`div`,{ref:D,style:{flex:1,height:`100%`,overflowY:`auto`,overflowX:`hidden`,position:`relative`,background:`#1e1e2e`,touchAction:`pan-y`},onClick:()=>{Ne(!1),Pe(null),Ie(null),He(null),Be(null),jt(),d()},children:[(0,y.jsx)(Lf,{open:!!Ue,title:Sn,label:xn,initialValue:Cn,confirmLabel:`Create`,onSubmit:yn,onClose:bn}),(0,y.jsx)(Rf,{open:!!Ge,title:Ge?.title??``,message:Ge?.message??``,confirmLabel:Ge?.confirmLabel??`Confirm`,onConfirm:()=>{let e=Ge?.onConfirm;Ke(null),e?.()},onClose:()=>Ke(null)}),be&&(0,y.jsx)(`div`,{style:{position:`sticky`,top:`calc(100% - 54px)`,left:0,zIndex:30,width:`100%`,height:0,display:`flex`,justifyContent:`center`,overflow:`visible`,pointerEvents:`none`},children:(0,y.jsxs)(`div`,{"aria-live":`polite`,onClick:e=>e.stopPropagation(),style:{display:`flex`,alignItems:`center`,gap:8,minHeight:34,padding:Math.abs(ve-1)>.001?`4px 5px 4px 12px`:`4px 12px`,border:`1px solid #45475a`,borderRadius:8,background:`#181825ee`,color:`#cdd6f4`,fontSize:11,fontWeight:700,fontVariantNumeric:`tabular-nums`,boxShadow:`0 8px 24px rgba(0,0,0,0.35)`,backdropFilter:`blur(8px)`,pointerEvents:`auto`,userSelect:`none`},children:[(0,y.jsxs)(`span`,{"aria-label":`Zoom ${Math.round(ve*100)} percent`,children:[Math.round(ve*100),`%`]}),Math.abs(ve-1)>.001&&(0,y.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Vt()},style:{height:26,padding:`0 8px`,border:`1px solid #45475a`,borderRadius:5,background:`#313244`,color:`#bac2de`,fontFamily:`inherit`,fontSize:10,fontWeight:700,cursor:`pointer`},children:`Reset zoom`})]})}),Fe&&(0,Ki.createPortal)((0,y.jsx)(`div`,{style:{position:`fixed`,left:Fe.buttonRect.left,top:Fe.buttonRect.top,width:Fe.buttonRect.width,height:Fe.buttonRect.height,zIndex:1e4,pointerEvents:`auto`},children:(0,y.jsx)(`div`,{style:{width:Fe.buttonRect.width/Fe.buttonScale,height:Fe.buttonRect.height/Fe.buttonScale,transform:`scale(${Fe.buttonScale})`,transformOrigin:`top left`},children:(0,y.jsx)(wd,{label:`Rebase`,tone:`success`,onClick:()=>Nn(Fe.targetRefName),onMouseLeave:kn})})}),document.body),(0,y.jsx)(`div`,{style:{position:`sticky`,top:0,left:0,zIndex:20,height:0,overflow:`visible`,pointerEvents:`none`},children:Pn.map(e=>(0,y.jsx)(`div`,{onClick:t=>mn(t,e.name),style:{position:`absolute`,left:e.x*vt+yt-4,top:4+e.row*22,padding:`2px 8px`,borderRadius:4,background:a===e.name?e.color+`35`:e.color+`20`,border:`1px solid ${a===e.name?e.color:e.color+`50`}`,color:e.color,fontSize:10,fontWeight:600,whiteSpace:`nowrap`,pointerEvents:`auto`,transform:`scale(${Math.min(vt,1)})`,transformOrigin:`top left`,transition:`left ${xt}, transform ${xt}`,cursor:`pointer`,boxShadow:a===e.name?`0 0 8px ${e.color}40`:`none`},children:e.name},e.name))}),(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,left:0,width:`100%`,height:0,overflow:`visible`,zIndex:5,pointerEvents:`none`},children:[In&&(0,y.jsx)(`div`,{style:{position:`absolute`,right:20,top:6,padding:`3px 8px`,borderRadius:6,background:`#181825`,border:`1px solid #313244`,color:`#9399b2`,fontSize:11,fontWeight:600,whiteSpace:`nowrap`,boxShadow:`0 4px 12px rgba(0,0,0,0.2)`},children:In}),(0,y.jsxs)(`div`,{ref:le,style:{position:`relative`},children:[P&&P.y*vt+bt-Se>28&&(0,y.jsxs)(Xc.div,{style:{position:`absolute`,left:20,top:Pc(wt,e=>e*vt+bt-7),opacity:Dt,maxWidth:(160+ct.extraLeftGutter-40)*vt,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:re?P.color:`#a6adc8`,fontSize:12,fontWeight:600,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`max-width ${xt}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:P.color,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:Qn})]}),Bn.map(e=>{let t=ee[e.sha],n=t?{success:`#a6e3a1`,pending:`#f9e2af`,failure:`#f38ba8`,error:`#f38ba8`,neutral:`#6c7086`,loading:`#585b70`,none:`#45475a`}[t.state]:void 0;return(0,y.jsxs)(`div`,{style:{position:`absolute`,left:20,top:e.y-7,maxWidth:(160+ct.extraLeftGutter-40)*vt,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontSize:12,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`top ${xt}, max-width ${xt}`},children:[n&&(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:n,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:e.text})]},e.key)})]}),(0,y.jsx)(`div`,{ref:O,style:{position:`relative`},children:Ln.map(e=>(0,y.jsxs)(`div`,{style:{position:`absolute`,right:20,top:e.y-7,padding:`2px 6px`,borderRadius:6,background:`#1e1e2e`,color:e.kind===`month`?`#6c7086`:e.kind===`hour`?`#585b70`:`#45475a`,fontSize:e.kind===`month`?11:10,fontWeight:e.kind===`month`?600:e.kind===`hour`?500:400,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`,transition:`top ${xt}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:e.kind===`month`?16:e.kind===`hour`?6:8,height:1,background:e.kind===`month`?`#585b70`:e.kind===`hour`?`#45475a`:`#313244`,verticalAlign:`middle`,marginRight:4}}),e.text]},e.key))})]}),(0,y.jsx)(`div`,{style:{width:Yn,height:Xn,position:`relative`,zIndex:10},children:(0,y.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,width:qn,height:Jn,transform:`translate(${yt}px, ${bt}px) scale(${vt})`,transformOrigin:`top left`,transition:`transform ${xt}`,willChange:Fe?`transform`:void 0},children:[(0,y.jsxs)(`svg`,{width:qn,height:Jn,style:{position:`absolute`,top:0,left:0,zIndex:10,pointerEvents:`none`,overflow:`visible`},children:[I.map(e=>(0,y.jsx)(`rect`,{x:e.x-80/2+2,y:0,width:76,height:Jn,rx:16,fill:`${e.color}16`,stroke:`${e.color}24`,strokeWidth:1},`gutter-${e.lane}`)),nn&&(0,y.jsxs)(Xc.g,{opacity:L?Pc(qe,e=>Z(nn.fromOpacity,nn.toOpacity,e)*.95):nn.toOpacity*.95,children:[(0,y.jsx)(Xc.rect,{x:L?Pc(qe,e=>Z(nn.fromX,nn.toX,e)):nn.toX,y:0,width:Cp,height:Jn,rx:18,fill:`${nn.color}10`}),(0,y.jsx)(Xc.rect,{x:L?Pc(qe,e=>Z(nn.fromX,nn.toX,e)+2):nn.toX+2,y:0,width:Cp-4,height:Jn,rx:16,fill:`${nn.color}06`})]},nn.key),pn&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{d:pn.targetPath,stroke:pn.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.7}),(0,y.jsx)(`path`,{d:pn.sourcePath,stroke:pn.color,strokeWidth:2.5,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.55})]}),en.map(e=>(0,y.jsx)(Xc.path,{d:L?Pc(qe,t=>t>=.999?e.path:em(e,t)):e.path,stroke:e.stroke,strokeWidth:L?Pc(qe,t=>Z(e.fromStrokeWidth,e.toStrokeWidth,t)):e.toStrokeWidth,fill:`none`,strokeLinecap:`round`,opacity:L?Pc(qe,t=>Z(e.fromOpacity,e.toOpacity,t)):e.toOpacity},e.key)),ht?.edges.map(e=>(0,y.jsx)(`path`,{d:e.path,stroke:e.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:e.dashed?`7 6`:void 0,opacity:.9},e.key))]}),(0,y.jsxs)(`svg`,{width:qn,height:Jn,style:{position:`absolute`,top:0,left:0,zIndex:30,pointerEvents:`none`,overflow:`visible`},children:[pn&&(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:pn.previewNode.x,cy:pn.previewNode.y,r:X*1.9,fill:pn.color,opacity:.12}),(0,y.jsx)(`circle`,{cx:pn.previewNode.x,cy:pn.previewNode.y,r:X,fill:Bf,stroke:pn.color,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:pn.previewNode.x,cy:pn.previewNode.y,r:2.5,fill:pn.color})]}),$t.map(t=>{let{row:n}=t,r=n.sha===i,a=t.color,o=Jf*2,s=im(n.additions,Pt,o),c=im(n.deletions,Pt,o),u=`gauge-${n.sha}`,d=`${u}-left`,f=`${u}-right`,p=r?Zf:Xf,m=r?Qf:Yf,h=Zd(n.subject,e),g=L?Pc(qe,e=>Z(t.fromX,t.toX,e)):t.toX,_=L?Pc(qe,e=>Z(t.fromY,t.toY,e)):t.toY,v=L?Pc(qe,e=>Z(t.fromOpacity,t.toOpacity,e)):t.toOpacity,b=L?Pc(qe,e=>Z(t.fromRadius,t.toRadius,e)):t.toRadius,x=L?Pc(qe,e=>Z(t.fromRadius,t.toRadius,e)*2.5):t.toRadius*2.5,S=L?Pc(qe,e=>`translate(${Z(t.fromX,t.toX,e)} ${Z(t.fromY,t.toY,e)})`):`translate(${t.toX} ${t.toY})`,C=L?Pc(qe,e=>nm(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Jf,`left`)):nm(t.toX,t.toY,Jf,`left`),w=L?Pc(qe,e=>nm(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Jf,`right`)):nm(t.toX,t.toY,Jf,`right`),T=L?Pc(qe,e=>rm(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Jf,`left`)):rm(t.toX,t.toY,Jf,`left`),ee=L?Pc(qe,e=>rm(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Jf,`right`)):rm(t.toX,t.toY,Jf,`right`);return(0,y.jsxs)(Xc.g,{onClick:t.interactive?e=>{e.stopPropagation(),l(n.sha)}:void 0,onPointerEnter:t.interactive?()=>Mt(n.sha):void 0,onPointerLeave:t.interactive?()=>Nt(n.sha):void 0,opacity:v,style:{cursor:t.interactive?`pointer`:`default`,pointerEvents:t.interactive?`auto`:`none`},children:[(0,y.jsx)(`title`,{children:`${n.subject}${h?`\n${h.label} commit`:``}\n+${n.additions} / -${n.deletions} (${n.locChanged} LOC changed)`}),r&&(0,y.jsx)(Xc.circle,{cx:g,cy:_,r:x,fill:a,opacity:.15}),(0,y.jsx)(Xc.circle,{cx:g,cy:_,r:b,fill:Bf,stroke:a,strokeWidth:r?3.5:2.75}),(0,y.jsxs)(`defs`,{children:[(0,y.jsx)(`clipPath`,{id:d,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(Xc.path,{d:C})}),(0,y.jsx)(`clipPath`,{id:f,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(Xc.path,{d:w})})]}),(0,y.jsx)(Xc.path,{d:C,fill:m}),(0,y.jsx)(Xc.path,{d:w,fill:m}),s>0&&(0,y.jsx)(Xc.rect,{x:L?Pc(qe,e=>Z(t.fromX,t.toX,e)-Jf):t.toX-Jf,y:L?Pc(qe,e=>Z(t.fromY,t.toY,e)+Jf-s):t.toY+Jf-s,width:Jf,height:s,fill:$f,clipPath:`url(#${d})`}),c>0&&(0,y.jsx)(Xc.rect,{x:g,y:L?Pc(qe,e=>Z(t.fromY,t.toY,e)+Jf-c):t.toY+Jf-c,width:Jf,height:c,fill:ep,clipPath:`url(#${f})`}),(0,y.jsx)(Xc.path,{d:T,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(Xc.path,{d:ee,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(Xc.line,{x1:g,y1:L?Pc(qe,e=>Z(t.fromY,t.toY,e)-Jf):t.toY-Jf,x2:g,y2:L?Pc(qe,e=>Z(t.fromY,t.toY,e)+Jf):t.toY+Jf,stroke:p,strokeWidth:1.6}),!h&&n.parentShas.length>1&&(0,y.jsx)(Xc.circle,{cx:g,cy:_,r:2,fill:a}),h&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Xc.circle,{cx:g,cy:_,r:7.4,fill:Bf,opacity:.9}),(0,y.jsx)(Xc.g,{transform:S,children:(0,y.jsx)(yf,{icon:h.icon,color:a,customSvg:h.customSvg})})]})]},t.key)}),ht?.nodes.map(({node:e,color:t})=>(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:X*1.9,fill:t,opacity:.12}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:X,fill:Bf,stroke:t,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:2.5,fill:t})]},`action-preview:${e.row.sha}`)),gt&&(0,y.jsx)(`g`,{"data-testid":`uncommit-preview-cross`,pointerEvents:`none`,children:gt.map((e,t)=>(0,y.jsx)(`line`,{...e,stroke:np,strokeWidth:3.25,strokeLinecap:`round`,strokeDasharray:`6 4`},`uncommit-cross-${t}`))}),P&&(0,y.jsxs)(Xc.g,{onClick:e=>{e.stopPropagation(),ie()},opacity:Dt,style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:$n}),P.sourcePath&&(0,y.jsx)(`path`,{d:P.sourcePath,stroke:P.color,strokeWidth:2.25,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.55}),(0,y.jsx)(Xc.path,{d:Pc([Ct,wt,Tt,Et],(e,t,n,r)=>Qp({x:e,y:t},{x:n,y:r},P.targetPlan,0)),stroke:P.color,strokeWidth:2.5,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.7}),re&&(0,y.jsx)(Xc.circle,{cx:Ct,cy:wt,r:X*2.5,fill:P.color,opacity:.15}),(0,y.jsx)(Xc.circle,{cx:Ct,cy:wt,r:X,fill:Bf,stroke:P.color,strokeWidth:re?3.5:2.75,strokeDasharray:`4 3`}),P.kind===`worktree`?(0,y.jsx)(Xc.text,{x:Ct,y:wt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:12,fontWeight:700,fill:P.color,style:{pointerEvents:`none`,userSelect:`none`},children:P.count}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Xc.circle,{cx:Ct,cy:wt,r:2.5,fill:P.color}),P.conflictedCount>0&&(0,y.jsxs)(`g`,{style:{pointerEvents:`none`,userSelect:`none`},children:[(0,y.jsx)(Xc.rect,{x:Pc(Ct,e=>e+X+6),y:Pc(wt,e=>e-10),width:Zn,height:20,rx:10,fill:`#fab38722`,stroke:`#fab387`,strokeWidth:1.4}),(0,y.jsx)(Xc.text,{x:Pc(Ct,e=>e+X+6+Zn/2),y:wt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:11,fontWeight:800,fill:`#fab387`,children:P.conflictedCount})]})]})]})]}),tn.map(e=>{let{placement:t}=e,n=t.isSelected||t.isCurrent,r=t.isSelected?t.color+`35`:t.isCurrent?t.color+`2a`:t.color+`18`,i=[`inset 0 1px 0 rgba(255, 255, 255, 0.14)`,`inset 0 -1px 0 ${t.color}18`,n?`0 0 8px ${t.color}38`:`0 2px 5px rgba(0, 0, 0, 0.18)`].join(`, `);return(0,y.jsxs)(Xc.div,{onClick:e=>mn(e,t.refName),onPointerEnter:()=>Mt(t.nodeSha),onPointerLeave:()=>Nt(t.nodeSha),style:{position:`absolute`,left:0,top:0,zIndex:40,height:20,padding:`0 7px`,borderRadius:4,background:`linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.015) 38%, ${t.color}18 100%), linear-gradient(${r}, ${r}), rgba(24, 24, 37, 0.5)`,backdropFilter:`blur(3px) saturate(145%) contrast(103%)`,WebkitBackdropFilter:`blur(3px) saturate(145%) contrast(103%)`,border:`1px solid ${n?t.color:t.color+`66`}`,color:t.color,fontSize:11,fontWeight:600,lineHeight:`20px`,whiteSpace:`nowrap`,cursor:`pointer`,userSelect:`none`,boxShadow:i,transformOrigin:`top left`,opacity:L?Pc(qe,t=>Z(e.fromOpacity,e.toOpacity,t)):e.toOpacity,transform:L?Pc(qe,t=>`translate(${Z(e.fromX,e.toX,t)}px, ${Z(e.fromY,e.toY,t)}px) scale(${Z(e.fromScale,e.toScale,t)})`):`translate(${e.toX}px, ${e.toY}px) scale(${e.toScale})`},children:[ym(t.isRemote,t.isCurrent),t.refName]},e.key)}),!L&&qt.map(e=>{let{worktree:t}=e,n=Ap(t.path),r=t.isCurrent?`#f9e2af`:`#94e2d5`;return(0,y.jsxs)(`div`,{"data-testid":`worktree-marker`,title:n,"aria-label":`${t.isCurrent?`Current detached worktree`:`Open linked worktree`} ${t.path}`,onClick:e=>{e.stopPropagation(),t.isCurrent||ae(t.path)},onPointerEnter:()=>Mt(e.nodeSha),onPointerLeave:()=>Nt(e.nodeSha),style:{position:`absolute`,left:e.x,top:e.y,zIndex:40,boxSizing:`border-box`,width:e.width,height:Vf,display:`flex`,alignItems:`center`,padding:`0 5px 0 7px`,borderRadius:`4px 1px 1px 4px`,borderRight:`2px solid ${r}aa`,background:`linear-gradient(90deg, rgba(17,17,27,0.82), ${r}14)`,color:`#cdd6f4`,fontSize:11,fontWeight:600,whiteSpace:`nowrap`,cursor:t.isCurrent?`default`:`pointer`,userSelect:`none`,boxShadow:`0 2px 5px rgba(0,0,0,0.2)`},children:[(0,y.jsx)(jp,{color:r}),(0,y.jsx)(`span`,{style:{marginLeft:5,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`},children:n})]},`worktree:${t.path}`)}),Ht.map(e=>{let t=Yt.get(e.row.sha)??0,n=Wt.targetNodeRadii.get(e.row.sha)??X,r=e.x+n+8+t+(t>0?8:0),o=e.y-10,s=se!==null,c=!s&&e.row.sha===i?Gn:[],l=!!a&&e.row.refNames.includes(a),u=l?cn:[],d=s&&l&&se?u.find(e=>e.action===se.action)??se:null,f=s?d?[d]:[]:u,p=!s&&!!j&&e.row.refNames.includes(j)&&un,m=!v&&!s&&!L&&(ze===e.row.sha||Ve===e.row.sha),h=m&&!!ln&&e.row.sha!==N?.targetSha,g=!s&&dn&&e.row.sha!==dn.targetSha?yr(e.row.refNames.filter(e=>e!==dn.shortName)):null,_=g&&(A?.kind!==`rebase`||A.targetRefName===g)?g:null,x=f.length>0||p||h||m||!!_;return c.length===0&&!x?null:(0,y.jsxs)(b.Fragment,{children:[c.length>0&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:(Jt.get(e.row.sha)??e.x-X)-12,top:e.y,transform:`translate(-100%, -50%)`,display:`flex`,alignItems:`center`,gap:10,flexWrap:`nowrap`,zIndex:40},children:c.map(t=>(0,y.jsx)(wd,{label:t.label,tone:t.tone,onClick:()=>Kn(t.action),onMouseEnter:()=>En(t.action,e.row.sha),onMouseLeave:On},t.action))}),x&&(0,y.jsxs)(`div`,{onPointerEnter:()=>Mt(e.row.sha),onPointerLeave:()=>Nt(e.row.sha),style:{position:`absolute`,left:r,top:o,display:`flex`,alignItems:`flex-start`,gap:10,flexWrap:`nowrap`,zIndex:m||Ve===e.row.sha?40:20},children:[f.length>0&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,position:`relative`,top:Ep(Uf),zIndex:7},children:f.map(e=>(0,y.jsx)(Td,{label:e.label,tone:e.tone,loading:!!d&&e.action===d.action,onClick:()=>gn(e)},e.action))}),_&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:Ep(Hf),zIndex:7},children:(0,y.jsx)(wd,{label:`Rebase`,tone:`success`,onClick:()=>Nn(_),onMouseEnter:t=>Dn(_,e,t),onMouseLeave:Fe?.targetRefName===_?void 0:kn})}),p&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:Ep(Hf),zIndex:7},children:(0,y.jsx)(wd,{label:`Merge`,tone:`merge`,onClick:jn,onMouseEnter:wn,onMouseLeave:Tn})}),h&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,zIndex:7},children:(0,y.jsx)(Td,{label:`Move ${ln} here`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>_n(e.row.sha)})}),m&&(0,y.jsxs)(`div`,{style:{position:`relative`,top:Ep(Wf),zIndex:8},children:[(0,y.jsx)(`button`,{type:`button`,title:`Create branch or tag`,"aria-label":`Create branch or tag`,onClick:t=>{t.stopPropagation(),Ne(!1),He(t=>t===e.row.sha?null:e.row.sha),Be(e.row.sha)},style:{width:Wf,height:Wf,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:0,borderRadius:6,border:`1px solid #4a4f68`,background:`#2f3348`,color:`#cdd6f4`,fontSize:21,fontWeight:600,lineHeight:1,cursor:`pointer`,fontFamily:`inherit`,boxShadow:`0 8px 20px rgba(0,0,0,0.28)`},onMouseEnter:e=>{e.currentTarget.style.background=`#3a4058`},onMouseLeave:e=>{e.currentTarget.style.background=`#2f3348`},children:`+`}),Ve===e.row.sha&&(0,y.jsx)(`div`,{onClick:e=>e.stopPropagation(),style:{position:`absolute`,right:0,top:36,width:Kf,padding:5,borderRadius:7,border:`1px solid #4a4f68`,background:`#181825`,boxShadow:`0 14px 30px rgba(0,0,0,0.42)`,display:`flex`,flexDirection:`column`,gap:4},children:[`branch`,`tag`].map(t=>(0,y.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),vn(t,e.row.sha)},style:{height:28,padding:`0 9px`,borderRadius:5,border:`1px solid transparent`,background:`transparent`,color:`#cdd6f4`,fontSize:12,fontWeight:600,fontFamily:`inherit`,textAlign:`left`,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`#313244`,e.currentTarget.style.borderColor=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`,e.currentTarget.style.borderColor=`transparent`},children:t===`branch`?`Branch`:`Tag`},t))})]})]})]},`${e.row.sha}-actions`)})]})})]})}var Hm=56,Um=56,Wm=12,Gm=`#11111b`,Km=56,qm=80,Jm=110,Ym=150,Xm=28,Zm=640,Qm=[`#89b4fa`,`#a6e3a1`,`#f9e2af`,`#f38ba8`,`#cba6f7`,`#94e2d5`,`#fab387`,`#74c7ec`,`#f5c2e7`,`#b4befe`];function $m(e){return Qm[(e%Qm.length+Qm.length)%Qm.length]}var eh=`#f9e2af`,th={commit:`#a6e3a1`,amend:`#f9e2af`,checkout:`#89b4fa`,reset:`#f38ba8`,rebase:`#fab387`,merge:`#cba6f7`,"cherry-pick":`#94e2d5`,revert:`#f5c2e7`,pull:`#74c7ec`,branch:`#b4befe`,clone:`#9399b2`,other:`#9399b2`},nh=new Set([`reset`,`rebase`,`amend`]),rh={reset:`reset moved HEAD away — commits only on the old position may be unreachable`,rebase:`rebase rewrote history — the original commits live on only in the reflog`,amend:`amend replaced the previous commit — the original version is only in the reflog`};function ih(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function ah(e){let t=new Map;e.forEach((e,n)=>t.set(e.sha,n));let n=new Map,r=[],i=[],a=0;for(let o=0;o<e.length;o++){let s=e[o],c=n.get(s.sha);c===void 0&&(c=r.indexOf(null),c===-1?(c=r.length,r.push(s.sha)):r[c]=s.sha,n.set(s.sha,c)),i.push(c),c>a&&(a=c),t.get(s.sha)===o&&(r[c]=null)}return{lanes:i,maxLane:a}}function oh(e){if(!e)return``;let t=Math.floor(Date.now()/1e3-e);if(t<60)return`just now`;if(t<3600)return`${Math.floor(t/60)}m ago`;if(t<86400)return`${Math.floor(t/3600)}h ago`;if(t<172800)return`yesterday`;if(t<14*86400)return`${Math.floor(t/86400)}d ago`;let n=new Date(e*1e3),r=n.toLocaleDateString(void 0,{month:`short`,day:`numeric`});return n.getFullYear()===new Date().getFullYear()?r:`${r} ${n.getFullYear()}`}function sh(){let e=R(e=>e.reflog),t=R(e=>e.reflogLoading),n=R(e=>e.reflogMaxCount),r=R(e=>e.selectedSha),i=R(e=>e.selectCommit),a=R(e=>e.recoverBranch),o=R(e=>e.checkoutSha),s=R(e=>e.performCommitAction),c=R(e=>e.loadMoreReflog),l=R(e=>e.showError),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(null);(0,b.useEffect)(()=>{d(null)},[e]);let g=e?.entries??[],{lanes:_,maxLane:v}=(0,b.useMemo)(()=>ah(g),[g]),x=(0,b.useMemo)(()=>{let e=new Set;for(let t of g)t.isReachable||e.add(t.sha);return e},[g]),S=e=>Ym+e*Um,C=e=>Km+e*Hm,w=Ym+(v+1)*Um+Xm,T=w+Zm,ee=Km+g.length*Hm+qm,te=(0,b.useMemo)(()=>{let e=``;return g.map(t=>{let n=oh(t.entryUnix);return n===e?``:(e=n,n)})},[g]),E=e=>{p({entry:e,defaultName:`recovered-${e.sha.slice(0,7)}`})},ne=e=>{h({title:`Checkout commit`,message:`Checkout ${e.sha.slice(0,8)}? This detaches HEAD at that state.`,confirmLabel:`Checkout`,onConfirm:()=>{o(e.sha).catch(e=>l(`Checkout failed`,e))}})},re=e=>{h({title:`Cherry pick commit`,message:`Cherry-pick ${e.sha.slice(0,8)} onto the current branch?`,confirmLabel:`Cherry pick`,onConfirm:()=>{s(`cherry-pick`,e.sha).catch(e=>l(`Cherry-pick failed`,e))}})},ie=e=>{if(!f)return;let{entry:t}=f;p(null),a(e,t.sha).catch(e=>l(`Recover failed`,e))},ae=e=>{navigator.clipboard?.writeText(e.sha)};return!e&&t?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6c7086`,fontSize:13},children:`Reading reflog…`}):g.length===0?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No reflog entries — this repository has no recorded HEAD movements yet`}):(0,y.jsxs)(`div`,{style:{flex:1,height:`100%`,overflow:`auto`,position:`relative`,background:`#1e1e2e`},onClick:()=>d(null),children:[(0,y.jsx)(Lf,{open:!!f,title:f?`Create branch at ${f.entry.sha.slice(0,8)}`:`Create branch`,label:`Branch name`,initialValue:f?.defaultName??``,confirmLabel:`Create`,onSubmit:ie,onClose:()=>p(null)}),(0,y.jsx)(Rf,{open:!!m,title:m?.title??``,message:m?.message??``,confirmLabel:m?.confirmLabel??`Confirm`,onConfirm:()=>{let e=m?.onConfirm;h(null),e?.()},onClose:()=>h(null)}),x.size>0&&(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,zIndex:30,margin:`10px 14px 0`,padding:`8px 14px`,borderRadius:6,background:`#f9e2af18`,border:`1px solid ${eh}55`,color:eh,fontSize:12,display:`flex`,alignItems:`center`,gap:8},children:[(0,y.jsx)(`span`,{style:{fontSize:14},children:`⚠`}),(0,y.jsxs)(`span`,{children:[x.size===1?`1 commit in your reflog is no longer reachable from any branch.`:`${x.size} commits in your reflog are no longer reachable from any branch.`,` `,`Select a dashed entry below to recover it.`]})]}),(0,y.jsxs)(`div`,{style:{width:T,height:ee,position:`relative`},children:[(0,y.jsxs)(`div`,{style:{position:`absolute`,left:150-Wm,top:16,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,userSelect:`none`},children:[e?.refName??`HEAD`,` time machine — every state HEAD has pointed to, newest first`]}),(0,y.jsxs)(`svg`,{width:T,height:ee,style:{position:`absolute`,top:0,left:0,pointerEvents:`none`,overflow:`visible`},children:[g.slice(0,-1).map((e,t)=>{let n=S(_[t]),r=C(t);return(0,y.jsx)(`path`,{d:ih(S(_[t+1]),C(t+1),n,r),stroke:$m(_[t]),strokeWidth:2.25,fill:`none`,strokeLinecap:`round`,opacity:.85},`edge-${t}`)}),g.map((e,t)=>{let n=S(_[t]),a=C(t),o=$m(_[t]),s=u===t||u===null&&e.sha===r,c=!e.isReachable;return(0,y.jsxs)(`g`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:`${e.selector} — ${e.message}`}),s&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:Wm*2.3,fill:o,opacity:.15}),c&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:17,fill:`none`,stroke:eh,strokeWidth:1.5,strokeDasharray:`4 3`,opacity:.9}),(0,y.jsx)(`circle`,{cx:n,cy:a,r:Wm,fill:Gm,stroke:o,strokeWidth:s?3:2.25}),t===0&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:3,fill:o})]},`node-${t}`)})]}),g.map((e,t)=>{let n=C(t);return te[t]?(0,y.jsx)(`div`,{style:{position:`absolute`,left:0,top:n-7,width:Jm,textAlign:`right`,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`},children:te[t]},`time-${t}`):null}),g.map((e,t)=>{let n=C(t),r=u===t,a=!e.isReachable,o=th[e.kind],s=nh.has(e.kind),c=rh[e.kind];return(0,y.jsxs)(`div`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{position:`absolute`,left:w,top:n-10,cursor:`pointer`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:20,whiteSpace:`nowrap`},children:[(0,y.jsxs)(`span`,{title:c??e.message,style:{height:18,padding:`0 8px`,borderRadius:4,background:o+`20`,border:`1px solid ${o}55`,color:o,fontSize:10,fontWeight:700,lineHeight:`18px`,textTransform:`uppercase`,letterSpacing:.4},children:[s?`⚠ `:``,e.kind]}),a&&(0,y.jsx)(`span`,{title:`Not reachable from any branch — only the reflog still knows this commit`,style:{height:18,padding:`0 8px`,borderRadius:4,background:`#f9e2af20`,border:`1px solid ${eh}`,color:eh,fontSize:10,fontWeight:700,lineHeight:`18px`},children:`LOST`}),e.refNames.slice(0,3).map(e=>(0,y.jsx)(`span`,{style:{height:18,padding:`0 7px`,borderRadius:4,background:`#89b4fa18`,border:`1px solid #89b4fa55`,color:`#89b4fa`,fontSize:10,fontWeight:600,lineHeight:`18px`},children:e},e)),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:11,fontFamily:`monospace`},children:e.sha.slice(0,7)}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:12,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:360},children:e.subject})]}),r?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[a?(0,y.jsx)(wd,{label:`Recover branch`,tone:`success`,onClick:()=>E(e)}):(0,y.jsx)(Td,{label:`Branch here`,tone:`neutral`,size:`compact`,onClick:()=>E(e)}),(0,y.jsx)(Td,{label:`Checkout`,tone:`warning`,size:`compact`,onClick:()=>ne(e)}),(0,y.jsx)(Td,{label:`Cherry-pick`,tone:`neutral`,size:`compact`,onClick:()=>re(e)}),(0,y.jsx)(Td,{label:`Copy sha`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>ae(e)})]}):(0,y.jsx)(`div`,{style:{marginTop:4,color:`#6c7086`,fontSize:10,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:Zm-40},children:e.message})]},`row-${t}`)}),g.length>=n&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:w,top:C(g.length)+4},children:(0,y.jsx)(Td,{label:t?`Loading…`:`Load older entries`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>{c()}})})]})]})}var ch=Object.defineProperty,lh=e=>t=>{var n=e[t];if(n)return n();throw Error(`Module not found in bundle: `+t)},Q=(e,t)=>()=>(e&&(t=e(e=0)),t),$=(e,t)=>{for(var n in t)ch(e,n,{get:t[n],enumerable:!0})},uh={};$(uh,{default:()=>dh});var dh,fh=Q(()=>{dh=[{type:`cmnt`,match:/(;|#).*/gm},{expand:`str`},{expand:`num`},{type:`num`,match:/\$[\da-fA-F]*\b/g},{type:`kwd`,match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:`func`,match:/^[a-z]+/g}]},{type:`kwd`,match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:`oper`}]}),ph={};$(ph,{default:()=>hh});var mh,hh,gh=Q(()=>{mh={type:`var`,match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},hh=[{sub:`todo`,match:/#.*/g},{type:`str`,match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[mh]},{type:`oper`,match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:`kwd`,match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:`num`},{type:`func`,match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gim},{type:`bool`,match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:`oper`,match:/[=(){}<>!]+/g},{type:`var`,match:/(?<=\s|^)[\w_]+(?=\s*=)/g},mh]}),_h={};$(_h,{default:()=>vh});var vh,yh=Q(()=>{vh=[{match:/[^\[\->+.<\]\s].*/g,sub:`todo`},{type:`func`,match:/\.+/g},{type:`kwd`,match:/[<>]+/g},{type:`oper`,match:/[+-]+/g}]}),bh={};$(bh,{default:()=>xh});var xh,Sh=Q(()=>{xh=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/#\s*include (<.*>|".*")/g,sub:[{type:`str`,match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:`kwd`,match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:`asm`}]},{type:`kwd`,match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Ch={};$(Ch,{default:()=>wh});var wh,Th=Q(()=>{wh=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:`var`,match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:`func`,match:/#[\w-]+(?=[^{}]*{)/g},{type:`num`,match:/#[\da-f]{3,8}/g},{type:`num`,match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:`var`,match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:`func`,match:/url(?=\()/g},{type:`str`,match:/[^()]+/g}]},{type:`func`,match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:`num`,match:/\b[a-z-]+\b/g}]}),Eh={};$(Eh,{default:()=>Dh});var Dh,Oh=Q(()=>{Dh=[{expand:`strDouble`},{type:`oper`,match:/,/g}]}),kh={};$(kh,{default:()=>Ah});var Ah,jh=Q(()=>{Ah=[{type:`deleted`,match:/^[-<].*/gm},{type:`insert`,match:/^[+>].*/gm},{type:`kwd`,match:/!.*/gm},{type:`section`,match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]}),Mh={};$(Mh,{default:()=>Nh});var Nh,Ph=Q(()=>{gh(),Nh=[{type:`kwd`,match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gim},...hh]}),Fh={};$(Fh,{default:()=>Ih});var Ih,Lh=Q(()=>{jh(),Ih=[{match:/^#.*/gm,sub:`todo`},{expand:`str`},...Ah,{type:`func`,match:/^(\$ )?git(\s.*)?$/gm},{type:`kwd`,match:/^commit \w+$/gm}]}),Rh={};$(Rh,{default:()=>zh});var zh,Bh=Q(()=>{zh=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`oper`,match:/[+\-*\/%&|^~=!<>.^-]+/g}]}),Vh={};$(Vh,{default:()=>qh,name:()=>Wh,properties:()=>Gh,xmlElement:()=>Kh});var Hh,Uh,Wh,Gh,Kh,qh,Jh=Q(()=>{Hh=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,Uh=Hh+`\\-\\.0-9·̀-ͯ‿-⁀`,Wh=`[${Hh}][${Uh}]*`,Gh=`\\s*(\\s+${Wh}\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,Kh={match:RegExp(`<[/!?]?${Wh}${Gh}[/!?]?>`,`g`),sub:[{type:`var`,match:RegExp(`^<[/!?]?${Wh}`,`g`),sub:[{type:`oper`,match:/^<[\/!?]?/g}]},{type:`str`,match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:`oper`,match:/^=/g}]},{type:`oper`,match:/[\/!?]?>/g},{type:`class`,match:RegExp(Wh,`g`)}]},qh=[{match:/<!--[^]*?-->/g,sub:`todo`},{type:`class`,match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},Kh,{type:`str`,match:RegExp(`<\\?${Wh}([^?]|\\?[^?>])*\\?+>`,`g`),sub:[{type:`var`,match:RegExp(`^<\\?${Wh}`,`g`),sub:[{type:`oper`,match:/^<\?/g}]},{type:`oper`,match:/\?+>$/g}]},{type:`var`,match:/&(#x?)?[\da-z]{1,8};/gi}]}),Yh={};$(Yh,{default:()=>Xh});var Xh,Zh=Q(()=>{Jh(),Xh=[{type:`class`,match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:`str`,match:/"[^"]*"|'[^']*'/g},{type:`oper`,match:/^<!|>$/g},{type:`var`,match:/DOCTYPE/gi}]},{match:RegExp(`<style${Gh}>[^]*?</style\\s*>`,`g`),sub:[{match:RegExp(`^<style${Gh}>`,`g`),sub:Kh.sub},{match:RegExp(`${Kh.match}|[^]*(?=</style\\s*>$)`,`g`),sub:`css`},Kh]},{match:RegExp(`<script${Gh}>[^]*?<\/script\\s*>`,`g`),sub:[{match:RegExp(`^<script${Gh}>`,`g`),sub:Kh.sub},{match:RegExp(`${Kh.match}|[^]*(?=<\/script\\s*>$)`,`g`),sub:`js`},Kh]},...qh]}),Qh,$h,eg=Q(()=>{Qh=[[`bash`,[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],[`html`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<!DOCTYPE\s+html/g,500]],[`http`,[/^(GET|HEAD|POST|PUT|DELETE|PATCH|HTTP)\b/g,500]],[`js`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window)\b/g,10]],[`ts`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window|implements|interface|namespace)\b/g,10]],[`py`,[/\b(def|print|await|async|class|and|or|lambda|import|from|self|asyncio|pass|True|False|None|__init__)\b/g,10]],[`sql`,[/\b(SELECT|INSERT|FROM)\b/g,50]],[`pl`,[/#!(\/usr)?\/bin\/perl/g,500],[/\b(use|print)\b|\$/g,10]],[`lua`,[/#!(\/usr)?\/bin\/lua/g,500]],[`make`,[/\b(ifneq|endif|if|elif|then|fi|echo|.PHONY|^[a-z]+ ?:$)\b|\$/gm,10]],[`uri`,[/https?:|mailto:|tel:|ftp:/g,30]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`diff`,[/^[+><-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],[`md`,[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],[`docker`,[/^(FROM|ENTRYPOINT|RUN)/gm,500]],[`xml`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],[`c`,[/#include\b|\bprintf\s+\(/g,100]],[`rs`,[/^\s+(use|fn|mut|match)\b/gm,100]],[`go`,[/\b(func|fmt|package)\b/g,100]],[`java`,[/^import\s+java/gm,500]],[`asm`,[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`json`,[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],[`yaml`,[/^(\s+)?[a-z][a-z0-9]*:/gim,10]]],$h=e=>Qh.map(([t,...n])=>[t,n.reduce((t,[n,r])=>t+[...e.matchAll(n)].length*r,0)]).filter(([e,t])=>t>20).sort((e,t)=>t[1]-e[1])[0]?.[0]||`plain`}),tg={};$(tg,{default:()=>ng});var ng,rg=Q(()=>{eg(),ng=[{type:`kwd`,match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:`str`},{type:`section`,match:/\bHTTP\/[\d.]+\b/g},{expand:`num`},{type:`oper`,match:/[,;:=]/g},{type:`var`,match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:$h}]}),ig={};$(ig,{default:()=>ag});var ag,og=Q(()=>{ag=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:`todo`},{type:`var`,match:/.*(?==)/g},{type:`section`,match:/^\s*\[.+\]\s*$/gm},{type:`oper`,match:/=/g},{type:`str`,match:/.*/g}]}),sg={};$(sg,{default:()=>cg});var cg,lg=Q(()=>{cg=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),ug={};$(ug,{default:()=>dg});var dg,fg=Q(()=>{dg=[{match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:`jsdoc`},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{match:/`((?!`)[^]|\\[^])*`?/g,sub:`js_template_literals`},{type:`kwd`,match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:`regex`},{expand:`num`},{type:`num`,match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]}),pg={};$(pg,{default:()=>mg,type:()=>hg});var mg,hg,gg=Q(()=>{mg=[{match:new class{exec(e){let t=this.lastIndex,n,r=n=>{for(;++t<e.length-2;)if(e[t]==`{`)r();else if(e[t]==`}`)return};for(;t<e.length;++t)if(e[t-1]!=`\\`&&e[t]==`$`&&e[t+1]==`{`)return n=t++,r(t),this.lastIndex=t+1,{index:n,0:e.slice(n,t+1)};return null}},sub:[{type:`kwd`,match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:`js`}]}],hg=`str`}),_g={};$(_g,{default:()=>vg,type:()=>yg});var vg,yg,bg=Q(()=>{vg=[{type:`err`,match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:`class`,match:/\bIDEA\b/g},{type:`insert`,match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:`oper`,match:/\bQUESTION\b/g}],yg=`cmnt`}),xg={};$(xg,{default:()=>Sg,type:()=>Cg});var Sg,Cg,wg=Q(()=>{bg(),Sg=[{type:`kwd`,match:/@\w+/g},{type:`class`,match:/{[\w\s|<>,.@\[\]]+}/g},{type:`var`,match:/\[[\w\s="']+\]/g},...vg],Cg=`cmnt`}),Tg={};$(Tg,{default:()=>Eg});var Eg,Dg=Q(()=>{Eg=[{type:`var`,match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{expand:`str`},{expand:`num`},{type:`num`,match:/\bnull\b/g},{type:`bool`,match:/\b(true|false)\b/g}]}),Og={};$(Og,{default:()=>kg});var kg,Ag=Q(()=>{eg(),kg=[{type:`cmnt`,match:/^>.*|(=|-)\1+/gm},{type:`class`,match:/\*\*.*?\*\*/g},{match:/^(`{3,})(.*)\n[^]*?^\1[ \t]*$/gm,sub:e=>({type:`kwd`,sub:[{match:/\n[^]*(?=```)/g,sub:e.split(`
600
+ `)[0].slice(3)||$h(e)}]})},{type:`str`,match:/`[^`]*`/g},{type:`var`,match:/~~.*?~~/g},{type:`kwd`,match:/\b_\S([^\n]*?\S)?_\b|\*\S([^\n]*?\S)?\*/g},{type:`kwd`,match:/^\s*(\*|\d+\.)\s/gm},{type:`func`,match:/\[[^\]]*]\([^)]*\)|<[^>]*>/g,sub:[{type:`oper`,match:/^\[[^\]]*]/g}]}]}),jg={};$(jg,{default:()=>Mg});var Mg,Ng=Q(()=>{Ag(),eg(),Mg=[{type:`insert`,match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:`insert`,match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:$h}]},{type:`deleted`,match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:`deleted`,match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:$h}]},...kg]}),Pg={};$(Pg,{default:()=>Fg});var Fg,Ig=Q(()=>{Fg=[{type:`cmnt`,match:/^#.*/gm},{expand:`strDouble`},{expand:`num`},{type:`err`,match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:`num`,match:/\b(null|undefined)\b/gi},{type:`bool`,match:/\b(false|true|yes|no)\b/gi},{type:`oper`,match:/\.|,/g}]}),Lg={};$(Lg,{default:()=>Rg});var Rg,zg=Q(()=>{Rg=[{match:/^#!.*|--(\[(=*)\[[^]*?--\]\2\]|.*)/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:`bool`,match:/\b(true|false|nil)\b/g},{type:`oper`,match:/[+*/%^#=~<>:,.-]+/g},{expand:`num`},{type:`func`,match:/[a-z_]+(?=\s*[({])/g}]}),Bg={};$(Bg,{default:()=>Vg});var Vg,Hg=Q(()=>{Vg=[{match:/^\s*#.*/gm,sub:`todo`},{expand:`str`},{type:`oper`,match:/[${}()]+/g},{type:`class`,match:/.PHONY:/gm},{type:`section`,match:/^[\w.]+:/gm},{type:`kwd`,match:/\b(ifneq|endif)\b/g},{expand:`num`},{type:`var`,match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:`bash`}]}),Ug={};$(Ug,{default:()=>Wg});var Wg,Gg=Q(()=>{Wg=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:`num`},{type:`kwd`,match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:`oper`,match:/[-+*/%~!&<>|=?,]+/g},{type:`func`,match:/[a-z_]+(?=\s*\()/g}]}),Kg={};$(Kg,{default:()=>qg});var qg,Jg=Q(()=>{qg=[{expand:`strDouble`}]}),Yg={};$(Yg,{default:()=>Xg});var Xg,Zg=Q(()=>{Xg=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/f("""|''')(\\[^]|(?!\1)[^])*\1?|f("|')(\\[^]|(?!\3).)*\3?/gi,sub:[{type:`var`,match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:`py`}]}]},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:`bool`,match:/\b(False|True|None)\b/g},{expand:`num`},{type:`func`,match:/[a-z_]\w*(?=\s*\()/gi},{type:`oper`,match:/[-/*+<>,=!&|^%]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Qg={};$(Qg,{default:()=>$g,type:()=>e_});var $g,e_,t_=Q(()=>{$g=[{match:/^(?!\/).*/gm,sub:`todo`},{type:`num`,match:/\[((?!\])[^\\]|\\.)*\]/g},{type:`kwd`,match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:`var`,match:/\*|\+|\{\d+,\d+\}/g}],e_=`oper`}),n_={};$(n_,{default:()=>r_});var r_,i_=Q(()=>{r_=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]}),a_={};$(a_,{default:()=>o_});var o_,s_=Q(()=>{o_=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`func`,match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:`kwd`,match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:`num`,match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:`bool`,match:/\b(TRUE|FALSE)\b/g},{type:`oper`,match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:`var`,match:/@\S+/g}]}),c_={};$(c_,{default:()=>l_});var l_,u_=Q(()=>{l_=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:`str`},{type:`section`,match:/^\[.+\]\s*$/gm},{type:`num`,match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:`num`},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[+,.=-]/g},{type:`var`,match:/\w+(?= \=)/g}]}),d_={};$(d_,{default:()=>f_});var f_,p_=Q(()=>{fg(),f_=[{type:`type`,match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:`kwd`,match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...dg]}),m_={};$(m_,{default:()=>h_});var h_,g_=Q(()=>{h_=[{match:/^#.*/gm,sub:`todo`},{type:`class`,match:/^\w+(?=:?)/gm},{type:`num`,match:/:\d+/g},{type:`oper`,match:/[:/&?]|\w+=/g},{type:`func`,match:/[.\w]+@|#[\w]+$/gm},{type:`var`,match:/\w+\.\w+(\.\w+)*/g}]}),__={};$(__,{default:()=>v_});var v_,y_=Q(()=>{v_=[{match:/#.*/g,sub:`todo`},{expand:`str`},{type:`str`,match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:`type`,match:/!![a-z]+/g},{type:`bool`,match:/\b(Yes|No)\b/g},{type:`oper`,match:/[+:-]/g},{expand:`num`},{type:`var`,match:/[a-zA-Z]\w*(?=:)/g}]}),b_={num:{type:`num`,match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:`str`,match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:`str`,match:/"((?!")[^\r\n\\]|\\[^])*"?/g}},x_=lh({"./languages/asm.js":()=>Promise.resolve().then(()=>(fh(),uh)),"./languages/bash.js":()=>Promise.resolve().then(()=>(gh(),ph)),"./languages/bf.js":()=>Promise.resolve().then(()=>(yh(),_h)),"./languages/c.js":()=>Promise.resolve().then(()=>(Sh(),bh)),"./languages/css.js":()=>Promise.resolve().then(()=>(Th(),Ch)),"./languages/csv.js":()=>Promise.resolve().then(()=>(Oh(),Eh)),"./languages/diff.js":()=>Promise.resolve().then(()=>(jh(),kh)),"./languages/docker.js":()=>Promise.resolve().then(()=>(Ph(),Mh)),"./languages/git.js":()=>Promise.resolve().then(()=>(Lh(),Fh)),"./languages/go.js":()=>Promise.resolve().then(()=>(Bh(),Rh)),"./languages/html.js":()=>Promise.resolve().then(()=>(Zh(),Yh)),"./languages/http.js":()=>Promise.resolve().then(()=>(rg(),tg)),"./languages/ini.js":()=>Promise.resolve().then(()=>(og(),ig)),"./languages/java.js":()=>Promise.resolve().then(()=>(lg(),sg)),"./languages/js.js":()=>Promise.resolve().then(()=>(fg(),ug)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(gg(),pg)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(wg(),xg)),"./languages/json.js":()=>Promise.resolve().then(()=>(Dg(),Tg)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(Ng(),jg)),"./languages/log.js":()=>Promise.resolve().then(()=>(Ig(),Pg)),"./languages/lua.js":()=>Promise.resolve().then(()=>(zg(),Lg)),"./languages/make.js":()=>Promise.resolve().then(()=>(Hg(),Bg)),"./languages/md.js":()=>Promise.resolve().then(()=>(Ag(),Og)),"./languages/pl.js":()=>Promise.resolve().then(()=>(Gg(),Ug)),"./languages/plain.js":()=>Promise.resolve().then(()=>(Jg(),Kg)),"./languages/py.js":()=>Promise.resolve().then(()=>(Zg(),Yg)),"./languages/regex.js":()=>Promise.resolve().then(()=>(t_(),Qg)),"./languages/rs.js":()=>Promise.resolve().then(()=>(i_(),n_)),"./languages/sql.js":()=>Promise.resolve().then(()=>(s_(),a_)),"./languages/todo.js":()=>Promise.resolve().then(()=>(bg(),_g)),"./languages/toml.js":()=>Promise.resolve().then(()=>(u_(),c_)),"./languages/ts.js":()=>Promise.resolve().then(()=>(p_(),d_)),"./languages/uri.js":()=>Promise.resolve().then(()=>(g_(),m_)),"./languages/xml.js":()=>Promise.resolve().then(()=>(Jh(),Vh)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(y_(),__))}),S_={},C_=(e=``)=>e.replaceAll(`&`,`&#38;`).replaceAll?.(`<`,`&lt;`).replaceAll?.(`>`,`&gt;`),w_=(e,t)=>t?`<span class="shj-syn-${t}">${e}</span>`:e;async function T_(e,t,n){try{let r,i,a={},o,s=[],c=0,l=typeof t==`string`?await(S_[t]??(S_[t]=x_(`./languages/${t}.js`))):t,u=[...typeof t==`string`?l.default:t.sub];for(;c<e.length;){for(a.index=null,r=u.length;r-->0;){if(i=u[r].expand?b_[u[r].expand]:u[r],s[r]===void 0||s[r].match.index<c){if(i.match.lastIndex=c,o=i.match.exec(e),o===null){u.splice(r,1),s.splice(r,1);continue}s[r]={match:o,lastIndex:i.match.lastIndex}}s[r].match[0]&&(s[r].match.index<=a.index||a.index===null)&&(a={part:i,index:s[r].match.index,match:s[r].match[0],end:s[r].lastIndex})}if(a.index===null)break;n(e.slice(c,a.index),l.type),c=a.end,a.part.sub?await T_(a.match,typeof a.part.sub==`string`?a.part.sub:typeof a.part.sub==`function`?a.part.sub(a.match):a.part,n):n(a.match,a.part.type)}n(e.slice(c,e.length),l.type)}catch{n(e)}}async function E_(e,t,n=!0,r={}){let i=``;return await T_(e,t,(e,t)=>i+=w_(C_(e),t)),n?`<div><div class="shj-numbers">${`<div></div>`.repeat(!r.hideLineNumbers&&e.split(`
601
+ `).length)}</div><div>${i}</div></div>`:i}var D_=5e4,O_={ts:`ts`,tsx:`ts`,mts:`ts`,cts:`ts`,js:`js`,jsx:`js`,mjs:`js`,cjs:`js`,py:`py`,rs:`rs`,go:`go`,java:`java`,lua:`lua`,pl:`pl`,c:`c`,h:`c`,cpp:`c`,cc:`c`,hpp:`c`,css:`css`,scss:`css`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,json:`json`,md:`md`,markdown:`md`,yml:`yaml`,yaml:`yaml`,toml:`toml`,ini:`ini`,sh:`bash`,bash:`bash`,zsh:`bash`,sql:`sql`,dockerfile:`docker`,makefile:`make`};function k_(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===`dockerfile`?`docker`:t===`makefile`?`make`:O_[t.slice(t.lastIndexOf(`.`)+1)]??`plain`}var A_=`
602
+ .file-diff .shj-syn-cmnt { color: #6c7086; font-style: italic; }
603
+ .file-diff .shj-syn-kwd { color: #cba6f7; }
604
+ .file-diff .shj-syn-num { color: #fab387; }
605
+ .file-diff .shj-syn-bool { color: #fab387; }
606
+ .file-diff .shj-syn-str { color: #a6e3a1; }
607
+ .file-diff .shj-syn-func { color: #89b4fa; }
608
+ .file-diff .shj-syn-class { color: #f9e2af; }
609
+ .file-diff .shj-syn-section { color: #94e2d5; }
610
+ .file-diff .shj-syn-oper { color: #94e2d5; }
611
+ .file-diff .shj-syn-var { color: #cdd6f4; }
612
+ .file-diff .shj-syn-esc { color: #f5c2e7; }
613
+ .file-diff .shj-syn-err { color: #f38ba8; }
614
+ `;function j_(e){let t=[],n=!1;for(let r of e.split(`
615
+ `)){if(r.startsWith(`@@`)){n=!0,t.push({kind:`hunk`,content:r,marker:``});continue}n&&(r.startsWith(`+`)?t.push({kind:`add`,content:r.slice(1),marker:`+`}):r.startsWith(`-`)?t.push({kind:`del`,content:r.slice(1),marker:`-`}):r.startsWith(` `)||r===``?t.push({kind:`ctx`,content:r.slice(1),marker:` `}):r.startsWith(`\\`)&&t.push({kind:`ctx`,content:r,marker:``}))}return t}var M_={add:`#a6e3a114`,del:`#f38ba814`,hunk:`transparent`,ctx:`transparent`},N_={add:`#a6e3a1`,del:`#f38ba8`,hunk:`#89b4fa`,ctx:`#45475a`};function P_({entry:e,path:t}){let n=(0,b.useMemo)(()=>e.patchText?j_(e.patchText):[],[e.patchText]),r=(0,b.useMemo)(()=>k_(t),[t]),i=r!==`plain`&&n.length<=D_,[a,o]=(0,b.useState)(null);return(0,b.useEffect)(()=>{if(o(null),!i||n.length===0)return;let e=!1;return Promise.all(n.map(e=>e.kind===`hunk`||e.content.length===0?Promise.resolve(null):E_(e.content,r,!1).catch(()=>null))).then(t=>{e||o(t)}),()=>{e=!0}},[n,r,i]),e.loading?(0,y.jsx)(I_,{text:`Loading diff...`}):e.error?(0,y.jsx)(I_,{text:e.error,color:`#f38ba8`}):e.imageDiff?(0,y.jsx)(F_,{imageDiff:e.imageDiff,path:t}):e.isBinary?(0,y.jsx)(I_,{text:`Binary file`}):n.length===0?(0,y.jsx)(I_,{text:`No textual changes`}):(0,y.jsxs)(`div`,{className:`file-diff`,style:{margin:`2px 0 6px 24px`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:420,fontSize:11,fontFamily:`monospace`,lineHeight:1.5},children:[(0,y.jsx)(`style`,{children:A_}),(0,y.jsx)(`div`,{style:{minWidth:`fit-content`},children:n.map((e,t)=>{let n=a?.[t]??null;return(0,y.jsxs)(`div`,{style:{display:`flex`,background:M_[e.kind],color:e.kind===`hunk`?`#89b4fa`:`#cdd6f4`,whiteSpace:`pre`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:16,textAlign:`center`,color:N_[e.kind],userSelect:`none`},children:e.marker}),n===null?(0,y.jsx)(`span`,{children:e.content}):(0,y.jsx)(`span`,{dangerouslySetInnerHTML:{__html:n}})]},t)})})]})}function F_({imageDiff:e,path:t}){let n=[];return e.before&&n.push({label:e.after?`Before`:`Deleted image`,preview:e.before}),e.after&&n.push({label:e.before?`After`:`Added image`,preview:e.after}),(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:10,display:`flex`,flexWrap:`wrap`,gap:10,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:520},children:n.map(({label:e,preview:n})=>(0,y.jsxs)(`figure`,{style:{flex:`1 1 220px`,minWidth:0,margin:0,display:`flex`,flexDirection:`column`,gap:6},children:[(0,y.jsx)(`figcaption`,{style:{color:`#a6adc8`,fontSize:10,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`},children:e}),(0,y.jsx)(`div`,{style:{minHeight:80,padding:8,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:4,backgroundColor:`#181825`,backgroundImage:[`linear-gradient(45deg, #242435 25%, transparent 25%)`,`linear-gradient(-45deg, #242435 25%, transparent 25%)`,`linear-gradient(45deg, transparent 75%, #242435 75%)`,`linear-gradient(-45deg, transparent 75%, #242435 75%)`].join(`,`),backgroundPosition:`0 0, 0 8px, 8px -8px, -8px 0`,backgroundSize:`16px 16px`},children:(0,y.jsx)(`img`,{src:n.dataUrl,alt:`${t} ${e.toLowerCase()}`,draggable:!1,style:{display:`block`,maxWidth:`100%`,maxHeight:410,objectFit:`contain`}})})]},e))})}function I_({text:e,color:t}){return(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:`6px 10px`,fontSize:11,color:t??`#6c7086`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`},children:e})}var L_={success:`#a6e3a1`,failure:`#f38ba8`,error:`#f38ba8`,pending:`#f9e2af`,neutral:`#6c7086`},R_={success:`✓`,failure:`✗`,error:`✗`,pending:`◔`,neutral:`–`},z_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`},B_={A:`A`,M:`M`,D:`D`,R:`R`,C:`C`,T:`T`,U:`U`};function V_(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function H_({commit:e,diff:t,branchName:n,prs:r,authorAvatarUrl:i,ciState:a,ciRuns:o,githubUrl:s,onCheckout:c,onNavigate:l}){return e?(0,y.jsxs)(`div`,{"data-testid":`commit-detail`,style:{position:`absolute`,right:0,bottom:0,zIndex:40,width:400,height:`fit-content`,maxHeight:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,borderTop:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:8},children:[(0,y.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:11,color:`#89b4fa`,letterSpacing:`0.04em`},children:e.sha.slice(0,12)}),l&&(0,y.jsx)(J_,{label:`Navigate to`,onClick:()=>l(e.sha)}),c&&(0,y.jsx)(J_,{label:`Checkout`,onClick:()=>c(e.sha)})]}),(0,y.jsx)(`p`,{style:{fontSize:14,fontWeight:600,color:`#cdd6f4`,lineHeight:1.4,margin:0,marginBottom:10},children:e.subject}),(0,y.jsx)(U_,{label:`Author`,value:`${e.authorName} <${e.authorEmail}>`,leading:(0,y.jsx)(W_,{name:e.authorName,url:i})}),(0,y.jsx)(U_,{label:`Date`,value:V_(e.authorUnix)}),n&&(0,y.jsx)(U_,{label:`Branch`,value:n}),(e.committerName!==e.authorName||e.committerUnix!==e.authorUnix)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(U_,{label:`Committer`,value:`${e.committerName} <${e.committerEmail}>`}),(0,y.jsx)(U_,{label:`Commit date`,value:V_(e.committerUnix)})]}),e.parents.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:`Parents`}),(0,y.jsx)(`span`,{style:{display:`flex`,gap:4,flexWrap:`wrap`},children:e.parents.map(e=>(0,y.jsx)(`span`,{onClick:()=>l?.(e),style:{fontFamily:`monospace`,color:`#89b4fa`,cursor:l?`pointer`:`default`,textDecoration:l?`underline`:`none`},children:e.slice(0,8)},e))})]}),e.parents.length>1&&(0,y.jsxs)(`div`,{style:{fontSize:12,color:`#a6adc8`,marginBottom:3},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:`Merge: `}),`merged into`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[0]),style:{color:`#89b4fa`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[0].slice(0,8)}),` `,`from`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[1]),style:{color:`#a6e3a1`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[1].slice(0,8)})]}),r&&r.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:4,marginTop:6,marginBottom:4},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:12,marginRight:4},children:r.length===1?`Pull request`:`Pull requests`}),r.map(e=>(0,y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open pull request #${e.number}: ${e.title}`,title:`Open pull request #${e.number}: ${e.title}`,style:{color:e.mergedAt?`#a6e3a1`:`#89b4fa`,fontSize:12,textDecoration:`underline`},children:[`PR #`,e.number,` ↗`,e.title?`: ${e.title.length>40?`${e.title.slice(0,40)}…`:e.title}`:``]},e.number))]}),s&&e.isPushed&&(0,y.jsxs)(`div`,{style:{marginTop:4,marginBottom:4,display:`flex`,gap:12},children:[(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`View on GitHub`}),(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}/checks`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`CI runs`})]}),a===`loading`&&(0,y.jsx)(`div`,{style:{marginTop:8},children:(0,y.jsx)(q_,{})}),o&&o.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexDirection:`column`,gap:3},children:o.map((e,t)=>(0,y.jsx)(K_,{run:e},`${e.name}-${t}`))}),e.refs.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:4},children:e.refs.map(e=>(0,y.jsx)(`span`,{style:{background:`#313244`,color:`#89b4fa`,fontSize:11,borderRadius:4,padding:`2px 6px`,fontWeight:500},children:e},e))})]}),e.body&&(0,y.jsx)(`div`,{style:{padding:`10px 16px`,borderBottom:`1px solid #313244`,flexShrink:0,maxHeight:200,overflowY:`auto`},children:(0,y.jsx)(`pre`,{style:{fontSize:12,color:`#a6adc8`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,fontFamily:`inherit`,margin:0,lineHeight:1.5},children:e.body})}),(0,y.jsx)(`div`,{style:{flex:`1 1 auto`,minHeight:0,overflowY:`auto`},children:t&&t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,position:`sticky`,top:0,background:`#181825`},children:[(0,y.jsxs)(`span`,{children:[`Changed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(G_,{sha:e.sha,cp:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):t?(0,y.jsx)(`div`,{style:{padding:`16px`,fontSize:13,color:`#45475a`},children:`No changed files`}):null})]}):null}function U_({label:e,value:t,mono:n,leading:r}){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:r?`center`:void 0,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:e}),(0,y.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:7,minWidth:0,color:`#a6adc8`,fontFamily:n?`monospace`:`inherit`},children:[r,(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t})]})]})}function W_({name:e,url:t}){let[n,r]=(0,b.useState)(!1);(0,b.useEffect)(()=>r(!1),[t]);let i={width:24,height:24,borderRadius:`50%`,flexShrink:0};return t&&!n?(0,y.jsx)(`img`,{src:t,alt:`${e} avatar`,width:24,height:24,onError:()=>r(!0),style:{...i,display:`block`,objectFit:`cover`,background:`#313244`}}):(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{...i,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`#313244`,color:`#cdd6f4`,fontSize:11,fontWeight:700},children:e.trim().charAt(0).toUpperCase()||`?`})}function G_({sha:e,cp:t}){let[n,r]=(0,b.useState)(!1),i=R(e=>e.loadCommitFileDiff),a=R(n=>n.commitFileDiffs[Lr(e,t.path)]),o=z_[t.status]??`#cdd6f4`,s=B_[t.status]??t.status,c=t.oldPath?`${t.oldPath} → ${t.path}`:t.path;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,fontSize:12,color:`#cdd6f4`,borderBottom:`1px solid #1e1e2e`,cursor:`pointer`},onClick:()=>{let a=!n;r(a),a&&i(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{flexShrink:0,width:18,height:18,borderRadius:3,background:o+`33`,color:o,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:10,fontWeight:700},children:s}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`,fontSize:12,color:`#a6adc8`},title:c,children:c})]}),n&&a&&(0,y.jsx)(P_,{entry:a,path:t.path})]})}function K_({run:e}){let t=L_[e.state],n=R_[e.state],r=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:t,fontSize:12,fontWeight:700,width:12,textAlign:`center`,flexShrink:0},children:n}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flexShrink:0,maxWidth:`55%`},children:e.name}),e.description&&(0,y.jsx)(`span`,{style:{color:`#6c7086`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1},children:e.description})]}),i={display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,textDecoration:`none`};return e.url?(0,y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,style:i,title:e.description??e.name,children:r}):(0,y.jsx)(`div`,{style:i,title:e.description??e.name,children:r})}function q_(){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,color:`#6c7086`},title:`Loading CI status`,children:[(0,y.jsx)(`span`,{style:{width:10,height:10,borderRadius:`50%`,border:`2px solid #45475a`,borderTopColor:`#89b4fa`,flexShrink:0,animation:`ci-spin 0.8s linear infinite`}}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500},children:`CI status`}),(0,y.jsx)(`span`,{children:`Loading...`}),(0,y.jsx)(`style`,{children:`@keyframes ci-spin { to { transform: rotate(360deg); } }`})]})}function J_({label:e,onClick:t}){return(0,y.jsx)(`button`,{onClick:t,title:e,style:{background:`#313244`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:11,padding:`2px 8px`,cursor:`pointer`,fontFamily:`inherit`},onMouseEnter:e=>{e.currentTarget.style.background=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`#313244`},children:e})}var Y_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`,"?":`#94e2d5`},X_={A:`Added`,M:`Modified`,D:`Deleted`,R:`Renamed`,C:`Copied`,T:`Type changed`,U:`Conflicted`,"?":`Untracked`};function Z_({file:e,area:t,actionLabel:n,onAction:r,onDiscard:i}){let[a,o]=(0,b.useState)(!1),s=R(e=>e.loadWorktreeFileDiff),c=R(n=>n.worktreeFileDiffs[Ir(t,e.path)]),l=e.path.lastIndexOf(`/`),u=l>=0?e.path.slice(0,l+1):``,d=l>=0?e.path.slice(l+1):e.path,f=Y_[e.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{a&&!c&&s(e,t)},[a,c,e,t,s]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`4px 6px`,borderRadius:6,cursor:`pointer`},onClick:()=>{let n=!a;o(n),n&&s(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:a?`▼`:`▶`}),(0,y.jsx)(`span`,{title:X_[e.status]??e.status,style:{flexShrink:0,width:16,height:16,borderRadius:3,background:f+`22`,color:f,fontSize:10,fontWeight:700,fontFamily:`monospace`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:e.status}),(0,y.jsxs)(`span`,{title:e.path,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontSize:12,fontFamily:`monospace`,direction:`rtl`,textAlign:`left`},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:u}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`},children:d})]}),(0,y.jsxs)(`span`,{onClick:e=>e.stopPropagation(),style:{display:`flex`,gap:4},children:[(0,y.jsx)(Td,{label:n,tone:`neutral`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:r}),(0,y.jsx)(Td,{label:`Discard`,tone:`danger`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:i})]})]}),a&&c&&(0,y.jsx)(P_,{entry:c,path:e.path})]})}function Q_({title:e,files:t,area:n,bulkLabel:r,onBulk:i,rowActionLabel:a,onRowAction:o,onDiscard:s}){return t.length===0?null:(0,y.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 6px 4px`},children:[(0,y.jsxs)(`span`,{style:{fontSize:11,fontWeight:700,letterSpacing:.4,textTransform:`uppercase`,color:`#a6adc8`},children:[e,` `,(0,y.jsxs)(`span`,{style:{color:`#6c7086`},children:[`(`,t.length,`)`]})]}),r&&i&&(0,y.jsx)(Td,{label:r,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:i})]}),t.map(e=>(0,y.jsx)(Z_,{file:e,area:n,actionLabel:typeof a==`function`?a(e):a,onAction:()=>o(e),onDiscard:()=>s(e)},`${e.status}:${e.path}`))]})}function $_({stagedCount:e,headSha:t,branch:n,amendable:r}){let i=R(e=>e.performCommit),a=R(e=>e.performRefAction),o=R(e=>e.runStageAction),s=R(e=>e.showError),c=R(e=>e.pendingMutation),l=R(e=>e.repoId),u=R(e=>e.worktreeCommitMessage),d=R(e=>e.setWorktreeCommitMessage),[f,p]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitNoVerify`)===`true`}catch{return!1}}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),[v,x]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitSubmitAction`)===`commit-and-push`?`commit-and-push`:`commit`}catch{return`commit`}}),[S,C]=(0,b.useState)(!1),[w,T]=(0,b.useState)(!1),ee=(0,b.useRef)(null),[te,E]=(0,b.useState)(``),ne=m&&r;(0,b.useEffect)(()=>{if(!S)return;let e=e=>{ee.current?.contains(e.target)||C(!1)},t=e=>{e.key===`Escape`&&C(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[S]);let re=e=>{try{localStorage.setItem(`commitNoVerify`,String(e))}catch{}p(e)},ie=async e=>{if(h(e),e){_(!0);let e=await o(`stage-all`,[]);if(_(!1),!e){h(!1);return}if(u.trim().length===0&&l&&t)try{let e=await nn(l,t),n=e.body?`${e.subject}\n\n${e.body}`:e.subject;R.getState().worktreeCommitMessage.trim().length===0&&(d(n),E(n))}catch{}}else u===te&&(d(``),E(``))},ae=e>0&&u.trim().length>0&&!g&&!c,oe=ae&&(v===`commit`||!!n),se=e=>{try{localStorage.setItem(`commitSubmitAction`,e)}catch{}x(e),C(!1)},ce=async()=>{if(!oe||!await i(u.trim(),f,ne)||(d(``),E(``),h(!1),v!==`commit-and-push`||!n))return;let e=R.getState(),r=e.refs.find(e=>e.kind===`head`&&e.isCurrent),o=r?.shortName??n,c=r?.targetSha??e.worktreeChanges?.headSha??t;if(!c){s(`Push failed`,`Could not determine the committed revision to push`);return}T(!0);try{await a(`push`,o,c)}catch(e){e&&typeof e==`object`&&e.code===`CONFLICT`?s(`Push rejected`,e,{label:`Force push`,run:()=>{a(`push`,o,c,!0).catch(e=>s(`Force push failed`,e))}}):s(`Push failed`,e)}finally{T(!1)}},D=g?`Staging…`:w?`Pushing…`:c?ne?`Amending…`:`Committing…`:`${ne?`Amend`:`Commit`}${v===`commit-and-push`?` & push`:``}${e>0?` (${e})`:``}`;return(0,y.jsxs)(`div`,{style:{borderBottom:`1px solid #313244`,padding:`10px 12px`,display:`flex`,flexDirection:`column`,gap:8,flexShrink:0},children:[(0,y.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),ce())},placeholder:ne?`Amend commit message`:e>0?`Commit message`:`Stage files to commit`,rows:3,style:{resize:`vertical`,minHeight:54,background:`#11111b`,border:`1px solid #313244`,borderRadius:6,color:`#cdd6f4`,fontSize:12,fontFamily:`inherit`,padding:`8px 10px`,outline:`none`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#313244`}}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,minWidth:0},children:[r&&(0,y.jsxs)(`label`,{title:`Replace the previous commit (git commit --amend) instead of creating a new one`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:m,disabled:g,onChange:e=>void ie(e.target.checked),style:{accentColor:`#cba6f7`,cursor:g?`default`:`pointer`}}),`Amend`]}),(0,y.jsxs)(`label`,{title:`Commit with --no-verify (skips pre-commit and commit-msg hooks)`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>re(e.target.checked),style:{accentColor:`#fab387`,cursor:`pointer`}}),`Skip git hooks`]})]}),(0,y.jsxs)(`div`,{ref:ee,style:{display:`flex`,position:`relative`,flexShrink:0},children:[(0,y.jsx)(`button`,{onClick:()=>void ce(),disabled:!oe,title:v===`commit-and-push`&&!n?`Check out a branch before committing and pushing`:void 0,style:{background:oe?`#a6e3a1`:`#313244`,color:oe?`#11111b`:`#6c7086`,border:`none`,borderRadius:`6px 0 0 6px`,fontSize:12,fontWeight:700,padding:`6px 12px 6px 14px`,cursor:oe?`pointer`:`default`,fontFamily:`inherit`,whiteSpace:`nowrap`},children:D}),(0,y.jsx)(`button`,{type:`button`,"aria-label":`Choose commit action`,"aria-haspopup":`menu`,"aria-expanded":S,disabled:g||c||w,onClick:()=>C(e=>!e),style:{width:28,background:ae?`#a6e3a1`:`#313244`,color:ae?`#11111b`:`#6c7086`,border:`none`,borderLeft:`1px solid ${ae?`#11111b33`:`#45475a`}`,borderRadius:`0 6px 6px 0`,cursor:g||c||w?`default`:`pointer`,fontFamily:`inherit`,fontSize:10,fontWeight:700},children:`▼`}),S&&(0,y.jsx)(`div`,{role:`menu`,"aria-label":`Commit action`,style:{position:`absolute`,right:0,bottom:`calc(100% + 6px)`,zIndex:50,minWidth:154,padding:4,border:`1px solid #45475a`,borderRadius:7,background:`#1e1e2e`,boxShadow:`0 8px 24px #00000066`},children:[[`commit`,`Commit`],[`commit-and-push`,`Commit & push`]].map(([e,t])=>(0,y.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":v===e,onClick:()=>se(e),style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,padding:`7px 9px`,border:`none`,borderRadius:5,background:v===e?`#313244`:`transparent`,color:`#cdd6f4`,cursor:`pointer`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,whiteSpace:`nowrap`},children:[(0,y.jsx)(`span`,{style:{width:12,color:`#a6e3a1`},children:v===e?`✓`:``}),t]},e))})]})]})]})}function ev({operation:e,conflictedCount:t}){let n=R(e=>e.abortInProgressOperation),r=R(e=>e.continueInProgressOperation),i=R(e=>e.pendingMutation),a=e===`rebase`?`Rebase`:`Merge`,o=t>0?`${a} conflict`:`${a} in progress`,s=t>0?`${t} conflicted file${t===1?``:`s`} — resolve and stage them, then continue`:`All conflicts resolved — continue the ${e} to finish.`,c=!i&&t===0;return(0,y.jsxs)(`div`,{style:{border:`1px solid #8b3a4a`,background:`#5c243033`,borderRadius:7,padding:`10px 10px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,y.jsxs)(`div`,{style:{minWidth:0,display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsx)(`span`,{style:{color:`#f5a6b8`,fontSize:13,fontWeight:700},children:o}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:11},children:s})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,y.jsx)(`span`,{title:c?void 0:t>0?`Stage all conflicted files first`:void 0,children:(0,y.jsx)(Td,{label:i?`Working…`:`Continue ${a}`,tone:`success`,onClick:()=>void r(e),disabled:!c})}),(0,y.jsx)(Td,{label:i?`Aborting…`:`Abort ${a}`,tone:`danger`,onClick:()=>void n(e),disabled:i})]})]})}function tv(){let e=R(e=>e.worktreeChanges),t=R(e=>e.runStageAction),n=R(e=>e.createStash),r=R(e=>e.pendingMutation),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(null),c=e?.staged??[],l=e?.unstaged??[],u=(0,b.useMemo)(()=>new Set([...c,...l].map(e=>e.path)).size,[c,l]),d=e?.mergeHeadShas?.length?`merge`:e?.rebaseHeadSha?`rebase`:null,f=(0,b.useMemo)(()=>new Set(l.filter(e=>e.status===`U`).map(e=>e.path)).size,[l]),p=e=>{s({title:`Discard file changes?`,message:`Discard all staged and unstaged changes to “${e.path}”? This cannot be undone.`,paths:e.oldPath?[e.path,e.oldPath]:[e.path],all:!1})};return(0,y.jsxs)(`div`,{"data-testid":`working-tree-detail`,style:{position:`absolute`,right:0,bottom:0,zIndex:40,width:480,height:`fit-content`,maxHeight:`100%`,borderLeft:`1px solid #313244`,borderTop:`1px solid #313244`,background:`#181825`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsx)(Lf,{open:i,title:`Stash changes`,label:`Message (optional)`,placeholder:`Describe these changes`,confirmLabel:`Stash`,allowEmpty:!0,onSubmit:e=>{a(!1),n(e||void 0)},onClose:()=>a(!1)}),(0,y.jsx)(Rf,{open:!!o,title:o?.title??``,message:o?.message??``,confirmLabel:`Discard`,onConfirm:()=>{let e=o;s(null),e&&t(e.all?`discard-all`:`discard`,e.paths)},onClose:()=>s(null)}),(0,y.jsxs)(`div`,{style:{padding:`14px 16px 10px`,borderBottom:`1px solid #313244`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:8,minWidth:0},children:[(0,y.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`#cdd6f4`,flexShrink:0},children:`Working tree`}),e?.branch&&(0,y.jsxs)(`span`,{style:{fontSize:12,color:`#89b4fa`,fontFamily:`monospace`,overflow:`hidden`,textOverflow:`ellipsis`},children:[`⎇ `,e.branch]})]}),l.length>0&&(0,y.jsx)(Td,{label:`Stage all`,tone:`success`,size:`compact`,disabled:r,onClick:()=>t(`stage-all`,[])})]}),(0,y.jsx)(`div`,{style:{fontSize:11,color:`#6c7086`,marginTop:2},children:u===0?`No changes`:`${u} changed file${u===1?``:`s`}`})]}),(0,y.jsx)($_,{stagedCount:c.length,headSha:e?.headSha,branch:e?.branch,amendable:!d&&!!e?.headSha}),(0,y.jsxs)(`div`,{style:{flex:`1 1 auto`,minHeight:0,overflow:`auto`,padding:`12px 10px`,display:`flex`,flexDirection:`column`,gap:16},children:[d&&(0,y.jsx)(ev,{operation:d,conflictedCount:f}),u===0?(0,y.jsx)(`div`,{style:{color:`#45475a`,fontSize:13,textAlign:`center`,marginTop:28},children:`Working tree clean`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Q_,{title:`Staged`,files:c,area:`staged`,bulkLabel:`Unstage all`,onBulk:()=>t(`unstage-all`,[]),rowActionLabel:`Unstage`,onRowAction:e=>t(`unstage`,[e.path]),onDiscard:p}),(0,y.jsx)(Q_,{title:`Changes`,files:l,area:`unstaged`,rowActionLabel:e=>e.status===`U`?`Mark resolved`:`Stage`,onRowAction:e=>t(`stage`,[e.path]),onDiscard:p})]})]}),u>0&&(0,y.jsxs)(`div`,{style:{flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:8,padding:`10px 12px`,borderTop:`1px solid #313244`},children:[(0,y.jsx)(Td,{label:`Stash all`,tone:`neutral`,disabled:r,onClick:()=>a(!0)}),(0,y.jsx)(Td,{label:`Discard all`,tone:`danger`,variant:`ghost`,disabled:r,onClick:()=>{s({title:`Discard all changes?`,message:`Permanently discard changes in ${u} file${u===1?``:`s`}, including untracked files? This cannot be undone.`,paths:[],all:!0})}})]})]})}var nv={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`};function rv(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function iv({stash:e,diff:t,busy:n,onApply:r,onDrop:i,onNavigate:a}){let[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1),u=async()=>{if(!n){s(!0);try{await r(e.sha)}finally{s(!1)}}},d=async()=>{if(!n&&window.confirm(`Drop ${e.selector}? This permanently deletes the stashed changes.`)){l(!0);try{await i(e.sha)}finally{l(!1)}}};return(0,y.jsxs)(`div`,{style:{width:400,flexShrink:0,height:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,y.jsx)(`span`,{style:{padding:`2px 6px`,borderRadius:4,background:`#55323c`,color:`#f5c2e7`,fontFamily:`monospace`,fontSize:11,fontWeight:700},children:e.selector}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontFamily:`monospace`,fontSize:10},children:e.sha.slice(0,10)})]}),(0,y.jsx)(`p`,{style:{margin:`0 0 11px`,color:`#cdd6f4`,fontSize:14,fontWeight:600,lineHeight:1.4},children:e.message||`Stashed changes`}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Created`}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`},children:rv(e.createdAt)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Parent`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>a(e.parentSha),title:`Navigate to ${e.parentSha}`,style:{padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:11,textDecoration:`underline`,textUnderlineOffset:2,cursor:`pointer`},children:e.parentSha.slice(0,12)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>void u(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #b87b89`,borderRadius:4,background:n?`#55323c`:`#f5c2e7`,color:n?`#a77b86`:`#311f25`,fontSize:11,fontWeight:750,cursor:n?`default`:`pointer`},children:o?`Applying…`:`Apply stash`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>void d(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #f38ba866`,borderRadius:4,background:`#311f25`,color:n?`#8b626c`:`#f38ba8`,fontSize:11,fontWeight:700,cursor:n?`default`:`pointer`},children:c?`Dropping…`:`Drop stash`})]})]}),(0,y.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:t?t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,background:`#181825`,color:`#6c7086`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`,zIndex:1},children:[(0,y.jsxs)(`span`,{children:[`Stashed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(av,{stashSha:e.sha,file:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:13},children:`No changed files`}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:12},children:`Loading stashed files…`})})]})}function av({stashSha:e,file:t}){let[n,r]=(0,b.useState)(!1),i=R(e=>e.loadStashFileDiff),a=R(n=>n.stashFileDiffs[Rr(e,t.path)]),o=t.oldPath?`${t.oldPath} → ${t.path}`:t.path,s=nv[t.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{let a=!n;r(a),a&&i(e,t)},style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,border:`none`,borderBottom:`1px solid #1e1e2e`,background:`transparent`,color:`#cdd6f4`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{width:10,flexShrink:0,color:`#6c7086`,fontSize:9},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{width:18,height:18,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:3,background:`${s}33`,color:s,fontSize:10,fontWeight:700},children:t.status}),(0,y.jsx)(`span`,{title:o,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12},children:o})]}),n&&a&&(0,y.jsx)(P_,{entry:a,path:t.path})]})}function ov({error:e,onDismiss:t}){let[n,r]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!e)return;r(!1);let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,y.jsx)(`div`,{onClick:t,style:{position:`fixed`,inset:0,background:`rgba(17, 17, 27, 0.75)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:24},children:(0,y.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`error-dialog-title`,style:{background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:8,boxShadow:`0 12px 40px rgba(0, 0, 0, 0.5)`,maxWidth:760,width:`100%`,maxHeight:`80vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`14px 18px`,borderBottom:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`span`,{id:`error-dialog-title`,style:{fontSize:14,fontWeight:600,color:`#f38ba8`},children:e.title}),(0,y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close`,style:{background:`transparent`,border:`none`,color:`#6c7086`,fontSize:20,lineHeight:1,cursor:`pointer`,padding:4},children:`×`})]}),(0,y.jsx)(`pre`,{style:{margin:0,padding:`16px 18px`,overflow:`auto`,flex:1,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,fontSize:12.5,lineHeight:1.5,color:`#cdd6f4`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,userSelect:`text`},children:e.message}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`12px 18px`,borderTop:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e.message),r(!0),setTimeout(()=>r(!1),1500)}catch{}},style:{background:`#313244`,color:`#cdd6f4`,border:`1px solid #45475a`,borderRadius:6,padding:`6px 14px`,fontSize:13,cursor:`pointer`},children:n?`Copied`:`Copy`}),e.action&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.run(),t()},style:{background:`#f9e2af`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:e.action.label}),(0,y.jsx)(`button`,{type:`button`,onClick:t,style:{background:`#89b4fa`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:`Close`})]})]})}):null}function sv(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function cv(e){let t=new Set(e.map(e=>e.agent)).size>1?`Agents ×${e.length}`:`${e[0].agent[0].toUpperCase()}${e[0].agent.slice(1)} ×${e.length}`,n=e.filter(e=>e.busy).length;return n>0?`${t} · ${n} working`:t}function lv(){let{sessions:e,capabilities:t,focusingPid:n,installing:r,focus:i,install:a,canInstallWindowCalls:o}=ji(),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(()=>{try{return localStorage.getItem(`agentSessionsShowAll`)===`true`}catch{return!1}}),d=e=>{try{localStorage.setItem(`agentSessionsShowAll`,String(e))}catch{}u(e)},[f,p]=(0,b.useState)(null),m=R(e=>e.repoPath),h=R(e=>e.openRepoByPath),g=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!s)return;let e=e=>{g.current&&!g.current.contains(e.target)&&c(!1)};return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[s]);let _=async e=>{await i(e)&&c(!1)},v=e=>{!e.gitRoot||e.gitRoot===m||(c(!1),h(e.gitRoot))};if(e.length===0)return null;let x=Oi(e),S=m?x.filter(e=>e.gitRoot===m||e.cwd===m):[],C=x.filter(e=>!S.includes(e)),w=m===null||l?[...S,...C]:S,T=m!==null&&!l?C.length:0;return(0,y.jsxs)(`div`,{ref:g,style:{position:`relative`,flexShrink:0},children:[(0,y.jsxs)(`button`,{onClick:e=>{let t=e.currentTarget.getBoundingClientRect();p({top:t.bottom+4,right:window.innerWidth-t.right}),c(e=>!e)},title:`${e.length} agent session${e.length===1?``:`s`} running`,"aria-label":`Agent sessions`,style:{display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid ${S.length>0?`#a6e3a155`:`#313244`}`,background:S.length>0?`#a6e3a115`:`transparent`,color:S.length>0?`#a6e3a1`:`#6c7086`,fontSize:11,cursor:`pointer`},children:[[...new Set(e.map(e=>e.agent))].map(t=>(0,y.jsx)(Pi,{agent:t,size:12,busy:e.some(e=>e.agent===t&&e.busy)},t)),cv(e)]}),s&&f&&(0,y.jsxs)(`div`,{style:{position:`fixed`,top:f.top,right:f.right,width:480,maxWidth:`calc(100vw - 16px)`,maxHeight:320,overflowY:`auto`,background:`#181825`,border:`1px solid #313244`,borderRadius:6,boxShadow:`0 8px 24px #00000088`,zIndex:100,padding:4},children:[o&&(0,y.jsxs)(`div`,{style:{padding:`8px 8px 10px`,borderBottom:`1px solid #313244`,marginBottom:4},children:[(0,y.jsx)(`div`,{style:{color:`#a6adc8`,fontSize:11,marginBottom:6,lineHeight:1.4},children:`Focusing terminal windows needs the “Activate Window By Title” GNOME\xA0Shell extension.`}),(0,y.jsx)(`button`,{onClick:()=>void a(),disabled:r,style:{padding:`4px 10px`,borderRadius:4,border:`1px solid #89b4fa55`,background:`#89b4fa20`,color:r?`#45475a`:`#89b4fa`,fontSize:11,cursor:r?`default`:`pointer`},children:r?`Waiting for GNOME confirmation…`:`Install extension`})]}),w.length===0&&(0,y.jsx)(`div`,{style:{padding:`8px`,color:`#585b70`,fontSize:11},children:`No agents running in this repository`}),w.map(e=>{let r=m!==null&&(e.gitRoot===m||e.cwd===m),i=e.gitRoot!==null&&!r,a=!e.focusable,o=a?e.kind===`terminal`?t?.displayServer===`wayland`?`Can't focus terminal windows on Wayland — install the 'Activate Window By Title' GNOME Shell extension`:`Can't focus terminal windows — install wmctrl`:`This session has no window to focus`:`Focus ${e.agent} window · ${Ai(e)} (pid ${e.pid})`;return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,width:`100%`,borderRadius:4,background:`transparent`,opacity:n!==null&&n!==e.pid?.5:1},onMouseEnter:e=>{e.currentTarget.style.background=`#31324466`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsxs)(`button`,{onClick:()=>v(e),disabled:!i,title:r?`${e.cwd} · currently open repository`:e.gitRoot?`Switch to ${e.gitRoot}`:`${e.cwd} · not inside a Git repository`,style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:0,padding:`6px 8px`,border:`none`,background:`transparent`,color:`#a6adc8`,fontSize:11,textAlign:`left`,cursor:i?`pointer`:`default`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,display:`inline-flex`},children:(0,y.jsx)(Pi,{agent:e.agent,size:13,busy:e.busy??!1})}),(0,y.jsxs)(`span`,{style:{flexShrink:0,fontFamily:`monospace`},children:[sv(e.cwd),e.count>1?` ×${e.count}`:``]}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,color:`#7f849c`,textAlign:`right`},children:e.title??Ai(e)}),e.busy&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#f9e2af`,fontSize:10},children:`working`}),r&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`this repo`})]}),(0,y.jsx)(`button`,{onClick:()=>!a&&void _(e),disabled:a||n!==null,title:o,style:{flexShrink:0,marginRight:6,padding:`3px 7px`,border:`1px solid #89b4fa55`,borderRadius:4,background:`#89b4fa18`,color:a?`#45475a`:`#89b4fa`,fontSize:10,cursor:a||n!==null?`default`:`pointer`},children:n===e.pid?`Focusing…`:`Focus on window`})]},`${e.pid}:${e.cwd}`)}),T>0&&(0,y.jsxs)(`button`,{onClick:()=>d(!0),style:{display:`block`,width:`100%`,padding:`6px 8px`,marginTop:w.length>0?2:0,border:`none`,borderTop:w.length>0?`1px solid #313244`:`none`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[`▸ Show `,T,` agent`,T===1?``:`s`,` in other repositories`]}),m!==null&&l&&C.length>0&&(0,y.jsx)(`button`,{onClick:()=>d(!1),style:{display:`block`,width:`100%`,padding:`6px 8px`,border:`none`,borderTop:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:`▾ Hide agents in other repositories`})]})]})}var uv=`modulepreload`,dv=function(e){return`/`+e},fv={},pv=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=dv(t,n),t=s(t),t in fv)return;fv[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:uv,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},mv=(0,b.lazy)(async()=>({default:(await pv(()=>import(`./SettingsDialog-CwkyBvJR.js`),[])).SettingsDialog})),hv=`ingit`,gv=8;function _v(e){if(e.trim().length===0)return null;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));if(t===-1)return{folder:`.`,prefix:e};let n=e.slice(t+1),r=e[t],i=e.slice(0,t);return/^[A-Za-z]:$/.test(i)&&(i+=r),i||=e.startsWith(`/`)||e.startsWith(`\\`)?r:`.`,{folder:i,prefix:n}}function vv(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function yv(e){if(!e)return 0;let t=new Set;for(let n of e.staged)t.add(n.path);for(let n of e.unstaged)t.add(n.path);return t.size}function bv(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!1),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)([]),[v,x]=(0,b.useState)(0),[S,C]=(0,b.useState)(null),w=(0,b.useRef)(null),{status:T,repoId:ee,repoPath:E,currentWorktreePath:ne,worktrees:re,recentRepos:ie,discoveredFolder:ae,discoveredRepos:oe,openError:se,errorDialog:ce,dismissError:D,showError:O,openRepoByPath:le,closeRepo:ue,openFromUrl:de,performRefAction:fe,showCommitMessages:pe,setShowCommitMessages:me,viewMode:he,setViewMode:ge,worktreeChanges:_e,reloadFromServer:ve}=R(te(e=>({status:e.status,repoId:e.repoId,repoPath:e.repoPath,currentWorktreePath:e.currentWorktreePath,worktrees:e.worktrees,recentRepos:e.recentRepos,discoveredFolder:e.discoveredFolder,discoveredRepos:e.discoveredRepos,openError:e.openError,errorDialog:e.errorDialog,dismissError:e.dismissError,showError:e.showError,openRepoByPath:e.openRepoByPath,closeRepo:e.closeRepo,openFromUrl:e.openFromUrl,performRefAction:e.performRefAction,showCommitMessages:e.showCommitMessages,setShowCommitMessages:e.setShowCommitMessages,viewMode:e.viewMode,setViewMode:e.setViewMode,worktreeChanges:e.worktreeChanges,reloadFromServer:e.reloadFromServer}))),ye=async()=>{if(!i){a(!0);try{await fe(`fetch`,``,``)}catch(e){O(`Fetch failed`,e)}finally{a(!1)}}};(0,b.useEffect)(()=>{let e=()=>de();return window.addEventListener(`hashchange`,e),de(),()=>window.removeEventListener(`hashchange`,e)},[de]),(0,b.useEffect)(()=>{T!==`ready`||!ee||ye()},[ee,T]),(0,b.useEffect)(()=>{s(E??``),d(!1),p(!1)},[E]),(0,b.useEffect)(()=>{if(!c||!u){p(!1),h(!1);return}let e=_v(o);if(!e){_([]),p(!1),h(!1);return}let t=!1,n=window.setTimeout(()=>{h(!0),Ht(e.folder).then(n=>{if(t)return;let r=e.prefix.toLowerCase(),i=n.entries.filter(e=>r.length===0||e.name.toLowerCase().startsWith(r)).slice(0,gv);_(i),x(0),p(i.length>0)}).catch(()=>{t||(_([]),p(!1))}).finally(()=>{t||h(!1)})},120);return()=>{t=!0,window.clearTimeout(n)}},[u,c,o]),(0,b.useEffect)(()=>{if(T!==`ready`||!E){document.title=hv;return}document.title=`${vv(E)} (${yv(_e)})`},[T,E,_e]),(0,b.useEffect)(()=>{let e=document.visibilityState===`hidden`?Date.now():null,t=()=>{e=Date.now()},n=()=>{document.visibilityState!==`hidden`&&(e!==null&&Date.now()-e>3e4&&ve(),e=null)},r=()=>{document.visibilityState===`hidden`?t():n()};return window.addEventListener(`blur`,t),window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[ve]);let be=e=>{e.preventDefault();let t=o.trim();if(!t||t===E){s(E??``),l(!1),e.currentTarget.querySelector(`input`)?.blur();return}le(t)},xe=()=>{let e=w.current?.getBoundingClientRect();e&&C({top:e.bottom+4,left:e.left,width:e.width})},Se=e=>{s(e.path),d(!1),p(!1),x(0)},Ce=c&&S!==null&&(m||f&&g.length>0);return T===`no-repo`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(zi,{onOpen:le,error:se,recentRepos:ie,discoveredFolder:ae,discoveredRepos:oe}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>r(!0),title:`Open settings`,"aria-label":`Open settings`,style:{position:`fixed`,top:14,right:14,zIndex:20,padding:`6px 11px`,border:`1px solid #45475a`,borderRadius:6,background:`#181825`,color:`#a6adc8`,fontSize:11,fontWeight:700,cursor:`pointer`},children:`Settings`}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(mv,{open:!0,onClose:()=>r(!1)})}),(0,y.jsx)(ov,{error:ce,onDismiss:D})]}):T===`loading`?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,width:`100%`,background:`#1e1e2e`,flexDirection:`column`,gap:16},children:[(0,y.jsx)(Cv,{}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:13},children:`Opening repository…`})]}):(0,y.jsxs)(`div`,{style:{position:`relative`,display:`flex`,height:`100%`,width:`100%`,overflow:`hidden`,background:`#1e1e2e`},children:[e&&(0,y.jsx)(xv,{onClose:()=>t(!1),onOpenSettings:()=>r(!0),settingsOpen:n}),(0,y.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{height:36,flexShrink:0,display:`flex`,alignItems:`center`,padding:`0 14px`,borderBottom:`1px solid #313244`,background:`#181825`,fontSize:12,color:`#6c7086`,gap:8,overflow:`hidden`},children:[!e&&(0,y.jsx)(`button`,{onClick:()=>t(!0),title:`Show refs`,"aria-label":`Show refs`,style:{width:24,height:20,flexShrink:0,padding:0,borderRadius:3,border:`1px solid #313244`,background:`#1e1e2e`,color:`#6c7086`,fontSize:13,lineHeight:`18px`,cursor:`pointer`},children:`☰`}),he===`history`&&(0,y.jsx)(`button`,{onClick:()=>me(!pe),style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid ${pe?`#89b4fa55`:`#313244`}`,background:pe?`#89b4fa20`:`transparent`,color:pe?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:pe?`Hide commit messages`:`Show commit messages`,children:pe?`Hide messages`:`Show messages`}),(0,y.jsxs)(`div`,{style:{flexShrink:0,display:`flex`,borderRadius:4,border:`1px solid #313244`,overflow:`hidden`},children:[(0,y.jsx)(`button`,{onClick:()=>ge(`history`),style:{padding:`4px 10px`,border:`none`,background:he===`history`?`#89b4fa20`:`transparent`,color:he===`history`?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Branch history graph`,children:`History`}),(0,y.jsx)(`button`,{onClick:()=>ge(`reflog`),style:{padding:`4px 10px`,border:`none`,borderLeft:`1px solid #313244`,background:he===`reflog`?`#f9e2af20`:`transparent`,color:he===`reflog`?`#f9e2af`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Reflog time machine — recover lost commits and see where HEAD has been`,children:`Time Machine`})]}),re.filter(e=>!e.bare).length>1&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`worktree`}),(0,y.jsx)(`select`,{value:ne??``,onChange:e=>{e.target.value&&e.target.value!==ne&&le(e.target.value)},title:`Switch linked worktree`,"aria-label":`Current linked worktree`,style:{maxWidth:220,flexShrink:1,minWidth:90,padding:`3px 5px`,border:`1px solid #313244`,borderRadius:4,outline:`none`,background:`#1e1e2e`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:11},children:re.filter(e=>!e.bare).map(e=>(0,y.jsxs)(`option`,{value:e.path,disabled:e.prunable,children:[vv(e.path),` — `,e.branchShortName??(e.detached?`detached ${e.headSha?.slice(0,8)??``}`:`no branch`)]},e.path))})]}),(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`repo`}),(0,y.jsx)(`form`,{onSubmit:be,style:{display:`flex`,flex:1,minWidth:0},children:(0,y.jsx)(`input`,{ref:w,value:o,onChange:e=>{s(e.target.value),d(!0),xe()},onFocus:e=>{l(!0),d(!1),xe(),e.currentTarget.select()},onBlur:()=>{l(!1),d(!1),p(!1)},onKeyDown:e=>{if(f&&g.length>0){if(e.key===`ArrowDown`){e.preventDefault(),x(e=>(e+1)%g.length);return}if(e.key===`ArrowUp`){e.preventDefault(),x(e=>(e-1+g.length)%g.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),Se(g[v]);return}if(e.key===`Escape`){e.preventDefault(),d(!1),p(!1);return}}e.key===`Escape`&&(s(E??``),e.currentTarget.blur())},"aria-label":`Repository path`,title:`Type a repository path and press Enter to open it`,spellCheck:!1,autoComplete:`off`,role:`combobox`,"aria-expanded":Ce,"aria-controls":`header-repo-path-suggestions`,"aria-autocomplete":`list`,style:{width:`100%`,minWidth:0,padding:`3px 5px`,border:`1px solid ${c?`#89b4fa88`:`transparent`}`,borderRadius:3,outline:`none`,background:c?`#1e1e2e`:`transparent`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12}})}),Ce&&(0,y.jsx)(`div`,{id:`header-repo-path-suggestions`,role:`listbox`,style:{position:`fixed`,zIndex:100,top:S.top,left:S.left,width:S.width,maxHeight:238,overflowY:`auto`,padding:4,border:`1px solid #3d4253`,borderRadius:5,background:`#181825`,boxShadow:`0 8px 24px #00000088`},children:m&&g.length===0?(0,y.jsx)(`div`,{style:{padding:`7px 8px`,color:`#7f849c`,fontSize:11},children:`Loading…`}):g.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===v,onMouseEnter:()=>x(t),onMouseDown:t=>{t.preventDefault(),Se(e)},style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,minWidth:0,padding:`6px 8px`,border:`none`,borderRadius:4,background:t===v?`#313244`:`transparent`,color:`#cdd6f4`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`},children:e.path}),e.isGitRepo&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`repo`})]},e.path))}),(0,y.jsx)(lv,{}),(0,y.jsxs)(`button`,{onClick:ye,disabled:i,title:`Fetch all remotes`,"aria-label":`Fetch all remotes`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:i?`#45475a`:`#6c7086`,fontSize:11,cursor:i?`default`:`pointer`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,animation:i?`spin 0.7s linear infinite`:`none`},children:`⟳`}),i?`Fetching…`:`Fetch`,(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}),(0,y.jsx)(`button`,{onClick:ue,title:`Close repository`,"aria-label":`Close repository`,style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,cursor:`pointer`},children:`Close`})]}),he===`reflog`?(0,y.jsx)(sh,{}):(0,y.jsx)(Vm,{})]}),(0,y.jsx)(Sv,{}),(0,y.jsx)(ov,{error:ce,onDismiss:D}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(mv,{open:!0,onClose:()=>r(!1)})})]})}function xv({onClose:e,onOpenSettings:t,settingsOpen:n}){let{refs:r,stashes:i,selectRef:a,selectStash:o,navigateTo:s,selectedStashSha:c,selectedSha:l}=R(te(e=>({refs:e.refs,stashes:e.stashes,selectRef:e.selectRef,selectStash:e.selectStash,navigateTo:e.navigateTo,selectedStashSha:e.selectedStashSha,selectedSha:e.selectedSha})));return(0,y.jsx)(Hi,{refs:r,stashes:i,onSelectRef:a,onSelectStash:o,onSelectStashParent:e=>{s(e)},selectedStashSha:c,selectedSha:l,onClose:e,onOpenSettings:t,settingsOpen:n})}function Sv(){let{selectedStashSha:e,stashes:t,stashDiff:n,pendingMutation:r,applyStash:i,dropStash:a,navigateTo:o,worktreeSelected:s,selectedSha:c,historyWindow:l,commitDetail:u,commitDiff:d,commitPRs:f,commitAuthorAvatars:p,commitCIStatus:m,githubUrl:h,checkoutSha:g,showError:_}=R(te(e=>({selectedStashSha:e.selectedStashSha,stashes:e.stashes,stashDiff:e.stashDiff,pendingMutation:e.pendingMutation,applyStash:e.applyStash,dropStash:e.dropStash,navigateTo:e.navigateTo,worktreeSelected:e.worktreeSelected,selectedSha:e.selectedSha,historyWindow:e.historyWindow,commitDetail:e.commitDetail,commitDiff:e.commitDiff,commitPRs:e.commitPRs,commitAuthorAvatars:e.commitAuthorAvatars,commitCIStatus:e.commitCIStatus,githubUrl:e.githubUrl,checkoutSha:e.checkoutSha,showError:e.showError}))),v=e?t.find(t=>t.sha===e)??null:null,x=c?m[c]:void 0,S=x?.runs??[],C=(0,b.useMemo)(()=>{if(!c||!l)return null;let e=l.rows,t=new Map(e.map(e=>[e.sha,e]));for(let n of e){if(n.refNames.length===0)continue;let e=n.refNames.find(e=>!e.includes(`/`)),r=n.refNames.find(e=>e.includes(`/`)&&e!==`origin`&&e!==`HEAD`),i=e??r;if(!i)continue;let a=n.sha,o=new Set;for(;a&&!o.has(a);){if(a===c)return i;o.add(a);let e=t.get(a);if(!e||e.parentShas.length===0)break;a=e.parentShas[0]}}return null},[c,l]);return v?(0,y.jsx)(iv,{stash:v,diff:n,busy:r,onApply:i,onDrop:a,onNavigate:e=>{o(e)}}):s?(0,y.jsx)(tv,{}):(0,y.jsx)(H_,{commit:u,diff:d,branchName:C,prs:f,authorAvatarUrl:u?p[u.sha]:void 0,ciState:x?.state,ciRuns:S,githubUrl:h,onNavigate:o,onCheckout:async e=>{try{await g(e)}catch(e){_(`Checkout failed`,e)}}})}function Cv(){return(0,y.jsx)(`div`,{style:{width:32,height:32,border:`3px solid #313244`,borderTopColor:`#89b4fa`,borderRadius:`50%`,animation:`spin 0.7s linear infinite`},children:(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})})}(0,x.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(bv,{})}));export{Xd as a,_f as c,Vd as d,R as f,c as h,rf as i,af as l,u as m,yf as n,Zd as o,f as p,Kd as r,vf as s,Wd as t,gf as u};