codex-supervisor-mcp 0.5.8 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,154 @@
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,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=N(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(ee(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 te(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var P={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(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=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(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=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=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=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),P=Symbol.for(`react.lazy`),oe=Symbol.for(`react.activity`),se=Symbol.for(`react.legacy_hidden`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.for(`react.view_transition`),ue=Symbol.for(`react.recoverable`),de=Symbol.iterator;function fe(e){return typeof e!=`object`||!e?null:(e=de&&e[de]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case ee:return`Profiler`;case M:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case oe:return`Activity`;case le:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case te:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case P:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},ge=[],_e=-1;function ve(e){return{current:e}}function ye(e){0>_e||(e.current=ge[_e],ge[_e]=null,_e--)}function R(e,t){_e++,ge[_e]=e.current,e.current=t}var be=ve(null),xe=ve(null),Se=ve(null),Ce=ve(null);function we(e,t){switch(R(Se,t),R(xe,e),R(be,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ye(be),R(be,e)}function Te(){ye(be),ye(xe),ye(Se)}function Ee(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,R(Ce,e)),t=be.current;var n=_p(t,e.type);t!==n&&(R(xe,e),R(be,n))}function De(e){xe.current===e&&(ye(be),ye(xe)),Ce.current===e&&(ye(Ce),ph._currentValue=he)}var Oe,ke;function Ae(e){if(Oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||``,ke=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+Oe+e+ke}var je=!1;function Me(e,t){if(!e||je)return``;je=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{je=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ae(n):``}function Ne(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae(`Lazy`);case 13:return e.child!==t&&t!==null?Ae(`Suspense Fallback`):Ae(`Suspense`);case 19:return Ae(`SuspenseList`);case 0:case 15:return Me(e.type,!1);case 11:return Me(e.type.render,!1);case 1:return Me(e.type,!0);case 31:return Ae(`Activity`);case 30:return Ae(`ViewTransition`);default:return``}}function Pe(e){try{var t=``,n=null;do t+=Ne(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Fe=Object.prototype.hasOwnProperty,Ie=t.unstable_scheduleCallback,Le=t.unstable_cancelCallback,Re=t.unstable_shouldYield,ze=t.unstable_requestPaint,Be=t.unstable_now,Ve=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,We=t.unstable_NormalPriority,Ge=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,qe=t.log,Je=t.unstable_setDisableYieldValue,Ye=null,Xe=null;function Ze(e){if(typeof qe==`function`&&Je(e),Xe&&typeof Xe.setStrictMode==`function`)try{Xe.setStrictMode(Ye,e)}catch{}}var Qe=Math.clz32?Math.clz32:tt,$e=Math.log,et=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-($e(e)/et|0)|0}var nt=256,rt=262144,it=4194304;function at(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ot(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=at(n))):i=at(o):i=at(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=at(n))):i=at(o)):i=at(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 st(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ct(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Qe(n),i=1<<r;t|=e[r],n&=~i}return t}function lt(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 ut(){var e=it;return it<<=1,!(it&62914560)&&(it=4194304),e}function dt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(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-Qe(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&&mt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function mt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Qe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ht(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function gt(e,t){var n=t&-t;return n=n&42?1:_t(n),(n&(e.suspendedLanes|t))===0?n:0}function _t(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 vt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yt(){var e=L.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function bt(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var xt=Math.random().toString(36).slice(2),St=`__reactFiber$`+xt,Ct=`__reactProps$`+xt,wt=`__reactContainer$`+xt,Tt=`__reactEvents$`+xt,Et=`__reactListeners$`+xt,Dt=`__reactHandles$`+xt,Ot=`__reactResources$`+xt,kt=`__reactMarker$`+xt,At=`__reactLoad$`+xt;function jt(e){delete e[St],delete e[Ct],delete e[Et],delete e[Dt]}function Mt(e){var t;if(t=e[St])return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[St])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Nt(e){if(e=e[St]||e[wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ft(e){var t=e[Ot];return t||=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function It(e){e[kt]=!0}function Lt(e){e[At]=void 0}var Rt=new Set,zt={};function Bt(e,t){Vt(e,t),Vt(e+`Capture`,t)}function Vt(e,t){for(zt[e]=t,e=0;e<t.length;e++)Rt.add(t[e])}var Ht=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]*$`),Ut={},Wt={};function Gt(e){return Fe.call(Wt,e)?!0:Fe.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var z=!1;function Kt(){var e=z;return z=!1,e}function qt(e,t,n){if(Gt(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 Jt(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 Yt(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 Xt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Qt(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 $t(e){if(!e._valueTracker){var t=Zt(e)?`checked`:`value`;e._valueTracker=Qt(e,t,``+e[t])}}function en(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var tn=/[\n"\\]/g;function nn(e){return e.replace(tn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function rn(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=``+Xt(t)):e.value!==``+Xt(t)&&(e.value=``+Xt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):on(e,Xt(n)):o===`number`&&e.value==t?on(e,Xt(e.value)):on(e,Xt(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=``+Xt(s):e.removeAttribute(`name`)}function an(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)){$t(e);return}n=n==null?``:``+Xt(n),t=t==null?n:``+Xt(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),$t(e)}function on(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function sn(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=``+Xt(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 cn(e,t,n){if(t!=null&&(t=``+Xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Xt(n)}function ln(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Xt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),$t(e)}function un(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dn=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 fn(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||dn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function pn(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]=``,z=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(fn(e,a,r),z=!0)}else for(var o in t)t.hasOwnProperty(o)&&fn(e,o,t[o])}function mn(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 hn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),gn=/^[\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 _n(e){return gn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function vn(){}var yn=null;function bn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xn=null,Sn=null;function B(e){var t=Nt(e);if(t&&(e=t.stateNode)){var n=e[Ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(rn(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="`+nn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ct]||null;if(!a)throw Error(i(90));rn(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&&en(r)}break a;case`textarea`:cn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&sn(e,!!n.multiple,t,!1)}}}var Cn=!1;function wn(e,t,n){if(Cn)return e(t,n);Cn=!0;try{return e(t)}finally{if(Cn=!1,(xn!==null||Sn!==null)&&(Gd(),xn&&(t=xn,e=Sn,Sn=xn=null,B(t),e)))for(t=0;t<e.length;t++)B(e[t])}}function Tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ct]||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 En=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Dn=!1;if(En)try{var On={};Object.defineProperty(On,"passive",{get:function(){Dn=!0}}),window.addEventListener(`test`,On,On),window.removeEventListener(`test`,On,On)}catch{Dn=!1}var kn=null,An=null,jn=null;function Mn(){if(jn)return jn;var e,t=An,n=t.length,r,i=`value`in kn?kn.value:kn.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 jn=i.slice(e,1<r?1-r:void 0)}function Nn(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 Pn(){return!0}function Fn(){return!1}function In(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)?Pn:Fn,this.isPropagationStopped=Fn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Pn)},persist:function(){},isPersistent:Pn}),t}var Ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rn=In(Ln),zn=D({},Ln,{view:0,detail:0}),Bn=In(zn),Vn,Hn,Un,Wn=D({},zn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tr,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!==Un&&(Un&&e.type===`mousemove`?(Vn=e.screenX-Un.screenX,Hn=e.screenY-Un.screenY):Hn=Vn=0,Un=e),Vn)},movementY:function(e){return`movementY`in e?e.movementY:Hn}}),Gn=In(Wn),Kn=In(D({},Wn,{dataTransfer:0})),qn=In(D({},zn,{relatedTarget:0})),Jn=In(D({},Ln,{animationName:0,elapsedTime:0,pseudoElement:0})),Yn=In(D({},Ln,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Xn=In(D({},Ln,{data:0})),Zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Qn={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`},$n={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function er(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$n[e])?!!t[e]:!1}function tr(){return er}var nr=In(D({},zn,{key:function(e){if(e.key){var t=Zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Nn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tr,charCode:function(e){return e.type===`keypress`?Nn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Nn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),rr=In(D({},Wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ir=In(D({},Ln,{submitter:0})),ar=In(D({},zn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tr})),or=In(D({},Ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),sr=In(D({},Wn,{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})),cr=In(D({},Ln,{newState:0,oldState:0,source:0})),lr=[9,13,27,32],ur=En&&`CompositionEvent`in window,dr=null;En&&`documentMode`in document&&(dr=document.documentMode);var fr=En&&`TextEvent`in window&&!dr,pr=En&&(!ur||dr&&8<dr&&11>=dr),mr=` `,hr=!1;function gr(e,t){switch(e){case`keyup`:return lr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function _r(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var vr=!1;function yr(e,t){switch(e){case`compositionend`:return _r(t);case`keypress`:return t.which===32?(hr=!0,mr):null;case`textInput`:return e=t.data,e===mr&&hr?null:e;default:return null}}function br(e,t){if(vr)return e===`compositionend`||!ur&&gr(e,t)?(e=Mn(),jn=An=kn=null,vr=!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 pr&&t.locale!==`ko`?null:t.data;default:return null}}var xr={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 Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!xr[e.type]:t===`textarea`}function Cr(e,t,n,r){xn?Sn?Sn.push(r):Sn=[r]:xn=r,t=ep(t,`onChange`),0<t.length&&(n=new Rn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var wr=null,Tr=null;function Er(e){qf(e,0)}function Dr(e){if(en(Pt(e)))return e}function Or(e,t){if(e===`change`)return t}var kr=!1;if(En){var Ar;if(En){var jr=`oninput`in document;if(!jr){var Mr=document.createElement(`div`);Mr.setAttribute(`oninput`,`return;`),jr=typeof Mr.oninput==`function`}Ar=jr}else Ar=!1;kr=Ar&&(!document.documentMode||9<document.documentMode)}function Nr(){wr&&(wr.detachEvent(`onpropertychange`,Pr),Tr=wr=null)}function Pr(e){if(e.propertyName===`value`&&Dr(Tr)){var t=[];Cr(t,Tr,e,bn(e)),wn(Er,t)}}function Fr(e,t,n){e===`focusin`?(Nr(),wr=t,Tr=n,wr.attachEvent(`onpropertychange`,Pr)):e===`focusout`&&Nr()}function Ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Dr(Tr)}function Lr(e,t){if(e===`click`)return Dr(t)}function Rr(e,t){if(e===`input`||e===`change`)return Dr(t)}function zr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Br=typeof Object.is==`function`?Object.is:zr;function Vr(e,t){if(Br(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(!Fe.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function Hr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wr(e,t){var n=Ur(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=Ur(n)}}function Gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(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=Hr(e.document)}return t}function qr(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 Jr=En&&`documentMode`in document&&11>=document.documentMode,Yr=null,Xr=null,Zr=null,Qr=!1;function $r(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qr||Yr==null||Yr!==Hr(r)||(r=Yr,`selectionStart`in r&&qr(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}),Zr&&Vr(Zr,r)||(Zr=r,r=ep(Xr,`onSelect`),0<r.length&&(t=new Rn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Yr)))}function ei(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ti={animationend:ei(`Animation`,`AnimationEnd`),animationiteration:ei(`Animation`,`AnimationIteration`),animationstart:ei(`Animation`,`AnimationStart`),transitionrun:ei(`Transition`,`TransitionRun`),transitionstart:ei(`Transition`,`TransitionStart`),transitioncancel:ei(`Transition`,`TransitionCancel`),transitionend:ei(`Transition`,`TransitionEnd`)},ni={},ri={};En&&(ri=document.createElement(`div`).style,`AnimationEvent`in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),`TransitionEvent`in window||delete ti.transitionend.transition);function ii(e){if(ni[e])return ni[e];if(!ti[e])return e;var t=ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ri)return ni[e]=t[n];return e}var ai=ii(`animationend`),oi=ii(`animationiteration`),si=ii(`animationstart`),ci=ii(`transitionrun`),li=ii(`transitionstart`),ui=ii(`transitioncancel`),di=ii(`transitionend`),fi=new Map,pi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);pi.push(`scrollEnd`);function mi(e,t){fi.set(e,t),Bt(t,[e])}var hi=0;function gi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ed.identifierPrefix;var n=hi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function _i(e){if(e==null||typeof e==`string`)return e;var t=null,n=Pd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function vi(e,t){return e=_i(e),t=_i(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var yi=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)},bi=[],xi=0,Si=0;function Ci(){for(var e=xi,t=Si=xi=0;t<e;){var n=bi[t];bi[t++]=null;var r=bi[t];bi[t++]=null;var i=bi[t];bi[t++]=null;var a=bi[t];if(bi[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&&Di(n,i,a)}}function wi(e,t,n,r){bi[xi++]=e,bi[xi++]=t,bi[xi++]=n,bi[xi++]=r,Si|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ti(e,t,n,r){return wi(e,t,n,r),Oi(e)}function Ei(e,t){return wi(e,null,null,t),Oi(e)}function Di(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-Qe(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<Fd)throw Fd=0,Id=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ki={};function Ai(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 ji(e,t,n,r){return new Ai(e,t,n,r)}function Mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ni(e,t){var n=e.alternate;return n===null?(n=ji(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Pi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Mi(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,be.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case oe:return e=ji(31,n,t,a),e.elementType=oe,e.lanes=o,e;case j:return Ii(n.children,a,o,t);case M:s=8,a|=24;break;case ee:return e=ji(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case re:return e=ji(13,n,t,a),e.elementType=re,e.lanes=o,e;case ie:return e=ji(19,n,t,a),e.elementType=ie,e.lanes=o,e;case se:case le:return e=a|32,e=ji(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case te:s=10;break a;case N:s=9;break a;case ne:s=11;break a;case ae:s=14;break a;case P:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ji(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ii(e,t,n,r){return e=ji(7,e,r,t),e.lanes=n,e}function Li(e,t,n){return e=ji(6,e,null,t),e.lanes=n,e}function Ri(e){var t=ji(18,null,null,0);return t.stateNode=e,t}function zi(e,t,n){return t=ji(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bi=new WeakMap;function Vi(e,t){if(typeof e==`object`&&e){var n=Bi.get(e);return n===void 0?(t={value:e,source:t,stack:Pe(t)},Bi.set(e,t),t):n}return{value:e,source:t,stack:Pe(t)}}var Hi=[],Ui=0,Wi=null,Gi=0,Ki=[],qi=0,Ji=null,Yi=1,Xi=``;function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Wi,Wi=e,Gi=t}function Qi(e,t,n){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Ji=e;var r=Yi;e=Xi;var i=32-Qe(r)-1;r&=~(1<<i),n+=1;var a=32-Qe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yi=1<<32-Qe(t)+i|n<<i|r,Xi=a+e}else Yi=1<<a|n<<i|r,Xi=e}function $i(e){e.return!==null&&(Zi(e,1),Qi(e,1,0))}function ea(e){for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null;for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Xi=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null}function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Yi=t.id,Xi=t.overflow,Ji=e}var na=null,ra=null,V=!1,ia=null,aa=!1,oa=Error(i(519));function sa(e){throw pa(Vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),oa}function ca(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Ct]=r,n){case`dialog`:K(`cancel`,t),K(`close`,t);break;case`iframe`:case`object`:case`embed`:K(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)K(Gf[n],t);break;case`source`:K(`error`,t);break;case`img`:case`image`:case`link`:K(`error`,t),K(`load`,t);break;case`details`:K(`toggle`,t);break;case`input`:K(`invalid`,t),an(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:K(`invalid`,t);break;case`textarea`:K(`invalid`,t),ln(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||op(t.textContent,n)?(r.popover!=null&&(K(`beforetoggle`,t),K(`toggle`,t)),r.onScroll!=null&&K(`scroll`,t),r.onScrollEnd!=null&&K(`scrollend`,t),r.onClick!=null&&(t.onclick=vn),t=!0):t=!1,t||sa(e,!0)}function la(e){for(na=e.return;na;)switch(na.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:na=na.return}}function ua(e){if(e!==na)return!1;if(!V)return la(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&ra&&sa(e),la(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=_m(e)}else t===27?(t=ra,Op(e.type)?(e=gm,gm=null,ra=e):ra=t):ra=na?hm(e.stateNode.nextSibling):null;return!0}function da(){ra=na=null,V=!1}function fa(){var e=ia;return e!==null&&(vd===null?vd=e:vd.push.apply(vd,e),ia=null),e}function pa(e){ia===null?ia=[e]:ia.push(e)}var ma=ve(null),ha=null,ga=null;function _a(e,t,n){R(ma,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ma.current,ye(ma)}function ya(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 ba(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),ya(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),ya(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ya(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function xa(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;Br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&ba(t,e,n,r),t.flags|=262144,e!==null}function Sa(e){for(e=e.firstContext;e!==null;){if(!Br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ca(e){ha=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wa(e){return Ea(ha,e)}function Ta(e,t){return ha===null&&Ca(e),Ea(e,t)}function Ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ga===null){if(e===null)throw Error(i(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return n}var Da=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()})}},Oa=t.unstable_scheduleCallback,ka=t.unstable_NormalPriority,Aa={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ja(){return{controller:new Da,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Oa(ka,function(){e.controller.abort()})}function Na(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Pa=null;function Fa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ia=null,La=0,Ra=0,za=null;function Ba(e,t){if(Ia===null){var n=Ia=[];La=0,Ra=Bf(),za={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return La++,t.then(Va,Va),t}function Va(){if(--La===0&&(Pa=null,Ia!==null)){za!==null&&(za.status=`fulfilled`);var e=Ia;Ia=null,Ra=0,za=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ha(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 Ua=I.S;I.S=function(e,t){if(xd=Be(),typeof t==`object`&&t&&typeof t.then==`function`&&Ba(e,t),Pa!==null)for(var n=Df;n!==null;)Na(n,Pa),n=n.next;if(n=e.types,n!==null){for(var r=Df;r!==null;)Na(r,n),r=r.next;if(Ra!==0){r=Pa,r===null&&(r=Pa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ua!==null&&Ua(e,t)};var Wa=ve(null);function Ga(){var e=Wa.current;return e===null?id.pooledCache:e}function Ka(e,t){t===null?R(Wa,Wa.current):R(Wa,t.pool)}function qa(){var e=Ga();return e===null?null:{parent:Aa._currentValue,pool:e}}var Ja=Error(i(460)),Ya=Error(i(474)),Xa=Error(i(542)),Za={then:function(){}};function Qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function $a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(vn,vn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(vn,vn);else{if(e=id,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,ro(e),e}throw to=t,Ja}}function eo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(to=e,Ja):e}}var to=null;function no(){if(to===null)throw Error(i(459));var e=to;return to=null,e}function ro(e){if(e===Ja||e===Xa)throw Error(i(483))}var io=null,ao=0;function oo(e){var t=ao;return ao+=1,io===null&&(io=[]),$a(io,e,t)}function so(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function co(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function lo(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=Ni(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),so(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===P&&eo(i)===t.type)?(t=a(t,n.props),so(t,n),t.return=e,t):(t=Fi(n.type,n.key,n.props,null,e.mode,r),so(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=zi(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=Ii(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=Li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Fi(t.type,t.key,t.props,null,e.mode,n),so(n,t),n.return=e,n;case A:return t=zi(t,e.mode,n),t.return=e,t;case P:return t=eo(t),f(e,t,n)}if(F(t)||fe(t))return t=Ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,oo(t),n);if(t.$$typeof===te)return f(e,Ta(e,t),n);co(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case P:return n=eo(n),p(e,t,n,r)}if(F(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,oo(n),r);if(n.$$typeof===te)return p(e,t,Ta(e,n),r);co(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case P:return r=eo(r),m(e,t,n,r,i)}if(F(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,oo(r),i);if(r.$$typeof===te)return m(e,t,n,Ta(t,r),i);co(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),V&&Zi(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 V&&Zi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Zi(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),V&&Zi(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 V&&Zi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),V&&Zi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),so(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===P&&eo(l)===r.type){n(e,r.sibling),c=a(r,o.props),so(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ii(o.props.children,e.mode,c,o.key),so(c,o),c.return=e,e=c):(c=Fi(o.type,o.key,o.props,null,e.mode,c),so(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=zi(o,e.mode,c),c.return=e,e=c}return s(e);case P:return o=eo(o),_(e,r,o,c)}if(F(o))return h(e,r,o,c);if(fe(o)){if(l=fe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,oo(o),c);if(o.$$typeof===te)return _(e,r,Ta(e,o),c);co(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=Li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ao=0;var i=_(e,t,n,r);return io=null,i}catch(t){if(t===Ja||t===Xa)throw t;var a=ji(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var uo=lo(!0),fo=lo(!1),po=!1;function mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ho(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 go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _o(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,rd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Oi(e),Di(e,null,n),t}return wi(e,r,t,n),Oi(e)}function vo(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,ht(e,n)}}function yo(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 bo=!1;function xo(){if(bo){var e=za;if(e!==null)throw e}}function So(e,t,n,r){bo=!1;var i=e.updateQueue;po=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(W&f)===f:(r&f)===f){f!==0&&f===Ra&&(bo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:po=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),fd|=o,e.lanes=o,e.memoizedState=d}}function Co(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function wo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Co(n[e],t)}var To=ve(null),Eo=ve(0);function Do(e,t){e=ud,R(Eo,e),R(To,t),ud=e|t.baseLanes}function Oo(){R(Eo,ud),R(To,To.current)}function ko(){ud=Eo.current,ye(To),ye(Eo)}var Ao=ve(null),jo=null;function Mo(e){var t=e.alternate;R(Lo,Lo.current&1),R(Ao,e),jo===null&&(t===null||To.current!==null||t.memoizedState!==null)&&(jo=e)}function No(e){R(Lo,Lo.current),R(Ao,e),jo===null&&(jo=e)}function Po(e){e.tag===22?(R(Lo,Lo.current),R(Ao,e),jo===null&&(jo=e)):Fo()}function Fo(){R(Lo,Lo.current),R(Ao,Ao.current)}function Io(e){ye(Ao),jo===e&&(jo=null),ye(Lo)}var Lo=ve(0);function Ro(e,t){R(Ao,Ao.current),R(Lo,t)}function zo(e){ye(Lo),ye(Ao),jo===e&&(jo=null)}function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vo=0,H=null,Ho=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Br(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Vo=a,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){I.H=hc;var t=Ho!==null&&Ho.next!==null;if(Vo=0,Uo=Ho=H=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&Sa(e)&&(Pc=!0))}function ts(e,t,n,r){H=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=Ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=vc,o=t(n,r)}while(Go);return o}function ns(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(Ho===null?null:Ho.memoizedState)!==e&&(H.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Vo=0,Uo=Ho=H=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?H.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(Ho===null){var e=H.alternate;e=e===null?null:e.memoizedState}else e=Ho.next;var t=Uo===null?H.memoizedState:Uo.next;if(t!==null)Uo=t,Ho=e;else{if(e===null)throw H.alternate===null?Error(i(467)):Error(i(310));Ho=e,e={memoizedState:Ho.memoizedState,baseState:Ho.baseState,baseQueue:Ho.baseQueue,queue:Ho.queue,next:null},Uo===null?H.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=$a(Yo,e,t),t=H,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===ue)return;if(e.$$typeof===te)return wa(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=H.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=cs(),H.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]=ce;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),Ho,e)}function ms(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?(Vo&f)===f:(W&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===Ra&&(d=!0);else if((Vo&p)===p){u=u.next,p===Ra&&(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,H.lanes|=p,fd|=p;f=u.action,Ko&&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,H.lanes|=f,fd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Br(o,e.memoizedState)&&(Pc=!0,d&&(n=za,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 hs(e){var t=ss(),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);Br(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=H,a=ss(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Br((Ho||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Vs(ys.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,id===null)throw Error(i(349));o||Vo&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=cs(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Br(e,n)}catch{return!0}}function xs(e){var t=Ei(e,2);t!==null&&Bd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){Ze(!0);try{n()}finally{Ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,Ho,typeof r==`function`?r:fs)}function ws(e,t,n,r,a){if(fc(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)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};o.types=a===null?null:a.types,I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(V){var n=id.formState;if(n!==null){a:{var r=H;if(V){if(ra){b:{for(var i=ra,a=aa;i.nodeType!==8;){if(!a){i=null;break b}if(i=hm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ra=hm(i.nextSibling),r=i.data===`F!`;break a}}sa(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,H,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,H,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,H,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),Ho,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Ja?Xa:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(H.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ss(),n=Ho;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=H.updateQueue,t===null&&(t=cs(),H.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 Ls(){return ss().memoizedState}function Rs(e,t,n,r){var i=os();H.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;Ho!==null&&r!==null&&Qo(r,Ho.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(H.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=cs(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(rd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(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 qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Vo&1073741824&&!(W&261930)?e.memoizedState=t:(e.memoizedState=n,e=Rd(),H.lanes|=e,fd|=e,n)}function Qs(e,t,n,r){return Br(n,t)?n:To.current===null?!(Vo&106)||Vo&1073741824&&!(W&261930)?(Pc=!0,e.memoizedState=n):(e=Rd(),H.lanes|=e,fd|=e,t):(e=Zs(e,n,r),Br(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};s.types=o===null?null:o.types,I.T=s,dc(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ha(c,r),Ld(e)):uc(e,t,r,Ld(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Ld())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,he,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:he},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Ld())}function ic(){return wa(ph)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ld();e=go(n);var r=_o(t,e,n);r!==null&&(Bd(r,t,n),vo(r,t,n)),t={cache:ja()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Ld();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Ti(e,t,n,r),n!==null&&(Bd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Ld())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(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,Br(s,o))return wi(e,t,i,0),id===null&&Ci(),!1}catch{}if(n=Ti(e,t,i,r),n!==null)return Bd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=Ti(e,n,r,2),t!==null&&Bd(t,e,2)}function fc(e){var t=e.alternate;return e===H||t!==null&&t===H}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ht(e,n)}}var hc={readContext:wa,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:wa,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Ze(!0);try{n(t)}finally{Ze(!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=cc.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,H,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,a=os();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),id===null)throw Error(i(349));W&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=id.identifierPrefix;if(V){var n=Xi,r=Yi;n=(r&~(1<<32-Qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,H)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(rd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ss(),Ho.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(ss(),Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ss();return Ho===null?Zs(n,e,t):Qs(n,Ho.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ss();return Ho===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=go(r);i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Bd(t,e,r),vo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=go(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Bd(t,e,r),vo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ld(),r=go(n);r.tag=2,t!=null&&(r.callback=t),t=_o(e,r,n),t!==null&&(Bd(t,e,n),vo(t,e,n))}};function xc(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?!Vr(n,r)||!Vr(i,a):!0}function Sc(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&&bc.enqueueReplaceState(t,t.state,null)}function Cc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){yi(e)}function Tc(e){console.error(e)}function Ec(e){yi(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(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 kc(e,t,n){return n=go(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=go(e),e.tag=3,e}function jc(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(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(wd===null?wd=new Set([this]):wd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&xa(t,n,a,!0),n=Ao.current,n!==null){switch(n.tag){case 31:case 13:case 19:return jo===null?Qd():n.alternate===null&&dd===0&&(dd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),xf(e,r,a)),!1;case 22:return n.flags|=65536,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),xf(e,r,a)),!1}throw Error(i(435,n.tag))}return xf(e,r,a),Qd(),!1}if(V)return t=Ao.current,t===null?(r!==oa&&(t=Error(i(423),{cause:r}),pa(Vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Vi(r,n),a=kc(e.stateNode,r,a),yo(e,a),dd!==4&&(dd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==oa&&(e=Error(i(422),{cause:r}),pa(Vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Vi(o,n),_d===null?_d=[o]:_d.push(o),dd!==4&&(dd=2),t===null)return!0;r=Vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),yo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(wd===null||!wd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),yo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?fo(t,null,n,r):uo(t,e.child,n,r)}function Ic(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 Ca(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(V&&s&&$i(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Vr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Vr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(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 Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ka(t,a===null?null:a.cachePool),a===null?Oo():Do(t,a),Po(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ka(t,null),Oo(),Fo()):(Ka(t,a.cachePool),Do(t,a),Fo(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Ga();return a=a===null?null:{parent:Aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ka(t,null),Oo(),Po(t),e!==null&&xa(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return uo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Io(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(No(t),(e=ra)?(e=dm(e,aa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(No(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||xa(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(To.current===null){if(r=id,r!==null&&(s=gt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ei(e,s),Bd(r,e,s),Nc;Qd()}t=Uc(e,t,n)}else e=o.treeContext,ra=hm(s.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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 Kc(e,t,n,r,i){return Ca(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(V&&r&&$i(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ca(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(V&&r&&$i(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ca(t),t.stateNode===null){var a=ki,o=n.contextType;typeof o==`object`&&o&&(a=wa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},mo(t),o=n.contextType,a.context=typeof o==`object`&&o?wa(o):ki,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(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&&bc.enqueueReplaceState(a,a.state,null),So(t,r,a,i),xo(),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=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ki,typeof u==`object`&&u&&(o=wa(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)&&Sc(t,a,r,o),po=!1;var f=t.memoizedState;a.state=f,So(t,r,a,i),xo(),l=t.memoizedState,s||f!==l||po?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=po||xc(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,ho(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ki,typeof l==`object`&&l&&(c=wa(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)&&Sc(t,a,r,c),po=!1,f=t.memoizedState,a.state=f,So(t,r,a,i),xo();var p=t.memoizedState;o!==d||f!==p||po||e!==null&&e.dependencies!==null&&Sa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=po||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Sa(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,Gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=uo(t,e.child,null,i),t.child=uo(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return da(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:qa()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=hd),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Lo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(V){if(i?Mo(t):Fo(),(e=ra)?(e=dm(e,aa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Fo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Ii(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(Mo(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Fo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ni(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ii(i,a,n,null),i.flags|=2):i=Ni(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=qa():(s=Aa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=Ni(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=ji(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return uo(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Mo(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Fo(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=Ii(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,uo(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,a)):(Fo(),t.child=e.child,t.flags|=128,null);if(Mo(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,pa({value:a,source:null,stack:null})),nl(e,t,c)}if(Pc||xa(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(To.current!==null)return nl(e,t,c);if(r=id,r!==null&&(a=gt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ei(e,a),Bd(r,e,a),Nc;return fm(o)||Qd(),nl(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ra=hm(o.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ya(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Bo(n)===null&&(t=e),e=e.sibling}return t}function ol(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 sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Lo.current;if(t.flags&128)return Ro(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ro(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=V?Gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return _a(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(xa(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=Ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Sa(e)))}function fl(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),_a(t,Aa,e.memoizedState.cache),da();break;case 27:case 5:Ee(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Mo(t),t.flags|=128,null;r=xa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Mo(t),e=ul(e,t,n),e===null?null:e.sibling)}Mo(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(xa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ro(t,Lo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:_a(t,Aa,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,V&&t.flags&1048576&&Qi(t,Gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=eo(t.elementType),t.type=e,typeof e==`function`)Mi(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ne){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===te){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ho(e,t),So(t,r,null,n);var s=t.memoizedState;if(r=s.cache,_a(t,Aa,r),r!==o.cache&&ba(t,[Aa],n,!0),xo(),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=Yc(e,t,r,n);break a}if(r!==a){a=Vi(Error(i(424)),t),pa(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ra=hm(e.firstChild),na=t,V=!0,ia=null,aa=!0,n=fo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(da(),r===a){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(t.stateNode=vp(t.type,t.pendingProps,Se.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&V&&(r=t.stateNode=xm(t.type,t.pendingProps,Se.current),na=t,aa=!0,a=ra,Op(t.type)?(gm=a,ra=hm(r.firstChild)):ra=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=ra)&&(r=lm(r,t.type,t.pendingProps,aa),r===null?a=!1:(t.stateNode=r,na=t,ra=hm(r.firstChild),aa=!1,a=!0)),a||sa(t)),Ee(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(a,o)?r=null:s!==null&&yp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),ph._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=ra)&&(n=um(n,t.pendingProps,aa),n===null?e=!1:(t.stateNode=n,na=t,ra=null,e=!0)),e||sa(t)),null;case 13:return $c(e,t,n);case 4:return we(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ca(t),a=wa(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ca(t),r=wa(Aa),e===null?(a=Ga(),a===null&&(a=id,o=ja(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},mo(t),_a(t,Aa,a)):((e.lanes&n)!==0&&(ho(e,t),So(t,null,null,n),xo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,_a(t,Aa,r),r!==a.cache&&ba(t,[Aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),_a(t,Aa,r))),Fc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:V&&$i(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Yd())e.flags|=8192;else throw to=Za,Ya}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(Yd())e.flags|=8192;else throw to=Za,Ya}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ut(),e.lanes|=t,gd|=t)}function vl(e,t){if(!V)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ea(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),va(Aa),Te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ua(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fa())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(De(t),n=Se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=be.current,ua(t)?ca(t,e):(e=xm(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(De(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=be.current,ua(t))ca(t,o);else{var s=hp(Se.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[St]=t,o[Ct]=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(lp(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&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Se.current,ua(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=na,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[St]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||sa(t,!0)}else e=hp(e).createTextNode(r),e[St]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ua(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[St]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Io(t),t):(Io(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ua(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[St]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Io(t),t):(Io(t),null)}return Io(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),_l(t,t.updateQueue),yl(t),null);case 4:return Te(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return va(t.type),yl(t),null;case 19:if(zo(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(dd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pi(n,e),n=n.sibling;return Ro(t,Lo.current&1|2),V&&Zi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Be()>Sd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Bo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!V)return yl(t),null}else 2*Be()-r.renderingStartTime>Sd&&n!==536870912&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Be(),e.sibling=null,o=Lo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||V?Ro(t,o):(n=o,R(Ao,t),R(Lo,n),jo===null&&(jo=t)),V&&Zi(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Io(t),ko(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(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&&ye(Wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Aa),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ea(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Aa),Te(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return De(t),null;case 31:if(t.memoizedState!==null){if(Io(t),t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Te(),null;case 10:return va(t.type),null;case 22:case 23:return Io(t),ko(),e!==null&&ye(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Aa),null;case 25:return null;default:return null}}function Sl(e,t){switch(ea(t),t.tag){case 3:va(Aa),Te();break;case 26:case 27:case 5:De(t);break;case 4:Te();break;case 31:t.memoizedState!==null&&Io(t);break;case 13:Io(t);break;case 19:zo(t);break;case 10:va(t.type);break;case 22:case 23:Io(t),ko(),e!==null&&ye(Wa);break;case 24:va(Aa)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){bf(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){bf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){bf(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wo(t,n)}catch(t){bf(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){bf(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=gi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);h(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){bf(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){bf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){bf(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&om(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&sm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){bf(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;dp(r,e.type,n,t),r[Ct]=t}catch(t){bf(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(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&&Op(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 Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vn)),kl(e,r),z=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),z=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lp(t,r,n),t[St]=e,t[Ct]=n}catch(t){bf(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Vl=!0,jp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=vi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=gi(r,n),a=vi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||zd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=vi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,zd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=vi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?zd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),zd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode);t=vi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Pp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&jp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=gi(n,r),a=vi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||zd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,su=!1,cu=!1,lu=!1,uu=typeof WeakSet==`function`?WeakSet:Set,du=null,fu=!1,pu=!1,mu=!1,hu=!1;function gu(e,t,n){if(e=e.containerInfo,pp=Sh,e=Kr(e),qr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,du=t,t=n?9270:1024;du!==null;){if(e=du,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),_u(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),_u(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),_u(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,du=r):(n&&eu(e),_u(n))}}Hl=null}function _u(e){for(;du!==null;){var t=du,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){bf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=gi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=vi(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,du=r;break}du=t.return}}function vu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&Cl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){bf(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){bf(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Ru(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{wo(e,t)}catch(e){bf(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Du(e,n);break;case 13:Ru(e,n),r&4&&Ou(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=wf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||su;t=ou,i=su,ou=r,(su=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),ou=t,su=i}break;case 30:Ru(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Ru(e,n)}}function yu(e,t){for(e=e.child;e!==null;)bu(e,t),e=e.sibling}function bu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){bf(e,e.return,t)}xu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,z=!0}catch(t){bf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){bf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&yu(e,t);break;default:yu(e,t)}}function xu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:bu(n,r);break a;case 22:n.memoizedState===null&&xu(n,r);break a;default:xu(n,r)}}e=e.sibling}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jt(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 Cu=null,wu=!1;function Tu(e,t,n){for(n=n.child;n!==null;)Eu(e,t,n),n=n.sibling}function Eu(e,t,n){if(Xe&&typeof Xe.onCommitFiberUnmount==`function`)try{Xe.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:su||Ol(n,t),Tu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!su&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:su||Ol(n,t),jl(n);var r=Cu,i=wu;Op(n.type)&&(Cu=n.stateNode,wu=!1),Tu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),Cu=r,wu=i;break;case 5:su||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Cu,i=wu,Cu=null,Tu(e,t,n),Cu=r,wu=i,Cu!==null){if(wu)try{(Cu.nodeType===9?Cu.body:Cu.nodeName===`HTML`?Cu.ownerDocument.body:Cu).removeChild(n.stateNode),z=!0}catch(e){bf(n,t,e)}else try{Cu.removeChild(n.stateNode),z=!0}catch(e){bf(n,t,e)}}break;case 18:Cu!==null&&(wu?(e=Cu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(Cu,n.stateNode));break;case 4:r=Cu,i=wu,Cu=n.stateNode.containerInfo,wu=!0,Tu(e,t,n),Cu=r,wu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),su||wl(4,n,t),Tu(e,t,n);break;case 1:su||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),Tu(e,t,n);break;case 21:Tu(e,t,n);break;case 22:su=(r=su)||n.memoizedState!==null,Tu(e,t,n),su=r;break;case 30:Ol(n,t),Tu(e,t,n);break;case 7:su||Ol(n,t),Tu(e,t,n);break;default:Tu(e,t,n)}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){bf(t,t.return,e)}}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){bf(t,t.return,e)}}function ku(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uu),t;default:throw Error(i(435,e.tag))}}function Au(e,t){var n=ku(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Tf.bind(null,e,t);t.then(r,r)}})}function ju(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){Cu=l.stateNode,wu=!1;break a}break;case 5:Cu=l.stateNode,wu=!1;break a;case 3:case 4:Cu=l.stateNode.containerInfo,wu=!0;break a}l=l.return}if(Cu===null)throw Error(i(160));Eu(s,c,o),Cu=null,wu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var Mu=null;function Nu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ju(t,e,n),Pu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Mu,ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=vp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[kt]||r[St]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),lp(r,t,n),r[St]=e,It(r),t=r;break a;case`link`:if(o=Zm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[St]=e,It(r),t=r}e.stateNode=t}}else ou||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||su||t.parentNode.removeChild(t)):a.count--,n===null?ou||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=cu,cu=!1,ju(t,e,n),cu=o,Pu(e),a&512&&(su||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{un(t,``),z=!0}catch(t){bf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(lu=!0);break;case 6:if(ju(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,z=!0}catch(t){bf(e,e.return,t)}}break;case 3:if(z=!1,Xm=null,o=Mu,Mu=Em(t.containerInfo),ju(t,e,n),Mu=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){bf(e,e.return,t)}lu&&(lu=!1,Fu(e)),z=!1;break;case 4:a=cu,cu=ou,r=Kt(),o=Mu,Mu=Em(e.stateNode.containerInfo),ju(t,e,n),Pu(e),Mu=o,z&&pu&&(mu=!0),z=r,cu=a;break;case 12:ju(t,e,n),Pu(e);break;case 31:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 13:ju(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(bd=Be()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=su,u=cu;ou=c||o,cu=u||o,su=l||s,ju(t,e,n),su=l,cu=u,ou=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||su||(t=s||su,n=ou,r=su,ou=o||ou,su=t,zu(e,2),ou=n,su=r),!o&&cu||yu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Au(e,n))));break;case 19:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 30:a&512&&(su||r===null||Ol(r,r.return)),a=Kt(),o=pu,s=(n&335544064)===n,c=e.memoizedProps,pu=s&&vi(c.default,c.update)!==`none`,ju(t,e,n),Pu(e),s&&r!==null&&z&&(e.flags|=4),pu=o,z=a;break;case 21:break;case 7:a&512&&(su||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ju(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(un(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){bf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else au(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(hu=fu=!1,Gl(),Iu(t,e),!fu&&!mu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),hu=!0}Wl=null;break;case 5:Iu(t,e);break;case 4:r=fu,fu=!1,Iu(t,e),fu&&(mu=!0),fu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Zl(e,!1));break;case 30:r=fu,i=Gl(),fu=!1,Iu(t,e),fu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=gi(a,o),o=gi(n.memoizedProps,o);var s=vi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(zd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),fu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),zu(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),zu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),zu(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||su||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:Ol(n,n.return),zu(n,r);break;case 7:Ol(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Bu(i,a,n),Cl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){bf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Co(l[i],c)}catch(e){bf(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Qm(Em(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Du(i,a);break;case 13:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Dl(a,a.return);break;case 30:Bu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(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&&Ma(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&hu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ma(a)));break;case 12:if(a&2048){Uu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){bf(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Gu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(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:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Mu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Mu;Mu=Em(e.stateNode.containerInfo),Ju(e,t,n),Mu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(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 Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;du!==null;){var n=du;switch(n.tag){case 0:case 11:case 15:wl(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:Ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,du=r;else a:for(n=e;du!==null;){r=du;var i=r.sibling,a=r.return;if(Su(r),r===n){du=null;break a}if(i!==null){i.return=a,du=i;break a}du=a}}}var td={getCacheForType:function(e){var t=wa(Aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return wa(Aa).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,rd=0,id=null,U=null,W=0,ad=0,od=null,sd=!1,cd=!1,ld=!1,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=null,vd=null,yd=!1,bd=0,xd=0,Sd=1/0,Cd=null,wd=null,Td=0,Ed=null,Dd=null,Od=0,kd=0,Ad=null,jd=null,Md=null,Nd=null,Pd=null,Fd=0,Id=null;function Ld(){return rd&2&&W!==0?W&-W:I.T===null?yt():Bf()}function Rd(){if(hd===0){if(!(W&536870912)||V){var e=rt;rt<<=1,!(rt&3932160)&&(rt=262144),hd=e}else hd=536870912}return e=Ao.current,e!==null&&(e.flags|=32),hd}function zd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(gi(e.memoizedProps,n))),Nd===null&&(Nd=[]),Nd.push(t.bind(null,r))}}function Bd(e,t,n){(e===id&&(ad===2||ad===9)||e.cancelPendingCommit!==null)&&(qd(e,0),Wd(e,W,hd,!1)),ft(e,n),(!(rd&2)||e!==id)&&(e===id&&(!(rd&2)&&(pd|=n),dd===4&&Wd(e,W,hd,!1)),Mf(e))}function Vd(e,t,n){if(rd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||st(e,t),a=r?tf(e,t):$d(e,t,!0),o=r;do{if(a===0){cd&&!r&&Wd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ud(n)){a=$d(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=_d;var l=c.current.memoizedState.isDehydrated;if(l&&(qd(c,s).flags|=256),s=$d(c,s,!1),s!==2&&s!==6){if(ld&&!l){c.errorRecoveryDisabledLanes|=o,pd|=o,a=4;break a}o=vd,vd=a,o!==null&&(vd===null?vd=o:vd.push.apply(vd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){qd(e,0),Wd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Wd(r,t,hd,!sd);break a;case 2:vd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=bd+300-Be(),10<a)){if(Wd(r,t,hd,!sd),ot(r,0,!0)!==0)break a;Od=t,r.timeoutHandle=Sp(Hd.bind(null,r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,`Throttled`,-0,0),a);break a}Hd(r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,null,-0,0)}break}while(1);Mf(e)}function Hd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vn},Hl=null,Yu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?bd-Be():(a&4194048)===a?xd-Be():0,m=oh(d,m),m!==null)){Od=a,e.cancelPendingCommit=m(lf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Wd(e,a,o,!l);return}lf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ud(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wd(e,t,n,r){t=ct(e,t),t&=~md,t&=~pd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Qe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&mt(e,n,t)}function Gd(){return rd&6?!0:(Nf(0,!1),!1)}function Kd(){if(U!==null){if(ad===0)var e=U.return;else e=U,ga=ha=null,as(e),io=null,ao=0,e=U;for(;e!==null;)Sl(e.alternate,e),e=e.return;U=null}}function qd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Od=0,Kd(),id=e,U=n=Ni(e.current,null),W=t,ad=0,od=null,sd=!1,cd=st(e,t),ld=!1,gd=hd=md=pd=fd=dd=0,vd=_d=null,yd=!1,ud=ct(e,t),Ci(),n}function Jd(e,t){H=null,I.H=hc,t===Ja||t===Xa?(t=no(),ad=3):t===Ya?(t=no(),ad=4):ad=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,od=t,U===null&&(dd=1,Dc(e,Vi(t,e.current)))}function Yd(){var e=Ao.current;return e===null?!0:(W&4194048)===W?jo===null:(W&62914560)===W||W&536870912?e===jo:!1}function Xd(){var e=I.H;return I.H=hc,e===null?hc:e}function Zd(){var e=I.A;return I.A=td,e}function Qd(){dd=4,sd||(W&4194048)!==W&&Ao.current!==null||(cd=!0),!(fd&134217727)&&!(pd&134217727)||id===null||Wd(id,W,hd,!1)}function $d(e,t,n){var r=rd;rd|=2;var i=Xd(),a=Zd();(id!==e||W!==t)&&(Cd=null,qd(e,t)),t=!1;var o=dd;a:do try{if(ad!==0&&U!==null){var s=U,c=od;switch(ad){case 8:Kd(),o=6;break a;case 3:case 2:case 9:case 6:Ao.current===null&&(t=!0);var l=ad;if(ad=0,od=null,of(e,s,c,l),n&&cd){o=0;break a}break;default:l=ad,ad=0,od=null,of(e,s,c,l)}}ef(),o=dd;break}catch(t){Jd(e,t)}while(1);return t&&e.shellSuspendCounter++,ga=ha=null,rd=r,I.H=i,I.A=a,U===null&&(id=null,W=0,Ci()),o}function ef(){for(;U!==null;)rf(U)}function tf(e,t){var n=rd;rd|=2;var r=Xd(),a=Zd();id!==e||W!==t?(Cd=null,Sd=Be()+500,qd(e,t)):cd=st(e,t);a:do try{if(ad!==0&&U!==null){t=U;var o=od;b:switch(ad){case 1:ad=0,od=null,of(e,t,o,1);break;case 2:case 9:if(Qa(o)){ad=0,od=null,af(t);break}t=function(){ad!==2&&ad!==9||id!==e||(ad=7),Mf(e)},o.then(t,t);break a;case 3:ad=7;break a;case 4:ad=5;break a;case 7:Qa(o)?(ad=0,od=null,af(t)):(ad=0,od=null,of(e,t,o,7));break;case 5:var s=null;switch(U.tag){case 26:s=U.memoizedState;case 5:case 27:var c=U;if(s?th(s):c.stateNode.complete){ad=0,od=null;var l=c.sibling;if(l!==null)U=l;else{var u=c.return;u===null?U=null:(U=u,sf(u))}break b}}ad=0,od=null,of(e,t,o,5);break;case 6:ad=0,od=null,of(e,t,o,6);break;case 8:Kd(),dd=6;break a;default:throw Error(i(462))}}nf();break}catch(t){Jd(e,t)}while(1);return ga=ha=null,I.H=r,I.A=a,rd=n,U===null?(id=null,W=0,Ci(),dd):0}function nf(){for(;U!==null&&!Re();)rf(U)}function rf(e){var t=pl(e.alternate,e,ud);e.memoizedProps=e.pendingProps,t===null?sf(e):U=t}function af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,W);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,W);break;case 5:as(t);var r=t;r===na&&(V?(la(r),r.tag===5&&r.stateNode!=null&&(ra=r.stateNode)):(la(r),V=!0));default:Sl(n,t),t=U=Pi(t,ud),t=pl(n,t,ud)}e.memoizedProps=e.pendingProps,t===null?sf(e):U=t}function of(e,t,n,r){ga=ha=null,as(t),io=null,ao=0;var i=t.return;try{if(Mc(e,i,t,n,W)){dd=1,Dc(e,Vi(n,e.current)),U=null;return}}catch(t){if(i!==null)throw U=i,t;dd=1,Dc(e,Vi(n,e.current)),U=null;return}t.flags&32768?(V||r===1?e=!0:cd||W&536870912?e=!1:(sd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),cf(t,e)):sf(t)}function sf(e){var t=e;do{if(t.flags&32768){cf(t,sd);return}e=t.return;var n=bl(t.alternate,t,ud);if(n!==null){U=n;return}if(t=t.sibling,t!==null){U=t;return}U=t=e}while(t!==null);dd===0&&(dd=5)}function cf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,U=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){U=e;return}U=e=n}while(e!==null);dd=6,U=null}function lf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do _f();while(Td!==0);if(rd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===id&&(U=id=null,W=0),Dd=t,Ed=e,Od=n,Ad=a,jd=r,uf(e,t,n,s,c,l,f)}}function uf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(kd=s,s|=Si,pt(e,n,s,r,i,a),Nd=null,(n&335544064)===n?(Pd=Fa(e),r=10262):(Pd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Ef(We,function(){return vf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,i=L.p,L.p=2,a=rd,rd|=4;try{gu(e,t,n)}finally{rd=a,L.p=i,I.T=r}}Td=1,Vl?Md=Rp(o,e.containerInfo,Pd,pf,mf,ff,hf,vf,df,null,null):(pf(),mf(),hf())}function df(e){if(Td!==0){var t=Ed.onRecoverableError;t(e,{componentStack:null})}}function ff(){Td===3&&(Td=0,Lu(Dd,Ed),Td=4)}function pf(){if(Td===1){Td=0;var e=Ed,t=Dd,n=Od,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=I.T,I.T=null;var i=L.p;L.p=2;var a=rd;rd|=4;try{pu=mu=!1,Nu(t,e,n),n=mp;var o=Kr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Gr(s.ownerDocument.documentElement,s)){if(c!==null&&qr(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 _=Wr(s,h),v=Wr(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}}Sh=!!pp,mp=pp=null}finally{rd=a,L.p=i,I.T=r}}e.current=t,Td=2}}function mf(){if(Td===2){Td=0;var e=Ed,t=Dd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=rd;rd|=4;try{vu(e,t.alternate,t)}finally{rd=i,L.p=r,I.T=n}}Td=3}}function hf(){if(Td===4||Td===3){Td=0;var e=Md;Md=null,ze();var t=Ed,n=Dd,r=Od,i=jd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Td=5:(Td=0,Dd=Ed=null,gf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(wd=null),vt(r),n=n.stateNode,Xe&&typeof Xe.onCommitFiberRoot==`function`)try{Xe.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=I.T,a=L.p,L.p=2,I.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{I.T=n,L.p=a}}if(i=Nd,o=Pd,Pd=null,i!==null&&(Nd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Od&3&&_f(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Id?Fd++:(Fd=0,Id=t):(Fd=0,Id=null),Nf(0,!1)}}function gf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function _f(){return Md!==null&&(Md.skipTransition(),Md=null),pf(),mf(),hf(),vf()}function vf(){if(Td!==5)return!1;var e=Ed,t=kd;kd=0;var n=vt(Od),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=Ad,Ad=null;var o=Ed,s=Od;if(Td=0,Dd=Ed=null,Od=0,rd&6)throw Error(i(331));var c=rd;if(rd|=4,Qu(o.current),Wu(o,o.current,s,n),rd=c,Nf(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot==`function`)try{Xe.onPostCommitFiberRoot(Ye,o)}catch{}return!0}finally{L.p=a,I.T=r,gf(e,t)}}function yf(e,t,n){t=Vi(n,t),t=kc(e.stateNode,t,2),e=_o(e,t,2),e!==null&&(ft(e,2),Mf(e))}function bf(e,t,n){if(e.tag===3)yf(e,e,n);else for(;t!==null;){if(t.tag===3){yf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(wd===null||!wd.has(r))){e=Vi(n,e),n=Ac(2),r=_o(t,n,2),r!==null&&(jc(n,r,t,e),ft(r,2),Mf(r));break}}t=t.return}}function xf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ld=!0,i.add(n),e=Sf.bind(null,e,t,n),t.then(e,e))}function Sf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,id===e&&(W&n)===n&&(dd===4||dd===3&&(W&62914560)===W&&300>Be()-bd?rd&2?md|=n:qd(e,0):md|=n,gd===W&&(gd=0)),Mf(e)}function Cf(e,t){t===0&&(t=ut()),e=Ei(e,t),e!==null&&(ft(e,t),Mf(e))}function wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cf(e,n)}function Tf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Cf(e,n)}function Ef(e,t){return Ie(e,t)}var Df=null,G=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==G&&e.next===null&&(G===null?Df=G=e:G=G.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Df;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=W,a=ot(r,r===id?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||st(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&xp()&&(e=jf);for(var t=Be(),n=null,r=Df;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Df=i:n.next=i,i===null&&(G=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}Td!==0&&Td!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Qe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=lt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=id,n=W,n=ot(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ad===2||ad===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||st(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Le(r),vt(n)){case 2:case 8:n=Ue;break;case 32:n=We;break;case 268435456:n=Ke;break;default:n=We}return r=Lf.bind(null,e),n=Ie(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Le(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(Td!==0&&Td!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_f()&&e.callbackNode!==n)return null;var r=W;return r=ot(e,e===id?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Vd(e,r,t),If(e,Be()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(_f())return null;Vd(e,t,!0)}function zf(){Ep(function(){rd&6?Ie(He,Pf):Ff()})}function Bf(){if(jf===0){var e=Ra;e===0&&(e=nt,nt<<=1,!(nt&261888)&&(nt=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:_n(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[Ct]||null).action),o=r.submitter;o&&(t=(t=o[Ct]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Rn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<pi.length;Uf++){var Wf=pi[Uf];mi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}mi(ai,`onAnimationEnd`),mi(oi,`onAnimationIteration`),mi(si,`onAnimationStart`),mi(`dblclick`,`onDoubleClick`),mi(`focusin`,`onFocus`),mi(`focusout`,`onBlur`),mi(ci,`onTransitionRun`),mi(li,`onTransitionStart`),mi(ui,`onTransitionCancel`),mi(di,`onTransitionEnd`),Vt(`onMouseEnter`,[`mouseout`,`mouseover`]),Vt(`onMouseLeave`,[`mouseout`,`mouseover`]),Vt(`onPointerEnter`,[`pointerout`,`pointerover`]),Vt(`onPointerLeave`,[`pointerout`,`pointerover`]),Bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){yi(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){yi(e)}i.currentTarget=null,a=c}}}}function K(e,t){var n=t[Tt];n===void 0&&(n=t[Tt]=new Set);var r=e+`__bubble`;n.has(r)||(Zf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,Rt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Zf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!Dn||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 Qf(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=Mt(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}wn(function(){var r=a,i=bn(n),s=[];a:{var c=fi.get(e);if(c!==void 0){var l=Rn,u=e;switch(e){case`keypress`:if(Nn(n)===0)break a;case`keydown`:case`keyup`:l=nr;break;case`focusin`:u=`focus`,l=qn;break;case`focusout`:u=`blur`,l=qn;break;case`beforeblur`:case`afterblur`:l=qn;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=Gn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ar;break;case ai:case oi:case si:l=Jn;break;case di:l=or;break;case`scroll`:case`scrollend`:l=Bn;break;case`wheel`:l=sr;break;case`copy`:case`cut`:case`paste`:l=Yn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=rr;break;case`submit`:l=ir;break;case`toggle`:case`beforetoggle`:l=cr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Tn(m,p),g!=null&&d.push($f(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==yn&&(u=n.relatedTarget||n.fromElement)&&(Mt(u)||u[wt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Mt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Gn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=rr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Pt(c),h=l==null?u:Pt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Mt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,tp):null,c!==null&&np(s,u,c,d,!1),l!==null&&f!==null&&np(s,f,l,d,!0)))}a:{if(c=r?Pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Or;else if(Sr(c)){if(kr)_=Rr;else{_=Ir;var v=Fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&mn(r.elementType)&&(_=Or):_=Lr;if(_&&=_(e,r)){Cr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Pt(r):window,e){case`focusin`:(Sr(v)||v.contentEditable===`true`)&&(Yr=v,Xr=r,Zr=null);break;case`focusout`:Zr=Xr=Yr=null;break;case`mousedown`:Qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Qr=!1,$r(s,n,i);break;case`selectionchange`:if(Jr)break;case`keydown`:case`keyup`:$r(s,n,i)}var y;if(ur)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else vr?gr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(pr&&n.locale!==`ko`&&(vr||b!==`onCompositionStart`?b===`onCompositionEnd`&&vr&&(y=Mn()):(kn=i,An=`value`in kn?kn.value:kn.textContent,vr=!0)),v=ep(r,b),0<v.length&&(b=new Xn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=_r(n),y!==null&&(b.data=y)))),(y=fr?yr(e,n):br(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new Xn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function $f(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ep(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=Tn(e,n),i!=null&&r.unshift($f(e,i,a)),i=Tn(e,t),i!=null&&r.push($f(e,i,a))),e.tag===3)return r;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(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=Tn(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=Tn(n,a),l!=null&&o.push($f(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rp=/\r\n?/g,ip=/\u0000|\uFFFD/g;function ap(e){return(typeof e==`string`?e:``+e).replace(rp,`
9
+ `).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function sp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||un(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&un(e,``+r);else return;break;case`className`:Jt(e,`class`,r);break;case`tabIndex`:Jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Jt(e,n,r);break;case`style`:pn(e,r,o);return;case`data`:if(t!==`object`){Jt(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=_n(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&sp(e,t,`name`,a.name,a,null),sp(e,t,`formEncType`,a.formEncType,a,null),sp(e,t,`formMethod`,a.formMethod,a,null),sp(e,t,`formTarget`,a.formTarget,a,null)):(sp(e,t,`encType`,a.encType,a,null),sp(e,t,`method`,a.method,a,null),sp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=vn);return;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=_n(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:K(`beforetoggle`,e),K(`toggle`,e),qt(e,`popover`,r);break;case`xlinkActuate`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:qt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=hn.get(n)||n,qt(e,n,r);else return}z=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:pn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)un(e,r);else if(typeof r==`number`||typeof r==`bigint`)un(e,``+r);else return;break;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=vn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!zt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Ct]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}z=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):qt(e,n,r)}return}z=!0}function lp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:K(`error`,e),K(`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:sp(e,t,o,s,n,null)}}a&&sp(e,t,`srcSet`,n.srcSet,n,null),r&&sp(e,t,`src`,n.src,n,null);return;case`input`:K(`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:sp(e,t,r,d,n,null)}}an(e,o,c,l,u,s,a,!1);return;case`select`:for(a in K(`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:sp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&sn(e,!!r,n,!0):sn(e,!!r,t,!1);return;case`textarea`:for(s in K(`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:sp(e,t,s,c,n,null)}ln(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:sp(e,t,l,r,n,null)}return;case`dialog`:K(`beforetoggle`,e),K(`toggle`,e),K(`cancel`,e),K(`close`,e);break;case`iframe`:case`object`:K(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)K(Gf[r],e);break;case`image`:K(`error`,e),K(`load`,e);break;case`details`:K(`toggle`,e);break;case`embed`:case`source`:case`link`:K(`error`,e),K(`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:sp(e,t,u,r,n,null)}return;default:if(mn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&sp(e,t,c,r,n,null))}var up={};function dp(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)||sp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(z=!0),o=m;break;case`name`:m!==f&&(z=!0),a=m;break;case`checked`:m!==f&&(z=!0),u=m;break;case`defaultChecked`:m!==f&&(z=!0),d=m;break;case`value`:m!==f&&(z=!0),s=m;break;case`defaultValue`:m!==f&&(z=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&sp(e,t,p,m,r,f)}}rn(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)||sp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(z=!0),p=o;break;case`defaultValue`:o!==l&&(z=!0),c=o;break;case`multiple`:o!==l&&(z=!0),s=o;default:o!==l&&sp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?sn(e,!!n,n?[]:``,!1):sn(e,!!n,t,!0)):sn(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:sp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(z=!0),p=a;break;case`defaultValue`:a!==o&&(z=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&sp(e,t,s,a,r,o)}cn(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:sp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(z=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:sp(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)&&sp(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:sp(e,t,u,p,r,m)}return;default:if(mn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&cp(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||cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&sp(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||sp(e,t,f,p,r,m)}function q(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){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&&q(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&&q(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 pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(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 _p(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 vp(e,t,n,r){return n=hp(n).createElement(e),n[St]=r,n[Ct]=t,lp(n,e,t),It(n),n}function yp(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 bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(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),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[kt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(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 jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=b(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=hp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Mt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),rm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),rm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=b(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(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`:cm(n),jt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(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[kt])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=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(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 hm(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 gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(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 ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(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 Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&sp(e,t,r,null,up,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===vn&&(e.onclick=null),jt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jt(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=L.d;L.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Gd();return e||t}function km(e){var t=Nt(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=nn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),It(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+nn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+nn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+nn(n.imageSizes)+`"]`)):i+=`[href="`+nn(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[At]=!0,o.onload=o.onerror=function(){Lt(o)}),It(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+nn(r)+`"][href="`+nn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),lp(r,`link`,e),It(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=Ft(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);It(c),lp(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,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=Ft(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),It(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=Ft(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),It(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=Se.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=Ft(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=Ft(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(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=Ft(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bm(e){return`href="`+nn(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[At]){r.loading=1;return}}else t=e.createElement(`link`),t[At]=!0,t.onload=t.onerror=Lt.bind(null,t),lp(t,`link`,n),It(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+nn(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+nn(n.href)+`"]`);if(r)return t.instance=r,It(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),It(r),lp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,It(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),It(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),lp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,It(a),a):(r=n,(a=wm.get(o))&&(r=D({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),It(a),lp(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,qm(r,n.precedence,e));return t.instance}function qm(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 Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,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[kt]||a[St]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(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 eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(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=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,It(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),It(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),lp(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=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.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=ch.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 ph={$$typeof:te,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function mh(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=dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dt(0),this.hiddenUpdates=dt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ji(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},mo(a),e}function gh(e){return e?(e=ki,e):ki}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=go(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=_o(e,r,t),n!==null&&(Bd(n,e,t),vo(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Ei(e,67108864);t!==null&&Bd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Ld();t=_t(t);var n=Ei(e,t);n!==null&&Bd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,Th(e,t,n,r)}finally{L.p=a,I.T=i}}function wh(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,Th(e,t,n,r)}finally{L.p=a,I.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Qf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=at(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Qe(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(rd&6)&&(Sd=Be()+500,Nf(0,!1))}}break;case 31:case 13:s=Ei(a,2),s!==null&&Bd(s,a,2),Gd(),yh(a,2)}if(a=Eh(r),a===null&&Qf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Eh(e){return e=bn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Mt(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 Dh=e,null}function kh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ve()){case He:return 2;case Ue:return 8;case We:case Ge:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(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=Nt(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Mt(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,bt(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,bt(e.priority,function(){xh(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 Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yn=r,n.target.dispatchEvent(r),yn=null}else return t=Nt(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=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(Oh(r||n)===null)continue;break}var a=Nt(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.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[Ct]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ct]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){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 Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Ld(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Gd(),t[wt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=yt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(i(527,Qh,`19.3.0`));L.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Ye=eg.inject($h),Xe=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;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=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[wt]=t.current,Xf(e),new Xh(t)}})),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=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})),v=o(((e,t)=>{t.exports=_()})),y=c(u(),1),b=v(),x=y.createContext(void 0),S=e=>{let t=y.useContext(x);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},C=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,b.jsx)(x.Provider,{value:e,children:t})),w={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T=new class{#e=w;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function E(e){setTimeout(e,0)}var D=typeof window>`u`||`Deno`in globalThis;function O(){}function k(e,t){return typeof e==`function`?e(t):e}function A(e){return typeof e==`number`&&e>=0&&e!==1/0}function j(e,t){return Math.max(e+(t||0)-Date.now(),0)}function M(e,t){return typeof e==`function`?e(t):e}function ee(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==te(o,t.options))return!1}else if(!re(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function N(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ne(t.options.mutationKey)!==ne(a))return!1}else if(!re(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function te(e,t){return(t?.queryKeyHashFn||ne)(e)}function ne(e){return JSON.stringify(e,(e,t)=>se(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function re(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!re(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!re(e[r],t[r]))return!1;return!0}return!1}var ie=Object.prototype.hasOwnProperty;function ae(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=oe(e)&&oe(t);if(!r&&!(se(e)&&se(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ie.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ae(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function P(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function oe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function se(e){if(!ce(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ce(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ce(e){return Object.prototype.toString.call(e)===`[object Object]`}function le(e){return new Promise(t=>{T.setTimeout(t,e)})}function ue(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ae(e,t)}function de(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function fe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var pe=Symbol();function me(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===pe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function F(e,t){return typeof e==`function`?e(...t):!!e}function I(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var L=()=>D,he=()=>L(),ge=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_e=new class extends ge{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ve=E;function ye(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ve,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var R=ye(),be=new class extends ge{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xe(e){return Math.min(1e3*2**e,3e4)}function Se(e){return(e??`online`)!==`online`||be.isOnline()}var Ce=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function we(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(O);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ce(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>_e.isFocused()&&(e.networkMode===`always`||be.isOnline())&&e.canRun(),p=()=>Se(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(he()?0:3),a=e.retryDelay??xe,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),le(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Te=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A(this.gcTime)&&(this.#e=T.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(he()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(T.clearTimeout(this.#e),this.#e=void 0)}};function Ee(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{I(e,()=>t.signal,()=>n=!0)},u=me(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?fe:de;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Oe:De,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:De(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function De(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Oe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ke(e,t){return t?De(e,t)!=null:!1}function Ae(e,t){return!t||!e.getPreviousPageParam?!1:Oe(e,t)!=null}var je=class extends Te{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Pe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Pe(this.options);e.data!==void 0&&(this.setState(Ne(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ue(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(O).catch(O):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>M(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>M(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!j(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=me(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ee(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=we({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ce&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ce){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Me(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ne(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),R.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Me(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Se(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ne(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Pe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Fe=class extends ge{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Le(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Re(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Re(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof M(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!P(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ze(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||M(this.options.enabled,this.#t)!==M(t.enabled,this.#t)||M(this.options.staleTime,this.#t)!==M(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||M(this.options.enabled,this.#t)!==M(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return P(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(O)),t}#h(e){return!he()&&M(this.options.enabled,this.#t)!==!1&&A(e)}#g(){this.#b();let e=M(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=j(this.#r.dataUpdatedAt,e)+1;this.#u=T.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return M(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=T.setInterval(()=>{(this.options.refetchIntervalInBackground||_e.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(T.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(T.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Le(e,t),o=i&&ze(e,n,t,r);(a||o)&&(l={...l,...Me(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ue(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ue(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Be(e,t),refetch:this.refetch,isEnabled:M(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),P(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();R.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Ie(e,t){return M(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||M(t.retryOnMount,e)!==!1)}function Le(e,t){return Ie(e,t)||e.state.data!==void 0&&Re(e,t,t.refetchOnMount)}function Re(e,t,n){if(M(t.enabled,e)!==!1&&M(t.staleTime,e)!==`static`){let r=M(n,e);return r===`always`||r!==!1&&Be(e,t)}return!1}function ze(e,t,n,r){return(e!==t||M(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Be(e,n)}function Be(e,t){return M(t.enabled,e)!==!1&&e.isStaleByTime(M(t.staleTime,e))}var Ve=class extends Fe{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ke(t,n.data),hasPreviousPage:Ae(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},He=class extends Te{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ue(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=we({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),R.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ue(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var We=class extends ge{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new He({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ge(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ge(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ge(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ge(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){R.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>N(t,e))}findAll(e={}){return this.getAll().filter(t=>N(e,t))}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return R.batch(()=>Promise.all(e.map(e=>e.continue().catch(O))))}};function Ge(e){return e.options.scope?.id}var Ke=class extends ge{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??te(r,t),a=this.get(i);return a||(a=new je({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){R.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ee(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ee(e,t)):t}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){R.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){R.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ke,this.#t=e.mutationCache||new We,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=_e.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=be.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(M(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=k(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return R.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;R.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return R.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=R.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(O).catch(O)}invalidateQueries(e,t={}){return R.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=R.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(O)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(O)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(M(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(M(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(O).catch(O)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(O).catch(O)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return be.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ne(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{re(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ne(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{re(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=te(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===pe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Je=y.createContext(!1),Ye=()=>y.useContext(Je);Je.Provider;function Xe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ze=y.createContext(Xe()),Qe=()=>y.useContext(Ze),$e=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?F(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},et=e=>{y.useEffect(()=>{e.clearReset()},[e])},tt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||F(n,[e.error,r])),nt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},rt=(e,t)=>e?.suspense&&t.isPending,it=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function at(e,t,n){let r=Ye(),i=Qe(),a=S(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,nt(o),$e(o,i,s),et(i);let[l]=y.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(y.useSyncExternalStore(y.useCallback(e=>{let t=d?l.subscribe(R.batchCalls(e)):O;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setOptions(o)},[o,l]),rt(o,u))throw it(o,l,i);if(tt({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ot(e,t){return at(e,Fe,t)}function st(e,t){return at(e,Ve,t)}var ct=g(),lt=(0,y.createContext)({});function ut(e){let t=(0,y.useRef)(null);return t.current===null&&(t.current=e()),t.current}var dt=typeof window<`u`?y.useLayoutEffect:y.useEffect,ft=(0,y.createContext)(null);function pt(e,t){e.indexOf(t)===-1&&e.push(t)}function mt(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var ht=(e,t,n)=>n>t?t:n<e?e:n,gt={},_t=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),vt=e=>typeof e==`object`&&!!e,yt=e=>/^0[^.\s]+$/u.test(e);function bt(e){let t;return()=>(t===void 0&&(t=e()),t)}var xt=e=>e,St=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ct=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},wt=class{constructor(){this.subscriptions=[]}add(e){return pt(this.subscriptions,e),()=>this.remove(e)}remove(e){mt(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Tt=e=>e*1e3,Et=e=>e/1e3,Dt=(e,t)=>t?1e3/t*e:0,Ot=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,kt=1e-7,At=12;function jt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ot(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>kt&&++s<At);return o}function Mt(e,t,n,r){if(e===t&&n===r)return xt;let i=t=>jt(t,0,1,e,n);return e=>e===0||e===1?e:Ot(i(e),t,r)}var Nt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Pt=e=>t=>1-e(1-t),Ft=Mt(.33,1.53,.69,.99),It=Pt(Ft),Lt=Nt(It),Rt=e=>e>=1?1:(e*=2)<1?.5*It(e):.5*(2-2**(-10*(e-1))),zt=e=>1-Math.sin(Math.acos(e)),Bt=Pt(zt),Vt=Nt(zt),Ht=Mt(.42,0,1,1),Ut=Mt(0,0,.58,1),Wt=Mt(.42,0,.58,1),Gt=e=>Array.isArray(e)&&typeof e[0]!=`number`,z=e=>Array.isArray(e)&&typeof e[0]==`number`,Kt={linear:xt,easeIn:Ht,easeInOut:Wt,easeOut:Ut,circIn:zt,circInOut:Vt,circOut:Bt,backIn:It,backInOut:Lt,backOut:Ft,anticipate:Rt},qt=e=>typeof e==`string`,Jt=e=>{if(z(e)){e.length;let[t,n,r,i]=e;return Mt(t,n,r,i)}return qt(e)?(Kt[e],`${e}`,Kt[e]):e},Yt={delta:0,timestamp:0,isProcessing:!1},Xt;function Zt(){Xt=void 0}var Qt={now:()=>(Xt===void 0&&Qt.set(Yt.isProcessing||gt.useManualTiming?Yt.timestamp:performance.now()),Xt),set:e=>{Xt=e,queueMicrotask(Zt)}},$t=e=>Math.round(e*1e5)/1e5,en=e=>t=>typeof t==`string`&&t.startsWith(e),tn=en(`--`),nn=en(`var(--`),rn=e=>nn(e)?an.test(e.split(`/*`)[0].trim()):!1,an=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function on(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var sn={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},cn={...sn,transform:e=>ht(0,1,e)},ln={...sn,default:1},un=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dn(e){return e==null}var fn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pn=(e,t)=>n=>!!(typeof n==`string`&&fn.test(n)&&n.startsWith(e)||t&&!dn(n)&&Object.prototype.hasOwnProperty.call(n,t)),mn=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(un);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},hn=e=>ht(0,255,e),gn={...sn,transform:e=>Math.round(hn(e))},_n={test:pn(`rgb`,`red`),parse:mn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+gn.transform(e)+`, `+gn.transform(t)+`, `+gn.transform(n)+`, `+$t(cn.transform(r))+`)`};function vn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var yn={test:pn(`#`),parse:vn,transform:_n.transform},bn=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xn=bn(`deg`),Sn=bn(`%`),B=bn(`px`),Cn=bn(`vh`),wn=bn(`vw`),Tn={...Sn,parse:e=>Sn.parse(e)/100,transform:e=>Sn.transform(e*100)},En={test:pn(`hsl`,`hue`),parse:mn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Sn.transform($t(t))+`, `+Sn.transform($t(n))+`, `+$t(cn.transform(r))+`)`},Dn={test:e=>_n.test(e)||yn.test(e)||En.test(e),parse:e=>_n.test(e)?_n.parse(e):En.test(e)?En.parse(e):yn.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?_n.transform(e):En.transform(e),getAnimatableNone:e=>{let t=Dn.parse(e);return t.alpha=0,Dn.transform(t)}},On=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,kn=new RegExp(un.source),An=new RegExp(On.source,`i`);function jn(e){return isNaN(e)&&typeof e==`string`&&(kn.test(e)||An.test(e))}var Mn=`number`,Nn=`color`,Pn=`var`,Fn=`var(`,In="${}",Ln=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Rn(e){let t=e.toString();return kn.test(t)||An.test(t)}function zn(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Ln,e=>(Dn.test(e)?(r.color.push(a),i.push(Nn),n.push(Dn.parse(e))):e.startsWith(Fn)?(r.var.push(a),i.push(Pn),n.push(e)):(r.number.push(a),i.push(Mn),n.push(parseFloat(e))),++a,In)).split(In),indexes:r,types:i}}function Bn(e){return zn(e).values}function Vn({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Mn?$t(r[a]):e===Nn?Dn.transform(r[a]):r[a]}return i}}function Hn(e){return Vn(zn(e))}var Un=e=>typeof e==`number`?0:Dn.test(e)?Dn.getAnimatableNone(e):e,Wn=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Un(e);function Gn(e){let t=zn(e);return Vn(t)(t.values.map((e,n)=>Wn(e,t.split[n])))}var Kn={test:jn,parse:Bn,createTransformer:Hn,getAnimatableNone:Gn};function qn(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 Jn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=qn(s,r,e+1/3),a=qn(s,r,e),o=qn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Yn(e,t){return n=>n>0?t:e}var Xn=(e,t,n)=>e+(t-e)*n,Zn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Qn=[yn,_n,En],$n=e=>Qn.find(t=>t.test(e));function er(e){let t=$n(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===En&&(n=Jn(n)),n}var tr=(e,t)=>{let n=er(e),r=er(t);if(!n||!r)return Yn(e,t);let i={...n};return e=>(i.red=Zn(n.red,r.red,e),i.green=Zn(n.green,r.green,e),i.blue=Zn(n.blue,r.blue,e),i.alpha=Xn(n.alpha,r.alpha,e),_n.transform(i))},nr=new Set([`none`,`hidden`]);function rr(e,t){return nr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ir(e,t){return n=>Xn(e,t,n)}function ar(e){return typeof e==`number`?ir:typeof e==`string`?rn(e)?Yn:Dn.test(e)?tr:lr:Array.isArray(e)?or:typeof e==`object`?Dn.test(e)?tr:sr:Yn}function or(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ar(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function sr(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ar(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function cr(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var lr=(e,t)=>{let n=Kn.createTransformer(t),r=zn(e),i=zn(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?nr.has(e)&&!i.values.length||nr.has(t)&&!r.values.length?rr(e,t):St(or(cr(r,i),i.values),n):(`${e}${t}`,Yn(e,t))},ur=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function dr(e,t){let n=ur.exec(e);if(!n)return;let r=ur.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>$t(Xn(a,o,e))+i}function fr(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Xn(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=dr(e,t);if(n)return n}return ar(e)(e,t)}var pr=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function mr(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var hr=40;function gr(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=pr.reduce((e,t)=>(e[t]=mr(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=gt.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,hr),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:pr.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<pr.length;t++)o[pr[t]].cancel(e)},state:n,steps:o}}var{schedule:_r,cancel:vr,steps:yr}=gr(typeof requestAnimationFrame<`u`?requestAnimationFrame:xt,!0,Yt),br=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>_r.update(t,e),stop:()=>vr(t),now:()=>Yt.isProcessing?Yt.timestamp:Qt.now()}},xr=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Sr=2e4;function Cr(e,t=50,n=Sr,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function wr(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Cr(r),Sr);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Et(i)}}var Tr={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},Er=e=>e<0?1/Math.max(1+e,Tr.minDamping):Math.max(1-e,Tr.minDamping);function Dr(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Ar(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Or(e,t){return e*Math.sqrt(1-t*t)}var kr=12;function Ar(e,t,n){let r=n;for(let n=1;n<kr;n++)r-=e(r)/t(r);return r}var jr=.001;function Mr({duration:e=Tr.duration,bounce:t=Tr.bounce}){let n,r;Tr.maxDuration;let i=Er(t);e=ht(Tr.minDuration,Tr.maxDuration,Et(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Or(t,i),o=Math.exp(-r);return jr-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Or(t*t,i);return(-n(t)+jr>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Ar(n,r,a),s=o*Dr(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Tt(e)}}var Nr=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Pr(e,t){if(Nr(e,t))return e}function Fr(e){let t=Pr(e.stiffness),n=Pr(e.damping,!0),r=Pr(e.mass),i={...e,stiffness:t??Tr.stiffness,damping:n??Tr.damping,mass:r??Tr.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Er(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Dr(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Mr(i)),i.isResolvedFromDuration=!0;(!Nr(i.stiffness)||!Nr(i.damping,!0))&&(i.stiffness=Tr.stiffness,i.damping=Tr.damping)}return i}function Ir(e=Tr.visualDuration,t=Tr.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Fr({...n}),f=e=>d?0:-Et(e),p=s/(2*Math.sqrt(o*c)),m=Et(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Tr.restSpeed.granular:Tr.restSpeed.default),g.restDelta=n.restDelta||(e?Tr.restDelta.granular:Tr.restDelta.default)};_();let v,y,b;if(p<1){let e=Or(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Tt(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Tt(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Cr(S),Sr),t=xr(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Ir.applyToOptions=e=>{let t=wr(e,100,Ir);return e.ease=t.ease,e.duration=Tt(t.duration),e.type=`keyframes`,e};function Lr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Ir({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Rr(e,t,n){let r=[],i=n||gt.mix||fr,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=St(Array.isArray(t)?t[n]||xt:t,a)),r.push(a)}return r}function zr(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Rr(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Ct(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ht(e[0],e[a-1],t)):l}function Br(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Ct(0,t,r);e.push(Xn(n,1,i))}}function Vr(e){let t=[0];return Br(t,e.length-1),t}function Hr(e,t){return e.map(e=>e*t)}function Ur(e,t){return e.map(()=>t||Wt).splice(0,e.length-1)}function Wr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Gt(r)?r.map(Jt):Jt(r)||Wt,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(gt.mix||fr)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?ht(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=zr(Hr(n&&n.length===t.length?n:Vr(t),e),t,{ease:Array.isArray(i)?i:Ur(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Gr=5;function Kr(e,t,n){let r=Math.max(t-Gr,0);return Dt(n-e(r),t-r)}function qr(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Kr(t=>e.next(t).value,t,e.next(t).value)}var Jr=e=>e!==null;function Yr(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Jr),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Xr={decay:Lr,inertia:Lr,tween:Wr,keyframes:Wr,spring:Ir};function Zr(e){typeof e.type==`string`&&(e.type=Xr[e.type])}function Qr(e,t){return{kind:e,animation:t,timestamp:Qt.now(),frameTimestamp:Yt.timestamp,frameIsProcessing:Yt.isProcessing}}function $r(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Qr(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function ei(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Qr(`layout-animation-start`,e),node:t})}catch{}}var ti=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},ni=e=>e/100,ri=class extends ti{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Qt.now()&&this.tick(Qt.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),$r(this,this.options)}initAnimation(){let{options:e}=this;Zr(e);let{type:t=Wr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Wr;s!==Wr&&typeof o[0]!=`number`&&(this.mixKeyframes=St(ni,fr(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Cr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=ht(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Lr&&(b.value=Yr(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Et(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Et(e)}get time(){return Et(this.currentTime)}set time(e){e=Tt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return qr(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Qt.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Et(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=br,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Qt.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},ii=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ai(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(un)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ii.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var oi=/\b([a-z-]*)\(.*?\)/gu,si={...Kn,getAnimatableNone:e=>{let t=e.match(oi);return t?t.map(ai).join(` `):e}},ci={...Kn,getAnimatableNone:e=>{let t=Kn.parse(e);return Kn.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},li={...sn,transform:Math.round},ui={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,rotate:xn,pathRotation:xn,rotateX:xn,rotateY:xn,rotateZ:xn,scale:ln,scaleX:ln,scaleY:ln,scaleZ:ln,skew:xn,skewX:xn,skewY:xn,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:cn,originX:Tn,originY:Tn,originZ:B,zIndex:li,fillOpacity:cn,strokeOpacity:cn,numOctaves:li},di={...ui,color:Dn,backgroundColor:Dn,outlineColor:Dn,fill:Dn,stroke:Dn,borderColor:Dn,borderTopColor:Dn,borderRightColor:Dn,borderBottomColor:Dn,borderLeftColor:Dn,filter:si,WebkitFilter:si,mask:ci,WebkitMask:ci},fi=e=>di[e],pi=new Set([si,ci]);function mi(e,t){let n=fi(e);return pi.has(n)||(n=Kn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function hi(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var gi=e=>e*180/Math.PI,_i=e=>yi(gi(Math.atan2(e[1],e[0]))),vi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_i,rotateZ:_i,skewX:e=>gi(Math.atan(e[1])),skewY:e=>gi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},yi=e=>(e%=360,e<0&&(e+=360),e),bi=_i,xi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Si=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ci={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xi,scaleY:Si,scale:e=>(xi(e)+Si(e))/2,rotateX:e=>yi(gi(Math.atan2(e[6],e[5]))),rotateY:e=>yi(gi(Math.atan2(-e[2],e[0]))),rotateZ:bi,rotate:bi,skewX:e=>gi(Math.atan(e[4])),skewY:e=>gi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wi(e){return+!!e.includes(`scale`)}function Ti(e,t){if(!e||e===`none`)return wi(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Ci,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=vi,i=t}if(!i)return wi(t);let a=r[t],o=i[1].split(`,`).map(Di);return typeof a==`function`?a(o):o[a]}var Ei=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ti(n,t)};function Di(e){return parseFloat(e.trim())}var Oi=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],ki=new Set([...Oi,`pathRotation`]),Ai=e=>e===sn||e===B,ji=new Set([`x`,`y`,`z`]),Mi=Oi.filter(e=>!ji.has(e));function Ni(e){let t=[];return Mi.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Pi=new Set([`bottom`,`right`]);function Fi(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Ii={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Fi(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Fi(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Ti(e,`x`),y:({transform:e})=>Ti(e,`y`)};Ii.translateX=Ii.x,Ii.translateY=Ii.y;var Li=new Set,Ri=!1,zi=!1,Bi=!1;function Vi(){if(zi){let e=[],t=new Set,n=new Set;Li.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Pi.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Ni(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}zi=!1,Ri=!1,Li.forEach(e=>e.complete(Bi)),Li.clear()}function Hi(){Li.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zi=!0)})}function Ui(){Bi=!0,Hi(),Vi(),Bi=!1}function Wi(e,t,n){if(typeof e==`string`){if(_t(e)||yt(e))return parseFloat(e);if(!Kn.test(e)&&Kn.test(n))return mi(t,n)}return e??void 0}var Gi=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Li.add(this),Ri||(Ri=!0,_r.read(Hi),_r.resolveKeyframes(Vi))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Wi(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}hi(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Li.delete(this)}cancel(){this.state===`scheduled`&&(Li.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Ki=e=>e.startsWith(`--`);function qi(e,t,n){Ki(t)?e.style.setProperty(t,n):e.style[t]=n}var Ji={};function Yi(e,t){let n=bt(e);return()=>Ji[t]??n()}var Xi=Yi(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Zi=Yi(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Qi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$i={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Qi([0,.65,.55,1]),circOut:Qi([.55,0,1,.45]),backIn:Qi([.31,.01,.66,-.59]),backOut:Qi([.33,1.53,.69,.99])};function ea(e,t){if(e)return typeof e==`function`?Zi()?xr(e,t):`ease-out`:z(e)?Qi(e):Array.isArray(e)?e.map(e=>ea(e,t)||$i.easeOut):$i[e]}function ta(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=ea(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function na(e){return typeof e==`function`&&`applyToOptions`in e}function ra({type:e,...t}){return na(e)&&Zi()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var V=class extends ti{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ra(e);this.animation=ta(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Yr(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),qi(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},$r(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Et(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Et(e)}get time(){return Et(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Tt(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Xi()?(this.animation.timeline=e,t?.(this.animation),xt):n(this)}},ia={anticipate:Rt,backInOut:Lt,circInOut:Vt};function aa(e){return e in ia}function oa(e){typeof e.ease==`string`&&aa(e.ease)&&(e.ease=ia[e.ease])}var sa=10,ca=class extends V{constructor(e){oa(e),Zr(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new ri({...a,autoplay:!1}),s=Math.max(sa,Qt.now()-this.startTime),c=ht(0,sa,s-sa),l=o.sample(s).value,{name:u}=this.options;i&&u&&qi(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},la=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Kn.test(e)||e===`0`)&&!e.startsWith(`url(`));function ua(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function da(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=la(i,t),s=la(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):ua(e)||(n===`spring`||na(n))&&r}function fa(e){e.duration=0,e.type=`keyframes`}var pa=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ma=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ha(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ma.test(e[t]))return!0;return!1}var ga=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),_a=bt(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function va(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(pa.has(n)||ga.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return _a()&&(pa.has(n)||ga.has(n)&&ha(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ya=40,ba=class extends ti{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Qt.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Gi;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Qt.now();let u=!0;da(e,i,a,o)||(u=!1,(gt.instantAnimations||!s)&&l?.(Yr(e,n,t)),e[0]=e[e.length-1],fa(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>ya?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&va(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new ca(n)}catch{m=new ri(n)}}else m=new ri(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ui()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function xa(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Sa=30,Ca=e=>!isNaN(parseFloat(e)),wa={current:void 0},Ta=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Qt.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Qt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ca(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new wt)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new wt,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){_r.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return wa.current&&wa.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Sa)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Sa);return Dt(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ea(e,t){return new Ta(e,t)}function Da(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Oa(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Da(n,e)}var ka={type:`spring`,stiffness:500,damping:25,restSpeed:10},Aa=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ja={type:`keyframes`,duration:.8},Ma={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Na=(e,{keyframes:t})=>t.length>2?ja:ki.has(e)?e.startsWith(`scale`)?Aa(t[1]):ka:Ma,Pa=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Fa(e){for(let t in e)if(!Pa.has(t))return!0;return!1}var Ia=(e,t,n,r={},i,a)=>o=>{let s=Oa(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Tt(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Fa(s)||Object.assign(u,Na(e,u)),u.duration&&=Tt(u.duration),u.repeatDelay&&=Tt(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(fa(u),u.delay===0&&(d=!0)),(gt.instantAnimations||gt.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,fa(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Yr(u.keyframes,s);if(e!==void 0){_r.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ri(u):new ba(u)},La=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ra(e){let t=La.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function za(e,t,n=1){`${e}`;let[r,i]=Ra(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return _t(e)?parseFloat(e):e}return rn(i)?za(i,t,n+1):i}function Ba(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Va(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Ba(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Ha(e,t,n){return Va(e.getProps(),t,n,e)}var Ua=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Wa=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Oi]),Ga=e=>Array.isArray(e);function Ka(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ea(n))}function qa(e){return Ga(e)?e[e.length-1]||0:e}function Ja(e,t){let{transitionEnd:n={},transition:r={},...i}=Ha(e,t)||{};i={...i,...n};for(let t in i)Ka(e,t,qa(i[t]))}var Ya=e=>!!(e&&e.getVelocity);function Xa(e){return!!(Ya(e)&&e.add)}function Za(e,t){let n=e.getValue(`willChange`);if(Xa(n))return n.add(t);if(!n&&gt.WillChange){let n=new gt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Qa(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var $a=`data-`+Qa(`framerAppearId`);function eo(e){return e.props[$a]}var to=typeof window<`u`;function no({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function ro(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Da(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&no(f,t))continue;let o={delay:n,...Oa(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){_r.update(()=>r.set(i));continue}let p=!1;if(to&&window.MotionHandoffAnimation){let n=eo(e);if(n){let e=window.MotionHandoffAnimation(n,t,_r);e!==null&&(o.startTime=e,p=!0)}}Za(e,t);let m=l??e.shouldReduceMotion;r.start(Ia(t,r,i,m&&Wa.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>_r.update(()=>{o&&Ja(e,o)});d.length?Promise.all(d).then(t):t()}return d}function io(e,t,n={}){let r=Ha(e,t,Ua(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?ro(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(io(e,t,{...n,delay:r+(typeof o==`function`?0:o)+xa(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function ao(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>io(e,t,n))):typeof t==`string`?io(e,t,n):Promise.all(ro(e,Ha(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var oo={test:e=>e===`auto`,parse:e=>e},so=e=>t=>t.test(e),co=[sn,B,Sn,xn,wn,Cn,oo],lo=e=>co.find(so(e));function uo(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||yt(e)}var fo=new Set([`auto`,`none`,`0`]);function po(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!fo.has(t)&&Rn(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=mi(n,i))}var mo=class extends Gi{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),rn(r))){let i=za(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Wa.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=lo(r),o=lo(i);if(on(r)!==on(i)&&Ii[n]){this.needsMeasurement=!0;return}if(a!==o){if(Ai(a)&&Ai(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ii[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||uo(e[t]))&&n.push(t);n.length&&po(e,n,t)}measure(){let{element:e,name:t}=this;return Ii[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},ho=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function go(e){return vt(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function _o(e){return vt(e)&&`ownerSVGElement`in e}var vo=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function yo(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var bo={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},xo=Oi.length;function So(e,t,n){let r=``,i=!0;for(let a=0;a<xo;a++){let o=Oi[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=vo(s,ui[o]);if(!c){i=!1;let t=bo[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${vo(a,ui.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Co(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(ki.has(e)){o=!0;continue}if(tn(e)){i[e]=n;continue}{let t=vo(n,ui[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=So(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var wo={offset:`stroke-dashoffset`,array:`stroke-dasharray`},To={offset:`strokeDashoffset`,array:`strokeDasharray`};function Eo(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?wo:To;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Do=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Oo(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Co(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Do)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Eo(d,i,a,o,!1)}function ko({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ao({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function jo(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Mo(e){return e===void 0||e===1}function No({scale:e,scaleX:t,scaleY:n}){return!Mo(e)||!Mo(t)||!Mo(n)}function Po(e){return No(e)||Fo(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Fo(e){return Io(e.x)||Io(e.y)}function Io(e){return e&&e!==`0%`}function Lo(e,t,n){return n+t*(e-n)}function Ro(e,t,n,r,i){return i!==void 0&&(e=Lo(e,i,r)),Lo(e,n,r)+t}function zo(e,t=0,n=1,r,i){e.min=Ro(e.min,t,n,r,i),e.max=Ro(e.max,t,n,r,i)}function Bo(e,{x:t,y:n}){zo(e.x,t.translate,t.scale,t.originPoint),zo(e.y,n.translate,n.scale,n.originPoint)}var Vo=.999999999999,H=1.0000000000001;function Ho(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Uo(e.x,-a.scroll.offset.x),Uo(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Bo(e,o)),r&&Po(a.latestValues)&&Ko(e,a.latestValues,a.layout?.layoutBox))}t.x<H&&t.x>Vo&&(t.x=1),t.y<H&&t.y>Vo&&(t.y=1)}function Uo(e,t){e.min+=t,e.max+=t}function Wo(e,t,n,r,i=.5){zo(e,t,n,Xn(e.min,e.max,i),r)}function Go(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ko(e,t,n){let r=n??e;Wo(e.x,Go(t.x,r.x),t.scaleX,t.scale,t.originX),Wo(e.y,Go(t.y,r.y),t.scaleY,t.scale,t.originY)}function qo(e,t){return ko(jo(e.getBoundingClientRect(),t))}function Jo(e,t,n){let r=qo(e,n),{scroll:i}=t;return i&&(Uo(r.x,i.offset.x),Uo(r.y,i.offset.y)),r}var{schedule:Yo,cancel:Xo}=gr(queueMicrotask,!1),Zo={x:!1,y:!1};function Qo(){return Zo.x||Zo.y}function $o(e){return e===`x`||e===`y`?Zo[e]?null:(Zo[e]=!0,()=>{Zo[e]=!1}):Zo.x||Zo.y?null:(Zo.x=Zo.y=!0,()=>{Zo.x=Zo.y=!1})}function es(e,t){let n=yo(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ts(e){return!(e.pointerType===`touch`||Qo())}function ns(e,t,n={}){let[r,i,a]=es(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!ts(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var rs=(e,t)=>t?e===t||rs(e,t.parentElement):!1,is=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,as=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function os(e){return as.has(e.tagName)||e.isContentEditable===!0}var ss=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function cs(e){return ss.has(e.tagName)||e.isContentEditable===!0}var ls=new WeakSet;function us(e){return t=>{t.key===`Enter`&&e(t)}}function ds(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var fs=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=us(()=>{if(ls.has(n))return;ds(n,`down`);let e=us(()=>{ds(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>ds(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function ps(e){return is(e)&&!Qo()}var ms=new WeakSet;function hs(e,t,n={}){let[r,i,a]=es(e,n),o=e=>{let r=e.currentTarget;if(!ps(e)||ms.has(e))return;ls.add(r),n.stopPropagation&&ms.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ls.has(r)&&ls.delete(r),ps(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||rs(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),go(e)&&(e.addEventListener(`focus`,e=>fs(e,i)),!os(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var gs=new WeakMap,_s,vs=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:_o(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ys=vs(`inline`,`width`,`offsetWidth`),bs=vs(`block`,`height`,`offsetHeight`);function xs({target:e,borderBoxSize:t}){gs.get(e)?.forEach(n=>{n(e,{get width(){return ys(e,t)},get height(){return bs(e,t)}})})}function Ss(e){e.forEach(xs)}function Cs(){typeof ResizeObserver<`u`&&(_s=new ResizeObserver(Ss))}function ws(e,t){_s||Cs();let n=yo(e);return n.forEach(e=>{let n=gs.get(e);n||(n=new Set,gs.set(e,n)),n.add(t),_s?.observe(e)}),()=>{n.forEach(e=>{let n=gs.get(e);n?.delete(t),n?.size||_s?.unobserve(e)})}}var Ts=new Set,Es;function Ds(){Es=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ts.forEach(t=>t(e))},window.addEventListener(`resize`,Es)}function Os(e){return Ts.add(e),Es||Ds(),()=>{Ts.delete(e),!Ts.size&&typeof Es==`function`&&(window.removeEventListener(`resize`,Es),Es=void 0)}}function ks(e,t){return typeof e==`function`?Os(e):ws(e,t)}var As={value:null,addProjectionMetrics:null};function js(e){return _o(e)&&e.tagName===`svg`}var Ms=e=>typeof e==`number`?e:parseFloat(e),Ns=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ps=()=>({x:Ns(),y:Ns()}),Fs=()=>({min:0,max:0}),Is=()=>({x:Fs(),y:Fs()}),Ls=new WeakMap;function Rs(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function zs(e){return typeof e==`string`||Array.isArray(e)}var Bs=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Vs=[`initial`,...Bs];function Hs(e){if(Rs(e.animate))return!0;for(let t=0;t<Vs.length;t++)if(zs(e[Vs[t]]))return!0;return!1}function Us(e){return!!(Hs(e)||e.variants)}function Ws(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Ya(i))e.addValue(r,i);else if(Ya(a))e.addValue(r,Ea(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Ea(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Gs={current:null},Ks={current:!1},qs=typeof window<`u`;function Js(){if(Ks.current=!0,qs){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Gs.current=e.matches;e.addEventListener(`change`,t),t()}else Gs.current=!1}}var Ys=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Xs={};function Zs(e){Xs=e}function Qs(){return Xs}var $s=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Gi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Qt.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,_r.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Hs(t),this.isVariantNode=Us(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Ya(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Ls.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Ks.current||Js(),this.shouldReduceMotion=Gs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),vr(this.notifyUpdate),vr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&pa.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new V({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Tt(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=ki.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&_r.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Xs){let t=Xs[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Is()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Ys.length;t++){let n=Ys[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Ws(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Ea(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(_t(n)||yt(n))?n=parseFloat(n):typeof n!=`number`&&!Kn.test(n)&&Kn.test(t)&&(n=mi(e,t)),this.setBaseTarget(e,Ya(n)?n.get():n)),Ya(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new wt),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Yo.render(this.render)}},ec=class extends $s{constructor(){super(...arguments),this.KeyframeResolver=mo}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Ya(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},tc=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function nc(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var rc={};function ic(e,{layout:t,layoutId:n}){return ki.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!rc[e]||e===`opacity`)}function ac(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Ya(r[t])||i&&Ya(i[t])||ic(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function oc(e){return window.getComputedStyle(e)}var sc=class extends ec{constructor(){super(...arguments),this.type=`html`,this.renderInstance=nc}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(ki.has(t))return this.projection?.isProjecting?wi(t):Ei(e,t);{let n=oc(e),r=(tn(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return qo(e,t)}build(e,t,n){Co(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ac(e,t,n)}},cc=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),lc=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function uc(e,t,n,r){nc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(cc.has(n)?n:Qa(n),t.attrs[n])}function dc(e,t,n){let r=ac(e,t,n);for(let n in e)if(Ya(e[n])||Ya(t[n])){let t=Oi.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var fc=class extends ec{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Is}getBaseTargetFromProps(e,t){return ki.has(t)?super.getBaseTargetFromProps(e,t)??wi(t):e[t]}getDefaultValue(e){return ki.has(e)?this.latestValues[e]??wi(e):void 0}readValueFromInstance(e,t){if(ki.has(t)){let e=fi(t);return e&&e.default||0}if(Do.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=cc.has(t)?t:Qa(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return dc(e,t,n)}build(e,t,n){Oo(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){uc(e,t,n,r)}mount(e){this.isSVGTag=lc(e.tagName),super.mount(e)}};function pc(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var mc=[...Bs].reverse();function hc(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>ao(e,t,n))),n=_c(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(mc.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?zs(g)||g===!1?g:void 0:h,v=zs(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||Rs(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=gc(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=Ha(e,n,Ua(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!pc(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=Ha(s,n)?.transition?.delayChildren;r.delay=xa(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Ha(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!Ya(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=_c(),i=!0}}}function gc(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!pc(t,e):!1}function _c(){let e={};for(let t of Bs)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function vc(e,t){e.min=t.min,e.max=t.max}function yc(e,t){vc(e.x,t.x),vc(e.y,t.y)}function bc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var xc=.9999,Sc=1.0001,Cc=-.01,wc=.01;function Tc(e){return e.max-e.min}function Ec(e,t,n){return Math.abs(e-t)<=n}function Dc(e,t,n,r=.5){e.origin=r,e.originPoint=Xn(t.min,t.max,e.origin),e.scale=Tc(n)/Tc(t),e.translate=Xn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xc&&e.scale<=Sc||isNaN(e.scale))&&(e.scale=1),(e.translate>=Cc&&e.translate<=wc||isNaN(e.translate))&&(e.translate=0)}function Oc(e,t,n,r){Dc(e.x,t.x,n.x,r?r.originX:void 0),Dc(e.y,t.y,n.y,r?r.originY:void 0)}function kc(e,t,n,r=0){e.min=(r?Xn(n.min,n.max,r):n.min)+t.min,e.max=e.min+Tc(t)}function Ac(e,t,n,r){kc(e.x,t.x,n.x,r?.x),kc(e.y,t.y,n.y,r?.y)}function jc(e,t,n,r=0){let i=r?Xn(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Tc(t)}function Mc(e,t,n,r){jc(e.x,t.x,n.x,r?.x),jc(e.y,t.y,n.y,r?.y)}function Nc(e,t,n,r,i){return e-=t,e=Lo(e,1/n,r),i!==void 0&&(e=Lo(e,1/i,r)),e}function Pc(e,t=0,n=1,r=.5,i,a=e,o=e){if(Sn.test(t)&&(t=parseFloat(t),t=Xn(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Xn(a.min,a.max,r);e===a&&(s-=t),e.min=Nc(e.min,t,n,s,i),e.max=Nc(e.max,t,n,s,i)}function Fc(e,t,[n,r,i],a,o){Pc(e,t[n],t[r],t[i],t.scale,a,o)}var Ic=[`x`,`scaleX`,`originX`],Lc=[`y`,`scaleY`,`originY`];function Rc(e,t,n,r){Fc(e.x,t,Ic,n?n.x:void 0,r?r.x:void 0),Fc(e.y,t,Lc,n?n.y:void 0,r?r.y:void 0)}function zc(e){return e.translate===0&&e.scale===1}function Bc(e){return zc(e.x)&&zc(e.y)}function Vc(e,t){return e.min===t.min&&e.max===t.max}function Hc(e,t){return Vc(e.x,t.x)&&Vc(e.y,t.y)}function Uc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Wc(e,t){return Uc(e.x,t.x)&&Uc(e.y,t.y)}function Gc(e){return Tc(e.x)/Tc(e.y)}function Kc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function qc(e){return[e(`x`),e(`y`)]}function Jc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Yc={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(B.test(e))e=parseFloat(e);else return e}return`${Jc(e,t.target.x)}% ${Jc(e,t.target.y)}%`}},Xc={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Kn.parse(e);if(i.length>5)return r;let a=Kn.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Xn(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Zc(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Qc=ho.length,$c=e=>typeof e==`number`||B.test(e);function el(e,t,n,r,i,a){i?(e.opacity=Xn(0,n.opacity??1,nl(r)),e.opacityExit=Xn(t.opacity??1,0,rl(r))):a&&(e.opacity=Xn(t.opacity??1,n.opacity??1,r));for(let i=0;i<Qc;i++){let a=ho[i],o=tl(t,a),s=tl(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||$c(o)===$c(s)?(e[a]=Math.max(Xn(Ms(o),Ms(s),r),0),(Sn.test(s)||Sn.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Xn(t.rotate||0,n.rotate||0,r))}function tl(e,t){return e[t]===void 0?e.borderRadius:e[t]}var nl=il(0,.5,Bt),rl=il(.5,.95,xt);function il(e,t,n){return r=>r<e?0:r>t?1:n(Ct(e,t,r))}function al(e,t,n){let r=Ya(e)?e:Ea(e);return r.start(Ia(``,r,t,n)),r.animation}function ol(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var sl=(e,t)=>e.depth-t.depth,cl=class{constructor(){this.children=[],this.isDirty=!1}add(e){pt(this.children,e),this.isDirty=!0}remove(e){mt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(sl),this.isDirty=!1,this.children.forEach(e)}};function ll(e,t){let n=Qt.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(vr(r),e(a-t))};return _r.setup(r,!0),()=>vr(r)}function ul(e){return Ya(e)?e.get():e}var dl=class{constructor(){this.members=[]}add(e){pt(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(mt(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(mt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},fl={borderRadius:{...Yc,applyTo:[...ho]},borderTopLeftRadius:Yc,borderTopRightRadius:Yc,borderBottomLeftRadius:Yc,borderBottomRightRadius:Yc,boxShadow:Xc},pl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(rc,{...fl,...rc});var ml={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},hl=[``,`X`,`Y`,`Z`],gl=1e3,_l=0;function vl(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=eo(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,_r,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yl(r)}function bl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=_l++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,As.value&&(ml.nodes=ml.calculatedTargetDeltas=ml.calculatedProjections=0),this.nodes.forEach(Cl),this.nodes.forEach(Nl),this.nodes.forEach(Pl),this.nodes.forEach(wl),As.addProjectionMetrics&&As.addProjectionMetrics(ml)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new cl)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new wt),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=_o(t)&&!js(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;_r.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ll(i,250),pl.hasAnimatedSinceResize&&(pl.hasAnimatedSinceResize=!1,this.nodes.forEach(Ml)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Vl,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Wc(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Oa(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Ml(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Fl),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Dl),this.nodes.forEach(El);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ol);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(kl),this.nodes.forEach(Al),this.nodes.forEach(jl),this.nodes.forEach(xl),this.nodes.forEach(Sl)):this.nodes.forEach(Ol),this.clearAllSnapshots();let e=Qt.now();Yt.delta=ht(0,1e3/60,e-Yt.timestamp),Yt.timestamp=e,Yt.isProcessing=!0,yr.update.process(Yt),yr.preRender.process(Yt),yr.render.process(Yt),Yt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Yo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tl),this.sharedNodes.forEach(Il)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_r.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_r.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Tc(this.snapshot.measuredBox.x)&&!Tc(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Is(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Bc(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Po(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Gl(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Is();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ql))){let{scroll:e}=this.root;e&&(Uo(t.x,e.offset.x),Uo(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Is();if(yc(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&yc(t,e),Uo(t.x,i.offset.x),Uo(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Is();yc(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Uo(r.x,-n.scroll.offset.x),Uo(r.y,-n.scroll.offset.y)),Po(n.latestValues)&&Ko(r,n.latestValues,n.layout?.layoutBox)}return Po(this.latestValues)&&Ko(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Is();yc(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Po(n.latestValues))continue;let r;n.instance&&(No(n.latestValues)&&n.updateSnapshot(),r=Is(),yc(r,n.measurePageBox())),Rc(t,n.latestValues,n.snapshot?.layoutBox,r)}return Po(this.latestValues)&&Rc(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Yt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Yt.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Is(),this.targetWithTransforms=Is()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ac(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):yc(this.target,this.layout.layoutBox),Bo(this.target,this.targetDelta)):yc(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),As.value&&ml.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||No(this.parent.latestValues)||Fo(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Is(),this.relativeTargetOrigin=Is(),Mc(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),yc(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Yt.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;yc(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ho(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Is());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bc(this.prevProjectionDelta.x,this.projectionDelta.x),bc(this.prevProjectionDelta.y,this.projectionDelta.y)),Oc(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Kc(this.projectionDelta.x,this.prevProjectionDelta.x)||!Kc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),As.value&&ml.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ps(),this.projectionDelta=Ps(),this.projectionDeltaWithTransform=Ps()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ps();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Is(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Bl));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Xn(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Xn(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Ll(o.x,e.x,n),Ll(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mc(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),zl(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Hc(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Is(),yc(f,this.relativeTarget)),c&&(this.animationValues=a,el(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(vr(this.pendingAnimation),void 0),this.pendingAnimation=_r.update(()=>{pl.hasAnimatedSinceResize=!0,this.motionValue||=Ea(0),this.motionValue.jump(0,!1),this.currentAnimation=al(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),ei(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(gl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Kl(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Is();let t=Tc(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Tc(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}yc(t,i),Ko(t,r),Oc(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new dl),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&vl(`z`,e,r,this.animationValues);for(let t=0;t<hl.length;t++)vl(`rotate${hl[t]}`,e,r,this.animationValues),vl(`skew${hl[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=ul(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=ul(t?.pointerEvents)||``),this.hasProjected&&!Po(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Zc(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in rc){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=rc[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?ul(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(El),this.root.sharedNodes.clear()}}}function xl(e){e.updateLayout()}function Sl(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)qc(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Tc(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;vc(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Kl(i,t.layoutBox,n)&&qc(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Tc(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Ps();Oc(o,n,t.layoutBox);let s=Ps();a?Oc(s,e.applyTransform(r,!0),t.measuredBox):Oc(s,n,t.layoutBox);let c=!Bc(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Is();Mc(s,t.layoutBox,i.layoutBox,o);let c=Is();Mc(c,n,a.layoutBox,o),Wc(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Cl(e){As.value&&ml.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function wl(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Tl(e){e.clearSnapshot()}function El(e){e.clearMeasurements()}function Dl(e){e.isLayoutDirty=!0,e.updateLayout()}function Ol(e){e.isLayoutDirty=!1}function kl(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Al(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function jl(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ml(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Nl(e){e.resolveTargetDelta()}function Pl(e){e.calcProjection()}function Fl(e){e.resetSkewAndRotation()}function Il(e){e.removeLeadSnapshot()}function Ll(e,t,n){e.translate=Xn(t.translate,0,n),e.scale=Xn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Rl(e,t,n,r){e.min=Xn(t.min,n.min,r),e.max=Xn(t.max,n.max,r)}function zl(e,t,n,r){Rl(e.x,t.x,n.x,r),Rl(e.y,t.y,n.y,r)}function Bl(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Vl={duration:.45,ease:[.4,0,.1,1]},Hl=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ul=Hl(`applewebkit/`)&&!Hl(`chrome/`)?Math.round:xt;function Wl(e){e.min=Ul(e.min),e.max=Ul(e.max)}function Gl(e){Wl(e.x),Wl(e.y)}function Kl(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ec(Gc(t),Gc(n),.2)}function ql(e){return e!==e.root&&e.scroll?.wasRoot}var Jl=bl({attachResizeListener:(e,t)=>ol(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Yl={current:void 0},Xl=bl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Yl.current){let e=new Jl({});e.mount(window),e.setOptions({layoutScroll:!0}),Yl.current=e}return Yl.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Zl=(0,y.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Ql(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function $l(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ql(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ql(e[t],null)}}}}function eu(...e){return y.useCallback($l(...e),e)}var tu=class extends y.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(go(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=go(e)&&e.offsetWidth||0,r=go(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function nu({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,y.useId)(),s=(0,y.useRef)(null),c=(0,y.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,y.useContext)(Zl),u=eu(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,y.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
10
+ [data-motion-pop-id="${o}"] {
11
+ position: absolute !important;
12
+ width: ${e}px !important;
13
+ height: ${u}px !important;
14
+ ${_}px !important;
15
+ ${v}px !important;
16
+ }
17
+ `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,b.jsx)(tu,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:y.cloneElement(e,{ref:u})})}var ru=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=ut(iu),d=(0,y.useId)(),f=(0,y.useRef)(n),p=(0,y.useRef)(r);dt(()=>{f.current=n,p.current=r});let m=!0,h=(0,y.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,y.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),y.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,b.jsx)(nu,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,b.jsx)(ft.Provider,{value:h,children:e})};function iu(){return new Map}function au(e=!0){let t=(0,y.useContext)(ft);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,y.useId)();(0,y.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,y.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var ou=e=>e.key||``;function su(e){let t=[];return y.Children.forEach(e,e=>{(0,y.isValidElement)(e)&&t.push(e)}),t}var cu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=au(o),f=(0,y.useMemo)(()=>su(e),[e]),p=o&&!u?[]:f.map(ou),m=(0,y.useRef)(!0),h=ut(()=>new Map),g=(0,y.useRef)(new Set),[_,v]=(0,y.useState)(f),[x,S]=(0,y.useState)(f);dt(()=>{o&&!u&&!x.length&&d?.()},[u,o,x.length,d]),dt(()=>{m.current=!1;for(let e=0;e<x.length;e++){let t=ou(x[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[x,p.length,p.join(`-`)]);let C=[];if(f!==_){let e=[...f],t=0;for(let n of x){let r=p.indexOf(ou(n));r===-1?(e.splice(t++,0,n),C.push(n)):t=r+C.length+1}return C.every(e=>h.get(ou(e)))?e=f:a===`wait`&&(e=C),S(su(e)),v(f),null}let{forceRender:w}=(0,y.useContext)(lt);return(0,b.jsx)(b.Fragment,{children:x.map(e=>{let _=ou(e),y=o&&!u?!1:f===x||p.includes(_);return(0,b.jsx)(ru,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(w?.(),v([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},_)})})},lu=(0,y.createContext)({strict:!1}),uu={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},du=!1;function fu(){if(du)return;let e={};for(let t in uu)e[t]={isEnabled:e=>uu[t].some(t=>!!e[t])};Zs(e),du=!0}function pu(){return fu(),Qs()}function mu(e){let t=pu();for(let n in e)t[n]={...t[n],...e[n]};Zs(t)}var hu=(0,y.createContext)({});function gu(e,t){if(Hs(e)){let{initial:t,animate:n}=e;return{initial:t===!1||zs(t)?t:void 0,animate:zs(n)?n:void 0}}return e.inherit===!1?{}:t}function _u(e){let{initial:t,animate:n}=gu(e,(0,y.useContext)(hu));return(0,y.useMemo)(()=>({initial:t,animate:n}),[vu(t),vu(n)])}function vu(e){return Array.isArray(e)?e.join(` `):e}var yu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bu(e,t,n){for(let r in t)!Ya(t[r])&&!ic(r,n)&&(e[r]=t[r])}function xu({transformTemplate:e},t){return(0,y.useMemo)(()=>{let n=yu();return Co(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Su(e,t){let n=e.style||{},r={};return bu(r,n,e),Object.assign(r,xu(e,t)),r}function Cu(e,t){let n={},r=Su(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var wu=()=>({...yu(),attrs:{}});function Tu(e,t,n,r){let i=(0,y.useMemo)(()=>{let n=wu();return Oo(n,t,lc(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};bu(t,e.style,e),i.style={...t,...i.style}}return i}var Eu=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Du(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Eu.has(e)}function Ou(e,t){return e.startsWith(`on`)?!Du(e):t?.(e)??!Du(e)}function ku(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Ya(e[a])||(Ou(a,r)||n===!0&&Du(a)||!t&&!Du(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var Au=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function ju(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Au.indexOf(e)>-1||/[A-Z]/u.test(e))}function Mu(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??ju(e)?Tu:Cu)(t,r,i,e),l=ku(t,typeof e==`string`,a,s),u=e===y.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,y.useMemo)(()=>Ya(d)?d.get():d,[d]);return(0,y.createElement)(e,{...u,children:f})}function Nu({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Pu(n,r,i,e),renderState:t()}}function Pu(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=ul(a[e]);let{initial:o,animate:s}=e,c=Hs(e),l=Us(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Rs(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Va(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Fu=e=>(t,n)=>{let r=(0,y.useContext)(hu),i=(0,y.useContext)(ft),a=()=>Nu(e,t,r,i);return n?a():ut(a)},Iu=Fu({scrapeMotionValuesFromProps:ac,createRenderState:yu}),Lu=Fu({scrapeMotionValuesFromProps:dc,createRenderState:wu}),Ru=Symbol.for(`motionComponentSymbol`);function zu(e,t,n){let r=(0,y.useRef)(n);(0,y.useInsertionEffect)(()=>{r.current=n});let i=(0,y.useRef)(null);return(0,y.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Bu=(0,y.createContext)({});function Vu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Hu(e,t,n,r,i,a){let{visualElement:o}=(0,y.useContext)(hu),s=(0,y.useContext)(lu),c=(0,y.useContext)(ft),l=(0,y.useContext)(Zl),u=l.reducedMotion,d=l.skipAnimations,f=(0,y.useRef)(null),p=(0,y.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,y.useContext)(Bu);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Uu(f.current,n,i,h);let g=(0,y.useRef)(!1);(0,y.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[$a],v=(0,y.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return dt(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),dt(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,y.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Uu(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Wu(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Vu(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Wu(e){if(e)return e.options.allowProjection===!1?Wu(e.parent):e.projection}function Gu(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&mu(r);let a=n?n===`svg`:ju(e),o=a?Lu:Iu;function s(n,s){let c,l={...(0,y.useContext)(Zl),...n,layoutId:Ku(n)},{isStatic:u,isValidProp:d}=l,f=_u(n),p=o(n,u);if(!u&&typeof window<`u`){qu(l,r);let t=Ju(l);c=t.MeasureLayout,f.visualElement=Hu(e,p,l,i,t.ProjectionNode,a)}return(0,b.jsxs)(hu.Provider,{value:f,children:[c&&f.visualElement?(0,b.jsx)(c,{visualElement:f.visualElement,...l}):null,Mu(e,n,zu(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,y.forwardRef)(s);return c[Ru]=e,c}function Ku({layoutId:e}){let t=(0,y.useContext)(lt).id;return t&&e!==void 0?t+`-`+e:e}function qu(e,t){(0,y.useContext)(lu).strict}function Ju(e){let{drag:t,layout:n}=pu();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Yu(e,t){if(typeof Proxy>`u`)return Gu;let n=new Map,r=(n,r)=>Gu(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Gu(a,void 0,e,t)),n.get(a))})}var Xu=(e,t)=>t.isSVG??ju(e)?new fc(t):new sc(t,{allowProjection:e!==y.Fragment}),Zu=class extends tc{constructor(e){super(e),e.animationState||=hc(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Rs(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Qu=0,$u={animation:{Feature:Zu},exit:{Feature:class extends tc{constructor(){super(...arguments),this.id=Qu++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Ha(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function ed(e){return{point:{x:e.pageX,y:e.pageY}}}var td=e=>t=>is(t)&&e(t,ed(t));function nd(e,t,n,r){return ol(e,t,td(n),r)}var rd=({current:e})=>e?e.ownerDocument.defaultView:null,id=(e,t)=>Math.abs(e-t);function U(e,t){let n=id(e.x,t.x),r=id(e.y,t.y);return Math.sqrt(n**2+r**2)}var W=new Set([`auto`,`scroll`]),ad=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=od(this.lastRawMoveEventInfo,this.transformPagePoint));let e=cd(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=U(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Qt.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=od(t,this.transformPagePoint),this.hasPendingMove=!0,_r.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=cd(e.type===`pointercancel`?this.lastMoveEventInfo:od(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!is(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=od(ed(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Yt;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,cd(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=St(nd(this.contextWindow,`pointermove`,this.handlePointerMove,d),nd(this.contextWindow,`pointerup`,this.handlePointerUp,d),nd(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(W.has(e.overflowX)||W.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),_r.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),vr(this.updatePoint)}};function od(e,t){return t?{point:t(e.point)}:e}function sd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cd({point:e},t){return{point:e,delta:sd(e,ud(t)),offset:sd(e,ld(t)),velocity:dd(t,.1)}}function ld(e){return e[0]}function ud(e){return e[e.length-1]}function dd(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=ud(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Tt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Tt(t)*2&&(r=e[1]);let a=Et(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function fd(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xn(n,e,r.max):Math.min(e,n)),e}function pd(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function md(e,{top:t,left:n,bottom:r,right:i}){return{x:pd(e.x,n,i),y:pd(e.y,t,r)}}function hd(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gd(e,t){return{x:hd(e.x,t.x),y:hd(e.y,t.y)}}function _d(e,t){let n=.5,r=Tc(e),i=Tc(t);return i>r?n=Ct(t.min,t.max-r,e.min):r>i&&(n=Ct(e.min,e.max-i,t.min)),ht(0,1,n)}function vd(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var yd=.35;function bd(e=yd){return e===!1?e=0:e===!0&&(e=yd),{x:xd(e,`left`,`right`),y:xd(e,`top`,`bottom`)}}function xd(e,t,n){return{min:Sd(e,t),max:Sd(e,n)}}function Sd(e,t){return typeof e==`number`?e:e[t]||0}var Cd=new WeakMap,wd=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Is(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$o(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Sn.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Tc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&_r.update(()=>i(e,t),!1,!0),Za(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Od(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&_r.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new ad(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:rd(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&_r.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Dd(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=fd(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Vu(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?md(n.layoutBox,e):!1,this.elastic=bd(t),r!==this.constraints&&!Vu(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&qc(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=vd(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Vu(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Jo(n,r.root,this.visualElement.getTransformPagePoint()),a=gd(r.layout.layoutBox,i);if(t){let e=t(Ao(a));this.hasMutatedConstraints=!!e,e&&(a=ko(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=qc(o=>{if(!Dd(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Za(this.visualElement,e),n.start(Ia(e,n,0,t,this.visualElement,!1))}stopAnimation(){qc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();qc(e=>{if(!Dd(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Xn(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Vu(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};qc(e=>{let t=this.getAxisMotionValue(e).get();i[e]=_d({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),qc(t=>{let n=this.getAxisMotionValue(t);if(!Dd(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Xn(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Cd.set(this.visualElement,this);let e=this.visualElement.current,t=nd(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&cs(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Vu(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Ed(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_r.read(r);let o=ol(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(qc(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=yd,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Td(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Ed(e,t,n){let r=ks(e,Td(n)),i=ks(t,Td(n));return()=>{r(),i()}}function Dd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Od(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var kd=class extends tc{constructor(e){super(e),this.removeGroupControls=xt,this.removeListeners=xt,this.controls=new wd(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xt}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Ad=e=>(t,n)=>{e&&_r.update(()=>e(t,n),!1,!0)},jd=class extends tc{constructor(){super(...arguments),this.removePointerDownListener=xt}onPointerDown(e){this.session=new ad(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rd(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ad(e),onStart:Ad(t),onMove:Ad(n),onEnd:(e,t)=>{delete this.session,r&&_r.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=nd(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Md=!1,Nd=class extends y.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Md&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),pl.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Md=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||_r.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Yo.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Md=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Pd(e){let[t,n]=au(),r=(0,y.useContext)(lt);return(0,b.jsx)(Nd,{...e,layoutGroup:r,switchLayoutGroup:(0,y.useContext)(Bu),isPresent:t,safeToRemove:n})}var Fd={pan:{Feature:jd},drag:{Feature:kd,ProjectionNode:Xl,MeasureLayout:Pd}};function Id(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&_r.postRender(()=>i(t,ed(t)))}var Ld=class extends tc{mount(){let{current:e}=this.node;e&&(this.unmount=ns(e,(e,t)=>(Id(this.node,t,`Start`),e=>Id(this.node,e,`End`))))}unmount(){}},Rd=class extends tc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=St(ol(this.node.current,`focus`,()=>this.onFocus()),ol(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function zd(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&_r.postRender(()=>i(t,ed(t)))}var Bd=class extends tc{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=hs(e,(e,t)=>(zd(this.node,t,`Start`),(e,{success:t})=>zd(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Vd=new WeakMap,Hd=new WeakMap,Ud=e=>{let t=Vd.get(e.target);t&&t(e)},Wd=e=>{e.forEach(Ud)};function Gd({root:e,...t}){let n=e||document;Hd.has(n)||Hd.set(n,{});let r=Hd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Wd,{root:e,...t})),r[i]}function Kd(e,t,n){let r=Gd(t);return Vd.set(e,n),r.observe(e),()=>{Vd.delete(e),r.unobserve(e)}}var qd={some:0,all:1},Jd=class extends tc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:qd[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Kd(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Yd(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Yd({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Xd={inView:{Feature:Jd},tap:{Feature:Bd},focus:{Feature:Rd},hover:{Feature:Ld}},Zd={layout:{ProjectionNode:Xl,MeasureLayout:Pd}},Qd=Yu({...$u,...Xd,...Fd,...Zd},Xu);async function $d(e){let t=await fetch(e,{headers:{accept:`application/json`}});if(!t.ok)throw Error(`${t.status} ${e}`);return await t.json()}var ef=2500,tf=8e3;function nf(){return ot({queryKey:[`version`],queryFn:()=>$d(`/api/version`),staleTime:6e5,refetchInterval:36e5})}var rf=20,af=40;function of(){return st({queryKey:[`overview`],queryFn:({pageParam:e})=>$d(`/api/overview?limit=${rf}&offset=${e}`),initialPageParam:0,getNextPageParam:e=>e.has_more?e.offset+e.limit:void 0,refetchInterval:e=>(e.state.data?.pages[0]?.active_workers??0)>0?ef:tf})}function sf(e){return st({queryKey:[`session`,e],queryFn:({pageParam:t})=>$d(`/api/sessions/${encodeURIComponent(e)}?limit=${af}&offset=${t}`),initialPageParam:0,getNextPageParam:e=>e.has_more?e.offset+e.limit:void 0,enabled:e!==null,refetchInterval:e=>(e.state.data?.pages[0]?.active_count??0)>0?ef:tf})}function cf(e){return ot({queryKey:[`worker`,e],queryFn:()=>$d(`/api/workers/${encodeURIComponent(e)}`),enabled:e!==null,refetchInterval:e=>{let t=e.state.data?.status;return t===`running`||t===`queued`?ef:!1}})}function lf(e,t){return ot({queryKey:[`events`,e],queryFn:()=>$d(`/api/workers/${encodeURIComponent(e)}/events?limit=400`),enabled:e!==null&&t,refetchInterval:4e3})}function uf(e,t,n){let r=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let i=r.current;if(!i||!e)return;let a=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&!t&&n()},{rootMargin:`200px`});return a.observe(i),()=>a.disconnect()},[e,t,n]),r}var df={queued:`排队中`,running:`运行中`,completed:`已完成`,failed:`失败`,cancelled:`已取消`,lost:`已丢失`},ff={starting:`启动中`,thinking:`思考中`,command:`执行命令`,editing:`改文件`,reporting:`汇报中`},pf={queued:{text:`text-yellow`,bg:`bg-yellow`},running:{text:`text-orange`,bg:`bg-orange`},completed:{text:`text-green`,bg:`bg-green`},failed:{text:`text-red`,bg:`bg-red`},cancelled:{text:`text-gray`,bg:`bg-gray`},lost:{text:`text-indigo`,bg:`bg-indigo`}};function mf(e,t=200){if(!e)return``;let n=e.replace(/```[\s\S]*?```/g,` `).replace(/`([^`]*)`/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/^\s*\|?\s*-{2,}[-|\s:]*$/gm,` `).replace(/\|/g,` `).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}function hf(e,t=Date.now()){if(!e)return`—`;let n=Date.parse(e);if(Number.isNaN(n))return`—`;let r=Math.round(Math.max(0,t-n)/1e3);if(r<45)return`刚刚`;let i=Math.round(r/60);if(i<60)return`${i} 分钟前`;let a=Math.round(i/60);return a<36?`${a} 小时前`:`${Math.round(a/24)} 天前`}function gf(e){if(!e)return`—`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`—`;let n=e=>String(e).padStart(2,`0`);return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function _f(e){if(e==null)return`—`;let t=Math.floor(e/1e3);if(t<60)return`${t} 秒`;let n=Math.floor(t/60);return n<60?`${n} 分 ${t%60} 秒`:`${Math.floor(n/60)} 小时 ${n%60} 分`}function vf(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function yf(e,t=8){return e?e.length>t?e.slice(-t):e:`—`}function bf(e,t){return t&&e.startsWith(t)?e.slice(t.length).replace(/^\/+/,``):e}function xf(e,t){return t?`未归入 session`:e}function Sf({status:e,size:t=8}){return(0,b.jsx)(`span`,{className:`inline-block shrink-0 rounded-full ${pf[e].bg} ${e===`running`?`animate-pulse`:``}`,style:{width:t,height:t},"aria-hidden":!0})}function Cf({status:e,phase:t,className:n=``}){let r=e===`running`&&t?ff[t]:df[e];return(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 ${n}`,children:[(0,b.jsx)(Sf,{status:e}),(0,b.jsx)(`span`,{className:e===`running`?`text-orange`:e===`failed`?`text-red`:`text-label-2`,children:r})]})}function wf({counts:e,total:t,height:n=4}){return(0,b.jsx)(`span`,{className:`flex w-full overflow-hidden rounded-full bg-fill`,style:{height:n},children:[`running`,`queued`,`completed`,`failed`,`lost`,`cancelled`].map(n=>{let r=e[n]??0;return r?(0,b.jsx)(`span`,{className:pf[n].bg,style:{width:`${r/t*100}%`},title:`${df[n]} ${r}`},n):null})})}function Tf({session:e,active:t,onSelect:n}){let r=e.active_count>0,i=e.title??xf(e.id,e.unsessioned);return(0,b.jsxs)(`button`,{type:`button`,onClick:n,"aria-current":t?`page`:void 0,className:`flex min-h-[44px] w-full items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors duration-150 ${t?`bg-blue/12 text-label`:`hover:bg-fill`}`,children:[r?(0,b.jsx)(Sf,{status:`running`,size:8}):(0,b.jsx)(`span`,{className:`inline-block h-2 w-2 shrink-0 rounded-full bg-fill-2`,"aria-hidden":!0}),(0,b.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,b.jsx)(`span`,{className:`t-subhead block truncate ${e.unsessioned?`italic text-label-2`:``}`,children:i}),(0,b.jsxs)(`span`,{className:`t-caption block truncate text-label-2`,children:[r?(0,b.jsxs)(`span`,{className:`text-orange`,children:[e.active_count,` 路运行中`]}):hf(e.last_activity_at),e.title&&!e.unsessioned&&(0,b.jsxs)(`span`,{className:`mono`,children:[` · `,e.id]})]})]}),(0,b.jsx)(`span`,{className:`t-caption mono shrink-0 rounded-full bg-fill px-2 py-0.5 text-label-2`,children:e.worker_count})]})}function Ef(){let{data:e}=nf();if(!e)return null;let t=e.update_available||e.integrity_matches===!1;return(0,b.jsxs)(`div`,{className:`border-t border-separator-soft px-5 py-3 ${t?`bg-yellow/15`:``}`,children:[(0,b.jsxs)(`div`,{className:`t-caption flex items-center gap-2 text-label-2`,children:[(0,b.jsxs)(`span`,{className:`mono`,children:[`v`,e.installed.version]}),e.latest&&!t&&(0,b.jsx)(`span`,{children:`已是最新`}),e.source===`offline`&&(0,b.jsx)(`span`,{title:e.error??``,children:`未能联系 npm`})]}),t&&(0,b.jsxs)(`div`,{className:`t-footnote mt-1 text-label`,children:[e.update_available?(0,b.jsxs)(b.Fragment,{children:[`有新版本 `,(0,b.jsx)(`span`,{className:`mono`,children:e.latest?.version}),`。`]}):(0,b.jsx)(b.Fragment,{children:`安装文件与发布版不一致。`}),(0,b.jsx)(`code`,{className:`mono mt-1 block select-all rounded bg-fill px-2 py-1 text-[12px]`,children:e.install_command}),(0,b.jsx)(`span`,{className:`t-caption text-label-2`,children:`装完重启 Claude Code / Codex 才会换成新版本。`})]})]})}function Df({pages:e,hasMore:t,loadingMore:n,loadMore:r,selected:i,onSelect:a}){let o=e?.[0],s=e?.flatMap(e=>e.sessions)??[],c=s.filter(e=>e.active_count>0),l=s.filter(e=>e.active_count===0),u=uf(t,n,r);return(0,b.jsxs)(`aside`,{className:`flex h-full min-h-0 flex-col border-r border-separator-soft bg-bg-2`,children:[(0,b.jsxs)(`div`,{className:`px-5 pt-5 pb-3`,children:[(0,b.jsx)(`h1`,{className:`t-title2`,children:`Sessions`}),(0,b.jsx)(`p`,{className:`t-footnote mt-0.5 text-label-2`,children:o?`${o.total_workers} 路 worker · ${o.active_workers} 运行中`:`读取中…`})]}),(0,b.jsxs)(`nav`,{className:`min-h-0 flex-1 overflow-y-auto px-2 pb-4`,children:[c.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`div`,{className:`group-header px-3 pt-2 pb-1`,children:`运行中`}),c.map(e=>(0,b.jsx)(Tf,{session:e,active:e.id===i,onSelect:()=>a(e.id)},e.id))]}),(0,b.jsx)(`div`,{className:`group-header px-3 pt-4 pb-1`,children:`全部`}),l.map(e=>(0,b.jsx)(Tf,{session:e,active:e.id===i,onSelect:()=>a(e.id)},e.id)),o&&s.length===0&&(0,b.jsx)(`p`,{className:`t-subhead px-3 py-6 text-label-2`,children:`还没有 worker。`}),(0,b.jsx)(`div`,{ref:u,className:`t-caption py-3 text-center text-label-3`,children:t?n?`加载中…`:`还有 ${(o?.total_sessions??0)-s.length} 个`:o&&s.length>0?`共 ${s.length} 个 session`:``})]}),(0,b.jsx)(Ef,{}),o&&(0,b.jsx)(`p`,{className:`t-caption mono truncate border-t border-separator-soft px-5 py-2.5 text-label-3`,title:o.store,children:o.store})]})}var G=typeof document<`u`?y.useLayoutEffect:()=>{};function Of(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var kf=y.createContext(void 0);function Af(e){let t=y.useContext(kf);if(t===void 0&&!e)throw Error(Of(72));return t}var jf={};function Mf(e,t){let n=y.useRef(jf);return n.current===jf&&(n.current=e(t)),n}var Nf=[];function Pf(e){y.useEffect(e,Nf)}var Ff=0,If=class e{static create(){return new e}currentId=Ff;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ff,t()},e)}isStarted(){return this.currentId!==Ff}clear=()=>{this.currentId!==Ff&&(clearTimeout(this.currentId),this.currentId=Ff)};disposeEffect=()=>this.clear};function Lf(){let e=Mf(If.create).current;return Pf(e.disposeEffect),e}function Rf(){return typeof window<`u`}function zf(e){return Hf(e)?(e.nodeName||``).toLowerCase():`#document`}function Bf(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vf(e){return((Hf(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Hf(e){return Rf()?e instanceof Node||e instanceof Bf(e).Node:!1}function Uf(e){return Rf()?e instanceof Element||e instanceof Bf(e).Element:!1}function Wf(e){return Rf()?e instanceof HTMLElement||e instanceof Bf(e).HTMLElement:!1}function Gf(e){return!Rf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Bf(e).ShadowRoot}function Kf(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=np(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qf(e){return/^(table|td|th)$/.test(zf(e))}function K(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Jf=/transform|translate|scale|rotate|perspective|filter/,Yf=/paint|layout|strict|content/,Xf=e=>!!e&&e!==`none`,Zf;function Qf(e){let t=Uf(e)?np(e):e;return Xf(t.transform)||Xf(t.translate)||Xf(t.scale)||Xf(t.rotate)||Xf(t.perspective)||!ep()&&(Xf(t.backdropFilter)||Xf(t.filter))||Jf.test(t.willChange||``)||Yf.test(t.contain||``)}function $f(e){let t=ip(e);for(;Wf(t)&&!tp(t);){if(Qf(t))return t;if(K(t))return null;t=ip(t)}return null}function ep(){return Zf??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Zf}function tp(e){return/^(html|body|#document)$/.test(zf(e))}function np(e){return Bf(e).getComputedStyle(e)}function rp(e){return Uf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ip(e){if(zf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Gf(e)&&e.host||Vf(e);return Gf(t)?t.host:t}function ap(e){let t=ip(e);return tp(t)?(e.ownerDocument||e).body:Wf(t)&&Kf(t)?t:ap(t)}function op(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ap(e),i=r===e.ownerDocument?.body,a=Bf(r);if(i){let e=sp(a);return t.concat(a,a.visualViewport||[],Kf(r)?r:[],e&&n?op(e):[])}return t.concat(r,op(r,[],n))}function sp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cp(e){let t=Mf(lp,e).current;return t.next=e,G(t.effect),t}function lp(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var up=y[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],dp=up&&up!==y.useLayoutEffect?up:e=>e();function q(e){let t=Mf(fp).current;return t.next=e,dp(t.effect),t.trampoline}function fp(){let e={next:void 0,callback:pp,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function pp(){}var mp=typeof navigator<`u`,hp=xp(),gp=Cp(),_p=Sp();typeof CSS>`u`||!CSS.supports||CSS.supports(`-webkit-backdrop-filter:none`),hp.platform===`MacIntel`&&hp.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(hp.platform),mp&&/firefox/i.test(_p);var vp=mp&&/apple/i.test(navigator.vendor);mp&&/Edg/i.test(_p),mp&&/android/i.test(gp)||/android/i.test(_p);var yp=mp&&gp.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,bp=_p.includes(`jsdom/`);function xp(){if(!mp)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function Sp(){if(!mp)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Cp(){if(!mp)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var wp=`data-base-ui-focusable`,Tp=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Ep(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Dp(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Gf(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Op(e){return`composedPath`in e?e.composedPath()[0]:e.target}function kp(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ap(e){return e.matches(`html,body`)}function jp(e){return e?.ownerDocument||document}function Mp(e){return Wf(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Np(e){if(!e||bp)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Pp(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Pp(e,t.id,n)])}function Fp(e){e.preventDefault(),e.stopPropagation()}function Ip(e){return`nativeEvent`in e}function Lp(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Rp(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var zp=[`top`,`right`,`bottom`,`left`],Bp=Math.min,Vp=Math.max,Hp=Math.round,Up=Math.floor,Wp=e=>({x:e,y:e}),Gp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Kp(e,t,n){return Vp(e,Bp(t,n))}function qp(e,t){return typeof e==`function`?e(t):e}function Jp(e){return e.split(`-`)[0]}function Yp(e){return e.split(`-`)[1]}function Xp(e){return e===`x`?`y`:`x`}function Zp(e){return e===`y`?`height`:`width`}function Qp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $p(e){return Xp(Qp(e))}function em(e,t,n){n===void 0&&(n=!1);let r=Yp(e),i=$p(e),a=Zp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lm(o)),[o,lm(o)]}function tm(e){let t=lm(e);return[nm(e),t,nm(t)]}function nm(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var rm=[`left`,`right`],im=[`right`,`left`],am=[`top`,`bottom`],om=[`bottom`,`top`];function sm(e,t,n){switch(e){case`top`:case`bottom`:return n?t?im:rm:t?rm:im;case`left`:case`right`:return t?am:om;default:return[]}}function cm(e,t,n,r){let i=Yp(e),a=sm(Jp(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nm)))),a}function lm(e){let t=Jp(e);return Gp[t]+e.slice(t.length)}function um(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function dm(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:um(e)}function fm(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pm(e,t,n){return Math.floor(e/t)!==n}function mm(e,t){return t<0||t>=e.current.length}function hm(e,t){return _m(e,{disabledIndices:t})}function gm(e,t){return _m(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function _m(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&Sm(e,a,r));return a}function vm(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f=[],p={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(e==null)return;let i=e.closest(`[role="row"]`);i&&(m=!0),(i!==t||n===-1)&&(t=i,n+=1,f[n]=[]),f[n].push(r),p[r]=n})}let h=m&&f.length>0&&f.some(e=>e.length!==a);function g(t){if(!h||l===-1)return;let n=p[l];if(n==null)return;let i=f[n].indexOf(l),a=t===`up`?n-1:n+1;r&&(a<0?a=f.length-1:a>=f.length&&(a=0));let s=new Set;for(;a>=0&&a<f.length&&!s.has(a);){s.add(a);let n=f[a];if(n.length===0){a=t===`up`?a-1:a+1;continue}let c=Math.min(i,n.length-1);for(let t=c;t>=0;--t){let r=n[t];if(!Sm(e,r,o))return r}a=t===`up`?a-1:a+1,r&&(a<0?a=f.length-1:a>=f.length&&(a=0))}}if(t.key===`ArrowUp`){let n=g(`up`);if(n!==void 0)u&&Fp(t),d=n;else{if(u&&Fp(t),l===-1)d=c;else if(d=_m(e,{startingIndex:d,amount:a,decrement:!0,disabledIndices:o}),r&&(l-a<s||d<0)){let e=l%a,t=c%a,n=c-(t-e);d=t===e?c:t>e?n:n-a}mm(e,d)&&(d=l)}}if(t.key===`ArrowDown`){let n=g(`down`);n===void 0?(u&&Fp(t),l===-1?d=s:(d=_m(e,{startingIndex:l,amount:a,disabledIndices:o}),r&&l+a>c&&(d=_m(e,{startingIndex:l%a-a,amount:a,disabledIndices:o}))),mm(e,d)&&(d=l)):(u&&Fp(t),d=n)}if(n===`both`){let n=Up(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&Fp(t),l%a===a-1?r&&(d=_m(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=_m(e,{startingIndex:l,disabledIndices:o}),r&&pm(d,a,n)&&(d=_m(e,{startingIndex:l-l%a-1,disabledIndices:o}))),pm(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&Fp(t),l%a===0?r&&(d=_m(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=_m(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&pm(d,a,n)&&(d=_m(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),pm(d,a,n)&&(d=l));let s=Up(c/a)===n;mm(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:_m(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function ym(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function bm(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function xm(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Sm(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r?r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`:!1}var Cm={...y},wm=0;function Tm(e,t=`mui`){let[n,r]=y.useState(e),i=e||n;return y.useEffect(()=>{n??(wm+=1,r(`${t}-${wm}`))},[n,t]),i}var Em=Cm.useId;function Dm(e,t){if(Em!==void 0){let n=Em();return e??(t?`${t}-${n}`:n)}return Tm(e,t)}function Om(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var km=y.createContext(null),Am=y.createContext(null),jm=()=>y.useContext(km)?.id||null,Mm=e=>{let t=y.useContext(Am);return e??t};function Nm(){}var Pm=Object.freeze([]),Fm=Object.freeze({}),Im={style:{transition:`none`}},Lm={fallbackAxisSide:`end`},Rm=`none`,zm=`trigger-hover`,Bm=`trigger-focus`,Vm=`outside-press`,Hm=`escape-key`,Um=`disabled`,Wm=`imperative-action`;function Gm(e,t,n,r){let i=!1,a=!1,o=r??Fm;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Km(e){return`data-base-ui-${e}`}Km(`safe-polygon`),`${Tp}`;function qm(e,t,n){if(n&&!Lp(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var Jm=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new If,currentIdRef:{current:null},currentContextRef:{current:null}});function Ym(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=y.useRef(n),a=y.useRef(n),o=y.useRef(null),s=y.useRef(null),c=Lf();return(0,b.jsx)(Jm.Provider,{value:y.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Xm(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=y.useContext(Jm),[p,m]=y.useState(!1);return G(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(i&&o.current&&!a&&o.current===r){if(m(!1),c)return f.start(c,e),()=>{f.clear()};e()}},[i,a,r,o,s,c,l,u,f]),G(()=>{if(!i||!a)return;let e=u.current,t=o.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=r,s.current={open:0,close:qm(l.current,`close`)},t!==null&&t!==r?(f.clear(),m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Gm(Rm))):(m(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,l,u,f]),G(()=>()=>{u.current=null},[u]),y.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function Zm(e,t,n,r){let i=Mf($m).current;return eh(i,e,t,n,r)&&nh(i,[e,t,n,r]),i.callback}function Qm(e){let t=Mf($m).current;return th(t,e)&&nh(t,e),t.callback}function $m(){return{callback:null,cleanup:null,refs:[]}}function eh(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function th(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function nh(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var rh=null;globalThis.requestAnimationFrame;var ih=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},ah=class e{static create(){return new e}static request(e){return ih.request(e)}static cancel(e){return ih.cancel(e)}currentId=rh;request(e){this.cancel(),this.currentId=ih.request(()=>{this.currentId=rh,e()})}cancel=()=>{this.currentId!==rh&&(ih.cancel(this.currentId),this.currentId=rh)};disposeEffect=()=>this.cancel};function oh(){let e=Mf(ah.create).current;return Pf(e.disposeEffect),e}function sh(e){return e?.ownerDocument||document}var ch=19;function lh(e){return ch>=e}function uh(e){if(!y.isValidElement(e))return null;let t=e,n=t.props;return(lh(19)?n?.ref:t.ref)??null}function dh(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function fh(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ph(e,t){return typeof e==`function`?e(t):e}function mh(e,t){return typeof e==`function`?e(t):e}var hh={};function gh(e,t,n,r,i){let a={...Sh(e,hh)};return t&&(a=vh(a,t)),n&&(a=vh(a,n)),r&&(a=vh(a,r)),i&&(a=vh(a,i)),a}function _h(e){if(e.length===0)return hh;if(e.length===1)return Sh(e[0],hh);let t={...Sh(e[0],hh)};for(let n=1;n<e.length;n+=1)t=vh(t,e[n]);return t}function vh(e,t){return xh(t)?t(e):yh(e,t)}function yh(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=dh(e.style,r);break;case`className`:e[n]=Th(e.className,r);break;default:e[n]=bh(n,r)?Ch(e[n],r):r}}return e}function bh(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function xh(e){return typeof e==`function`}function Sh(e,t){return xh(e)?e(t):e??hh}function Ch(e,t){return t?e?n=>{if(Eh(n)){let r=n;wh(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function wh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Th(e,t){return t?e?t+` `+e:t:e}function Eh(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Dh(e,t,n={}){let r=t.render,i=Oh(t,n);return n.enabled===!1?null:kh(e,r,i,n.state??Fm)}function Oh(e,t={}){let{className:n,style:r,render:i}=e,{state:a=Fm,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ph(n,a):void 0,d=l?mh(r,a):void 0,f=l?fh(a,c):Fm,p=l?dh(f,Array.isArray(s)?_h(s):s)??Fm:Fm;return typeof document<`u`&&(l?p.ref=Array.isArray(o)?Qm([p.ref,uh(i),...o]):Zm(p.ref,uh(i),o):Zm(null,null)),l?(u!==void 0&&(p.className=Th(p.className,u)),d!==void 0&&(p.style=dh(p.style,d)),p):Fm}function kh(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=gh(n,t.props);return e.ref=n.ref,y.cloneElement(t,e)}if(e&&typeof e==`string`)return Ah(e,n);throw Error(Of(8))}function Ah(e,t){return e===`button`?(0,y.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,y.createElement)(`img`,{alt:``,...t,key:t.key}):y.createElement(e,t)}var jh=c(m()),Mh=y.createContext(null),Nh=()=>y.useContext(Mh),Ph=Km(`portal`);function Fh(e={}){let{ref:t,container:n,componentProps:r=Fm,elementProps:i,elementState:a}=e,o=Dm(),s=Nh()?.portalNode,[c,l]=y.useState(null),[u,d]=y.useState(null),f=y.useRef(null);G(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(Hf(n)?n:n.current))??s??document.body;if(e==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==e&&(f.current=e,d(null),l(e))},[n,s,o]);let p=Dh(`div`,r,{ref:[t,d],state:a,props:[{id:o,[Ph]:``},i]});return{portalNode:u,portalSubtree:c&&p?jh.createPortal(p,c):null}}function Ih(e){return e==null?e:`current`in e?e.current:e}function Lh(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Rh(e){return e!=null&&e.clientX!=null}function zh(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:l=null,y:u=null}=t,d=y.useRef(!1),f=y.useRef(null),[p,m]=y.useState(),[h,g]=y.useState([]),_=q((e,t)=>{d.current||(!o.current.openEvent||Rh(o.current.openEvent))&&n.set(`positionReference`,Lh(a,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),v=q(e=>{l==null&&u==null&&(r?f.current||g([]):_(e.clientX,e.clientY))}),b=Lp(p)?i:r,x=y.useCallback(()=>{if(!b||!s||l!=null||u!=null)return;let e=Bf(i);function t(n){let r=Op(n);Dp(i,r)?(e.removeEventListener(`mousemove`,t),f.current=null):_(n.clientX,n.clientY)}if(!o.current.openEvent||Rh(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),f.current=null};return f.current=n,n}n.set(`positionReference`,a)},[b,s,l,u,i,o,a,n,_]);y.useEffect(()=>x(),[x,h]),y.useEffect(()=>{s&&!i&&(d.current=!1)},[s,i]),y.useEffect(()=>{!s&&r&&(d.current=!0)},[s,r]),G(()=>{s&&(l!=null||u!=null)&&(d.current=!1,_(l,u))},[s,l,u,_]);let S=y.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return y.useMemo(()=>s?{reference:S}:{},[s,S])}function Bh(e,t,n){let{reference:r,floating:i}=e,a=Qp(t),o=$p(t),s=Zp(o),c=Jp(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Yp(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Vh(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=qp(t,e),p=dm(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=fm(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=fm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Hh=50,Uh=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vh},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bh(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Hh&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bh(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wh=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=qp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Jp(r),_=Qp(o),v=Jp(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lm(o)]:tm(o)),x=p!==`none`;!d&&x&&b.push(...cm(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=em(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Qp(t)||T.every(e=>Qp(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Qp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Gh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kh(e){return zp.some(t=>e[t]>=0)}var qh=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=qp(e,t);switch(i){case`referenceHidden`:{let e=Gh(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Kh(e)}}}case`escaped`:{let e=Gh(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Kh(e)}}}default:return{}}}}},Jh=new Set([`left`,`top`]);async function Yh(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jp(n),s=Yp(n),c=Qp(n)===`y`,l=Jh.has(o)?-1:1,u=a&&c?-1:1,d=qp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Xh=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Yh(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Zh=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Qp(i),p=Xp(f),m=u[p],h=u[f],g=(e,t)=>Kp(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Qh=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=qp(e,t),u={x:n,y:r},d=Qp(i),f=Xp(d),p=u[f],m=u[d],h=qp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Jh.has(Jp(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},$h=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=qp(e,t),c=await i.detectOverflow(t,s),l=Jp(n),u=Yp(n),d=Qp(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Bp(p-c[m],g),y=Bp(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Vp(c.left,c.right):S=p-2*Vp(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function eg(e){let t=np(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Hp(n)!==a||Hp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function tg(e){return Uf(e)?e:e.contextElement}function ng(e){let t=tg(e);if(!Wf(t))return Wp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=eg(t),o=(a?Hp(n.width):n.width)/r,s=(a?Hp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var rg=Wp(0);function ig(e){let t=Bf(e);return!ep()||!t.visualViewport?rg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ag(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Bf(e)}function og(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=tg(e),o=Wp(1);t&&(r?Uf(r)&&(o=ng(r)):o=ng(e));let s=ag(a,n,r)?ig(a):Wp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Bf(a),t=Uf(r)?Bf(r):r,n=e,i=sp(n);for(;i&&t!==n;){let e=ng(i),t=i.getBoundingClientRect(),r=np(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Bf(i),i=sp(n)}}return fm({width:u,height:d,x:c,y:l})}function sg(e,t){let n=rp(e).scrollLeft;return t?t.left+n:og(Vf(e)).left+n}function cg(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-sg(e,n),y:n.top+t.scrollTop}}function lg(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vf(r),s=t?K(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Wp(1),u=Wp(0),d=Wf(r);if((d||!a)&&((zf(r)!==`body`||Kf(o))&&(c=rp(r)),d)){let e=og(r);l=ng(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cg(o,c):Wp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ug(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dg(e){let t=rp(e),n=e.ownerDocument.body,r=Vp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Vp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+sg(e),o=-t.scrollTop;return np(n).direction===`rtl`&&(a+=Vp(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var fg=25;function pg(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Bf(e),a=Vf(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ep()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(sg(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=fg&&(s-=o)}return{width:s,height:c,x:l,y:u}}function mg(e,t){let n=og(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ng(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function hg(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=pg(e,n,t);else if(t===`document`)r=dg(Vf(e));else if(Uf(t))r=mg(t,n);else{let n=ig(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fm(r)}function gg(e,t){let n=t.get(e);if(n)return n;let r=op(e,[],!1).filter(e=>Uf(e)&&zf(e)!==`body`),i=null,a=np(e).position===`fixed`,o=a?ip(e):e;for(;Uf(o)&&!tp(o);){let e=np(o),t=Qf(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ip(o)}return t.set(e,r),r}function _g(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?K(t)?[]:gg(t,this._c):[].concat(n),r],o=hg(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=hg(t,a[e],i);s=Vp(n.top,s),c=Bp(n.right,c),l=Bp(n.bottom,l),u=Vp(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vg(e){let{width:t,height:n}=eg(e);return{width:t,height:n}}function yg(e,t,n){let r=Wf(t),i=Vf(t),a=n===`fixed`,o=og(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Wp(0);if((r||!a)&&((zf(t)!==`body`||Kf(i))&&(s=rp(t)),r)){let e=og(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=sg(i));let l=i&&!r&&!a?cg(i,s):Wp(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function bg(e){return np(e).position===`static`}function xg(e,t){if(!Wf(e)||np(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vf(e)===n&&(n=n.ownerDocument.body),n}function Sg(e,t){let n=Bf(e);if(K(e))return n;if(!Wf(e)){let t=ip(e);for(;t&&!tp(t);){if(Uf(t)&&!bg(t))return t;t=ip(t)}return n}let r=xg(e,t);for(;r&&qf(r)&&bg(r);)r=xg(r,t);return r&&tp(r)&&bg(r)&&!Qf(r)?n:r||$f(e)||n}var Cg=async function(e){let t=this.getOffsetParent||Sg,n=this.getDimensions,r=await n(e.floating);return{reference:yg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wg(e){return np(e).direction===`rtl`}var Tg={convertOffsetParentRelativeRectToViewportRelativeRect:lg,getDocumentElement:Vf,getClippingRect:_g,getOffsetParent:Sg,getElementRects:Cg,getClientRects:ug,getDimensions:vg,getScale:ng,isElement:Uf,isRTL:wg};function Eg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dg(e,t,n){let r=null,i,a=Vf(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Up(d),h=Up(a.clientWidth-(u+f)),g=Up(a.clientHeight-(d+p)),_=Up(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Vp(0,Bp(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Eg(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Bf(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Og(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=tg(e),u=i||a?[...l?op(l):[],...t?op(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Dg(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?og(e):null;c&&g();function g(){let t=og(e);h&&!Eg(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var kg=Xh,Ag=Zh,jg=Wh,Mg=$h,Ng=qh,Pg=Qh,Fg=(e,t,n)=>{let r=new Map,i=n??{},a={...Tg,...i.platform,_c:r};return Uh(e,t,{...i,platform:a})},Ig=typeof document<`u`?y.useLayoutEffect:function(){};function Lg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Lg(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rg(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zg(e,t){let n=Rg(e);return Math.round(t*n)/n}function Bg(e){let t=y.useRef(e);return Ig(()=>{t.current=e}),t}function Vg(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);Lg(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=y.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=y.useRef(null),w=y.useRef(null),T=y.useRef(u),E=c!=null,D=Bg(c),O=Bg(i),k=Bg(l),A=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Fg(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Lg(T.current,t)&&(T.current=t,jh.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ig(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=y.useRef(!1);Ig(()=>(j.current=!0,()=>{j.current=!1}),[]),Ig(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=y.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:b}),[v,b]),ee=y.useMemo(()=>({reference:x,floating:S}),[x,S]),N=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!ee.floating)return e;let t=zg(ee.floating,u.x),r=zg(ee.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rg(ee.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ee.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:A,refs:M,elements:ee,floatingStyles:N}),[u,A,M,ee,N])}var Hg=(e,t)=>{let n=kg(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ug=(e,t)=>{let n=Ag(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wg=(e,t)=>({fn:Pg(e).fn,options:[e,t]}),Gg=(e,t)=>{let n=jg(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kg=(e,t)=>{let n=Mg(e);return{name:n.name,fn:n.fn,options:[e,t]}},qg=(e,t)=>{let n=Ng(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jg={intentional:`onClick`,sloppy:`onPointerDown`};function Yg(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Xg(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=Mm(_),b=q(typeof d==`function`?d:()=>!1),x=typeof d==`function`?b:d,S=y.useRef(!1),{escapeKey:C,outsidePress:w}=Yg(g),T=y.useRef(null),E=Lf(),D=Lf(),O=q(()=>{D.clear(),c.current.insideReactTree=!1}),k=y.useRef(!1),A=y.useRef(``),j=q(e=>{A.current=e.pointerType}),M=q(()=>{let e=A.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),ee=q(e=>{if(!r||!l||!u||e.key!==`Escape`||k.current)return;let t=c.current.floatingContext?.nodeId,i=v?Pp(v.nodesRef.current,t):[];if(!C&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Gm(Hm,Ip(e)?e.nativeEvent:e);n.setOpen(!1,a),!C&&!a.isPropagationAllowed&&e.stopPropagation()}),N=q(e=>{let t=M();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),te=q(()=>{c.current.insideReactTree=!0,D.start(0,O)}),ne=q((e,t=!1)=>{if(N(e)){O();return}if(c.current.insideReactTree){O();return}if(M()===`intentional`&&t||typeof x==`function`&&!x(e))return;let r=Op(e),i=`[${Km(`inert`)}]`,a=jp(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>Dp(e,r))))return;let s=Uf(r)?r:null;for(;s&&!tp(s);){let e=ip(s);if(tp(e)||!Uf(e))break;s=e}if(a.length&&Uf(r)&&!Ap(r)&&!Dp(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!Dp(s,e)))return;if(Wf(r)&&!(`touches`in e)){let t=tp(r),n=np(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&Pp(v.nodesRef.current,l).some(t=>kp(e,t.context?.elements.floating));if(kp(e,n.select(`floatingElement`))||kp(e,n.select(`domReferenceElement`))||u)return;let d=v?Pp(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Gm(Vm,e)),O()}),re=q(e=>{M()===`sloppy`&&e.pointerType!==`touch`&&n.select(`open`)&&l&&!kp(e,n.select(`floatingElement`))&&!kp(e,n.select(`domReferenceElement`))&&ne(e)}),ie=q(e=>{if(M()!==`sloppy`||!n.select(`open`)||!l||kp(e,n.select(`floatingElement`))||kp(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}),ae=q(e=>{let t=Op(e);function n(){ie(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),P=q(e=>{let t=S.current;if(S.current=!1,E.clear(),e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)return;let n=Op(e);function r(){e.type===`pointerdown`?re(e):ne(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),oe=q(e=>{if(M()!==`sloppy`||!T.current||kp(e,n.select(`floatingElement`))||kp(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(ne(e),E.clear(),T.current=null)}),se=q(e=>{let t=Op(e);function n(){oe(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ce=q(e=>{M()!==`sloppy`||!T.current||kp(e,n.select(`floatingElement`))||kp(e,n.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&ne(e),E.clear(),T.current=null)}),le=q(e=>{let t=Op(e);function n(){ce(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});y.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=C,c.current.__outsidePressBubbles=w;let e=new If;function t(e){n.setOpen(!1,Gm(Rm,e))}function s(){e.clear(),k.current=!0}function d(){e.start(ep()?5:0,()=>{k.current=!1})}let f=jp(i);f.addEventListener(`pointerdown`,j,!0),u&&(f.addEventListener(`keydown`,ee),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),x&&(f.addEventListener(`click`,P,!0),f.addEventListener(`pointerdown`,P,!0),f.addEventListener(`touchstart`,ae,!0),f.addEventListener(`touchmove`,se,!0),f.addEventListener(`touchend`,le,!0),f.addEventListener(`mousedown`,P,!0));let p=[];return h&&(Uf(o)&&(p=op(o)),Uf(i)&&(p=p.concat(op(i))),!Uf(a)&&a&&a.contextElement&&(p=p.concat(op(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,j,!0),u&&(f.removeEventListener(`keydown`,ee),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),x&&(f.removeEventListener(`click`,P,!0),f.removeEventListener(`pointerdown`,P,!0),f.removeEventListener(`touchstart`,ae,!0),f.removeEventListener(`touchmove`,se,!0),f.removeEventListener(`touchend`,le,!0),f.removeEventListener(`mousedown`,P,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,u,x,r,s,h,l,C,w,ee,ne,P,re,ae,se,le,j,n]),y.useEffect(O,[x,O]);let ue=y.useMemo(()=>({onKeyDown:ee,...p&&{[Jg[m]]:e=>{n.setOpen(!1,Gm(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,Gm(`trigger-press`,e.nativeEvent))}}}}),[ee,n,p,m]),de=q(e=>{let t=Op(e.nativeEvent);Dp(n.select(`floatingElement`),t)&&e.button===0&&(S.current=!0)}),fe=y.useMemo(()=>({onKeyDown:ee,onPointerDown:de,onMouseDown:de,onMouseUp:de,onClickCapture:te,onMouseDownCapture:te,onPointerDownCapture:te,onMouseUpCapture:te,onTouchEndCapture:te,onTouchMoveCapture:te}),[ee,de,te]);return y.useMemo(()=>l?{reference:ue,floating:fe,trigger:ue}:{},[l,ue,fe])}var Zg=class{constructor(e){this.value=e}deref(){return this.value}},Qg=typeof WeakRef>`u`?Zg:WeakRef,$g=0,e_=1;function t_(){return{s:$g,v:void 0,o:null,p:null}}function n_(e){return e instanceof Qg?e.deref():e}function r_(e,t={}){let n=t_(),{resultEqualityCheck:r,maxSize:i}=t,a=i!==void 0;if(a&&(!Number.isInteger(i)||i<1))throw TypeError(`maxSize must be a positive integer, received: ${i}`);let o=null,s=0,c,l=0;function u(){s>=i&&(o=n,n=t_(),s=0)}function d(){let t=n,{length:i}=arguments;for(let e=0,n=i;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=t_(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=t_(),e.set(n,t),s++):t=r}}if(t.s===e_)return t.v;if(o!==null){let e=o;for(let t=0,n=i;t<n;t++){let n=arguments[t],r;if(typeof n==`function`||typeof n==`object`&&n){let t=e.o;r=t===null?void 0:t.get(n)}else{let t=e.p;r=t===null?void 0:t.get(n)}if(r===void 0){e=null;break}e=r}if(e!==null&&e.s===e_){let n=t;return n.s=e_,n.v=e.v,u(),e.v}}let d=t,f=e.apply(null,arguments);if(l++,r){let e=n_(c);e!=null&&r(e,f)&&(f=e,l!==0&&l--),c=typeof f==`object`&&f||typeof f==`function`?new Qg(f):f}return d.s=e_,d.v=f,a&&u(),f}return d.clearCache=()=>{n=t_(),o=null,s=0,d.resetResultsCount()},d.resultsCount=()=>l,d.resetResultsCount=()=>{l=0},d}var i_=Symbol(`NOT_FOUND`);function a_(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function o_(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var s_=e=>Array.isArray(e)?e:[e];function c_(e){let t=Array.isArray(e[0])?e[0]:e;return o_(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function l_(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),a_(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=r_,argsMemoizeOptions:u=[]}={...n,...a},d=s_(c),f=s_(u),p=c_(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let{length:e}=p,t=Array(e);for(let n=0;n<e;n++)t[n]=p[n].apply(null,arguments);return i=m.apply(null,t),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}function u_(e){let t;return{get(n){return t&&e(t.key,n)?t.value:i_},put(e,n){t={key:e,value:n}},findMatchingEntry(e,n){let r=t;return r!==void 0&&n(r.value,e)?r:void 0},clear(){t=void 0}}}function d_(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(n.key,e));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return i_}function i(t,r){n.unshift({key:t,value:r}),n.length>e&&n.pop()}function a(e,t){let r=n,{length:i}=r;for(let n=0;n<i;n++){let i=r[n];if(t(i.value,e))return i}}function o(){n=[]}return{get:r,put:i,findMatchingEntry:a,clear:o}}var f_=(e,t)=>e===t;function p_(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function m_(e,t){let{equalityCheck:n=f_,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=p_(n),o=0,s=r<=1?u_(a):d_(r,a);function c(){let t=s.get(arguments);if(t===i_){if(t=e.apply(null,arguments),o++,i){let e=s.findMatchingEntry(t,i);e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}l_({memoize:m_,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var h_=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Of(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},g_=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),__=o(((e,t)=>{t.exports=g_()})),v_=o((e=>{var t=u(),n=__();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),y_=o(((e,t)=>{t.exports=v_()})),b_=__(),x_=y_(),S_=lh(19)?w_:T_;function C_(e,t,n,r,i){return S_(e,t,n,r,i)}function w_(e,t,n,r,i){let a=y.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,b_.useSyncExternalStore)(e.subscribe,a,a)}function T_(e,t,n,r,i){return(0,x_.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var E_=class e{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},D_=class extends E_{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){y.useDebugValue(e),G(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){G(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){G(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){y.useDebugValue(e);let r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),G(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{y.useDebugValue(e);let i=this.selectors[e];return C_(this,i,t,n,r)};useContextCallback(e,t){y.useDebugValue(e);let n=q(t??Nm);this.context[e]=n}useStateSetter(e){let t=y.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},O_={open:h_(e=>e.open),domReferenceElement:h_(e=>e.domReferenceElement),referenceElement:h_(e=>e.positionReference??e.referenceElement),floatingElement:h_(e=>e.floatingElement),floatingId:h_(e=>e.floatingId)},k_=class extends D_{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Om(),nested:t,noEmit:n,triggerElements:i},O_)}setOpen=(e,t)=>{if((!e||!this.state.open||Rp(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function A_(e,t=!1,n=!1){let[r,i]=y.useState(e&&t?`idle`:void 0),[a,o]=y.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),G(()=>{if(!e&&a&&r!==`ending`&&n){let e=ah.request(()=>{i(`ending`)});return()=>{ah.cancel(e)}}},[e,a,r,n]),G(()=>{if(!e||t)return;let n=ah.request(()=>{jh.flushSync(()=>{i(void 0)})});return()=>{ah.cancel(n)}},[t,e]),G(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=ah.request(()=>{i(`idle`)});return()=>{ah.cancel(n)}},[t,e,a,i,r]),y.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}function j_(e,t=!1,n=!0){let r=oh();return q((i,a=null)=>{r.cancel();let o=Ih(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||jh.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;jh.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function M_(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=cp(n),o=q(i),s=j_(r,n);y.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function N_(e,t){let n=y.useRef(null);return y.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function P_(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=N_(e,n),o=q(t=>{let i=a(t);return t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}),i});return G(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function F_(e){let t=e.useState(`open`);G(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function I_(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=A_(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=q(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return M_({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var L_=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function R_(){return new k_({open:!1,floatingElement:null,referenceElement:null,triggerElements:new L_,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function z_(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:R_(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Fm,inactiveTriggerProps:Fm,popupProps:Fm}}var B_={open:h_(e=>e.open),mounted:h_(e=>e.mounted),transitionStatus:h_(e=>e.transitionStatus),floatingRootContext:h_(e=>e.floatingRootContext),preventUnmountingOnClose:h_(e=>e.preventUnmountingOnClose),payload:h_(e=>e.payload),activeTriggerId:h_(e=>e.activeTriggerId),activeTriggerElement:h_(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:h_((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:h_((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:h_((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:h_((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:h_(e=>e.popupProps),popupElement:h_(e=>e.popupElement),positionerElement:h_(e=>e.positionerElement)};function V_(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Dm(),a=jm()!=null,o=Mf(()=>new k_({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new L_,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return G(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Uf(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=e.noEmit||!1,o}function H_(e={}){let{nodeId:t,externalTree:n}=e,r=V_(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=y.useState(null),c=y.useRef(null),l=Mm(n);G(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=Vg({...e,elements:{...a,...o&&{reference:o}}}),d=y.useCallback(e=>{let t=Uf(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=y.useState(null),[m,h]=y.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,Uf(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=y.useCallback(e=>{(Uf(e)||e===null)&&(c.current=e,p(e)),(Uf(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!Uf(e))&&u.refs.setReference(e)},[u.refs,p]),_=y.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=y.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),b=y.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),x=i.useState(`open`),S=i.useState(`floatingId`),C=y.useMemo(()=>({...u,dataRef:i.context.dataRef,open:x,onOpenChange:i.setOpen,events:i.context.events,floatingId:S,refs:v,elements:b,nodeId:t,rootStore:i}),[u,v,b,t,i,x,S]);return G(()=>{i.context.dataRef.current.floatingContext=C;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=C)}),y.useMemo(()=>({...u,context:C,refs:v,elements:b,rootStore:i}),[u,v,b,C,i])}function U_(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=Dm(),o=jm()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=Mf(()=>new k_({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return G(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Uf(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var W_=yp&&vp;function G_(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=y.useRef(!1),c=Lf(),l=y.useRef(!0);y.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Bf(e);function r(){!n.select(`open`)&&Wf(e)&&e===Ep(jp(e))&&(s.current=!0)}function i(){l.current=!0}function o(){l.current=!1}return t.addEventListener(`blur`,r),W_&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),W_&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),y.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let u=y.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=Op(e.nativeEvent);if(o&&Uf(t)){if(W_&&!e.relatedTarget){if(!l.current&&!Mp(t))return}else if(!Np(t))return}n.setOpen(!0,Gm(Bm,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=Uf(t)&&t.hasAttribute(Km(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=Ep(o?o.ownerDocument:document);(t||s!==o)&&(Dp(i.current.floatingContext?.refs.floating.current,s)||Dp(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Gm(Bm,r)))})}}),[i,n,o,c]);return y.useMemo(()=>a?{reference:u,trigger:u}:{},[a,u])}var K_=Km(`safe-polygon`),q_=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Tp}`;function J_(e){return e?!!e.closest(q_):!1}function Y_(e){let t=y.useRef(void 0),n=y.useRef(!1),r=y.useRef(void 0),i=y.useRef(!0),a=y.useRef(!1),o=y.useRef(()=>{}),s=y.useRef(!1),c=Lf(),l=Lf(),u=y.useRef(void 0);return y.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u},d.hoverInteractionState},[e,t,n,r,i,a,o,s,c,l,u])}var X_=new Set([`click`,`mousedown`]);function Z_(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:_}=Y_(n),v=Mm(l),b=jm(),x=q(()=>d.current?!0:o.current.openEvent?X_.has(o.current.openEvent.type):!1),S=q(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),C=y.useCallback((e,t=!0)=>{let r=Q_(c,u.current);r&&!f.current?g.start(r,()=>n.setOpen(!1,Gm(zm,e))):t&&(g.clear(),n.setOpen(!1,Gm(zm,e)))},[c,f,n,u,g]),w=q(()=>{m.current(),f.current=void 0}),T=q(()=>{if(p.current){let e=jp(i).body;e.style.pointerEvents=``,e.removeAttribute(K_),p.current=!1}}),E=q(e=>{if(!J_(Op(e))){d.current=!1;return}d.current=!0});G(()=>{r||(u.current=void 0,h.current=!1,d.current=!1,w(),T())},[r,u,h,d,w,T]),y.useEffect(()=>()=>{w()},[w]),y.useEffect(()=>T,[T]),G(()=>{if(s&&r&&_.current?.blockPointerEvents&&S()&&Uf(a)&&i){p.current=!0;let e=jp(i).body;e.setAttribute(K_,``);let t=a,n=i,r=v?.nodesRef.current.find(e=>e.id===b)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,_,S,v,b,p]),y.useEffect(()=>{if(!s)return;function e(e){if(x()||!o.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(T(),w(),x()||C(e))}function t(e){g.clear(),T(),f.current?.(e),w()}function r(e){x()||C(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,E,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,E,!0))}})}function Q_(e,t){return t&&!Lp(t)?0:typeof e==`function`?e():e}function $_(e){return typeof e==`function`?e():e}var ev={current:null};function tv(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=ev,externalTree:f,isActiveTrigger:p=!0}=t,m=Mm(f),{pointerTypeRef:h,interactedInsideRef:g,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:b,unbindMouseMoveRef:x,restTimeoutPendingRef:S,openChangeTimeout:C,restTimeout:w,handleCloseOptionsRef:T}=Y_(n),E=cp(s),D=cp(o),O=cp(l);p&&(T.current=E.current?.__options);let k=q(()=>g.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),A=y.useCallback((e,t=!0)=>{let r=qm(D.current,`close`,h.current);r&&!_.current?C.start(r,()=>n.setOpen(!1,Gm(zm,e))):t&&(C.clear(),n.setOpen(!1,Gm(zm,e)))},[D,_,n,h,C]),j=q(()=>{x.current(),_.current=void 0}),M=q(()=>{if(b.current){let e=jp(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(K_),b.current=!1}});y.useEffect(()=>{if(!a)return;function e(e){e.open||(C.clear(),w.clear(),v.current=!0,S.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,C,w,v,S]);let ee=q(e=>{if(k()||!r.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||E.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){M(),j(),k()||A(e)}})(e)});return y.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!Uf(e))return;function t(e){if(C.clear(),v.current=!1,c&&!Lp(h.current)||$_(O.current)>0&&!qm(D.current,`open`))return;let t=qm(D.current,`open`,h.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>Dp(t,e.target)))&&(!r||!Dp(r,e.target)),o=e.currentTarget??null;t?C.start(t,()=>{n.select(`open`)||n.setOpen(!0,Gm(zm,e,o))}):(!n.select(`open`)||a)&&n.setOpen(!0,Gm(zm,e,o))}function i(e){if(k()){M();return}x.current();let t=jp(n.select(`domReferenceElement`));w.clear(),S.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(E.current&&r.current.floatingContext){n.select(`open`)||C.clear(),_.current=E.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){M(),j(),k()||A(e,!0)}});let i=_.current;i(e),t.addEventListener(`mousemove`,i),x.current=()=>{t.removeEventListener(`mousemove`,i)};return}(h.current!==`touch`||!Dp(n.select(`floatingElement`),e.relatedTarget))&&A(e)}}function o(e){ee(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[j,M,v,r,D,A,n,a,E,ee,p,k,c,u,h,O,w,S,C,d,m,x,_]),y.useMemo(()=>{function e(e){h.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>Dp(t,e.target)))&&(!i||!Dp(i,e.target));if(c&&!Lp(h.current)||o&&!s||$_(O.current)===0||!s&&S.current&&e.movementX**2+e.movementY**2<2)return;w.clear();function l(){!v.current&&(!o||s)&&n.setOpen(!0,Gm(zm,t,r))}h.current===`touch`?jh.flushSync(()=>{l()}):s&&o?l():(S.current=!0,w.start($_(O.current),l))}}},[v,c,n,h,O,w,S])}function nv(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=y.useCallback(t=>rv(t,e,`reference`),t),o=y.useCallback(t=>rv(t,e,`floating`),n),s=y.useCallback(t=>rv(t,e,`item`),r),c=y.useCallback(t=>rv(t,e,`trigger`),i);return y.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function rv(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[wp]=``);for(let t in e)(!i||!e||t!==`active`&&t!==`selected`)&&(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&iv(a,s,i,r)}return iv(a,e,i,r),a}function iv(e,t,n,r){for(let i in t){let a=t[i];(!n||i!==`active`&&i!==`selected`)&&(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}function av(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function ov(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function sv(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new If,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=Op(f),v=f.type===`mouseleave`,y=Dp(s.floating,_),b=Dp(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=ov(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Uf(f.relatedTarget)&&Dp(s.floating,f.relatedTarget)||d&&Pp(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let ee=[];switch(C){case`top`:ee=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:ee=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:ee=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:ee=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]]}function N([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]];default:return[]}}if(!av([m,h],ee)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}av([m,h],N([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var cv={...B_,disabled:h_(e=>e.disabled),instantType:h_(e=>e.instantType),isInstantPhase:h_(e=>e.isInstantPhase),trackCursorAxis:h_(e=>e.trackCursorAxis),disableHoverablePopup:h_(e=>e.disableHoverablePopup),lastOpenChangeReason:h_(e=>e.openChangeReason),closeDelay:h_(e=>e.closeDelay)},lv=class e extends D_{constructor(e){super({...uv(),...e},{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new L_},cv)}setOpen=(e,t)=>{let n=t.reason,r=n===zm,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?jh.flushSync(o):o()};static useStore(t,n){let r=Mf(()=>t??new e(n)).current,i=U_({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function uv(){return{...z_(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function dv(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=lv.useStore(l?.store,{open:r??n,activeTriggerId:u===void 0?d:u});p.useControlledProp(`open`,r,n),p.useControlledProp(`activeTriggerId`,u,d),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=p.useState(`activeTriggerId`),g=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let _=!t&&m;G(()=>{m&&t&&p.setOpen(!1,Gm(Um))},[m,t,p]),p.useSyncedValue(`disabled`,t),F_(p);let{forceUnmount:v,transitionStatus:x}=I_(_,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=y.useRef(null);G(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),G(()=>{_&&(h??p.set(`payload`,void 0))},[p,h,_]);let E=y.useCallback(()=>{p.setOpen(!1,fv(p,Wm))},[p]);y.useImperativeHandle(o,()=>({unmount:v,close:E}),[v,E]);let D=p.useState(`floatingRootContext`),{getReferenceProps:O,getFloatingProps:k,getTriggerProps:A}=nv([G_(D,{enabled:!t}),Xg(D,{enabled:!t,referencePress:!0}),zh(D,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),j=y.useMemo(()=>O(),[O]),M=y.useMemo(()=>A(),[A]),ee=y.useMemo(()=>k(),[k]);return p.useSyncedValues({floatingRootContext:D,activeTriggerProps:j,inactiveTriggerProps:M,popupProps:ee}),(0,b.jsx)(kf.Provider,{value:p,children:typeof f==`function`?f({payload:g}):f})}function fv(e,t){let n=Gm(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var pv=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),mv={[pv.startingStyle]:``},hv={[pv.endingStyle]:``},gv={transitionStatus(e){return e===`starting`?mv:e===`ending`?hv:null}},_v=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=pv.startingStyle]=`startingStyle`,e[e.endingStyle=pv.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),vv=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),yv={[vv.popupOpen]:``};vv.popupOpen,vv.pressed;var bv={[_v.open]:``},xv={[_v.closed]:``},Sv={[_v.anchorHidden]:``},Cv={open(e){return e?yv:null}},wv={open(e){return e?bv:xv},anchorHidden(e){return e?Sv:null}};function Tv(e){return Dm(e,`base-ui`)}var Ev=y.createContext(void 0);function Dv(){return y.useContext(Ev)}var Ov=y.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=Af(!0),f=i?.store??d;if(!f)throw Error(Of(82));let p=Tv(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=y.useRef(null),v=s??600,b=c??0,{registerTrigger:x,isMountedByThisTrigger:S}=P_(p,_,f,{payload:a,closeDelay:b}),C=Dv(),{delayRef:w,isInstantPhase:T,hasProvider:E}=Xm(h,{open:g});f.useSyncedValue(`isInstantPhase`,T);let D=f.useState(`disabled`),O=o??D,k=f.useState(`trackCursorAxis`),A=f.useState(`disableHoverablePopup`),j=tv(h,{enabled:!O,mouseOnly:!0,move:!1,handleClose:!A&&k!==`both`?sv():null,restMs(){let e=C?.delay,t=typeof w.current==`object`?w.current.open:void 0,n=v;return E&&(n=t===0?0:s??e??v),n},delay(){let e=typeof w.current==`object`?w.current.close:void 0,t=b;return c==null&&E&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),M=y.useMemo(()=>({open:g}),[g]),ee=f.useState(`triggerProps`,S);return Dh(`button`,e,{state:M,ref:[t,x,_],props:[j,ee,{id:p},u],stateAttributesMapping:Cv})}),kv=y.createContext(void 0);function Av(){let e=y.useContext(kv);if(e===void 0)throw Error(Of(70));return e}var jv=y.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=Fh({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,b.jsxs)(y.Fragment,{children:[c,s&&jh.createPortal(n,s)]})}),Mv=y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Af().useState(`mounted`)||n?(0,b.jsx)(kv.Provider,{value:n,children:(0,b.jsx)(jv,{ref:t,...r})}):null}),Nv=y.createContext(void 0);function Pv(){let e=y.useContext(Nv);if(e===void 0)throw Error(Of(71));return e}var Fv=y.createContext(void 0);function Iv(){return y.useContext(Fv)?.direction??`ltr`}var Lv=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=qp(e,t)||{};if(l==null)return{};let f=dm(u),p={x:n,y:r},m=$p(i),h=Zp(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Kp(k,j,A),ee=!c.arrow&&Yp(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,N=ee?j<k?j-k:j-A:0;return{[m]:p[m]+N,data:{[m]:M,centerOffset:j-M-N,...ee&&{alignmentOffset:N}},reset:ee}}}),Rv=(e,t)=>({...Lv(e),options:[e,t]}),zv={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await qg().fn(e)).data?.referenceHidden||a}}}},Bv={sideX:`left`,sideY:`top`},Vv={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Bf(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:Bv};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=sh(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Jp(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Bv.sideX,g=f===`top`?`bottom`:Bv.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Hv(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Uv(e,t,n){let{rects:r,placement:i}=e;return{side:Hv(t,Jp(i),n),align:Yp(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Wv(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:b=!1,externalTree:x}=e,[S,C]=y.useState(null);!m&&S!==null&&C(null);let w=h.side||`flip`,T=h.align||`flip`,E=h.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=q(D),k=D?O:t,A=cp(t),j=Iv()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],ee=a===`center`?M:`${M}-${a}`,N=c,te=+(r===`bottom`),ne=+(r===`top`),re=+(r===`right`),ie=+(r===`left`);typeof N==`number`?N={top:N+te,right:N+ie,bottom:N+ne,left:N+re}:N&&={top:(N.top||0)+te,right:(N.right||0)+ie,bottom:(N.bottom||0)+ne,left:(N.left||0)+re};let ae={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:N},P=y.useRef(null),oe=cp(i),se=cp(o),ce=[Hg(e=>{let t=Uv(e,r,j),n=typeof oe.current==`function`?oe.current(t):oe.current,i=typeof se.current==`function`?se.current(t):se.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],le=T===`none`&&w!==`shift`,ue=!le&&(l||g||w===`shift`),de=w===`none`?null:Gg({...ae,padding:{top:N.top+1,right:N.right+1,bottom:N.bottom+1,left:N.left+1},mainAxis:!g&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),fe=le?null:Ug(e=>{let t=sh(e.elements.floating).documentElement;return{...ae,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:ue,limiter:l||g?void 0:Wg(e=>{if(!P.current)return{};let{width:t,height:n}=P.current.getBoundingClientRect(),r=Qp(Jp(e.placement)),i=r===`y`?t:n,a=r===`y`?N.left+N.right:N.top+N.bottom;return{offset:i/2+a/2}})}},[ae,l,g,N,T]);w===`shift`||T===`shift`||a===`center`?ce.push(fe,de):ce.push(de,fe),ce.push(Kg({...ae,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),Rv(()=>({element:P.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Jp(a),l=Qp(c),u=P.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(Uv(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ue&&l===`y`&&b?S:x),{}}},zv,v),G(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let pe=y.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:me,elements:F,x:I,y:L,middlewareData:he,update:ge,placement:_e,context:ve,isPositioned:ye,floatingStyles:R}=H_({rootContext:p,placement:ee,middleware:ce,strategy:n,whileElementsMounted:f?void 0:(...e)=>Og(...e,pe),nodeId:_,externalTree:x}),{sideX:be,sideY:xe}=he.adaptiveOrigin||Bv,Se=ye?n:`fixed`,Ce=y.useMemo(()=>v?{position:Se,[be]:I,[xe]:L}:{position:Se,...R},[v,Se,be,I,xe,L,R]),we=y.useRef(null);G(()=>{if(!m)return;let e=A.current,t=typeof e==`function`?e():e,n=(Gv(t)?t.current:t)||null;n!==we.current&&(me.setPositionReference(n),we.current=n)},[m,me,k,A]),y.useEffect(()=>{if(!m)return;let e=A.current;typeof e!=`function`&&Gv(e)&&e.current!==we.current&&(me.setPositionReference(e.current),we.current=e.current)},[m,me,k,A]),y.useEffect(()=>{if(f&&m&&F.domReference&&F.floating)return Og(F.domReference,F.floating,ge,pe)},[f,m,F,ge,pe]);let Te=Jp(_e),Ee=Hv(r,Te,j),De=Yp(_e)||`center`,Oe=!!he.hide?.referenceHidden;G(()=>{b&&m&&ye&&C(Te)},[b,m,ye,Te]);let ke=y.useMemo(()=>({position:`absolute`,top:he.arrow?.y,left:he.arrow?.x}),[he.arrow]),Ae=he.arrow?.centerOffset!==0;return y.useMemo(()=>({positionerStyles:Ce,arrowStyles:ke,arrowRef:P,arrowUncentered:Ae,side:Ee,align:De,physicalSide:Te,anchorHidden:Oe,refs:me,context:ve,isPositioned:ye,update:ge}),[Ce,ke,P,Ae,Ee,De,Te,Oe,me,ve,ye,ge])}function Gv(e){return e!=null&&`current`in e}function Kv(e){return e===`starting`?Im:Fm}var qv=y.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Lm,...g}=e,_=Af(),v=Av(),x=_.useState(`open`),S=_.useState(`mounted`),C=_.useState(`trackCursorAxis`),w=_.useState(`disableHoverablePopup`),T=_.useState(`floatingRootContext`),E=_.useState(`instantType`),D=_.useState(`transitionStatus`),O=Wv({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:Vv}),k=y.useMemo(()=>{let e={};return(!x||C===`both`||w)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!S,style:{...O.positionerStyles,...e}}},[x,C,w,S,O.positionerStyles]),A=y.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),j=y.useMemo(()=>({...A,arrowRef:O.arrowRef,arrowStyles:O.arrowStyles,arrowUncentered:O.arrowUncentered}),[A,O.arrowRef,O.arrowStyles,O.arrowUncentered]),M=Dh(`div`,e,{state:A,props:[k,Kv(D),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:wv});return(0,b.jsx)(Nv.Provider,{value:j,children:M})});function Jv(e){let t=np(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(Hp(n)!==a||Hp(r)!==o)&&(n=a,r=o),{width:n,height:r}}var Yv=typeof ResizeObserver<`u`,Xv=()=>!0;function Zv(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=Xv,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=y.useRef(!0),d=j_(t,!0,!1),f=oh(),p=y.useRef(null),m=q(o),h=q(s),g=y.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:Fm},[c,l]);G(()=>{if(!i||!a()||!Yv){u.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(g).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current===null?p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=Qv(t,`position`,`static`),o=Qv(t,`transform`,`none`),s=Qv(t,`scale`,`1`),c=Qv(n,`--available-width`,`max-content`),l=Qv(n,`--available-height`,`max-content`);if(m?.(),u.current||p.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=Jv(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),h?.(null,i),u.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let _=Jv(t);t.style.setProperty(`--popup-width`,`${p.current.width}px`),t.style.setProperty(`--popup-height`,`${p.current.height}px`),r(),o(),c(),l(),h?.(p.current,_),n.style.setProperty(`--positioner-width`,`${_.width}px`),n.style.setProperty(`--positioner-height`,`${_.height}px`);let v=new AbortController;return f.request(()=>{t.style.setProperty(`--popup-width`,`${_.width}px`),t.style.setProperty(`--popup-height`,`${_.height}px`),d(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),f.cancel()}},[r,t,n,d,f,a,i,m,h,g])}function Qv(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var $v={...wv,...gv},ey=y.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Af(),{side:o,align:s}=Pv(),c=a.useState(`open`),l=a.useState(`mounted`),u=a.useState(`instantType`),d=a.useState(`transitionStatus`),f=a.useState(`popupProps`),p=a.useState(`payload`),m=a.useState(`popupElement`),h=a.useState(`positionerElement`),g=a.useState(`floatingRootContext`),_=Iv();M_({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function v(){g.context.events.emit(`measure-layout`)}function b(e,t){g.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}Zv({popupElement:m,positionerElement:h,mounted:l,content:p,enabled:()=>a.context.triggerElements.size>1,onMeasureLayout:v,onMeasureLayoutComplete:b,side:o,direction:_});let x=a.useState(`disabled`),S=a.useState(`closeDelay`);return Z_(g,{enabled:!x,closeDelay:S}),Dh(`div`,e,{state:y.useMemo(()=>({open:c,side:o,align:s,instant:u,transitionStatus:d}),[c,o,s,u,d]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[f,Kv(d),i],stateAttributesMapping:$v})}),ty=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=y.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=y.useMemo(()=>({open:t,close:n}),[t,n]);return(0,b.jsx)(Ev.Provider,{value:i,children:(0,b.jsx)(Ym,{delay:a,timeoutMs:r,children:e.children})})};function ny({render:e,children:t,side:n=`right`}){return(0,b.jsxs)(dv,{children:[(0,b.jsx)(Ov,{render:e}),(0,b.jsx)(Mv,{children:(0,b.jsx)(qv,{side:n,sideOffset:10,align:`start`,collisionPadding:12,className:`z-50`,children:(0,b.jsx)(ey,{className:`w-[380px] max-w-[calc(100vw-24px)] rounded-xl bg-bg-2 p-4 text-label shadow-panel outline-none transition-[opacity,transform] duration-150 data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0 data-[ending-style]:opacity-0`,children:t})})})]})}function ry({children:e}){return(0,b.jsx)(ty,{delay:350,closeDelay:80,children:e})}function iy({label:e,children:t}){return(0,b.jsxs)(`div`,{className:`mt-2.5 first:mt-0`,children:[(0,b.jsx)(`div`,{className:`t-caption font-medium uppercase tracking-wide text-label-2`,children:e}),(0,b.jsx)(`div`,{className:`t-footnote mt-0.5 text-label`,children:t})]})}var ay=`grid-cols-[112px_minmax(0,1fr)_96px_64px_64px_112px]`;function oy({worker:e,active:t,onSelect:n,index:r}){let i=e.status===`running`,a=i?e.current_action:e.error??(mf(e.last_message,160)||e.goal);return(0,b.jsx)(Qd.li,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:Math.min(r,10)*.025},children:(0,b.jsxs)(`button`,{type:`button`,onClick:n,"aria-current":t?`true`:void 0,className:`grid w-full ${ay} items-center gap-x-4 px-4 py-3 text-left transition-colors duration-150 ${t?`bg-blue/12`:`hover:bg-fill/60`}`,children:[(0,b.jsx)(Cf,{status:e.status,phase:e.phase,className:`t-subhead`}),(0,b.jsxs)(`span`,{className:`min-w-0`,children:[(0,b.jsxs)(ny,{side:`bottom`,render:(0,b.jsx)(`span`,{className:`t-headline block truncate`,children:e.title}),children:[(0,b.jsx)(`div`,{className:`t-headline`,children:e.title}),(0,b.jsx)(iy,{label:`Goal`,children:e.goal??`—`}),e.owned_paths.length>0&&(0,b.jsx)(iy,{label:`负责的路径`,children:(0,b.jsx)(`ul`,{className:`mono space-y-0.5`,children:e.owned_paths.map(t=>(0,b.jsx)(`li`,{className:`truncate`,title:t,children:bf(t,e.project_root)},t))})}),e.branch&&(0,b.jsxs)(iy,{label:`分支`,children:[(0,b.jsx)(`span`,{className:`mono`,children:e.branch}),e.base_commit&&(0,b.jsxs)(`span`,{className:`mono text-label-2`,children:[` ← `,e.base_commit.slice(0,7)]})]}),e.depends_on.length>0&&(0,b.jsx)(iy,{label:`依赖`,children:(0,b.jsx)(`span`,{className:`mono`,children:e.depends_on.map(e=>yf(e)).join(`, `)})}),e.model&&(0,b.jsx)(iy,{label:`模型`,children:(0,b.jsx)(`span`,{className:`mono`,children:e.model})})]}),(0,b.jsx)(`span`,{className:`t-footnote mt-0.5 block truncate ${i?`mono text-orange`:e.error?`text-red`:`text-label-2`}`,title:a??void 0,children:a||`—`})]}),(0,b.jsx)(`span`,{className:`t-subhead tabular text-right text-label-2`,children:_f(e.duration_ms)}),(0,b.jsx)(`span`,{className:`t-subhead tabular text-right ${e.changed_file_count>0?`text-label`:`text-label-3`}`,children:e.changed_file_count}),(0,b.jsx)(`span`,{className:`t-subhead tabular text-right text-label-2`,children:e.command_count}),(0,b.jsx)(`span`,{className:`t-footnote tabular text-right text-label-2`,title:gf(e.updated_at),children:hf(e.updated_at)})]})})}function sy({pages:e,hasMore:t,loadingMore:n,loadMore:r,selected:i,onSelect:a}){let o=e.flatMap(e=>e.workers),s=e[0]?.worker_count??o.length,c=uf(t,n,r);return(0,b.jsxs)(`section`,{className:`inset overflow-hidden`,children:[(0,b.jsxs)(`div`,{className:`grid ${ay} gap-x-4 border-b border-separator-soft px-4 py-2`,children:[(0,b.jsx)(`span`,{className:`t-footnote text-label-2`,children:`状态`}),(0,b.jsx)(`span`,{className:`t-footnote text-label-2`,children:`Worker`}),(0,b.jsx)(`span`,{className:`t-footnote text-right text-label-2`,children:`耗时`}),(0,b.jsx)(`span`,{className:`t-footnote text-right text-label-2`,title:`worktree 里改过的文件数,含已 commit 的`,children:`文件`}),(0,b.jsx)(`span`,{className:`t-footnote text-right text-label-2`,children:`命令`}),(0,b.jsx)(`span`,{className:`t-footnote text-right text-label-2`,children:`更新`})]}),(0,b.jsx)(`ol`,{className:`divide-y divide-separator-soft`,children:o.map((e,t)=>(0,b.jsx)(oy,{worker:e,index:t,active:e.id===i,onSelect:()=>a(e.id)},e.id))}),(0,b.jsx)(`div`,{ref:c,className:`t-caption border-t border-separator-soft px-4 py-2.5 text-center text-label-3`,children:t?n?`加载中…`:`已显示 ${o.length} / ${s},继续滚动加载`:`共 ${s} 路`})]})}function cy({label:e,value:t,tone:n=``}){return(0,b.jsxs)(`span`,{className:`t-subhead inline-flex items-baseline gap-1.5`,children:[(0,b.jsx)(`span`,{className:`tabular font-semibold ${n}`,children:t}),(0,b.jsx)(`span`,{className:`text-label-2`,children:e})]})}function ly({pages:e,hasMore:t,loadingMore:n,loadMore:r,selectedWorker:i,onSelectWorker:a}){let o=e[0],s=o.active_count>0,c=o.counts,l=o.title??xf(o.id,o.unsessioned);return(0,b.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,b.jsxs)(`header`,{className:`shrink-0 px-8 pt-7 pb-4`,children:[(0,b.jsxs)(Qd.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22},children:[(0,b.jsxs)(ny,{side:`bottom`,render:(0,b.jsx)(`h2`,{className:`t-title1 inline-block max-w-full truncate ${o.unsessioned?`text-label-2`:``}`,children:l}),children:[(0,b.jsx)(`div`,{className:`t-headline`,children:l}),(0,b.jsx)(iy,{label:`Session id`,children:(0,b.jsx)(`span`,{className:`mono`,children:o.id})}),(0,b.jsx)(iy,{label:`说明`,children:o.note??(o.title_derived?`没有记录说明。派单时传 session_title / session_note,或调用 describe_session。`:`—`)}),o.project_roots.length>0&&(0,b.jsx)(iy,{label:`项目根目录`,children:(0,b.jsx)(`ul`,{className:`mono space-y-0.5`,children:o.project_roots.map(e=>(0,b.jsx)(`li`,{className:`truncate`,title:e,children:e},e))})})]}),(0,b.jsxs)(`p`,{className:`t-subhead mt-1 flex flex-wrap items-center gap-x-3 text-label-2`,children:[o.title&&!o.unsessioned&&(0,b.jsx)(`span`,{className:`mono`,children:o.id}),(0,b.jsxs)(`span`,{children:[`首次派单 `,gf(o.first_created_at)]}),(0,b.jsxs)(`span`,{children:[`最近活动 `,hf(o.last_activity_at)]}),o.title_derived&&o.title&&(0,b.jsx)(`span`,{className:`text-label-3`,children:`标题由各路 goal 拼出,派单时传 session_title 可自定`})]}),o.note&&(0,b.jsx)(`p`,{className:`t-subhead mt-2 max-w-[72ch] text-label`,children:o.note})]},o.id),(0,b.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-x-5 gap-y-2`,children:[(0,b.jsx)(cy,{label:`路`,value:o.worker_count}),(0,b.jsx)(cy,{label:`运行中`,value:c.running??0,tone:s?`text-orange`:`text-label-3`}),(0,b.jsx)(cy,{label:`完成`,value:c.completed??0,tone:`text-green`}),(0,b.jsx)(cy,{label:`失败`,value:c.failed??0,tone:(c.failed??0)>0?`text-red`:`text-label-3`}),(0,b.jsx)(cy,{label:`丢失`,value:c.lost??0,tone:(c.lost??0)>0?`text-indigo`:`text-label-3`}),(0,b.jsx)(`div`,{className:`w-40`,children:(0,b.jsx)(wf,{counts:o.counts,total:o.worker_count})})]}),(0,b.jsx)(cu,{mode:`wait`,initial:!1,children:s?(0,b.jsx)(Qd.section,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.22},className:`overflow-hidden`,children:(0,b.jsxs)(`div`,{className:`inset mt-5 px-4 py-3`,children:[(0,b.jsx)(`div`,{className:`group-header`,children:`正在进行`}),(0,b.jsx)(`ul`,{className:`mt-1 divide-y divide-separator-soft`,children:o.now.map(e=>(0,b.jsxs)(`li`,{className:`flex min-h-[36px] items-center gap-3`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),className:`t-subhead shrink-0 text-blue`,children:e.title.length>32?`${e.title.slice(0,32)}…`:e.title}),(0,b.jsx)(`span`,{className:`t-footnote mono truncate text-label-2`,children:e.current_action??e.phase??`…`})]},e.id))})]})},`now`):o.last_report?(0,b.jsx)(Qd.section,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.22},className:`overflow-hidden`,children:(0,b.jsxs)(`div`,{className:`inset mt-5 px-4 py-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`group-header`,children:`最近一条汇报`}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>a(o.last_report.id),className:`t-footnote truncate text-blue`,children:o.last_report.title}),(0,b.jsx)(`span`,{className:`t-caption ml-auto shrink-0 text-label-2`,children:hf(o.last_report.at)})]}),(0,b.jsx)(`p`,{className:`t-subhead mt-1 line-clamp-2 text-label`,children:mf(o.last_report.text,260)})]})},`last`):null})]}),(0,b.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-8 pb-8`,children:[(0,b.jsx)(`div`,{className:`group-header mb-2`,children:`Worker(按派单顺序)`}),(0,b.jsx)(sy,{pages:e,hasMore:t,loadingMore:n,loadMore:r,selected:i,onSelect:a})]})]})}function uy({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=y.useRef(e!==void 0),[a,o]=y.useState(t);return[i?e:a,y.useCallback(e=>{i||o(e)},[])]}var dy=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function fy(){return y.useContext(dy)}function py(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=q(i),o=y.useRef(0),s=Mf(hy).current,c=Mf(my).current,[l,u]=y.useState(0),d=y.useRef(l),f=q((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=q(e=>{c.delete(e),d.current+=1,u(d.current)}),m=y.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(gy).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);G(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),G(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),G(()=>()=>{n.current=[]},[n]),G(()=>()=>{r&&(r.current=[])},[r]);let h=q(e=>(s.add(e),()=>{s.delete(e)}));G(()=>{s.forEach(e=>e(m))},[s,m]);let g=y.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,b.jsx)(dy.Provider,{value:g,children:t})}function my(){return new Map}function hy(){return new Set}function gy(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var _y=y.createContext(void 0);function vy(){let e=y.useContext(_y);if(e===void 0)throw Error(Of(64));return e}var yy=function(e){return e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e}({}),by={tabActivationDirection:e=>({[yy.activationDirection]:e})},xy=y.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,...c}=e,l=Iv(),u=y.useRef([]),[d,f]=y.useState(()=>new Map),[p,m]=uy({controlled:s,default:r,name:`Tabs`,state:`value`}),[h,g]=y.useState(()=>new Map),[_,v]=y.useState(`none`),x=q((e,t)=>{i?.(e,t),!t.isCanceled&&(m(e),v(t.activationDirection))}),S=q((e,t)=>{f(n=>{if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})}),C=q((e,t)=>{f(n=>{if(!n.has(e)||n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})}),w=y.useCallback(e=>d.get(e),[d]),T=y.useCallback(e=>{for(let t of h.values())if(e===t?.value)return t?.id},[h]),E=y.useCallback(e=>{if(e===void 0)return null;for(let[t,n]of h.entries())if(n!=null&&e===(n.value??n.index))return t;return null},[h]),D=y.useMemo(()=>({direction:l,getTabElementBySelectedValue:E,getTabIdByPanelValue:T,getTabPanelIdByValue:w,onValueChange:x,orientation:a,registerMountedTabPanel:S,setTabMap:g,unregisterMountedTabPanel:C,tabActivationDirection:_,value:p}),[l,E,T,w,x,a,S,g,C,_,p]),O=Dh(`div`,e,{state:{orientation:a,tabActivationDirection:_},ref:t,props:c,stateAttributesMapping:by});return(0,b.jsx)(_y.Provider,{value:D,children:(0,b.jsx)(py,{elementsRef:u,children:O})})}),Sy=y.createContext(void 0);function Cy(e=!1){let t=y.useContext(Sy);if(t===void 0&&!e)throw Error(Of(16));return t}function wy(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:y.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Ty(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=y.useRef(null),o=Cy(!0)!==void 0,s=q(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=wy({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=y.useCallback(()=>{let e=a.current;Ey(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return G(l,[l]),{getButtonProps:y.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return gh({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(wh(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(wh(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:q(e=>{a.current=e,l()})}}function Ey(e){return Wf(e)&&e.tagName===`BUTTON`}var Dy=`data-composite-item-active`,Oy=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function ky(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=fy(),f=y.useRef(-1),[p,m]=y.useState(a??(i===Oy.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=y.useRef(null),g=y.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return G(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),G(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),y.useMemo(()=>({ref:g,index:p}),[p,g])}function Ay(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Cy(),{ref:i,index:a}=ky(e),o=n===a,s=y.useRef(null),c=Zm(i,s);return{compositeProps:y.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}var jy=y.createContext(void 0);function My(){let e=y.useContext(jy);if(e===void 0)throw Error(Of(65));return e}var Ny=y.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,...c}=e,{value:l,getTabPanelIdByValue:u,orientation:d}=vy(),{activateOnFocus:f,highlightedTabIndex:p,onTabActivation:m,setHighlightedTabIndex:h,tabsListElement:g}=My(),_=Tv(o),{compositeProps:v,compositeRef:b,index:x}=Ay({metadata:y.useMemo(()=>({disabled:r,id:_,value:a}),[r,_,a])}),S=a===l,C=y.useRef(!1);G(()=>{if(C.current){C.current=!1;return}if(!(S&&x>-1&&p!==x))return;let e=g;if(e!=null){let t=Ep(sh(e));if(t&&Dp(e,t))return}h(x)},[S,x,p,h,r,g]);let{getButtonProps:w,buttonRef:T}=Ty({disabled:r,native:s,focusableWhenDisabled:!0}),E=u(a),D=y.useRef(!1),O=y.useRef(!1);function k(e){S||r||m(a,Gm(Rm,e.nativeEvent,void 0,{activationDirection:`none`}))}function A(e){S||(x>-1&&h(x),!r&&f&&(!D.current||D.current&&O.current)&&m(a,Gm(Rm,e.nativeEvent,void 0,{activationDirection:`none`})))}function j(e){if(S||r)return;D.current=!0;function t(){D.current=!1,O.current=!1}(!e.button||e.button===0)&&(O.current=!0,sh(e.currentTarget).addEventListener(`pointerup`,t,{once:!0}))}return Dh(`button`,e,{state:y.useMemo(()=>({disabled:r,active:S,orientation:d}),[r,S,d]),ref:[t,T,b],props:[v,{role:`tab`,"aria-controls":E,"aria-selected":S,id:_,onClick:k,onFocus:A,onPointerDown:j,[Dy]:S?``:void 0,onKeyDownCapture(){C.current=!0}},c,w]})}),Py=function(e){return e.index=`data-index`,e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e.hidden=`data-hidden`,e}({}),Fy=y.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,...o}=e,{value:s,getTabIdByPanelValue:c,orientation:l,tabActivationDirection:u,registerMountedTabPanel:d,unregisterMountedTabPanel:f}=vy(),p=Tv(),{ref:m,index:h}=ky({metadata:y.useMemo(()=>({id:p,value:r}),[p,r])}),g=r!==s,_=c(r),v=Dh(`div`,e,{state:y.useMemo(()=>({hidden:g,orientation:l,tabActivationDirection:u}),[g,l,u]),ref:[t,m],props:[{"aria-labelledby":_,hidden:g,id:p??void 0,role:`tabpanel`,tabIndex:g?-1:0,[Py.index]:h},o],stateAttributesMapping:by});return G(()=>{if((!g||a)&&p!=null)return d(r,p),()=>{f(r,p)}},[g,a,r,p,d,f]),g&&!a?null:v});function Iy(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Ly=`ArrowUp`,Ry=`ArrowDown`,zy=`ArrowLeft`,By=`ArrowRight`,Vy=`Home`,Hy=new Set([zy,By]),Uy=new Set([zy,By,Vy,`End`]),Wy=new Set([Ly,Ry]),Gy=new Set([Ly,Ry,Vy,`End`]),Ky=new Set([...Hy,...Wy]),qy=new Set([...Ky,Vy,`End`]),Jy=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function Yy(e){return Wf(e)&&e.tagName===`INPUT`}function Xy(e){return!!(Yy(e)&&e.selectionStart!=null||Wf(e)&&e.tagName===`TEXTAREA`)}function Zy(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Qy(e,t,`left`),a=$y(e),o=$y(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Qy(e,t,`top`),r=$y(e),i=$y(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Qy(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function $y(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var eb=[];function tb(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:i=!1,orientation:a=`both`,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d=!1,disabledIndices:f,modifierKeys:p=eb}=e,[m,h]=y.useState(0),g=n>1,_=y.useRef(null),v=Zm(_,l),b=y.useRef([]),x=y.useRef(!1),S=s??m,C=q((e,t=!1)=>{if((c??h)(e),t){let t=b.current[e];Zy(_.current,t,o,a)}}),w=q(e=>{if(e.size===0||x.current)return;x.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&C(r),Zy(_.current,n,o,a)}),T=y.useMemo(()=>({"aria-orientation":a===`both`?void 0:a,ref:v,onFocus(e){_.current&&Xy(e.target)&&e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let s=u?qy:Ky;if(!s.has(e.key)||nb(e,p)||!_.current)return;let c=o===`rtl`,l=c?zy:By,m={horizontal:l,vertical:Ry,both:l}[a],h=c?By:zy,v={horizontal:h,vertical:Ly,both:h}[a];if(Xy(e.target)&&!Iy(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==m&&t>0)return}let y=S,x=hm(b,f),w=gm(b,f);if(g){let o=t||Array.from({length:b.current.length},()=>({width:1,height:1})),s=ym(o,n,i),l=s.findIndex(e=>e!=null&&!Sm(b,e,f)),u=s.reduce((e,t,n)=>t!=null&&!Sm(b,t,f)?n:e,-1);y=s[vm({current:s.map(e=>e?b.current[e]:null)},{event:e,orientation:a,loopFocus:r,cols:n,disabledIndices:xm([...f||b.current.map((e,t)=>Sm(b,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:bm(S>w?x:S,o,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[Ry],both:[l,Ry]}[a],E={horizontal:[h],vertical:[Ly],both:[h,Ly]}[a],D=g?s:{horizontal:u?Uy:Hy,vertical:u?Gy:Wy,both:s}[a];u&&(e.key===`Home`?y=x:e.key===`End`&&(y=w)),y===S&&(T.includes(e.key)||E.includes(e.key))&&(y=r&&y===w&&T.includes(e.key)?x:r&&y===x&&E.includes(e.key)?w:_m(b,{startingIndex:y,decrement:E.includes(e.key),disabledIndices:f})),y!==S&&!mm(b,y)&&(d&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),C(y,!0),queueMicrotask(()=>{b.current[y]?.focus()}))}}),[n,i,o,f,b,u,S,g,t,r,v,p,C,a,d]);return y.useMemo(()=>({props:T,highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:b,disabledIndices:f,onMapChange:w,relayKeyboardEvent:T.onKeyDown}),[T,S,C,b,f,w])}function nb(e,t){for(let n of Jy.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function rb(e){let{render:t,className:n,refs:r=Pm,props:i=Pm,state:a=Fm,stateAttributesMapping:o,highlightedIndex:s,onHighlightedIndexChange:c,orientation:l,dense:u,itemSizes:d,loopFocus:f,cols:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:x,highlightItemOnHover:S=!1,tag:C=`div`,...w}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=tb({itemSizes:d,cols:p,loopFocus:f,dense:u,orientation:l,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:Iv(),disabledIndices:v,modifierKeys:x}),j=Dh(C,e,{state:a,ref:r,props:[T,...i,w],stateAttributesMapping:o}),M=y.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:S,relayKeyboardEvent:A}),[E,D,S,A]);return(0,b.jsx)(Sy.Provider,{value:M,children:(0,b.jsx)(py,{elementsRef:O,onMapChange:e=>{h?.(e),k(e)},children:j})})}var ib=y.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,...o}=e,{getTabElementBySelectedValue:s,onValueChange:c,orientation:l,value:u,setTabMap:d,tabActivationDirection:f}=vy(),[p,m]=y.useState(0),[h,g]=y.useState(null),_=ob(u,l,h,s),v=q((e,t)=>{e!==u&&(t.activationDirection=_(e),c(e,t))}),x=y.useMemo(()=>({orientation:l,tabActivationDirection:f}),[l,f]),S={"aria-orientation":l===`vertical`?`vertical`:void 0,role:`tablist`},C=y.useMemo(()=>({activateOnFocus:n,highlightedTabIndex:p,onTabActivation:v,setHighlightedTabIndex:m,tabsListElement:h,value:u}),[n,p,v,m,h,u]);return(0,b.jsx)(jy.Provider,{value:C,children:(0,b.jsx)(rb,{render:a,className:r,state:x,refs:[t,g],props:[S,o],stateAttributesMapping:by,highlightedIndex:p,enableHomeAndEndKeys:!0,loopFocus:i,orientation:l,onHighlightedIndexChange:m,onMapChange:d,disabledIndices:Pm})})});function ab(e,t){let{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect();return{left:n-i,top:r-a}}function ob(e,t,n,r){let[i,a]=y.useState(null);return G(()=>{if(e==null||n==null){a(null);return}let i=r(e);if(i==null){a(null);return}let{left:o,top:s}=ab(i,n);a(t===`horizontal`?o:s)},[t,r,n,e]),y.useCallback(o=>{if(o===e)return`none`;if(o==null)return a(null),`none`;if(o!=null&&n!=null){let e=r(o);if(e!=null){let{left:r,top:o}=ab(e,n);if(i==null)return a(t===`horizontal`?r:o),`none`;if(t===`horizontal`){if(r<i)return a(r),`left`;if(r>i)return a(r),`right`}else if(o<i)return a(o),`up`;else if(o>i)return a(o),`down`}}return`none`},[r,t,i,n,e])}var sb=new Map([[`bold`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),y.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),cb=new Map([[`bold`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),y.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),lb=new Map([[`bold`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M233.86,110.48,65.8,14.58A20,20,0,0,0,37.15,38.64L67.33,128,37.15,217.36A20,20,0,0,0,56,244a20.1,20.1,0,0,0,9.81-2.58l.09-.06,168-96.07a20,20,0,0,0,0-34.81ZM63.19,215.26,88.61,140H144a12,12,0,0,0,0-24H88.61L63.18,40.72l152.76,87.17Z`}))],[`duotone`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M227.91,134.86,59.93,231a8,8,0,0,1-11.44-9.67L80,128,48.49,34.72a8,8,0,0,1,11.44-9.67l168,95.85A8,8,0,0,1,227.91,134.86Z`,opacity:`0.2`}),y.createElement(`path`,{d:`M231.87,114l-168-95.89A16,16,0,0,0,40.92,37.34L71.55,128,40.92,218.67A16,16,0,0,0,56,240a16.15,16.15,0,0,0,7.93-2.1l167.92-96.05a16,16,0,0,0,.05-27.89ZM56,224a.56.56,0,0,0,0-.12L85.74,136H144a8,8,0,0,0,0-16H85.74L56.06,32.16A.46.46,0,0,0,56,32l168,95.83Z`}))],[`fill`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M240,127.89a16,16,0,0,1-8.18,14L63.9,237.9A16.15,16.15,0,0,1,56,240a16,16,0,0,1-15-21.33l27-79.95A4,4,0,0,1,71.72,136H144a8,8,0,0,0,8-8.53,8.19,8.19,0,0,0-8.26-7.47h-72a4,4,0,0,1-3.79-2.72l-27-79.94A16,16,0,0,1,63.84,18.07l168,95.89A16,16,0,0,1,240,127.89Z`}))],[`light`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M230.88,115.69l-168-95.88a14,14,0,0,0-20,16.87L73.66,128,42.81,219.33A14,14,0,0,0,56,238a14.15,14.15,0,0,0,6.93-1.83L230.84,140.1a14,14,0,0,0,0-24.41Zm-5.95,14L57,225.73a2,2,0,0,1-2.86-2.42.42.42,0,0,0,0-.1L84.3,134H144a6,6,0,0,0,0-12H84.3L54.17,32.8a.3.3,0,0,0,0-.1,1.87,1.87,0,0,1,.6-2.2A1.85,1.85,0,0,1,57,30.25l168,95.89a1.93,1.93,0,0,1,1,1.74A2,2,0,0,1,224.93,129.66Z`}))],[`regular`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M231.87,114l-168-95.89A16,16,0,0,0,40.92,37.34L71.55,128,40.92,218.67A16,16,0,0,0,56,240a16.15,16.15,0,0,0,7.93-2.1l167.92-96.05a16,16,0,0,0,.05-27.89ZM56,224a.56.56,0,0,0,0-.12L85.74,136H144a8,8,0,0,0,0-16H85.74L56.06,32.16A.46.46,0,0,0,56,32l168,95.83Z`}))],[`thin`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M229.89,117.43l-168-95.88A12,12,0,0,0,44.7,36l31.08,92L44.71,220A12,12,0,0,0,56,236a12.13,12.13,0,0,0,5.93-1.57l167.94-96.08a12,12,0,0,0,0-20.92Zm-4,14L58,227.47a4,4,0,0,1-5.72-4.83l0-.07L82.87,132H144a4,4,0,0,0,0-8H82.87L52.26,33.37A3.89,3.89,0,0,1,53.44,29,4.13,4.13,0,0,1,56,28a3.88,3.88,0,0,1,1.93.54l168,95.87a4,4,0,0,1,0,7Z`}))]]),ub=new Map([[`bold`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),y.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),db=new Map([[`bold`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),y.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,y.createElement(y.Fragment,null,y.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),fb=(0,y.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),pb=y.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...l}=e,{color:u=`currentColor`,size:d,weight:f=`regular`,mirrored:p=!1,...m}=y.useContext(fb);return y.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??d,height:i??d,fill:r??u,viewBox:`0 0 256 256`,transform:o||p?`scale(-1, 1)`:void 0,...m,...l},!!n&&y.createElement(`title`,null,n),s,c.get(a??f))});pb.displayName=`IconBase`;var mb=y.forwardRef((e,t)=>y.createElement(pb,{ref:t,...e,weights:sb}));mb.displayName=`ArrowCounterClockwiseIcon`;var hb=mb,gb=y.forwardRef((e,t)=>y.createElement(pb,{ref:t,...e,weights:cb}));gb.displayName=`CaretRightIcon`;var _b=gb,vb=y.forwardRef((e,t)=>y.createElement(pb,{ref:t,...e,weights:lb}));vb.displayName=`PaperPlaneRightIcon`;var yb=vb,bb=y.forwardRef((e,t)=>y.createElement(pb,{ref:t,...e,weights:ub}));bb.displayName=`StopIcon`;var xb=bb,Sb=y.forwardRef((e,t)=>y.createElement(pb,{ref:t,...e,weights:db}));Sb.displayName=`XIcon`;var Cb=Sb;function wb(e){return typeof e==`object`?e.key:e}function Tb(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function Eb(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Db(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Ob=(e,t)=>Math.abs(e-t)<1.01,kb=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},Ab,jb=()=>{if(Ab!==void 0)return Ab;if(typeof navigator>`u`)return Ab=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ab=!0;let e=navigator.maxTouchPoints;return Ab=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Mb=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Nb=e=>e,Pb=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Fb=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Mb(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Mb(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Ib={passive:!0},Lb=typeof window>`u`||`onscrollend`in window,Rb=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Lb,o=0,s=a?null:kb(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Ib),a&&r.addEventListener(`scrollend`,u,Ib),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},zb=(e,t)=>Rb(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Bb=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Vb=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};function Hb(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var Ub=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Nb,rangeExtractor:Pb,onChange:()=>{},measureElement:Bb,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>wb(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Hb(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Eb(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,jb()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Ib),e.addEventListener(`touchend`,n,Ib),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(jb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!Ob(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Eb(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=Eb(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=Tb(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Eb(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=Kb(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Eb(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=Eb(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return Db(t[Wb(0,t.length-1,r?e=>n[e*2]:e=>Db(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(jb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Ob(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Wb=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Gb(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function Kb(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Gb(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Wb(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var qb=typeof document<`u`?y.useLayoutEffect:y.useEffect;function Jb({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=y.useReducer(e=>e+1,0)[1],a=y.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=y.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=e=>{let t=a.current;if(!t.enabled||!t.container)return;s(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,o=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let s=a.start-o,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==s&&(t.lastPositions.set(c,s),r?c.style.transform=n?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`:c.style[i]=`${s}px`)}},l={...r,onChange:(t,n)=>{var s;let l=a.current,u=!0;if(l.enabled){c(t);let e=t.range,n=l.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(l.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,jh.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[u]=y.useState(()=>{let e=new Ub(l),t=e.measureElement;return e.measureElement=e=>{o.current=!0;try{t(e)}finally{o.current=!1}},Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return u.setOptions(l),qb(()=>u._didMount(),[]),qb(()=>(s(u),u._willUpdate())),qb(()=>{c(u)}),u}function Yb(e){return Jb({observeElementRect:Fb,observeElementOffset:zb,scrollToFn:Vb,...e})}function Xb(e){let t=e.item;if(e.type===`item.started`||e.type===`item.completed`||e.type===`item.updated`){let n=t?.type??`item`,r=e.type===`item.completed`;return n===`command_execution`?{kind:r?`命令完成`:`命令`,text:String(t?.command??``)}:n===`agent_message`?{kind:`汇报`,text:String(t?.text??``)}:n===`reasoning`?{kind:`思考`,text:String(t?.text??``)}:n===`file_change`?{kind:`改文件`,text:JSON.stringify(t?.changes??t)}:n===`error`?{kind:`错误`,text:String(t?.message??t?.text??``),danger:!0}:{kind:n,text:JSON.stringify(t)}}return e.type===`turn.completed`?{kind:`turn 完成`,text:JSON.stringify(e.usage??{})}:e.type===`turn.failed`?{kind:`turn 失败`,text:JSON.stringify(e),danger:!0}:e.type===`thread.started`?{kind:`thread`,text:String(e.thread_id??``)}:{kind:e.type,text:JSON.stringify(e)}}function Zb({events:e}){let t=(0,y.useRef)(null),n=e.map(Xb),r=Yb({count:n.length,getScrollElement:()=>t.current,estimateSize:()=>60,overscan:10});return n.length===0?(0,b.jsx)(`p`,{className:`t-subhead py-8 text-center text-label-2`,children:`没有事件。`}):(0,b.jsx)(`div`,{ref:t,className:`inset h-full overflow-y-auto`,children:(0,b.jsx)(`div`,{style:{height:r.getTotalSize(),position:`relative`},children:r.getVirtualItems().map(e=>{let t=n[e.index];return(0,b.jsx)(`div`,{ref:r.measureElement,"data-index":e.index,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},className:`border-b border-separator-soft px-4 py-2.5`,children:(0,b.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,b.jsx)(`span`,{className:`t-caption mono w-8 shrink-0 text-right text-label-3`,children:e.index+1}),(0,b.jsx)(`span`,{className:`t-footnote w-16 shrink-0 ${t.danger?`text-red`:`text-label-2`}`,children:t.kind}),(0,b.jsx)(`pre`,{className:`t-footnote mono min-w-0 flex-1 whitespace-pre-wrap break-all ${t.danger?`text-red`:`text-label`}`,children:t.text.length>1200?`${t.text.slice(0,1200)}…(共 ${t.text.length} 字)`:t.text})]})},e.key)})})})}function Qb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $b=Qb();function ex(e){$b=e}var tx={exec:()=>null};function nx(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function J(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(ix.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var rx=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),ix={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:nx(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:nx(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:nx(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:nx(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:nx(e=>RegExp(`^ {0,${e}}(?:</?(?:${yx})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:nx(e=>RegExp(`^ {0,${e}}>`))},ax=/^(?:[ \t]*(?:\n|$))+/,ox=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sx=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,cx=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ux=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,dx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fx=J(dx).replace(/bull/g,ux).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),px=J(dx).replace(/bull/g,ux).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,hx=/^[^\n]+/,gx=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,_x=J(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,gx).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),vx=J(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ux).getRegex(),yx=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,bx=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xx=J(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,bx).replace(`tag`,yx).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sx=e=>J(mx).replace(`hr`,cx).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,yx).getRegex(),Cx=Sx(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),wx=Sx(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Tx={blockquote:J(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,wx).getRegex(),code:ox,def:_x,fences:sx,heading:lx,hr:cx,html:xx,lheading:fx,list:vx,newline:ax,paragraph:Cx,table:tx,text:hx},Ex=J(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,cx).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,yx).getRegex(),Dx={...Tx,lheading:px,table:Ex,paragraph:J(mx).replace(`hr`,cx).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Ex).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,yx).getRegex()},Ox={...Tx,html:J(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,bx).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:tx,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:J(mx).replace(`hr`,cx).replace(`heading`,` *#{1,6} *[^
18
+ ]`).replace(`lheading`,fx).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},kx=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ax=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,jx=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Mx=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Nx=/[\p{P}\p{S}]/u,Px=/[\s\p{P}\p{S}]/u,Fx=/[^\s\p{P}\p{S}]/u,Ix=J(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Px).getRegex(),Lx=/[\p{Pi}\p{Ps}"']/u,Rx=/(?!~)[\p{P}\p{S}]/u,zx=/(?!~)[\s\p{P}\p{S}]/u,Bx=/(?:[^\s\p{P}\p{S}]|~)/u,Vx=J(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,rx?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Hx=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ux=J(Hx,`u`).replace(/punct/g,Nx).getRegex(),Wx=J(Hx,`u`).replace(/punct/g,Rx).getRegex(),Gx=J(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Lx).replace(/punct/g,Nx).getRegex(),Kx=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,qx=J(Kx,`gu`).replace(/notPunctSpace/g,Fx).replace(/punctSpace/g,Px).replace(/punct/g,Nx).getRegex(),Jx=J(Kx,`gu`).replace(/notPunctSpace/g,Bx).replace(/punctSpace/g,zx).replace(/punct/g,Rx).getRegex(),Yx=J(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Fx).replace(/punctSpace/g,Px).replace(/punct/g,Nx).getRegex(),Xx=J(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Fx).replace(/punctSpace/g,Px).replace(/punct/g,Nx).getRegex(),Zx=J(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Fx).replace(/punctSpace/g,Px).replace(/punct/g,Nx).getRegex(),Qx=J(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Nx).getRegex(),$x=J(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Fx).replace(/punctSpace/g,Px).replace(/punct/g,Nx).getRegex(),eS=J(/\\(punct)/,`gu`).replace(/punct/g,Nx).getRegex(),tS=J(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),nS=J(bx).replace(`(?:-->|$)`,`-->`).getRegex(),rS=J(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,nS).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),iS=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,aS=J(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,iS).getRegex(),oS=J(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,aS).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sS=J(/^!?\[(label)\]\[(ref)\]/).replace(`label`,aS).replace(`ref`,gx).getRegex(),cS=J(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,gx).getRegex(),lS=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,uS=J(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,iS).getRegex(),dS=J(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,J(/^!?\[(label)\]\[(ref)\]/).replace(`label`,uS).replace(`ref`,lS).getRegex()).replace(`nolink`,J(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,lS).getRegex()).getRegex(),fS=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pS=J(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),mS={_backpedal:tx,anyPunctuation:eS,autolink:tS,blockSkip:Vx,br:jx,code:Ax,del:tx,delLDelim:tx,delRDelim:tx,emStrongLDelim:Ux,emStrongRDelimAst:qx,emStrongRDelimUnd:Xx,escape:kx,link:oS,nolink:cS,punctuation:Ix,reflink:sS,reflinkSearch:dS,tag:rS,text:Mx,url:tx},hS={...mS,emStrongLDelim:Gx,emStrongRDelimAst:Yx,emStrongRDelimUnd:Zx,link:J(/^!?\[(label)\]\((.*?)\)/).replace(`label`,aS).getRegex(),reflink:J(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,aS).getRegex()},gS={...mS,emStrongRDelimAst:Jx,emStrongLDelim:Wx,delLDelim:Qx,delRDelim:$x,url:J(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,pS).replace(`protocol`,fS).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:J(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,fS).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},_S={...gS,br:J(jx).replace(`{2,}`,`*`).getRegex(),text:J(gS.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},vS={normal:Tx,gfm:Dx,pedantic:Ox},yS={normal:mS,gfm:gS,breaks:_S,pedantic:hS},bS={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},xS=e=>bS[e];function SS(e,t){if(t){if(ix.escapeTest.test(e))return e.replace(ix.escapeReplace,xS)}else if(ix.escapeTestNoEncode.test(e))return e.replace(ix.escapeReplaceNoEncode,xS);return e}function CS(e){return e.replace(ix.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function wS(e){try{e=encodeURI(e).replace(ix.percentDecode,`%`)}catch{return null}return e}function TS(e,t){let n=e.replace(ix.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(ix.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(ix.slashPipe,`|`);return n}function ES(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function DS(e){let t=e.split(`
19
+ `),n=t.length-1;for(;n>=0&&ix.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
20
+ `)}function OS(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function kS(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function AS(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function jS(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function MS(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
21
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
22
+ `)}function NS(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var PS=class{options;rules;lexer;constructor(e){this.options=e||$b}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:DS(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=MS(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ES(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:ES(t[0],`
23
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ES(t[0],`
24
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ES(t[0],`
25
+ `).split(`
26
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
27
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
28
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
29
+ ${s}`:s,r=r?`${r}
30
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
31
+ `),o=t.raw+`
32
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
33
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
34
+ ${d.join(`
35
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
36
+ `+e.join(`
37
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
38
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
39
+ `,1)[0],l=t[1].length,u=this.options.pedantic?AS(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>AS(e,l)),d=e.split(`
40
+ `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
41
+ `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
42
+ `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
43
+ `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
44
+ `+d}f=!d.trim(),r+=l+`
45
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=DS(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&kS(t[2],`()`)!==-1)return;let e=OS(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:ES(t[0],`
46
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=TS(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
47
+ `):[],a={type:`table`,raw:ES(t[0],`
48
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(TS(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:ES(t[0],`
49
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
50
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&NS(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=ES(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=kS(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),jS(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&NS(e,n[1],r,this.rules))return;let i=t[OS((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return jS(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:CS(t[0]),escaped:e}}}},FS=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$b,this.options.tokenizer=this.options.tokenizer||new PS,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:ix,block:vS.normal,inline:yS.normal};this.options.pedantic?(t.block=vS.pedantic,t.inline=yS.pedantic):this.options.gfm&&(t.block=vS.gfm,t.inline=this.options.breaks?yS.breaks:yS.gfm),this.tokenizer.rules=t}static get rules(){return{block:vS,inline:yS}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(ix.carriageReturn,`
51
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ix.tabCharGlobal,` `).replace(ix.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
52
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
53
+ `)?``:`
54
+ `)+i.raw,n.text+=`
55
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
56
+ `)?``:`
57
+ `)+i.raw,n.text+=`
58
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
59
+ `)?``:`
60
+ `)+i.raw,r.text+=`
61
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
62
+ `)?``:`
63
+ `)+i.raw,n.text+=`
64
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,OS(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,OS(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},IS=class{options;parser;constructor(e){this.options=e||$b}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(ix.notSpaceStart)?.[0],i=e?e.replace(ix.endingNewline,``)+`
65
+ `:``;return r?`<pre><code class="language-`+SS(r)+`">`+(n?i:SS(i,!0))+`</code></pre>
66
+ `:`<pre><code>`+(n?i:SS(i,!0))+`</code></pre>
67
+ `}blockquote({tokens:e}){return`<blockquote>
68
+ ${this.parser.parse(e)}</blockquote>
69
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
70
+ `}hr(e){return`<hr>
71
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
72
+ `+r+`</`+i+`>
73
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
74
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
75
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
76
+ <thead>
77
+ `+t+`</thead>
78
+ `+r+`</table>
79
+ `}tablerow({text:e}){return`<tr>
80
+ ${e}</tr>
81
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
82
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${SS(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?SS(n,!0):this.parser.parseInline(r),o=wS(e);if(o===null)return a;e=SS(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+SS(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=wS(e);if(i===null)return SS(n);e=i;let a=`<img src="${SS(e)}" alt="${SS(n)}"`;return t&&(a+=` title="${SS(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:SS(e.text)}},LS=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},RS=class e{options;renderer;textRenderer;constructor(e){this.options=e||$b,this.options.renderer=this.options.renderer||new IS,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new LS}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},zS=class{options;block;constructor(e){this.options=e||$b}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?FS.lex:FS.lexInline}provideParser(e=this.block){return e?RS.parse:RS.parseInline}},BS=new class{defaults=Qb();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=RS;Renderer=IS;TextRenderer=LS;Lexer=FS;Tokenizer=PS;Hooks=zS;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new IS(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new PS(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new zS;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=zS.passThroughHooks.has(n)?e=>{if(this.defaults.async&&zS.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return FS.lex(e,t??this.defaults)}parser(e,t){return RS.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?FS.lex:FS.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?RS.parse:RS.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?FS.lex:FS.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?RS.parse:RS.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
83
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+SS(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function VS(e,t){return BS.parse(e,t)}VS.options=VS.setOptions=function(e){return BS.setOptions(e),VS.defaults=BS.defaults,ex(VS.defaults),VS},VS.getDefaults=Qb,VS.defaults=$b;function HS(...e){return BS.use(...e),VS.defaults=BS.defaults,ex(VS.defaults),VS}VS.use=HS,VS.walkTokens=function(e,t){return BS.walkTokens(e,t)},VS.parseInline=BS.parseInline,VS.Parser=RS,VS.parser=RS.parse,VS.Renderer=IS,VS.TextRenderer=LS,VS.Lexer=FS,VS.lexer=FS.lex,VS.Tokenizer=PS,VS.Hooks=zS,VS.parse=VS,VS.options,VS.setOptions,VS.walkTokens,VS.parseInline,RS.parse,FS.lex;function US(e,t){this.v=e,this.k=t}function WS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function GS(e){if(Array.isArray(e))return e}function KS(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function qS(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
84
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JS(e,t){return GS(e)||KS(e,t)||YS(e,t)||qS()}function YS(e,t){if(e){if(typeof e==`string`)return WS(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WS(e,t):void 0}}function XS(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof US;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}XS.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},XS.prototype.next=function(e){return this._invoke(`next`,e)},XS.prototype.throw=function(e){return this._invoke(`throw`,e)},XS.prototype.return=function(e){return this._invoke(`return`,e)};var ZS=Object.entries,QS=Object.setPrototypeOf,$S=Object.isFrozen,eC=Object.getPrototypeOf,tC=Object.getOwnPropertyDescriptor,nC=Object.freeze,rC=Object.seal,iC=Object.create,aC=typeof Reflect<`u`&&Reflect,oC=aC.apply,sC=aC.construct;nC||=function(e){return e},rC||=function(e){return e},oC||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},sC||=function(e){return new e(...[...arguments].slice(1))};var cC=OC(Array.prototype.forEach);Array.prototype.indexOf;var lC=OC(Array.prototype.lastIndexOf),uC=OC(Array.prototype.pop),dC=OC(Array.prototype.push);Array.prototype.slice;var fC=OC(Array.prototype.splice),pC=Array.isArray,mC=OC(String.prototype.toLowerCase),hC=OC(String.prototype.toString),gC=OC(String.prototype.match),_C=OC(String.prototype.replace),vC=OC(String.prototype.indexOf),yC=OC(String.prototype.trim),bC=OC(Number.prototype.toString),xC=OC(Boolean.prototype.toString),SC=typeof BigInt>`u`?null:OC(BigInt.prototype.toString),CC=typeof Symbol>`u`?null:OC(Symbol.prototype.toString),wC=OC(Object.prototype.hasOwnProperty),TC=OC(Object.prototype.toString),EC=OC(RegExp.prototype.test),DC=kC(TypeError);function OC(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return oC(e,t,n)}}function kC(e){return function(){return sC(e,[...arguments])}}function AC(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mC;if(QS&&QS(e,null),!pC(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&($S(t)||(t[r]=e),i=e)}e[i]=!0}return e}function jC(e){for(let t=0;t<e.length;t++)wC(e,t)||(e[t]=null);return e}function MC(e){let t=iC(null);for(let r of ZS(e)){var n=JS(r,2);let i=n[0],a=n[1];wC(e,i)&&(t[i]=pC(a)?jC(a):a&&typeof a==`object`&&a.constructor===Object?MC(a):a)}return t}function NC(e){switch(typeof e){case`string`:return e;case`number`:return bC(e);case`boolean`:return xC(e);case`bigint`:return SC?SC(e):`0`;case`symbol`:return CC?CC(e):`Symbol()`;case`undefined`:return TC(e);case`function`:case`object`:{if(e===null)return TC(e);let t=e,n=PC(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:TC(e)}return TC(e)}default:return TC(e)}}function PC(e,t){for(;e!==null;){let n=tC(e,t);if(n){if(n.get)return OC(n.get);if(typeof n.value==`function`)return OC(n.value)}e=eC(e)}function n(){return null}return n}function FC(e){try{return EC(e,``),!0}catch{return!1}}var IC=nC(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),LC=nC(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),RC=nC([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),zC=nC([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),BC=nC(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),VC=nC([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),HC=nC([`#text`]),UC=nC(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),WC=nC(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),GC=nC(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),KC=nC([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),qC=rC(/{{[\w\W]*|^[\w\W]*}}/g),JC=rC(/<%[\w\W]*|^[\w\W]*%>/g),YC=rC(/\${[\w\W]*/g),XC=rC(/^data-[\-\w.\u00B7-\uFFFF]+$/),ZC=rC(/^aria-[\-\w]+$/),QC=rC(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$C=rC(/^(?:\w+script|data):/i),ew=rC(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tw=rC(/^html$/i),nw=rC(/^[a-z][.\w]*(-[.\w]+)+$/i),rw=rC(/<[/\w!]/g),iw=rC(/<[/\w]/g),aw=rC(/<\/no(script|embed|frames)/i),ow=rC(/\/>/i),sw={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},cw=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],lw=nC(AC({},cw)),uw=function(){let e={};return cC(cw,t=>{e[t]=rC(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),nC(e)}(),dw=function(){return typeof window>`u`?null:window},fw=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},pw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},mw=function(e,t,n,r){return wC(e,t)&&pC(e[t])?AC(r.base?MC(r.base):{},e[t],r.transform):n},hw=function(e,t,n){let r=wC(e,t)?e[t]:void 0;return r&&typeof r==`object`?MC(r):n()};function gw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dw(),t=e=>gw(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==sw.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=PC(d,`cloneNode`),p=PC(d,`remove`),m=PC(d,`removeAttributeNode`),h=PC(d,`nextSibling`),g=PC(d,`childNodes`),_=PC(d,`parentNode`),v=PC(d,`shadowRoot`),y=PC(d,`attributes`),b=o&&o.prototype?PC(o.prototype,`nodeType`):null,x=o&&o.prototype?PC(o.prototype,`nodeName`):null,S=o&&o.prototype?PC(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,O=!1,k=0,A=function(){if(k>0)throw DC(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},j=function(e){A(),k++;try{return T.createHTML(e)}finally{k--}},M=function(e){A(),k++;try{return T.createScriptURL(e)}finally{k--}},ee=function(){return O||=(D=fw(u,i),!0),D},N=n,te=N.implementation,ne=N.createNodeIterator,re=N.createDocumentFragment,ie=N.getElementsByTagName,ae=r.importNode,P=pw();t.isSupported=typeof ZS==`function`&&typeof _==`function`&&te&&te.createHTMLDocument!==void 0;let oe=qC,se=JC,ce=YC,le=XC,ue=ZC,de=$C,fe=ew,pe=nw,me=QC,F=null,I=AC({},[...IC,...LC,...RC,...BC,...HC]),L=null,he=AC({},[...UC,...WC,...GC,...KC]),ge=Object.seal(iC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,ve=null,ye=Object.seal(iC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),R=!0,be=!0,xe=!1,Se=!0,Ce=!1,we=!0,Te=!1,Ee=!1,De=null,Oe=null,ke=!1,Ae=!1,je=!1,Me=!1,Ne=!0,Pe=!1,Fe=`user-content-`,Ie=!0,Le=!1,Re={},ze=null,Be=AC({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ve=null,He=AC({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ue=null,We=AC({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ge=`http://www.w3.org/1998/Math/MathML`,Ke=`http://www.w3.org/2000/svg`,qe=`http://www.w3.org/1999/xhtml`,Je=qe,Ye=!1,Xe=null,Ze=AC({},[Ge,Ke,qe],hC),Qe=nC([`mi`,`mo`,`mn`,`ms`,`mtext`]),$e=AC({},Qe),et=nC([`annotation-xml`]),tt=AC({},et),nt=AC({},[`title`,`style`,`font`,`a`,`script`]),rt=null,it=[`application/xhtml+xml`,`text/html`],at=null,ot=null,st=n.createElement(`form`),ct=function(e){return e instanceof RegExp||e instanceof Function},lt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ot&&ot===e)return;(!e||typeof e!=`object`)&&(e={}),e=MC(e),rt=it.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,at=rt===`application/xhtml+xml`?hC:mC,F=mw(e,`ALLOWED_TAGS`,I,{transform:at}),L=mw(e,`ALLOWED_ATTR`,he,{transform:at}),Xe=mw(e,`ALLOWED_NAMESPACES`,Ze,{transform:hC}),Ue=mw(e,`ADD_URI_SAFE_ATTR`,We,{transform:at,base:We}),Ve=mw(e,`ADD_DATA_URI_TAGS`,He,{transform:at,base:He}),ze=mw(e,`FORBID_CONTENTS`,Be,{transform:at}),_e=mw(e,`FORBID_TAGS`,MC({}),{transform:at}),ve=mw(e,`FORBID_ATTR`,MC({}),{transform:at}),Re=wC(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?MC(e.USE_PROFILES):e.USE_PROFILES:!1,R=e.ALLOW_ARIA_ATTR!==!1,be=e.ALLOW_DATA_ATTR!==!1,xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=e.SAFE_FOR_TEMPLATES||!1,we=e.SAFE_FOR_XML!==!1,Te=e.WHOLE_DOCUMENT||!1,Ae=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_TRUSTED_TYPE||!1,ke=e.FORCE_BODY||!1,Ne=e.SANITIZE_DOM!==!1,Pe=e.SANITIZE_NAMED_PROPS||!1,Ie=e.KEEP_CONTENT!==!1,Le=e.IN_PLACE||!1,me=FC(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:QC,Je=typeof e.NAMESPACE==`string`?e.NAMESPACE:qe,$e=hw(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>AC({},Qe)),tt=hw(e,`HTML_INTEGRATION_POINTS`,()=>AC({},et));let t=hw(e,`CUSTOM_ELEMENT_HANDLING`,()=>iC(null));if(ge=iC(null),wC(t,`tagNameCheck`)&&ct(t.tagNameCheck)&&(ge.tagNameCheck=t.tagNameCheck),wC(t,`attributeNameCheck`)&&ct(t.attributeNameCheck)&&(ge.attributeNameCheck=t.attributeNameCheck),wC(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ge.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),rC(ge),Ce&&(be=!1),je&&(Ae=!0),Re&&(F=AC({},HC),L=iC(null),Re.html===!0&&(AC(F,IC),AC(L,UC)),Re.svg===!0&&(AC(F,LC),AC(L,WC),AC(L,KC)),Re.svgFilters===!0&&(AC(F,RC),AC(L,WC),AC(L,KC)),Re.mathMl===!0&&(AC(F,BC),AC(L,GC),AC(L,KC))),ye.tagCheck=null,ye.attributeCheck=null,wC(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ye.tagCheck=e.ADD_TAGS:pC(e.ADD_TAGS)&&(F===I&&(F=MC(F)),AC(F,e.ADD_TAGS,at))),wC(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ye.attributeCheck=e.ADD_ATTR:pC(e.ADD_ATTR)&&(L===he&&(L=MC(L)),AC(L,e.ADD_ATTR,at))),wC(e,`ADD_FORBID_CONTENTS`)&&pC(e.ADD_FORBID_CONTENTS)&&(ze===Be&&(ze=MC(ze)),AC(ze,e.ADD_FORBID_CONTENTS,at)),Ie&&(F[`#text`]=!0),Te&&AC(F,[`html`,`head`,`body`]),F.table&&(AC(F,[`tbody`]),delete _e.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw DC(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw DC(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=j(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ee()),T&&typeof E==`string`&&(E=j(``)));nC&&nC(e),ot=e},ut=AC({},[...LC,...RC,...zC]),dt=AC({},[...BC,...VC]),ft=function(e,t,n){return t.namespaceURI===qe?e===`svg`:t.namespaceURI===Ge?e===`svg`&&(n===`annotation-xml`||$e[n]):!!ut[e]},pt=function(e,t,n){return t.namespaceURI===qe?e===`math`:t.namespaceURI===Ke?e===`math`&&tt[n]:!!dt[e]},mt=function(e,t,n){return t.namespaceURI===Ke&&!tt[n]||t.namespaceURI===Ge&&!$e[n]?!1:!dt[e]&&(nt[e]||!ut[e])},ht=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Je,tagName:`template`});let n=mC(e.tagName),r=mC(t.tagName);return Xe[e.namespaceURI]?e.namespaceURI===Ke?ft(n,t,r):e.namespaceURI===Ge?pt(n,t,r):e.namespaceURI===qe?mt(n,t,r):!!(rt===`application/xhtml+xml`&&Xe[e.namespaceURI]):!1},gt=function(e){dC(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw DC(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_t=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},vt=function(e){xt(e);let t=g(e);if(t){let e=[];cC(t,t=>{dC(e,t)}),cC(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&_t(e,r,i)}},yt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}dC(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ae||je)try{gt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},bt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||L[at(i)]||_t(e,r,i)}},xt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===sw.element&&bt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},St=function(e,t){return we?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Ct=function(e){if(!we)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===sw.processingInstruction||n===sw.comment&&EC(iw,e.data)){try{p(e)}catch{}continue}if(n===sw.element){let t=e,n=at(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&St(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},wt=function(e){let t=null,r=null;if(ke)e=`<remove></remove>`+e;else{let t=gC(e,/^[\r\n\t ]+/);r=t&&t[0]}rt===`application/xhtml+xml`&&Je===qe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?j(e):e;if(Je===qe)try{t=new l().parseFromString(i,rt)}catch{}if(!t||!t.documentElement){t=te.createDocument(Je,`template`,null);try{t.documentElement.innerHTML=Ye?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Je===qe?ie.call(t,Te?`html`:`body`)[0]:Te?t.documentElement:a},Tt=function(e){let t=S?S(e):e.ownerDocument;return ne.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Et=function(e){return e=_C(e,oe,` `),e=_C(e,se,` `),e=_C(e,ce,` `),e},Dt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ne.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Et(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&cC(i,e=>{kt(e.content)&&Dt(e.content)})},Ot=function(e){let t=x?x(e):null;return typeof t!=`string`||at(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},kt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===sw.documentFragment}catch{return!1}},At=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function jt(e,n,r){e.length!==0&&cC(e,e=>{e.call(t,n,r,ot)})}let Mt=function(e,t){return!!(we&&e.hasChildNodes()&&!At(e.firstElementChild)&&EC(rw,e.textContent)&&EC(rw,e.innerHTML)||we&&e.namespaceURI===qe&&lw[t]&&(At(e.firstElementChild)||typeof e.textContent==`string`&&EC(uw[t],e.textContent))||e.nodeType===sw.processingInstruction||we&&e.nodeType===sw.comment&&EC(iw,e.data))},Nt=function(e,t){return e instanceof RegExp?EC(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Pt=function(e,t,n){if(!_e[t]&&Bt(t)&&Nt(ge.tagNameCheck,t))return!1;if(Ie&&!ze[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return gt(e),!0},Ft=function(e,t,n,r){return e.length===0?t:t===n||t===r?MC(t):t},It=function(e,t){return e===t||_(e)!==null?!1:(Le&&xt(e),!0)},Lt=function(e,n){if(jt(P.beforeSanitizeElements,e,null),It(e,n))return!0;if(Ot(e))return gt(e),!0;let r=at(w(e));if(F=Ft(P.uponSanitizeElement,F,I,De),jt(P.uponSanitizeElement,e,{tagName:r,allowedTags:F}),It(e,n))return!0;if(Mt(e,r))return gt(e),!0;if(_e[r]||!(ye.tagCheck instanceof Function&&ye.tagCheck(r))&&!F[r]){let t=Pt(e,r,n);return t===!1&&(jt(P.afterSanitizeElements,e,null),It(e,n))?!0:t}if(C(e)===sw.element&&!ht(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&EC(aw,e.innerHTML))return gt(e),!0;if(Ce&&e.nodeType===sw.text){let n=Et(e.textContent);e.textContent!==n&&(dC(t.removed,{element:e.cloneNode()}),e.textContent=n)}return jt(P.afterSanitizeElements,e,null),It(e,n)},Rt=function(e,t,r){if(ve[t]||St(t,e)||Ne&&(t===`id`||t===`name`)&&(r in n||r in st))return!1;let i=L[t]||ye.attributeCheck instanceof Function&&ye.attributeCheck(t,e);return be&&EC(le,t)||R&&EC(ue,t)?!0:i?Ue[t]||EC(me,_C(r,fe,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&vC(r,`data:`)===0&&Ve[e]||xe&&!EC(de,_C(r,fe,``))?!0:!r:Bt(e)&&Nt(ge.tagNameCheck,e)&&Nt(ge.attributeNameCheck,t,e)||t===`is`&&ge.allowCustomizedBuiltInElements&&Nt(ge.tagNameCheck,r)},zt=AC({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Bt=function(e){return!zt[mC(e)]&&EC(pe,e)},Vt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return j(r);case`TrustedScriptURL`:return M(r)}return r},Ht=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Ot(e)||(gt(e),!1)}catch{return yt(t,e),!1}},Ut=function(e,n){if(jt(P.beforeSanitizeAttributes,e,null),It(e,n))return;let r=e.attributes;if(!r||Ot(e))return;L=Ft(P.uponSanitizeAttribute,L,he,Oe);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},a=r.length,o=at(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=at(s),d=l,f=s===`value`?d:yC(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,jt(P.uponSanitizeAttribute,e,i),f=i.attrValue,Pe&&(u===`id`||u===`name`)&&vC(f,Fe)!==0&&(yt(s,e,n),f=Fe+f,p=!0),we&&EC(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){yt(s,e,n);continue}if(u===`attributename`&&gC(f,`href`)){yt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){yt(s,e,n);continue}if(!Se&&EC(ow,f)){yt(s,e,n);continue}if(Ce&&(f=Et(f)),!Rt(o,u,f)){yt(s,e,n);continue}f=Vt(o,u,c,f),f!==d&&Ht(e,s,c,f)&&p&&uC(t.removed)}}jt(P.afterSanitizeAttributes,e,null),It(e,n)},Wt=function(e){let t=null,n=Tt(e);for(jt(P.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(jt(P.uponSanitizeShadowNode,t,null),Lt(t,e),Ut(t,e),kt(t.content)&&Wt(t.content),C(t)===sw.element){let e=v(t);kt(e)&&(Gt(e),Wt(e))}jt(P.afterSanitizeShadowDOM,e,null)},Gt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Wt(e.shadow);continue}let n=e.node,r=C(n)===sw.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&at(e)===`template`){let e=n.content;kt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);kt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ye=!e,Ye&&(e=`<!-->`),typeof e!=`string`&&!At(e)&&(e=NC(e),typeof e!=`string`))throw DC(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ee?(F=De,L=Oe):lt(n),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(F=MC(F)),P.uponSanitizeAttribute.length>0&&(L=MC(L)),t.removed=[];let c=Le&&typeof e!=`string`&&At(e);if(c){Ct(e);let t=w(e);if(typeof t==`string`){let n=at(t);if(!F[n]||_e[n])throw vt(e),DC(`root node is forbidden and cannot be sanitized in-place`)}if(Ot(e))throw vt(e),DC(`root node is clobbered and cannot be sanitized in-place`);try{Gt(e)}catch(t){throw vt(e),t}}else if(At(e))i=wt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===sw.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Gt(i);else{if(!Ae&&!Ce&&!Te&&e.indexOf(`<`)===-1)return T&&Me?j(e):e;if(i=wt(e),!i)return Ae?null:Me?E:``}i&&ke&&gt(i.firstChild);let l=c?e:i;try{let e=Tt(l);for(;o=e.nextNode();)Lt(o,l),Ut(o,l),kt(o.content)&&Wt(o.content)}catch(n){throw c&&(vt(e),cC(t.removed,e=>{e.element&&xt(e.element)})),n}if(c){let n=!1;if(cC(t.removed,t=>{t.element&&(t.element===e&&(n=!0),xt(t.element))}),n)throw DC(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ce&&Dt(e),e}if(Ae){if(Ce&&Dt(i),je)for(s=re.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=ae.call(r,s,!0)),s}let u=Te?i.outerHTML:i.innerHTML;return Te&&F[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&EC(tw,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
85
+ `+u),Ce&&(u=Et(u)),T&&Me?j(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lt(e),Ee=!0,De=F,Oe=L},t.clearConfig=function(){ot=null,Ee=!1,De=null,Oe=null,T=D,E=``},t.isValidAttribute=function(e,t,n){ot||lt({});let r=at(e),i=at(t);return Rt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&wC(P,e)&&dC(P[e],t)},t.removeHook=function(e,t){if(wC(P,e)){if(t!==void 0){let n=lC(P[e],t);return n===-1?void 0:fC(P[e],n,1)[0]}return uC(P[e])}},t.removeHooks=function(e){wC(P,e)&&(P[e]=[])},t.removeAllHooks=function(){P=pw()},t}var _w=gw();VS.setOptions({gfm:!0,breaks:!1});function vw({text:e,className:t=``}){let n=(0,y.useMemo)(()=>_w.sanitize(VS.parse(e,{async:!1}),{USE_PROFILES:{html:!0}}),[e]);return(0,b.jsx)(`div`,{className:`md ${t}`,dangerouslySetInnerHTML:{__html:n}})}var yw=`vercel.ai.error`,bw=Symbol.for(yw),xw=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[bw]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,yw)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}},Sw=`AI_APICallError`,Cw=`vercel.ai.error.${Sw}`,ww=Symbol.for(Cw),Tw=class extends xw{constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:o,isRetryable:s=r!=null&&(r===408||r===409||r===429||r>=500),data:c}){super({name:Sw,message:e,cause:o}),this[ww]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=s,this.data=c}static isInstance(e){return xw.hasMarker(e,Cw)}},Ew=`AI_EmptyResponseBodyError`,Dw=`vercel.ai.error.${Ew}`,Ow=Symbol.for(Dw),kw=class extends xw{constructor({message:e=`Empty response body`}={}){super({name:Ew,message:e}),this[Ow]=!0}static isInstance(e){return xw.hasMarker(e,Dw)}};function Aw(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var jw=`AI_InvalidArgumentError`,Mw=`vercel.ai.error.${jw}`,Nw=Symbol.for(Mw),Pw=class extends xw{constructor({message:e,cause:t,argument:n}){super({name:jw,message:e,cause:t}),this[Nw]=!0,this.argument=n}static isInstance(e){return xw.hasMarker(e,Mw)}},Fw=`AI_JSONParseError`,Iw=`vercel.ai.error.${Fw}`,Lw=Symbol.for(Iw),Rw=class extends xw{constructor({text:e,cause:t}){super({name:Fw,message:`JSON parsing failed: Text: ${e}.\nError message: ${Aw(t)}`,cause:t}),this[Lw]=!0,this.text=e}static isInstance(e){return xw.hasMarker(e,Iw)}},zw=`AI_TypeValidationError`,Bw=`vercel.ai.error.${zw}`,Vw=Symbol.for(Bw),Hw=class e extends xw{constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:zw,message:`${r}: Value: ${JSON.stringify(e)}.\nError message: ${Aw(t)}`,cause:t}),this[Vw]=!0,this.value=e,this.context=n}static isInstance(e){return xw.hasMarker(e,Bw)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}},Uw=`AI_UnsupportedFunctionalityError`,Ww=`vercel.ai.error.${Uw}`,Gw=Symbol.for(Ww),Kw=class extends xw{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:Uw,message:t}),this[Gw]=!0,this.functionality=e}static isInstance(e){return xw.hasMarker(e,Ww)}};function qw(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Jw(e,t=`|`){return e.map(e=>xT(e)).join(t)}function Yw(e,t){return typeof t==`bigint`?t.toString():t}var Xw=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Zw(e){return new Xw(e)}function Qw(e){return e==null}function $w(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function eT(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var tT=Symbol(`evaluating`);function nT(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==tT)return r===void 0&&(r=tT,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function rT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function iT(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function aT(e){return iT(e._zod.def)??e._zod.def.shape}function oT(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return rT(this,t,e),e},enumerable:!0,configurable:!0})}function sT(e,t,n){t in e?rT(e,t,n):e[t]=n}function cT(e,t,n,r){let i=aT(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?oT(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):sT(e,a,r?r(n.value,a):n.value))}}function lT(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?oT(e,n,()=>t[n]):sT(e,n,r.value))}}function uT(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function dT(e){return JSON.stringify(e)}function fT(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var pT=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function mT(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var hT=Zw(()=>{if(lE.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function gT(e){if(mT(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return mT(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function _T(e){return gT(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var vT=new Set([`string`,`number`,`symbol`]);function yT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function bT(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Y(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function xT(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ST(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var CT={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wT={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function TT(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return cT(i,e,ET(e,t)),bT(e,uT(n,{shape:i,checks:[]}))}function ET(e,t){let n=aT(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function DT(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(ET(e,t)),a={};return cT(a,e,Reflect.ownKeys(aT(e)).filter(e=>!i.has(e))),bT(e,uT(n,{shape:a,checks:[]}))}function OT(e,t){if(!gT(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=aT(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return bT(e,uT(e._zod.def,{shape:kT(e,t)}))}function kT(e,t){let n={};return cT(n,e,Reflect.ownKeys(aT(e))),lT(n,t),n}function AT(e,t){if(!gT(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return bT(e,uT(e._zod.def,{shape:kT(e,t)}))}function jT(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return cT(n,e,Reflect.ownKeys(aT(e))),cT(n,t,Reflect.ownKeys(aT(t))),bT(e,uT(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function MT(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(ET(t,n)):void 0,o={};return cT(o,t,Reflect.ownKeys(aT(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),bT(t,uT(t._zod.def,{shape:o,checks:[]}))}function NT(e,t,n){let r=n?new Set(ET(t,n)):void 0,i={};return cT(i,t,Reflect.ownKeys(aT(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),bT(t,uT(t._zod.def,{shape:i}))}function PT(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function FT(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function IT(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function LT(e){return typeof e==`string`?e:e?.message}function RT(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function zT(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:LT(e.inst?._zod.def?.error?.(e))??LT(a?.(e))??LT(t?.error?.(e))??LT(n.customError?.(e))??LT(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var BT=/[\uD800-\uDBFF]/;function VT(e){let t=e.length;if(!BT.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function HT(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function UT(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function WT(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function GT(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):YT(e,n,r.value)}}function KT(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function qT(e,t,n){return KT(e,t,n,!1)}function JT(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return KT(this,n,r(this))},set(e){KT(this,n,e)}})}return t}function YT(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:KT(this,t,n.bind(this))},set(e){KT(this,t,e)}})}function XT(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var ZT,QT=!1,$T={configurable:!0,get(){QT=!0}};function X(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&ZT!==e._zod){ZT=void 0;return}ZT=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,$T);let e=QT;QT=!1;try{let r=n(this);return QT?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),QT||=e,r}catch(n){throw delete this[t],QT||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function eE(e,t,n,r){let i=XT(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var tE=`~constantCatch`;function nE(e){let t=()=>e;return t[tE]=!0,t}var rE,iE={value:void 0,enumerable:!1},aE=`captureStackTrace`in Error?Error:null;function oE(e){let t=aE;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return aE=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Z(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){iE.value=new a(r);try{Object.defineProperty(n,"_zod",iE)}finally{iE.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),GT(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?oE(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var sE=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},cE=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(rE=globalThis).__zod_globalConfig??(rE.__zod_globalConfig={});var lE=globalThis.__zod_globalConfig;function uE(e){return e&&Object.assign(lE,e),lE}function dE(){let e=this._zod;return e.message??=JSON.stringify(e.def,Yw,2),e.message}function fE(e){this._zod.message=e}var pE={get:dE,set:fE,enumerable:!0,configurable:!0},mE={value:void 0,enumerable:!1},hE=new WeakSet([Object.prototype,Error.prototype]),gE=(e,t)=>{e.name=`$ZodError`,mE.value=t,Object.defineProperty(e,"issues",mE),mE.value=void 0,Object.defineProperty(e,"message",pE);let n=Object.getPrototypeOf(e);hE.has(n)||(hE.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},_E=Z(`$ZodError`,gE);Z(`$ZodError`,gE,void 0,{Parent:Error});function vE(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function yE(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?vE(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function bE(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function xE(e,t){return{callee:t?.callee??e,Err:t?.Err}}var SE=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new sE;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>zT(e,o,uE())));throw pT(n,a?.callee??t),n}return s.value};return t},CE=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>zT(e,o,uE())));throw pT(n,a?.callee??t),n}return s.value};return t},wE=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new sE;return a.issues.length?TE(e,a.issues,i):{success:!0,data:a.value}};function TE(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>zT(e,n,uE()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var EE=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?TE(e,a.issues,i):{success:!0,data:a.value}},DE=Symbol.for(`zod.compile.invalid`),OE=Symbol.for(`zod.compile.fallback`),kE=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==DE)return!0;if(r.definite===!0&&n===void 0)return!1}return AE(e,t,n)});function AE(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[OE]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new sE;return a.issues.length===0}var jE=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ME=e=>{let t=SE(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,xE(n,a))};return n},NE=e=>{let t=SE(e),n=(e,r,i,a)=>t(e,r,i,xE(n,a));return n},PE=e=>{let t=CE(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,xE(n,a))};return n},FE=e=>{let t=CE(e),n=async(e,r,i,a)=>await t(e,r,i,xE(n,a));return n},IE=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return wE(e)(t,n,i)},LE=e=>(t,n,r)=>wE(e)(t,n,r),RE=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return EE(e)(t,n,i)},zE=e=>async(t,n,r)=>EE(e)(t,n,r),BE=/^[cC][0-9a-z]{6,}$/,VE=/^[0-9a-z]+$/,HE=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,UE=/^[0-9a-vA-V]{20}$/,WE=/^[A-Za-z0-9]{27}$/,GE=/^[a-zA-Z0-9_-]{21}$/;function KE(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var qE=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,JE=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,YE=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,XE=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ZE=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function QE(){return new RegExp(ZE,`u`)}var $E=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,nD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,iD=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,aD=/^https?$/,oD=/^\+[1-9]\d{6,14}$/,sD=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function cD(e){return RegExp(`^${e}$`)}var lD=cD(sD);function uD(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function dD(e){return RegExp(`^${uD(e)}$`)}function fD(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${uD({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${uD({precision:e.precision})}`:n;return RegExp(`^${sD}T(?:${r})$`)}var pD=/^[\s\S]{0,}$/,mD=/^-?\d+$/,hD=/^-?\d+(?:\.\d+)?$/,gD=/^(?:true|false)$/i,_D=/^null$/i,vD=/^[^A-Z]*$/,yD=/^[^a-z]*$/,bD=Z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),xD=e=>{let t=e.value;return!Qw(t)&&t.length!==void 0},SD={number:`number`,bigint:`bigint`,object:`date`},CD=Z(`$ZodCheckLessThan`,(e,t)=>{bD.init(e,t);let n=SD[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:SD[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wD=Z(`$ZodCheckGreaterThan`,(e,t)=>{bD.init(e,t);let n=SD[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:SD[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),TD=Z(`$ZodCheckMultipleOf`,(e,t)=>{bD.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):eT(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ED=Z(`$ZodCheckNumberFormat`,(e,t)=>{bD.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=CT[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),DD=Z(`$ZodCheckMaxLength`,(e,t)=>{var n;bD.init(e,t),(n=e._zod.def).when??(n.when=xD),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?VT(r):i)<=t.maximum)return;let a=HT(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),OD=Z(`$ZodCheckMinLength`,(e,t)=>{var n;bD.init(e,t),(n=e._zod.def).when??(n.when=xD),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?VT(r):i)>=t.minimum)return;let a=HT(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kD=Z(`$ZodCheckLengthEquals`,(e,t)=>{var n;bD.init(e,t),(n=e._zod.def).when??(n.when=xD),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?VT(r):i;if(a===t.length)return;let o=HT(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),AD=Z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;bD.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jD=Z(`$ZodCheckRegex`,(e,t)=>{AD.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),MD=Z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=vD,AD.init(e,t)}),ND=Z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=yD,AD.init(e,t)}),PD=Z(`$ZodCheckIncludes`,(e,t)=>{bD.init(e,t);let n=yT(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),FD=Z(`$ZodCheckStartsWith`,(e,t)=>{bD.init(e,t);let n=RegExp(`^${yT(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ID=Z(`$ZodCheckEndsWith`,(e,t)=>{bD.init(e,t);let n=RegExp(`.*${yT(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function LD(e,t,n){e.issues.length&&t.issues.push(...IT(n,e.issues))}var RD=Z(`$ZodCheckProperties`,(e,t)=>{bD.init(e,t),qT(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>LD(t,r,e)))):LD(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),zD=Z(`$ZodCheckOverwrite`,(e,t)=>{bD.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),BD=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
86
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
87
+ `)}\n};`)(...Object.values(this.closed))}},VD={major:4,minor:6,patch:5},HD=Z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=VD;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=PT(t),a;for(let o of n){if(o._zod.def.when){if(FT(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new sE;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(RT(t.issues,n,e),i||=PT(t,n))});else{if(t.issues.length===n)continue;RT(t.issues,n,e),i||=PT(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(PT(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new sE;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new sE;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return qT(this,`~standard`,GD(this))},set"~standard"(e){KT(this,`~standard`,e)}}),UD=(e,t)=>e.issues.length?{issues:e.issues.map(e=>zT(e,t,uE()))}:{value:e.value};async function WD(e,t){let n={async:!0};return UD(await e._zod.run({value:t,issues:[]},n),n)}function GD(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return UD(r,n)}catch{}return WD(e,t)},vendor:`zod`,version:1}}var KD=Z(`$ZodString`,(e,t)=>{HD.init(e,t),e._zod.pattern=t.pattern??pD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),qD=Z(`$ZodStringFormat`,(e,t)=>{AD.init(e,t),KD.init(e,t)}),JD=Z(`$ZodGUID`,(e,t)=>{t.pattern??=JE,qD.init(e,t)}),YD=Z(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=YE(e)}else t.pattern??=YE();qD.init(e,t)}),XD=Z(`$ZodEmail`,(e,t)=>{t.pattern??=XE,qD.init(e,t)});function ZD(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function QD(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?ZD(e)||2:$D(e,t)}function $D(e,t){if(!t.normalize&&t.protocol?.source===aD.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var eO=/[\t\n\r]/g;function tO(e){return e.replace(eO,``)}function nO(e,t){return t.lastIndex=0,t.test(e.hostname)}function rO(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var iO=Z(`$ZodURL`,(e,t)=>{qD.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=QD(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=tO(r);return}t.hostname&&!nO(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!rO(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:tO(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),aO=Z(`$ZodEmoji`,(e,t)=>{t.pattern??=QE(),qD.init(e,t)}),oO=Z(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?GE:KE(t.length),qD.init(e,t)}),sO=Z(`$ZodCUID`,(e,t)=>{t.pattern??=BE,qD.init(e,t)}),cO=Z(`$ZodCUID2`,(e,t)=>{t.pattern??=VE,qD.init(e,t)}),lO=Z(`$ZodULID`,(e,t)=>{t.pattern??=HE,qD.init(e,t)}),uO=Z(`$ZodXID`,(e,t)=>{t.pattern??=UE,qD.init(e,t)}),dO=Z(`$ZodKSUID`,(e,t)=>{t.pattern??=WE,qD.init(e,t)}),fO=Z(`$ZodISODateTime`,(e,t)=>{t.pattern??=fD(t),qD.init(e,t)}),pO=Z(`$ZodISODate`,(e,t)=>{t.pattern??=lD,qD.init(e,t)}),mO=Z(`$ZodISOTime`,(e,t)=>{t.pattern??=dD(t),qD.init(e,t)}),hO=Z(`$ZodISODuration`,(e,t)=>{t.pattern??=qE,qD.init(e,t)}),gO=Z(`$ZodIPv4`,(e,t)=>{t.pattern??=$E,qD.init(e,t)}),_O=/^[0-9a-fA-F:.]+$/;function vO(e){return _O.test(e)?ZD(`http://[${e}]`):!1}var yO=Z(`$ZodIPv6`,(e,t)=>{t.pattern??=eD,qD.init(e,t),e._zod.check=n=>{vO(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),bO=Z(`$ZodCIDRv4`,(e,t)=>{t.pattern??=tD,qD.init(e,t)});function xO(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:vO(n)}var SO=Z(`$ZodCIDRv6`,(e,t)=>{t.pattern??=nD,qD.init(e,t),e._zod.check=n=>{xO(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function CO(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var wO=/^[0-9a-zA-Z+/]*={0,2}$/,TO=Z(`$ZodBase64`,(e,t)=>{t.pattern??=wO,qD.init(e,t),e._zod.check=n=>{CO(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),EO=/^[A-Za-z0-9_-]*$/;function DO(e){if(!EO.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return CO(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var OO=Z(`$ZodBase64URL`,(e,t)=>{t.pattern??=EO,qD.init(e,t),e._zod.check=n=>{DO(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),kO=Z(`$ZodE164`,(e,t)=>{t.pattern??=oD,qD.init(e,t)});function AO(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var jO=Z(`$ZodJWT`,(e,t)=>{qD.init(e,t),e._zod.check=n=>{AO(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),MO=Z(`$ZodNumber`,(e,t)=>{HD.init(e,t),e._zod.pattern=hD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),NO=Z(`$ZodNumberFormat`,(e,t)=>{ED.init(e,t),MO.init(e,t)}),PO=Z(`$ZodBoolean`,(e,t)=>{HD.init(e,t),e._zod.pattern=gD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),FO=Z(`$ZodNull`,(e,t)=>{HD.init(e,t),e._zod.pattern=_D,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),IO=Z(`$ZodUnknown`,(e,t)=>{HD.init(e,t),e._zod.parse=e=>e}),LO=Z(`$ZodNever`,(e,t)=>{HD.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function RO(e,t,n){e.issues.length&&t.issues.push(...IT(n,e.issues)),t.value[n]=e.value}var zO=Z(`$ZodArray`,(e,t)=>{HD.init(e,t);let n=lE.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>RO(t,r,e)));else if(RO(c,r,e),s&&c.issues.length!==0&&PT(c))break}return o.length?Promise.all(o).then(()=>r):r}});function BO(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...IT(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var VO=[];function HO(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:VO,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ST(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function UO(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(PT(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>BO(e,n,i,t,d,f))):BO(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var WO=Z(`$ZodObject`,(e,t)=>{HD.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Zw(()=>HO(t));X(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||rT(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=mT,o=t.catchall,s,c=lE.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(PT(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>BO(n,t,e,r,a,o))):BO(s,t,e,r,a,o)}return o?UO(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),GO=Z(`$ZodObjectJIT`,(e,t)=>{WO.init(e,t);let n=e._zod.parse,r=Zw(()=>HO(t)),i=lE.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new BD([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
88
+ let ${e}_ab = false;
89
+ for (let i = 0; i < ${e}.issues.length; i++) {
90
+ const iss = ${e}.issues[i];
91
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
92
+ payload.issues.push(iss);
93
+ if (iss.continue !== true) ${e}_ab = true;
94
+ }
95
+ if (${e}_ab && ctx && ctx.abortEarly) {
96
+ payload.value = newResult;
97
+ return payload;
98
+ }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:dT(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
99
+ const ${n}_present = ${i};
100
+ if (!${n}.issues.length || ${n}_present) {
101
+ if (${n}.issues.length) {${c(n,r)}
102
+ }
103
+
104
+ if (${e}) {
105
+ newResult[${r}] = ${n}.value;
106
+ }
107
+ }
108
+
109
+ `)}else f?(o.write(`
110
+ if (${n}.issues.length) {${c(n,r)}
111
+ }
112
+ `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
113
+ if (${n}.value !== undefined || ${i}) {
114
+ newResult[${r}] = ${n}.value;
115
+ }
116
+ `)):o.write(`
117
+ const ${n}_present = ${i};
118
+ if (${n}.issues.length) {${c(n,r)}
119
+ }
120
+ if (!${n}_present && !${n}.issues.length) {
121
+ payload.issues.push({
122
+ code: "invalid_type",
123
+ expected: "nonoptional",
124
+ input: undefined,
125
+ path: [${r}]
126
+ });
127
+ if (ctx && ctx.abortEarly) {
128
+ payload.value = newResult;
129
+ return payload;
130
+ }
131
+ }
132
+
133
+ if (${n}_present) {
134
+ newResult[${r}] = ${n}.value;
135
+ }
136
+
137
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=mT,c=!lE.jitless,l=c&&hT.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?UO([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function KO(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!PT(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>zT(e,r,uE())))}),t)}var qO=Z(`$ZodUnion`,(e,t)=>{HD.init(e,t),X(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),X(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),X(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),X(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>$w(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>KO(t,r,e,i)):KO(o,r,e,i)}});function JO(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var YO=Z(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,qO.init(e,t);let n=e._zod.parse;X(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||rT(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=iT(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Zw(()=>JO(t));e._zod.parse=(i,a)=>{let o=i.value;if(!mT(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),XO=Z(`$ZodIntersection`,(e,t)=>{HD.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>QO(e,t,n)):QO(e,i,a)}});function ZO(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(gT(e)&&gT(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=ZO(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ZO(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function QO(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=ZO(t.value,n.value);if(!c.valid){if(PT(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var $O=Z(`$ZodRecord`,(e,t)=>{HD.init(e,t);let n=lE.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!gT(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>zT(e,i,uE())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...IT(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...IT(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&hD.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>zT(e,i,uE())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...IT(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...IT(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),ek=Z(`$ZodEnum`,(e,t)=>{HD.init(e,t);let n=qw(t.entries),r=new Set(n);e._zod.values=r,X(e,`pattern`,e=>{let t=qw(e.def.entries).filter(e=>vT.has(typeof e));return RegExp(t.length?`^(${t.map(e=>yT(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),tk=Z(`$ZodLiteral`,(e,t)=>{HD.init(e,t);let n=new Set(t.values);e._zod.values=n,X(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?yT(e):e?yT(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),nk=Z(`$ZodTransform`,(e,t)=>{HD.init(e,t),e._zod.optin=`optional`,lE.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new cE(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new sE;return n.value=i,n}});function rk(e,t){return e.value=t.issues.length?void 0:t.value,e}var ik=Z(`$ZodOptional`,(e,t)=>{HD.init(e,t),X(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,X(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),X(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$w(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>rk(e,t)):rk(e,r)}return t.innerType._zod.run(e,n)}}),ak=Z(`$ZodExactOptional`,(e,t)=>{ik.init(e,t),X(e,`values`,e=>e.def.innerType._zod.values),X(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ok=Z(`$ZodNullable`,(e,t)=>{HD.init(e,t),X(e,`optin`,e=>e.def.innerType._zod.optin),X(e,`optout`,e=>e.def.innerType._zod.optout),X(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$w(t.source)}|null)$`):void 0}),X(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),sk=Z(`$ZodDefault`,(e,t)=>{HD.init(e,t),e._zod.optin=`defaulted`,X(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ck(e,t)):ck(r,t)}});function ck(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var lk=Z(`$ZodPrefault`,(e,t)=>{HD.init(e,t),e._zod.optin=`defaulted`,X(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),uk=Z(`$ZodNonOptional`,(e,t)=>{HD.init(e,t),X(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>dk(t,e)):dk(i,e)}});function dk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function fk(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>zT(e,r,uE()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var pk=Z(`$ZodCatch`,(e,t)=>{HD.init(e,t),X(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),X(e,`optout`,e=>e.def.innerType._zod.optout),X(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>fk(e,r,t,n)):fk(e,r,t,n)}}),mk=Z(`$ZodPipe`,(e,t)=>{HD.init(e,t),X(e,`values`,e=>e.def.in._zod.values),X(e,`optin`,e=>e.def.in._zod.optin),X(e,`optout`,e=>e.def.out._zod.optout),X(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>hk(e,t.in,n)):hk(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>hk(e,t.out,n)):hk(r,t.out,n)}});function hk(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var gk=Z(`$ZodReadonly`,(e,t)=>{HD.init(e,t),X(e,`propValues`,e=>e.def.innerType._zod.propValues),X(e,`values`,e=>e.def.innerType._zod.values),X(e,`optin`,e=>e.def.innerType?._zod?.optin),X(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(_k):_k(r)}});function _k(e){return e.memo||(e.value=Object.freeze(e.value)),e}var vk=Z(`$ZodLazy`,(e,t)=>{HD.init(e,t),nT(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),X(e,`pattern`,e=>e.innerType?._zod?.pattern),X(e,`propValues`,e=>e.innerType?._zod?.propValues),X(e,`optin`,e=>e.innerType?._zod?.optin??void 0),X(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),yk=Z(`$ZodCustom`,(e,t)=>{bD.init(e,t),HD.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>bk(t,n,r,e));bk(i,n,r,e)}});function bk(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(WT(e))}}var xk=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Sk=`~memo`,Ck=[];function wk(e){return typeof e==`object`&&!!e}function Tk(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Ek=new WeakMap,Dk=0,Ok=1,kk=2;function Ak(e,t,n){let r=Ek.get(e);if(r!==void 0)return r?kk:Dk;if(t.has(e))return kk;t.add(e);let i=Dk,a=e=>{if(i!==kk&&e?._zod){let r=Ak(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Dk;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ok:o.value?._zod?Ak(o.value,t,n):Dk;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=iT(c);s(e?o(e,!0):Ok),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ak(r,t,!1):Ok);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),jk(e,i)}function jk(e,t){return t!==Ok&&Ek.set(e,t===kk),t}function Mk(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Nk,Pk=[],Fk={alloc(e,t,n){let r=Nk;if(!r)return n;Nk=void 0;let i={value:n,issues:null};return r.set(t.value,i),Pk.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Lk(n,e.value))throw new xk;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ak(e,new Set,!1);if(i===Dk)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===kk||r?n=!0:r=!0}let l=s.value;if(!wk(l))return t(s,c);let u=c[Sk];u||(u={buckets:new WeakMap,backEdges:void 0},c[Sk]=u);let d;i===c?d=a:(d=Mk(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Tk(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Nk=d;let p=Pk.length,m=t(s,c);Nk=void 0;let h=Pk.length>p?Pk.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Tk(e.issues):Ck),e)):(h&&(h.issues=m.issues.length?Tk(m.issues):Ck),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ik(){return Fk}function Lk(e,t){let n=e[Sk]?.backEdges;return n!==void 0&&wk(t)&&n.has(t)}var Rk=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(UT(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${xT(e.values[0])}`:`Invalid option: expected one of ${Jw(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Jw(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function zk(){return{localeError:Rk()}}var Bk,Vk=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Hk(){return new Vk}(Bk=globalThis).__zod_globalRegistry??(Bk.__zod_globalRegistry=Hk());var Uk=globalThis.__zod_globalRegistry;function Wk(e){return e.checks&&=[...e.checks],e}function Gk(e,t){return new e(Wk({type:`string`,...Y(t)}))}function Kk(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Y(t)})}function qk(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Y(t)})}function Jk(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Y(t)})}function Yk(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Y(t)})}function Xk(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Y(t)})}function Zk(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Y(t)})}function Qk(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Y(t)})}function $k(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Y(t)})}function eA(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Y(t)})}function tA(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Y(t)})}function nA(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Y(t)})}function rA(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Y(t)})}function iA(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Y(t)})}function aA(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Y(t)})}function oA(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Y(t)})}function sA(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Y(t)})}function cA(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Y(t)})}function lA(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Y(t)})}function uA(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Y(t)})}function dA(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Y(t)})}function fA(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Y(t)})}function pA(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Y(t)})}function mA(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Y(t)})}function hA(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Y(t)})}function gA(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Y(t)})}function _A(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Y(t)})}function vA(e,t){return new e(Wk({type:`number`,checks:[],...Y(t)}))}function yA(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Y(t)})}function bA(e,t){return new e({type:`boolean`,...Y(t)})}function xA(e,t){return new e({type:`null`,...Y(t)})}function SA(e){return new e({type:`unknown`})}function CA(e,t){return new e({type:`never`,...Y(t)})}function wA(e,t){return new CD({check:`less_than`,...Y(t),value:e,inclusive:!1})}function TA(e,t){return new CD({check:`less_than`,...Y(t),value:e,inclusive:!0})}function EA(e,t){return new wD({check:`greater_than`,...Y(t),value:e,inclusive:!1})}function DA(e,t){return new wD({check:`greater_than`,...Y(t),value:e,inclusive:!0})}function OA(e,t){return new TD({check:`multiple_of`,...Y(t),value:e})}function kA(e,t){return new DD({check:`max_length`,...Y(t),maximum:e})}function AA(e,t){return new OD({check:`min_length`,...Y(t),minimum:e})}function jA(e,t){return new kD({check:`length_equals`,...Y(t),length:e})}function MA(e,t){return new jD({check:`string_format`,format:`regex`,...Y(t),pattern:e})}function NA(e){return new MD({check:`string_format`,format:`lowercase`,...Y(e)})}function PA(e){return new ND({check:`string_format`,format:`uppercase`,...Y(e)})}function FA(e,t){return new PD({check:`string_format`,format:`includes`,...Y(t),includes:e})}function IA(e,t){return new FD({check:`string_format`,format:`starts_with`,...Y(t),prefix:e})}function LA(e,t){return new ID({check:`string_format`,format:`ends_with`,...Y(t),suffix:e})}function RA(e,t){return new RD({check:`properties`,shape:e,...Y(t)})}function zA(e){return new zD({check:`overwrite`,tx:e})}function BA(e){return zA(t=>t.normalize(e))}function VA(){return zA(e=>e.trim())}function HA(){return zA(e=>e.toLowerCase())}function UA(){return zA(e=>e.toUpperCase())}function WA(){return zA(e=>fT(e))}function GA(e,t,n){return new e({type:`array`,element:t,...Y(n)})}function KA(e,t,n){let r=Y(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function qA(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Y(n)})}function JA(e,t){let n=YA(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(WT(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(WT(r))}},e(t.value,t)),t);return n}function YA(e,t){let n=new bD({check:`custom`,...Y(t)});return n._zod.check=e,n}function XA(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&rT(e,t,n[t]);return e}function ZA(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Uk,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function QA(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function $A(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,$A(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&XA(o.schema,c),t.io===`input`&&lj(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ej(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function tj(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ej(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ej(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
138
+
139
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function nj(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;nj(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var rj=new Set([`type`,`properties`,`required`,`additionalProperties`]),ij=[`oneOf`,`anyOf`];function aj(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function oj(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!rj.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??aj(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}rT(n,r,e.length===1?e[0]:oj(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=aj(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function sj(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of rj)if(t in e)return;let n=t.filter(e=>ij.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=oj(t);else{let e=n[0],i=ij.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>oj([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,XA(e,r))}function cj(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):XA(i,s),XA(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())nj(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])sj(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}XA(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,rT(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:dj(t,`input`,e.processors),output:dj(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function lj(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return lj(r.element,n);if(r.type===`set`)return lj(r.valueType,n);if(r.type===`lazy`)return lj(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return lj(r.innerType,n);if(r.type===`intersection`)return lj(r.left,n)||lj(r.right,n);if(r.type===`record`||r.type===`map`)return lj(r.keyType,n)||lj(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:lj(r.in,n)||lj(r.out,n);if(r.type===`object`){for(let e in r.shape)if(lj(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(lj(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(lj(e,n))return!0;return!!(r.rest&&lj(r.rest,n))}return!1}var uj=(e,t={})=>n=>{let r=ZA({...n,processors:t});return $A(e,r),tj(r,e),cj(r,e)},dj=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ZA({...i??{},target:a,io:t,processors:n});return $A(e,o),tj(o,e),cj(o,e)},fj=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},pj=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},mj=(e,t)=>{fj(e,`minimum`,t),pj(e,`maximum`,t)},hj=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},gj=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},_j=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},vj=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},yj=(e,t)=>fj(e,`minimum`,t.minimum),bj=(e,t)=>pj(e,`maximum`,t.maximum),xj=e=>(t,n)=>{vj(t,n.format);let[r,i]=e[n.format];fj(t,`minimum`,r),pj(t,`maximum`,i)},Sj={greater_than:(e,t)=>fj(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>pj(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>hj(e,t.value),number_format:xj(CT),bigint_format:xj(wT),min_length:yj,max_length:bj,length_equals:(e,t)=>mj(e,t.length),min_size:yj,max_size:bj,size_equals:(e,t)=>mj(e,t.size),string_format:(e,t)=>{vj(e,t.format),t.pattern&&gj(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>_j(e,t.mime)};function Cj(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Sj[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&fj(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&fj(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&pj(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&pj(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&hj(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&_j(t,i.mime);for(let e of i.patterns??[])gj(t,e);return t}var wj={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Tj=new Map([[wO,rD],[EO,iD]]),Ej=e=>Tj.get(e)??e,Dj=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Cj(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=wj[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Ej);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Oj=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Cj(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):QA(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},kj=(e,t,n,r)=>{n.type=`boolean`},Aj=(e,t,n,r)=>{QA(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},jj=(e,t,n,r)=>{QA(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Mj=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Nj=(e,t,n,r)=>{QA(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Pj=(e,t,n,r)=>{QA(e,t,n,r,`Void cannot be represented in JSON Schema`)},Fj=(e,t,n,r)=>{n.not={}},Ij=(e,t,n,r)=>{},Lj=(e,t,n,r)=>{},Rj=(e,t,n,r)=>{QA(e,t,n,r,`Date cannot be represented in JSON Schema`)},zj=(e,t,n,r)=>{let i=e._zod.def,a=qw(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Bj=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(QA(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(QA(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Vj=(e,t,n,r)=>{QA(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Hj=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Uj=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=Cj(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Wj=(e,t,n,r)=>{n.type=`boolean`},Gj=(e,t,n,r)=>{QA(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Kj=(e,t,n,r)=>{QA(e,t,n,r,`Function types cannot be represented in JSON Schema`)},qj=(e,t,n,r)=>{QA(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Jj=(e,t,n,r)=>{QA(e,t,n,r,`Map cannot be represented in JSON Schema`)},Yj=(e,t,n,r)=>{QA(e,t,n,r,`Set cannot be represented in JSON Schema`)},Xj=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Cj(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=$A(a.element,t,{...r,path:[...r.path,`items`]})};function Zj(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Zj(t.out):t.type===`catch`?Zj(t.innerType):e._zod.optin}var Qj=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&QA(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)rT(i.properties,e,$A(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Zj(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=$A(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},$j=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>$A(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},eM=(e,t,n,r)=>{let i=e._zod.def,a=$A(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=$A(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},tM=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>$A(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?$A(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Zj(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=Cj(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function nM(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=nM(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>nM(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?hD:mD).source),p):p}var rM=new WeakMap;function iM(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of rM.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=nM(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var aM=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Cj(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=$A(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)rT(i.patternProperties,Ej(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=$A(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=rM.get(t);n||(n=[],rM.set(t,n),t.deferred.push(()=>iM(t))),n.push(e)}i.additionalProperties=$A(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Zj(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},oM=(e,t,n,r)=>{let i=e._zod.def,a=$A(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},sM=(e,t,n,r)=>{let i=e._zod.def;$A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cM=Symbol();function lM(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(QA(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),cM):JSON.parse(o)}var uM=(e,t,n,r)=>{let i=e._zod.def;$A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=lM(i.defaultValue,e,t,n,r);o!==cM&&(n.default=o)},dM=(e,t,n,r)=>{let i=e._zod.def;$A(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=lM(i.defaultValue,e,t,n,r);o!==cM&&(n._prefault=o)},fM=(e,t,n,r)=>{let i=e._zod.def;$A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{QA(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},pM=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;$A(o,t,r);let s=t.seen.get(e);s.ref=o},mM=(e,t,n,r)=>{let i=e._zod.def;$A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},hM=(e,t,n,r)=>{let i=e._zod.def;$A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gM=(e,t,n,r)=>{let i=e._zod.def;$A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},_M=(e,t,n,r)=>{let i=e._zod.innerType;$A(i,t,r);let a=t.seen.get(e);a.ref=i},vM={string:Dj,number:Oj,boolean:kj,bigint:Aj,symbol:jj,null:Mj,undefined:Nj,void:Pj,never:Fj,any:Ij,unknown:Lj,date:Rj,enum:zj,literal:Bj,nan:Vj,template_literal:Hj,file:Uj,success:Wj,custom:Gj,function:Kj,transform:qj,map:Jj,set:Yj,array:Xj,object:Qj,union:$j,intersection:eM,tuple:tM,record:aM,nullable:oM,nonoptional:sM,default:uM,prefault:dM,catch:fM,pipe:pM,readonly:mM,promise:hM,optional:gM,lazy:_M};function yM(e,t){if(`_idmap`in e){let n=e,r=ZA({...t,processors:vM}),i={};for(let e of n._idmap.entries()){let[t,n]=e;$A(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;tj(r,n),rT(a,t,cj(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=ZA({...t,processors:vM});return $A(e,n),tj(n,e),cj(n,e)}var bM=new WeakSet([Object.prototype,Error.prototype]);function xM(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var SM=Z(`ZodError`,(e,t)=>{_E.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);bM.has(n)||(bM.add(n),xM(n,`format`,e=>t=>bE(e,t)),xM(n,`flatten`,e=>t=>yE(e,t)),xM(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Yw,2)}),xM(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Yw,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),CM=SE(SM),wM=CE(SM),TM=wE(SM),EM=EE(SM),DM=ME(SM),OM=NE(SM),kM=PE(SM),AM=FE(SM),jM=IE(SM),MM=LE(SM),NM=RE(SM),PM=zE(SM);function FM(){lE.localeError||uE(zk())}function IM(){lE.memoizer||uE({memoizer:Ik()})}var LM=Z(`ZodType`,(e,t)=>(FM(),HD.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(uT(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return bT(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(uP(e,t))},superRefine(e,t){return this.check(dP(e,t))},overwrite(e){return this.check(zA(e))},optional(){return UN(this)},exactOptional(){return GN(this)},nullable(){return qN(this)},nullish(){return UN(qN(this))},nonoptional(e){return $N(this,e)},array(){return wN(this)},or(e){return kN([this,e])},and(e){return NN(this,e)},transform(e){return rP(this,VN(e))},default(e){return YN(this,e)},prefault(e){return ZN(this,e)},catch(e){return tP(this,e)},pipe(e){return rP(this,e)},readonly(){return aP(this)},describe(e){let t=this.clone();return Uk.add(t,{description:e}),t},meta(...e){if(e.length===0)return Uk.get(this);let t=this.clone();return Uk.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return qT(this,`~standard`,{...GD(this),jsonSchema:{input:dj(this,`input`),output:dj(this,`output`)}})},set"~standard"(e){KT(this,`~standard`,e)},parse:function e(t,n){return CM(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await wM(this,t,n,{callee:e})},safeParse(e,t){return TM(this,e,t)},async safeParseAsync(e,t){return EM(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){KT(this,`spa`,e)},validate(e,t){return kE(this,e,t)},validateAsync(e,t){return jE(this,e,t)},encode:function e(t,n){return DM(this,t,n,{callee:e})},decode:function e(t,n){return OM(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await kM(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await AM(this,t,n,{callee:e})},safeEncode(e,t){return jM(this,e,t)},safeDecode(e,t){return MM(this,e,t)},async safeEncodeAsync(e,t){return NM(this,e,t)},async safeDecodeAsync(e,t){return PM(this,e,t)},toJSONSchema(e){return uj(this,{})(e)},get description(){return Uk.get(this)?.description},get _def(){return this._zod.def}}),RM=Z(`_ZodString`,(e,t)=>{KD.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dj(e,t,n,r)},JT({format:e=>Cj(e).format??null,minLength:e=>Cj(e).minimum??null,maxLength:e=>Cj(e).maximum??null},{regex(...e){return this.check(MA(...e))},includes(...e){return this.check(FA(...e))},startsWith(...e){return this.check(IA(...e))},endsWith(...e){return this.check(LA(...e))},min(...e){return this.check(AA(...e))},max(...e){return this.check(kA(...e))},length(...e){return this.check(jA(...e))},nonempty(...e){return this.check(AA(1,...e))},lowercase(e){return this.check(NA(e))},uppercase(e){return this.check(PA(e))},trim(){return this.check(VA())},normalize(...e){return this.check(BA(...e))},toLowerCase(){return this.check(HA())},toUpperCase(){return this.check(UA())},slugify(){return this.check(WA())}})),zM=Z(`ZodString`,(e,t)=>{KD.init(e,t),RM.init(e,t)},{email(e){return this.check(Kk(KM,e))},url(e){return this.check(Qk(YM,e))},jwt(e){return this.check(pA(uN,e))},emoji(e){return this.check($k(XM,e))},guid(e){return this.check(qk(qM,e))},uuid(e){return this.check(Jk(JM,e))},uuidv4(e){return this.check(Yk(JM,e))},uuidv6(e){return this.check(Xk(JM,e))},uuidv7(e){return this.check(Zk(JM,e))},nanoid(e){return this.check(eA(ZM,e))},cuid(e){return this.check(tA(QM,e))},cuid2(e){return this.check(nA($M,e))},ulid(e){return this.check(rA(eN,e))},base64(e){return this.check(uA(sN,e))},base64url(e){return this.check(dA(cN,e))},xid(e){return this.check(iA(tN,e))},ksuid(e){return this.check(aA(nN,e))},ipv4(e){return this.check(oA(rN,e))},ipv6(e){return this.check(sA(iN,e))},cidrv4(e){return this.check(cA(aN,e))},cidrv6(e){return this.check(lA(oN,e))},e164(e){return this.check(fA(lN,e))},datetime(e){return this.check(mA(HM,e))},date(e){return this.check(hA(UM,e))},time(e){return this.check(gA(WM,e))},duration(e){return this.check(_A(GM,e))}});function BM(e){return Gk(zM,e)}var VM=Z(`ZodStringFormat`,(e,t)=>{qD.init(e,t),RM.init(e,t)}),HM=Z(`ZodISODateTime`,(e,t)=>{fO.init(e,t),VM.init(e,t)}),UM=Z(`ZodISODate`,(e,t)=>{pO.init(e,t),VM.init(e,t)}),WM=Z(`ZodISOTime`,(e,t)=>{mO.init(e,t),VM.init(e,t)}),GM=Z(`ZodISODuration`,(e,t)=>{hO.init(e,t),VM.init(e,t)}),KM=Z(`ZodEmail`,(e,t)=>{XD.init(e,t),VM.init(e,t)}),qM=Z(`ZodGUID`,(e,t)=>{JD.init(e,t),VM.init(e,t)}),JM=Z(`ZodUUID`,(e,t)=>{YD.init(e,t),VM.init(e,t)}),YM=Z(`ZodURL`,(e,t)=>{iO.init(e,t),VM.init(e,t)}),XM=Z(`ZodEmoji`,(e,t)=>{aO.init(e,t),VM.init(e,t)}),ZM=Z(`ZodNanoID`,(e,t)=>{oO.init(e,t),VM.init(e,t)}),QM=Z(`ZodCUID`,(e,t)=>{sO.init(e,t),VM.init(e,t)}),$M=Z(`ZodCUID2`,(e,t)=>{cO.init(e,t),VM.init(e,t)}),eN=Z(`ZodULID`,(e,t)=>{lO.init(e,t),VM.init(e,t)}),tN=Z(`ZodXID`,(e,t)=>{uO.init(e,t),VM.init(e,t)}),nN=Z(`ZodKSUID`,(e,t)=>{dO.init(e,t),VM.init(e,t)}),rN=Z(`ZodIPv4`,(e,t)=>{gO.init(e,t),VM.init(e,t)}),iN=Z(`ZodIPv6`,(e,t)=>{yO.init(e,t),VM.init(e,t)}),aN=Z(`ZodCIDRv4`,(e,t)=>{bO.init(e,t),VM.init(e,t)}),oN=Z(`ZodCIDRv6`,(e,t)=>{SO.init(e,t),VM.init(e,t)}),sN=Z(`ZodBase64`,(e,t)=>{TO.init(e,t),VM.init(e,t)}),cN=Z(`ZodBase64URL`,(e,t)=>{OO.init(e,t),VM.init(e,t)}),lN=Z(`ZodE164`,(e,t)=>{kO.init(e,t),VM.init(e,t)}),uN=Z(`ZodJWT`,(e,t)=>{jO.init(e,t),VM.init(e,t)}),dN=Z(`ZodNumber`,(e,t)=>{MO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oj(e,t,n,r),e.isFinite=!0},JT({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Cj(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Cj(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Cj(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Cj(e).format??null},{gt(e,t){return this.check(EA(e,t))},gte(e,t){return this.check(DA(e,t))},min(e,t){return this.check(DA(e,t))},lt(e,t){return this.check(wA(e,t))},lte(e,t){return this.check(TA(e,t))},max(e,t){return this.check(TA(e,t))},int(e){return this.check(mN(e))},safe(e){return this.check(mN(e))},positive(e){return this.check(EA(0,e))},nonnegative(e){return this.check(DA(0,e))},negative(e){return this.check(wA(0,e))},nonpositive(e){return this.check(TA(0,e))},multipleOf(e,t){return this.check(OA(e,t))},step(e,t){return this.check(OA(e,t))},finite(){return this}}));function fN(e){return vA(dN,e)}var pN=Z(`ZodNumberFormat`,(e,t)=>{NO.init(e,t),dN.init(e,t)});function mN(e){return yA(pN,e)}var hN=Z(`ZodBoolean`,(e,t)=>{PO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kj(e,t,n,r)});function gN(e){return bA(hN,e)}var _N=Z(`ZodNull`,(e,t)=>{FO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mj(e,t,n,r)});function vN(e){return xA(_N,e)}var yN=Z(`ZodUnknown`,(e,t)=>{IO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function bN(){return SA(yN)}var xN=Z(`ZodNever`,(e,t)=>{LO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fj(e,t,n,r)});function SN(e){return CA(xN,e)}var CN=Z(`ZodArray`,(e,t)=>{IM(),zO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xj(e,t,n,r),e.element=t.element},{min(e,t){return this.check(AA(e,t))},nonempty(e){return this.check(AA(1,e))},max(e,t){return this.check(kA(e,t))},length(e,t){return this.check(jA(e,t))},unwrap(){return this.element}});function wN(e,t){return GA(CN,e,t)}var TN=Z(`ZodObject`,(e,t)=>{IM(),GO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qj(e,t,n,r),eE(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return LN(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(uT(this._zod.def,{catchall:e}))},passthrough(){return this.clone(uT(this._zod.def,{catchall:bN()}))},loose(){return this.clone(uT(this._zod.def,{catchall:bN()}))},strict(){return this.clone(uT(this._zod.def,{catchall:SN()}))},strip(){return this.clone(uT(this._zod.def,{catchall:void 0}))},extend(e){return OT(this,e)},safeExtend(e){return AT(this,e)},merge(e){return jT(this,e)},pick(e){return TT(this,e)},omit(e){return DT(this,e)},partial(...e){return MT(HN,this,e[0])},exactPartial(...e){return MT(WN,this,e[0],`exactPartial`)},required(...e){return NT(QN,this,e[0])}});function EN(e,t){return new TN({type:`object`,shape:e??{},...Y(t)})}function DN(e,t){return new TN({type:`object`,shape:e,catchall:bN(),...Y(t)})}var ON=Z(`ZodUnion`,(e,t)=>{qO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$j(e,t,n,r),e.options=t.options});function kN(e,t){return new ON({type:`union`,options:e,...Y(t)})}var AN=Z(`ZodDiscriminatedUnion`,(e,t)=>{ON.init(e,t),YO.init(e,t)});function jN(e,t,n){return new AN({type:`union`,options:t,discriminator:e,...Y(n)})}var MN=Z(`ZodIntersection`,(e,t)=>{XO.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eM(e,t,n,r)});function NN(e,t){return new MN({type:`intersection`,left:e,right:t})}var PN=Z(`ZodRecord`,(e,t)=>{IM(),$O.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aM(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function FN(e,t,n){return!t||!t._zod?new PN({type:`record`,keyType:BM(),valueType:e,...Y(t)}):new PN({type:`record`,keyType:e,valueType:t,...Y(n)})}var IN=Z(`ZodEnum`,(e,t)=>{ek.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zj(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new IN({...t,checks:[],...Y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new IN({...t,checks:[],...Y(r),entries:i})}});function LN(e,t){return new IN({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Y(t)})}var RN=Z(`ZodLiteral`,(e,t)=>{tk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bj(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function zN(e,t){return new RN({type:`literal`,values:Array.isArray(e)?e:[e],...Y(t)})}var BN=Z(`ZodTransform`,(e,t)=>{IM(),nk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qj(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new cE(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(WT(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(WT(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function VN(e){return new BN({type:`transform`,transform:e})}var HN=Z(`ZodOptional`,(e,t)=>{ik.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function UN(e){return new HN({type:`optional`,innerType:e})}var WN=Z(`ZodExactOptional`,(e,t)=>{ak.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function GN(e){return new WN({type:`optional`,innerType:e})}var KN=Z(`ZodNullable`,(e,t)=>{ok.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qN(e){return new KN({type:`nullable`,innerType:e})}var JN=Z(`ZodDefault`,(e,t)=>{sk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function YN(e,t){return new JN({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():_T(t)}})}var XN=Z(`ZodPrefault`,(e,t)=>{lk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ZN(e,t){return new XN({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():_T(t)}})}var QN=Z(`ZodNonOptional`,(e,t)=>{uk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $N(e,t){return new QN({type:`nonoptional`,innerType:e,...Y(t)})}var eP=Z(`ZodCatch`,(e,t)=>{pk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tP(e,t){return new eP({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:nE(t)})}var nP=Z(`ZodPipe`,(e,t)=>{mk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pM(e,t,n,r),e.in=t.in,e.out=t.out});function rP(e,t){return new nP({type:`pipe`,in:e,out:t})}var iP=Z(`ZodReadonly`,(e,t)=>{gk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function aP(e){return new iP({type:`readonly`,innerType:e})}var oP=Z(`ZodLazy`,(e,t)=>{vk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_M(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function sP(e){return new oP({type:`lazy`,getter:e})}var cP=Z(`ZodCustom`,(e,t)=>{yk.init(e,t),LM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gj(e,t,n,r)});function lP(e,t){return KA(cP,e??(()=>!0),t)}function uP(e,t={}){return qA(cP,e,t)}function dP(e,t){return JA(e,t)}var fP=Z(`ZodInstanceOf`,(e,t)=>{cP.init(e,t)},{properties(e,t){return this.check(RA(e,t))}});function pP(e,t={}){let n=new fP({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...Y(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var mP=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},hP=10,gP=13,_P=32;function vP(e){}function yP(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=vP,onError:n=vP,onRetry:r=vP,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(`
140
+ `)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new mP(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
141
+ `,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(`
142
+ `,n);continue}let i=e.charCodeAt(n);if(bP(e,n,i)){let i=e.charCodeAt(n+5)===_P?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===hP){t({id:l,event:f,data:a}),l=void 0,u=``,f=void 0,n=r+2,r=e.indexOf(`
143
+ `,n);continue}u=d===0?a:`${u}
144
+ ${a}`,d++}else xP(e,n,i)?f=e.slice(e.charCodeAt(n+6)===_P?n+7:n+6,r)||void 0:_(e,n,r);n=r+1,r=e.indexOf(`
145
+ `,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
146
+ `,n),i=-1;if(t!==-1&&r!==-1?i=t<r?t:r:t===-1?r!==-1&&(i=r):i=t===e.length-1?-1:t,i===-1)break;_(e,n,i),n=i+1,e.charCodeAt(n-1)===gP&&e.charCodeAt(n)===hP&&n++}return e.slice(n)}function _(e,t,n){if(t===n){y();return}let r=e.charCodeAt(t);if(bP(e,t,r)){let r=e.charCodeAt(t+5)===_P?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u}
147
+ ${i}`,d++;return}if(xP(e,t,r)){f=e.slice(e.charCodeAt(t+6)===_P?t+7:t+6,n)||void 0;return}if(r===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let r=e.slice(e.charCodeAt(t+3)===_P?t+4:t+3,n);r.includes(`\0`)||(l=r);return}if(r===58){if(i){let r=e.slice(t,n);i(r.slice(e.charCodeAt(t+1)===_P?2:1))}return}let a=e.slice(t,n),o=a.indexOf(`:`);if(o===-1){v(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===_P?2:1;v(s,a.slice(o+c),a)}function v(e,t,i){switch(e){case`event`:f=t||void 0;break;case`data`:u=d===0?t:`${u}
148
+ ${t}`,d++;break;case`id`:t.includes(`\0`)||(l=t);break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new mP(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new mP(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}))}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function bP(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function xP(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var SP=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=yP({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}};new TextDecoder;var{btoa:CP,atob:wP}=globalThis;function TP(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}var EP=({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:r=`-`}={})=>{let i=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return i;if(n.includes(r))throw new Pw({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},DP=EP();function OP(e){return globalThis.Buffer?.isBuffer(e)??!1}var kP=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,AP=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function jP(e){let t=JSON.parse(e);return typeof t!=`object`||!t||kP.test(e)===!1&&AP.test(e)===!1?t:MP(t)}function MP(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function NP(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return jP(e)}try{return jP(e)}finally{Error.stackTraceLimit=t}}function PP(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){let{additionalProperties:t}=e;e.additionalProperties=t!=null&&typeof t!=`boolean`&&FP(t);let{properties:n}=e;if(n!=null)for(let e of Object.keys(n))n[e]=FP(n[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(FP):FP(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(FP)),e.allOf!=null&&(e.allOf=e.allOf.map(FP)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(FP));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=FP(t[e]);return e}function FP(e){return typeof e==`boolean`?e:PP(e)}var IP=Symbol(`Let zodToJsonSchema decide on which parser to use`),LP={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},RP=e=>typeof e==`string`?{...LP,name:e}:{...LP,...e};function zP(){return{}}function BP(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==`ZodAny`&&(n.items=jF(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}function VP(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value}return t}function HP(){return{type:`boolean`}}function UP(e,t){return jF(e.type._def,t)}var WP=(e,t)=>jF(e.innerType._def,t);function GP(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>GP(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return KP(e)}}var KP=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value}return t};function qP(e,t){return{...jF(e.innerType._def,t),default:e.defaultValue()}}function JP(e,t){return t.effectStrategy===`input`?jF(e.schema._def,t):zP()}function YP(e){return{type:`string`,enum:Array.from(e.values)}}var XP=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function ZP(e,t){let n=[jF(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),jF(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(XP(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}function QP(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var $P=void 0,eF={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>($P===void 0&&($P=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),$P),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function tF(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:aF(n,`email`,r.message,t);break;case`format:idn-email`:aF(n,`idn-email`,r.message,t);break;case`pattern:zod`:oF(n,eF.email,r.message,t)}break;case`url`:aF(n,`uri`,r.message,t);break;case`uuid`:aF(n,`uuid`,r.message,t);break;case`regex`:oF(n,r.regex,r.message,t);break;case`cuid`:oF(n,eF.cuid,r.message,t);break;case`cuid2`:oF(n,eF.cuid2,r.message,t);break;case`startsWith`:oF(n,RegExp(`^${nF(r.value,t)}`),r.message,t);break;case`endsWith`:oF(n,RegExp(`${nF(r.value,t)}$`),r.message,t);break;case`datetime`:aF(n,`date-time`,r.message,t);break;case`date`:aF(n,`date`,r.message,t);break;case`time`:aF(n,`time`,r.message,t);break;case`duration`:aF(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:oF(n,RegExp(nF(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&aF(n,`ipv4`,r.message,t),r.version!==`v4`&&aF(n,`ipv6`,r.message,t);break;case`base64url`:oF(n,eF.base64url,r.message,t);break;case`jwt`:oF(n,eF.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&oF(n,eF.ipv4Cidr,r.message,t),r.version!==`v4`&&oF(n,eF.ipv6Cidr,r.message,t);break;case`emoji`:oF(n,eF.emoji(),r.message,t);break;case`ulid`:oF(n,eF.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:aF(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:oF(n,eF.base64,r.message,t)}break;case`nanoid`:oF(n,eF.nanoid,r.message,t)}return n}function nF(e,t){return t.patternStrategy===`escape`?iF(e):e}var rF=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function iF(e){let t=``;for(let n=0;n<e.length;n++)rF.has(e[n])||(t+=`\\`),t+=e[n];return t}function aF(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function oF(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:sF(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=sF(t,r)}function sF(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
149
+ ]))`;continue}if(r[e]===`$`){i+=`($|(?=[\r
150
+ ]))`;continue}}if(n.s&&r[e]===`.`){i+=o?`${r[e]}\r\n`:`[${r[e]}\r\n]`;continue}i+=r[e],r[e]===`\\`?a=!0:o&&r[e]===`]`?o=!1:!o&&r[e]===`[`&&(o=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function cF(e,t){let n={type:`object`,additionalProperties:jF(e.valueType._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]})??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===`ZodString`&&e.keyType._def.checks?.length){let{type:r,...i}=tF(e.keyType._def,t);return{...n,propertyNames:i}}if(e.keyType?._def.typeName===`ZodEnum`)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===`ZodBranded`&&e.keyType._def.type._def.typeName===`ZodString`&&e.keyType._def.type._def.checks?.length){let{type:r,...i}=UP(e.keyType._def,t);return{...n,propertyNames:i}}return n}function lF(e,t){return t.mapStrategy===`record`?cF(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[jF(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||zP(),jF(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||zP()],minItems:2,maxItems:2}}}function uF(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}function dF(){return{not:zP()}}function fF(){return{type:`null`}}var pF={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function mF(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in pF&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=pF[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return hF(e,t)}var hF=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>jF(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function gF(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[pF[e.innerType._def.typeName],`null`]};let n=jF(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function _F(e){let t={type:`number`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`int`:t.type=`integer`;break;case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value}return t}function vF(e,t){let n={type:`object`,properties:{}},r=[],i=e.shape();for(let e in i){let a=i[e];if(a===void 0||a._def===void 0)continue;let o=bF(a),s=jF(a._def,{...t,currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]});s!==void 0&&(n.properties[e]=s,o||r.push(e))}r.length&&(n.required=r);let a=yF(e,t);return a!==void 0&&(n.additionalProperties=a),n}function yF(e,t){if(e.catchall._def.typeName!==`ZodNever`)return jF(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function bF(e){try{return e.isOptional()}catch{return!0}}var xF=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return jF(e.innerType._def,t);let n=jF(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:zP()},n]}:zP()},SF=(e,t)=>{if(t.pipeStrategy===`input`)return jF(e.in._def,t);if(t.pipeStrategy===`output`)return jF(e.out._def,t);let n=jF(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]});return{allOf:[n,jF(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]})].filter(e=>e!==void 0)}};function CF(e,t){return jF(e.type._def,t)}function wF(e,t){let n={type:`array`,uniqueItems:!0,items:jF(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function TF(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>jF(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:jF(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>jF(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function EF(){return{not:zP()}}function DF(){return zP()}var OF=(e,t)=>jF(e.innerType._def,t),kF=(e,t,n)=>{switch(t){case`ZodString`:return tF(e,n);case`ZodNumber`:return _F(e);case`ZodObject`:return vF(e,n);case`ZodBigInt`:return VP(e);case`ZodBoolean`:return HP();case`ZodDate`:return GP(e,n);case`ZodUndefined`:return EF();case`ZodNull`:return fF();case`ZodArray`:return BP(e,n);case`ZodUnion`:case`ZodDiscriminatedUnion`:return mF(e,n);case`ZodIntersection`:return ZP(e,n);case`ZodTuple`:return TF(e,n);case`ZodRecord`:return cF(e,n);case`ZodLiteral`:return QP(e);case`ZodEnum`:return YP(e);case`ZodNativeEnum`:return uF(e);case`ZodNullable`:return gF(e,n);case`ZodOptional`:return xF(e,n);case`ZodMap`:return lF(e,n);case`ZodSet`:return wF(e,n);case`ZodLazy`:return()=>e.getter()._def;case`ZodPromise`:return CF(e,n);case`ZodNaN`:case`ZodNever`:return dF();case`ZodEffects`:return JP(e,n);case`ZodAny`:return zP();case`ZodUnknown`:return DF();case`ZodDefault`:return qP(e,n);case`ZodBranded`:return UP(e,n);case`ZodReadonly`:return OF(e,n);case`ZodCatch`:return WP(e,n);case`ZodPipeline`:return SF(e,n);case`ZodFunction`:case`ZodVoid`:case`ZodSymbol`:return;default:return(e=>void 0)(t)}},AF=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)};function jF(e,t,n=!1){let r=t.seen.get(e);if(t.override){let i=t.override?.(e,t,r,n);if(i!==IP)return i}if(r&&!n){let e=MF(r,t);if(e!==void 0)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=kF(e,e.typeName,t),o=typeof a==`function`?jF(a(),t):a;if(o&&NF(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var MF=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:AF(t.currentPath,e.path)};case`none`:case`seen`:return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),zP()):t.$refStrategy===`seen`?zP():void 0}},NF=(e,t,n)=>(e.description&&(n.description=e.description),n),PF=e=>{let t=RP(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},FF=(e,t)=>{let n=PF(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:jF(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??zP()}),{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,a=jF(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??zP(),o=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;o!==void 0&&(a.title=o);let s=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,i].join(`/`),[n.definitionPath]:{...r,[i]:a}};return s.$schema=`http://json-schema.org/draft-07/schema#`,s},IF=Symbol.for(`vercel.ai.schema`);function LF(e){let t;return()=>(t??=e(),t)}function RF(e,{validate:t}={}){return{[IF]:!0,_type:void 0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function zF(e){return typeof e==`object`&&!!e&&IF in e&&e[IF]===!0&&`jsonSchema`in e&&`validate`in e}function BF(e){return e==null?RF({type:`object`,properties:{},additionalProperties:!1}):zF(e)?e:`~standard`in e?e[`~standard`].vendor===`zod`?KF(e):VF(e):e()}function VF(e){return RF(()=>{if(!HF(e))throw Error(`Standard schema vendor '${e[`~standard`].vendor}' does not support JSON Schema conversion.`);return PP(e[`~standard`].jsonSchema.input({target:`draft-07`}))},{validate:async t=>{let n=await e[`~standard`].validate(t);return`value`in n?{success:!0,value:n.value}:{success:!1,error:new Hw({value:t,cause:n.issues})}}})}function HF(e){return e[`~standard`].jsonSchema!=null}function UF(e,t){let n=t?.useReferences??!1;return RF(()=>FF(e,{$refStrategy:n?`root`:`none`}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function WF(e,t){let n=t?.useReferences??!1;return RF(()=>PP(yM(e,{target:`draft-7`,io:`input`,reused:n?`ref`:`inline`})),{validate:async t=>{let n=await EM(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function GF(e){return`_zod`in e}function KF(e,t){return GF(e)?WF(e,t):UF(e,t)}async function qF({value:e,schema:t,context:n}){let r=await JF({value:e,schema:t,context:n});if(!r.success)throw Hw.wrap({value:e,cause:r.error,context:n});return r.value}async function JF({value:e,schema:t,context:n}){let r=BF(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:Hw.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:Hw.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function YF({text:e,schema:t}){try{let n=NP(e);return t==null?{success:!0,value:n,rawValue:n}:await JF({value:n,schema:t})}catch(t){return{success:!1,error:Rw.isInstance(t)?t:new Rw({text:e,cause:t}),rawValue:void 0}}}function XF({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new SP).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await YF({text:e,schema:t}))}}))}async function ZF(e){return typeof e==`function`&&(e=e()),e}new TextDecoder;var QF=`AI_InvalidArgumentError`,$F=`vercel.ai.error.${QF}`,eI=Symbol.for($F),tI=class extends xw{constructor({parameter:e,value:t,message:n}){super({name:QF,message:`Invalid argument for parameter ${e}: ${n}`}),this[eI]=!0,this.parameter=e,this.value=t}static isInstance(e){return xw.hasMarker(e,$F)}},nI=`AI_UIMessageStreamError`,rI=`vercel.ai.error.${nI}`,iI=Symbol.for(rI),aI=class extends xw{constructor({chunkType:e,chunkId:t,message:n}){super({name:nI,message:n}),this[iI]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return xw.hasMarker(e,rI)}};function oI(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let r in t)if(r!==`__proto__`&&r!==`constructor`&&r!==`prototype`&&Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(i===void 0)continue;let a=r in e?e[r]:void 0,o=typeof i==`object`&&!!i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=typeof a==`object`&&!!a&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);n[r]=o&&s?oI(a,i):i}return n}var Q={array:wN,boolean:gN,custom:lP,discriminatedUnion:jN,enum:LN,instanceof:pP,lazy:sP,literal:zN,looseObject:DN,never:SN,null:vN,number:fN,object:EN,record:FN,string:BM,union:kN,unknown:bN},sI=Q.lazy(()=>Q.union([Q.null(),Q.string(),Q.number(),Q.boolean(),Q.record(Q.string(),sI.optional()),Q.array(sI)])),$=Q.record(Q.string(),Q.record(Q.string(),sI.optional())),cI=Q.union([Q.string(),Q.instanceof(Uint8Array),Q.instanceof(ArrayBuffer),Q.custom(OP,{message:`Must be a Buffer`})]),lI=Q.record(Q.string(),Q.string()),uI=Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:$.optional()}),dI=Q.object({type:Q.literal(`image`),image:Q.union([cI,Q.instanceof(URL),lI]),mediaType:Q.string().optional(),providerOptions:$.optional()}),fI=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:cI}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)}),Q.object({type:Q.literal(`reference`),reference:lI}),Q.object({type:Q.literal(`text`),text:Q.string()})]),pI=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:cI}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)})]),mI=Q.object({type:Q.literal(`file`),data:Q.union([fI,cI,Q.instanceof(URL),lI]),filename:Q.string().optional(),mediaType:Q.string(),providerOptions:$.optional()}),hI=Q.object({type:Q.literal(`reasoning`),text:Q.string(),providerOptions:$.optional()}),gI=Q.object({type:Q.literal(`custom`),kind:Q.string().transform(e=>e),providerOptions:$.optional()}),_I=Q.object({type:Q.literal(`reasoning-file`),data:Q.union([pI,cI,Q.instanceof(URL)]),mediaType:Q.string(),providerOptions:$.optional()}),vI=Q.object({type:Q.literal(`tool-call`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerOptions:$.optional(),providerExecuted:Q.boolean().optional()}),yI=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`text`),value:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`json`),value:sI,providerOptions:$.optional()}),Q.object({type:Q.literal(`execution-denied`),reason:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`error-text`),value:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`error-json`),value:sI,providerOptions:$.optional()}),Q.object({type:Q.literal(`content`),value:Q.array(Q.union([Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file`),data:fI,mediaType:Q.string(),filename:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-data`),data:Q.string(),mediaType:Q.string(),filename:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-url`),url:Q.string(),mediaType:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-data`),data:Q.string(),mediaType:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-url`),url:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:$.optional()}),Q.object({type:Q.literal(`custom`),providerOptions:$.optional()})]))})]),bI=Q.object({type:Q.literal(`tool-result`),toolCallId:Q.string(),toolName:Q.string(),output:yI,providerOptions:$.optional()}),xI=Q.object({type:Q.literal(`tool-approval-request`),approvalId:Q.string(),toolCallId:Q.string(),reason:Q.string().optional(),isAutomatic:Q.boolean().optional(),signature:Q.string().optional(),inputSchemaInput:Q.unknown().optional()}),SI=Q.object({type:Q.literal(`tool-approval-response`),approvalId:Q.string(),approved:Q.boolean(),reason:Q.string().optional()}),CI=Q.object({role:Q.literal(`system`),content:Q.string(),providerOptions:$.optional()}),wI=Q.object({role:Q.literal(`user`),content:Q.union([Q.string(),Q.array(Q.union([uI,dI,mI]))]),providerOptions:$.optional()}),TI=Q.object({role:Q.literal(`assistant`),content:Q.union([Q.string(),Q.array(Q.union([uI,gI,mI,hI,_I,vI,bI,xI]))]),providerOptions:$.optional()}),EI=Q.object({role:Q.literal(`tool`),content:Q.array(Q.union([bI,SI])),providerOptions:$.optional()});Q.union([CI,wI,TI,EI]);function DI(e){let t=[`ROOT`],n=-1,r=null,i=0;function a(e){return e>=`0`&&e<=`9`||e>=`A`&&e<=`F`||e>=`a`&&e<=`f`}function o(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`)}}function s(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop()}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop()}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case`ROOT`:o(u,l,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=l,t.pop()}break;case`INSIDE_OBJECT_AFTER_COMMA`:u===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_KEY`));break;case`INSIDE_OBJECT_KEY`:u===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`));break;case`INSIDE_OBJECT_AFTER_KEY`:u===`:`&&(t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`));break;case`INSIDE_OBJECT_BEFORE_VALUE`:o(u,l,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:s(u,l);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=l;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=l}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=l,t.pop();break;default:n=l,o(u,l,`INSIDE_ARRAY_AFTER_VALUE`)}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=l,t.pop();break;default:n=l}break;case`INSIDE_ARRAY_AFTER_COMMA`:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),u===`u`?(i=0,t.push(`INSIDE_STRING_UNICODE_ESCAPE`)):n=l;break;case`INSIDE_STRING_UNICODE_ESCAPE`:a(u)&&(i++,i===4&&(t.pop(),n=l));break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=l;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l);break;default:t.pop()}break;case`INSIDE_LITERAL`:{let i=e.substring(r,l+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?s(u,l):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l)):n=l;break}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:l+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:l+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:l+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?l+=`true`.slice(t.length):`false`.startsWith(t)?l+=`false`.slice(t.length):`null`.startsWith(t)&&(l+=`null`.slice(t.length))}}return l}async function OI(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await YF({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await YF({text:DI(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}new TextEncoder,new TextEncoder,EP({prefix:`aitxt`,size:24}),EP({prefix:`call`,size:24}),TransformStream;var kI=Q.record(Q.string(),sI.optional()),AI=LF(()=>KF(Q.union([Q.looseObject({type:Q.literal(`text-start`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`text-delta`),id:Q.string(),delta:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`text-end`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`error`),errorText:Q.string()}),Q.looseObject({type:Q.literal(`tool-input-start`),toolCallId:Q.string(),toolName:Q.string(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:kI.optional(),dynamic:Q.boolean().optional(),title:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-input-delta`),toolCallId:Q.string(),inputTextDelta:Q.string()}),Q.looseObject({type:Q.literal(`tool-input-available`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:kI.optional(),dynamic:Q.boolean().optional(),title:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-input-error`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:kI.optional(),dynamic:Q.boolean().optional(),errorText:Q.string(),title:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-approval-request`),approvalId:Q.string(),toolCallId:Q.string(),approvalDescriptor:Q.unknown().optional(),inputSchemaInput:Q.unknown().optional(),reason:Q.string().optional(),isAutomatic:Q.boolean().optional(),signature:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-approval-response`),approvalId:Q.string(),approved:Q.boolean(),reason:Q.string().optional(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`tool-output-available`),toolCallId:Q.string(),output:Q.unknown(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:kI.optional(),dynamic:Q.boolean().optional(),preliminary:Q.boolean().optional()}),Q.looseObject({type:Q.literal(`tool-output-error`),toolCallId:Q.string(),errorText:Q.string(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:kI.optional(),dynamic:Q.boolean().optional()}),Q.looseObject({type:Q.literal(`tool-output-denied`),toolCallId:Q.string()}),Q.looseObject({type:Q.literal(`reasoning-start`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`reasoning-delta`),id:Q.string(),delta:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`reasoning-end`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`custom`),kind:Q.string().transform(e=>e),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`source-url`),sourceId:Q.string(),url:Q.string(),title:Q.string().optional(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`source-document`),sourceId:Q.string(),mediaType:Q.string(),title:Q.string(),filename:Q.string().optional(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`file`),url:Q.string(),mediaType:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`reasoning-file`),url:Q.string(),mediaType:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.custom(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:Q.string().optional(),data:Q.unknown(),transient:Q.boolean().optional()}),Q.looseObject({type:Q.literal(`start-step`)}),Q.looseObject({type:Q.literal(`finish-step`)}),Q.looseObject({type:Q.literal(`reset-step`)}),Q.looseObject({type:Q.literal(`start`),messageId:Q.string().optional(),messageMetadata:Q.unknown().optional()}),Q.looseObject({type:Q.literal(`finish`),finishReason:Q.enum([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`]).optional(),messageMetadata:Q.unknown().optional()}),Q.looseObject({type:Q.literal(`abort`),reason:Q.string().optional()}),Q.looseObject({type:Q.literal(`message-metadata`),messageMetadata:Q.unknown()})])));function jI(e){return e.type.startsWith(`data-`)}function MI(){return Object.create(null)}function NI(e){return e.type.startsWith(`tool-`)}function PI(e){return e.type===`dynamic-tool`}function FI(e){return NI(e)||PI(e)}function II(e){return e.type.split(`-`).slice(1).join(`-`)}function LI({lastMessage:e,messageId:t}){let n=e?.role===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},r=MI(),i=n.parts.findLastIndex(e=>e.type===`step-start`),a=0;for(let e of n.parts.slice(i+1)){if(!FI(e))continue;let t=a;NI(e)&&a++,e.state===`input-streaming`&&(r[e.toolCallId]={text:e.rawInput??``,index:t,toolName:e.type===`dynamic-tool`?e.toolName:II(e),dynamic:e.type===`dynamic-tool`,title:e.title,toolMetadata:e.toolMetadata})}return{message:n,activeTextParts:MI(),activeReasoningParts:MI(),partialToolCalls:r}}function RI({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:o,resetStateOnMessageIdChange:s=!1}){return e.pipeThrough(new TransformStream({async transform(e,c){await r(async({state:r,write:l})=>{function u(){let e=r.message.parts,t=e.length-1;for(;t>=0&&e[t].type!==`step-start`;)t--;return e.slice(t+1)}function d(){return u().filter(FI)}function f(e){let t=d().find(t=>t.toolCallId===e);if(t==null){let n=r.message.parts;for(let r=n.length-1;r>=0;r--){let i=n[r];if(FI(i)&&i.toolCallId===e){t=i;break}}}if(t==null)throw new aI({chunkType:`tool-invocation`,chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function p(e){let t=r.message.parts.filter(FI).find(t=>t.approval?.id===e);if(t==null)throw new aI({chunkType:`tool-approval-response`,chunkId:e,message:`No tool invocation found for approval ID "${e}".`});return t}function m(e,t){let n=t??u().find(t=>NI(t)&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null){if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}}else r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},input:i.input,output:i.output,rawInput:i.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,preliminary:i.preliminary,...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&e.state!==`output-available`&&e.state!==`output-error`?{callProviderMetadata:i.providerMetadata}:{}})}function h(e,t){let n=t??u().find(t=>t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.toolName=e.toolName,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null){if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}}else r.message.parts.push({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:i.input,output:i.output,errorText:i.errorText,preliminary:i.preliminary,providerExecuted:i.providerExecuted,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&e.state!==`output-available`&&e.state!==`output-error`?{callProviderMetadata:i.providerMetadata}:{}})}async function g(e){if(e!=null){let n=r.message.metadata==null?e:oI(r.message.metadata,e);t!=null&&await qF({value:n,schema:t,context:{field:`message.metadata`,entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case`text-start`:{let t={type:`text`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeTextParts[e.id]=t,r.message.parts.push(t),l();break}case`text-delta`:{let t=r.activeTextParts[e.id];if(t==null)throw new aI({chunkType:`text-delta`,chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,l();break}case`text-end`:{let t=r.activeTextParts[e.id];if(t==null)throw new aI({chunkType:`text-end`,chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state=`done`,t.providerMetadata=e.providerMetadata??t.providerMetadata,delete r.activeTextParts[e.id],l();break}case`custom`:{let t={type:`custom`,kind:e.kind,providerMetadata:e.providerMetadata};r.message.parts.push(t),l();break}case`reasoning-start`:{let t={type:`reasoning`,id:e.id,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),l();break}case`reasoning-delta`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new aI({chunkType:`reasoning-delta`,chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,l();break}case`reasoning-end`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new aI({chunkType:`reasoning-end`,chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=e.providerMetadata??t.providerMetadata,t.state=`done`,delete r.activeReasoningParts[e.id],l();break}case`file`:case`reasoning-file`:r.message.parts.push({type:e.type,mediaType:e.mediaType,url:e.url,...e.providerMetadata==null?{}:{providerMetadata:e.providerMetadata}}),l();break;case`source-url`:r.message.parts.push({type:`source-url`,sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case`source-document`:r.message.parts.push({type:`source-document`,sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case`tool-input-start`:{let t=u().filter(NI);r.partialToolCalls[e.toolCallId]={text:``,toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title,toolMetadata:e.toolMetadata},e.dynamic?h({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}):m({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}),l();break}case`tool-input-delta`:{let t=r.partialToolCalls[e.toolCallId];if(t==null)throw new aI({chunkType:`tool-input-delta`,chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:n}=await OI(t.text);t.dynamic?h({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,rawInput:t.text,title:t.title,toolMetadata:t.toolMetadata}):m({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,rawInput:t.text,title:t.title,toolMetadata:t.toolMetadata}),l();break}case`tool-input-available`:e.dynamic?h({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}):m({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}),l(),a&&!e.providerExecuted&&await a({toolCall:e});break;case`tool-input-error`:{let t=u().filter(FI).find(t=>t.toolCallId===e.toolCallId);(t==null?e.dynamic:t.type===`dynamic-tool`)?h({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}):m({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}),l();break}case`tool-approval-request`:{let t=f(e.toolCallId);t.state=`approval-requested`,t.approval={id:e.approvalId,...e.approvalDescriptor==null?{}:{descriptor:e.approvalDescriptor},...Object.prototype.hasOwnProperty.call(e,`inputSchemaInput`)?{inputSchemaInput:e.inputSchemaInput}:{},...e.reason==null?{}:{requestReason:e.reason},...e.isAutomatic===!0?{isAutomatic:!0}:{},...e.signature==null?{}:{signature:e.signature}},l();break}case`tool-approval-response`:{let t=p(e.approvalId),n=t.approval==null?{id:e.approvalId}:t.approval;t.state=`approval-responded`,t.approval={...n,id:e.approvalId,approved:e.approved,...e.reason==null?{}:{reason:e.reason}},e.providerExecuted!=null&&(t.providerExecuted=e.providerExecuted),e.providerMetadata!=null&&(t.callProviderMetadata=e.providerMetadata),l();break}case`tool-output-denied`:{let t=f(e.toolCallId);t.state=`output-denied`,l();break}case`tool-output-available`:{let t=f(e.toolCallId);t.type===`dynamic-tool`?h({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-available`,input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t):m({toolCallId:e.toolCallId,toolName:II(t),state:`output-available`,input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t),l();break}case`tool-output-error`:{let t=f(e.toolCallId);t.type===`dynamic-tool`?h({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t):m({toolCallId:e.toolCallId,toolName:II(t),state:`output-error`,input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t),l();break}case`start-step`:r.message.parts.push({type:`step-start`});break;case`finish-step`:break;case`reset-step`:{let e=u();r.activeTextParts=MI(),r.activeReasoningParts=MI(),r.partialToolCalls=MI(),e.length>0&&(r.message.parts.splice(r.message.parts.length-e.length,e.length),l());break}case`start`:s&&e.messageId!=null&&e.messageId!==r.message.id&&Object.assign(r,LI({lastMessage:void 0,messageId:e.messageId}),{finishReason:void 0}),e.messageId!=null&&(r.message.id=e.messageId),await g(e.messageMetadata),(e.messageId!=null||e.messageMetadata!=null)&&l({updateStatus:!1});break;case`finish`:e.finishReason!=null&&(r.finishReason=e.finishReason),await g(e.messageMetadata),e.messageMetadata!=null&&l();break;case`message-metadata`:await g(e.messageMetadata),e.messageMetadata!=null&&l();break;case`error`:i?.(Error(e.errorText));break;default:if(jI(e)){if(n?.[e.type]!=null){let t=r.message.parts.findIndex(t=>`id`in t&&`data`in t&&t.id===e.id&&t.type===e.type),i=t>=0?t:r.message.parts.length;await qF({value:e.data,schema:n[e.type],context:{field:`message.parts[${i}].data`,entityName:e.type,entityId:e.id}})}let t=e;if(t.transient){o?.(t);break}let i=t.id==null?void 0:r.message.parts.find(e=>t.type===e.type&&t.id===e.id);i==null?r.message.parts.push(t):i.data=t.data,o?.(t),l()}}c.enqueue(e)})}}))}async function zI({stream:e,onError:t,abortSignal:n}){let r=e.getReader(),i=()=>{r.cancel().catch(()=>{})};n?.aborted?i():n?.addEventListener(`abort`,i,{once:!0});try{for(;;){let{done:e}=await r.read();if(e)break}}catch(e){t?.(e)}finally{n?.removeEventListener(`abort`,i),r.releaseLock()}}EP({prefix:`aitxt`,size:24}),EP({prefix:`call`,size:24}),EP({prefix:`aitxt`,size:24}),EP({prefix:`call`,size:24}),Q.record(Q.string(),sI.optional()),Q.record(Q.string(),Q.string()),EP({prefix:`call`,size:24}),EP({prefix:`call`,size:24}),new TextEncoder,EP({prefix:`call`,size:24}),EP({prefix:`aiobj`,size:24});var{atob:BI}=globalThis,VI=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};EP({prefix:`aiobj`,size:24}),EP({prefix:`call`,size:24}),Q.object({token:Q.string().refine(e=>e.trim().length>0),url:Q.string().refine(e=>{try{let t=new URL(e);return(t.protocol===`ws:`||t.protocol===`wss:`)&&t.hostname!==``}catch{return!1}}),expiresAt:Q.number().positive().max(2**53-1).optional(),tools:Q.array(Q.object({type:Q.literal(`function`),name:Q.string().min(1),description:Q.string().optional(),parameters:Q.record(Q.string(),Q.unknown())})).optional()}),EP({prefix:`call`,size:24}),EP({prefix:`call`,size:24}),EP({prefix:`call`,size:24});async function HI({response:e,url:t,fallbackMessage:n}){let r=await e.text();return new Tw({message:r||n,url:t,requestBodyValues:void 0,statusCode:e.status,responseBody:r})}async function UI(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Kw({functionality:`FileList`,message:`FileList is not supported in the current environment`});return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:`file`,mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}function WI(e,t){let n=e.search(/[?#]/),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n);return`${r.endsWith(`/`)&&t.startsWith(`/`)?r.slice(0,-1):r}${t}${i}`}var GI=class{constructor({api:e=`/api/chat`,credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){let n=await ZF(this.body),r=await ZF(this.headers),i=await ZF(this.credentials),a={...TP(r),...TP(t.headers)},o=await this.prepareSendMessagesRequest?.({api:this.api,id:t.chatId,messages:t.messages,body:{...n,...t.body},headers:a,credentials:i,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId}),s=o?.api??this.api,c=o?.headers===void 0?a:TP(o.headers),l=o?.body===void 0?{...n,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId}:o.body,u=o?.credentials??i,d=await(this.fetch??globalThis.fetch)(s,{method:`POST`,headers:{"content-type":`application/json`,...c},body:JSON.stringify(l),credentials:u,signal:e});if(!d.ok)throw await HI({response:d,url:s,fallbackMessage:`Failed to fetch the chat response.`});if(!d.body)throw new kw({message:`The response body is empty.`});return this.processResponseStream(d.body)}async reconnectToStream(e){let t=await ZF(this.body),n=await ZF(this.headers),r=await ZF(this.credentials),i={...TP(n),...TP(e.headers)},a=await this.prepareReconnectToStreamRequest?.({api:this.api,id:e.chatId,body:{...t,...e.body},headers:i,credentials:r,requestMetadata:e.metadata}),o=a?.api;if(o==null){if(e.chatId===`.`||e.chatId===`..`)throw new tI({parameter:`chatId`,value:e.chatId,message:`Chat IDs must not be "." or ".." when using the default reconnect URL.`});o=WI(this.api,`/${encodeURIComponent(e.chatId)}/stream`)}let s=a?.headers===void 0?i:TP(a.headers),c=a?.credentials??r,l=await(this.fetch??globalThis.fetch)(o,{method:`GET`,headers:s,credentials:c,signal:e.abortSignal});if(l.status===204)return null;if(!l.ok)throw await HI({response:l,url:o,fallbackMessage:`Failed to fetch the chat response.`});if(!l.body)throw new kw({message:`The response body is empty.`});return this.processResponseStream(l.body)}},KI=class extends GI{constructor(e={}){super(e)}processResponseStream(e){return XF({stream:e,schema:AI}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},qI=class{constructor({generateId:e=DP,id:t=e(),transport:n=new KI,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:c,onData:l,sendAutomaticallyWhen:u}){this.pendingMessagePreparations=new Set,this.activeResponse=void 0,this.activeResumeRequest=void 0,this.resumableStreamState=void 0,this.jobExecutor=new VI,this.sendMessage=async(e,t)=>{if(e==null){let e=this.pendingApprovalMessageId;if(e==null){e=this.lastMessage?.id;for(let t=this.state.messages.length-1;t>=0;t--){let n=this.state.messages[t];if(n.role===`assistant`&&n.parts.some(e=>FI(e)&&e.state===`approval-responded`)){e=n.id;break}}}let n=e!=null&&e===this.pendingApprovalMessageId?this.state.messages.findIndex(t=>t.id===e):-1;await this.makeRequestForToolApproval({messageId:e,messageIndex:n,...t});return}let n;if(`text`in e||`files`in e){let t=new AbortController;this.pendingMessagePreparations.add(t);let r;try{r=Array.isArray(e.files)?e.files:await UI(e.files)}finally{this.pendingMessagePreparations.delete(t)}if(t.signal.aborted)return;n={parts:[...r,...`text`in e&&e.text!=null?[{type:`text`,text:e.text}]:[]]}}else n=e;if(e.messageId!=null){let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(t===-1)throw new tI({parameter:`message.messageId`,value:e.messageId,message:`message with id ${e.messageId} not found`});if(this.state.messages[t].role!==`user`)throw new tI({parameter:`message.messageId`,value:e.messageId,message:`message with id ${e.messageId} is not a user message`});this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{id:e.messageId,...n,role:n.role??`user`,metadata:e.metadata})}else this.state.pushMessage({...n,id:n.id??this.generateId(),role:n.role??`user`,metadata:e.metadata});await this.makeRequest({trigger:`submit-message`,messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{let n=e==null?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(n===-1)throw new tI({parameter:`messageId`,value:e,message:`message ${e} not found`});this.state.messages=this.state.messages.slice(0,this.messages[n].role===`assistant`?n:n+1),await this.makeRequest({trigger:`regenerate-message`,messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:`resume-stream`,...e})},this.clearError=()=>{this.status===`error`&&(this.state.error=void 0,this.setStatus({status:`ready`}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n,options:r})=>this.jobExecutor.run(async()=>{let i=this.state.messages,a=r=>FI(r)&&r.state===`approval-requested`&&r.approval.id===e?{...r,state:`approval-responded`,approval:{...r.approval,id:e,approved:t,reason:n}}:r,o=i.findIndex(t=>t.parts.some(t=>FI(t)&&t.state===`approval-requested`&&t.approval.id===e));if(o!==-1){let e=i[o];this.state.replaceMessage(o,{...e,parts:e.parts.map(a)}),this.pendingApprovalMessageId=e.id}this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(a)),this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{if(e){let e=o===-1?this.lastMessage?.id:i[o].id;this.makeRequestForToolApproval({messageId:e,messageIndex:o,...r})}})}),this.addToolOutput=async({state:e,toolCallId:t,output:n,errorText:r,options:i})=>this.jobExecutor.run(async()=>{let a=this.state.messages,o=a[a.length-1],s=i=>{if(!FI(i)||i.toolCallId!==t)return i;let{approval:a,...o}=i,s=a?.approved===!0?{approval:{...a,approved:a.approved}}:{};return e===`output-error`?{...o,...s,state:e,input:i.input,output:void 0,errorText:r}:{...o,...s,state:`output-available`,input:i.input,output:n,errorText:void 0}};this.state.replaceMessage(a.length-1,{...o,parts:o.parts.map(s)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{e&&this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,...i})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{for(let e of this.pendingMessagePreparations)e.abort();this.activeResumeRequest?.abortController.abort(),this.activeResponse?.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=o,this.onToolCall=s,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=u}get status(){return this.state.status}setStatus({status:e,error:t}){if(this.status===e){this.error!==t&&(this.state.error=t);return}this.state.status=e,this.state.error=t}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e==`object`&&`then`in e?await e:e}async makeRequestForToolApproval({messageId:e,messageIndex:t,...n}){let r=e!=null&&e===this.pendingApprovalMessageId;r&&(this.pendingApprovalMessageId=void 0),await this.makeRequest({trigger:`submit-message`,messageId:e,...n}),r&&this.status===`error`&&this.pendingApprovalMessageId==null&&(this.pendingApprovalMessageId=this.state.messages[t]?.id??e)}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){e!==`resume-stream`&&(this.resumableStreamState=void 0);let a=new AbortController,o=e===`resume-stream`?{abortController:a}:void 0;o&&(this.activeResumeRequest?.abortController.abort(),this.activeResumeRequest=o);let s=()=>o==null||this.activeResumeRequest===o,c=()=>{this.activeResumeRequest===o&&(this.activeResumeRequest=void 0)},l;if(e===`resume-stream`)try{let e=await this.transport.reconnectToStream({chatId:this.id,abortSignal:a.signal,metadata:t,headers:n,body:r});if(a.signal.aborted||!s()){await e?.cancel().catch(()=>{}),s()&&(this.setStatus({status:`ready`}),this.resumableStreamState=void 0),c();return}if(e==null){this.setStatus({status:`ready`}),this.resumableStreamState=void 0,c();return}l=e}catch(e){if(a.signal.aborted||e.name===`AbortError`){s()&&(this.setStatus({status:`ready`}),this.resumableStreamState=void 0),c();return}if(!s())return;this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e}),c();return}this.setStatus({status:`submitted`,error:void 0});let u=this.lastMessage,d=e===`submit-message`&&i!=null?this.state.messages.findIndex(e=>e.id===i):this.state.messages.length-1,f=d===-1?u:this.state.messages[d],p=e===`resume-stream`&&f?.role===`assistant`&&f.parts.some(e=>FI(e)&&(e.state===`input-streaming`||e.state===`approval-responded`))?this.state.snapshot(f):void 0,m=d!==-1&&d<this.state.messages.length-1&&f?.role===`assistant`,h=!1,g=!1,_=!1,v;try{let o={state:e===`resume-stream`&&this.resumableStreamState!=null?this.resumableStreamState:LI({lastMessage:e===`resume-stream`?p:e===`regenerate-message`?void 0:this.state.snapshot(f),messageId:this.generateId()}),abortController:a};v=o,o.abortController.signal.addEventListener(`abort`,()=>{h=!0}),this.activeResponse=o;let c;if(c=e===`resume-stream`?l:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:o.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i}),await zI({stream:RI({stream:c,resetStateOnMessageIdChange:e===`resume-stream`,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:e=>this.jobExecutor.run(()=>o.abortController.signal.aborted?Promise.resolve():e({state:o.state,write:({updateStatus:e=!0}={})=>{o.abortController.signal.aborted||(e&&this.setStatus({status:`streaming`}),m?this.state.replaceMessage(d,o.state.message):o.state.message.id===this.lastMessage?.id?this.state.replaceMessage(this.state.messages.length-1,o.state.message):this.state.pushMessage(o.state.message))}})),onError:e=>{throw e}}),abortSignal:o.abortController.signal,onError:e=>{throw e}}),h)return s()&&(this.setStatus({status:`ready`}),this.resumableStreamState===o.state&&(this.resumableStreamState=void 0)),null;s()&&(this.setStatus({status:`ready`}),this.resumableStreamState===o.state&&(this.resumableStreamState=void 0))}catch(e){if(h||e.name===`AbortError`)return h=!0,s()&&(this.setStatus({status:`ready`}),this.resumableStreamState===v?.state&&(this.resumableStreamState=void 0)),null;if(!s())return null;if(_=!0,e instanceof TypeError){let t=e.message.toLowerCase();g=t.includes(`fetch`)||t.includes(`network`)||t===`load failed`}g?this.resumableStreamState=v?.state:this.resumableStreamState===v?.state&&(this.resumableStreamState=void 0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e})}finally{try{v&&this.onFinish?.({message:v.state.message,messages:this.state.messages,isAbort:h,isDisconnect:g,isError:_,finishReason:v.state.finishReason})}finally{this.activeResponse===v&&(this.activeResponse=void 0),c()}}!_&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,metadata:t,headers:n,body:r})}},JI=c(o(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n}))(),1);function YI(e,t){return t==null?e:(0,JI.default)(e,t)}function XI(e){return Array.isArray(e)?[...e]:typeof e==`object`&&e&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)?{...e}:e}var ZI=class{#e;#t;#n;#r;#i;#a;constructor(e=[]){this.#t=`ready`,this.#n=void 0,this.#r=new Set,this.#i=new Set,this.#a=new Set,this.pushMessage=e=>{this.#e=this.#e.concat(e),this.#o()},this.popMessage=()=>{this.#e=this.#e.slice(0,-1),this.#o()},this.replaceMessage=(e,t)=>{this.#e=[...this.#e.slice(0,e),this.snapshot(t),...this.#e.slice(e+1)],this.#o()},this.snapshot=e=>{if(typeof e!=`object`||!e||!(`parts`in e)||!Array.isArray(e.parts))return e;let t=e,n={...t,parts:t.parts.map(e=>({...e}))};return`metadata`in t&&(n.metadata=XI(t.metadata)),n},this[`~registerMessagesCallback`]=(e,t)=>{let n=t?YI(e,t):e;return this.#r.add(n),()=>{this.#r.delete(n)}},this[`~registerStatusCallback`]=e=>(this.#i.add(e),()=>{this.#i.delete(e)}),this[`~registerErrorCallback`]=e=>(this.#a.add(e),()=>{this.#a.delete(e)}),this.#o=()=>{this.#r.forEach(e=>e())},this.#s=()=>{this.#i.forEach(e=>e())},this.#c=()=>{this.#a.forEach(e=>e())},this.#e=e}get status(){return this.#t}set status(e){this.#t=e,this.#s()}get error(){return this.#n}set error(e){this.#n=e,this.#c()}get messages(){return this.#e}set messages(e){this.#e=[...e],this.#o()}#o;#s;#c},QI=class extends qI{#e;constructor({messages:e,...t}){let n=new ZI(e);super({...t,state:n}),this[`~registerMessagesCallback`]=(e,t)=>this.#e[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>this.#e[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>this.#e[`~registerErrorCallback`](e),this.#e=n}},$I=new WeakMap;function eL({chat:e,registration:t}){let n=$I.get(e);n??(n=new Set,$I.set(e,n));let r=n.size===0;return n.add(t),r&&e.resumeStream(),()=>{n.delete(t),n.size===0&&$I.delete(e)}}function tL(e){return{chat:e,messages:e.messages,status:e.status,error:e.error}}function nL(e,t){return e.chat===t.chat&&e.messages===t.messages&&e.status===t.status&&e.error===t.error}function rL({throttle:e,experimental_throttle:t,resume:n=!1,...r}={}){let i=e??t,a=(0,y.useRef)({}),o=(0,y.useRef)({});`chat`in r||(o.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen,transport:r.transport});let s,c=()=>o.current.transport??(s??=new KI),l={...r,transport:{sendMessages:e=>c().sendMessages(e),reconnectToStream:e=>c().reconnectToStream(e)},onToolCall:e=>o.current.onToolCall?.(e),onData:e=>o.current.onData?.(e),onFinish:e=>o.current.onFinish?.(e),onError:e=>o.current.onError?.(e),sendAutomaticallyWhen:e=>o.current.sendAutomaticallyWhen?.(e)??!1},u=`chat`in r?r.chat:r.id,{chat:d,isExternallyManaged:f}=(0,y.useMemo)(()=>({chat:`chat`in r?r.chat:new QI(l),isExternallyManaged:`chat`in r}),[u]);(0,y.useEffect)(()=>{if(!f)return()=>{d.stop()}},[d,f]);let[p,m]=(0,y.useState)(()=>tL(d));p.chat!==d&&m(tL(d)),(0,y.useEffect)(()=>{let e=!0,t=()=>{if(!e)return;let t=tL(d);m(e=>e.chat!==d||nL(e,t)?e:t)},n=[d[`~registerMessagesCallback`](t,i),d[`~registerStatusCallback`](t),d[`~registerErrorCallback`](t)],r=tL(d);return m(e=>nL(e,r)?e:r),()=>{e=!1,n.forEach(e=>e())}},[d,i]);let{messages:h,status:g,error:_}=p,v=(0,y.useCallback)(e=>{typeof e==`function`&&(e=e(d.messages)),d.messages=e},[d]);return(0,y.useEffect)(()=>{if(n)return eL({chat:d,registration:a.current})},[n,d]),{id:d.id,messages:h,setMessages:v,sendMessage:d.sendMessage,regenerate:d.regenerate,clearError:d.clearError,stop:d.stop,error:_,resumeStream:d.resumeStream,status:g,addToolResult:d.addToolOutput,addToolOutput:d.addToolOutput,addToolApprovalResponse:d.addToolApprovalResponse}}var iL={running:`进行中`,completed:``,failed:`失败`,stopped:`已停止`,timed_out:`超时停止`,interrupted:`看板重启时中断`};function aL(e){return/"busy"/.test(e)?`这路 worker 有一轮旁问还在进行,上面可以接上看或停止它。`:/"no_thread"/.test(e)?`这路 worker 没记录 Codex 线程 id,没法分叉。`:/"codex_missing"/.test(e)?`找不到 codex 命令。起看板的环境里 PATH 没有它,或者设一下 CODEX_BIN。`:/Failed to fetch|NetworkError|Load failed/.test(e)?`连不上看板后端,它还在跑吗?`:e}function oL({text:e}){let[t,n]=(0,y.useState)(!1),r=e.split(`
151
+ `).find(e=>e.trim())??``;return(0,b.jsxs)(`div`,{className:`t-footnote text-label-2`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex min-h-[28px] items-center gap-1 text-left hover:text-label`,children:[(0,b.jsx)(_b,{size:11,weight:`bold`,className:`shrink-0 transition-transform ${t?`rotate-90`:``}`}),(0,b.jsx)(`span`,{className:`truncate`,children:t?`思考`:r.slice(0,120)})]}),t&&(0,b.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words pl-4 font-sans text-label-2`,children:e})]})}function sL({name:e,input:t,output:n}){let[r,i]=(0,y.useState)(!1),a=e===`shell`?t?.command??``:e,o=n?.exit_code!==void 0&&n?.exit_code!==null&&n.exit_code!==0;return(0,b.jsxs)(`div`,{className:`inset my-1 overflow-hidden`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`flex min-h-[32px] w-full items-center gap-2 px-3 text-left`,children:[(0,b.jsx)(_b,{size:11,weight:`bold`,className:`shrink-0 text-label-3 transition-transform ${r?`rotate-90`:``}`}),(0,b.jsx)(`span`,{className:`t-caption shrink-0 rounded px-1.5 py-0.5 font-medium ${n?o?`bg-red/12 text-red`:`bg-green/12 text-green`:`bg-fill text-label-2`}`,children:n?`exit ${n.exit_code??`?`}`:`运行中`}),(0,b.jsx)(`span`,{className:`t-footnote mono min-w-0 flex-1 truncate text-label`,children:a})]}),r&&(0,b.jsxs)(`pre`,{className:`t-caption mono max-h-64 overflow-auto border-t border-separator-soft px-3 py-2 whitespace-pre-wrap break-all text-label-2`,children:[t?.command?`$ ${t.command}\n`:JSON.stringify(t,null,2)+`
152
+ `,n?.output??(n?JSON.stringify(n,null,2):`…`)]})]})}function cL({message:e,turn:t}){let n=e.parts,r=n.filter(e=>e.type===`data-notice`),i=n.filter(e=>e.type===`data-usage`).at(-1)?.data??t?.usage??null,a=t&&t.status!==`completed`&&t.status!==`running`?iL[t.status]:null;return(0,b.jsxs)(`div`,{className:`space-y-1.5`,children:[n.map((e,t)=>{if(e.type===`reasoning`)return(0,b.jsx)(oL,{text:String(e.text??``)},t);if(e.type===`text`)return(0,b.jsx)(vw,{text:String(e.text??``),className:`inset px-4 py-3`},t);if(e.type.startsWith(`tool-`)||e.type===`dynamic-tool`){let n=e.type===`dynamic-tool`?String(e.toolName??`tool`):e.type.slice(5);return(0,b.jsx)(sL,{name:n,input:e.input,output:e.output},t)}return null}),a&&(0,b.jsxs)(`p`,{className:`t-footnote text-red`,children:[a,t?.error&&t.error!==`stopped`?`:${t.error}`:``]}),r.length>0&&(0,b.jsxs)(`details`,{className:`t-caption text-label-3`,children:[(0,b.jsxs)(`summary`,{className:`cursor-pointer`,children:[`Codex 提示 `,r.length,` 条`]}),(0,b.jsx)(`ul`,{className:`mt-1 list-disc pl-4`,children:r.map((e,t)=>(0,b.jsx)(`li`,{children:String(e.data?.message??``)},t))})]}),i&&(0,b.jsxs)(`div`,{className:`t-caption mono text-label-3`,children:[vf(i.input_tokens??0),` in(缓存 `,vf(i.cached_input_tokens??0),`)· `,vf(i.output_tokens??0),` out`]})]})}function lL(e){let t=[];for(let n of e)t.push({id:`u-${n.id}`,role:`user`,parts:[{type:`text`,text:n.question}]}),n.status!==`running`&&t.push({id:n.id,role:`assistant`,parts:n.parts});return t}function uL({workerId:e,canAsk:t,running:n}){let r=`/api/workers/${encodeURIComponent(e)}/chat`,i=(0,y.useMemo)(()=>new KI({api:r}),[r]),{messages:a,sendMessage:o,status:s,stop:c,error:l,setMessages:u,resumeStream:d,clearError:f}=rL({id:`side-${e}`,transport:i}),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(!1),x=(0,y.useRef)(null),S=(0,y.useRef)(null),C=s===`submitted`||s===`streaming`,w=(0,y.useCallback)(async()=>{try{let e=await(await fetch(r)).json();return g(e),e}catch{return null}},[r]);(0,y.useEffect)(()=>{let t=!1;return(async()=>{let n=await w();n&&!t&&x.current!==e&&(x.current=e,u(lL(n.turns)),n.busy&&(v(!0),await d().catch(()=>{}),t||(v(!1),await w())))})(),()=>{t=!0}},[e]),(0,y.useEffect)(()=>{(s===`ready`||s===`error`)&&w()},[s,w]),(0,y.useEffect)(()=>{S.current?.scrollTo({top:S.current.scrollHeight,behavior:`smooth`})},[a,s]);let T=!!h?.busy&&!C&&!_,E=async()=>{let e=p.trim();e&&!C&&!_&&t&&((await w())?.busy||(m(``),f(),o({text:e})))},D=async()=>{v(!0);let e=await w();e&&u(lL(e.turns)),await d().catch(()=>{}),v(!1),await w()},O=async()=>{await fetch(`${r}/stop`,{method:`POST`}),c(),await w()},k=async()=>{c(),await fetch(r,{method:`DELETE`}),u([]),f(),await w()},A=new Map((h?.turns??[]).map(e=>[e.id,e]));return(0,b.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,b.jsxs)(`div`,{ref:S,className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-1 py-2`,children:[a.length===0&&!T&&(0,b.jsx)(`p`,{className:`t-subhead px-1 py-6 text-label-2`,children:t?`问这路 worker 任何事。它会从这路的 Codex 线程分叉出一个只读的旁路会话来回答:能读它的 worktree 和磁盘上任何文件,不会改东西,也不打扰它。${n?`它还在跑,答案基于目前为止的进度。`:``}切 tab、关抽屉、刷新都不会丢:回答在服务端继续,回来接着看。`:`这路 worker 没记录 Codex 线程 id(0.5 之前派的),没法分叉,问不了。`}),a.map(e=>e.role===`user`?(0,b.jsx)(`div`,{className:`flex justify-end`,children:(0,b.jsx)(`div`,{className:`t-subhead max-w-[85%] whitespace-pre-wrap rounded-2xl rounded-br-md bg-blue px-3.5 py-2 text-white`,children:e.parts.filter(e=>e.type===`text`).map(e=>e.text).join(`
153
+ `)})},e.id):(0,b.jsx)(`div`,{className:`max-w-[95%]`,children:(0,b.jsx)(cL,{message:e,turn:A.get(e.id)})},e.id)),(C||_)&&(0,b.jsxs)(`div`,{className:`t-footnote flex items-center gap-2 px-1 text-label-2`,children:[(0,b.jsx)(`span`,{className:`inline-block h-2 w-2 animate-pulse rounded-full bg-orange`}),_?`接上正在进行的一轮…`:s===`submitted`?`正在分叉线程…`:`在想…`,(0,b.jsx)(`button`,{type:`button`,onClick:O,className:`ml-2 text-blue`,children:`停止`})]}),T&&(0,b.jsxs)(`div`,{className:`t-footnote flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg bg-orange/10 px-3 py-2 text-label`,children:[(0,b.jsxs)(`span`,{children:[`有一轮旁问在进行(`,h?.busy_since?`${gf(h.busy_since)} 开始`:`刚才`,`,`,h?.watchers?`另一个页面在看`:`没有页面在看`,`)。`]}),(0,b.jsx)(`button`,{type:`button`,onClick:D,className:`font-semibold text-blue`,children:`接上看`}),(0,b.jsx)(`button`,{type:`button`,onClick:O,className:`text-red`,children:`停止它`})]}),l&&(0,b.jsx)(`p`,{className:`t-footnote rounded-lg bg-red/10 px-3 py-2 text-red`,children:aL(l.message)})]}),(0,b.jsxs)(`div`,{className:`shrink-0 border-t border-separator-soft pt-3`,children:[(0,b.jsxs)(`div`,{className:`inset flex items-end gap-2 px-3 py-2`,children:[(0,b.jsx)(`textarea`,{value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),E())},placeholder:t?`问它点什么… Enter 发送,Shift+Enter 换行`:`没有线程 id,问不了`,disabled:!t,rows:Math.min(6,Math.max(1,p.split(`
154
+ `).length)),className:`t-subhead min-h-[28px] flex-1 resize-none bg-transparent py-1 text-label outline-none placeholder:text-label-3 disabled:opacity-50`}),C||_?(0,b.jsx)(`button`,{type:`button`,onClick:O,"aria-label":`停止`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-fill text-label hover:bg-fill-2`,children:(0,b.jsx)(xb,{size:14,weight:`fill`})}):(0,b.jsx)(`button`,{type:`button`,onClick:()=>void E(),disabled:!p.trim()||!t||T,"aria-label":`发送`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-blue text-white disabled:opacity-40`,children:(0,b.jsx)(yb,{size:14,weight:`fill`})})]}),(0,b.jsxs)(`div`,{className:`t-caption mt-1.5 flex items-center justify-between px-1 text-label-3`,children:[(0,b.jsxs)(`span`,{children:[`只读旁路会话 · 不影响 worker`,h?.fork_thread_id?` · 已分叉`:``]}),(a.length>0||h?.active)&&(0,b.jsxs)(`button`,{type:`button`,onClick:k,className:`inline-flex items-center gap-1 hover:text-label`,children:[(0,b.jsx)(hb,{size:12}),` 结束并清空`]})]})]})]})}function dL({segments:e,value:t}){let n=(0,y.useRef)(null),[r,i]=(0,y.useState)(null);return(0,y.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let r=()=>{let n=e.querySelector(`[data-value="${CSS.escape(t)}"]`);n&&i({left:n.offsetLeft,width:n.offsetWidth})};r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[t,e.length]),(0,b.jsxs)(ib,{ref:n,className:`relative grid shrink-0 rounded-lg bg-fill p-0.5`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},children:[r&&(0,b.jsx)(Qd.span,{"aria-hidden":!0,className:`absolute top-0.5 bottom-0.5 rounded-md bg-bg-2 shadow-[0_1px_2px_rgb(0_0_0/0.10),0_0_0_0.5px_rgb(0_0_0/0.04)]`,initial:!1,animate:{left:r.left,width:r.width},transition:{type:`spring`,stiffness:520,damping:42,mass:.7}}),e.map(e=>{let n=e.value===t;return(0,b.jsxs)(Ny,{value:e.value,"data-value":e.value,className:`t-footnote relative z-10 flex h-8 items-center justify-center gap-1 rounded-md font-medium outline-none focus-visible:ring-2 focus-visible:ring-blue`,children:[(0,b.jsx)(Qd.span,{animate:{color:n?`var(--color-label)`:`var(--color-label-2)`},transition:{duration:.18},className:`whitespace-nowrap`,children:e.label}),e.count?(0,b.jsx)(`span`,{className:`tabular text-label-3`,children:e.count}):null]},e.value)})]})}function fL({id:e,children:t}){return(0,b.jsx)(cu,{mode:`wait`,initial:!1,children:(0,b.jsx)(Qd.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-2},transition:{duration:.16,ease:[.25,.1,.25,1]},children:t},e)})}function pL({label:e,children:t,mono:n=!1,title:r}){return(0,b.jsxs)(`div`,{className:`flex min-h-[36px] items-center gap-4 py-1.5`,children:[(0,b.jsx)(`span`,{className:`t-subhead w-20 shrink-0 text-label-2`,children:e}),(0,b.jsx)(`span`,{className:`t-subhead min-w-0 flex-1 truncate text-right ${n?`mono`:``}`,title:r,children:t})]})}function mL({title:e,children:t}){return(0,b.jsxs)(`section`,{className:`mt-5`,children:[e&&(0,b.jsx)(`div`,{className:`group-header mb-1.5 px-1`,children:e}),(0,b.jsx)(`div`,{className:`inset divide-y divide-separator-soft px-4`,children:t})]})}function hL({text:e}){let t=Array.from(new Set(e.split(/(?<=\.)\s+(?=[A-Z])|\n+/).map(e=>e.trim()).filter(Boolean)));return(0,b.jsxs)(`details`,{className:`group mt-4 px-1`,children:[(0,b.jsxs)(`summary`,{className:`t-footnote cursor-pointer list-none text-label-2 hover:text-label`,children:[(0,b.jsx)(`span`,{className:`mr-1 inline-block transition-transform group-open:rotate-90`,children:`▸`}),`Codex 提示 `,t.length,` 条`]}),(0,b.jsx)(`ul`,{className:`t-footnote mt-1.5 space-y-1 pl-4 text-label-2`,children:t.map(e=>(0,b.jsx)(`li`,{className:`list-disc`,children:e},e))})]})}function gL({children:e}){return(0,b.jsx)(`p`,{className:`t-subhead py-10 text-center text-label-2`,children:e})}function _L({worker:e}){if(e.reports.length===0)return(0,b.jsx)(gL,{children:`这路 worker 还没有汇报。`});let t=[...e.reports].reverse();return(0,b.jsx)(`div`,{className:`space-y-3`,children:t.map((e,n)=>(0,b.jsxs)(`article`,{className:`inset px-4 py-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`group-header`,children:n===0?`最终汇报`:`之前的汇报 ${t.length-n}`}),(0,b.jsxs)(`span`,{className:`t-caption ml-auto text-label-3`,children:[e.length,` 字`]})]}),(0,b.jsx)(vw,{text:e,className:`mt-2`})]},n))})}function vL({worker:e}){return e.changed_files.length===0?(0,b.jsx)(gL,{children:`没有改动:worktree 没有未提交的文件,分支上也没有新提交。`}):(0,b.jsx)(`ul`,{className:`inset divide-y divide-separator-soft px-4`,children:e.changed_files.map(t=>(0,b.jsx)(`li`,{className:`t-subhead mono flex min-h-[36px] items-center py-1.5`,title:t,children:(0,b.jsx)(`span`,{className:`truncate`,children:bf(t,e.worktree_path)})},t))})}function yL({worker:e}){if(e.commands.length===0)return(0,b.jsx)(gL,{children:`没跑过命令。`});let t=[...e.commands].reverse();return(0,b.jsx)(`ol`,{className:`inset divide-y divide-separator-soft px-4`,children:t.map((e,t)=>{let n=e.exit_code!==null&&e.exit_code!==0;return(0,b.jsxs)(`li`,{className:`py-2.5`,children:[(0,b.jsxs)(`div`,{className:`t-caption flex items-center gap-2`,children:[(0,b.jsxs)(`span`,{className:`tabular ${n?`text-red`:`text-green`}`,children:[`exit `,e.exit_code??`?`]}),(0,b.jsx)(`span`,{className:`ml-auto text-label-3`,children:gf(e.completed_at)})]}),(0,b.jsx)(`pre`,{className:`t-footnote mono mt-1 whitespace-pre-wrap break-all text-label`,children:e.command})]},t)})})}var bL=[{value:`overview`,label:`概览`},{value:`report`,label:`汇报`},{value:`changes`,label:`改动`},{value:`commands`,label:`命令`},{value:`events`,label:`事件`},{value:`prompt`,label:`任务书`},{value:`ask`,label:`旁问`}];function xL({workerId:e,onClose:t,onOpenWorker:n}){let[r,i]=(0,y.useState)(`report`),{data:a,error:o}=cf(e),{data:s}=lf(e,r===`events`),c=a?{changes:a.changed_files.length,commands:a.command_count,events:a.event_kinds.reduce((e,t)=>e+t.count,0)}:{},l=a?.followup_of??a?.resumed_from??null,u=l&&l!==a?.id?l:null;return(0,b.jsxs)(Qd.section,{initial:{x:32,opacity:0},animate:{x:0,opacity:1},exit:{x:32,opacity:0},transition:{duration:.24,ease:[.25,.1,.25,1]},className:`flex h-full min-h-0 flex-col border-l border-separator-soft bg-bg`,"aria-label":`worker 详情`,children:[!a&&(0,b.jsx)(`p`,{className:`t-subhead p-8 text-label-2`,children:o?`读取失败:${o.message}`:`读取中…`}),a&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`header`,{className:`shrink-0 border-b border-separator-soft px-6 pt-5 pb-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsx)(Cf,{status:a.status,phase:a.phase,className:`t-footnote`}),(0,b.jsx)(`h2`,{className:`t-title2 mt-1`,children:a.title}),a.goal&&(0,b.jsx)(`p`,{className:`t-subhead mt-1 line-clamp-2 text-label-2`,title:a.goal,children:a.goal})]}),(0,b.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`关闭`,className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-fill text-label-2 hover:bg-fill-2`,children:(0,b.jsx)(Cb,{size:14,weight:`bold`})})]}),a.status===`running`&&a.current_action&&(0,b.jsx)(`p`,{className:`t-footnote mono mt-3 truncate text-orange`,title:a.current_action,children:a.current_action}),a.error&&(a.status===`running`||a.status===`queued`?(0,b.jsxs)(`p`,{className:`t-footnote mt-3 text-label-2`,children:[`上次运行:`,a.error]}):(0,b.jsx)(`p`,{className:`t-footnote mt-3 rounded-lg bg-red/10 px-3 py-1.5 text-red`,children:a.error})),(0,b.jsxs)(`div`,{className:`t-footnote mono tabular mt-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-label-2`,children:[(0,b.jsx)(`span`,{title:`耗时`,children:_f(a.duration_ms)}),(0,b.jsxs)(`span`,{title:`改动的文件数(worktree 真实 diff)`,children:[a.changed_files.length,` 文件`]}),(0,b.jsxs)(`span`,{title:`跑过的命令数`,children:[a.command_count,` 命令`]}),(0,b.jsxs)(`span`,{title:`输入 ${a.usage.input_tokens}(缓存命中 ${a.usage.cached_input_tokens})/ 输出 ${a.usage.output_tokens}`,children:[vf(a.usage.input_tokens),` in · `,vf(a.usage.output_tokens),` out`]}),a.exit_code!==null&&(0,b.jsxs)(`span`,{title:`退出码`,children:[`exit `,a.exit_code]}),a.run_count>1&&(0,b.jsxs)(`span`,{children:[`第 `,a.run_count,` 次运行`]})]})]}),(0,b.jsxs)(xy,{value:r,onValueChange:e=>i(e),className:`flex min-h-0 flex-1 flex-col`,children:[(0,b.jsx)(`div`,{className:`mx-6 mt-3`,children:(0,b.jsx)(dL,{value:r,segments:bL.map(e=>({value:e.value,label:e.label,count:c[e.value]}))})}),(0,b.jsx)(Fy,{value:`ask`,keepMounted:!0,className:`min-h-0 flex-1 flex-col px-6 pb-4 pt-3 ${r===`ask`?`flex`:`hidden`}`,children:(0,b.jsx)(uL,{workerId:a.id,canAsk:!!a.thread_id,running:a.status===`running`})}),r!==`ask`&&(0,b.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 pb-8 pt-3`,children:(0,b.jsxs)(fL,{id:r,children:[(0,b.jsxs)(Fy,{value:`overview`,children:[(0,b.jsxs)(mL,{title:`运行`,children:[(0,b.jsx)(pL,{label:`开始`,mono:!0,children:gf(a.started_at??a.created_at)}),(0,b.jsx)(pL,{label:`结束`,mono:!0,children:gf(a.completed_at)}),(0,b.jsx)(pL,{label:`耗时`,children:_f(a.duration_ms)}),(0,b.jsx)(pL,{label:`退出码`,mono:!0,children:a.exit_code??`—`}),(0,b.jsx)(pL,{label:`运行次数`,mono:!0,children:a.run_count}),a.pid&&a.status===`running`&&(0,b.jsx)(pL,{label:`pid`,mono:!0,children:a.pid})]}),(0,b.jsxs)(mL,{title:`模型与会话`,children:[(0,b.jsx)(pL,{label:`模型`,mono:!0,children:a.model??`默认`}),(0,b.jsxs)(pL,{label:`tokens`,mono:!0,title:`输入 ${a.usage.input_tokens}(缓存命中 ${a.usage.cached_input_tokens})/ 输出 ${a.usage.output_tokens} / ${a.usage.turns} turn`,children:[vf(a.usage.input_tokens),` in · `,vf(a.usage.output_tokens),` out`]}),(0,b.jsx)(pL,{label:`沙箱`,mono:!0,children:a.sandbox}),(0,b.jsx)(pL,{label:`thread`,mono:!0,title:a.thread_id??``,children:a.thread_id??`—`}),(0,b.jsx)(pL,{label:`worker`,mono:!0,title:a.id,children:a.id}),(0,b.jsx)(pL,{label:`session`,mono:!0,children:a.session_id??`—`})]}),(0,b.jsxs)(mL,{title:`代码`,children:[(0,b.jsx)(pL,{label:`分支`,mono:!0,title:a.branch??``,children:a.branch??`—`}),(0,b.jsx)(pL,{label:`基线`,mono:!0,title:a.base_commit??``,children:a.base_commit?a.base_commit.slice(0,12):`—`}),(0,b.jsx)(pL,{label:`worktree`,mono:!0,title:a.worktree_path??``,children:a.worktree_path??`—`}),(0,b.jsx)(pL,{label:`项目`,mono:!0,title:a.project_root,children:a.project_root}),u&&(0,b.jsx)(pL,{label:a.followup_of?`接续自`:`续跑自`,mono:!0,children:(0,b.jsx)(`button`,{type:`button`,className:`text-blue`,onClick:()=>n(u),children:u})})]}),a.owned_paths.length>0&&(0,b.jsx)(mL,{title:`负责的路径`,children:a.owned_paths.map(e=>(0,b.jsx)(`div`,{className:`t-footnote mono flex min-h-[32px] items-center py-1 text-label`,title:e,children:(0,b.jsx)(`span`,{className:`truncate`,children:bf(e,a.project_root)})},e))}),a.notices&&(0,b.jsx)(hL,{text:a.notices})]}),(0,b.jsx)(Fy,{value:`report`,children:(0,b.jsx)(_L,{worker:a})}),(0,b.jsx)(Fy,{value:`changes`,children:(0,b.jsx)(vL,{worker:a})}),(0,b.jsx)(Fy,{value:`commands`,children:(0,b.jsx)(yL,{worker:a})}),(0,b.jsx)(Fy,{value:`events`,className:`h-[70vh]`,children:(0,b.jsx)(Zb,{events:s?.events??[]})}),(0,b.jsx)(Fy,{value:`prompt`,children:(0,b.jsx)(`pre`,{className:`inset t-subhead whitespace-pre-wrap break-words px-4 py-3 font-sans text-label`,children:a.prompt??`—`})})]})})]})]})]})}var SL=`csv.drawer.width`,CL=.42,wL=380,TL=.72;function EL(){try{let e=localStorage.getItem(SL),t=e?Number(e):NaN;return Number.isFinite(t)&&t>0&&t<1?t:CL}catch{return CL}}function DL(e){let t=e*window.innerWidth,n=wL/window.innerWidth;return Math.min(TL,Math.max(n,t<wL?n:e))}function OL({onChange:e}){let t=(0,y.useRef)(!1),n=(0,y.useCallback)(e=>{t.current=!0,e.target.setPointerCapture(e.pointerId),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),r=(0,y.useCallback)(n=>{t.current&&e(DL((window.innerWidth-n.clientX)/window.innerWidth))},[e]),i=(0,y.useCallback)(()=>{t.current&&(t.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``)},[]);return(0,y.useEffect)(()=>()=>i(),[i]),(0,b.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`调整抽屉宽度`,title:`拖动调整宽度,双击还原`,onPointerDown:n,onPointerMove:r,onPointerUp:i,onPointerCancel:i,onDoubleClick:()=>e(CL),className:`group relative z-10 -mx-1 h-full w-2 shrink-0 cursor-col-resize touch-none`,children:(0,b.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-separator transition-colors group-hover:w-0.5 group-hover:bg-blue group-active:w-0.5 group-active:bg-blue`})})}function kL(){let e=window.location.hash.match(/^#\/s\/([^/]+)(?:\/w\/([^/]+))?/);return{session:e?.[1]?decodeURIComponent(e[1]):null,worker:e?.[2]?decodeURIComponent(e[2]):null}}function AL(e,t){let n=e?`#/s/${encodeURIComponent(e)}${t?`/w/${encodeURIComponent(t)}`:``}`:``;window.location.hash!==n&&window.history.pushState(null,``,n||window.location.pathname)}function jL(){let[e,t]=(0,y.useState)(kL),[n,r]=(0,y.useState)(EL),i=(0,y.useCallback)(e=>{r(e);try{localStorage.setItem(`csv.drawer.width`,String(e))}catch{}},[]);(0,y.useEffect)(()=>{let e=()=>t(kL());return window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[]);let a=of(),o=a.data?.pages[0],s=a.error,c=e.session??o?.sessions[0]?.id??null,l=sf(c),u=l.data?.pages[0],d=l.error,f=(0,y.useCallback)((e,n)=>{AL(e,n),t({session:e,worker:n})},[]);(0,y.useEffect)(()=>{let t=t=>{t.key===`Escape`&&e.worker&&f(e.session,null)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,f]);let p=e.worker!==null;return(0,b.jsx)(ry,{children:(0,b.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[280px_minmax(0,1fr)] md:grid-cols-[280px_minmax(0,1fr)_auto_var(--drawer)]`,style:{"--drawer":p?`${Math.round(n*1e4)/100}%`:`0px`},children:[(0,b.jsx)(Df,{pages:a.data?.pages,hasMore:!!a.hasNextPage,loadingMore:a.isFetchingNextPage,loadMore:()=>void a.fetchNextPage(),selected:c,onSelect:e=>f(e,null)}),(0,b.jsxs)(`main`,{className:`min-h-0 min-w-0`,children:[s&&(0,b.jsxs)(`p`,{className:`t-subhead p-8 text-red`,children:[`读不到后端:`,s.message,`。确认 codex-supervisor-web 在运行。`]}),!s&&!u&&!d&&(0,b.jsx)(`p`,{className:`t-subhead p-8 text-label-2`,children:o?`选一个 session。`:`读取中…`}),d&&(0,b.jsxs)(`p`,{className:`t-subhead p-8 text-red`,children:[`读取 session 失败:`,d.message]}),u&&l.data&&(0,b.jsx)(ly,{pages:l.data.pages,hasMore:!!l.hasNextPage,loadingMore:l.isFetchingNextPage,loadMore:()=>void l.fetchNextPage(),selectedWorker:e.worker,onSelectWorker:e=>f(c,e)})]}),(0,b.jsx)(`div`,{className:p?`hidden h-full min-h-0 md:block`:`hidden`,children:p&&(0,b.jsx)(OL,{onChange:i})}),(0,b.jsx)(`div`,{className:`min-h-0 overflow-hidden ${p?``:`hidden md:block`}`,children:(0,b.jsx)(cu,{children:p&&e.worker&&(0,b.jsx)(xL,{workerId:e.worker,onClose:()=>f(c,null),onOpenWorker:e=>f(c,e)},e.worker)})})]})})}var ML=new qe({defaultOptions:{queries:{staleTime:1e3,retry:1,refetchOnWindowFocus:!0}}});(0,ct.createRoot)(document.getElementById(`root`)).render((0,b.jsx)(y.StrictMode,{children:(0,b.jsx)(C,{client:ML,children:(0,b.jsx)(jL,{})})}));