@vercel/board 0.21.1 → 0.22.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.
@@ -18,7 +18,7 @@ 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<
18
18
  * This source code is licensed under the MIT license found in the
19
19
  * LICENSE file in the root directory of this source tree.
20
20
  */
21
- var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var ee={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ee,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),p=/* @__PURE__ */ o(((e,t)=>{t.exports=f()})),m=/* @__PURE__ */ o((e=>{
21
+ var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ee(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function R(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 ee(R.bind(null,e))}var te={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,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=R,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ee,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`})),p=/* @__PURE__ */ o(((e,t)=>{t.exports=f()})),m=/* @__PURE__ */ o((e=>{
22
22
  /**
23
23
  * @license React
24
24
  * react-dom.production.js
@@ -38,15 +38,15 @@ var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.lengt
38
38
  * This source code is licensed under the MIT license found in the
39
39
  * LICENSE file in the root directory of this source tree.
40
40
  */
41
- var t=d(),n=p(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),ee=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.legacy_hidden`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.for(`react.view_transition`),B=Symbol.for(`react.recoverable`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case te:return`Activity`;case ie:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case ee:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,V=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?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}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){var t=e.memoizedState;t!==null&&(dh._currentValue=t.memoizedState,he(ye,e)),t=ge.current;var n=_p(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),dh._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
41
+ var t=d(),n=p(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),R=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),re=Symbol.for(`react.legacy_hidden`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.for(`react.view_transition`),z=Symbol.for(`react.recoverable`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case ee:return`SuspenseList`;case ne:return`Activity`;case ae:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case R:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function he(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function ge(e,t){pe++,fe[pe]=e.current,e.current=t}var _e=me(null),ve=me(null),ye=me(null),be=me(null);function xe(e,t){switch(ge(ye,t),ge(ve,e),ge(_e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=vp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}he(_e),ge(_e,e)}function Se(){he(_e),he(ve),he(ye)}function Ce(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,ge(be,e)),t=_e.current;var n=vp(t,e.type);t!==n&&(ge(ve,e),ge(_e,n))}function we(e){ve.current===e&&(he(_e),he(ve)),be.current===e&&(he(be),ph._currentValue=de)}var Te,Ee;function De(e){if(Te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||``,Ee=-1<e.stack.indexOf(`
42
42
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
43
- `+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
43
+ `+Te+e+Ee}var Oe=!1;function ke(e,t){if(!e||Oe)return``;Oe=!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(`
44
44
  `),l=s.split(`
45
45
  `);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=`
46
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);case 30:return Ee(`ViewTransition`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
46
+ `+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{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
47
47
  Error generating stack: `+e.message+`
48
- `+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Je(n),i=1<<r;t|=e[r],n&=~i}return t}function at(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ot(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function st(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function U(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&lt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function W(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ut(e,t){var n=t&-t;return n=n&42?1:dt(n),(n&(e.suspendedLanes|t))===0?n:0}function dt(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 ft(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function pt(){var e=H.p;return e===0?(e=window.event,e===void 0?32:Dh(e.type)):e}function mt(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var ht=Math.random().toString(36).slice(2),gt=`__reactFiber$`+ht,_t=`__reactProps$`+ht,vt=`__reactContainer$`+ht,yt=`__reactEvents$`+ht,bt=`__reactListeners$`+ht,xt=`__reactHandles$`+ht,St=`__reactResources$`+ht,Ct=`__reactMarker$`+ht,wt=`__reactLoad$`+ht;function Tt(e){delete e[gt],delete e[_t],delete e[bt],delete e[xt]}function Et(e){var t;if(t=e[gt])return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[gt])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[gt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:/* @__PURE__ */ new Map,hoistableScripts:/* @__PURE__ */ new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=/* @__PURE__ */ new Set,Nt={};function Pt(e,t){Ft(e,t),Ft(e+`Capture`,t)}function Ft(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.add(t[e])}var It=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]*$`),Lt={},Rt={};function zt(e){return je.call(Rt,e)?!0:je.call(Lt,e)?!1:It.test(e)?Rt[e]=!0:(Lt[e]=!0,!1)}var Bt=!1;function Vt(){var e=Bt;return Bt=!1,e}function Ht(e,t,n){if(zt(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 Ut(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 Wt(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 Gt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Kt(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 G(e){if(!e._valueTracker){var t=Kt(e)?`checked`:`value`;e._valueTracker=qt(e,t,``+e[t])}}function Jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Yt=/[\n"\\]/g;function Xt(e){return e.replace(Yt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Zt(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=``+Gt(t)):e.value!==``+Gt(t)&&(e.value=``+Gt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):$t(e,Gt(n)):o===`number`&&e.value==t?$t(e,Gt(e.value)):$t(e,Gt(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=``+Gt(s):e.removeAttribute(`name`)}function Qt(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)){G(e);return}n=n==null?``:``+Gt(n),t=t==null?n:``+Gt(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),G(e)}function $t(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function en(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=``+Gt(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 tn(e,t,n){if(t!=null&&(t=``+Gt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Gt(n)}function nn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Gt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),G(e)}function rn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var an=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 on(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||an.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function sn(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]=``,Bt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(on(e,a,r),Bt=!0)}else for(var o in t)t.hasOwnProperty(o)&&on(e,o,t[o])}function cn(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 ln=/* @__PURE__ */ 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`]]),un=/^[\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 dn(e){return un.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function fn(){}var pn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hn=null,gn=null;function _n(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Zt(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="`+Xt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[_t]||null;if(!a)throw Error(i(90));Zt(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&&Jt(r)}break a;case`textarea`:tn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&en(e,!!n.multiple,t,!1)}}}var vn=!1;function yn(e,t,n){if(vn)return e(t,n);vn=!0;try{return e(t)}finally{if(vn=!1,(hn!==null||gn!==null)&&(Hd(),hn&&(t=hn,e=gn,gn=hn=null,_n(t),e)))for(t=0;t<e.length;t++)_n(e[t])}}function bn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||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 xn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Sn=!1;if(xn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Sn=!0}}),window.addEventListener(`test`,Cn,Cn),window.removeEventListener(`test`,Cn,Cn)}catch{Sn=!1}var wn=null,Tn=null,En=null;function Dn(){if(En)return En;var e,t=Tn,n=t.length,r,i=`value`in wn?wn.value:wn.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 En=i.slice(e,1<r?1-r:void 0)}function On(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 kn(){return!0}function An(){return!1}function jn(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)?kn:An,this.isPropagationStopped=An,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=kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=jn(Mn),Pn=D({},Mn,{view:0,detail:0}),Fn=jn(Pn),In,Ln,Rn,zn=D({},Pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xn,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!==Rn&&(Rn&&e.type===`mousemove`?(In=e.screenX-Rn.screenX,Ln=e.screenY-Rn.screenY):Ln=In=0,Rn=e),In)},movementY:function(e){return`movementY`in e?e.movementY:Ln}}),Bn=jn(zn),Vn=jn(D({},zn,{dataTransfer:0})),Hn=jn(D({},Pn,{relatedTarget:0})),Un=jn(D({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Wn=jn(D({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Gn=jn(D({},Mn,{data:0})),Kn={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`},Jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jn[e])?!!t[e]:!1}function Xn(){return Yn}var Zn=jn(D({},Pn,{key:function(e){if(e.key){var t=Kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=On(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:Xn,charCode:function(e){return e.type===`keypress`?On(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?On(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Qn=jn(D({},zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$n=jn(D({},Mn,{submitter:0})),er=jn(D({},Pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xn})),tr=jn(D({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=jn(D({},zn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),rr=jn(D({},Mn,{newState:0,oldState:0,source:0})),ir=[9,13,27,32],ar=xn&&`CompositionEvent`in window,or=null;xn&&`documentMode`in document&&(or=document.documentMode);var sr=xn&&`TextEvent`in window&&!or,cr=xn&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=Dn(),En=Tn=wn=null,pr=!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 cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={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 _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){hn?gn?gn.push(r):gn=[r]:hn=r,t=$f(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){Gf(e,0)}function Sr(e){if(Jt(Ot(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(xn){var Tr;if(xn){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,mn(e)),yn(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function Lr(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 Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(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=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lr(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=Lr(e.document)}return t}function Hr(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 Ur=xn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Lr(r)||(r=Wr,`selectionStart`in r&&Hr(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}),Kr&&Ir(Kr,r)||(Kr=r,r=$f(Gr,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};xn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`transitionend`),si=/* @__PURE__ */ new Map,ci=`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(` `);ci.push(`scrollEnd`);function li(e,t){si.set(e,t),Pt(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Cd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=jd;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 pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=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)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[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&&Si(n,i,a)}}function yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(e,null,null,t),Ci(e)}function Si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ci(e){if(50<Md)throw Md=0,Nd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function Ti(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 Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(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 ki(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 Ai(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case te:return e=Ei(31,n,t,a),e.elementType=te,e.lanes=o,e;case j:return ji(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ei(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Ei(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Ei(19,n,t,a),e.elementType=R,e.lanes=o,e;case ne:case ie:return e=a|32,e=Ei(30,n,t,e),e.elementType=ie,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case ee:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=/* @__PURE__ */ new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Li=[],Ri=0,zi=null,Bi=0,Vi=[],Hi=0,Ui=null,Wi=1,Gi=``;function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=zi,zi=e,Bi=t}function qi(e,t,n){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Ui=e;var r=Wi;e=Gi;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Wi=1<<32-Je(t)+i|n<<i|r,Gi=a+e}else Wi=1<<a|n<<i|r,Gi=e}function Ji(e){e.return!==null&&(Ki(e,1),qi(e,1,0))}function Yi(e){for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null;for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Gi=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null}function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Wi=t.id,Gi=t.overflow,Ui=e}var Zi=null,Qi=null,$i=!1,ea=null,ta=!1,na=Error(i(519));function ra(e){throw la(Ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),na}function ia(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[_t]=r,n){case`dialog`:Kf(`cancel`,t),Kf(`close`,t);break;case`iframe`:case`object`:case`embed`:Kf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Uf.length;n++)Kf(Uf[n],t);break;case`source`:Kf(`error`,t);break;case`img`:case`image`:case`link`:Kf(`error`,t),Kf(`load`,t);break;case`details`:Kf(`toggle`,t);break;case`input`:Kf(`invalid`,t),Qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Kf(`invalid`,t);break;case`textarea`:Kf(`invalid`,t),nn(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||ap(t.textContent,n)?(r.popover!=null&&(Kf(`beforetoggle`,t),Kf(`toggle`,t)),r.onScroll!=null&&Kf(`scroll`,t),r.onScrollEnd!=null&&Kf(`scrollend`,t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||ra(e,!0)}function aa(e){for(Zi=e.return;Zi;)switch(Zi.tag){case 5:case 31:case 13:ta=!1;return;case 27:case 3:ta=!0;return;default:Zi=Zi.return}}function oa(e){if(e!==Zi)return!1;if(!$i)return aa(e),$i=!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&&Qi&&ra(e),aa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=_m(e)}else t===27?(t=Qi,Op(e.type)?(e=gm,gm=null,Qi=e):Qi=t):Qi=Zi?hm(e.stateNode.nextSibling):null;return!0}function sa(){Qi=Zi=null,$i=!1}function ca(){var e=ea;return e!==null&&(hd===null?hd=e:hd.push.apply(hd,e),ea=null),e}function la(e){ea===null?ea=[e]:ea.push(e)}var ua=pe(null),da=null,fa=null;function pa(e,t,n){he(ua,t._currentValue),t._currentValue=n}function ma(e){e._currentValue=ua.current,me(ua)}function ha(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 ga(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),ha(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),ha(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),ha(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 _a(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;Fr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[dh]:e.push(dh))}a=a.return}return e!==null&&ga(t,e,n,r),t.flags|=262144,e!==null}function va(e){for(e=e.firstContext;e!==null;){if(!Fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ya(e){da=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ba(e){return Sa(da,e)}function xa(e,t){return da===null&&ya(e),Sa(e,t)}function Sa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fa===null){if(e===null)throw Error(i(308));fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fa=fa.next=t;return n}var Ca=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()})}},wa=t.unstable_scheduleCallback,Ta=t.unstable_NormalPriority,Ea={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Da(){return{controller:new Ca,data:/* @__PURE__ */ new Map,refCount:0}}function Oa(e){e.refCount--,e.refCount===0&&wa(Ta,function(){e.controller.abort()})}function ka(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 Aa=null;function ja(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ma=null,Na=0,Pa=0,Fa=null;function Ia(e,t){if(Ma===null){var n=Ma=[];Na=0,Pa=Rf(),Fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Na++,t.then(La,La),t}function La(){if(--Na===0&&(Aa=null,Ma!==null)){Fa!==null&&(Fa.status=`fulfilled`);var e=Ma;Ma=null,Pa=0,Fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ra(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 za=V.S;V.S=function(e,t){if(vd=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&Ia(e,t),Aa!==null)for(var n=wf;n!==null;)ka(n,Aa),n=n.next;if(n=e.types,n!==null){for(var r=wf;r!==null;)ka(r,n),r=r.next;if(Pa!==0){r=Aa,r===null&&(r=Aa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}za!==null&&za(e,t)};var Ba=pe(null);function Va(){var e=Ba.current;return e===null?$u.pooledCache:e}function Ha(e,t){t===null?he(Ba,Ba.current):he(Ba,t.pool)}function Ua(){var e=Va();return e===null?null:{parent:Ea._currentValue,pool:e}}var Wa=Error(i(460)),Ga=Error(i(474)),Ka=Error(i(542)),qa={then:function(){}};function Ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(fn,fn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(fn,fn);else{if(e=$u,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,$a(e),e}throw Za=t,Wa}}function Xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Za=e,Wa):e}}var Za=null;function Qa(){if(Za===null)throw Error(i(459));var e=Za;return Za=null,e}function $a(e){if(e===Wa||e===Ka)throw Error(i(483))}var eo=null,to=0;function no(e){var t=to;return to+=1,eo===null&&(eo=[]),Ya(eo,e,t)}function ro(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function io(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 ao(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=/* @__PURE__ */ 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=Oi(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=Mi(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),ro(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ee&&Xa(i)===t.type)?(t=a(t,n.props),ro(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),ro(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=Pi(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=ji(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=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ai(t.type,t.key,t.props,null,e.mode,n),ro(n,t),n.return=e,n;case A:return t=Pi(t,e.mode,n),t.return=e,t;case ee:return t=Xa(t),f(e,t,n)}if(le(t)||oe(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,no(t),n);if(t.$$typeof===F)return f(e,xa(e,t),n);io(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ee:return n=Xa(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,no(n),r);if(n.$$typeof===F)return p(e,t,xa(e,n),r);io(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ee:return r=Xa(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,no(r),i);if(r.$$typeof===F)return m(e,t,n,xa(t,r),i);io(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),$i&&Ki(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 $i&&Ki(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)}),$i&&Ki(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),$i&&Ki(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 $i&&Ki(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)}),$i&&Ki(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),ro(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ee&&Xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ro(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=ji(o.props.children,e.mode,c,o.key),ro(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),ro(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=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case ee:return o=Xa(o),_(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(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,no(o),c);if(o.$$typeof===F)return _(e,r,xa(e,o),c);io(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=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{to=0;var i=_(e,t,n,r);return eo=null,i}catch(t){if(t===Wa||t===Ka)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var oo=ao(!0),so=ao(!1),co=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Qu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ci(e),Si(e,null,n),t}return yi(e,r,t,n),Ci(e)}function mo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,W(e,n)}}function ho(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var go=!1;function _o(){if(go){var e=Fa;if(e!==null)throw e}}function vo(e,t,n,r){go=!1;var i=e.updateQueue;co=!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?(td&f)===f:(r&f)===f){f!==0&&f===Pa&&(go=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:co=!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),ld|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=pe(null),So=pe(0);function Co(e,t){e=sd,he(So,e),he(xo,t),sd=e|t.baseLanes}function wo(){he(So,sd),he(xo,xo.current)}function To(){sd=So.current,me(xo),me(So)}var Eo=pe(null),Do=null;function Oo(e){var t=e.alternate;he(No,No.current&1),he(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){he(No,No.current),he(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(he(No,No.current),he(Eo,e),Do===null&&(Do=e)):jo()}function jo(){he(No,No.current),he(Eo,Eo.current)}function Mo(e){me(Eo),Do===e&&(Do=null),me(No)}var No=pe(0);function Po(e,t){he(Eo,Eo.current),he(No,t)}function Fo(e){me(No),me(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||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 Lo=0,Ro=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(i(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return Lo=a,Ro=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){V.H=fc;var t=zo!==null&&zo.next!==null;if(Lo=0,Bo=zo=Ro=null,Vo=!1,Go=0,Ko=null,t)throw Error(i(300));e===null||Ac||(e=e.dependencies,e!==null&&va(e)&&(Ac=!0))}function Qo(e,t,n,r){Ro=e;var a=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=a)throw Error(i(301));if(a+=1,Bo=zo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}V.H=hc,o=t(n,r)}while(Ho);return o}function $o(){var e=V.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(Ro.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Lo=0,Bo=zo=Ro=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=Ro.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?Ro.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw Ro.alternate===null?Error(i(467)):Error(i(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Ya(Ko,e,t),t=Ro,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===B)return;if(e.$$typeof===F)return ba(e)}throw Error(i(438,String(e)))}function cs(e){var t=null,n=Ro.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ro.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),Ro.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=re;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Lo&f)===f:(td&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===Pa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Ro.lanes|=p,ld|=p;f=u.action,Uo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Ro.lanes|=f,ld|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Fr(o,e.memoizedState)&&(Ac=!0,d&&(n=Fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Fr(o,t.memoizedState)||(Ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ps(e,t,n){var r=Ro,a=is(),o=$i;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Fr((zo||a).memoizedState,n);if(s&&(a.memoizedState=n,Ac=!0),a=a.queue,Rs(gs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,$u===null)throw Error(i(349));o||Lo&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ro.updateQueue,t===null?(t=as(),Ro.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function vs(e){var t=xi(e,2);t!==null&&Ld(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,a){if(lc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};V.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ss(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=V.T,o={};o.types=a===null?null:a.types,V.T=o;try{var s=n(i,r),c=V.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),V.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if($i){var n=$u.formState;if(n!==null){a:{var r=Ro;if($i){if(Qi){b:{for(var i=Qi,a=ta;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){Qi=hm(i.nextSibling),r=i.data===`F!`;break a}}ra(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,Ro,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,Ro,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,Ro,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Wa?Ka:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ro.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ro.updateQueue,t===null&&(t=as(),Ro.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();Ro.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(Ro.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){Ro.flags|=4;var t=Ro.updateQueue;if(t===null)t=as(),Ro.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if(Qu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Lo&1073741824&&!(td&261930)?e.memoizedState=t:(e.memoizedState=n,e=Fd(),Ro.lanes|=e,ld|=e,n)}function Ys(e,t,n,r){return Fr(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(td&261930)?(Ac=!0,e.memoizedState=n):(e=Fd(),Ro.lanes|=e,ld|=e,t):(e=Js(e,n,r),Fr(e,t)||(Ac=!0),e)}function Xs(e,t,n,r,i){var a=H.p;H.p=a!==0&&8>a?a:8;var o=V.T,s={};s.types=o===null?null:o.types,V.T=s,cc(e,!1,t,n);try{var c=i(),l=V.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Ra(c,r),Pd(e)):sc(e,t,r,Pd(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Pd())}finally{H.p=a,o!==null&&s.types!==null&&(o.types=s.types),V.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=$s(e).queue;Xs(e,a,t,ue,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Pd())}function tc(){return ba(dh)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pd();e=fo(n);var r=po(t,e,n);r!==null&&(Ld(r,t,n),mo(r,t,n)),t={cache:Da()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Pd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=bi(e,t,n,r),n!==null&&(Ld(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Pd())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Fr(s,o))return yi(e,t,i,0),$u===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return Ld(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Rf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=bi(e,n,r,2),t!==null&&Ld(t,e,2)}function lc(e){var t=e.alternate;return e===Ro||t!==null&&t===Ro}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,W(e,n)}}var fc={readContext:ba,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:ba,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:ba,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ac.bind(null,Ro,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,Ro,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,Ro,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ro,a=rs();if($i){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),$u===null)throw Error(i(349));td&127||ms(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ls(gs.bind(null,r,o,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,o,n,t),null),n},useId:function(){var e=rs(),t=$u.identifierPrefix;if($i){var n=Gi,r=Wi;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,Ro,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,Ro)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(Qu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:ba,use:ss,useCallback:Ks,useContext:ba,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:ba,use:ss,useCallback:Ks,useContext:ba,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return zo===null?Js(n,e,t):Ys(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=fo(r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Ld(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Ld(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pd(),r=fo(n);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,n),t!==null&&(Ld(t,e,n),mo(t,e,n))}};function vc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ir(n,r)||!Ir(i,a):!0}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function bc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){mi(e)}function Sc(e){console.error(e)}function Cc(e){mi(e)}function K(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function wc(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 Tc(e,t,n){return n=fo(n),n.tag=3,n.payload={element:null},n.callback=function(){K(e,t)},n}function Ec(e){return e=fo(e),e.tag=3,e}function Dc(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(){wc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){wc(t,n,r),typeof i!=`function`&&(xd===null?xd=/* @__PURE__ */ new Set([this]):xd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Oc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&_a(t,n,a,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Yd():n.alternate===null&&cd===0&&(cd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=/* @__PURE__ */ new Set([r]):t.add(r),vf(e,r,a)),!1;case 22:return n.flags|=65536,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */ new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=/* @__PURE__ */ new Set([r]):n.add(r)),vf(e,r,a)),!1}throw Error(i(435,n.tag))}return vf(e,r,a),Yd(),!1}if($i)return t=Eo.current,t===null?(r!==na&&(t=Error(i(423),{cause:r}),la(Ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ii(r,n),a=Tc(e.stateNode,r,a),ho(e,a),cd!==4&&(cd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==na&&(e=Error(i(422),{cause:r}),la(Ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ii(o,n),md===null?md=[o]:md.push(o),cd!==4&&(cd=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Tc(n.stateNode,r,e),ho(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(xd===null||!xd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ec(a),Dc(a,e,n,r),ho(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var kc=Error(i(461)),Ac=!1;function jc(e,t,n,r){t.child=e===null?so(t,null,n,r):oo(t,e.child,n,r)}function Mc(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 ya(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!Ac?(ts(e,t,i),ol(e,t,i)):($i&&s&&Ji(t),t.flags|=1,jc(e,t,r,i),t.child)}function Nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Pc(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!sl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return ol(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref){if(Ac=!1,t.pendingProps=r=a,sl(e,i))e.flags&131072&&(Ac=!0);else return t.lanes=e.lanes,ol(e,t,i)}}return Hc(e,t,n,r,i)}function Fc(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 Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ha(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ha(t,null),wo(),jo()):(Ha(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return jc(e,t,i,n),t.child}function Ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lc(e,t,n,r,i){var a=Va();return a=a===null?null:{parent:Ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ha(t,null),wo(),Ao(t),e!==null&&_a(e,t,r,!0),t.childLanes=i,null}function Rc(e,t){return t=Zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zc(e,t,n){return oo(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if($i){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ic(null,e);if(ko(t),(e=Qi)?(e=dm(e,ta),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw ra(t);return t.lanes=536870912,null}return Rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ac||_a(e,t,n,!1),a=(n&e.childLanes)!==0,Ac||a){if(xo.current===null){if(r=$u,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),Ld(r,e,s),kc;Yd()}t=zc(e,t,n)}else e=o.treeContext,Qi=hm(s.nextSibling),Zi=t,$i=!0,ea=null,ta=!1,e!==null&&Xi(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Hc(e,t,n,r,i){return ya(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!Ac?(ts(e,t,i),ol(e,t,i)):($i&&r&&Ji(t),t.flags|=1,jc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return ya(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!Ac?(ts(e,t,a),ol(e,t,a)):($i&&r&&Ji(t),t.flags|=1,jc(e,t,n,a),t.child)}function Wc(e,t,n,r,i){if(ya(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=ba(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},lo(t),o=n.contextType,a.context=typeof o==`object`&&o?ba(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_c.enqueueReplaceState(a,a.state,null),vo(t,r,a,i),_o(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=ba(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&yc(t,a,r,o),co=!1;var f=t.memoizedState;a.state=f,vo(t,r,a,i),_o(),l=t.memoizedState,s||f!==l||co?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=co||vc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,uo(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=ba(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&yc(t,a,r,c),co=!1,f=t.memoizedState,a.state=f,vo(t,r,a,i),_o();var p=t.memoizedState;o!==d||f!==p||co||e!==null&&e.dependencies!==null&&va(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=co||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&va(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,Vc(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=oo(t,e.child,null,i),t.child=oo(t,null,n,i)):jc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ol(e,t,i),e}function Gc(e,t,n,r){return sa(),t.flags|=256,jc(e,t,n,r),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Ua()}}function Jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=fd),e}function Yc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if($i){if(i?Oo(t):jo(),(e=Qi)?(e=dm(e,ta),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw ra(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Zc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=qc(n),r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(null,r)):(Oo(t),Xc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return $c(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ic(null,r),r=t.child,i=e.child.memoizedState,i===null?i=qc(n):(a=i.cachePool,a===null?a=Ua():(s=Ea._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=Oi(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 Xc(e,t){return t=Zc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return oo(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $c(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,Qc(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Zc({mode:`visible`,children:a.children},s),o=ji(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,oo(t,e.child,null,c),a=t.child,a.memoizedState=qc(c),a.childLanes=Jc(e,r,c),t.memoizedState=Kc,Ic(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(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,la({value:a,source:null,stack:null})),Qc(e,t,c)}if(Ac||_a(e,t,c,!1),r=(c&e.childLanes)!==0,Ac||r){if(xo.current!==null)return Qc(e,t,c);if(r=$u,r!==null&&(a=ut(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,xi(e,a),Ld(r,e,a),kc;return fm(o)||Yd(),Qc(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Qi=hm(o.nextSibling),Zi=t,$i=!0,ea=null,ta=!1,e!==null&&Xi(t,e),t=Xc(t,a.children),t.flags|=134221824,t)}function el(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ha(e.return,t,n)}function tl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function nl(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 rl(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 il(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(rl(e),jc(e,t,r,n),rl(e)):jc(e,t,r,n),r=$i?Bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&el(e,n,t);else if(e.tag===19)el(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=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,rl(t)),nl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nl(t,!0,n,null,a,r);break;case`together`:nl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nl(t,!1,i,n,a,r)}return t.child}function al(e,t,n){var r=t.pendingProps;return pa(t,t.type,r.value),jc(e,t,r.children,n),t.child}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ld|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(_a(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=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&va(e)))}function cl(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),pa(t,Ea,e.memoizedState.cache),sa();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=_a(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Yc(e,t,n):(Oo(t),e=ol(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return il(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(_a(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return il(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Fc(e,t,n,t.pendingProps);case 24:pa(t,Ea,e.memoizedState.cache)}return ol(e,t,n)}function q(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ac=!0;else{if(!sl(e,n)&&!(t.flags&128))return Ac=!1,cl(e,t,n);Ac=!!(e.flags&131072)}}else Ac=!1,$i&&t.flags&1048576&&qi(t,Bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Xa(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=bc(e,r),t.tag=1,t=Wc(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Mc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Nc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=al(null,t,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Wc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,uo(e,t),vo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,pa(t,Ea,r),r!==o.cache&&ga(t,[Ea],n,!0),_o(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Gc(e,t,r,n);break a}if(r!==a){a=Ii(Error(i(424)),t),la(a),t=Gc(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(Qi=hm(e.firstChild),Zi=t,$i=!0,ea=null,ta=!0,n=so(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(sa(),r===a){t=ol(e,t,n);break a}jc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:$i||(t.stateNode=vp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&$i&&(r=t.stateNode=xm(t.type,t.pendingProps,ve.current),Zi=t,ta=!0,a=Qi,Op(t.type)?(gm=a,Qi=hm(r.firstChild)):Qi=a),jc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$i&&((a=r=Qi)&&(r=lm(r,t.type,t.pendingProps,ta),r===null?a=!1:(t.stateNode=r,Zi=t,Qi=hm(r.firstChild),ta=!1,a=!0)),a||ra(t)),Se(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=Xo(e,t,$o,null,null,n),dh._currentValue=a),Vc(e,t),jc(e,t,r,n),t.child;case 6:return e===null&&$i&&((e=n=Qi)&&(n=um(n,t.pendingProps,ta),n===null?e=!1:(t.stateNode=n,Zi=t,Qi=null,e=!0)),e||ra(t)),null;case 13:return Yc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):jc(e,t,r,n),t.child;case 11:return Mc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),jc(e,t,r,n),t.child;case 8:return jc(e,t,t.pendingProps.children,n),t.child;case 12:return jc(e,t,t.pendingProps.children,n),t.child;case 10:return al(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ya(t),a=ba(a),r=r(a),t.flags|=1,jc(e,t,r,n),t.child;case 14:return Nc(e,t,t.type,t.pendingProps,n);case 15:return Pc(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return Bc(e,t,n);case 22:return Fc(e,t,n,t.pendingProps);case 24:return ya(t),r=ba(Ea),e===null?(a=Va(),a===null&&(a=$u,o=Da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},lo(t),pa(t,Ea,a)):((e.lanes&n)!==0&&(uo(e,t),vo(t,null,null,n),_o()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,pa(t,Ea,r),r!==a.cache&&ga(t,[Ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),pa(t,Ea,r))),jc(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:$i&&Ji(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),jc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ll(e){e.flags|=4}function ul(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(Kd())e.flags|=8192;else throw Za=qa,Ga}}else e.flags&=-16777217}function dl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(Kd())e.flags|=8192;else throw Za=qa,Ga}}function fl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ot(),e.lanes|=t,pd|=t)}function pl(e,t){if(!$i)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 ml(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 hl(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ml(t),null;case 1:return ml(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ma(Ea),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(oa(t)?ll(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ca())),ml(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ll(t),o===null?(ml(t),ul(t,a,null,r,n)):(ml(t),dl(t,o))):o?o===e.memoizedState?(ml(t),t.flags&=-16777217):(ll(t),ml(t),dl(t,o)):(e=e.memoizedProps,e!==r&&ll(t),ml(t),ul(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ml(t),t.subtreeFlags&=-33554433,null}e=ge.current,oa(t)?ia(t,e):(e=xm(a,r,n),t.stateNode=e,ll(t))}return ml(t),t.subtreeFlags&=-33554433,null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ml(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,oa(t))ia(t,o);else{var s=hp(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[gt]=t,o[_t]=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(cp(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&&ll(t)}}return ml(t),t.subtreeFlags&=-33554433,ul(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,oa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ap(e.nodeValue,n)),e||ra(t,!0)}else e=hp(e).createTextNode(r),e[gt]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=oa(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[gt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return ml(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=oa(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[gt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),a=!1}else a=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fl(t,t.updateQueue),ml(t),null);case 4:return xe(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,ml(t),null;case 10:return ma(t.type),ml(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return ml(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)pl(r,!1);else{if(cd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,pl(r,!1),e=o.updateQueue,t.updateQueue=e,fl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return Po(t,No.current&1|2),$i&&Ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>yd&&(t.flags|=128,a=!0,pl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,fl(t,e),pl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!$i)return ml(t),null}else 2*Ie()-r.renderingStartTime>yd&&n!==536870912&&(t.flags|=128,a=!0,pl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,o=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||$i?Po(t,o):(n=o,he(Eo,t),he(No,n),Do===null&&(Do=t)),$i&&Ki(t,r.treeForkCount),e}return ml(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ml(t),t.subtreeFlags&6&&(t.flags|=8192)):ml(t),n=t.updateQueue,n!==null&&fl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(Ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ma(Ea),ml(t),null;case 25:return null;case 30:return t.flags|=33554432,ml(t),null}throw Error(i(156,t.tag))}function gl(e,t){switch(Yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ma(Ea),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(Mo(t),t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return xe(),null;case 10:return ma(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&me(Ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ma(Ea),null;case 25:return null;default:return null}}function _l(e,t){switch(Yi(t),t.tag){case 3:ma(Ea),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ma(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&me(Ba);break;case 24:ma(Ea)}}function vl(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){_f(t,t.return,e)}}function yl(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){_f(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){_f(t,t.return,e)}}function bl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){_f(e,e.return,t)}}}function xl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){_f(e,t,n)}}function Sl(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=di(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);m(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){_f(e,t,n)}}function Cl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){_f(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){_f(e,t,n)}else n.current=null}}function wl(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 Tl(e){for(var t=e.return;t!==null&&(Ol(t)&&om(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function El(e){for(var t=e.return;t!==null&&(Ol(t)&&sm(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function Dl(e){return e.tag===5||e.tag===3||e.tag===27}function Ol(e){return e&&e.tag===7&&e.stateNode!==null}function kl(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){_f(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[_t]=t}catch(t){_f(e,e.return,t)}}function jl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Ml(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||jl(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 Nl(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=fn)),wl(e,r),Bt=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),wl(e,r),Bt=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[gt]=e,t[_t]=n}catch(t){_f(e,e.return,t)}}var Il=!1,Ll=null;function Rl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Il=!0)}var zl=null;function Bl(){var e=zl;return zl=null,e}var Vl=0;function Hl(e,t,n,r,i){return Vl=0,Ul(e.child,t,n,r,i)}function Ul(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);Il=!0,jp(o,Vl===0?t:t+`_`+Vl,n),Vl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Ul(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Wl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Wl(e.child,t)),e=e.sibling}function Gl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Gl(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=pi(t.default,t.share),t!==`none`&&(Hl(e,n,t,null,!1)||Wl(e.child,!1))}e=e.sibling}}function Kl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Gl(e):Hl(e,i,a,null,!1)?(Gl(e),n.paired||t||Id(e,r.onEnter)):Wl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e,t),e=e.sibling;else Gl(e)}function ql(e){if(Ll!==null&&Ll.size!==0){var t=Ll;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=pi(n.default,n.share);if(a!==`none`&&(Hl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Id(e,n.onShare)):Wl(e.child,!1)),t.delete(r),t.size===0)break}}}ql(e)}e=e.sibling}}}function Jl(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Ll===null?void 0:Ll.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Hl(e,n,i,null,!1)?r===void 0?Id(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ll.delete(n),Id(e,t.onShare)):Wl(e.child,!1)),Ll!==null&&ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else Ll!==null&&ql(e)}function Yl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&Hl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Yl(e);e=e.sibling}}function Xl(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,Wl(e.child,!1))}Xl(e)}e=e.sibling}}function Zl(e){if(e.tag===30)e.stateNode.paired=null,Wl(e.child,!1),Xl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Xl(e)}function Ql(e){for(e=e.child;e!==null;)e.tag===30?Wl(e.child,!1):e.subtreeFlags&33554432&&Ql(e),e=e.sibling}function $l(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Vl<a.length){var l=a[Vl],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,Vl===0?n:n+`_`+Vl,i),s&&e.flags&4||(zl===null&&(zl=[]),zl.push(c,Vl===0?r:r+`_`+Vl,t.memoizedProps)),Vl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:$l(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function eu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(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;Vl=0,i=$l(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Id(e,n.onUpdate))}else e.subtreeFlags&33554432&&eu(e,t);e=e.sibling}}var tu=!1,nu=!1,ru=!1,iu=!1,au=typeof WeakSet==`function`?WeakSet:Set,ou=null,su=!1,cu=!1,lu=!1,uu=!1;function du(e,t,n){if(e=e.containerInfo,pp=bh,e=Vr(e),Hr(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},bh=!1,n=(n&335544064)===n,ou=t,t=n?9270:1024;ou!==null;){if(e=ou,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Jl(r[a]);if(e.alternate===null&&e.flags&2)n&&Rl(e),fu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Jl(r),fu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Rl(e),fu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ou=r):(n&&Yl(e),fu(n))}}Ll=null}function fu(e){for(;ou!==null;){var t=ou,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){_f(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=di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=pi(a.default,a.update),a!==`none`&&Hl(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,ou=r;break}ou=t.return}}function pu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Nu(e,n),r&4&&vl(5,n);break;case 1:if(Nu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){_f(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){_f(n,n.return,e)}}}r&64&&bl(n),r&512&&Sl(n,n.return);break;case 3:if(Nu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{bo(e,t)}catch(e){_f(n,n.return,e)}}break;case 27:t===null&&r&4&&Fl(n);case 26:case 5:Nu(e,n),t===null&&r&4&&kl(n),r&512&&Sl(n,n.return);break;case 12:Nu(e,n);break;case 31:Nu(e,n),r&4&&Su(e,n);break;case 13:Nu(e,n),r&4&&Cu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||tu,!r){var a=t!==null&&t.memoizedState!==null||nu;t=tu,i=nu,tu=r,(nu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Fu(e,n,r)):Nu(e,n),tu=t,nu=i}break;case 30:Nu(e,n),r&512&&Sl(n,n.return);break;case 7:r&512&&Sl(n,n.return);default:Nu(e,n)}}function mu(e,t){for(e=e.child;e!==null;)hu(e,t),e=e.sibling}function hu(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){_f(e,e.return,t)}gu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){_f(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){_f(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&mu(e,t);break;default:mu(e,t)}}function gu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:hu(n,r);break a;case 22:n.memoizedState===null&&gu(n,r);break a;default:gu(n,r)}}e=e.sibling}}function _u(e){var t=e.alternate;t!==null&&(e.alternate=null,_u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(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 vu=null,yu=!1;function bu(e,t,n){for(n=n.child;n!==null;)xu(e,t,n),n=n.sibling}function xu(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:nu||Cl(n,t),bu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!nu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nu||Cl(n,t),El(n);var r=vu,i=yu;Op(n.type)&&(vu=n.stateNode,yu=!1),bu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),vu=r,yu=i;break;case 5:nu||Cl(n,t),El(n);case 6:if(n.tag===6&&El(n),r=vu,i=yu,vu=null,bu(e,t,n),vu=r,yu=i,vu!==null){if(yu)try{(vu.nodeType===9?vu.body:vu.nodeName===`HTML`?vu.ownerDocument.body:vu).removeChild(n.stateNode),Bt=!0}catch(e){_f(n,t,e)}else try{vu.removeChild(n.stateNode),Bt=!0}catch(e){_f(n,t,e)}}break;case 18:vu!==null&&(yu?(e=vu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Kh(e)):kp(vu,n.stateNode));break;case 4:r=vu,i=yu,vu=n.stateNode.containerInfo,yu=!0,bu(e,t,n),vu=r,yu=i;break;case 0:case 11:case 14:case 15:yl(2,n,t),nu||yl(4,n,t),bu(e,t,n);break;case 1:nu||(Cl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&xl(n,t,r)),bu(e,t,n);break;case 21:bu(e,t,n);break;case 22:nu=(r=nu)||n.memoizedState!==null,bu(e,t,n),nu=r;break;case 30:Cl(n,t),bu(e,t,n);break;case 7:nu||Cl(n,t),bu(e,t,n);break;default:bu(e,t,n)}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kh(e)}catch(e){_f(t,t.return,e)}}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kh(e)}catch(e){_f(t,t.return,e)}}function wu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new au),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new au),t;default:throw Error(i(435,e.tag))}}function Tu(e,t){var n=wu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Sf.bind(null,e,t);t.then(r,r)}})}function Eu(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)){vu=l.stateNode,yu=!1;break a}break;case 5:vu=l.stateNode,yu=!1;break a;case 3:case 4:vu=l.stateNode.containerInfo,yu=!0;break a}l=l.return}if(vu===null)throw Error(i(160));xu(s,c,o),vu=null,yu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ou(t,e,n),t=t.sibling}var Du=null;function Ou(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}Eu(t,e,n),ku(e),a&4&&(yl(3,e,e.return),vl(3,e),yl(5,e,e.return));break;case 1:Eu(t,e,n),ku(e),a&512&&(nu||r===null||Cl(r,r.return)),a&64&&tu&&(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=Du,Eu(t,e,n),ku(e),a&512&&(nu||r===null||Cl(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(tu)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[Ct]||r[gt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),cp(r,t,n),r[gt]=e,At(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),cp(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),cp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[gt]=e,At(r),t=r}e.stateNode=t}}else tu||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Al(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||nu||t.parentNode.removeChild(t)):a.count--,n===null?tu||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:Eu(t,e,n),ku(e),a&512&&(nu||r===null||Cl(r,r.return)),r!==null&&a&4&&Al(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ru,ru=!1,Eu(t,e,n),ru=o,ku(e),a&512&&(nu||r===null||Cl(r,r.return)),e.flags&32){t=e.stateNode;try{rn(t,``),Bt=!0}catch(t){_f(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Al(e,t,r===null?t:r.memoizedProps)),a&1024&&(iu=!0);break;case 6:if(Eu(t,e,n),ku(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Bt=!0}catch(t){_f(e,e.return,t)}}break;case 3:if(Bt=!1,Xm=null,o=Du,Du=Em(t.containerInfo),Eu(t,e,n),Du=o,ku(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Kh(t.containerInfo)}catch(t){_f(e,e.return,t)}iu&&(iu=!1,Au(e)),Bt=!1;break;case 4:a=ru,ru=tu,r=Vt(),o=Du,Du=Em(e.stateNode.containerInfo),Eu(t,e,n),ku(e),Du=o,Bt&&cu&&(lu=!0),Bt=r,ru=a;break;case 12:Eu(t,e,n),ku(e);break;case 31:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 13:Eu(t,e,n),ku(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(_d=Ie()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=tu,l=nu,u=ru;tu=c||o,ru=u||o,nu=l||s,Eu(t,e,n),nu=l,ru=u,tu=c,ku(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||tu||nu||(t=s||nu,n=tu,r=nu,tu=o||tu,nu=t,Pu(e,2),tu=n,nu=r),!o&&ru||mu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Tu(e,n))));break;case 19:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 30:a&512&&(nu||r===null||Cl(r,r.return)),a=Vt(),o=cu,s=(n&335544064)===n,c=e.memoizedProps,cu=s&&pi(c.default,c.update)!==`none`,Eu(t,e,n),ku(e),s&&r!==null&&Bt&&(e.flags|=4),cu=o,Bt=a;break;case 21:break;case 7:a&512&&(nu||r===null||Cl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Eu(t,e,n),ku(e)}}function ku(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(jl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ol(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Dl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Pl(e,Ml(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(rn(l,``),n.flags&=-33),Pl(e,Ml(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Nl(e,Ml(e),u,s);break;default:throw Error(i(161))}}catch(t){_f(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Au(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Au(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,bh=!0,t.reset(),bh=!1),e=e.sibling}}function ju(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Mu(t,e),t=t.sibling;else eu(t,!1)}function Mu(e,t){var n=e.alternate;if(n===null)Kl(e,!1);else switch(e.tag){case 3:if(uu=su=!1,Bl(),ju(t,e),!su&&!lu){if(e=zl,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`})),uu=!0}zl=null;break;case 5:ju(t,e);break;case 4:r=su,su=!1,ju(t,e),su&&(lu=!0),su=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ju(t,e):Kl(e,!1));break;case 30:r=su,i=Bl(),su=!1,ju(t,e),su&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Vl=0,t=$l(e,n,t,o,s,a,!0),Vl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Id(e,e.memoizedProps.onUpdate),zl=i):i!==null&&(i.push.apply(i,zl),zl=i),su=e.flags&32?!0:r;break;default:ju(t,e)}}function Nu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pu(e,t.alternate,t),t=t.sibling}function Pu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:yl(4,n,n.return),Pu(n,r);break;case 1:Cl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&xl(n,n.return,i),Pu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:Cl(n,n.return),n.tag!==5&&n.tag!==27||El(n),Pu(n,r);break;case 6:El(n);break;case 26:Cl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||nu||i.parentNode.removeChild(i),Pu(n,r);break;case 22:n.memoizedState===null&&Pu(n,r);break;case 30:Cl(n,n.return),Pu(n,r);break;case 7:Cl(n,n.return);default:Pu(n,r)}e=e.sibling}}function Fu(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:Fu(i,a,n),vl(4,a);break;case 1:if(Fu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){_f(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)yo(l[i],c)}catch(e){_f(r,r.return,e)}}s&&o&64&&bl(a),Sl(a,a.return);break;case 27:n&2&&Fl(a);case 5:a.tag!==5&&a.tag!==27||Tl(a),Fu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 6:Tl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||tu||Qm(Em(c.ownerDocument),a.type,c),Fu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 12:Fu(i,a,n);break;case 31:Fu(i,a,n),s&&o&4&&Su(i,a);break;case 13:Fu(i,a,n),s&&o&4&&Cu(i,a);break;case 22:a.memoizedState===null&&Fu(i,a,n),Sl(a,a.return);break;case 30:Fu(i,a,n),Sl(a,a.return);break;case 7:Sl(a,a.return);default:Fu(i,a,n)}t=t.sibling}}function Iu(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&&Oa(n))}function Lu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oa(e))}function Ru(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)zu(e,t,n,r),t=t.sibling;else i&&Ql(t)}function zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Zl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ru(e,t,n,r),a&2048&&vl(9,t);break;case 1:Ru(e,t,n,r);break;case 3:Ru(e,t,n,r),i&&uu&&(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&&Oa(a)));break;case 12:if(a&2048){Ru(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){_f(t,t.return,e)}}else Ru(e,t,n,r);break;case 31:Ru(e,t,n,r);break;case 13:Ru(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&&Zl(t),o._visibility&2?Ru(e,t,n,r):(o._visibility|=2,Bu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Zl(s),o._visibility&2?Ru(e,t,n,r):Vu(e,t)),a&2048&&Iu(s,t);break;case 24:Ru(e,t,n,r),a&2048&&Lu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Wl(a.child,!0),Wl(t.child,!0))),Ru(e,t,n,r);break;default:Ru(e,t,n,r)}}function Bu(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:Bu(a,o,s,c,i),vl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Bu(a,o,s,c,i)):u._visibility&2?Bu(a,o,s,c,i):Vu(a,o),i&&l&2048&&Iu(o.alternate,o);break;case 24:Bu(a,o,s,c,i),i&&l&2048&&Lu(o.alternate,o);break;default:Bu(a,o,s,c,i)}t=t.sibling}}function Vu(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:Vu(n,r),i&2048&&Iu(r.alternate,r);break;case 24:Vu(n,r),i&2048&&Lu(r.alternate,r);break;default:Vu(n,r)}t=t.sibling}}var Hu=8192;function Uu(e,t,n){if(e.subtreeFlags&Hu)for(e=e.child;e!==null;)Wu(e,t,n),e=e.sibling}function Wu(e,t,n){switch(e.tag){case 26:Uu(e,t,n),e.flags&Hu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Du,e.memoizedState,e.memoizedProps));break;case 5:Uu(e,t,n),e.flags&Hu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Du;Du=Em(e.stateNode.containerInfo),Uu(e,t,n),Du=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Hu,Hu=16777216,Uu(e,t,n),Hu=r):Uu(e,t,n));break;case 30:if((e.flags&Hu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ll===null&&(Ll=/* @__PURE__ */ new Map),Ll.set(r,i)}Uu(e,t,n);break;default:Uu(e,t,n)}}function Gu(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 Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(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:Ku(e),e.flags&2048&&yl(9,e,e.return);break;case 3:Ku(e);break;case 12:Ku(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ju(e)):Ku(e);break;default:Ku(e)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:yl(8,t,t.return),Ju(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ju(t));break;default:Ju(t)}e=e.sibling}}function Yu(e,t){for(;ou!==null;){var n=ou;switch(n.tag){case 0:case 11:case 15:yl(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:Oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ou=r;else a:for(n=e;ou!==null;){r=ou;var i=r.sibling,a=r.return;if(_u(r),r===n){ou=null;break a}if(i!==null){i.return=a,ou=i;break a}ou=a}}}var Xu={getCacheForType:function(e){var t=ba(Ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ba(Ea).controller.signal}},Zu=typeof WeakMap==`function`?WeakMap:Map,Qu=0,$u=null,ed=null,td=0,nd=0,rd=null,id=!1,ad=!1,od=!1,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=null,hd=null,gd=!1,_d=0,vd=0,yd=1/0,bd=null,xd=null,Sd=0,Cd=null,wd=null,Td=0,Ed=0,Dd=null,Od=null,kd=null,Ad=null,jd=null,Md=0,Nd=null;function Pd(){return Qu&2&&td!==0?td&-td:V.T===null?pt():Rf()}function Fd(){if(fd===0){if(!(td&536870912)||$i){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),fd=e}else fd=536870912}return e=Eo.current,e!==null&&(e.flags|=32),fd}function Id(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(di(e.memoizedProps,n))),Ad===null&&(Ad=[]),Ad.push(t.bind(null,r))}}function Ld(e,t,n){(e===$u&&(nd===2||nd===9)||e.cancelPendingCommit!==null)&&(Wd(e,0),Vd(e,td,fd,!1)),ct(e,n),(!(Qu&2)||e!==$u)&&(e===$u&&(!(Qu&2)&&(ud|=n),cd===4&&Vd(e,td,fd,!1)),Af(e))}function Rd(e,t,n){if(Qu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||rt(e,t),a=r?Qd(e,t):Xd(e,t,!0),o=r;do{if(a===0){ad&&!r&&Vd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Bd(n)){a=Xd(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=md;var l=c.current.memoizedState.isDehydrated;if(l&&(Wd(c,s).flags|=256),s=Xd(c,s,!1),s!==2&&s!==6){if(od&&!l){c.errorRecoveryDisabledLanes|=o,ud|=o,a=4;break a}o=hd,hd=a,o!==null&&(hd===null?hd=o:hd.push.apply(hd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Wd(e,0),Vd(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:Vd(r,t,fd,!id);break a;case 2:hd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=_d+300-Ie(),10<a)){if(Vd(r,t,fd,!id),nt(r,0,!0)!==0)break a;Td=t,r.timeoutHandle=Sp(zd.bind(null,r,n,hd,bd,gd,t,fd,ud,pd,id,o,`Throttled`,-0,0),a);break a}zd(r,n,hd,bd,gd,t,fd,ud,pd,id,o,null,-0,0)}break}while(1);Af(e)}function zd(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:fn},Ll=null,Wu(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=sh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?_d-Ie():(a&4194048)===a?vd-Ie():0,m=ah(d,m),m!==null)){Td=a,e.cancelPendingCommit=m(of.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Vd(e,a,o,!l);return}of(e,t,a,n,r,i,o,s,c,l,u,d)}function Bd(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(!Fr(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 Vd(e,t,n,r){t=it(e,t),t&=~dd,t&=~ud,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&lt(e,n,t)}function Hd(){return Qu&6?!0:(jf(0,!1),!1)}function Ud(){if(ed!==null){if(nd===0)var e=ed.return;else e=ed,fa=da=null,ns(e),eo=null,to=0,e=ed;for(;e!==null;)_l(e.alternate,e),e=e.return;ed=null}}function Wd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Td=0,Ud(),$u=e,ed=n=Oi(e.current,null),td=t,nd=0,rd=null,id=!1,ad=rt(e,t),od=!1,pd=fd=dd=ud=ld=cd=0,hd=md=null,gd=!1,sd=it(e,t),vi(),n}function Gd(e,t){Ro=null,V.H=fc,t===Wa||t===Ka?(t=Qa(),nd=3):t===Ga?(t=Qa(),nd=4):nd=t===kc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,rd=t,ed===null&&(cd=1,K(e,Ii(t,e.current)))}function Kd(){var e=Eo.current;return e===null?!0:(td&4194048)===td?Do===null:(td&62914560)===td||td&536870912?e===Do:!1}function qd(){var e=V.H;return V.H=fc,e===null?fc:e}function Jd(){var e=V.A;return V.A=Xu,e}function Yd(){cd=4,id||(td&4194048)!==td&&Eo.current!==null||(ad=!0),!(ld&134217727)&&!(ud&134217727)||$u===null||Vd($u,td,fd,!1)}function Xd(e,t,n){var r=Qu;Qu|=2;var i=qd(),a=Jd();($u!==e||td!==t)&&(bd=null,Wd(e,t)),t=!1;var o=cd;a:do try{if(nd!==0&&ed!==null){var s=ed,c=rd;switch(nd){case 8:Ud(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=nd;if(nd=0,rd=null,nf(e,s,c,l),n&&ad){o=0;break a}break;default:l=nd,nd=0,rd=null,nf(e,s,c,l)}}Zd(),o=cd;break}catch(t){Gd(e,t)}while(1);return t&&e.shellSuspendCounter++,fa=da=null,Qu=r,V.H=i,V.A=a,ed===null&&($u=null,td=0,vi()),o}function Zd(){for(;ed!==null;)ef(ed)}function Qd(e,t){var n=Qu;Qu|=2;var r=qd(),a=Jd();$u!==e||td!==t?(bd=null,yd=Ie()+500,Wd(e,t)):ad=rt(e,t);a:do try{if(nd!==0&&ed!==null){t=ed;var o=rd;b:switch(nd){case 1:nd=0,rd=null,nf(e,t,o,1);break;case 2:case 9:if(Ja(o)){nd=0,rd=null,tf(t);break}t=function(){nd!==2&&nd!==9||$u!==e||(nd=7),Af(e)},o.then(t,t);break a;case 3:nd=7;break a;case 4:nd=5;break a;case 7:Ja(o)?(nd=0,rd=null,tf(t)):(nd=0,rd=null,nf(e,t,o,7));break;case 5:var s=null;switch(ed.tag){case 26:s=ed.memoizedState;case 5:case 27:var c=ed;if(s?th(s):c.stateNode.complete){nd=0,rd=null;var l=c.sibling;if(l!==null)ed=l;else{var u=c.return;u===null?ed=null:(ed=u,rf(u))}break b}}nd=0,rd=null,nf(e,t,o,5);break;case 6:nd=0,rd=null,nf(e,t,o,6);break;case 8:Ud(),cd=6;break a;default:throw Error(i(462))}}$d();break}catch(t){Gd(e,t)}while(1);return fa=da=null,V.H=r,V.A=a,Qu=n,ed===null?($u=null,td=0,vi(),cd):0}function $d(){for(;ed!==null&&!Pe();)ef(ed)}function ef(e){var t=q(e.alternate,e,sd);e.memoizedProps=e.pendingProps,t===null?rf(e):ed=t}function tf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,td);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,td);break;case 5:ns(t);var r=t;r===Zi&&($i?(aa(r),r.tag===5&&r.stateNode!=null&&(Qi=r.stateNode)):(aa(r),$i=!0));default:_l(n,t),t=ed=ki(t,sd),t=q(n,t,sd)}e.memoizedProps=e.pendingProps,t===null?rf(e):ed=t}function nf(e,t,n,r){fa=da=null,ns(t),eo=null,to=0;var i=t.return;try{if(Oc(e,i,t,n,td)){cd=1,K(e,Ii(n,e.current)),ed=null;return}}catch(t){if(i!==null)throw ed=i,t;cd=1,K(e,Ii(n,e.current)),ed=null;return}t.flags&32768?($i||r===1?e=!0:ad||td&536870912?e=!1:(id=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),af(t,e)):rf(t)}function rf(e){var t=e;do{if(t.flags&32768){af(t,id);return}e=t.return;var n=hl(t.alternate,t,sd);if(n!==null){ed=n;return}if(t=t.sibling,t!==null){ed=t;return}ed=t=e}while(t!==null);cd===0&&(cd=5)}function af(e,t){do{var n=gl(e.alternate,e);if(n!==null){n.flags&=32767,ed=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ed=e;return}ed=e=n}while(e!==null);cd=6,ed=null}function of(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do mf();while(Sd!==0);if(Qu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===$u&&(ed=$u=null,td=0),wd=t,Cd=e,Td=n,Dd=a,Od=r,sf(e,t,n,s,c,l,f)}}function sf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ed=s,s|=_i,U(e,n,s,r,i,a),Ad=null,(n&335544064)===n?(jd=ja(e),r=10262):(jd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Cf(Be,function(){return hf(),null})):(e.callbackNode=null,e.callbackPriority=0),Il=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=V.T,V.T=null,i=H.p,H.p=2,a=Qu,Qu|=4;try{du(e,t,n)}finally{Qu=a,H.p=i,V.T=r}}Sd=1,Il?kd=Rp(o,e.containerInfo,jd,uf,df,lf,ff,hf,cf,null,null):(uf(),df(),ff())}function cf(e){if(Sd!==0){var t=Cd.onRecoverableError;t(e,{componentStack:null})}}function lf(){Sd===3&&(Sd=0,Mu(wd,Cd),Sd=4)}function uf(){if(Sd===1){Sd=0;var e=Cd,t=wd,n=Td,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=V.T,V.T=null;var i=H.p;H.p=2;var a=Qu;Qu|=4;try{cu=lu=!1,Ou(t,e,n),n=mp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(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 _=zr(s,h),v=zr(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}}bh=!!pp,mp=pp=null}finally{Qu=a,H.p=i,V.T=r}}e.current=t,Sd=2}}function df(){if(Sd===2){Sd=0;var e=Cd,t=wd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=V.T,V.T=null;var r=H.p;H.p=2;var i=Qu;Qu|=4;try{pu(e,t.alternate,t)}finally{Qu=i,H.p=r,V.T=n}}Sd=3}}function ff(){if(Sd===4||Sd===3){Sd=0;var e=kd;kd=null,Fe();var t=Cd,n=wd,r=Td,i=Od,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Sd=5:(Sd=0,wd=Cd=null,pf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(xd=null),ft(r),n=n.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=V.T,a=H.p,H.p=2,V.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{V.T=n,H.p=a}}if(i=Ad,o=jd,jd=null,i!==null&&(Ad=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);Td&3&&mf(),Af(t),a=t.pendingLanes,r&261930&&a&42?t===Nd?Md++:(Md=0,Nd=t):(Md=0,Nd=null),jf(0,!1)}}function pf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Oa(t)))}function mf(){return kd!==null&&(kd.skipTransition(),kd=null),uf(),df(),ff(),hf()}function hf(){if(Sd!==5)return!1;var e=Cd,t=Ed;Ed=0;var n=ft(Td),r=V.T,a=H.p;try{H.p=32>n?32:n,V.T=null,n=Dd,Dd=null;var o=Cd,s=Td;if(Sd=0,wd=Cd=null,Td=0,Qu&6)throw Error(i(331));var c=Qu;if(Qu|=4,qu(o.current),zu(o,o.current,s,n),Qu=c,jf(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{H.p=a,V.T=r,pf(e,t)}}function gf(e,t,n){t=Ii(n,t),t=Tc(e.stateNode,t,2),e=po(e,t,2),e!==null&&(ct(e,2),Af(e))}function _f(e,t,n){if(e.tag===3)gf(e,e,n);else for(;t!==null;){if(t.tag===3){gf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(xd===null||!xd.has(r))){e=Ii(n,e),n=Ec(2),r=po(t,n,2),r!==null&&(Dc(n,r,t,e),ct(r,2),Af(r));break}}t=t.return}}function vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Zu;var i=/* @__PURE__ */ new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=/* @__PURE__ */ new Set,r.set(t,i));i.has(n)||(od=!0,i.add(n),e=yf.bind(null,e,t,n),t.then(e,e))}function yf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$u===e&&(td&n)===n&&(cd===4||cd===3&&(td&62914560)===td&&300>Ie()-_d?Qu&2?dd|=n:Wd(e,0):dd|=n,pd===td&&(pd=0)),Af(e)}function bf(e,t){t===0&&(t=ot()),e=xi(e,t),e!==null&&(ct(e,t),Af(e))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bf(e,n)}function Sf(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),bf(e,n)}function Cf(e,t){return Me(e,t)}var wf=null,Tf=null,Ef=!1,Df=!1,Of=!1,kf=0;function Af(e){e!==Tf&&e.next===null&&(Tf===null?wf=Tf=e:Tf=Tf.next=e),Df=!0,Ef||(Ef=!0,Lf())}function jf(e,t){if(!Of&&Df){Of=!0;do for(var n=!1,r=wf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,If(r,a))}else a=td,a=nt(r,r===$u?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,If(r,a))}r=r.next}while(n);Of=!1}}function Mf(){Nf()}function Nf(){Df=Ef=!1;var e=0;kf!==0&&xp()&&(e=kf);for(var t=Ie(),n=null,r=wf;r!==null;){var i=r.next,a=Pf(r,t);a===0?(r.next=null,n===null?wf=i:n.next=i,i===null&&(Tf=n)):(n=r,(e!==0||a&3)&&(Df=!0)),r=i}Sd!==0&&Sd!==5||jf(e,!1),kf!==0&&(kf=0)}function Pf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=at(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=$u,n=td,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(nd===2||nd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),ft(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=Ff.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function Ff(e,t){if(Sd!==0&&Sd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(mf()&&e.callbackNode!==n)return null;var r=td;return r=nt(e,e===$u?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Rd(e,r,t),Pf(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?Ff.bind(null,e):null)}function If(e,t){if(mf())return null;Rd(e,t,!0)}function Lf(){Ep(function(){Qu&6?Me(Re,Mf):Nf()})}function Rf(){if(kf===0){var e=Pa;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),kf=e}return kf}function zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:dn(e)}function Bf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=zf((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Nn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(kf!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Vf=0;Vf<ci.length;Vf++){var Hf=ci[Vf];li(Hf.toLowerCase(),`on`+(Hf[0].toUpperCase()+Hf.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),Ft(`onMouseEnter`,[`mouseout`,`mouseover`]),Ft(`onMouseLeave`,[`mouseout`,`mouseover`]),Ft(`onPointerEnter`,[`pointerout`,`pointerover`]),Ft(`onPointerLeave`,[`pointerout`,`pointerover`]),Pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Uf=`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(` `),Wf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Uf));function Gf(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){mi(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){mi(e)}i.currentTarget=null,a=c}}}}function Kf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=/* @__PURE__ */ new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function qf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var Jf=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[Jf]){e[Jf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(Wf.has(t)||qf(t,!1,e),qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,qf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(Dh(t)){case 2:var i=xh;break;case 8:i=Sh;break;default:i=Ch}n=i.bind(null,t,n,e),i=void 0,!Sn||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 Zf(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=Et(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}yn(function(){var r=a,i=mn(n),s=[];a:{var c=si.get(e);if(c!==void 0){var l=Nn,u=e;switch(e){case`keypress`:if(On(n)===0)break a;case`keydown`:case`keyup`:l=Zn;break;case`focusin`:u=`focus`,l=Hn;break;case`focusout`:u=`blur`,l=Hn;break;case`beforeblur`:case`afterblur`:l=Hn;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=Bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=er;break;case ei:case ti:case ni:l=Un;break;case oi:l=tr;break;case`scroll`:case`scrollend`:l=Fn;break;case`wheel`:l=nr;break;case`copy`:case`cut`:case`paste`:l=Wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Qn;break;case`submit`:l=$n;break;case`toggle`:case`beforetoggle`:l=rr}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=bn(m,p),g!=null&&d.push(Qf(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!==pn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[vt]))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?Et(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=Bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ot(c),h=l==null?u:Ot(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(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,ep):null,c!==null&&tp(s,u,c,d,!1),l!==null&&f!==null&&tp(s,f,l,d,!0)))}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Cr;else if(_r(c)){if(wr)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&cn(r.elementType)&&(_=Cr):_=Mr;if(_&&=_(e,r)){vr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ot(r):window,e){case`focusin`:(_r(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(s,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(s,n,i)}var y;if(ar)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 pr?dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(cr&&n.locale!==`ko`&&(pr||b!==`onCompositionStart`?b===`onCompositionEnd`&&pr&&(y=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,pr=!0)),v=$f(r,b),0<v.length&&(b=new Gn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=fr(n),y!==null&&(b.data=y)))),(y=sr?mr(e,n):hr(e,n))&&(b=$f(r,`onBeforeInput`),0<b.length&&(v=new Gn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Bf(s,e,r,n,i)}Gf(s,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $f(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=bn(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=bn(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ep(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(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=bn(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=bn(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var np=/\r\n?/g,rp=/\u0000|\uFFFD/g;function ip(e){return(typeof e==`string`?e:``+e).replace(np,`
49
- `).replace(rp,``)}function ap(e,t){return t=ip(t),ip(e)===t}function op(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&rn(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:sn(e,r,o);return;case`data`:if(t!==`object`){Ut(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=dn(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`&&op(e,t,`name`,a.name,a,null),op(e,t,`formEncType`,a.formEncType,a,null),op(e,t,`formMethod`,a.formMethod,a,null),op(e,t,`formTarget`,a.formTarget,a,null)):(op(e,t,`encType`,a.encType,a,null),op(e,t,`method`,a.method,a,null),op(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Kf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Kf(`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=dn(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`:Kf(`beforetoggle`,e),Kf(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(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=ln.get(n)||n,Ht(e,n,r);else return}Bt=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:sn(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`)rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)rn(e,``+r);else return;break;case`onScroll`:r!=null&&Kf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Kf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Nt.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[_t]||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}Bt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}Bt=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Kf(`error`,e),Kf(`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:op(e,t,o,s,n,null)}}a&&op(e,t,`srcSet`,n.srcSet,n,null),r&&op(e,t,`src`,n.src,n,null);return;case`input`:Kf(`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:op(e,t,r,d,n,null)}}Qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Kf(`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:op(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&en(e,!!r,n,!0):en(e,!!r,t,!1);return;case`textarea`:for(s in Kf(`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:op(e,t,s,c,n,null)}nn(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:op(e,t,l,r,n,null)}return;case`dialog`:Kf(`beforetoggle`,e),Kf(`toggle`,e),Kf(`cancel`,e),Kf(`close`,e);break;case`iframe`:case`object`:Kf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Uf.length;r++)Kf(Uf[r],e);break;case`image`:Kf(`error`,e),Kf(`load`,e);break;case`details`:Kf(`toggle`,e);break;case`embed`:case`source`:case`link`:Kf(`error`,e),Kf(`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:op(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&op(e,t,c,r,n,null))}var lp={};function up(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)||op(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&&(Bt=!0),o=m;break;case`name`:m!==f&&(Bt=!0),a=m;break;case`checked`:m!==f&&(Bt=!0),u=m;break;case`defaultChecked`:m!==f&&(Bt=!0),d=m;break;case`value`:m!==f&&(Bt=!0),s=m;break;case`defaultValue`:m!==f&&(Bt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&op(e,t,p,m,r,f)}}Zt(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)||op(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&&(Bt=!0),p=o;break;case`defaultValue`:o!==l&&(Bt=!0),c=o;break;case`multiple`:o!==l&&(Bt=!0),s=o;default:o!==l&&op(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?en(e,!!n,n?[]:``,!1):en(e,!!n,t,!0)):en(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:op(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&&(Bt=!0),p=a;break;case`defaultValue`:a!==o&&(Bt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&op(e,t,s,a,r,o)}tn(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:op(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&&(Bt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:op(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)&&op(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:op(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(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||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&op(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||op(e,t,f,p,r,m)}function dp(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&&dp(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&&dp(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[gt]=r,n[_t]=t,cp(n,e,t),At(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),Kh(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[Ct]||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);Kh(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>J){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}),m(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),m(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){m(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=[];m(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&&m(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=/* @__PURE__ */ new Set),this._observers.add(e),m(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),m(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 m(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=[];m(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=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function 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=[];m(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??=/* @__PURE__ */ 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),Tt(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[Ct])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&&op(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),Tt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var wm=/* @__PURE__ */ new Map,Tm=/* @__PURE__ */ 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=H.d;H.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=Hd();return e||t}function km(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?ec(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=Xt(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`),cp(t,`link`,e),At(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="`+Xt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Xt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Xt(n.imageSizes)+`"]`)):i+=`[href="`+Xt(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`);cp(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(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="`+Xt(r)+`"][href="`+Xt(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`),cp(r,`link`,e),At(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=kt(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`);At(c),cp(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=kt(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`),At(a),cp(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=kt(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`),At(a),cp(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=ve.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=kt(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=kt(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=kt(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="`+Xt(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[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),cp(t,`link`,n),At(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="`+Xt(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~="`+Xt(n.href)+`"]`);if(r)return t.instance=r,At(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`),At(r),cp(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,At(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(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,At(a),a):(r=n,(a=wm.get(o))&&(r=D({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),cp(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=/* @__PURE__ */ new Map,i=Xm=/* @__PURE__ */ new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=/* @__PURE__ */ 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[Ct]||a[gt]||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=ch.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=sh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=/* @__PURE__ */ new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=sh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var J=0;function ah(e,t){return e.stylesheets&&e.count===0&&uh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&J===0&&(J=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>J?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function oh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)uh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function sh(){this.count--,oh(this)}function ch(){this.imgCount--,oh(this)}var lh=null;function uh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lh=/* @__PURE__ */ new Map,t.forEach(Y,e),lh=null,sh.call(e))}function Y(e,t){if(!(t.state.loading&4)){var n=lh.get(e);if(n)var r=n.get(null);else{n=/* @__PURE__ */ new Map,lh.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=sh.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 dh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function fh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=st(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=st(0),this.hiddenUpdates=st(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=/* @__PURE__ */ new Map}function ph(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=Da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},lo(a),e}function mh(e){return e?(e=wi,e):wi}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(Ld(n,e,t),mo(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _h(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&Ld(t,e,67108864),_h(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=Pd();t=dt(t);var n=xi(e,t);n!==null&&Ld(n,e,t),_h(e,t)}}var bh=!0;function xh(e,t,n,r){var i=V.T;V.T=null;var a=H.p;try{H.p=2,Ch(e,t,n,r)}finally{H.p=a,V.T=i}}function Sh(e,t,n,r){var i=V.T;V.T=null;var a=H.p;try{H.p=8,Ch(e,t,n,r)}finally{H.p=a,V.T=i}}function Ch(e,t,n,r){if(bh){var i=wh(r);if(i===null)Zf(e,t,r,Th,n),Ih(e,r);else if(Rh(i,e,t,n,r))r.stopPropagation();else if(Ih(e,r),t&4&&-1<Fh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}Af(a),!(Qu&6)&&(yd=Ie()+500,jf(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&Ld(s,a,2),Hd(),_h(a,2)}if(a=wh(r),a===null&&Zf(e,t,r,Th,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function wh(e){return e=mn(e),Eh(e)}var Th=null;function Eh(e){if(Th=null,e=Et(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 Th=e,null}function Dh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Oh=!1,kh=null,Ah=null,jh=null,Mh=/* @__PURE__ */ new Map,Nh=/* @__PURE__ */ new Map,Ph=[],Fh=`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 Ih(e,t){switch(e){case`focusin`:case`focusout`:kh=null;break;case`dragenter`:case`dragleave`:Ah=null;break;case`mouseover`:case`mouseout`:jh=null;break;case`pointerover`:case`pointerout`:Mh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Nh.delete(t.pointerId)}}function Lh(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=Dt(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Rh(e,t,n,r,i){switch(t){case`focusin`:return kh=Lh(kh,e,t,n,r,i),!0;case`dragenter`:return Ah=Lh(Ah,e,t,n,r,i),!0;case`mouseover`:return jh=Lh(jh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Mh.set(a,Lh(Mh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Nh.set(a,Lh(Nh.get(a)||null,e,t,n,r,i)),!0}return!1}function zh(e){var t=Et(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,mt(e.priority,function(){yh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,mt(e.priority,function(){yh(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 Bh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Dt(n),t!==null&&vh(t),e.blockedOn=n,!1;t.shift()}return!0}function Vh(e,t,n){Bh(e)&&n.delete(t)}function Hh(){Oh=!1,kh!==null&&Bh(kh)&&(kh=null),Ah!==null&&Bh(Ah)&&(Ah=null),jh!==null&&Bh(jh)&&(jh=null),Mh.forEach(Vh),Nh.forEach(Vh)}function Uh(e,n){e.blockedOn===n&&(e.blockedOn=null,Oh||(Oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Hh)))}var Wh=null;function Gh(e){Wh!==e&&(Wh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wh===e&&(Wh=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(Eh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Kh(e){function t(t){return Uh(t,e)}kh!==null&&Uh(kh,e),Ah!==null&&Uh(Ah,e),jh!==null&&Uh(jh,e),Mh.forEach(t),Nh.forEach(t);for(var n=0;n<Ph.length;n++){var r=Ph[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ph.length&&(n=Ph[0],n.blockedOn===null);)zh(n),n.blockedOn===null&&Ph.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[_t]||null;if(typeof a==`function`)o||Gh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(Eh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Gh(n)}}}function qh(){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 Jh(e){this._internalRoot=e}Yh.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hh(n,Pd(),e,t,null,null)},Yh.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hh(e.current,2,null,e,null,null),Hd(),t[vt]=null}};function Yh(e){this._internalRoot=e}Yh.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ph.length&&t!==0&&t<Ph[n].priority;n++);Ph.splice(n,0,e),n===0&&zh(e)}};var Xh=n.version;if(Xh!==`19.3.0`)throw Error(i(527,Xh,`19.3.0`));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Zh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:V,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{Ge=Qh.inject(Zh),Ke=Qh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ph(e,1,!1,null,null,n,r,null,o,s,c,qh),e[vt]=t.current,Yf(e),new Jh(t)}})),_=/* @__PURE__ */ o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()}));
48
+ `+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(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 rt(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=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(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 it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(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-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(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 st(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function H(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-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ut(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ut(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function U(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(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 pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=V.p;return e===0?(e=window.event,e===void 0?32:Oh(e.type)):e}function ht(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt,Tt=`__reactLoad$`+gt;function Et(e){delete e[_t],delete e[vt],delete e[xt],delete e[St]}function Dt(e){var t;if(t=e[_t])return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[_t])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function Ot(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function At(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:/* @__PURE__ */ new Map,hoistableScripts:/* @__PURE__ */ new Map},t}function jt(e){e[wt]=!0}function Mt(e){e[Tt]=void 0}var Nt=/* @__PURE__ */ new Set,Pt={};function Ft(e,t){It(e,t),It(e+`Capture`,t)}function It(e,t){for(Pt[e]=t,e=0;e<t.length;e++)Nt.add(t[e])}var Lt=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]*$`),Rt={},zt={};function Bt(e){return Me.call(zt,e)?!0:Me.call(Rt,e)?!1:Lt.test(e)?zt[e]=!0:(Rt[e]=!0,!1)}var Vt=!1;function Ht(){var e=Vt;return Vt=!1,e}function Ut(e,t,n){if(Bt(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 Wt(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 Gt(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 Kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Jt(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 W(e){if(!e._valueTracker){var t=qt(e)?`checked`:`value`;e._valueTracker=Jt(e,t,``+e[t])}}function Yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Xt=/[\n"\\]/g;function Zt(e){return e.replace(Xt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Qt(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=``+Kt(t)):e.value!==``+Kt(t)&&(e.value=``+Kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):en(e,Kt(n)):o===`number`&&e.value==t?en(e,Kt(e.value)):en(e,Kt(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=``+Kt(s):e.removeAttribute(`name`)}function $t(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)){W(e);return}n=n==null?``:``+Kt(n),t=t==null?n:``+Kt(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),W(e)}function en(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function tn(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=``+Kt(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 nn(e,t,n){if(t!=null&&(t=``+Kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Kt(n)}function rn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ue(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),W(e)}function an(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var on=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 sn(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||on.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function cn(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]=``,Vt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(sn(e,a,r),Vt=!0)}else for(var o in t)t.hasOwnProperty(o)&&sn(e,o,t[o])}function ln(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 un=/* @__PURE__ */ 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`]]),dn=/^[\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 fn(e){return dn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function pn(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=Ot(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Qt(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="`+Zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));Qt(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&&Yt(r)}break a;case`textarea`:nn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&tn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Ud(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||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 Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.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 Dn=i.slice(e,1<r?1-r:void 0)}function kn(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 An(){return!0}function jn(){return!1}function Mn(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)?An:jn,this.isPropagationStopped=jn,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=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=D({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=D({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(D({},Bn,{dataTransfer:0})),Un=Mn(D({},Fn,{relatedTarget:0})),Wn=Mn(D({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(D({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(D({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(D({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(D({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(D({},Nn,{submitter:0})),tr=Mn(D({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(D({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(D({},Bn,{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})),ir=Mn(D({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!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 lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=ep(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Kf(e,0)}function Cr(e){if(Yt(kt(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(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(!Me.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function Rr(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 zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(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=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(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=Rr(e.document)}return t}function Ur(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 Wr=Sn&&`documentMode`in document&&11>=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==Rr(r)||(r=Gr,`selectionStart`in r&&Ur(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}),qr&&Lr(qr,r)||(qr=r,r=ep(Kr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gr)))}function Xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Zr={animationend:Xr(`Animation`,`AnimationEnd`),animationiteration:Xr(`Animation`,`AnimationIteration`),animationstart:Xr(`Animation`,`AnimationStart`),transitionrun:Xr(`Transition`,`TransitionRun`),transitionstart:Xr(`Transition`,`TransitionStart`),transitioncancel:Xr(`Transition`,`TransitionCancel`),transitionend:Xr(`Transition`,`TransitionEnd`)},Qr={},$r={};Sn&&($r=document.createElement(`div`).style,`AnimationEvent`in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),`TransitionEvent`in window||delete Zr.transitionend.transition);function ei(e){if(Qr[e])return Qr[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $r)return Qr[e]=t[n];return e}var ti=ei(`animationend`),ni=ei(`animationiteration`),ri=ei(`animationstart`),ii=ei(`transitionrun`),ai=ei(`transitionstart`),oi=ei(`transitioncancel`),si=ei(`transitionend`),ci=/* @__PURE__ */ new Map,li=`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(` `);li.push(`scrollEnd`);function ui(e,t){ci.set(e,t),Ft(t,[e])}var di=0;function fi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=di++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function pi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;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 mi(e,t){return e=pi(e),t=pi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var hi=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)},gi=[],_i=0,vi=0;function yi(){for(var e=_i,t=vi=_i=0;t<e;){var n=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var i=gi[t];gi[t++]=null;var a=gi[t];if(gi[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&&Ci(n,i,a)}}function bi(e,t,n,r){gi[_i++]=e,gi[_i++]=t,gi[_i++]=n,gi[_i++]=r,vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function xi(e,t,n,r){return bi(e,t,n,r),wi(e)}function Si(e,t){return bi(e,null,null,t),wi(e)}function Ci(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-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function wi(e){if(50<Nd)throw Nd=0,Pd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function Ei(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 Di(e,t,n,r){return new Ei(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var n=e.alternate;return n===null?(n=Di(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 Ai(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 ji(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Oi(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,_e.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ne:return e=Di(31,n,t,a),e.elementType=ne,e.lanes=o,e;case j:return Mi(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Di(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Di(13,n,t,a),e.elementType=L,e.lanes=o,e;case ee:return e=Di(19,n,t,a),e.elementType=ee,e.lanes=o,e;case re:case ae:return e=a|32,e=Di(30,n,t,e),e.elementType=ae,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case R:s=14;break a;case te:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Mi(e,t,n,r){return e=Di(7,e,r,t),e.lanes=n,e}function Ni(e,t,n){return e=Di(6,e,null,t),e.lanes=n,e}function Pi(e){var t=Di(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=Di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ii=/* @__PURE__ */ new WeakMap;function Li(e,t){if(typeof e==`object`&&e){var n=Ii.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Ii.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Ri=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){Ri[zi++]=Vi,Ri[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-Ye(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=Ri[--zi],Ri[zi]=null,Vi=Ri[--zi],Ri[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,ea=!1,ta=null,na=!1,ra=Error(i(519));function ia(e){throw ua(Li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:qf(`cancel`,t),qf(`close`,t);break;case`iframe`:case`object`:case`embed`:qf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)qf(Wf[n],t);break;case`source`:qf(`error`,t);break;case`img`:case`image`:case`link`:qf(`error`,t),qf(`load`,t);break;case`details`:qf(`toggle`,t);break;case`input`:qf(`invalid`,t),$t(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:qf(`invalid`,t);break;case`textarea`:qf(`invalid`,t),rn(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&&(qf(`beforetoggle`,t),qf(`toggle`,t)),r.onScroll!=null&&qf(`scroll`,t),r.onScrollEnd!=null&&qf(`scrollend`,t),r.onClick!=null&&(t.onclick=pn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:Qi=Qi.return}}function sa(e){if(e!==Qi)return!1;if(!ea)return oa(e),ea=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||bp(e.type,e.memoizedProps)),n=!n),n&&$i&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=vm(e)}else t===27?(t=$i,kp(e.type)?(e=_m,_m=null,$i=e):$i=t):$i=Qi?gm(e.stateNode.nextSibling):null;return!0}function ca(){$i=Qi=null,ea=!1}function la(){var e=ta;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=me(null),fa=null,pa=null;function ma(e,t,n){ge(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,he(da)}function ga(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 _a(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),ga(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),ga(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),ga(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 va(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;Ir(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===be.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&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Ir(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=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()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:/* @__PURE__ */ new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(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 ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=zf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(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 Ba=B.S;B.S=function(e,t){if(yd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=Tf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=me(null);function Ha(){var e=Va.current;return e===null?ed.pooledCache:e}function Ua(e,t){t===null?ge(Va,Va.current):ge(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(i(460)),Ka=Error(i(474)),qa=Error(i(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(pn,pn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(pn,pn);else{if(e=ed,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,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(i(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(i(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(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 oo(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=/* @__PURE__ */ 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=ki(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=Ni(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),io(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===te&&Za(i)===t.type)?(t=a(t,n.props),io(t,n),t.return=e,t):(t=ji(n.type,n.key,n.props,null,e.mode,r),io(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=Fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ji(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Fi(t,e.mode,n),t.return=e,t;case te:return t=Za(t),f(e,t,n)}if(ue(t)||se(t))return t=Mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===F)return f(e,Sa(e,t),n);ao(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 te:return n=Za(n),p(e,t,n,r)}if(ue(n)||se(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===F)return p(e,t,Sa(e,n),r);ao(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 te:return r=Za(r),m(e,t,n,r,i)}if(ue(r)||se(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===F)return m(e,t,n,Sa(t,r),i);ao(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),ea&&qi(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 ea&&qi(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)}),ea&&qi(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),ea&&qi(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 ea&&qi(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)}),ea&&qi(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),io(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===te&&Za(l)===r.type){n(e,r.sibling),c=a(r,o.props),io(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Mi(o.props.children,e.mode,c,o.key),io(c,o),c.return=e,e=c):(c=ji(o.type,o.key,o.props,null,e.mode,c),io(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=Fi(o,e.mode,c),c.return=e,e=c}return s(e);case te:return o=Za(o),_(e,r,o,c)}if(ue(o))return h(e,r,o,c);if(se(o)){if(l=se(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,ro(o),c);if(o.$$typeof===F)return _(e,r,Sa(e,o),c);ao(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=Ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=Di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(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 po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$u&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=wi(e),Ci(e,null,n),t}return bi(e,r,t,n),wi(e)}function ho(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,U(e,n)}}function go(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 _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!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?(nd&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!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:lo=!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),ud|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=me(null),Co=me(0);function wo(e,t){e=cd,ge(Co,e),ge(So,t),cd=e|t.baseLanes}function To(){ge(Co,cd),ge(So,So.current)}function Eo(){cd=Co.current,he(So),he(Co)}var Do=me(null),Oo=null;function ko(e){var t=e.alternate;ge(Po,Po.current&1),ge(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){ge(Po,Po.current),ge(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(ge(Po,Po.current),ge(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){ge(Po,Po.current),ge(Do,Do.current)}function No(e){he(Do),Oo===e&&(Oo=null),he(Po)}var Po=me(0);function Fo(e,t){ge(Do,Do.current),ge(Po,t)}function Io(e){he(Po),he(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(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 Ro=0,zo=null,Bo=null,Vo=null,Ho=!1,Uo=!1,Wo=!1,Go=0,Ko=0,qo=null,Jo=0;function Yo(){throw Error(i(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function Zo(e,t,n,r,i,a){return Ro=a,zo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?mc:hc,Wo=!1,a=n(r,i),Wo=!1,Uo&&(a=$o(t,n,r,i)),Qo(e),a}function Qo(e){B.H=pc;var t=Bo!==null&&Bo.next!==null;if(Ro=0,Vo=Bo=zo=null,Ho=!1,Ko=0,qo=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&ya(e)&&(jc=!0))}function $o(e,t,n,r){zo=e;var a=0;do{if(Uo&&(qo=null),Ko=0,Uo=!1,25<=a)throw Error(i(301));if(a+=1,Vo=Bo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}B.H=gc,o=t(n,r)}while(Uo);return o}function es(){var e=B.H,t=e.useState()[0];return t=typeof t.then==`function`?ss(t):t,e=e.useState()[0],(Bo===null?null:Bo.memoizedState)!==e&&(zo.flags|=1024),t}function ts(){var e=Go!==0;return Go=0,e}function ns(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rs(e){if(Ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ho=!1}Ro=0,Vo=Bo=zo=null,Uo=!1,Ko=Go=0,qo=null}function is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e,Vo}function as(){if(Bo===null){var e=zo.alternate;e=e===null?null:e.memoizedState}else e=Bo.next;var t=Vo===null?zo.memoizedState:Vo.next;if(t!==null)Vo=t,Bo=e;else{if(e===null)throw zo.alternate===null?Error(i(467)):Error(i(310));Bo=e,e={memoizedState:Bo.memoizedState,baseState:Bo.baseState,baseQueue:Bo.baseQueue,queue:Bo.queue,next:null},Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e}return Vo}function os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=Ko;return Ko+=1,qo===null&&(qo=[]),e=Xa(qo,e,t),t=zo,(Vo===null?t.memoizedState:Vo.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?mc:hc),e}function cs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ss(e);if(e.$$typeof===z)return;if(e.$$typeof===F)return xa(e)}throw Error(i(438,String(e)))}function ls(e){var t=null,n=zo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=zo.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=os(),zo.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]=ie;return t.index++,n}function us(e,t){return typeof t==`function`?t(e):t}function ds(e){return fs(as(),Bo,e)}function fs(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?(Ro&f)===f:(nd&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===Fa&&(d=!0);else if((Ro&p)===p){u=u.next,p===Fa&&(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,zo.lanes|=p,ud|=p;f=u.action,Wo&&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,zo.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(jc=!0,d&&(n=Ia,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 ps(e){var t=as(),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);Ir(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ms(e,t,n){var r=zo,a=as(),o=ea;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ir((Bo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,zs(_s.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Vo!==null&&!!(Vo.memoizedState.tag&1),Ps(e?9:8,{destroy:void 0},gs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Ro&127||hs(r,t,n)}return n}function hs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=zo.updateQueue,t===null?(t=os(),zo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gs(e,t,n,r){t.value=n,t.getSnapshot=r,vs(t)&&ys(e)}function _s(e,t,n){return n(function(){vs(t)&&ys(e)})}function vs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function ys(e){var t=Si(e,2);t!==null&&Rd(t,e,2)}function bs(e){var t=is();if(typeof e==`function`){var n=e;if(e=n(),Wo){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:e},t}function xs(e,t,n,r){return e.baseState=n,fs(e,Bo,typeof r==`function`?r:us)}function Ss(e,t,n,r,a){if(uc(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)}};B.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Cs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Cs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=B.T,o={};o.types=a===null?null:a.types,B.T=o;try{var s=n(i,r),c=B.S;c!==null&&c(o,s),ws(e,t,s)}catch(n){Es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),B.T=a}}else try{a=n(i,r),ws(e,t,a)}catch(n){Es(e,t,n)}}function ws(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ts(e,t,n)},function(n){return Es(e,t,n)}):Ts(e,t,n)}function Ts(e,t,n){t.status=`fulfilled`,t.value=n,Ds(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cs(e,n)))}function Es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ds(t),t=t.next;while(t!==r)}e.action=null}function Ds(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Os(e,t){return t}function ks(e,t){if(ea){var n=ed.formState;if(n!==null){a:{var r=zo;if(ea){if($i){b:{for(var i=$i,a=na;i.nodeType!==8;){if(!a){i=null;break b}if(i=gm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=gm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=is(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:t},n.queue=r,n=sc.bind(null,zo,r),r.dispatch=n,r=bs(!1),a=lc.bind(null,zo,!1,r.queue),r=is(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ss.bind(null,zo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function As(e){return js(as(),Bo,e)}function js(e,t,n){if(t=fs(e,t,Os)[0],e=ds(us)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ss(t)}catch(e){throw e===Ga?qa:e}else r=t;t=as();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(zo.flags|=2048,Ps(9,{destroy:void 0},Ms.bind(null,i,n),null)),[r,a,e]}function Ms(e,t){e.action=t}function Ns(e){var t=as(),n=Bo;if(n!==null)return js(t,n,e);as(),t=t.memoizedState,n=as();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=zo.updateQueue,t===null&&(t=os(),zo.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 Fs(){return as().memoizedState}function Is(e,t,n,r){var i=is();zo.flags|=e,i.memoizedState=Ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ls(e,t,n,r){var i=as();r=r===void 0?null:r;var a=i.memoizedState.inst;Bo!==null&&r!==null&&Xo(r,Bo.memoizedState.deps)?i.memoizedState=Ps(t,a,n,r):(zo.flags|=e,i.memoizedState=Ps(1|t,a,n,r))}function Rs(e,t){Is(8390656,8,e,t)}function zs(e,t){Ls(2048,8,e,t)}function Bs(e){zo.flags|=4;var t=zo.updateQueue;if(t===null)t=os(),zo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vs(e){var t=as().memoizedState;return Bs({ref:t,nextImpl:e}),function(){if($u&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Hs(e,t){return Ls(4,2,e,t)}function Us(e,t){return Ls(4,4,e,t)}function Ws(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Gs(e,t,n){n=n==null?null:n.concat([e]),Ls(4,4,Ws.bind(null,t,e),n)}function Ks(){}function qs(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Js(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xo(t,r[1]))return r[0];if(r=e(),Wo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Ys(e,t,n){return n===void 0||Ro&1073741824&&!(nd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),zo.lanes|=e,ud|=e,n)}function Xs(e,t,n,r){return Ir(n,t)?n:So.current===null?!(Ro&106)||Ro&1073741824&&!(nd&261930)?(jc=!0,e.memoizedState=n):(e=Id(),zo.lanes|=e,ud|=e,t):(e=Ys(e,n,r),Ir(e,t)||(jc=!0),e)}function Zs(e,t,n,r,i){var a=V.p;V.p=a!==0&&8>a?a:8;var o=B.T,s={};s.types=o===null?null:o.types,B.T=s,lc(e,!1,t,n);try{var c=i(),l=B.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?cc(e,t,za(c,r),Fd(e)):cc(e,t,r,Fd(e))}catch(n){cc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{V.p=a,o!==null&&s.types!==null&&(o.types=s.types),B.T=o}}function Qs(){}function $s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ec(e).queue;Zs(e,a,t,de,n===null?Qs:function(){return tc(e),n(r)})}function ec(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:de},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tc(e){var t=ec(e);t.next===null&&(t=e.alternate.memoizedState),cc(e,t.next.queue,{},Fd())}function nc(){return xa(ph)}function rc(){return as().memoizedState}function ic(){return as().memoizedState}function ac(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=po(n);var r=mo(t,e,n);r!==null&&(Rd(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function oc(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?dc(t,n):(n=xi(e,t,n,r),n!==null&&(Rd(n,e,r),fc(n,t,r)))}function sc(e,t,n){cc(e,t,n,Fd())}function cc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))dc(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,Ir(s,o))return bi(e,t,i,0),ed===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return Rd(n,e,r),fc(n,t,r),!0}return!1}function lc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(i(479))}else t=xi(e,n,r,2),t!==null&&Rd(t,e,2)}function uc(e){var t=e.alternate;return e===zo||t!==null&&t===zo}function dc(e,t){Uo=Ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,U(e,n)}}var pc={readContext:xa,use:cs,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useLayoutEffect:Yo,useInsertionEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useSyncExternalStore:Yo,useId:Yo,useHostTransitionStatus:Yo,useFormState:Yo,useActionState:Yo,useOptimistic:Yo,useMemoCache:Yo,useCacheRefresh:Yo,useEffectEvent:Yo},mc={readContext:xa,use:cs,useCallback:function(e,t){return is().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Is(4194308,4,Ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Is(4194308,4,e,t)},useInsertionEffect:function(e,t){Is(4,2,e,t)},useMemo:function(e,t){var n=is();t=t===void 0?null:t;var r=e();if(Wo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=is();if(n!==void 0){var i=n(t);if(Wo){Je(!0);try{n(t)}finally{Je(!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=oc.bind(null,zo,e),[r.memoizedState,e]},useRef:function(e){var t=is();return e={current:e},t.memoizedState=e},useState:function(e){e=bs(e);var t=e.queue,n=sc.bind(null,zo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ks,useDeferredValue:function(e,t){return Ys(is(),e,t)},useTransition:function(){var e=bs(!1);return e=Zs.bind(null,zo,e.queue,!0,!1),is().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=zo,a=is();if(ea){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));nd&127||hs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Rs(_s.bind(null,r,o,e),[e]),r.flags|=2048,Ps(9,{destroy:void 0},gs.bind(null,r,o,n,t),null),n},useId:function(){var e=is(),t=ed.identifierPrefix;if(ea){var n=Ki,r=Gi;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:nc,useFormState:ks,useActionState:ks,useOptimistic:function(e){var t=is();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lc.bind(null,zo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ls,useCacheRefresh:function(){return is().memoizedState=ac.bind(null,zo)},useEffectEvent:function(e){var t=is(),n={impl:e};return t.memoizedState=n,function(){if($u&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hc={readContext:xa,use:cs,useCallback:qs,useContext:xa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ds,useRef:Fs,useState:function(){return ds(us)},useDebugValue:Ks,useDeferredValue:function(e,t){return Xs(as(),Bo.memoizedState,e,t)},useTransition:function(){var e=ds(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:As,useActionState:As,useOptimistic:function(e,t){return xs(as(),Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs},gc={readContext:xa,use:cs,useCallback:qs,useContext:xa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ps,useRef:Fs,useState:function(){return ps(us)},useDebugValue:Ks,useDeferredValue:function(e,t){var n=as();return Bo===null?Ys(n,e,t):Xs(n,Bo.memoizedState,e,t)},useTransition:function(){var e=ps(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){var n=as();return Bo===null?(n.baseState=e,[e,n.queue.dispatch]):xs(n,Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs};function _c(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 vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Rd(t,e,n),ho(t,e,n))}};function yc(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?!Lr(n,r)||!Lr(i,a):!0}function bc(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&&vc.enqueueReplaceState(t,t.state,null)}function xc(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 Sc(e){hi(e)}function Cc(e){console.error(e)}function wc(e){hi(e)}function G(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){G(e,t)},n}function Dc(e){return e=po(e),e.tag=3,e}function Oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=/* @__PURE__ */ new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=/* @__PURE__ */ new Set([r]):t.add(r),yf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */ new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=/* @__PURE__ */ new Set([r]):n.add(r)),yf(e,r,a)),!1}throw Error(i(435,n.tag))}return yf(e,r,a),Xd(),!1}if(ea)return t=Do.current,t===null?(r!==ra&&(t=Error(i(423),{cause:r}),ua(Li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Li(r,n),a=Ec(e.stateNode,r,a),go(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ra&&(e=Error(i(422),{cause:r}),ua(Li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Li(o,n),hd===null?hd=[o]:hd.push(o),ld!==4&&(ld=2),t===null)return!0;r=Li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ec(n.stateNode,r,e),go(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`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Zo(e,t,n,o,a,i),s=ts(),e!==null&&!jc?(ns(e,t,i),sl(e,t,i)):(ea&&s&&Yi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=ji(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return so(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function Vc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ea){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(Ao(t),(e=$i)?(e=fm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ao(t),a){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||va(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(So.current===null){if(r=ed,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Si(e,s),Rd(r,e,s),Ac;Xd()}t=Bc(e,t,n)}else e=o.treeContext,$i=gm(s.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=ki(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,r,i){return ba(t),n=Zo(e,t,n,r,void 0,i),r=ts(),e!==null&&!jc?(ns(e,t,i),sl(e,t,i)):(ea&&r&&Yi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=$o(t,r,n,i),Qo(e),r=ts(),e!==null&&!jc?(ns(e,t,a),sl(e,t,a)):(ea&&r&&Yi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ti,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=vc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(_c(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&&vc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),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=xc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ti,typeof u==`object`&&u&&(o=xa(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)&&bc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(_c(t,n,d,r),l=t.memoizedState),(c=lo||yc(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,fo(e,t),o=t.memoizedProps,u=xc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ti,typeof l==`object`&&l&&(c=xa(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)&&bc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(_c(t,n,s,r),p=t.memoizedState),(u=lo||yc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return ca(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Wa()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ea){if(i?ko(t):Mo(),(e=$i)?(e=fm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=Mi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(ko(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ki(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Mi(i,a,n,null),i.flags|=2):i=ki(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=ki(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return so(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(Mo(),o=a.fallback,s=t.mode,a=Qc({mode:`visible`,children:a.children},s),o=Mi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,so(t,e.child,null,c),a=t.child,a.memoizedState=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),mm(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,ua({value:a,source:null,stack:null})),$c(e,t,c)}if(jc||va(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(So.current!==null)return $c(e,t,c);if(r=ed,r!==null&&(a=dt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Si(e,a),Rd(r,e,a),Ac;return pm(o)||Xd(),$c(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=gm(o.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Zc(t,a.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function rl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function il(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=ea?Vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tl(e,n,t);else if(e.tag===19)tl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(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=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function ll(e,t,n){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Ce(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(ko(t),e=sl(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return sl(e,t,n)}function K(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,ea&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Oi(e)?(r=xc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===R){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=le(e)||e,Error(i(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=xc(r,t.pendingProps),Gc(e,t,r,a,n);case 3:a:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),vo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Kc(e,t,r,n);break a}if(r!==a){a=Li(Error(i(424)),t),ua(a),t=Kc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for($i=gm(e.firstChild),Qi=t,ea=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ea||(t.stateNode=yp(t.type,t.pendingProps,ye.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&ea&&(r=t.stateNode=Sm(t.type,t.pendingProps,ye.current),Qi=t,na=!0,a=$i,kp(t.type)?(_m=a,$i=gm(r.firstChild)):$i=a),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ea&&((a=r=$i)&&(r=um(r,t.type,t.pendingProps,na),r===null?a=!1:(t.stateNode=r,Qi=t,$i=gm(r.firstChild),na=!1,a=!0)),a||ia(t)),Ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,bp(a,o)?r=null:s!==null&&bp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Zo(e,t,es,null,null,n),ph._currentValue=a),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&ea&&((e=n=$i)&&(n=dm(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ia(t)),null;case 13:return Xc(e,t,n);case 4:return xe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Ha(),a===null&&(a=ed,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),ma(t,Da,a)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Da,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ea&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(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(qd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function fl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(qd())e.flags|=8192;else throw Qa=Ja,Ka}}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,md|=t)}function ml(e,t){if(!ea)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 hl(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 gl(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hl(t),null;case 1:return hl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),Se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?ul(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),hl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ul(t),o===null?(hl(t),dl(t,a,null,r,n)):(hl(t),fl(t,o))):o?o===e.memoizedState?(hl(t),t.flags&=-16777217):(ul(t),hl(t),fl(t,o)):(e=e.memoizedProps,e!==r&&ul(t),hl(t),dl(t,a,e,r,n)),null;case 27:if(we(t),n=ye.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}e=_e.current,sa(t)?aa(t,e):(e=Sm(a,r,n),t.stateNode=e,ul(t))}return hl(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}if(o=_e.current,sa(t))aa(t,o);else{var s=gp(ye.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[_t]=t,o[vt]=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&&ul(t)}}return hl(t),t.subtreeFlags&=-33554433,dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ye.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||ia(t,!0)}else e=gp(e).createTextNode(r),e[_t]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(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[_t]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(i(558))}return hl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(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[_t]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(No(t),t):(No(t),null)}return No(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),pl(t,t.updateQueue),hl(t),null);case 4:return Se(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,hl(t),null;case 10:return ha(t.type),hl(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return hl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ml(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lo(e),o!==null){for(t.flags|=128,ml(r,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return Fo(t,Po.current&1|2),ea&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>bd&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),ml(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ea)return hl(t),null}else 2*Le()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,ml(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=Le(),e.sibling=null,o=Po.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ea?Fo(t,o):(n=o,ge(Do,t),ge(Po,n),Oo===null&&(Oo=t)),ea&&qi(t,r.treeForkCount),e}return hl(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(hl(t),t.subtreeFlags&6&&(t.flags|=8192)):hl(t),n=t.updateQueue,n!==null&&pl(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&&he(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),hl(t),null;case 25:return null;case 30:return t.flags|=33554432,hl(t),null}throw Error(i(156,t.tag))}function _l(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),Se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(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 Se(),null;case 10:return ha(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&he(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function vl(e,t){switch(Xi(t),t.tag){case 3:ha(Da),Se();break;case 26:case 27:case 5:we(t);break;case 4:Se();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ha(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&he(Va);break;case 24:ha(Da)}}function yl(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){vf(t,t.return,e)}}function bl(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){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){vf(e,e.return,t)}}}function Sl(e,t,n){n.props=xc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function Cl(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=fi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Vp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Hp(e);m(e.child,!1,am,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){vf(e,t,n)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(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){vf(e,t,n)}else n.current=null}}function Tl(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++)sm(e.stateNode,t[n])}function El(e){for(var t=e.return;t!==null&&(kl(t)&&sm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Dl(e){for(var t=e.return;t!==null&&(kl(t)&&cm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Ol(e){return e.tag===5||e.tag===3||e.tag===27}function kl(e){return e&&e.tag===7&&e.stateNode!==null}function Al(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){vf(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;dp(r,e.type,n,t),r[vt]=t}catch(t){vf(e,e.return,t)}}function Ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kp(e.type)||e.tag===4}function Nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ml(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&&kp(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 Pl(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=pn)),Tl(e,r),Vt=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,kp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Tl(e,r),Vt=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,kp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e){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[_t]=e,t[vt]=n}catch(t){vf(e,e.return,t)}}var Ll=!1,Rl=null;function zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ll=!0)}var Bl=null;function Vl(){var e=Bl;return Bl=null,e}var Hl=0;function Ul(e,t,n,r,i){return Hl=0,Wl(e.child,t,n,r,i)}function Wl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Fp(o);r.push(s),s.view&&(a=!0)}else a||Fp(o).view&&(a=!0);Ll=!0,Mp(o,Hl===0?t:t+`_`+Hl,n),Hl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Wl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Gl(e,t){for(;e!==null;)e.tag===5?Np(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Gl(e.child,t)),e=e.sibling}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Kl(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=mi(t.default,t.share),t!==`none`&&(Ul(e,n,t,null,!1)||Gl(e.child,!1))}e=e.sibling}}function ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=fi(r,n),a=mi(r.default,n.paired?r.share:r.enter);a===`none`?Kl(e):Ul(e,i,a,null,!1)?(Kl(e),n.paired||t||Ld(e,r.onEnter)):Gl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e,t),e=e.sibling;else Kl(e)}function Jl(e){if(Rl!==null&&Rl.size!==0){var t=Rl;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=mi(n.default,n.share);if(a!==`none`&&(Ul(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Gl(e.child,!1)),t.delete(r),t.size===0)break}}}Jl(e)}e=e.sibling}}}function Yl(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=Rl===null?void 0:Rl.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ul(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Rl.delete(n),Ld(e,t.onShare)):Gl(e.child,!1)),Rl!==null&&Jl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Rl!==null&&Jl(e)}function Xl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode);t=mi(t.default,t.update),e.flags&=-5,t!==`none`&&Ul(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Xl(e);e=e.sibling}}function Zl(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,Gl(e.child,!1))}Zl(e)}e=e.sibling}}function Ql(e){if(e.tag===30)e.stateNode.paired=null,Gl(e.child,!1),Zl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Zl(e)}function $l(e){for(e=e.child;e!==null;)e.tag===30?Gl(e.child,!1):e.subtreeFlags&33554432&&$l(e),e=e.sibling}function eu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Hl<a.length){var l=a[Hl],u=Fp(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&&Mp(c,Hl===0?n:n+`_`+Hl,i),s&&e.flags&4||(Bl===null&&(Bl=[]),Bl.push(c,Hl===0?r:r+`_`+Hl,t.memoizedProps)),Hl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:eu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function tu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=fi(n,r),a=mi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ip)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Hl=0,i=eu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&tu(e,t);e=e.sibling}}var nu=!1,ru=!1,iu=!1,au=!1,ou=typeof WeakSet==`function`?WeakSet:Set,su=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,mp=xh,e=Hr(e),Ur(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(hp={focusedElem:e,selectionRange:r},xh=!1,n=(n&335544064)===n,su=t,t=n?9270:1024;su!==null;){if(e=su,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Yl(r[a]);if(e.alternate===null&&e.flags&2)n&&zl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Yl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&zl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,su=r):(n&&Xl(e),pu(n))}}Rl=null}function pu(e){for(;su!==null;){var t=su,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=xc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(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=fi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=mi(a.default,a.update),a!==`none`&&Ul(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,su=r;break}su=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&yl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=xc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&xl(n),r&512&&Cl(n,n.return);break;case 3:if(Pu(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{xo(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Il(n);case 26:case 5:Pu(e,n),t===null&&r&4&&Al(n),r&512&&Cl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||nu,!r){var a=t!==null&&t.memoizedState!==null||ru;t=nu,i=ru,nu=r,(ru=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),nu=t,ru=i}break;case 30:Pu(e,n),r&512&&Cl(n,n.return);break;case 7:r&512&&Cl(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(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){vf(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Vt=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?jp(s,!0):jp(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Et(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 yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:ru||wl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ru&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ru||wl(n,t),Dl(n);var r=yu,i=bu;kp(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:ru||wl(n,t),Dl(n);case 6:if(n.tag===6&&Dl(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),Vt=!0}catch(e){vf(n,t,e)}else try{yu.removeChild(n.stateNode),Vt=!0}catch(e){vf(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,Ap(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qh(e)):Ap(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),ru||bl(4,n,t),xu(e,t,n);break;case 1:ru||(wl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Sl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:ru=(r=ru)||n.memoizedState!==null,xu(e,t,n),ru=r;break;case 30:wl(n,t),xu(e,t,n);break;case 7:ru||wl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qh(e)}catch(e){vf(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qh(e)}catch(e){vf(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ou),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ou),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Du(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(kp(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(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}Du(t,e,n),Au(e),a&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),a&64&&nu&&(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=Ou,Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(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(nu)e.stateNode=yp(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[wt]||r[_t]||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[_t]=e,jt(r),t=r;break a;case`link`:if(o=Qm(`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=Qm(`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[_t]=e,jt(r),t=r}e.stateNode=t}}else nu||$m(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&jl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ru||t.parentNode.removeChild(t)):a.count--,n===null?nu||$m(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),r!==null&&a&4&&jl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=iu,iu=!1,Du(t,e,n),iu=o,Au(e),a&512&&(ru||r===null||wl(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),Vt=!0}catch(t){vf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,jl(e,t,r===null?t:r.memoizedProps)),a&1024&&(au=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Vt=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(Vt=!1,Zm=null,o=Ou,Ou=Dm(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{qh(t.containerInfo)}catch(t){vf(e,e.return,t)}au&&(au=!1,ju(e)),Vt=!1;break;case 4:a=iu,iu=nu,r=Ht(),o=Ou,Ou=Dm(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,Vt&&lu&&(uu=!0),Vt=r,iu=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=Le()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=nu,l=ru,u=iu;nu=c||o,iu=u||o,ru=l||s,Du(t,e,n),ru=l,iu=u,nu=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||nu||ru||(t=s||ru,n=nu,r=ru,nu=o||nu,ru=t,Fu(e,2),nu=n,ru=r),!o&&iu||hu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(ru||r===null||wl(r,r.return)),a=Ht(),o=lu,s=(n&335544064)===n,c=e.memoizedProps,lu=s&&mi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&Vt&&(e.flags|=4),lu=o,Vt=a;break;case 21:break;case 7:a&512&&(ru||r===null||wl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ml(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(kl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ol(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Fl(e,Nl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),Fl(e,Nl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Pl(e,Nl(e),u,s);break;default:throw Error(i(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,xh=!0,t.reset(),xh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else tu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)ql(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Vl(),Mu(t,e),!cu&&!uu){if(e=Bl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Np(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`})),du=!0}Bl=null;break;case 5:Mu(t,e);break;case 4:r=cu,cu=!1,Mu(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):ql(e,!1));break;case 30:r=cu,i=Vl(),cu=!1,Mu(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=fi(a,o),o=fi(n.memoizedProps,o);var s=mi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Hl=0,t=eu(e,n,t,o,s,a,!0),Hl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Bl=i):i!==null&&(i.push.apply(i,Bl),Bl=i),cu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),Fu(n,r);break;case 1:wl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Sl(n,n.return,i),Fu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:wl(n,n.return),n.tag!==5&&n.tag!==27||Dl(n),Fu(n,r);break;case 6:Dl(n);break;case 26:wl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ru||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:wl(n,n.return),Fu(n,r);break;case 7:wl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(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:Iu(i,a,n),yl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(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++)bo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&xl(a),Cl(a,a.return);break;case 27:n&2&&Il(a);case 5:a.tag!==5&&a.tag!==27||El(a),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 6:El(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||nu||$m(Dm(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),Cl(a,a.return);break;case 30:Iu(i,a,n),Cl(a,a.return);break;case 7:Cl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(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&&ka(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&$l(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&yl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(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&&ka(a)));break;case 12:if(a&2048){zu(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){vf(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(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&&Ql(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Ql(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Gl(a.child,!0),Gl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(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:Vu(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(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:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=Ou;Ou=Dm(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Rl===null&&(Rl=/* @__PURE__ */ new Map),Rl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(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 qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&bl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;su!==null;){var n=su;switch(n.tag){case 0:case 11:case 15:bl(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:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,su=r;else a:for(n=e;su!==null;){r=su;var i=r.sibling,a=r.return;if(vu(r),r===n){su=null;break a}if(i!==null){i.return=a,su=i;break a}su=a}}}var Zu={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,$u=0,ed=null,td=null,nd=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return $u&2&&nd!==0?nd&-nd:B.T===null?mt():zf()}function Id(){if(pd===0){if(!(nd&536870912)||ea){var e=et;et<<=1,!(et&3932160)&&(et=262144),pd=e}else pd=536870912}return e=Do.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Vp(fi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===ed&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,nd,pd,!1)),lt(e,n),(!($u&2)||e!==ed)&&(e===ed&&(!($u&2)&&(dd|=n),ld===4&&Hd(e,nd,pd,!1)),jf(e))}function zd(e,t,n){if($u&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),a=r?$d(e,t):Zd(e,t,!0),o=r;do{if(a===0){od&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Vd(n)){a=Zd(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=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=o,dd|=o,a=4;break a}o=gd,gd=a,o!==null&&(gd===null?gd=o:gd.push.apply(gd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Gd(e,0),Hd(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:Hd(r,t,pd,!ad);break a;case 2:gd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=vd+300-Le(),10<a)){if(Hd(r,t,pd,!ad),rt(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=Cp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,ad,o,`Throttled`,-0,0),a);break a}Bd(r,n,gd,xd,_d,t,pd,dd,md,ad,o,null,-0,0)}break}while(1);jf(e)}function Bd(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:pn},Rl=null,Gu(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?vd-Le():(a&4194048)===a?yd-Le():0,m=sh(d,m),m!==null)){Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l);return}sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(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(!Ir(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 Hd(e,t,n,r){t=at(e,t),t&=~fd,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ut(e,n,t)}function Ud(){return $u&6?!0:(Mf(0,!1),!1)}function Wd(){if(td!==null){if(rd===0)var e=td.return;else e=td,pa=fa=null,rs(e),to=null,no=0,e=td;for(;e!==null;)vl(e.alternate,e),e=e.return;td=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),ed=e,td=n=ki(e.current,null),nd=t,rd=0,id=null,ad=!1,od=it(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=at(e,t),yi(),n}function Kd(e,t){zo=null,B.H=pc,t===Ga||t===qa?(t=$a(),rd=3):t===Ka?(t=$a(),rd=4):rd=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,td===null&&(ld=1,G(e,Li(t,e.current)))}function qd(){var e=Do.current;return e===null?!0:(nd&4194048)===nd?Oo===null:(nd&62914560)===nd||nd&536870912?e===Oo:!1}function Jd(){var e=B.H;return B.H=pc,e===null?pc:e}function Yd(){var e=B.A;return B.A=Zu,e}function Xd(){ld=4,ad||(nd&4194048)!==nd&&Do.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||ed===null||Hd(ed,nd,pd,!1)}function Zd(e,t,n){var r=$u;$u|=2;var i=Jd(),a=Yd();(ed!==e||nd!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&td!==null){var s=td,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=rd;if(rd=0,id=null,rf(e,s,c,l),n&&od){o=0;break a}break;default:l=rd,rd=0,id=null,rf(e,s,c,l)}}Qd(),o=ld;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,$u=r,B.H=i,B.A=a,td===null&&(ed=null,nd=0,yi()),o}function Qd(){for(;td!==null;)tf(td)}function $d(e,t){var n=$u;$u|=2;var r=Jd(),a=Yd();ed!==e||nd!==t?(xd=null,bd=Le()+500,Gd(e,t)):od=it(e,t);a:do try{if(rd!==0&&td!==null){t=td;var o=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,o,1);break;case 2:case 9:if(Ya(o)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||ed!==e||(rd=7),jf(e)},o.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Ya(o)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,o,7));break;case 5:var s=null;switch(td.tag){case 26:s=td.memoizedState;case 5:case 27:var c=td;if(s?nh(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)td=l;else{var u=c.return;u===null?td=null:(td=u,af(u))}break b}}rd=0,id=null,rf(e,t,o,5);break;case 6:rd=0,id=null,rf(e,t,o,6);break;case 8:Wd(),ld=6;break a;default:throw Error(i(462))}}ef();break}catch(t){Kd(e,t)}while(1);return pa=fa=null,B.H=r,B.A=a,$u=n,td===null?(ed=null,nd=0,yi(),ld):0}function ef(){for(;td!==null&&!Fe();)tf(td)}function tf(e){var t=K(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,nd);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,nd);break;case 5:rs(t);var r=t;r===Qi&&(ea?(oa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(oa(r),ea=!0));default:vl(n,t),t=td=Ai(t,cd),t=K(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function rf(e,t,n,r){pa=fa=null,rs(t),to=null,no=0;var i=t.return;try{if(kc(e,i,t,n,nd)){ld=1,G(e,Li(n,e.current)),td=null;return}}catch(t){if(i!==null)throw td=i,t;ld=1,G(e,Li(n,e.current)),td=null;return}t.flags&32768?(ea||r===1?e=!0:od||nd&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,ad);return}e=t.return;var n=gl(t.alternate,t,cd);if(n!==null){td=n;return}if(t=t.sibling,t!==null){td=t;return}td=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=_l(e.alternate,e);if(n!==null){n.flags&=32767,td=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){td=e;return}td=e=n}while(e!==null);ld=6,td=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if($u&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(td=ed=null,nd=0),Td=t,wd=e,Ed=n,Od=a,kd=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=vi,H(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Ma(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(Ve,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ll=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=B.T,B.T=null,i=V.p,V.p=2,a=$u,$u|=4;try{fu(e,t,n)}finally{$u=a,V.p=i,B.T=r}}Cd=1,Ll?Ad=zp(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(Cd!==0){var t=wd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Cd===3&&(Cd=0,Nu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=B.T,B.T=null;var i=V.p;V.p=2;var a=$u;$u|=4;try{lu=uu=!1,ku(t,e,n),n=hp;var o=Hr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Vr(s.ownerDocument.documentElement,s)){if(c!==null&&Ur(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 _=Br(s,h),v=Br(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}}xh=!!mp,hp=mp=null}finally{$u=a,V.p=i,B.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=B.T,B.T=null;var r=V.p;V.p=2;var i=$u;$u|=4;try{mu(e,t.alternate,t)}finally{$u=i,V.p=r,B.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Ie();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),pt(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=B.T,a=V.p,V.p=2,B.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{B.T=n,V.p=a}}if(i=jd,o=Md,Md=null,i!==null&&(jd=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);Ed&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=pt(Ed),r=B.T,a=V.p;try{V.p=32>n?32:n,B.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,$u&6)throw Error(i(331));var c=$u;if($u|=4,Ju(o.current),Bu(o,o.current,s,n),$u=c,Mf(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,o)}catch{}return!0}finally{V.p=a,B.T=r,mf(e,t)}}function _f(e,t,n){t=Li(n,t),t=Ec(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(lt(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Li(n,e),n=Dc(2),r=mo(t,n,2),r!==null&&(Oc(n,r,t,e),lt(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;var i=/* @__PURE__ */ new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=/* @__PURE__ */ new Set,r.set(t,i));i.has(n)||(sd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(nd&n)===n&&(ld===4||ld===3&&(nd&62914560)===nd&&300>Le()-vd?$u&2?fd|=n:Gd(e,0):fd|=n,md===nd&&(md=0)),jf(e)}function xf(e,t){t===0&&(t=st()),e=Si(e,t),e!==null&&(lt(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(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),xf(e,n)}function wf(e,t){return Ne(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;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-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=nd,a=rt(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&Sp()&&(e=Af);for(var t=Le(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Cd!==0&&Cd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=nd,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),pt(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=If.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=nd;return r=rt(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Ff(e,Le()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;zd(e,t,!0)}function Rf(){Dp(function(){$u&6?Ne(ze,Nf):Pf()})}function zf(){if(Af===0){var e=Fa;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);$s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),$s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<li.length;Hf++){var Uf=li[Hf];ui(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}ui(ti,`onAnimationEnd`),ui(ni,`onAnimationIteration`),ui(ri,`onAnimationStart`),ui(`dblclick`,`onDoubleClick`),ui(`focusin`,`onFocus`),ui(`focusout`,`onBlur`),ui(ii,`onTransitionRun`),ui(ai,`onTransitionStart`),ui(oi,`onTransitionCancel`),ui(si,`onTransitionEnd`),It(`onMouseEnter`,[`mouseout`,`mouseover`]),It(`onMouseLeave`,[`mouseout`,`mouseover`]),It(`onPointerEnter`,[`pointerout`,`pointerover`]),It(`onPointerLeave`,[`pointerout`,`pointerover`]),Ft(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ft(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ft(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ft(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`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(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(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){hi(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){hi(e)}i.currentTarget=null,a=c}}}}function qf(e,t){var n=t[bt];n===void 0&&(n=t[bt]=/* @__PURE__ */ 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,Nt.forEach(function(t){t!==`selectionchange`&&(Gf.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(Oh(t)){case 2:var i=Sh;break;case 8:i=Ch;break;default:i=wh}n=i.bind(null,t,n,e),i=void 0,!Cn||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=Dt(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}bn(function(){var r=a,i=hn(n),s=[];a:{var c=ci.get(e);if(c!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;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=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ti:case ni:case ri:l=Wn;break;case si:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}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=xn(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!==mn&&(u=n.relatedTarget||n.fromElement)&&(Dt(u)||u[yt]))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?Dt(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=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:kt(c),h=l==null?u:kt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Dt(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?kt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=wr;else if(vr(c)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&ln(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?kt(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Gr=v,Kr=r,qr=null);break;case`focusout`:qr=Kr=Gr=null;break;case`mousedown`:Jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jr=!1,Yr(s,n,i);break;case`selectionchange`:if(Wr)break;case`keydown`:case`keyup`:Yr(s,n,i)}var y;if(or)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 mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=ep(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Vf(s,e,r,n,i)}Kf(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=xn(e,n),i!=null&&r.unshift($f(e,i,a)),i=xn(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=xn(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=xn(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,`
49
+ `).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===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Wt(e,`class`,r);break;case`tabIndex`:Wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Wt(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Wt(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=fn(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=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`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=fn(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`:qf(`beforetoggle`,e),qf(`toggle`,e),Ut(e,`popover`,r);break;case`xlinkActuate`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ut(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=un.get(n)||n,Ut(e,n,r);else return}Vt=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:cn(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`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Pt.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[vt]||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}Vt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ut(e,n,r)}return}Vt=!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`:qf(`error`,e),qf(`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`:qf(`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)}}$t(e,o,c,l,u,s,a,!1);return;case`select`:for(a in qf(`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&&tn(e,!!r,n,!0):tn(e,!!r,t,!1);return;case`textarea`:for(s in qf(`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)}rn(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`:qf(`beforetoggle`,e),qf(`toggle`,e),qf(`cancel`,e),qf(`close`,e);break;case`iframe`:case`object`:qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)qf(Wf[r],e);break;case`image`:qf(`error`,e),qf(`load`,e);break;case`details`:qf(`toggle`,e);break;case`embed`:case`source`:case`link`:qf(`error`,e),qf(`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(ln(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&&(Vt=!0),o=m;break;case`name`:m!==f&&(Vt=!0),a=m;break;case`checked`:m!==f&&(Vt=!0),u=m;break;case`defaultChecked`:m!==f&&(Vt=!0),d=m;break;case`value`:m!==f&&(Vt=!0),s=m;break;case`defaultValue`:m!==f&&(Vt=!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)}}Qt(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&&(Vt=!0),p=o;break;case`defaultValue`:o!==l&&(Vt=!0),c=o;break;case`multiple`:o!==l&&(Vt=!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?tn(e,!!n,n?[]:``,!1):tn(e,!!n,t,!0)):tn(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&&(Vt=!0),p=a;break;case`defaultValue`:a!==o&&(Vt=!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)}nn(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&&(Vt=!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(ln(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 fp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){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&&fp(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&&fp(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 mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 vp(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 yp(e,t,n,r){return n=gp(n).createElement(e),n[_t]=r,n[vt]=t,lp(n,e,t),jt(n),n}function bp(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 xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,Ep=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Dp=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Op)};function Op(e){setTimeout(function(){throw e})}function kp(e){return e===`head`}function Ap(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),qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);qh(t)}function jp(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 Mp(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 Np(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 Pp(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 Fp(e){return Pp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ip(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Pp(t,n,e)}function Lp(e){return e.documentElement.clientHeight}function Rp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function zp(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`&&(Lp(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+=rh(f),u>oh){s.length=o;break}f=new Promise(Rp.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 Bp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Bp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Bp.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},Bp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vp(e){return{name:e,group:new Bp(`group`,e),imagePair:new Bp(`image-pair`,e),old:new Bp(`old`,e),new:new Bp(`new`,e)}}function Hp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hp.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(qp(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=Gp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Up,e,s,r)}this._eventListeners=a}};function Up(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Hp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Gp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Wp,e,n,i),r.splice(t,1),a!==null&&a()}};function Wp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Gp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Kp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function qp(e,t,n,r){if(e.length===0)return-1;r=Kp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Kp(a.optionsOrUseCapture)===r)return i}return-1}Hp.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,Gp(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,Gp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Hp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=b(e),bm(e,t))}Hp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Yp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Jp(t[n],e);n--);};function Yp(e,t){return t.push(e),!1}Hp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=gp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Xp,e,void 0,void 0))};function Xp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Hp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=/* @__PURE__ */ new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Hp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Qp,e,void 0,void 0);for(var n=t=0;n<$p.length;n++){var r=$p[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):$p[t++]=r}$p.length=t}};function Qp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var $p=[],em=!1;function tm(e,t,n){$p.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=$p;$p=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Hp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(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}Hp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Hp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Yp,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||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=Dt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function im(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)}Hp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Yp,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),im(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),im(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=b(e),om(e,t),!1}function om(e,t){e.reactFragments??=/* @__PURE__ */ new Set,e.reactFragments.add(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.addEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<$p.length;i++){var a=$p[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&($p[r++]=a)}$p.length=r,n.observe(e)}),om(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(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`:lm(n),Et(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(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[wt])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=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(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 gm(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 _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(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 bm(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 xm(e){Ep(function(){Ep(function(t){return e(t)})})}function Sm(e,t,n){switch(t=gp(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 Cm(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===pn&&(e.onclick=null),Et(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Et(e)}var Tm=/* @__PURE__ */ new Map,Em=/* @__PURE__ */ new Set;function Dm(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 Om=V.d;V.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Ud();return e||t}function Am(e){var t=Ot(e);t!==null&&t.tag===5&&t.type===`form`?tc(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=Zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),jt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Zt(n.imageSizes)+`"]`)):i+=`[href="`+Zt(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[Tt]=!0,o.onload=o.onerror=function(){Mt(o)}),jt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Zt(r)+`"][href="`+Zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),lp(r,`link`,e),jt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=At(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);jt(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,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=At(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),jt(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){Om.M(e,t);var n=jm;if(n&&e){var r=At(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),jt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=ye.current)?Dm(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=Vm(n.href),t=At(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=Vm(n.href);var o=At(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(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.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},Tm.set(e,o)),Wm(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=Gm(n),t=At(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 Vm(e){return`href="`+Zt(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Tt]){r.loading=1;return}}else t=e.createElement(`link`),t[Tt]=!0,t.onload=t.onerror=Mt.bind(null,t),lp(t,`link`,n),jt(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 Gm(e){return`[src="`+Zt(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Zt(n.href)+`"]`);if(r)return t.instance=r,jt(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`),jt(r),lp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,jt(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),jt(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,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,jt(a),a):(r=n,(a=Tm.get(o))&&(r=D({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),jt(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,Jm(r,n.precedence,e));return t.instance}function Jm(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 Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=/* @__PURE__ */ new Map,i=Zm=/* @__PURE__ */ new Map;i.set(n,r)}else i=Zm,r=i.get(n),r||(r=/* @__PURE__ */ 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[wt]||a[_t]||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 $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(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 th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ah(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=Vm(r.href),a=t.querySelector(Hm(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,jt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),jt(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=/* @__PURE__ */ 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 oh=0;function sh(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&&oh===0&&(oh=62500*pp());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>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function q(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--,q(this)}function lh(){this.imgCount--,q(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=/* @__PURE__ */ 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=/* @__PURE__ */ 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:F,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function J(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=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(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=/* @__PURE__ */ new Map}function mh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new J(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function hh(e){return e?(e=Ti,e):Ti}function gh(e,t,n,r,i,a){i=hh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Rd(n,e,t),ho(n,e,t))}function _h(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vh(e,t){_h(e,t),(e=e.alternate)&&_h(e,t)}function yh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Rd(t,e,67108864),vh(e,67108864)}}function bh(e){if(e.tag===13||e.tag===31){var t=Fd();t=ft(t);var n=Si(e,t);n!==null&&Rd(n,e,t),vh(e,t)}}var xh=!0;function Sh(e,t,n,r){var i=B.T;B.T=null;var a=V.p;try{V.p=2,wh(e,t,n,r)}finally{V.p=a,B.T=i}}function Ch(e,t,n,r){var i=B.T;B.T=null;var a=V.p;try{V.p=8,wh(e,t,n,r)}finally{V.p=a,B.T=i}}function wh(e,t,n,r){if(xh){var i=Th(r);if(i===null)Qf(e,t,r,Eh,n),Lh(e,r);else if(zh(i,e,t,n,r))r.stopPropagation();else if(Lh(e,r),t&4&&-1<Ih.indexOf(e)){for(;i!==null;){var a=Ot(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}jf(a),!($u&6)&&(bd=Le()+500,Mf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Rd(s,a,2),Ud(),vh(a,2)}if(a=Th(r),a===null&&Qf(e,t,r,Eh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Th(e){return e=hn(e),Dh(e)}var Eh=null;function Dh(e){if(Eh=null,e=Dt(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 Eh=e,null}function Oh(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(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var kh=!1,Ah=null,jh=null,Mh=null,Nh=/* @__PURE__ */ new Map,Ph=/* @__PURE__ */ new Map,Fh=[],Ih=`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 Lh(e,t){switch(e){case`focusin`:case`focusout`:Ah=null;break;case`dragenter`:case`dragleave`:jh=null;break;case`mouseover`:case`mouseout`:Mh=null;break;case`pointerover`:case`pointerout`:Nh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ph.delete(t.pointerId)}}function Rh(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=Ot(t),t!==null&&yh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zh(e,t,n,r,i){switch(t){case`focusin`:return Ah=Rh(Ah,e,t,n,r,i),!0;case`dragenter`:return jh=Rh(jh,e,t,n,r,i),!0;case`mouseover`:return Mh=Rh(Mh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Nh.set(a,Rh(Nh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ph.set(a,Rh(Ph.get(a)||null,e,t,n,r,i)),!0}return!1}function Bh(e){var t=Dt(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,ht(e.priority,function(){bh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ht(e.priority,function(){bh(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 Vh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Th(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=Ot(n),t!==null&&yh(t),e.blockedOn=n,!1;t.shift()}return!0}function Hh(e,t,n){Vh(e)&&n.delete(t)}function Uh(){kh=!1,Ah!==null&&Vh(Ah)&&(Ah=null),jh!==null&&Vh(jh)&&(jh=null),Mh!==null&&Vh(Mh)&&(Mh=null),Nh.forEach(Hh),Ph.forEach(Hh)}function Wh(e,n){e.blockedOn===n&&(e.blockedOn=null,kh||(kh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Uh)))}var Gh=null;function Kh(e){Gh!==e&&(Gh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gh===e&&(Gh=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(Dh(r||n)===null)continue;break}var a=Ot(n);a!==null&&(e.splice(t,3),t-=3,$s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qh(e){function t(t){return Wh(t,e)}Ah!==null&&Wh(Ah,e),jh!==null&&Wh(jh,e),Mh!==null&&Wh(Mh,e),Nh.forEach(t),Ph.forEach(t);for(var n=0;n<Fh.length;n++){var r=Fh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fh.length&&(n=Fh[0],n.blockedOn===null);)Bh(n),n.blockedOn===null&&Fh.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[vt]||null;if(typeof a==`function`)o||Kh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(Dh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kh(n)}}}function Jh(){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 Yh(e){this._internalRoot=e}Xh.prototype.render=Yh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;gh(n,Fd(),e,t,null,null)},Xh.prototype.unmount=Yh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gh(e.current,2,null,e,null,null),Ud(),t[yt]=null}};function Xh(e){this._internalRoot=e}Xh.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fh.length&&t!==0&&t<Fh[n].priority;n++);Fh.splice(n,0,e),n===0&&Bh(e)}};var Zh=n.version;if(Zh!==`19.3.0`)throw Error(i(527,Zh,`19.3.0`));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:B,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{Ke=$h.inject(Qh),qe=$h}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Sc,s=Cc,c=wc;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=mh(e,1,!1,null,null,n,r,null,o,s,c,Jh),e[yt]=t.current,Xf(e),new Yh(t)}})),_=/* @__PURE__ */ o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()}));
50
50
  /**
51
51
  * @license lucide-react v1.49.0 - ISC
52
52
  *
@@ -150,86 +150,86 @@ const N={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]
150
150
  * This source code is licensed under the ISC license.
151
151
  * See the LICENSE file in the root directory of this source tree.
152
152
  */
153
- ;L.node;const R=M(L),z={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]}
153
+ ;L.node;const ee=M(L),R={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]}
154
154
  /**
155
155
  * @license lucide-react v1.49.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
159
  */
160
- ;z.node;const ee=M(z),te={name:`face-slightly-smiling-plus`,size:24,node:[[`path`,{d:`M13.267 2.08a10 10 0 108.653 8.653`,key:`1wbpyh`}],[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}]],aliases:[`smile-plus`]}
160
+ ;R.node;const te=M(R),ne={name:`face-slightly-smiling-plus`,size:24,node:[[`path`,{d:`M13.267 2.08a10 10 0 108.653 8.653`,key:`1wbpyh`}],[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}]],aliases:[`smile-plus`]}
161
161
  /**
162
162
  * @license lucide-react v1.49.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
166
  */
167
- ;te.node;const ne=M(te),re={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}
167
+ ;ne.node;const re=M(ne),ie={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}
168
168
  /**
169
169
  * @license lucide-react v1.49.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
173
  */
174
- ;re.node;const ie=M(re),B={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]}
174
+ ;ie.node;const ae=M(ie),z={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]}
175
175
  /**
176
176
  * @license lucide-react v1.49.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
180
  */
181
- ;B.node;const ae=M(B),oe={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}
181
+ ;z.node;const oe=M(z),se={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}
182
182
  /**
183
183
  * @license lucide-react v1.49.0 - ISC
184
184
  *
185
185
  * This source code is licensed under the ISC license.
186
186
  * See the LICENSE file in the root directory of this source tree.
187
187
  */
188
- ;oe.node;const se=M(oe),ce={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]}
188
+ ;se.node;const ce=M(se),le={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]}
189
189
  /**
190
190
  * @license lucide-react v1.49.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
194
  */
195
- ;ce.node;const le=M(ce),V={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]}
195
+ ;le.node;const ue=M(le),B={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]}
196
196
  /**
197
197
  * @license lucide-react v1.49.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
201
  */
202
- ;V.node;const H=M(V),ue={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]}
202
+ ;B.node;const V=M(B),de={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]}
203
203
  /**
204
204
  * @license lucide-react v1.49.0 - ISC
205
205
  *
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
- ;ue.node;const de=M(ue),fe={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]}
209
+ ;de.node;const fe=M(de),pe={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]}
210
210
  /**
211
211
  * @license lucide-react v1.49.0 - ISC
212
212
  *
213
213
  * This source code is licensed under the ISC license.
214
214
  * See the LICENSE file in the root directory of this source tree.
215
215
  */
216
- ;fe.node;const pe=M(fe),me={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]}
216
+ ;pe.node;const me=M(pe),he={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]}
217
217
  /**
218
218
  * @license lucide-react v1.49.0 - ISC
219
219
  *
220
220
  * This source code is licensed under the ISC license.
221
221
  * See the LICENSE file in the root directory of this source tree.
222
222
  */
223
- ;me.node;const he=M(me),ge={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
223
+ ;he.node;const ge=M(he),_e={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
224
224
  /**
225
225
  * @license lucide-react v1.49.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- ;ge.node;const _e=M(ge);var ve=_();const ye={100:{characters:[`💯`],aliases:[]},thumbs_up:{characters:[`👍`],aliases:[`+1`,`thumbsup`]},thumbs_down:{characters:[`👎`],aliases:[`-1`,`thumbsdown`]},clap:{characters:[`👏`],aliases:[]},wave:{characters:[`👋`],aliases:[]},pray:{characters:[`🙏`],aliases:[]},muscle:{characters:[`💪`],aliases:[]},ok_hand:{characters:[`👌`],aliases:[]},point_up:{characters:[`👆`],aliases:[]},point_down:{characters:[`👇`],aliases:[]},point_left:{characters:[`👈`],aliases:[]},point_right:{characters:[`👉`],aliases:[]},raised_hands:{characters:[`🙌`],aliases:[]},shrug:{characters:[`🤷`],aliases:[]},facepalm:{characters:[`🤦`],aliases:[]},heart:{characters:[`❤️`,`❤`],aliases:[]},smile:{characters:[`😊`],aliases:[`slightly_smiling_face`]},laugh:{characters:[`😂`,`😆`],aliases:[`laughing`,`satisfied`,`joy`]},thinking:{characters:[`🤔`],aliases:[`thinking_face`]},sad:{characters:[`😢`],aliases:[`cry`,`white_frowning_face`]},cry:{characters:[`😭`],aliases:[`sob`]},angry:{characters:[`😠`],aliases:[]},love_eyes:{characters:[`😍`],aliases:[`heart_eyes`]},cool:{characters:[`😎`],aliases:[`sunglasses`]},wink:{characters:[`😉`],aliases:[]},surprised:{characters:[`😮`],aliases:[`open_mouth`]},worried:{characters:[`😟`],aliases:[]},confused:{characters:[`😕`],aliases:[]},neutral:{characters:[`😐`],aliases:[`neutral_face`]},sleeping:{characters:[`😴`],aliases:[]},sick:{characters:[`🤢`],aliases:[`nauseated_face`]},mind_blown:{characters:[`🤯`],aliases:[`exploding_head`]},relieved:{characters:[`😌`],aliases:[]},grimace:{characters:[`😬`],aliases:[`grimacing`]},rolling_eyes:{characters:[`🙄`],aliases:[]},hug:{characters:[`🤗`],aliases:[`hugging_face`]},zany:{characters:[`🤪`],aliases:[`zany_face`]},check:{characters:[`✅`,`✔️`],aliases:[`white_check_mark`,`heavy_check_mark`]},x:{characters:[`❌`,`✖️`],aliases:[`heavy_multiplication_x`]},question:{characters:[`❓`,`?`],aliases:[]},exclamation:{characters:[`❗`],aliases:[]},warning:{characters:[`⚠️`],aliases:[]},stop:{characters:[`🛑`],aliases:[`octagonal_sign`]},info:{characters:[`ℹ️`],aliases:[`information_source`]},fire:{characters:[`🔥`],aliases:[]},star:{characters:[`⭐`],aliases:[]},sparkles:{characters:[`✨`],aliases:[]},lightning:{characters:[`⚡`],aliases:[`zap`]},boom:{characters:[`💥`],aliases:[]},eyes:{characters:[`👀`],aliases:[]},green_circle:{characters:[`🟢`],aliases:[`large_green_circle`]},yellow_circle:{characters:[`🟡`],aliases:[`large_yellow_circle`]},red_circle:{characters:[`🔴`],aliases:[]},blue_circle:{characters:[`🔵`],aliases:[`large_blue_circle`]},white_circle:{characters:[`⚪`],aliases:[]},black_circle:{characters:[`⚫`],aliases:[]},rocket:{characters:[`🚀`],aliases:[]},party:{characters:[`🎉`,`🥳`],aliases:[`tada`,`partying_face`]},confetti:{characters:[`🎊`],aliases:[`confetti_ball`]},balloon:{characters:[`🎈`],aliases:[]},gift:{characters:[`🎁`],aliases:[]},trophy:{characters:[`🏆`],aliases:[]},medal:{characters:[`🥇`],aliases:[`first_place_medal`]},lightbulb:{characters:[`💡`],aliases:[`bulb`]},gear:{characters:[`⚙️`],aliases:[]},wrench:{characters:[`🔧`],aliases:[]},hammer:{characters:[`🔨`],aliases:[]},bug:{characters:[`🐛`],aliases:[]},link:{characters:[`🔗`],aliases:[]},lock:{characters:[`🔒`],aliases:[]},unlock:{characters:[`🔓`],aliases:[]},key:{characters:[`🔑`],aliases:[]},pin:{characters:[`📌`],aliases:[`pushpin`]},memo:{characters:[`📝`],aliases:[]},clipboard:{characters:[`📋`],aliases:[]},calendar:{characters:[`📅`],aliases:[]},clock:{characters:[`🕐`],aliases:[`clock1`]},hourglass:{characters:[`⏳`],aliases:[]},bell:{characters:[`🔔`],aliases:[]},megaphone:{characters:[`📢`],aliases:[`mega`]},speech_bubble:{characters:[`💬`],aliases:[`speech_balloon`]},email:{characters:[`📧`],aliases:[]},inbox:{characters:[`📥`],aliases:[`inbox_tray`]},outbox:{characters:[`📤`],aliases:[`outbox_tray`]},package:{characters:[`📦`],aliases:[]},folder:{characters:[`📁`],aliases:[`file_folder`]},file:{characters:[`📄`],aliases:[`page_facing_up`]},chart_up:{characters:[`📈`],aliases:[`chart_with_upwards_trend`]},chart_down:{characters:[`📉`],aliases:[`chart_with_downwards_trend`]},coffee:{characters:[`☕`],aliases:[]},pizza:{characters:[`🍕`],aliases:[]},beer:{characters:[`🍺`],aliases:[]},arrow_up:{characters:[`⬆️`],aliases:[]},arrow_down:{characters:[`⬇️`],aliases:[]},arrow_left:{characters:[`⬅️`],aliases:[]},arrow_right:{characters:[`➡️`],aliases:[]},refresh:{characters:[`🔄`],aliases:[`arrows_counterclockwise`]},sun:{characters:[`☀️`],aliases:[`sunny`]},cloud:{characters:[`☁️`],aliases:[]},rain:{characters:[`🌧️`],aliases:[`rain_cloud`]},snow:{characters:[`❄️`],aliases:[`snowflake`]},rainbow:{characters:[`🌈`],aliases:[]}},be=/* @__PURE__ */ new Map,xe=/* @__PURE__ */ new Map,Se=/* @__PURE__ */ new Map,Ce=e=>e.replace(/️/g,``);function we(e,t,n){be.set(e,e);for(let t of n)be.has(t)||be.set(t,e);t[0]&&xe.set(e,t[0]);for(let n of t)Se.has(Ce(n))||Se.set(Ce(n),e)}for(let[e,t]of Object.entries(ye))we(e,t.characters,t.aliases);we(`rotating_light`,[`🚨`],[]),we(`ship`,[`🚢`],[]);const Te=e=>be.get(e)??e;function Ee(e){let t=e.trim(),n=t.match(/^:?([a-z0-9_+-]+):?$/i);if(n)return Te(n[1].toLowerCase());let r=Se.get(Ce(t));if(r)return r;throw Error(`unknown emoji: ${e} (use a short name like eyes or thumbs_up)`)}const De=e=>xe.get(Te(e))??`:${e}:`,Oe=4194304,ke=26214400,Ae=104857600;function je(e){return e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const Me={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".avif":`image/avif`,".svg":`image/svg+xml`,".mp4":`video/mp4`,".webm":`video/webm`,".mov":`video/quicktime`,".pdf":`application/pdf`,".txt":`text/plain`,".log":`text/plain`,".md":`text/markdown`,".json":`application/json`,".csv":`text/csv`,".html":`text/html`,".zip":`application/zip`};function Ne(e){let t=e.lastIndexOf(`.`);return t>0&&Me[e.slice(t).toLowerCase()]||`application/octet-stream`}const Pe=e=>e.profile!==null&&e.handle.includes(`/`)?`${e.name} via ${e.handle.slice(0,e.handle.indexOf(`/`))}`:e.name;function Fe(e){let t=e.author;if(!t)return e.by.actor;let n=t.handle.indexOf(`/`);return e.by.profile!==null&&n!==-1?`${t.name} via ${t.handle.slice(0,n)}`:t.person&&t.person.handle!==t.handle?`${t.name} (${t.person.handle})`:t.name}function Ie(e,t=Date.now()){let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}d`}function Le(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 Re(e,t=`|`){return e.map(e=>lt(e)).join(t)}function ze(e,t){return typeof t==`bigint`?t.toString():t}var Be=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 Ve(e){return new Be(e)}function He(e){return e==null}function Ue(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function We(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}function Ge(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ke(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function qe(e){return Ke(e._zod.def)??e._zod.def.shape}function Je(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Ge(this,t,e),e},enumerable:!0,configurable:!0})}function Ye(e,t,n){t in e?Ge(e,t,n):e[t]=n}function Xe(e,t,n,r){let i=qe(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Je(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Ye(e,a,r?r(n.value,a):n.value))}}function Ze(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Je(e,n,()=>t[n]):Ye(e,n,r.value))}}function Qe(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function $e(e){return JSON.stringify(e)}function et(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const tt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function nt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const rt=/* @__PURE__*/ Ve(()=>{if(Xt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function it(e){if(nt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return nt(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function at(e){return it(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const ot=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function st(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ct(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(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 lt(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function W(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const ut={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},dt={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function ft(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 Xe(i,e,pt(e,t)),ct(e,Qe(n,{shape:i,checks:[]}))}function pt(e,t){let n=qe(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 mt(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(pt(e,t)),a={};return Xe(a,e,Reflect.ownKeys(qe(e)).filter(e=>!i.has(e))),ct(e,Qe(n,{shape:a,checks:[]}))}function ht(e,t){if(!it(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=qe(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 ct(e,Qe(e._zod.def,{shape:gt(e,t)}))}function gt(e,t){let n={};return Xe(n,e,Reflect.ownKeys(qe(e))),Ze(n,t),n}function _t(e,t){if(!it(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ct(e,Qe(e._zod.def,{shape:gt(e,t)}))}function vt(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 Xe(n,e,Reflect.ownKeys(qe(e))),Xe(n,t,Reflect.ownKeys(qe(t))),ct(e,Qe(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function yt(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(pt(t,n)):void 0,o={};return Xe(o,t,Reflect.ownKeys(qe(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),ct(t,Qe(t._zod.def,{shape:o,checks:[]}))}function bt(e,t,n){let r=n?new Set(pt(t,n)):void 0,i={};return Xe(i,t,Reflect.ownKeys(qe(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),ct(t,Qe(t._zod.def,{shape:i}))}function xt(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 St(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 Ct(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function wt(e){return typeof e==`string`?e:e?.message}function Tt(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Et(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:wt(e.inst?._zod.def?.error?.(e))??wt(a?.(e))??wt(t?.error?.(e))??wt(n.customError?.(e))??wt(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}const Dt=/[\uD800-\uDBFF]/;function Ot(e){let t=e.length;if(!Dt.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 kt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function At(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 jt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Mt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):It(e,n,r.value)}}function Nt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Pt(e,t,n){return Nt(e,t,n,!1)}function Ft(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Nt(this,n,r(this))},set(e){Nt(this,n,e)}})}return t}function It(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Nt(this,t,n.bind(this))},set(e){Nt(this,t,e)}})}function Lt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Rt,zt=!1;const Bt={configurable:!0,get(){zt=!0}};function Vt(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Rt!==e._zod){Rt=void 0;return}Rt=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Bt);let e=zt;zt=!1;try{let r=n(this);return zt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),zt||=e,r}catch(n){throw delete this[t],zt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Ht(e,t,n,r){let i=Lt(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})}})}function Ut(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var Wt;const Gt={value:void 0,enumerable:!1};let Kt=`captureStackTrace`in Error?Error:null;function qt(e){let t=Kt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Kt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function G(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Gt.value=new a(r);try{Object.defineProperty(n,"_zod",Gt)}finally{Gt.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),Mt(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?qt(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 Jt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Yt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Wt=globalThis).__zod_globalConfig??(Wt.__zod_globalConfig={});const Xt=globalThis.__zod_globalConfig;function Zt(e){return e&&Object.assign(Xt,e),Xt}function Qt(){let e=this._zod;return e.message??=JSON.stringify(e.def,ze,2),e.message}function $t(e){this._zod.message=e}const en={get:Qt,set:$t,enumerable:!0,configurable:!0},tn={value:void 0,enumerable:!1},nn=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),rn=(e,t)=>{e.name=`$ZodError`,tn.value=t,Object.defineProperty(e,"issues",tn),tn.value=void 0,Object.defineProperty(e,"message",en);let n=Object.getPrototypeOf(e);nn.has(n)||(nn.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})}}))},an=G(`$ZodError`,rn);G(`$ZodError`,rn,void 0,{Parent:Error});function on(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 sn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?on(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function cn(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 ln(e,t){return{callee:t?.callee??e,Err:t?.Err}}const un=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 Jt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Et(e,o,Zt())));throw tt(n,a?.callee??t),n}return s.value};return t},dn=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=>Et(e,o,Zt())));throw tt(n,a?.callee??t),n}return s.value};return t},fn=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 Jt;return a.issues.length?pn(e,a.issues,i):{success:!0,data:a.value}};function pn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Et(e,n,Zt()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const mn=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?pn(e,a.issues,i):{success:!0,data:a.value}},hn=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),gn=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),_n=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==hn)return!0;if(r.definite===!0&&n===void 0)return!1}return vn(e,t,n)});function vn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[gn]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Jt;return a.issues.length===0}const yn=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},bn=e=>{let t=un(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ln(n,a))};return n},xn=e=>{let t=un(e),n=(e,r,i,a)=>t(e,r,i,ln(n,a));return n},Sn=e=>{let t=dn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ln(n,a))};return n},Cn=e=>{let t=dn(e),n=async(e,r,i,a)=>await t(e,r,i,ln(n,a));return n},wn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return fn(e)(t,n,i)},Tn=e=>(t,n,r)=>fn(e)(t,n,r),En=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return mn(e)(t,n,i)},Dn=e=>async(t,n,r)=>mn(e)(t,n,r),On=/^[cC][0-9a-z]{6,}$/,kn=/^[0-9a-z]+$/,An=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,jn=/^[0-9a-vA-V]{20}$/,Mn=/^[A-Za-z0-9]{27}$/,Nn=/^[a-zA-Z0-9_-]{21}$/;function Pn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const Fn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,In=/^([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})$/,Ln=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)$/,Rn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function zn(){return/* @__PURE__ */ RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const Bn=/^(?:(?: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])$/,Vn=/^(([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}|:))$/,Hn=/^((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])$/,Un=/^(([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])$/,Wn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Kn=/^https?$/,qn=/^\+[1-9]\d{6,14}$/,Jn=`(?:(?:\\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 Yn(e){return RegExp(`^${e}$`)}const Xn=/*@__PURE__*/ Yn(Jn);function Zn(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 Qn(e){return RegExp(`^${Zn(e)}$`)}function $n(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Zn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Zn({precision:e.precision})}`:n;return RegExp(`^${Jn}T(?:${r})$`)}const er=/^[\s\S]{0,}$/,tr=/^-?\d+$/,nr=/^-?\d+(?:\.\d+)?$/,rr=/^(?:true|false)$/i,ir=/^null$/i,ar=/^[^A-Z]*$/,or=/^[^a-z]*$/,sr=/*@__PURE__*/ G(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),cr=e=>{let t=e.value;return!He(t)&&t.length!==void 0},lr={number:`number`,bigint:`bigint`,object:`date`},ur=/*@__PURE__*/ G(`$ZodCheckLessThan`,(e,t)=>{sr.init(e,t);let n=lr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:lr[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})}}),dr=/*@__PURE__*/ G(`$ZodCheckGreaterThan`,(e,t)=>{sr.init(e,t);let n=lr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:lr[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})}}),fr=/*@__PURE__*/ G(`$ZodCheckMultipleOf`,(e,t)=>{sr.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):We(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})}}),pr=/*@__PURE__*/ G(`$ZodCheckNumberFormat`,(e,t)=>{sr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ut[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})}}),mr=/*@__PURE__*/ G(`$ZodCheckMaxLength`,(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=cr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ot(r):i)<=t.maximum)return;let a=kt(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),hr=/*@__PURE__*/ G(`$ZodCheckMinLength`,(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=cr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ot(r):i)>=t.minimum)return;let a=kt(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gr=/*@__PURE__*/ G(`$ZodCheckLengthEquals`,(e,t)=>{var n;sr.init(e,t),(n=e._zod.def).when??(n.when=cr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ot(r):i;if(a===t.length)return;let o=kt(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})}}),_r=/*@__PURE__*/ G(`$ZodCheckStringFormat`,(e,t)=>{var n,r;sr.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=()=>{})}),vr=/*@__PURE__*/ G(`$ZodCheckRegex`,(e,t)=>{_r.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})}}),yr=/*@__PURE__*/ G(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ar,_r.init(e,t)}),br=/*@__PURE__*/ G(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=or,_r.init(e,t)}),xr=/*@__PURE__*/ G(`$ZodCheckIncludes`,(e,t)=>{sr.init(e,t);let n=st(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})}}),Sr=/*@__PURE__*/ G(`$ZodCheckStartsWith`,(e,t)=>{sr.init(e,t);let n=RegExp(`^${st(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})}}),Cr=/*@__PURE__*/ G(`$ZodCheckEndsWith`,(e,t)=>{sr.init(e,t);let n=RegExp(`.*${st(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})}}),wr=/*@__PURE__*/ G(`$ZodCheckOverwrite`,(e,t)=>{sr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Tr=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(`
230
+ ;_e.node;const ve=M(_e);var ye=_();const be={100:{characters:[`💯`],aliases:[]},thumbs_up:{characters:[`👍`],aliases:[`+1`,`thumbsup`]},thumbs_down:{characters:[`👎`],aliases:[`-1`,`thumbsdown`]},clap:{characters:[`👏`],aliases:[]},wave:{characters:[`👋`],aliases:[]},pray:{characters:[`🙏`],aliases:[]},muscle:{characters:[`💪`],aliases:[]},ok_hand:{characters:[`👌`],aliases:[]},point_up:{characters:[`👆`],aliases:[]},point_down:{characters:[`👇`],aliases:[]},point_left:{characters:[`👈`],aliases:[]},point_right:{characters:[`👉`],aliases:[]},raised_hands:{characters:[`🙌`],aliases:[]},shrug:{characters:[`🤷`],aliases:[]},facepalm:{characters:[`🤦`],aliases:[]},heart:{characters:[`❤️`,`❤`],aliases:[]},smile:{characters:[`😊`],aliases:[`slightly_smiling_face`]},laugh:{characters:[`😂`,`😆`],aliases:[`laughing`,`satisfied`,`joy`]},thinking:{characters:[`🤔`],aliases:[`thinking_face`]},sad:{characters:[`😢`],aliases:[`cry`,`white_frowning_face`]},cry:{characters:[`😭`],aliases:[`sob`]},angry:{characters:[`😠`],aliases:[]},love_eyes:{characters:[`😍`],aliases:[`heart_eyes`]},cool:{characters:[`😎`],aliases:[`sunglasses`]},wink:{characters:[`😉`],aliases:[]},surprised:{characters:[`😮`],aliases:[`open_mouth`]},worried:{characters:[`😟`],aliases:[]},confused:{characters:[`😕`],aliases:[]},neutral:{characters:[`😐`],aliases:[`neutral_face`]},sleeping:{characters:[`😴`],aliases:[]},sick:{characters:[`🤢`],aliases:[`nauseated_face`]},mind_blown:{characters:[`🤯`],aliases:[`exploding_head`]},relieved:{characters:[`😌`],aliases:[]},grimace:{characters:[`😬`],aliases:[`grimacing`]},rolling_eyes:{characters:[`🙄`],aliases:[]},hug:{characters:[`🤗`],aliases:[`hugging_face`]},zany:{characters:[`🤪`],aliases:[`zany_face`]},check:{characters:[`✅`,`✔️`],aliases:[`white_check_mark`,`heavy_check_mark`]},x:{characters:[`❌`,`✖️`],aliases:[`heavy_multiplication_x`]},question:{characters:[`❓`,`?`],aliases:[]},exclamation:{characters:[`❗`],aliases:[]},warning:{characters:[`⚠️`],aliases:[]},stop:{characters:[`🛑`],aliases:[`octagonal_sign`]},info:{characters:[`ℹ️`],aliases:[`information_source`]},fire:{characters:[`🔥`],aliases:[]},star:{characters:[`⭐`],aliases:[]},sparkles:{characters:[`✨`],aliases:[]},lightning:{characters:[`⚡`],aliases:[`zap`]},boom:{characters:[`💥`],aliases:[]},eyes:{characters:[`👀`],aliases:[]},green_circle:{characters:[`🟢`],aliases:[`large_green_circle`]},yellow_circle:{characters:[`🟡`],aliases:[`large_yellow_circle`]},red_circle:{characters:[`🔴`],aliases:[]},blue_circle:{characters:[`🔵`],aliases:[`large_blue_circle`]},white_circle:{characters:[`⚪`],aliases:[]},black_circle:{characters:[`⚫`],aliases:[]},rocket:{characters:[`🚀`],aliases:[]},party:{characters:[`🎉`,`🥳`],aliases:[`tada`,`partying_face`]},confetti:{characters:[`🎊`],aliases:[`confetti_ball`]},balloon:{characters:[`🎈`],aliases:[]},gift:{characters:[`🎁`],aliases:[]},trophy:{characters:[`🏆`],aliases:[]},medal:{characters:[`🥇`],aliases:[`first_place_medal`]},lightbulb:{characters:[`💡`],aliases:[`bulb`]},gear:{characters:[`⚙️`],aliases:[]},wrench:{characters:[`🔧`],aliases:[]},hammer:{characters:[`🔨`],aliases:[]},bug:{characters:[`🐛`],aliases:[]},link:{characters:[`🔗`],aliases:[]},lock:{characters:[`🔒`],aliases:[]},unlock:{characters:[`🔓`],aliases:[]},key:{characters:[`🔑`],aliases:[]},pin:{characters:[`📌`],aliases:[`pushpin`]},memo:{characters:[`📝`],aliases:[]},clipboard:{characters:[`📋`],aliases:[]},calendar:{characters:[`📅`],aliases:[]},clock:{characters:[`🕐`],aliases:[`clock1`]},hourglass:{characters:[`⏳`],aliases:[]},bell:{characters:[`🔔`],aliases:[]},megaphone:{characters:[`📢`],aliases:[`mega`]},speech_bubble:{characters:[`💬`],aliases:[`speech_balloon`]},email:{characters:[`📧`],aliases:[]},inbox:{characters:[`📥`],aliases:[`inbox_tray`]},outbox:{characters:[`📤`],aliases:[`outbox_tray`]},package:{characters:[`📦`],aliases:[]},folder:{characters:[`📁`],aliases:[`file_folder`]},file:{characters:[`📄`],aliases:[`page_facing_up`]},chart_up:{characters:[`📈`],aliases:[`chart_with_upwards_trend`]},chart_down:{characters:[`📉`],aliases:[`chart_with_downwards_trend`]},coffee:{characters:[`☕`],aliases:[]},pizza:{characters:[`🍕`],aliases:[]},beer:{characters:[`🍺`],aliases:[]},arrow_up:{characters:[`⬆️`],aliases:[]},arrow_down:{characters:[`⬇️`],aliases:[]},arrow_left:{characters:[`⬅️`],aliases:[]},arrow_right:{characters:[`➡️`],aliases:[]},refresh:{characters:[`🔄`],aliases:[`arrows_counterclockwise`]},sun:{characters:[`☀️`],aliases:[`sunny`]},cloud:{characters:[`☁️`],aliases:[]},rain:{characters:[`🌧️`],aliases:[`rain_cloud`]},snow:{characters:[`❄️`],aliases:[`snowflake`]},rainbow:{characters:[`🌈`],aliases:[]}},xe=/* @__PURE__ */ new Map,Se=/* @__PURE__ */ new Map,Ce=/* @__PURE__ */ new Map,we=e=>e.replace(/️/g,``);function Te(e,t,n){xe.set(e,e);for(let t of n)xe.has(t)||xe.set(t,e);t[0]&&Se.set(e,t[0]);for(let n of t)Ce.has(we(n))||Ce.set(we(n),e)}for(let[e,t]of Object.entries(be))Te(e,t.characters,t.aliases);Te(`rotating_light`,[`🚨`],[]),Te(`ship`,[`🚢`],[]);const Ee=e=>xe.get(e)??e;function De(e){let t=e.trim(),n=t.match(/^:?([a-z0-9_+-]+):?$/i);if(n)return Ee(n[1].toLowerCase());let r=Ce.get(we(t));if(r)return r;throw Error(`unknown emoji: ${e} (use a short name like eyes or thumbs_up)`)}const Oe=e=>Se.get(Ee(e))??`:${e}:`,ke=4194304,Ae=26214400,je=104857600;function Me(e){return e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const Ne={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".avif":`image/avif`,".svg":`image/svg+xml`,".mp4":`video/mp4`,".webm":`video/webm`,".mov":`video/quicktime`,".pdf":`application/pdf`,".txt":`text/plain`,".log":`text/plain`,".md":`text/markdown`,".json":`application/json`,".csv":`text/csv`,".html":`text/html`,".zip":`application/zip`};function Pe(e){let t=e.lastIndexOf(`.`);return t>0&&Ne[e.slice(t).toLowerCase()]||`application/octet-stream`}const Fe=e=>e.profile!==null&&e.handle.includes(`/`)?`${e.name} via ${e.handle.slice(0,e.handle.indexOf(`/`))}`:e.name;function Ie(e){let t=e.author;if(!t)return e.by.actor;let n=t.handle.indexOf(`/`);return e.by.profile!==null&&n!==-1?`${t.name} via ${t.handle.slice(0,n)}`:t.person&&t.person.handle!==t.handle?`${t.name} (${t.person.handle})`:t.name}function Le(e,t=Date.now()){let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}d`}function Re(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 ze(e,t=`|`){return e.map(e=>ut(e)).join(t)}function Be(e,t){return typeof t==`bigint`?t.toString():t}var Ve=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 He(e){return new Ve(e)}function Ue(e){return e==null}function We(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ge(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}function Ke(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function qe(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Je(e){return qe(e._zod.def)??e._zod.def.shape}function Ye(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Ke(this,t,e),e},enumerable:!0,configurable:!0})}function Xe(e,t,n){t in e?Ke(e,t,n):e[t]=n}function Ze(e,t,n,r){let i=Je(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Ye(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Xe(e,a,r?r(n.value,a):n.value))}}function Qe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ye(e,n,()=>t[n]):Xe(e,n,r.value))}}function $e(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function et(e){return JSON.stringify(e)}function tt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const nt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const it=/* @__PURE__*/ He(()=>{if(Zt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function at(e){if(rt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return rt(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ot(e){return at(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const st=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function lt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(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 ut(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function U(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const dt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ft={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function pt(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 Ze(i,e,mt(e,t)),lt(e,$e(n,{shape:i,checks:[]}))}function mt(e,t){let n=Je(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 ht(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(mt(e,t)),a={};return Ze(a,e,Reflect.ownKeys(Je(e)).filter(e=>!i.has(e))),lt(e,$e(n,{shape:a,checks:[]}))}function gt(e,t){if(!at(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Je(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 lt(e,$e(e._zod.def,{shape:_t(e,t)}))}function _t(e,t){let n={};return Ze(n,e,Reflect.ownKeys(Je(e))),Qe(n,t),n}function vt(e,t){if(!at(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return lt(e,$e(e._zod.def,{shape:_t(e,t)}))}function yt(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 Ze(n,e,Reflect.ownKeys(Je(e))),Ze(n,t,Reflect.ownKeys(Je(t))),lt(e,$e(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function bt(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(mt(t,n)):void 0,o={};return Ze(o,t,Reflect.ownKeys(Je(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),lt(t,$e(t._zod.def,{shape:o,checks:[]}))}function xt(e,t,n){let r=n?new Set(mt(t,n)):void 0,i={};return Ze(i,t,Reflect.ownKeys(Je(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),lt(t,$e(t._zod.def,{shape:i}))}function St(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 Ct(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 wt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Tt(e){return typeof e==`string`?e:e?.message}function Et(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Dt(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:Tt(e.inst?._zod.def?.error?.(e))??Tt(a?.(e))??Tt(t?.error?.(e))??Tt(n.customError?.(e))??Tt(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}const Ot=/[\uD800-\uDBFF]/;function kt(e){let t=e.length;if(!Ot.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 At(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function jt(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 Mt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Nt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Lt(e,n,r.value)}}function Pt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ft(e,t,n){return Pt(e,t,n,!1)}function It(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Pt(this,n,r(this))},set(e){Pt(this,n,e)}})}return t}function Lt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Pt(this,t,n.bind(this))},set(e){Pt(this,t,e)}})}function Rt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let zt,Bt=!1;const Vt={configurable:!0,get(){Bt=!0}};function Ht(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,Vt);let e=Bt;Bt=!1;try{let r=n(this);return Bt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Bt||=e,r}catch(n){throw delete this[t],Bt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Ut(e,t,n,r){let i=Rt(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})}})}function Wt(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var Gt;const Kt={value:void 0,enumerable:!1};let qt=`captureStackTrace`in Error?Error:null;function Jt(e){let t=qt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return qt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function W(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Kt.value=new a(r);try{Object.defineProperty(n,"_zod",Kt)}finally{Kt.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),Nt(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?Jt(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 Yt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Xt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Gt=globalThis).__zod_globalConfig??(Gt.__zod_globalConfig={});const Zt=globalThis.__zod_globalConfig;function Qt(e){return e&&Object.assign(Zt,e),Zt}function $t(){let e=this._zod;return e.message??=JSON.stringify(e.def,Be,2),e.message}function en(e){this._zod.message=e}const tn={get:$t,set:en,enumerable:!0,configurable:!0},nn={value:void 0,enumerable:!1},rn=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),an=(e,t)=>{e.name=`$ZodError`,nn.value=t,Object.defineProperty(e,"issues",nn),nn.value=void 0,Object.defineProperty(e,"message",tn);let n=Object.getPrototypeOf(e);rn.has(n)||(rn.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})}}))},on=W(`$ZodError`,an);W(`$ZodError`,an,void 0,{Parent:Error});function sn(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 cn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?sn(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ln(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 un(e,t){return{callee:t?.callee??e,Err:t?.Err}}const dn=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 Yt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Dt(e,o,Qt())));throw nt(n,a?.callee??t),n}return s.value};return t},fn=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=>Dt(e,o,Qt())));throw nt(n,a?.callee??t),n}return s.value};return t},pn=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 Yt;return a.issues.length?mn(e,a.issues,i):{success:!0,data:a.value}};function mn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Dt(e,n,Qt()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const hn=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?mn(e,a.issues,i):{success:!0,data:a.value}},gn=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),_n=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),vn=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==gn)return!0;if(r.definite===!0&&n===void 0)return!1}return yn(e,t,n)});function yn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[_n]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Yt;return a.issues.length===0}const bn=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},xn=e=>{let t=dn(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,un(n,a))};return n},Sn=e=>{let t=dn(e),n=(e,r,i,a)=>t(e,r,i,un(n,a));return n},Cn=e=>{let t=fn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,un(n,a))};return n},wn=e=>{let t=fn(e),n=async(e,r,i,a)=>await t(e,r,i,un(n,a));return n},Tn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return pn(e)(t,n,i)},En=e=>(t,n,r)=>pn(e)(t,n,r),Dn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hn(e)(t,n,i)},On=e=>async(t,n,r)=>hn(e)(t,n,r),kn=/^[cC][0-9a-z]{6,}$/,An=/^[0-9a-z]+$/,jn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Mn=/^[0-9a-vA-V]{20}$/,Nn=/^[A-Za-z0-9]{27}$/,Pn=/^[a-zA-Z0-9_-]{21}$/;function Fn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const In=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ln=/^([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})$/,Rn=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)$/,zn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Bn(){return/* @__PURE__ */ RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const Vn=/^(?:(?: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])$/,Hn=/^(([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}|:))$/,Un=/^((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])$/,Wn=/^(([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])$/,Gn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,qn=/^https?$/,Jn=/^\+[1-9]\d{6,14}$/,Yn=`(?:(?:\\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 Xn(e){return RegExp(`^${e}$`)}const Zn=/*@__PURE__*/ Xn(Yn);function Qn(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 $n(e){return RegExp(`^${Qn(e)}$`)}function er(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Qn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Qn({precision:e.precision})}`:n;return RegExp(`^${Yn}T(?:${r})$`)}const tr=/^[\s\S]{0,}$/,nr=/^-?\d+$/,rr=/^-?\d+(?:\.\d+)?$/,ir=/^(?:true|false)$/i,ar=/^null$/i,or=/^[^A-Z]*$/,sr=/^[^a-z]*$/,cr=/*@__PURE__*/ W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),lr=e=>{let t=e.value;return!Ue(t)&&t.length!==void 0},ur={number:`number`,bigint:`bigint`,object:`date`},dr=/*@__PURE__*/ W(`$ZodCheckLessThan`,(e,t)=>{cr.init(e,t);let n=ur[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:ur[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})}}),fr=/*@__PURE__*/ W(`$ZodCheckGreaterThan`,(e,t)=>{cr.init(e,t);let n=ur[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ur[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})}}),pr=/*@__PURE__*/ W(`$ZodCheckMultipleOf`,(e,t)=>{cr.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):Ge(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})}}),mr=/*@__PURE__*/ W(`$ZodCheckNumberFormat`,(e,t)=>{cr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=dt[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})}}),hr=/*@__PURE__*/ W(`$ZodCheckMaxLength`,(e,t)=>{var n;cr.init(e,t),(n=e._zod.def).when??(n.when=lr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?kt(r):i)<=t.maximum)return;let a=At(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gr=/*@__PURE__*/ W(`$ZodCheckMinLength`,(e,t)=>{var n;cr.init(e,t),(n=e._zod.def).when??(n.when=lr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?kt(r):i)>=t.minimum)return;let a=At(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_r=/*@__PURE__*/ W(`$ZodCheckLengthEquals`,(e,t)=>{var n;cr.init(e,t),(n=e._zod.def).when??(n.when=lr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?kt(r):i;if(a===t.length)return;let o=At(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})}}),vr=/*@__PURE__*/ W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;cr.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=()=>{})}),yr=/*@__PURE__*/ W(`$ZodCheckRegex`,(e,t)=>{vr.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})}}),br=/*@__PURE__*/ W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=or,vr.init(e,t)}),xr=/*@__PURE__*/ W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=sr,vr.init(e,t)}),Sr=/*@__PURE__*/ W(`$ZodCheckIncludes`,(e,t)=>{cr.init(e,t);let n=ct(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})}}),Cr=/*@__PURE__*/ W(`$ZodCheckStartsWith`,(e,t)=>{cr.init(e,t);let n=RegExp(`^${ct(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})}}),wr=/*@__PURE__*/ W(`$ZodCheckEndsWith`,(e,t)=>{cr.init(e,t);let n=RegExp(`.*${ct(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})}}),Tr=/*@__PURE__*/ W(`$ZodCheckOverwrite`,(e,t)=>{cr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Er=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(`
231
231
  `).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(`
232
- `)}\n};`)(...Object.values(this.closed))}};const Er={major:4,minor:6,patch:5},Dr=/*@__PURE__*/ G(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Er;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=xt(t),a;for(let o of n){if(o._zod.def.when){if(St(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 Jt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Tt(t.issues,n,e),i||=xt(t,n))});else{if(t.issues.length===n)continue;Tt(t.issues,n,e),i||=xt(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(xt(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Jt;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 Jt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Pt(this,`~standard`,Ar(this))},set"~standard"(e){Nt(this,`~standard`,e)}}),Or=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Et(e,t,Zt()))}:{value:e.value};async function kr(e,t){let n={async:!0};return Or(await e._zod.run({value:t,issues:[]},n),n)}function Ar(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Or(r,n)}catch{}return kr(e,t)},vendor:`zod`,version:1}}const jr=/*@__PURE__*/ G(`$ZodString`,(e,t)=>{Dr.init(e,t),e._zod.pattern=t.pattern??er,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}}),Mr=/*@__PURE__*/ G(`$ZodStringFormat`,(e,t)=>{_r.init(e,t),jr.init(e,t)}),Nr=/*@__PURE__*/ G(`$ZodGUID`,(e,t)=>{t.pattern??=In,Mr.init(e,t)}),Pr=/*@__PURE__*/ G(`$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??=Ln(e)}else t.pattern??=Ln();Mr.init(e,t)}),Fr=/*@__PURE__*/ G(`$ZodEmail`,(e,t)=>{t.pattern??=Rn,Mr.init(e,t)});function Ir(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Lr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Ir(e)||2:Rr(e,t)}function Rr(e,t){if(!t.normalize&&t.protocol?.source===Kn.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}}const zr=/[\t\n\r]/g;function Br(e){return e.replace(zr,``)}function Vr(e,t){return t.lastIndex=0,t.test(e.hostname)}function Hr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const Ur=/*@__PURE__*/ G(`$ZodURL`,(e,t)=>{Mr.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Lr(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=Br(r);return}t.hostname&&!Vr(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&&!Hr(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:Br(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Wr=/*@__PURE__*/ G(`$ZodEmoji`,(e,t)=>{t.pattern??=zn(),Mr.init(e,t)}),Gr=/*@__PURE__*/ G(`$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?Nn:Pn(t.length),Mr.init(e,t)}),Kr=/*@__PURE__*/ G(`$ZodCUID`,(e,t)=>{t.pattern??=On,Mr.init(e,t)}),qr=/*@__PURE__*/ G(`$ZodCUID2`,(e,t)=>{t.pattern??=kn,Mr.init(e,t)}),Jr=/*@__PURE__*/ G(`$ZodULID`,(e,t)=>{t.pattern??=An,Mr.init(e,t)}),Yr=/*@__PURE__*/ G(`$ZodXID`,(e,t)=>{t.pattern??=jn,Mr.init(e,t)}),Xr=/*@__PURE__*/ G(`$ZodKSUID`,(e,t)=>{t.pattern??=Mn,Mr.init(e,t)}),Zr=/*@__PURE__*/ G(`$ZodISODateTime`,(e,t)=>{t.pattern??=$n(t),Mr.init(e,t)}),Qr=/*@__PURE__*/ G(`$ZodISODate`,(e,t)=>{t.pattern??=Xn,Mr.init(e,t)}),$r=/*@__PURE__*/ G(`$ZodISOTime`,(e,t)=>{t.pattern??=Qn(t),Mr.init(e,t)}),ei=/*@__PURE__*/ G(`$ZodISODuration`,(e,t)=>{t.pattern??=Fn,Mr.init(e,t)}),ti=/*@__PURE__*/ G(`$ZodIPv4`,(e,t)=>{t.pattern??=Bn,Mr.init(e,t)}),ni=/^[0-9a-fA-F:.]+$/;function ri(e){return ni.test(e)?Ir(`http://[${e}]`):!1}const ii=/*@__PURE__*/ G(`$ZodIPv6`,(e,t)=>{t.pattern??=Vn,Mr.init(e,t),e._zod.check=n=>{ri(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),ai=/*@__PURE__*/ G(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Hn,Mr.init(e,t)});function oi(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:ri(n)}const si=/*@__PURE__*/ G(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Un,Mr.init(e,t),e._zod.check=n=>{oi(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function ci(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const li=/^[0-9a-zA-Z+/]*={0,2}$/,ui=/*@__PURE__*/ G(`$ZodBase64`,(e,t)=>{t.pattern??=li,Mr.init(e,t),e._zod.check=n=>{ci(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),di=/^[A-Za-z0-9_-]*$/;function fi(e){if(!di.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ci(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const pi=/*@__PURE__*/ G(`$ZodBase64URL`,(e,t)=>{t.pattern??=di,Mr.init(e,t),e._zod.check=n=>{fi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),mi=/*@__PURE__*/ G(`$ZodE164`,(e,t)=>{t.pattern??=qn,Mr.init(e,t)});function hi(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}}const gi=/*@__PURE__*/ G(`$ZodJWT`,(e,t)=>{Mr.init(e,t),e._zod.check=n=>{hi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),_i=/*@__PURE__*/ G(`$ZodNumber`,(e,t)=>{Dr.init(e,t),e._zod.pattern=nr,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}}),vi=/*@__PURE__*/ G(`$ZodNumberFormat`,(e,t)=>{pr.init(e,t),_i.init(e,t)}),yi=/*@__PURE__*/ G(`$ZodBoolean`,(e,t)=>{Dr.init(e,t),e._zod.pattern=rr,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}}),bi=/*@__PURE__*/ G(`$ZodNull`,(e,t)=>{Dr.init(e,t),e._zod.pattern=ir,e._zod.values=/* @__PURE__ */ 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}}),xi=/*@__PURE__*/ G(`$ZodUnknown`,(e,t)=>{Dr.init(e,t),e._zod.parse=e=>e}),Si=/*@__PURE__*/ G(`$ZodNever`,(e,t)=>{Dr.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ci(e,t,n){e.issues.length&&t.issues.push(...Ct(n,e.issues)),t.value[n]=e.value}const wi=/*@__PURE__*/ G(`$ZodArray`,(e,t)=>{Dr.init(e,t);let n=Xt.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=>Ci(t,r,e)));else if(Ci(c,r,e),s&&c.issues.length!==0&&xt(c))break}return o.length?Promise.all(o).then(()=>r):r}});function Ti(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(...Ct(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}}const Ei=[];function Di(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Ei,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=W(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Oi(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(xt(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=>Ti(e,n,i,t,d,f))):Ti(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}const ki=/*@__PURE__*/ G(`$ZodObject`,(e,t)=>{Dr.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=Ve(()=>Di(t));Vt(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)||Ge(n,e,/* @__PURE__ */ 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=nt,o=t.catchall,s,c=Xt.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(xt(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=>Ti(n,t,e,r,a,o))):Ti(s,t,e,r,a,o)}return o?Oi(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Ai=/*@__PURE__*/ G(`$ZodObjectJIT`,(e,t)=>{ki.init(e,t);let n=e._zod.parse,r=Ve(()=>Di(t)),i=Xt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Tr([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
232
+ `)}\n};`)(...Object.values(this.closed))}};const Dr={major:4,minor:6,patch:5},Or=/*@__PURE__*/ W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Dr;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=St(t),a;for(let o of n){if(o._zod.def.when){if(Ct(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 Yt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Et(t.issues,n,e),i||=St(t,n))});else{if(t.issues.length===n)continue;Et(t.issues,n,e),i||=St(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(St(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Yt;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 Yt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ft(this,`~standard`,jr(this))},set"~standard"(e){Pt(this,`~standard`,e)}}),kr=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Dt(e,t,Qt()))}:{value:e.value};async function Ar(e,t){let n={async:!0};return kr(await e._zod.run({value:t,issues:[]},n),n)}function jr(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return kr(r,n)}catch{}return Ar(e,t)},vendor:`zod`,version:1}}const Mr=/*@__PURE__*/ W(`$ZodString`,(e,t)=>{Or.init(e,t),e._zod.pattern=t.pattern??tr,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}}),Nr=/*@__PURE__*/ W(`$ZodStringFormat`,(e,t)=>{vr.init(e,t),Mr.init(e,t)}),Pr=/*@__PURE__*/ W(`$ZodGUID`,(e,t)=>{t.pattern??=Ln,Nr.init(e,t)}),Fr=/*@__PURE__*/ W(`$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??=Rn(e)}else t.pattern??=Rn();Nr.init(e,t)}),Ir=/*@__PURE__*/ W(`$ZodEmail`,(e,t)=>{t.pattern??=zn,Nr.init(e,t)});function Lr(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Rr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Lr(e)||2:zr(e,t)}function zr(e,t){if(!t.normalize&&t.protocol?.source===qn.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}}const Br=/[\t\n\r]/g;function Vr(e){return e.replace(Br,``)}function Hr(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ur(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const Wr=/*@__PURE__*/ W(`$ZodURL`,(e,t)=>{Nr.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Rr(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=Vr(r);return}t.hostname&&!Hr(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&&!Ur(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:Vr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Gr=/*@__PURE__*/ W(`$ZodEmoji`,(e,t)=>{t.pattern??=Bn(),Nr.init(e,t)}),Kr=/*@__PURE__*/ W(`$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?Pn:Fn(t.length),Nr.init(e,t)}),qr=/*@__PURE__*/ W(`$ZodCUID`,(e,t)=>{t.pattern??=kn,Nr.init(e,t)}),Jr=/*@__PURE__*/ W(`$ZodCUID2`,(e,t)=>{t.pattern??=An,Nr.init(e,t)}),Yr=/*@__PURE__*/ W(`$ZodULID`,(e,t)=>{t.pattern??=jn,Nr.init(e,t)}),Xr=/*@__PURE__*/ W(`$ZodXID`,(e,t)=>{t.pattern??=Mn,Nr.init(e,t)}),Zr=/*@__PURE__*/ W(`$ZodKSUID`,(e,t)=>{t.pattern??=Nn,Nr.init(e,t)}),Qr=/*@__PURE__*/ W(`$ZodISODateTime`,(e,t)=>{t.pattern??=er(t),Nr.init(e,t)}),$r=/*@__PURE__*/ W(`$ZodISODate`,(e,t)=>{t.pattern??=Zn,Nr.init(e,t)}),ei=/*@__PURE__*/ W(`$ZodISOTime`,(e,t)=>{t.pattern??=$n(t),Nr.init(e,t)}),ti=/*@__PURE__*/ W(`$ZodISODuration`,(e,t)=>{t.pattern??=In,Nr.init(e,t)}),ni=/*@__PURE__*/ W(`$ZodIPv4`,(e,t)=>{t.pattern??=Vn,Nr.init(e,t)}),ri=/^[0-9a-fA-F:.]+$/;function ii(e){return ri.test(e)?Lr(`http://[${e}]`):!1}const ai=/*@__PURE__*/ W(`$ZodIPv6`,(e,t)=>{t.pattern??=Hn,Nr.init(e,t),e._zod.check=n=>{ii(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),oi=/*@__PURE__*/ W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Un,Nr.init(e,t)});function si(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:ii(n)}const ci=/*@__PURE__*/ W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Wn,Nr.init(e,t),e._zod.check=n=>{si(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function li(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ui=/^[0-9a-zA-Z+/]*={0,2}$/,di=/*@__PURE__*/ W(`$ZodBase64`,(e,t)=>{t.pattern??=ui,Nr.init(e,t),e._zod.check=n=>{li(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),fi=/^[A-Za-z0-9_-]*$/;function pi(e){if(!fi.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return li(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const mi=/*@__PURE__*/ W(`$ZodBase64URL`,(e,t)=>{t.pattern??=fi,Nr.init(e,t),e._zod.check=n=>{pi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),hi=/*@__PURE__*/ W(`$ZodE164`,(e,t)=>{t.pattern??=Jn,Nr.init(e,t)});function gi(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}}const _i=/*@__PURE__*/ W(`$ZodJWT`,(e,t)=>{Nr.init(e,t),e._zod.check=n=>{gi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),vi=/*@__PURE__*/ W(`$ZodNumber`,(e,t)=>{Or.init(e,t),e._zod.pattern=rr,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}}),yi=/*@__PURE__*/ W(`$ZodNumberFormat`,(e,t)=>{mr.init(e,t),vi.init(e,t)}),bi=/*@__PURE__*/ W(`$ZodBoolean`,(e,t)=>{Or.init(e,t),e._zod.pattern=ir,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}}),xi=/*@__PURE__*/ W(`$ZodNull`,(e,t)=>{Or.init(e,t),e._zod.pattern=ar,e._zod.values=/* @__PURE__ */ 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}}),Si=/*@__PURE__*/ W(`$ZodUnknown`,(e,t)=>{Or.init(e,t),e._zod.parse=e=>e}),Ci=/*@__PURE__*/ W(`$ZodNever`,(e,t)=>{Or.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function wi(e,t,n){e.issues.length&&t.issues.push(...wt(n,e.issues)),t.value[n]=e.value}const Ti=/*@__PURE__*/ W(`$ZodArray`,(e,t)=>{Or.init(e,t);let n=Zt.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=>wi(t,r,e)));else if(wi(c,r,e),s&&c.issues.length!==0&&St(c))break}return o.length?Promise.all(o).then(()=>r):r}});function Ei(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(...wt(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}}const Di=[];function Oi(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Di,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=U(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ki(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(St(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=>Ei(e,n,i,t,d,f))):Ei(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}const Ai=/*@__PURE__*/ W(`$ZodObject`,(e,t)=>{Or.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=He(()=>Oi(t));Ht(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)||Ke(n,e,/* @__PURE__ */ 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=rt,o=t.catchall,s,c=Zt.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(St(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=>Ei(n,t,e,r,a,o))):Ei(s,t,e,r,a,o)}return o?ki(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),ji=/*@__PURE__*/ W(`$ZodObjectJIT`,(e,t)=>{Ai.init(e,t);let n=e._zod.parse,r=He(()=>Oi(t)),i=Zt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Er([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
233
233
  let ${e}_ab = false;
234
234
  for (let i = 0; i < ${e}.issues.length; i++) {
235
235
  const iss = ${e}.issues[i];
@@ -240,7 +240,7 @@ const N={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]
240
240
  if (${e}_ab && ctx && ctx.abortEarly) {
241
241
  payload.value = newResult;
242
242
  return payload;
243
- }`;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)}]`:$e(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(`
243
+ }`;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)}]`:et(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(`
244
244
  const ${n}_present = ${i};
245
245
  if (!${n}.issues.length || ${n}_present) {
246
246
  if (${n}.issues.length) {${c(n,r)}
@@ -279,75 +279,75 @@ const N={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]
279
279
  newResult[${r}] = ${n}.value;
280
280
  }
281
281
 
282
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=nt,c=!Xt.jitless,l=c&&rt.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?Oi([],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 ji(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=>!xt(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=>Et(e,r,Zt())))}),t)}const Mi=/*@__PURE__*/ G(`$ZodUnion`,(e,t)=>{Dr.init(e,t),Vt(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),Vt(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Vt(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)))}),Vt(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=>Ue(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=>ji(t,r,e,i)):ji(o,r,e,i)}});function Ni(e){let t=/* @__PURE__ */ 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}const Pi=/*@__PURE__*/ G(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Mi.init(e,t);let n=e._zod.parse;Vt(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)||Ge(t,e,/* @__PURE__ */ 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=Ke(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Ve(()=>Ni(t));e._zod.parse=(i,a)=>{let o=i.value;if(!nt(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)}}),Fi=/*@__PURE__*/ G(`$ZodIntersection`,(e,t)=>{Dr.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])=>Li(e,t,n)):Li(e,i,a)}});function Ii(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(it(e)&&it(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=Ii(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=Ii(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 Li(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ 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=Ii(t.value,n.value);if(!c.valid){if(xt(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Ri=/*@__PURE__*/ G(`$ZodRecord`,(e,t)=>{Dr.init(e,t);let n=Xt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!it(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=/* @__PURE__ */ 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=>Et(e,i,Zt())),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(...Ct(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Ct(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`&&nr.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=>Et(e,i,Zt())),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(...Ct(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Ct(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}}),zi=/*@__PURE__*/ G(`$ZodEnum`,(e,t)=>{Dr.init(e,t);let n=Le(t.entries),r=new Set(n);e._zod.values=r,Vt(e,`pattern`,e=>{let t=Le(e.def.entries).filter(e=>ot.has(typeof e));return RegExp(t.length?`^(${t.map(e=>st(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}}),Bi=/*@__PURE__*/ G(`$ZodLiteral`,(e,t)=>{Dr.init(e,t);let n=new Set(t.values);e._zod.values=n,Vt(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?st(e):e?st(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}}),Vi=/*@__PURE__*/ G(`$ZodTransform`,(e,t)=>{Dr.init(e,t),e._zod.optin=`optional`,Xt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Yt(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 Jt;return n.value=i,n}});function Hi(e,t){return e.value=t.issues.length?void 0:t.value,e}const Ui=/*@__PURE__*/ G(`$ZodOptional`,(e,t)=>{Dr.init(e,t),Vt(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Vt(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),Vt(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ue(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=>Hi(e,t)):Hi(e,r)}return t.innerType._zod.run(e,n)}}),Wi=/*@__PURE__*/ G(`$ZodExactOptional`,(e,t)=>{Ui.init(e,t),Vt(e,`values`,e=>e.def.innerType._zod.values),Vt(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Gi=/*@__PURE__*/ G(`$ZodNullable`,(e,t)=>{Dr.init(e,t),Vt(e,`optin`,e=>e.def.innerType._zod.optin),Vt(e,`optout`,e=>e.def.innerType._zod.optout),Vt(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ue(t.source)}|null)$`):void 0}),Vt(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ 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)}),Ki=/*@__PURE__*/ G(`$ZodDefault`,(e,t)=>{Dr.init(e,t),e._zod.optin=`defaulted`,Vt(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=>qi(e,t)):qi(r,t)}});function qi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ji=/*@__PURE__*/ G(`$ZodPrefault`,(e,t)=>{Dr.init(e,t),e._zod.optin=`defaulted`,Vt(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))}),Yi=/*@__PURE__*/ G(`$ZodNonOptional`,(e,t)=>{Dr.init(e,t),Vt(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=>Xi(t,e)):Xi(i,e)}});function Xi(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 Zi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Et(e,r,Zt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Qi=/*@__PURE__*/ G(`$ZodCatch`,(e,t)=>{Dr.init(e,t),Vt(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Vt(e,`optout`,e=>e.def.innerType._zod.optout),Vt(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=>Zi(e,r,t,n)):Zi(e,r,t,n)}}),$i=/*@__PURE__*/ G(`$ZodPipe`,(e,t)=>{Dr.init(e,t),Vt(e,`values`,e=>e.def.in._zod.values),Vt(e,`optin`,e=>e.def.in._zod.optin),Vt(e,`optout`,e=>e.def.out._zod.optout),Vt(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=>ea(e,t.in,n)):ea(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ea(e,t.out,n)):ea(r,t.out,n)}});function ea(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)}const ta=/*@__PURE__*/ G(`$ZodReadonly`,(e,t)=>{Dr.init(e,t),Vt(e,`propValues`,e=>e.def.innerType._zod.propValues),Vt(e,`values`,e=>e.def.innerType._zod.values),Vt(e,`optin`,e=>e.def.innerType?._zod?.optin),Vt(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(na):na(r)}});function na(e){return e.memo||(e.value=Object.freeze(e.value)),e}const ra=/*@__PURE__*/ G(`$ZodCustom`,(e,t)=>{sr.init(e,t),Dr.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=>ia(t,n,r,e));ia(i,n,r,e)}});function ia(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(jt(e))}}var aa=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const oa=`~memo`,sa=[];function ca(e){return typeof e==`object`&&!!e}function la(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const ua=/*@__PURE__*/ new WeakMap;function da(e,t,n){let r=ua.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=da(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?da(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ke(c);s(e?o(e,!0):1),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?da(r,t,!1):1);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),fa(e,i)}function fa(e,t){return t!==1&&ua.set(e,t===2),t}function pa(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ma;const ha=[],ga={alloc(e,t,n){let r=ma;if(!r)return n;ma=void 0;let i={value:n,issues:null};return r.set(t.value,i),ha.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`&&va(n,e.value))throw new aa;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=da(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!ca(l))return t(s,c);let u=c[oa];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[oa]=u);let d;i===c?d=a:(d=pa(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(...la(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ma=d;let p=ha.length,m=t(s,c);ma=void 0;let h=ha.length>p?ha.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?la(e.issues):sa),e)):(h&&(h.issues=m.issues.length?la(m.issues):sa),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function _a(){return ga}function va(e,t){let n=e[oa]?.backEdges;return n!==void 0&&ca(t)&&n.has(t)}const ya=()=>{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(At(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${lt(e.values[0])}`:`Invalid option: expected one of ${Re(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`:``}: ${Re(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 ba(){return{localeError:ya()}}var xa,Sa=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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 Ca(){return new Sa}(xa=globalThis).__zod_globalRegistry??(xa.__zod_globalRegistry=Ca());const wa=globalThis.__zod_globalRegistry;function Ta(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
283
- function Ea(e,t){return new e(Ta({type:`string`,...U(t)}))}// @__NO_SIDE_EFFECTS__
284
- function Da(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
285
- function Oa(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
286
- function ka(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
287
- function Aa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...U(t)})}// @__NO_SIDE_EFFECTS__
288
- function ja(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...U(t)})}// @__NO_SIDE_EFFECTS__
289
- function Ma(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...U(t)})}// @__NO_SIDE_EFFECTS__
290
- function Na(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
291
- function Pa(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
292
- function Fa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
293
- function Ia(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
294
- function La(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
295
- function Ra(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
296
- function za(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
297
- function Ba(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
298
- function Va(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
299
- function Ha(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
300
- function Ua(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
301
- function Wa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
302
- function Ga(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
303
- function Ka(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
304
- function qa(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
305
- function Ja(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
306
- function Ya(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...U(t)})}// @__NO_SIDE_EFFECTS__
307
- function Xa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...U(t)})}// @__NO_SIDE_EFFECTS__
308
- function Za(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...U(t)})}// @__NO_SIDE_EFFECTS__
309
- function Qa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...U(t)})}// @__NO_SIDE_EFFECTS__
310
- function $a(e,t){return new e(Ta({type:`number`,checks:[],...U(t)}))}// @__NO_SIDE_EFFECTS__
311
- function eo(e,t){return new e(Ta({type:`number`,coerce:!0,checks:[],...U(t)}))}// @__NO_SIDE_EFFECTS__
312
- function to(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...U(t)})}// @__NO_SIDE_EFFECTS__
313
- function no(e,t){return new e({type:`boolean`,...U(t)})}// @__NO_SIDE_EFFECTS__
314
- function ro(e,t){return new e({type:`boolean`,coerce:!0,...U(t)})}// @__NO_SIDE_EFFECTS__
315
- function io(e,t){return new e({type:`null`,...U(t)})}// @__NO_SIDE_EFFECTS__
316
- function ao(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
317
- function oo(e,t){return new e({type:`never`,...U(t)})}// @__NO_SIDE_EFFECTS__
318
- function so(e,t){return new ur({check:`less_than`,...U(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
319
- function co(e,t){return new ur({check:`less_than`,...U(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
320
- function lo(e,t){return new dr({check:`greater_than`,...U(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
321
- function uo(e,t){return new dr({check:`greater_than`,...U(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
322
- function fo(e,t){return new fr({check:`multiple_of`,...U(t),value:e})}// @__NO_SIDE_EFFECTS__
323
- function po(e,t){return new mr({check:`max_length`,...U(t),maximum:e})}// @__NO_SIDE_EFFECTS__
324
- function mo(e,t){return new hr({check:`min_length`,...U(t),minimum:e})}// @__NO_SIDE_EFFECTS__
325
- function ho(e,t){return new gr({check:`length_equals`,...U(t),length:e})}// @__NO_SIDE_EFFECTS__
326
- function go(e,t){return new vr({check:`string_format`,format:`regex`,...U(t),pattern:e})}// @__NO_SIDE_EFFECTS__
327
- function _o(e){return new yr({check:`string_format`,format:`lowercase`,...U(e)})}// @__NO_SIDE_EFFECTS__
328
- function vo(e){return new br({check:`string_format`,format:`uppercase`,...U(e)})}// @__NO_SIDE_EFFECTS__
329
- function yo(e,t){return new xr({check:`string_format`,format:`includes`,...U(t),includes:e})}// @__NO_SIDE_EFFECTS__
330
- function bo(e,t){return new Sr({check:`string_format`,format:`starts_with`,...U(t),prefix:e})}// @__NO_SIDE_EFFECTS__
331
- function xo(e,t){return new Cr({check:`string_format`,format:`ends_with`,...U(t),suffix:e})}// @__NO_SIDE_EFFECTS__
332
- function So(e){return new wr({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
333
- function Co(e){return/* @__PURE__ */ So(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
334
- function wo(){return/* @__PURE__ */ So(e=>e.trim())}// @__NO_SIDE_EFFECTS__
335
- function To(){return/* @__PURE__ */ So(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
336
- function Eo(){return/* @__PURE__ */ So(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
337
- function Do(){return/* @__PURE__ */ So(e=>et(e))}// @__NO_SIDE_EFFECTS__
338
- function Oo(e,t,n){return new e({type:`array`,element:t,...U(n)})}// @__NO_SIDE_EFFECTS__
339
- function ko(e,t,n){let r=U(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
340
- function Ao(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...U(n)})}// @__NO_SIDE_EFFECTS__
341
- function jo(e,t){let n=/* @__PURE__ */ Mo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(jt(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(jt(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
342
- function Mo(e,t){let n=new sr({check:`custom`,...U(t)});return n._zod.check=e,n}function No(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Ge(e,t,n[t]);return e}function Po(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??wa,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Fo(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 Io(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,Io(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&No(o.schema,c),t.io===`input`&&Ko(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 Lo(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ro(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=/* @__PURE__ */ 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}/${Lo(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+Lo(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>
282
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=rt,c=!Zt.jitless,l=c&&it.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?ki([],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 Mi(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=>!St(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=>Dt(e,r,Qt())))}),t)}const Ni=/*@__PURE__*/ W(`$ZodUnion`,(e,t)=>{Or.init(e,t),Ht(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),Ht(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Ht(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)))}),Ht(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=>We(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=>Mi(t,r,e,i)):Mi(o,r,e,i)}});function Pi(e){let t=/* @__PURE__ */ 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}const Fi=/*@__PURE__*/ W(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ni.init(e,t);let n=e._zod.parse;Ht(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)||Ke(t,e,/* @__PURE__ */ 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=qe(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=He(()=>Pi(t));e._zod.parse=(i,a)=>{let o=i.value;if(!rt(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)}}),Ii=/*@__PURE__*/ W(`$ZodIntersection`,(e,t)=>{Or.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])=>Ri(e,t,n)):Ri(e,i,a)}});function Li(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(at(e)&&at(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=Li(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=Li(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 Ri(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ 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=Li(t.value,n.value);if(!c.valid){if(St(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const zi=/*@__PURE__*/ W(`$ZodRecord`,(e,t)=>{Or.init(e,t);let n=Zt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!at(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=/* @__PURE__ */ 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=>Dt(e,i,Qt())),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(...wt(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...wt(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`&&rr.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=>Dt(e,i,Qt())),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(...wt(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...wt(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}}),Bi=/*@__PURE__*/ W(`$ZodEnum`,(e,t)=>{Or.init(e,t);let n=Re(t.entries),r=new Set(n);e._zod.values=r,Ht(e,`pattern`,e=>{let t=Re(e.def.entries).filter(e=>st.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ct(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}}),Vi=/*@__PURE__*/ W(`$ZodLiteral`,(e,t)=>{Or.init(e,t);let n=new Set(t.values);e._zod.values=n,Ht(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?ct(e):e?ct(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}}),Hi=/*@__PURE__*/ W(`$ZodTransform`,(e,t)=>{Or.init(e,t),e._zod.optin=`optional`,Zt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Xt(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 Yt;return n.value=i,n}});function Ui(e,t){return e.value=t.issues.length?void 0:t.value,e}const Wi=/*@__PURE__*/ W(`$ZodOptional`,(e,t)=>{Or.init(e,t),Ht(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Ht(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),Ht(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${We(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=>Ui(e,t)):Ui(e,r)}return t.innerType._zod.run(e,n)}}),Gi=/*@__PURE__*/ W(`$ZodExactOptional`,(e,t)=>{Wi.init(e,t),Ht(e,`values`,e=>e.def.innerType._zod.values),Ht(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ki=/*@__PURE__*/ W(`$ZodNullable`,(e,t)=>{Or.init(e,t),Ht(e,`optin`,e=>e.def.innerType._zod.optin),Ht(e,`optout`,e=>e.def.innerType._zod.optout),Ht(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${We(t.source)}|null)$`):void 0}),Ht(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ 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)}),qi=/*@__PURE__*/ W(`$ZodDefault`,(e,t)=>{Or.init(e,t),e._zod.optin=`defaulted`,Ht(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=>Ji(e,t)):Ji(r,t)}});function Ji(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Yi=/*@__PURE__*/ W(`$ZodPrefault`,(e,t)=>{Or.init(e,t),e._zod.optin=`defaulted`,Ht(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))}),Xi=/*@__PURE__*/ W(`$ZodNonOptional`,(e,t)=>{Or.init(e,t),Ht(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=>Zi(t,e)):Zi(i,e)}});function Zi(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 Qi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Dt(e,r,Qt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const $i=/*@__PURE__*/ W(`$ZodCatch`,(e,t)=>{Or.init(e,t),Ht(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Ht(e,`optout`,e=>e.def.innerType._zod.optout),Ht(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=>Qi(e,r,t,n)):Qi(e,r,t,n)}}),ea=/*@__PURE__*/ W(`$ZodPipe`,(e,t)=>{Or.init(e,t),Ht(e,`values`,e=>e.def.in._zod.values),Ht(e,`optin`,e=>e.def.in._zod.optin),Ht(e,`optout`,e=>e.def.out._zod.optout),Ht(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=>ta(e,t.in,n)):ta(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ta(e,t.out,n)):ta(r,t.out,n)}});function ta(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)}const na=/*@__PURE__*/ W(`$ZodReadonly`,(e,t)=>{Or.init(e,t),Ht(e,`propValues`,e=>e.def.innerType._zod.propValues),Ht(e,`values`,e=>e.def.innerType._zod.values),Ht(e,`optin`,e=>e.def.innerType?._zod?.optin),Ht(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(ra):ra(r)}});function ra(e){return e.memo||(e.value=Object.freeze(e.value)),e}const ia=/*@__PURE__*/ W(`$ZodCustom`,(e,t)=>{cr.init(e,t),Or.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=>aa(t,n,r,e));aa(i,n,r,e)}});function aa(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(Mt(e))}}var oa=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const sa=`~memo`,ca=[];function la(e){return typeof e==`object`&&!!e}function ua(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const da=/*@__PURE__*/ new WeakMap;function fa(e,t,n){let r=da.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=fa(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?fa(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=qe(c);s(e?o(e,!0):1),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?fa(r,t,!1):1);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),pa(e,i)}function pa(e,t){return t!==1&&da.set(e,t===2),t}function ma(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ha;const ga=[],_a={alloc(e,t,n){let r=ha;if(!r)return n;ha=void 0;let i={value:n,issues:null};return r.set(t.value,i),ga.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`&&ya(n,e.value))throw new oa;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=fa(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!la(l))return t(s,c);let u=c[sa];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[sa]=u);let d;i===c?d=a:(d=ma(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(...ua(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ha=d;let p=ga.length,m=t(s,c);ha=void 0;let h=ga.length>p?ga.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ua(e.issues):ca),e)):(h&&(h.issues=m.issues.length?ua(m.issues):ca),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function va(){return _a}function ya(e,t){let n=e[sa]?.backEdges;return n!==void 0&&la(t)&&n.has(t)}const ba=()=>{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(jt(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ut(e.values[0])}`:`Invalid option: expected one of ${ze(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`:``}: ${ze(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 xa(){return{localeError:ba()}}var Sa,Ca=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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 wa(){return new Ca}(Sa=globalThis).__zod_globalRegistry??(Sa.__zod_globalRegistry=wa());const Ta=globalThis.__zod_globalRegistry;function Ea(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
283
+ function Da(e,t){return new e(Ea({type:`string`,...H(t)}))}// @__NO_SIDE_EFFECTS__
284
+ function Oa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
285
+ function ka(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
286
+ function Aa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
287
+ function ja(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...H(t)})}// @__NO_SIDE_EFFECTS__
288
+ function Ma(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...H(t)})}// @__NO_SIDE_EFFECTS__
289
+ function Na(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...H(t)})}// @__NO_SIDE_EFFECTS__
290
+ function Pa(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
291
+ function Fa(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
292
+ function Ia(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
293
+ function La(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
294
+ function Ra(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
295
+ function za(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
296
+ function Ba(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
297
+ function Va(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
298
+ function Ha(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
299
+ function Ua(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
300
+ function Wa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
301
+ function Ga(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
302
+ function Ka(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
303
+ function qa(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
304
+ function Ja(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
305
+ function Ya(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...H(t)})}// @__NO_SIDE_EFFECTS__
306
+ function Xa(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...H(t)})}// @__NO_SIDE_EFFECTS__
307
+ function Za(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...H(t)})}// @__NO_SIDE_EFFECTS__
308
+ function Qa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...H(t)})}// @__NO_SIDE_EFFECTS__
309
+ function $a(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...H(t)})}// @__NO_SIDE_EFFECTS__
310
+ function eo(e,t){return new e(Ea({type:`number`,checks:[],...H(t)}))}// @__NO_SIDE_EFFECTS__
311
+ function to(e,t){return new e(Ea({type:`number`,coerce:!0,checks:[],...H(t)}))}// @__NO_SIDE_EFFECTS__
312
+ function no(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...H(t)})}// @__NO_SIDE_EFFECTS__
313
+ function ro(e,t){return new e({type:`boolean`,...H(t)})}// @__NO_SIDE_EFFECTS__
314
+ function io(e,t){return new e({type:`boolean`,coerce:!0,...H(t)})}// @__NO_SIDE_EFFECTS__
315
+ function ao(e,t){return new e({type:`null`,...H(t)})}// @__NO_SIDE_EFFECTS__
316
+ function oo(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
317
+ function so(e,t){return new e({type:`never`,...H(t)})}// @__NO_SIDE_EFFECTS__
318
+ function co(e,t){return new dr({check:`less_than`,...H(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
319
+ function lo(e,t){return new dr({check:`less_than`,...H(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
320
+ function uo(e,t){return new fr({check:`greater_than`,...H(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
321
+ function fo(e,t){return new fr({check:`greater_than`,...H(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
322
+ function po(e,t){return new pr({check:`multiple_of`,...H(t),value:e})}// @__NO_SIDE_EFFECTS__
323
+ function mo(e,t){return new hr({check:`max_length`,...H(t),maximum:e})}// @__NO_SIDE_EFFECTS__
324
+ function ho(e,t){return new gr({check:`min_length`,...H(t),minimum:e})}// @__NO_SIDE_EFFECTS__
325
+ function go(e,t){return new _r({check:`length_equals`,...H(t),length:e})}// @__NO_SIDE_EFFECTS__
326
+ function _o(e,t){return new yr({check:`string_format`,format:`regex`,...H(t),pattern:e})}// @__NO_SIDE_EFFECTS__
327
+ function vo(e){return new br({check:`string_format`,format:`lowercase`,...H(e)})}// @__NO_SIDE_EFFECTS__
328
+ function yo(e){return new xr({check:`string_format`,format:`uppercase`,...H(e)})}// @__NO_SIDE_EFFECTS__
329
+ function bo(e,t){return new Sr({check:`string_format`,format:`includes`,...H(t),includes:e})}// @__NO_SIDE_EFFECTS__
330
+ function xo(e,t){return new Cr({check:`string_format`,format:`starts_with`,...H(t),prefix:e})}// @__NO_SIDE_EFFECTS__
331
+ function So(e,t){return new wr({check:`string_format`,format:`ends_with`,...H(t),suffix:e})}// @__NO_SIDE_EFFECTS__
332
+ function Co(e){return new Tr({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
333
+ function wo(e){return/* @__PURE__ */ Co(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
334
+ function To(){return/* @__PURE__ */ Co(e=>e.trim())}// @__NO_SIDE_EFFECTS__
335
+ function Eo(){return/* @__PURE__ */ Co(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
336
+ function Do(){return/* @__PURE__ */ Co(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
337
+ function Oo(){return/* @__PURE__ */ Co(e=>tt(e))}// @__NO_SIDE_EFFECTS__
338
+ function ko(e,t,n){return new e({type:`array`,element:t,...H(n)})}// @__NO_SIDE_EFFECTS__
339
+ function Ao(e,t,n){let r=H(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
340
+ function jo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...H(n)})}// @__NO_SIDE_EFFECTS__
341
+ function Mo(e,t){let n=/* @__PURE__ */ No(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Mt(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(Mt(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
342
+ function No(e,t){let n=new cr({check:`custom`,...H(t)});return n._zod.check=e,n}function Po(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Ke(e,t,n[t]);return e}function Fo(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??Ta,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Io(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 Lo(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,Lo(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Po(o.schema,c),t.io===`input`&&qo(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 Ro(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function zo(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=/* @__PURE__ */ 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}/${Ro(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+Ro(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>
343
343
 
344
- 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 zo(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;zo(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}const Bo=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Vo=[`oneOf`,`anyOf`];function Ho(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Uo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Bo.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ 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]??Ho(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ge(n,r,e.length===1?e[0]:Uo(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=Ho(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 Wo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Bo)if(t in e)return;let n=t.filter(e=>Vo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Uo(t);else{let e=n[0],i=Vo.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=>Uo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,No(e,r))}function Go(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)):No(i,s),No(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())zo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ 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)??[])Wo(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)}No(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,Ge(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:Jo(t,`input`,e.processors),output:Jo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ko(e,t){let n=t??{seen:/* @__PURE__ */ 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 Ko(r.element,n);if(r.type===`set`)return Ko(r.valueType,n);if(r.type===`lazy`)return Ko(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 Ko(r.innerType,n);if(r.type===`intersection`)return Ko(r.left,n)||Ko(r.right,n);if(r.type===`record`||r.type===`map`)return Ko(r.keyType,n)||Ko(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Ko(r.in,n)||Ko(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ko(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ko(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ko(e,n))return!0;return!!(r.rest&&Ko(r.rest,n))}return!1}const qo=(e,t={})=>n=>{let r=Po({...n,processors:t});return Io(e,r),Ro(r,e),Go(r,e)},Jo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Po({...i??{},target:a,io:t,processors:n});return Io(e,o),Ro(o,e),Go(o,e)},Yo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Xo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Zo=(e,t)=>{Yo(e,`minimum`,t),Xo(e,`maximum`,t)},Qo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},$o=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},es=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},ts=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ns=(e,t)=>Yo(e,`minimum`,t.minimum),rs=(e,t)=>Xo(e,`maximum`,t.maximum),is=e=>(t,n)=>{ts(t,n.format);let[r,i]=e[n.format];Yo(t,`minimum`,r),Xo(t,`maximum`,i)},as={greater_than:(e,t)=>Yo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Xo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Qo(e,t.value),number_format:is(ut),bigint_format:is(dt),min_length:ns,max_length:rs,length_equals:(e,t)=>Zo(e,t.length),min_size:ns,max_size:rs,size_equals:(e,t)=>Zo(e,t.size),string_format:(e,t)=>{ts(e,t.format),t.pattern&&$o(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)=>es(e,t.mime)};function os(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)as[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Yo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Yo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Xo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Xo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Qo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&es(t,i.mime);for(let e of i.patterns??[])$o(t,e);return t}const ss={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},cs=/* @__PURE__ */ new Map([[li,Wn],[di,Gn]]),ls=e=>cs.get(e)??e,us=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=os(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ss[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(ls);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}))])}},ds=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=os(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=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Fo(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}))])}},fs=(e,t,n,r)=>{n.type=`boolean`},ps=(e,t,n,r)=>{Fo(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},ms=(e,t,n,r)=>{Fo(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},hs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},gs=(e,t,n,r)=>{Fo(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},_s=(e,t,n,r)=>{Fo(e,t,n,r,`Void cannot be represented in JSON Schema`)},vs=(e,t,n,r)=>{n.not={}},ys=(e,t,n,r)=>{},bs=(e,t,n,r)=>{},xs=(e,t,n,r)=>{Fo(e,t,n,r,`Date cannot be represented in JSON Schema`)},Ss=(e,t,n,r)=>{let i=e._zod.def,a=Le(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},Cs=(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(Fo(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Fo(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}},ws=(e,t,n,r)=>{Fo(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Ts=(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},Es=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=os(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})))},Ds=(e,t,n,r)=>{n.type=`boolean`},Os=(e,t,n,r)=>{Fo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ks=(e,t,n,r)=>{Fo(e,t,n,r,`Function types cannot be represented in JSON Schema`)},As=(e,t,n,r)=>{Fo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},js=(e,t,n,r)=>{Fo(e,t,n,r,`Map cannot be represented in JSON Schema`)},Ms=(e,t,n,r)=>{Fo(e,t,n,r,`Set cannot be represented in JSON Schema`)},Ns=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=os(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Io(a.element,t,{...r,path:[...r.path,`items`]})};function Ps(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ps(t.out):t.type===`catch`?Ps(t.innerType):e._zod.optin}const Fs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Fo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ge(i.properties,e,Io(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`?Ps(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=Io(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Is=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Io(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ls=(e,t,n,r)=>{let i=e._zod.def,a=Io(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Io(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)},Rs=(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)=>Io(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Io(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`?Ps(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}=os(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function zs(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=zs(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=>zs(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`)?nr:tr).source),p):p}const Bs=/* @__PURE__ */ new WeakMap;function Vs(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Bs.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=zs(t,a,/* @__PURE__ */ 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)}}const Hs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=os(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Io(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Ge(i.patternProperties,ls(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Io(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Bs.get(t);n||(n=[],Bs.set(t,n),t.deferred.push(()=>Vs(t))),n.push(e)}i.additionalProperties=Io(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ps(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))}},Us=(e,t,n,r)=>{let i=e._zod.def,a=Io(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`}]},Ws=(e,t,n,r)=>{let i=e._zod.def;Io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gs=Symbol();function Ks(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Fo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Gs):JSON.parse(o)}const qs=(e,t,n,r)=>{let i=e._zod.def;Io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ks(i.defaultValue,e,t,n,r);o!==Gs&&(n.default=o)},Js=(e,t,n,r)=>{let i=e._zod.def;Io(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ks(i.defaultValue,e,t,n,r);o!==Gs&&(n._prefault=o)},Ys=(e,t,n,r)=>{let i=e._zod.def;Io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Fo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Xs=(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;Io(o,t,r);let s=t.seen.get(e);s.ref=o},Zs=(e,t,n,r)=>{let i=e._zod.def;Io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Qs=(e,t,n,r)=>{let i=e._zod.def;Io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$s=(e,t,n,r)=>{let i=e._zod.def;Io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ec={string:us,number:ds,boolean:fs,bigint:ps,symbol:ms,null:hs,undefined:gs,void:_s,never:vs,any:ys,unknown:bs,date:xs,enum:Ss,literal:Cs,nan:ws,template_literal:Ts,file:Es,success:Ds,custom:Os,function:ks,transform:As,map:js,set:Ms,array:Ns,object:Fs,union:Is,intersection:Ls,tuple:Rs,record:Hs,nullable:Us,nonoptional:Ws,default:qs,prefault:Js,catch:Ys,pipe:Xs,readonly:Zs,promise:Qs,optional:$s,lazy:(e,t,n,r)=>{let i=e._zod.innerType;Io(i,t,r);let a=t.seen.get(e);a.ref=i}};function tc(e,t){if(`_idmap`in e){let n=e,r=Po({...t,processors:ec}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Io(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ro(r,n),Ge(a,t,Go(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Po({...t,processors:ec});return Io(e,n),Ro(n,e),Go(n,e)}const nc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function rc(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})}})}const ic=(e,t)=>{an.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);nc.has(n)||(nc.add(n),rc(n,`format`,e=>t=>cn(e,t)),rc(n,`flatten`,e=>t=>sn(e,t)),rc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ze,2)}),rc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ze,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},ac=/*@__PURE__*/ G(`ZodError`,ic),oc=/*@__PURE__*/ G(`ZodError`,ic,void 0,{Parent:Error}),sc=/* @__PURE__ */ un(oc),cc=/* @__PURE__ */ dn(oc),lc=/* @__PURE__ */ fn(oc),uc=/* @__PURE__ */ mn(oc),dc=/* @__PURE__ */ bn(oc),fc=/* @__PURE__ */ xn(oc),pc=/* @__PURE__ */ Sn(oc),mc=/* @__PURE__ */ Cn(oc),hc=/* @__PURE__ */ wn(oc),gc=/* @__PURE__ */ Tn(oc),_c=/* @__PURE__ */ En(oc),vc=/* @__PURE__ */ Dn(oc);function yc(){Xt.localeError||Zt(ba())}function bc(){Xt.memoizer||Zt({memoizer:_a()})}const xc=/*@__PURE__*/ G(`ZodType`,(e,t)=>(yc(),Dr.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Qe(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 ct(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ul(e,t))},superRefine(e,t){return this.check(Wl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ So(e))},optional(){return wl(this)},exactOptional(){return El(this)},nullable(){return Ol(this)},nullish(){return wl(Ol(this))},nonoptional(e){return Pl(this,e)},array(){return sl(this)},or(e){return ul([this,e])},and(e){return ml(this,e)},transform(e){return Rl(this,Sl(e))},default(e){return Al(this,e)},prefault(e){return Ml(this,e)},catch(e){return Il(this,e)},pipe(e){return Rl(this,e)},readonly(){return Bl(this)},describe(e){let t=this.clone();return wa.add(t,{description:e}),t},meta(...e){if(e.length===0)return wa.get(this);let t=this.clone();return wa.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 Pt(this,`~standard`,{...Ar(this),jsonSchema:{input:Jo(this,`input`),output:Jo(this,`output`)}})},set"~standard"(e){Nt(this,`~standard`,e)},parse:function e(t,n){return sc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await cc(this,t,n,{callee:e})},safeParse(e,t){return lc(this,e,t)},async safeParseAsync(e,t){return uc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Nt(this,`spa`,e)},validate(e,t){return _n(this,e,t)},validateAsync(e,t){return yn(this,e,t)},encode:function e(t,n){return dc(this,t,n,{callee:e})},decode:function e(t,n){return fc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await pc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await mc(this,t,n,{callee:e})},safeEncode(e,t){return hc(this,e,t)},safeDecode(e,t){return gc(this,e,t)},async safeEncodeAsync(e,t){return _c(this,e,t)},async safeDecodeAsync(e,t){return vc(this,e,t)},toJSONSchema(e){return qo(this,{})(e)},get description(){return wa.get(this)?.description},get _def(){return this._zod.def}}),Sc=/*@__PURE__*/ G(`_ZodString`,(e,t)=>{jr.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>us(e,t,n,r)},/*@__PURE__*/ Ft({format:e=>os(e).format??null,minLength:e=>os(e).minimum??null,maxLength:e=>os(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ go(...e))},includes(...e){return this.check(/* @__PURE__ */ yo(...e))},startsWith(...e){return this.check(/* @__PURE__ */ bo(...e))},endsWith(...e){return this.check(/* @__PURE__ */ xo(...e))},min(...e){return this.check(/* @__PURE__ */ mo(...e))},max(...e){return this.check(/* @__PURE__ */ po(...e))},length(...e){return this.check(/* @__PURE__ */ ho(...e))},nonempty(...e){return this.check(/* @__PURE__ */ mo(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ _o(e))},uppercase(e){return this.check(/* @__PURE__ */ vo(e))},trim(){return this.check(/* @__PURE__ */ wo())},normalize(...e){return this.check(/* @__PURE__ */ Co(...e))},toLowerCase(){return this.check(/* @__PURE__ */ To())},toUpperCase(){return this.check(/* @__PURE__ */ Eo())},slugify(){return this.check(/* @__PURE__ */ Do())}})),Cc=/*@__PURE__*/ G(`ZodString`,(e,t)=>{jr.init(e,t),Sc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Da(kc,e))},url(e){return this.check(/* @__PURE__ */ Na(Mc,e))},jwt(e){return this.check(/* @__PURE__ */ Ja(qc,e))},emoji(e){return this.check(/* @__PURE__ */ Pa(Nc,e))},guid(e){return this.check(/* @__PURE__ */ Oa(Ac,e))},uuid(e){return this.check(/* @__PURE__ */ ka(jc,e))},uuidv4(e){return this.check(/* @__PURE__ */ Aa(jc,e))},uuidv6(e){return this.check(/* @__PURE__ */ ja(jc,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ma(jc,e))},nanoid(e){return this.check(/* @__PURE__ */ Fa(Pc,e))},cuid(e){return this.check(/* @__PURE__ */ Ia(Fc,e))},cuid2(e){return this.check(/* @__PURE__ */ La(Ic,e))},ulid(e){return this.check(/* @__PURE__ */ Ra(Lc,e))},base64(e){return this.check(/* @__PURE__ */ Ga(Wc,e))},base64url(e){return this.check(/* @__PURE__ */ Ka(Gc,e))},xid(e){return this.check(/* @__PURE__ */ za(Rc,e))},ksuid(e){return this.check(/* @__PURE__ */ Ba(zc,e))},ipv4(e){return this.check(/* @__PURE__ */ Va(Bc,e))},ipv6(e){return this.check(/* @__PURE__ */ Ha(Vc,e))},cidrv4(e){return this.check(/* @__PURE__ */ Ua(Hc,e))},cidrv6(e){return this.check(/* @__PURE__ */ Wa(Uc,e))},e164(e){return this.check(/* @__PURE__ */ qa(Kc,e))},datetime(e){return this.check(/* @__PURE__ */ Ya(Tc,e))},date(e){return this.check(/* @__PURE__ */ Xa(Ec,e))},time(e){return this.check(/* @__PURE__ */ Za(Dc,e))},duration(e){return this.check(/* @__PURE__ */ Qa(Oc,e))}});function K(e){return/* @__PURE__ */ Ea(Cc,e)}const wc=/*@__PURE__*/ G(`ZodStringFormat`,(e,t)=>{Mr.init(e,t),Sc.init(e,t)}),Tc=/*@__PURE__*/ G(`ZodISODateTime`,(e,t)=>{Zr.init(e,t),wc.init(e,t)}),Ec=/*@__PURE__*/ G(`ZodISODate`,(e,t)=>{Qr.init(e,t),wc.init(e,t)}),Dc=/*@__PURE__*/ G(`ZodISOTime`,(e,t)=>{$r.init(e,t),wc.init(e,t)}),Oc=/*@__PURE__*/ G(`ZodISODuration`,(e,t)=>{ei.init(e,t),wc.init(e,t)}),kc=/*@__PURE__*/ G(`ZodEmail`,(e,t)=>{Fr.init(e,t),wc.init(e,t)}),Ac=/*@__PURE__*/ G(`ZodGUID`,(e,t)=>{Nr.init(e,t),wc.init(e,t)}),jc=/*@__PURE__*/ G(`ZodUUID`,(e,t)=>{Pr.init(e,t),wc.init(e,t)}),Mc=/*@__PURE__*/ G(`ZodURL`,(e,t)=>{Ur.init(e,t),wc.init(e,t)}),Nc=/*@__PURE__*/ G(`ZodEmoji`,(e,t)=>{Wr.init(e,t),wc.init(e,t)}),Pc=/*@__PURE__*/ G(`ZodNanoID`,(e,t)=>{Gr.init(e,t),wc.init(e,t)}),Fc=/*@__PURE__*/ G(`ZodCUID`,(e,t)=>{Kr.init(e,t),wc.init(e,t)}),Ic=/*@__PURE__*/ G(`ZodCUID2`,(e,t)=>{qr.init(e,t),wc.init(e,t)}),Lc=/*@__PURE__*/ G(`ZodULID`,(e,t)=>{Jr.init(e,t),wc.init(e,t)}),Rc=/*@__PURE__*/ G(`ZodXID`,(e,t)=>{Yr.init(e,t),wc.init(e,t)}),zc=/*@__PURE__*/ G(`ZodKSUID`,(e,t)=>{Xr.init(e,t),wc.init(e,t)}),Bc=/*@__PURE__*/ G(`ZodIPv4`,(e,t)=>{ti.init(e,t),wc.init(e,t)}),Vc=/*@__PURE__*/ G(`ZodIPv6`,(e,t)=>{ii.init(e,t),wc.init(e,t)}),Hc=/*@__PURE__*/ G(`ZodCIDRv4`,(e,t)=>{ai.init(e,t),wc.init(e,t)}),Uc=/*@__PURE__*/ G(`ZodCIDRv6`,(e,t)=>{si.init(e,t),wc.init(e,t)}),Wc=/*@__PURE__*/ G(`ZodBase64`,(e,t)=>{ui.init(e,t),wc.init(e,t)}),Gc=/*@__PURE__*/ G(`ZodBase64URL`,(e,t)=>{pi.init(e,t),wc.init(e,t)}),Kc=/*@__PURE__*/ G(`ZodE164`,(e,t)=>{mi.init(e,t),wc.init(e,t)}),qc=/*@__PURE__*/ G(`ZodJWT`,(e,t)=>{gi.init(e,t),wc.init(e,t)}),Jc=/*@__PURE__*/ G(`ZodNumber`,(e,t)=>{_i.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ft({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=os(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=os(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=os(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>os(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ lo(e,t))},gte(e,t){return this.check(/* @__PURE__ */ uo(e,t))},min(e,t){return this.check(/* @__PURE__ */ uo(e,t))},lt(e,t){return this.check(/* @__PURE__ */ so(e,t))},lte(e,t){return this.check(/* @__PURE__ */ co(e,t))},max(e,t){return this.check(/* @__PURE__ */ co(e,t))},int(e){return this.check(Zc(e))},safe(e){return this.check(Zc(e))},positive(e){return this.check(/* @__PURE__ */ lo(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ uo(0,e))},negative(e){return this.check(/* @__PURE__ */ so(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ co(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ fo(e,t))},step(e,t){return this.check(/* @__PURE__ */ fo(e,t))},finite(){return this}}));function Yc(e){return/* @__PURE__ */ $a(Jc,e)}const Xc=/*@__PURE__*/ G(`ZodNumberFormat`,(e,t)=>{vi.init(e,t),Jc.init(e,t)});function Zc(e){return/* @__PURE__ */ to(Xc,e)}const Qc=/*@__PURE__*/ G(`ZodBoolean`,(e,t)=>{yi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r)});function $c(e){return/* @__PURE__ */ no(Qc,e)}const el=/*@__PURE__*/ G(`ZodNull`,(e,t)=>{bi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r)});function tl(e){return/* @__PURE__ */ io(el,e)}const nl=/*@__PURE__*/ G(`ZodUnknown`,(e,t)=>{xi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rl(){return/* @__PURE__ */ ao(nl)}const il=/*@__PURE__*/ G(`ZodNever`,(e,t)=>{Si.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r)});function al(e){return/* @__PURE__ */ oo(il,e)}const ol=/*@__PURE__*/ G(`ZodArray`,(e,t)=>{bc(),wi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ mo(e,t))},nonempty(e){return this.check(/* @__PURE__ */ mo(1,e))},max(e,t){return this.check(/* @__PURE__ */ po(e,t))},length(e,t){return this.check(/* @__PURE__ */ ho(e,t))},unwrap(){return this.element}});function sl(e,t){return/* @__PURE__ */ Oo(ol,e,t)}const cl=/*@__PURE__*/ G(`ZodObject`,(e,t)=>{bc(),Ai.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),Ht(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return vl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Qe(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Qe(this._zod.def,{catchall:rl()}))},loose(){return this.clone(Qe(this._zod.def,{catchall:rl()}))},strict(){return this.clone(Qe(this._zod.def,{catchall:al()}))},strip(){return this.clone(Qe(this._zod.def,{catchall:void 0}))},extend(e){return ht(this,e)},safeExtend(e){return _t(this,e)},merge(e){return vt(this,e)},pick(e){return ft(this,e)},omit(e){return mt(this,e)},partial(...e){return yt(Cl,this,e[0])},exactPartial(...e){return yt(Tl,this,e[0],`exactPartial`)},required(...e){return bt(Nl,this,e[0])}});function q(e,t){let n={type:`object`,shape:e??{},...U(t)};return new cl(n)}const ll=/*@__PURE__*/ G(`ZodUnion`,(e,t)=>{Mi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.options=t.options});function ul(e,t){return new ll({type:`union`,options:e,...U(t)})}const dl=/*@__PURE__*/ G(`ZodDiscriminatedUnion`,(e,t)=>{ll.init(e,t),Pi.init(e,t)});function fl(e,t,n){return new dl({type:`union`,options:t,discriminator:e,...U(n)})}const pl=/*@__PURE__*/ G(`ZodIntersection`,(e,t)=>{Fi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r)});function ml(e,t){return new pl({type:`intersection`,left:e,right:t})}const hl=/*@__PURE__*/ G(`ZodRecord`,(e,t)=>{bc(),Ri.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hs(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function gl(e,t,n){return!t||!t._zod?new hl({type:`record`,keyType:K(),valueType:e,...U(t)}):new hl({type:`record`,keyType:e,valueType:t,...U(n)})}const _l=/*@__PURE__*/ G(`ZodEnum`,(e,t)=>{zi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(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 _l({...t,checks:[],...U(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 _l({...t,checks:[],...U(r),entries:i})}});function vl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new _l({type:`enum`,entries:n,...U(t)})}const yl=/*@__PURE__*/ G(`ZodLiteral`,(e,t)=>{Bi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(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 bl(e,t){return new yl({type:`literal`,values:Array.isArray(e)?e:[e],...U(t)})}const xl=/*@__PURE__*/ G(`ZodTransform`,(e,t)=>{bc(),Vi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Yt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(jt(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(jt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Sl(e){return new xl({type:`transform`,transform:e})}const Cl=/*@__PURE__*/ G(`ZodOptional`,(e,t)=>{Ui.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wl(e){return new Cl({type:`optional`,innerType:e})}const Tl=/*@__PURE__*/ G(`ZodExactOptional`,(e,t)=>{Wi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function El(e){return new Tl({type:`optional`,innerType:e})}const Dl=/*@__PURE__*/ G(`ZodNullable`,(e,t)=>{Gi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ol(e){return new Dl({type:`nullable`,innerType:e})}const kl=/*@__PURE__*/ G(`ZodDefault`,(e,t)=>{Ki.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Al(e,t){return new kl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():at(t)}})}const jl=/*@__PURE__*/ G(`ZodPrefault`,(e,t)=>{Ji.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ml(e,t){return new jl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():at(t)}})}const Nl=/*@__PURE__*/ G(`ZodNonOptional`,(e,t)=>{Yi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pl(e,t){return new Nl({type:`nonoptional`,innerType:e,...U(t)})}const Fl=/*@__PURE__*/ G(`ZodCatch`,(e,t)=>{Qi.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ys(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Il(e,t){return new Fl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ut(t)})}const Ll=/*@__PURE__*/ G(`ZodPipe`,(e,t)=>{$i.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.in=t.in,e.out=t.out});function Rl(e,t){return new Ll({type:`pipe`,in:e,out:t})}const zl=/*@__PURE__*/ G(`ZodReadonly`,(e,t)=>{ta.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bl(e){return new zl({type:`readonly`,innerType:e})}const Vl=/*@__PURE__*/ G(`ZodCustom`,(e,t)=>{ra.init(e,t),xc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Os(e,t,n,r)});function Hl(e,t){return/* @__PURE__ */ ko(Vl,e??(()=>!0),t)}function Ul(e,t={}){return/* @__PURE__ */ Ao(Vl,e,t)}function Wl(e,t){return/* @__PURE__ */ jo(e,t)}function Gl(e){return/* @__PURE__ */ eo(Jc,e)}function Kl(e){return/* @__PURE__ */ ro(Qc,e)}const ql=1e4,Jl=`[a-z0-9][a-z0-9_-]*`,Yl=K().max(80).regex(RegExp(`^${Jl}(?:/${Jl})*$`),`invalid channel path`),Xl=e=>!e.includes(`\0`)&&e.isWellFormed(),Zl=e=>e.replaceAll(`\0`,``).toWellFormed(),Ql=K().max(ql).refine(e=>e.trim().length>0,`message text is empty`).refine(Xl,`message text has a NUL character or a lone surrogate`),$l=Yc().int().positive(),eu=/* @__PURE__ */ new Set([...Object.getOwnPropertyNames(Object.prototype),`prototype`]),tu=e=>!eu.has(e),nu=K().max(64).regex(/^[a-z0-9][a-z0-9_.-]*$/,`invalid label key`).refine(tu,`label key is a reserved name`),ru=gl(nu,K().max(256).refine(Xl,`label value has a NUL character or a lone surrogate`)),iu=K().max(64).regex(/^[a-z0-9_+-]+$/,`invalid emoji name`).refine(tu,`emoji name is a reserved name`),au=K().min(1).max(256);ul([vl([`person`,`agent`,`deployment`,`workflow`,`external`]),bl(`profile`)]);const ou=e=>e===`profile`?`agent`:e;K().min(1).max(128).refine(Xl,`handle has a NUL character or a lone surrogate`);function su(e){if(e===null)return null;try{return new URL(e).protocol===`https:`?e:null}catch{return null}}q({actor:au,principal:K().min(1),profile:K().nullable(),session:K().nullable()});const cu=K().regex(/^[A-Za-z0-9_-]{22}$/,`invalid attachment id`);q({id:cu,name:K().min(1).max(255),type:K().min(1).max(255),size:Yc().int().nonnegative()}),K().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/,`ids start with a letter and use up to 32 letters, numbers, and hyphens`);const lu=K().min(3).max(300),uu=q({channel:lu.optional(),thread:lu,subthread:lu.nullable(),message:K().min(1).max(300),context:K().max(300).nullable()}),du=q({author:K().min(1).max(256),text:K().max(ql),createdAt:K().max(64).nullable(),files:sl(q({name:K().min(1).max(1e3),url:K().max(4e3).nullable()})).max(20)}),fu=q({url:K().min(1).max(4e3),message:$l.nullable(),snapshot:du.nullable(),unavailable:K().max(300).nullable()}),pu=q({id:K().min(1),handle:K().min(1),name:K().min(1),avatar:K().nullable(),isBot:$c()}),mu=q({type:vl([`image`,`file`,`video`,`audio`]),name:K().max(1e3).optional(),mimeType:K().max(255).optional(),size:Yc().int().nonnegative().optional(),url:K().max(4e3).optional(),fetchMetadata:gl(K(),K().max(4e3)).optional()}),hu=q({url:K().min(1).max(4e3),thread:lu,message:K().min(1).max(300),snapshot:du.nullable()}),gu=q({channel:lu,thread:lu,subthread:lu.nullable()}),_u=fl(`kind`,[q({kind:bl(`message`),...gu.shape,message:K(),isRoot:$c(),text:K(),context:K().nullable(),author:pu,files:sl(mu).max(20).optional(),links:sl(hu).max(10).optional()}),q({kind:bl(`edited`),...gu.shape,message:K(),text:K(),author:pu,links:sl(hu).max(10).optional(),linksOnly:$c().optional()}),q({kind:bl(`deleted`),...gu.shape,message:K()}),q({kind:bl(`reaction`),...gu.shape,message:K(),emoji:K(),added:$c(),author:pu}),q({kind:bl(`lifecycle`),...gu.omit({subthread:!0}).shape,type:K(),title:K(),url:K().nullable(),labels:gl(K(),K()),unset:sl(K()),owns:sl(K()).optional(),reply:K().nullable(),createRoot:$c(),retitled:$c().optional(),author:pu})]),vu=e=>e.slice(e.indexOf(`:`)+1).includes(`:`),yu=e=>{let t=e.indexOf(`:`),n=e.slice(t+1).indexOf(`:`);return n===-1?e:e.slice(0,t+1+n)},bu=(e,t)=>`${e}|${t}`,xu=K().min(1).max(128),Su=xu,Cu=ul([K(),sl(K())]).transform(e=>Array.isArray(e)?e:[e]),wu=K().regex(/^[a-z0-9][a-z0-9_.-]*(=.*)?$/,`label filters look like key, key=value, or key=a|b`).transform(e=>{let t=e.indexOf(`=`);return t===-1?[e,null]:[e.slice(0,t),e.slice(t+1).split(`|`)]}),Tu=q({target:lu,kind:vl([`channel`,`thread`])}),Eu=q({channel:K().optional(),re:Su.optional(),by:K().optional(),mentions:K().optional(),label:Cu.pipe(sl(wu)).optional(),from:K().min(1).max(64).optional(),text:K().min(1).max(200).optional()}),Du=Eu.extend({after:xu.optional(),before:Su.optional(),limit:Gl().int().min(1).max(500).optional()}),Ou=Eu.extend({after:xu.optional(),limit:Gl().int().min(1).max(500).optional()}),ku=Eu.extend({after:xu.optional(),wait:Gl().min(0).max(300).optional(),all:Kl().optional()}),Au=q({channel:Yl.optional(),re:xu.optional(),text:K().max(ql).default(``),labels:ru.optional(),noSync:$c().optional(),sync:sl(ul([K().min(3).max(300),Tu])).max(10).optional(),id:K().min(1).max(200).refine(Xl,`id has a NUL character or a lone surrogate`).optional(),attachments:sl(cu).max(10).optional()}).refine(e=>e.text.trim().length>0||(e.attachments?.length??0)>0,{message:`message text is empty`,path:[`text`]}).refine(e=>e.channel===void 0!=(e.re===void 0),{message:"a post needs `channel`; a reply needs `re`"}).refine(e=>!(e.noSync&&e.sync?.length),{message:"`noSync` and `sync` contradict each other"}),ju=K().regex(/^\d+(\.\d+)?(s|m|h|d)$/,`durations look like 30s, 30m, 12h, or 1d`),Mu=K().datetime({offset:!0}),Nu=q({channel:Yl.optional(),re:xu.optional(),text:K().max(ql).default(``),labels:ru.optional(),noSync:$c().optional(),attachments:sl(cu).max(10).optional(),in:ju.optional(),at:Mu.optional(),every:ju.optional(),until:Mu.optional(),for:ju.optional(),times:Yc().int().positive().optional()}).refine(e=>e.text.trim().length>0||(e.attachments?.length??0)>0,{message:`message text is empty`,path:[`text`]}).refine(e=>e.channel===void 0!=(e.re===void 0),{message:"a schedule needs `channel` for a new thread, or `re` for a reply"}).refine(e=>e.in!==void 0||e.at!==void 0||e.every!==void 0,{message:"say when: `in`, `at`, or `every`"}).refine(e=>e.in===void 0||e.at===void 0,{message:"`in` and `at` contradict each other"}).refine(e=>[e.until,e.for,e.times].filter(e=>e!==void 0).length<=1,{message:"pick one stop: `until`, `for`, or `times`"}).refine(e=>e.every!==void 0||e.until===void 0&&e.for===void 0&&e.times===void 0,{message:"`until`, `for`, and `times` stop a repeat: add `every`"}),Pu=q({re:Su.optional(),channel:K().optional(),by:K().optional(),all:Kl().optional()}),Fu=q({target:K().min(3).max(300)}),Iu=q({channel:K().optional(),limit:Gl().int().min(1).max(500).optional()}),Lu=q({watch:gl(K().max(100),q({tail:K().max(1e3),when:vl([`matches`,`enters`]).default(`matches`)})).refine(e=>Object.keys(e).length<=32,`a board registers at most 32 watchers`),sync:sl(q({key:K().min(1).max(64),platform:K().min(1).max(64),signIn:$c().default(!1)})).max(32).optional()}),Ru=ul([Lu.extend({url:K().url().max(500).refine(e=>/^https:\/\//.test(e),`wake-ups go over https`).transform(e=>e.replace(/\/+$/,``)).nullable().optional(),path:tl({error:`register a url or a path, not both`}).optional(),branch:tl({error:`a branch goes with a path`}).optional()}),Lu.extend({url:tl({error:`register a url or a path, not both`}).optional(),path:K().max(300).regex(/^\/[^?#]*$/,`a path starts with / and has no query or fragment`).transform(e=>e.replace(/(.)\/+$/,`$1`)),branch:K().min(1).max(255).nullable().optional()})]),zu=q({limit:Gl().int().min(1).max(50).optional(),wait:Gl().min(0).max(25).optional()}),Bu=q({lease:K().min(1).max(64),error:K().min(1).max(500).optional(),skip:$c().optional()}),Vu=q({target:K().min(1).max(4e3),limit:Gl().int().min(1).max(200).optional()}),Hu=q({target:K().min(1).max(4e3)}),Uu=q({url:K().url().max(4e3)}),Wu=q({actor:K().min(1).max(256)}),Gu=K().min(1).max(64),Ku=q({thread:lu,message:K().min(1).max(300).optional()}),qu=fu.extend({message:xu.nullable()}),Ju=pu.extend({avatar:K().nullable().transform(su)}),Yu={author:Ju,from:Gu.nullable()},Xu=q({key:Gu,channel:lu,thread:lu}),Zu={origin:Ku.optional(),message:xu.optional()},Qu=fl(`op`,[q({op:bl(`post`),...Yu,origin:uu.nullable().default(null),source:Xu.optional(),channel:Yl.optional(),re:xu.optional(),text:K().max(ql).default(``),labels:ru.optional(),noSync:$c().optional(),attachments:sl(cu).max(10).optional(),links:sl(qu).max(10).optional(),id:K().min(1).max(200).refine(Xl,`id has a NUL character or a lone surrogate`).optional()}),q({op:bl(`edit`),...Yu,...Zu,text:Ql,source:Xu.optional()}),q({op:bl(`delete`),...Yu,...Zu}),q({op:bl(`react`),...Yu,...Zu,emoji:iu,remove:$c().optional()}),q({op:bl(`labels`),...Yu,...Zu,set:ru.optional(),unset:sl(nu).optional()}),q({op:bl(`links`),...Yu,...Zu,links:sl(qu).max(10)}),q({op:bl(`seen`),author:Ju})]),$u=sl(K().min(1).max(300)).max(10).nullable(),ed=fl(`kind`,[q({kind:bl(`message`),message:xu,target:lu,external:q({thread:lu,message:K().min(1).max(300),asUser:bl(!0).optional()}),files:$u.optional()}),q({kind:bl(`files`),message:xu,target:lu,files:$u}),q({kind:bl(`failed`),message:xu,target:lu,error:K().min(1).max(500)}),q({kind:bl(`thread`),message:xu,target:lu,targetKind:vl([`channel`,`thread`]),cause:vl([`config`,`request`])})]),td=q({code:K().min(1).max(64).optional(),post:K().min(1).max(200).optional(),thread:lu.optional(),message:K().min(1).max(300).optional(),account:au.optional(),person:au.optional()}),nd=q({message:Cu.pipe(sl(xu).min(1).max(100))}),rd=q({by:au,since:Gl().int().nonnegative()}),id=q({events:sl(q({id:K().min(1).max(300),event:_u,raw:rl()})).min(1).max(50)}),ad=q({limit:Gl().int().min(1).max(50).optional()}),od=q({lease:K().min(1).max(64),error:K().min(1).max(500).optional()}),sd=q({sync:Gu}),cd=q({sync:Gu,account:Ju,code:K().min(1).max(64),message:K().max(1024).optional(),method:vl([`code`,`consent`]).optional()}),ld=q({sync:Gu,code:K().min(1).max(64)}),ud=q({account:au}),dd=q({name:K().max(1024).nullable().optional(),type:K().max(1024).nullable().optional(),size:Yc().int().positive().max(Ae,`direct uploads are at most ${Ae/1024/1024} MB`)}),fd=q({text:Ql}),pd=q({}).optional(),md=q({status:K().trim().min(1).max(100).optional()}).optional(),hd=q({emoji:iu,remove:$c().optional()}),gd=q({set:ru.optional(),unset:sl(nu).optional()}).refine(e=>e.set!==void 0||e.unset!==void 0,{message:"nothing to change: pass `set` or `unset`"}),_d={discovery:{method:`GET`,path:`/`},me:{method:`GET`,path:`/me`},channels:{method:`GET`,path:`/channels`},actors:{method:`GET`,path:`/actors`},messages:{method:`GET`,path:`/messages`,query:Du},message:{method:`GET`,path:`/messages/:id`},threads:{method:`GET`,path:`/threads`,query:Ou},post:{method:`POST`,path:`/messages`,body:Au},edit:{method:`POST`,path:`/messages/:id/edit`,body:fd},delete:{method:`POST`,path:`/messages/:id/delete`,body:pd},react:{method:`POST`,path:`/messages/:id/reactions`,body:hd},label:{method:`POST`,path:`/messages/:id/labels`,body:gd},sync:{method:`POST`,path:`/messages/:id/sync`,body:Fu},synced:{method:`GET`,path:`/messages/:id/sync`},linked:{method:`GET`,path:`/links`,query:Uu},typing:{method:`POST`,path:`/messages/:id/typing`,body:md},schedule:{method:`POST`,path:`/schedules`,body:Nu},schedules:{method:`GET`,path:`/schedules`,query:Pu},cancelSchedule:{method:`POST`,path:`/schedules/:id/cancel`},posted:{method:`GET`,path:`/posts/:id`},inbox:{method:`GET`,path:`/inbox/:key`,query:Iu},inboxPush:{method:`POST`,path:`/inbox/:key`,body:id},inboxNext:{method:`GET`,path:`/inbox/:key/next`,query:ad},inboxAck:{method:`POST`,path:`/inbox/:key/:id/ack`,body:od},syncImport:{method:`POST`,path:`/sync/imports`,body:Qu},syncReceipt:{method:`POST`,path:`/sync/receipts`,body:ed},syncThread:{method:`GET`,path:`/sync/threads/:thread`},syncFind:{method:`GET`,path:`/sync/find`,query:td},syncCopies:{method:`GET`,path:`/sync/copies`,query:nd},syncRoots:{method:`GET`,path:`/sync/roots`,query:rd},syncCode:{method:`POST`,path:`/sync/codes`,body:sd},syncAccount:{method:`POST`,path:`/sync/accounts`,body:cd},syncUnlink:{method:`POST`,path:`/sync/accounts/unlink`,body:ud},readSource:{method:`GET`,path:`/sources/:key/read`,query:Vu},joinSource:{method:`POST`,path:`/sources/:key/join`,body:Hu},webhook:{method:`POST`,path:`/webhooks/:key`},events:{method:`GET`,path:`/events`,query:ku},avatar:{method:`GET`,path:`/avatars/:name`},upload:{method:`POST`,path:`/attachments`},attachment:{method:`GET`,path:`/attachments/:id`},uploadStart:{method:`POST`,path:`/attachments/uploads`,body:dd},uploadFinish:{method:`POST`,path:`/attachments/uploads/:id`},openapi:{method:`GET`,path:`/openapi.json`},identity:{method:`GET`,path:`/identity`},signIn:{method:`GET`,path:`/identity/sign-in`,query:ld},signedIn:{method:`GET`,path:`/identity/signed-in`,query:ld},identityUnlink:{method:`POST`,path:`/identity/unlink`,body:Wu},watchers:{method:`GET`,path:`/watchers`},register:{method:`POST`,path:`/watchers`,body:Ru},matches:{method:`GET`,path:`/watchers/matches`,query:zu},ack:{method:`POST`,path:`/watchers/matches/:id/ack`,body:Bu},wake:{method:`POST`,path:`/wake`}};async function*vd(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=()=>void n.cancel().catch(()=>{});t?.addEventListener(`abort`,a,{once:!0});try{for(;;){let{value:e,done:t}=await n.read();if(t)return;i+=r.decode(e,{stream:!0});let a;for(;(a=i.search(/\r?\n\r?\n/))!==-1;){let e=i.slice(0,a);i=i.slice(a).replace(/^\r?\n\r?\n/,``);let t={},n=[];for(let r of e.split(/\r?\n/)){if(r===``||r.startsWith(`:`))continue;let e=r.indexOf(`:`),i=e===-1?r:r.slice(0,e),a=e===-1?``:r.slice(e+1).replace(/^ /,``);i===`data`?n.push(a):i===`id`?t.id=a:i===`event`&&(t.event=a)}n.length>0&&(t.data=n.join(`
345
- `)),(t.id!==void 0||t.data!==void 0)&&(yield t)}}}finally{t?.removeEventListener(`abort`,a),n.releaseLock()}}var yd=class extends Error{code;status;constructor(e,t,n){super(t),this.name=`BoardError`,this.code=e,this.status=n}};const bd=async e=>typeof e==`function`?await e():e,xd=e=>{let{at:t,until:n,...r}=Sd(e);return{...r,...t===void 0?{}:{at:t instanceof Date?t.toISOString():t},...n===void 0?{}:{until:n instanceof Date?n.toISOString():n}}},Sd=e=>{if(typeof e==`string`)return{text:e};let{attachments:t,...n}=e;return t?.length?{...n,attachments:t.map(e=>typeof e==`string`?e:e.id)}:n},Cd={ms:1,s:1e3,m:6e4,h:36e5,d:864e5};function wd(e){if(typeof e==`number`)return e;let t=e.trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/);if(!t)throw new yd(`invalid_duration`,`invalid duration: ${e}`,0);return Number(t[1])*Cd[t[2]??`ms`]}const Td=e=>encodeURIComponent(e);function Ed(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`label`){let e=Array.isArray(r)?r:typeof r==`object`?Object.entries(r).map(([e,t])=>`${e}=${String(t)}`):[r];for(let n of e)t.append(`label`,String(n))}else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}const Dd=(e,t)=>t?.length?{...e,unknownMentions:t}:e;function Od(e){let t=e.url.replace(/\/+$/,``),n=e.fetch??((e,t)=>globalThis.fetch(e,t)),r=e.storeFetch??((e,t)=>globalThis.fetch(e,t));async function i(t,n){let r={...e.headers?await bd(e.headers):{}};if(!t)return r;e.token!==void 0&&(r.authorization=`Bearer ${await bd(e.token)}`);let i=n===void 0?e.profile===void 0?null:await bd(e.profile):n;if(i!==null){let{name:e,avatar:t}=typeof i==`string`?{name:i,avatar:void 0}:i;r[`x-board-profile`]=e,t&&(r[`x-board-avatar`]=t)}else{let t=e.person===void 0?null:await bd(e.person);t?.name&&(r[`x-board-name`]=encodeURIComponent(t.name)),t?.avatar&&(r[`x-board-avatar`]=t.avatar)}let a=n===void 0?e.session===void 0?null:await bd(e.session):null;a&&(r[`x-board-session`]=a);let o=e.handle===void 0?null:await bd(e.handle);return o&&(r[`x-board-handle`]=o),r}async function a(e,r,a={}){let o=await n(`${t}${r}`,{method:e,headers:{...await i(a.auth??!0),...a.body===void 0?{}:{"content-type":`application/json`},...a.headers},...a.body===void 0?{}:{body:JSON.stringify(a.body)},...a.signal?{signal:a.signal}:{}});if(!o.ok)throw await kd(o);return o}async function o(e,t,n){return await(await a(e,t,n)).json()}let s=(e={})=>e;async function c(e={},t){return o(`GET`,`/events${Ed(e)}`,t?{signal:t}:{})}return{url:t,request:async(e,r={})=>n(`${t}${e}`,{method:r.method??`GET`,headers:{...r.headers,...await i(!0,r.as)},...r.body?{body:r.body}:{},...r.signal?{signal:r.signal}:{}}),discovery:()=>o(`GET`,`/`,{auth:!1}),me:()=>o(`GET`,`/me`),channels:async()=>(await o(`GET`,`/channels`)).channels,actors:async()=>(await o(`GET`,`/actors`)).actors,identity:()=>o(`GET`,`/identity`),unlinkAccount:e=>o(`POST`,`/identity/unlink`,{body:{actor:e}}),messages:(e={})=>o(`GET`,`/messages${Ed(e)}`),thread:e=>o(`GET`,`/messages/${Td(e)}`),posted:async e=>(await o(`GET`,`/posts/${Td(e)}`)).message,threads:(e={})=>o(`GET`,`/threads${Ed(e)}`),async post(e,t){let{message:n,unknownMentions:r}=await o(`POST`,`/messages`,{body:{channel:e,...Sd(t)}});return Dd(n,r)},async reply(e,t){let{message:n,unknownMentions:r}=await o(`POST`,`/messages`,{body:{re:e,...Sd(t)}});return Dd(n,r)},async schedule(e,t){let{schedule:n,unknownMentions:r}=await o(`POST`,`/schedules`,{body:{...typeof e==`string`?{channel:e}:{re:e.re},...xd(t)}});return Dd(n,r)},schedules:async(e={})=>(await o(`GET`,`/schedules${Ed(e)}`)).schedules,cancelSchedule:e=>o(`POST`,`/schedules/${Td(e)}/cancel`,{body:{}}),async upload(e){let a=e.type||(e.data instanceof Blob?e.data.type:``)||Ne(e.name),s=e.data instanceof Blob?e.data.size:e.data.byteLength;if(s>4194304){if(s>104857600)throw new yd(`too_large`,`attachments are at most ${Ae/1024/1024} MB`,413);let t=await o(`POST`,`/attachments/uploads`,{body:{name:e.name,type:a,size:s}}).catch(e=>{throw e instanceof yd&&e.status===404&&e.code===`not_found`?new yd(`too_large`,`this board takes files of at most ${Oe/1024/1024} MB`,413):e}),n=await r(t.url,{method:`PUT`,headers:t.headers,body:e.data});if(!n.ok)throw new yd(`upload_failed`,`the blob store refused the file: ${n.status} ${(await n.text().catch(()=>``)).slice(0,300)||n.statusText}`,n.status);return(await o(`POST`,`/attachments/uploads/${encodeURIComponent(t.id)}`,{body:{}})).attachment}let c=await n(`${t}/attachments`,{method:`POST`,headers:{...await i(!0),"content-type":a,"x-board-filename":encodeURIComponent(e.name)},body:e.data});if(!c.ok)throw await kd(c);return(await c.json()).attachment},download:(e,t={})=>a(`GET`,`/attachments/${encodeURIComponent(e)}`,t.signal?{signal:t.signal}:{}),edit:(e,t)=>o(`POST`,`/messages/${Td(e)}/edit`,{body:{text:t}}),delete:e=>o(`POST`,`/messages/${Td(e)}/delete`,{body:{}}),react:(e,t,n={})=>o(`POST`,`/messages/${Td(e)}/reactions`,{body:{emoji:Ee(t),...n}}),label:(e,t)=>o(`POST`,`/messages/${Td(e)}/labels`,{body:t}),typing:async(e,t)=>(await o(`POST`,`/messages/${Td(e)}/typing`,{body:t?{status:t}:{}})).targets,sync:((e,t)=>t===void 0?o(`GET`,`/messages/${Td(e)}/sync`):o(`POST`,`/messages/${Td(e)}/sync`,{body:{target:t}})),linked:e=>o(`GET`,`/links${Ed({url:e})}`),inbox:async(e,t={})=>(await o(`GET`,`/inbox/${e}${Ed(t)}`)).events,register:e=>o(`POST`,`/watchers`,{body:e}),watchers:async()=>(await o(`GET`,`/watchers`)).watchers,matches:async(e={})=>{let{signal:t,...n}=e;return(await o(`GET`,`/watchers/matches${Ed(n)}`,t?{signal:t}:{})).matches},ack:(e,t)=>o(`POST`,`/watchers/matches/${encodeURIComponent(e)}/ack`,{body:t}),readSource:(e,t,n={})=>o(`GET`,`/sources/${e}/read${Ed({target:t,...n})}`),joinSource:(e,t)=>o(`POST`,`/sources/${e}/join`,{body:{target:t}}),poll:c,syncImport:e=>o(`POST`,`/sync/imports`,{body:e}),syncReceipt:e=>o(`POST`,`/sync/receipts`,{body:e}),syncThread:e=>o(`GET`,`/sync/threads/${Td(e)}`),syncFind:(e,t={})=>o(`GET`,`/sync/find${Ed(e)}`,t.signal?{signal:t.signal}:{}),syncCopies:async e=>(await o(`GET`,`/sync/copies?${e.map(e=>`message=${encodeURIComponent(e)}`).join(`&`)}`)).copies,syncRoots:async(e,t)=>(await o(`GET`,`/sync/roots${Ed({by:e,since:t instanceof Date?t.getTime():t})}`)).roots,inboxPush:(e,t)=>o(`POST`,`/inbox/${Td(e)}`,{body:{events:t}}),inboxNext:async(e,t={})=>(await o(`GET`,`/inbox/${Td(e)}/next${Ed(t)}`)).items,inboxAck:(e,t,n)=>o(`POST`,`/inbox/${Td(e)}/${Td(t)}/ack`,{body:n}),syncCode:e=>o(`POST`,`/sync/codes`,{body:{sync:e}}),syncAccount:e=>o(`POST`,`/sync/accounts`,{body:e}),syncUnlink:e=>o(`POST`,`/sync/accounts/unlink`,{body:{account:e}}),async*events(e={},t={}){let n=e.after,r=0;for(;!t.signal?.aborted;){let i;try{i=await a(`GET`,`/events${Ed({...s(e),after:n})}`,{headers:{accept:`text/event-stream`},...t.signal?{signal:t.signal}:{}})}catch(e){if(t.signal?.aborted)return;if(e instanceof yd&&e.status>=400&&e.status<500)throw e;await new Promise(e=>setTimeout(e,Math.min(3e4,500*2**r++)));continue}r=0;try{for await(let e of vd(i.body,t.signal))e.id!==void 0&&(n=e.id),e.event===`board`&&e.data&&(yield JSON.parse(e.data))}catch{if(t.signal?.aborted)return;await new Promise(e=>setTimeout(e,Math.min(3e4,500*2**r++)))}}},async wait(e={},t={}){let n=Date.now()+wd(t.timeout??`30m`),r=e.after??(await c({...e,after:void 0,wait:0},t.signal)).cursor;for(;Date.now()<n&&!t.signal?.aborted;){let i=Math.max(0,Math.min(25,Math.ceil((n-Date.now())/1e3))),a=await c({...e,after:r,wait:i},t.signal);if(a.events.length>0)return a.events[0];r=a.cursor}return null}}}async function kd(e){try{let t=await e.json();if(t.error?.message)return new yd(t.error.code??`error`,t.error.message,e.status)}catch{}return new yd(`http_error`,`${e.status} ${e.statusText}`,e.status)}const Ad=e=>Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);async function jd(e){return Ad(new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e))))}async function Md(...e){let t=new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(JSON.stringify(e)))).slice(0,16);t[6]=t[6]&15|128,t[8]=t[8]&63|128;let n=Ad(t);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}const Nd=/^[0-9a-f]{8}-[0-9a-f]{4}-8[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,Pd=async(e,t)=>`key:${e}:${(await jd(`board-key\u001f${t}`)).slice(0,32)}`;var Fd=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t}},Id=class extends Fd{response;constructor(e){super(e.status,`rejected`,`rejected with ${e.status}`),this.response=e}};const Ld=(e,t=`invalid_request`)=>new Fd(400,t,e),Rd=e=>new Fd(401,`unauthorized`,e),zd=e=>new Fd(403,`forbidden`,e),Bd=(e,t=`not_found`)=>new Fd(404,t,e),Vd=()=>new Fd(409,`duplicate_id`,`that id was already used for a different write`),Hd=(e,t=200,n)=>new Response(JSON.stringify(e),{status:t,headers:{"content-type":`application/json`,...n}});function Ud(e){if(e.code!==`invalid_union`||e.errors.length===0)return e;let t=e.errors.reduce((e,t)=>t.length<e.length?t:e)[0];return t?Ud({...t,path:[...e.path,...t.path]}):e}function Wd(e){if(e instanceof Id)return e.response;if(e instanceof Fd)return Hd({error:{code:e.code,message:e.message}},e.status);if(e instanceof ac){let t=e.issues[0]&&Ud(e.issues[0]),n=t?.path.length?`${t.path.join(`.`)}: `:``;return Hd({error:{code:`invalid_request`,message:`${n}${t?.message??`invalid request`}`}},400)}let t=e?.code;return t===`INVALID_PAYLOAD`?Hd({error:{code:`invalid_request`,message:e.message}},400):t===`PARTIAL_DUPLICATE_BATCH`||t===`DUPLICATE_EVENT_ID`?Wd(Vd()):t===`STORE_UNAVAILABLE`||t===`STORE_NOT_CONFIGURED`?Hd({error:{code:`unavailable`,message:e.message}},503):(console.error(`[board]`,e),Hd({error:{code:`internal`,message:`internal error`}},500))}const Gd=`0.21.1`,Kd=[`avatar`,`openapi`,`webhook`,`signIn`,`signedIn`,`identityUnlink`,`sync`],qd=/* @__PURE__ */ `discovery.me.channels.actors.identity.messages.threads.message.post.posted.edit.delete.react.label.schedule.schedules.cancelSchedule.upload.attachment.uploadStart.uploadFinish.watchers.register.matches.ack.events.syncImport.syncReceipt.syncThread.syncFind.syncCopies.syncRoots.inboxPush.inboxNext.inboxAck.inbox.syncCode.syncAccount.syncUnlink.typing.readSource.joinSource.synced.linked`.split(`.`),Jd=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Yd(e,t,n,r){let i=t.split(`/`).filter(Boolean),a=i.map(e=>e.startsWith(`:`)?`/([^/]+)`:`/${Jd(e)}`).join(``);return{method:e,pattern:RegExp(`${a}$`),names:i.filter(e=>e.startsWith(`:`)).map(e=>e.slice(1)),target:n,segments:i.length,literals:i.filter(e=>!e.startsWith(`:`)).length,own:r}}function Xd(e,t){let n=[...Kd.map(e=>Yd(_d[e].method,_d[e].path,{kind:`board`,name:e},!1)),...qd.filter(e=>e!==`discovery`).map(e=>Yd(_d[e].method,_d[e].path,{kind:`protocol`,name:e},!1)),...e.map(e=>Yd(e.method,e.path,{kind:`backend`,route:e},!0))].sort((e,t)=>t.segments-e.segments||t.literals-e.literals||Number(t.own)-Number(e.own)),r=(e,t,n)=>{let r={};try{e.names.forEach((e,t)=>r[e]=decodeURIComponent(n[t]))}catch{return null}let i=e.names[0];return{target:e.target,base:t,param:i===void 0?null:r[i],params:r}},i=e=>({target:{kind:`protocol`,name:`discovery`},base:e,param:null,params:{},root:!0});return function(e,a){let o=a.length>1?a.replace(/\/+$/,``):a;if(t!==void 0){let a=t.replace(/\/+$/,``);if(o!==a&&!o.startsWith(`${a}/`))return null;let s=o.slice(a.length)||`/`;if(s===`/`)return e===`GET`?i(a):null;for(let t of n){let n=t.method===e?s.match(RegExp(`^${t.pattern.source}`)):null;if(n)return r(t,a,n.slice(1))}return null}for(let t of n){if(t.method!==e)continue;let n=o.match(t.pattern);if(n)return r(t,o.slice(0,n.index),n.slice(1))}return e===`GET`?i(o===`/`?``:o):null}}function Zd(e){let t={};for(let n of new Set(e.searchParams.keys())){let r=e.searchParams.getAll(n);t[n]=r.length>1?r:r[0]}return t}async function Qd(e){let t=await e.text();if(t.trim()!==``)try{return JSON.parse(t)}catch{throw Ld(`request body is not valid JSON`)}}const $d=()=>new Fd(413,`too_large`,`attachments are at most ${Oe/1024/1024} MB`);async function ef(e,t){if(Number(e.headers.get(`content-length`)??0)>t)throw $d();let n=[],r=0;for await(let i of e.body??[]){if(r+=i.byteLength,r>t)throw $d();n.push(i)}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;return i}function tf(){let e={};for(let[t,n]of Object.entries(_d)){let r=n.path.replace(/:(\w+)/g,`{$1}`),i={operationId:t};`query`in n&&(i[`x-query-schema`]=tc(n.query,{io:`input`})),`body`in n&&(i.requestBody={content:{"application/json":{schema:tc(n.body,{io:`input`})}}}),(e[r]??={})[n.method.toLowerCase()]=i}return{openapi:`3.1.0`,info:{title:`board`,version:Gd},paths:e}}const nf={re:{type:`string`},by:{type:`string`},mentions:{type:`string`},label:{type:`string`,multiple:!0},from:{type:`string`},text:{type:`string`}};function rf(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r===`--mentions`?e[n+1]?.startsWith(`@`)?t.push(`--mentions=${e[++n]}`):t.push(`--mentions=me`):t.push(r)}return t}function af(e){let t=[],n=null,r=null;for(let i=0;i<e.length;i++){let a=e[i];r?a===r?r=null:a===`\\`&&r===`"`&&i+1<e.length?n+=e[++i]:n+=a:/\s/.test(a)?(n!==null&&t.push(n),n=null):a===`"`||a===`'`?(r=a,n??=``):n=a===`\\`&&i+1<e.length?(n??``)+e[++i]:(n??``)+a}if(r)throw Error(`unterminated ${r}`);return n!==null&&t.push(n),t}const of={...nf,all:{type:`boolean`}};function sf(e){let t={},n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`--`){n.push(...e.slice(r+1));break}if(!i.startsWith(`-`)||i===`-`){n.push(i);continue}let a=i.indexOf(`=`),o=i.startsWith(`--`)?i.slice(2,a===-1?void 0:a):null,s=o!==null&&Object.hasOwn(of,o)?of[o]:null;if(!s)throw Error(`${o===null?i.slice(0,2):`--${o}`} isn't a filter`);if(s.type===`boolean`){if(a!==-1)throw Error(`--${o} takes no value`);t[o]=!0;continue}let c;if(a!==-1)c=i.slice(a+1);else{let t=e[r+1];if(t===void 0||t.length>1&&t.startsWith(`-`))throw Error(`--${o} needs a value`);c=t,r++}t[o]=`multiple`in s?[...t[o]??[],c]:c}return{values:t,positionals:n}}function cf(e){let{values:t,positionals:n}=sf(rf(af(e)));if(n.length>1)throw Error(`expected one channel, got: ${n.join(` `)}`);let r=n[0],i=Eu.safeParse({...r?{channel:r}:{},...t.re?{re:t.re.replace(/^#/,``)}:{},...t.by?{by:t.by.replace(/^@/,``)}:{},...t.mentions?{mentions:t.mentions.replace(/^@/,``)}:{},...t.label?.length?{label:t.label}:{},...t.from?{from:t.from}:{},...t.text?{text:t.text}:{}});if(!i.success){let e=i.error.issues[0];throw Error(`${e?.path.length?`--${String(e.path[0])}: `:``}${e?.message??`invalid filters`}`)}return{filters:i.data,all:t.all===!0}}const lf=e=>e.channel!==void 0||e.re!==void 0||e.by!==void 0||e.mentions!==void 0||e.from!==void 0||e.text!==void 0||(e.label?.length??0)>0;function uf(e,t){let n,r;try{({filters:n,all:r}=cf(t.tail))}catch(t){throw Error(`watch ${e}: ${t.message}`)}if(n.mentions===`me`)throw Error(`watch ${e}: a watcher has no "me": use --mentions @handle`);let i=lf(n);if(t.when===`enters`&&!i)throw Error(`watch ${e}: \`when: enters\` needs a filter to enter`);return{filters:n,criteria:i,enters:t.when===`enters`,all:r}}const df=1e4,ff=e=>((e instanceof Error?e.message:String(e))||`unknown error`).slice(0,500),pf=e=>e?.startsWith(`https://`)?e:null;function mf(e){let t=typeof process<`u`&&process.env.VERCEL===`1`?process.env:null,n=t?.VERCEL_TARGET_ENV||t?.VERCEL_ENV,r=n===`preview`&&t?.VERCEL_GIT_COMMIT_REF||null;return!e||n!==`production`&&!r?null:{path:new URL(e).pathname,...r?{branch:r}:{}}}function hf(e){let{registry:t,rethrow:n}=e,r=e.binding,i=null,a=null;async function o(n){let r=await e.hash();return i&&i.url===n&&i.result.hash===r&&Date.now()-i.at<df?i.result:(a??=e.wakeAt(n).then(e=>t.register(e)).then(e=>(i={url:n,at:Date.now(),result:e},e)).finally(()=>{a=null}),a)}async function s(e){let n={};if(!r().subscriptions[e.watcher])n={skip:!0};else try{await r().run(e.watcher,e.event,{trigger:`watch:${e.watcher}:${e.id}`,attempt:e.attempt+1})}catch(t){console.error(`[board] watcher ${e.watcher} failed:`,t),n={error:ff(t)}}await t.ack(e.id,{lease:e.lease,...n}).catch(e=>console.error(`[board] couldn't ack a match:`,ff(e)))}async function c(){let e=0,n=Date.now()+24e4;for(;Date.now()<n;){let n=await t.matches({limit:10});if(n.length===0)break;await Promise.all(n.map(s)),e+=n.length}return e+await r().pull()}let l=null;function u(){if(l)return;let n=l=new AbortController;(async()=>{for(let i=1e3;!n.signal.aborted;)try{await o(null);let e=await t.matches({limit:10,wait:25,signal:n.signal});await Promise.all(e.map(s)),await r().pull(),i=1e3}catch(t){if(n.signal.aborted)break;console.error(`[board] couldn't pull matches from ${e.remote}:`,ff(t)),await new Promise(e=>setTimeout(e,i)),i=Math.min(i*2,6e4)}})()}let d=null,f=0;function p(){if(d)return d;if(!e.hasWork()||Date.now()-f<df)return Promise.resolve();let t=pf(r().url());return!t&&typeof process<`u`&&process.env.VERCEL===`1`?Promise.resolve():(d=o(t).then(()=>{},t=>{d=null,f=Date.now(),console.error(`[board] couldn't register with ${e.remote}:`,ff(t))}),t||u(),d)}return{start:p,routes:[{method:`POST`,path:`/wake`,async handle(t){return d??=Promise.resolve(),t.headers.get(`x-board-watchers`)!==await e.hash()&&await o(pf(r().url())).catch(n),Hd({ran:await c().catch(n)})}},{method:`POST`,path:`/watchers`,async handle(t,{caller:i}){if(i)return e.registerFor(i,t);d??=Promise.resolve();let a=pf(r().url()),s=await o(a).catch(n);return a||u(),Hd(s)}}],registerNow:()=>o(pf(r().url())),close:()=>{l?.abort(),l=null}}}const gf=(e,t)=>e<t?-1:+(e>t);function _f(e,t=[]){let n=Object.keys(e).sort(gf).map(t=>[t,e[t].tail,e[t].when]);return t.length>0&&n.push([`sync`,[...t].sort((e,t)=>gf(e.key,t.key)).map(e=>[e.key,e.platform,e.signIn])]),JSON.stringify(n)}const vf=/^[A-Za-z][A-Za-z0-9-]{0,31}$/,yf=/* @__PURE__ */ new Set([`identity`,`edit`,`delete`,`schedule`,`cancelSchedule`,`upload`,`uploadStart`,`uploadFinish`,`watchers`,`register`,`matches`,`ack`,`syncImport`,`syncReceipt`,`syncThread`,`syncFind`,`syncCopies`,`syncRoots`,`inboxPush`,`inboxNext`,`inboxAck`,`inbox`,`syncCode`,`syncAccount`,`syncUnlink`]);function bf(e){let t=e.replace(/[^A-Za-z0-9-]+/g,`-`).replace(/^-+|-+$/g,``);return/^[A-Za-z]/.test(t)||(t=`u-${t}`),t.slice(0,32).replace(/-+$/,``)}function xf(e,t){let n=new Set([...t,`middleware`,`client`].map(e=>e.toLowerCase())),r=bf(e),i=r;for(let e=2;n.has(i.toLowerCase());e++)i=`${r.slice(0,31-String(e).length)}-${e}`;return i}function Sf(e){let{access:t}=e.principal;if(t.everywhere(`manage`))return null;let n=Object.entries(t.summary()).map(([e,t])=>`${e}=${t.join(`,`)}`);return n.length>0?n.join(`;`):`*=`}const Cf=e=>((e instanceof Error?e.message:String(e))||`unknown error`).slice(0,500),wf=e=>{throw e instanceof yd?new Fd(e.status>=400?e.status:502,e.code,e.message):e instanceof Fd||e instanceof Error&&e.name===`AbortError`?e:new Fd(502,`unreachable`,`the board didn't answer: ${Cf(e)}`)};function Tf(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null&&r!==!1){if(n===`label`&&Array.isArray(r))for(let[e,n]of r)t.append(`label`,n===null?e:`${e}=${n.join(`|`)}`);else if(Array.isArray(r))for(let e of r)t.append(n,String(e));else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}function Ef(e,t){let n=(t.headers.get(`content-disposition`)??``).match(/filename\*=UTF-8''([^;]+)/)?.[1],r=`file`;try{n&&(r=decodeURIComponent(n))}catch{}return{attachment:{id:e,name:r,type:t.headers.get(`content-type`)??`application/octet-stream`,size:Number(t.headers.get(`content-length`)??0)},data:t.body??/* @__PURE__ */ new Uint8Array}}function Df(e,t,n){if(e!==void 0&&!/^https?:\/\/[^/]/.test(e))throw Error(`http: ${e} isn't a URL: pass the board's, like https://board.example.com/api/board`);if(e===void 0&&!n)throw Error(`http: pass the board's URL: outside Node there's no environment to find it in`);let r=(e??n.url()).replace(/\/+$/,``),i=t.fetch??n?.fetch(r)??((e,t)=>globalThis.fetch(e,t)),a=null,o={},s=[],c=null,l=()=>c??=jd(_f(o,s)).then(e=>e.slice(0,32)),u=()=>{if(!a)throw Error(`http: this backend isn't serving a board yet: pass it to board({ backend })`);return a},d=(e,t)=>Od({url:r,fetch:i,profile:e===void 0?()=>n?.profile().profile??null:e,session:t||e===null?null:()=>n?.profile().session??null}),f=d(null,!0),p=/* @__PURE__ */ new Map;function m(e){if(!vf.test(e))throw new Fd(400,`invalid_request`,`as: ${e}: profiles start with a letter and use up to 32 letters, numbers, and hyphens`);let t=p.get(e);return t||p.set(e,t=d(e,!0)),t}let h=/* @__PURE__ */ new Map;function g(e){let t=JSON.stringify(e??(e===null?null:`\0`)),n=h.get(t);return n||h.set(t,n=d(e,!1)),n}function _(e){return e.origin.via?.kind===`engine`?f:e.origin.via?.kind===`client`?(e.self!==null&&m(e.self),g(`profile`in e?e.profile:e.self??void 0)):m(e.self??`client`)}let v=null,y=()=>(v??=i(r).then(async e=>{if(!e.ok)throw new Fd(e.status>=400?e.status:502,`no_board`,`no board at ${r} (${e.status})`);return await e.json()},wf)).catch(e=>{throw v=null,e}),b=null,x=()=>b??=f.me().then(e=>e.principal).catch(e=>{throw b=null,e}),S=async e=>Pd(await x(),e);async function C(e,t,n,i){let a=_d[t],o={...n},s=a.path.replace(/:(\w+)/g,(e,t)=>{let n=o[t];return delete o[t],encodeURIComponent(String(n))}),c;if(t===`upload`){let{data:t,name:r,type:a}=n;if(t.byteLength>4194304){let n=await e.upload({data:t,name:r??`file`,...a?{type:a}:{}}).catch(wf);return Response.json({attachment:n})}c=await e.request(s,{method:`POST`,body:t,headers:{...a?{"content-type":a}:{},...r===null?{}:{"x-board-filename":encodeURIComponent(r)}},signal:i}).catch(wf)}else c=a.method===`GET`?await e.request(`${s}${Tf(o)}`,{signal:i}).catch(wf):await e.request(s,{method:`POST`,body:new TextEncoder().encode(JSON.stringify(o)),headers:{"content-type":`application/json`},signal:i}).catch(wf);if(c.ok)return c;try{let e=await c.json();if(e.error?.message)throw new Fd(c.status,e.error.code??`error`,e.error.message)}catch(e){if(e instanceof Fd)throw e}throw new Fd(502,`remote_error`,`${r} answered ${c.status}`)}async function w(e,t,n,a){if(e===`me`){let{principal:e,author:n,actor:r}=t;return{actor:r.id,principal:e.id,kind:r.kind,handle:r.handle,name:r.name,avatar:r.avatar,profile:n.profile,session:n.session,expiresAt:e.expiresAt?.toISOString()??null,can:e.access.summary()}}if(yf.has(e))throw zd(`this board's callers act as its project on ${r}, which can't tell them apart: ${e} is the project's own to do there`);let s=Sf(t),c=t.actor.avatar?.startsWith(`https://`)?t.actor.avatar:void 0,l=Od({url:r,fetch:i,profile:{name:xf(t.actor.handle,Object.keys(o)),...c?{avatar:c}:{}},session:null,...s===null?{}:{headers:{"x-board-scope":s}}});(e===`post`||e===`posted`)&&typeof n.id==`string`&&(n={...n,id:await S(await Md(`board-gateway`,t.principal.id,n.id)).catch(wf)});let u=await C(l,e,n,a);return e===`attachment`?Ef(String(n.id),u):u.json()}async function T(e,t,n,r){let i=k();if(`identity`in t)return w(e,t.identity,n,r);let a=_(t);`self`in t&&t.origin.via?.kind===`engine`&&await i,(e===`post`||e===`posted`)&&`self`in t&&typeof n.id==`string`&&Nd.test(n.id)&&(n={...n,id:await S(n.id).catch(wf)});let o=await C(a,e,n,r);return e===`attachment`?Ef(String(n.id),o):o.json()}let E={...Object.fromEntries(qd.map(e=>[e,(t,n,r)=>T(e,t,n,r)])),async discovery(){return y()},async readSource(e,t,n){return`self`in e&&u().sync.some(e=>e.key===t.key)?u().readSource(t.key,t.target,t.limit??50):T(`readSource`,e,t,n)},async joinSource(e,t,n){return`self`in e&&u().sync.some(e=>e.key===t.key)?u().joinSource(t.key,t.target):T(`joinSource`,e,t,n)},async synced(e,t,n){let{targets:r}=await T(`synced`,e,t,n);return{targets:await Promise.all(r.map(async e=>({...e,url:e.url??(e.thread!==null&&e.message!==null?await u().linkOf(e.key,e.thread,e.message):null)})))}},async linked(e,t,n){let r=()=>new Fd(404,`message_not_found`,`no message on this board for that link`),i=await(async()=>{for(let{platform:e,thread:r,message:i}of u().locate(t.url))for(let t of u().sync.filter(t=>t.platform===e)){let e=await f.syncFind({thread:`${t.key}:${r}`,...i===null?{}:{message:i}},{signal:n}).catch(wf),a=i===null?e.thread===null?null:(await f.syncThread(e.thread).catch(wf)).root:e.message;if(a!==null)return a}return null})();if(i===null)return T(`linked`,e,t,n);try{return await E.message(e,{id:i},n)}catch(e){throw e instanceof Fd&&e.status===404?r():e}},async typing(e,t,n){let{targets:r}=await T(`typing`,e,t,n);if(!(`self`in e)||u().sync.length===0)return{targets:r};let{message:i,replies:a}=await E.message(e,{id:t.id},n),o=await u().typing([i,...a],t.status).catch(e=>(console.warn(`[board] skipped typing where this board syncs:`,Cf(e)),[]));return{targets:[...r,...o]}}};async function D(e){let t=mf(e);return t&&(await y()).wake_by_path?t:{url:e}}let O=hf({remote:r,registry:{register:e=>f.register({...e,watch:o,...s.length>0?{sync:s}:{}}),matches:e=>f.matches(e),ack:(e,t)=>f.ack(e,t)},wakeAt:D,binding:u,hash:l,hasWork:()=>Object.keys(o).length>0||s.length>0,rethrow:wf,registerFor:async(e,t)=>Hd(await E.register(e,Ru.parse(await t.json()),t.signal))}),k=O.start;return{...E,routes:O.routes,keeps:!1,bind(e){if(a)throw Error(`http: this backend already serves a board: create one http() per board()`);for(let[t,n]of Object.entries(e.subscriptions)){if(n.kind===`sync`){t===`@sync`&&(s=e.sync.map(e=>({...e})));continue}if(!vf.test(t))throw Error(`watch ${t}: ids start with a letter and use up to 32 letters, numbers, and hyphens`);uf(t,n),o[t]={tail:n.tail,when:n.when}}c=null,a=e},registerWatchers:O.registerNow,close:O.close}}function Of(e,t={}){return Df(e,t,null)}const kf=/```[\s\S]*?```/g,Af=/`[^`\n]*`/g,jf=`[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?`,Mf=RegExp(`(?<![\\w@.-])@(${jf}(?:/${jf})?)(?!:|[a-z0-9_/-]|\\.(?=[a-z0-9]))`,`gi`),Nf=/(?<![\w@.-])@\[([^\]\s]+)\]/g,Pf=e=>e.replace(kf,e=>` `.repeat(e.length)).replace(Af,e=>` `.repeat(e.length));function Ff(e){let t=Pf(e),n=[];for(let e of t.matchAll(Nf)){let t=e[1];t!==void 0&&n.push({index:e.index,token:{kind:`actor`,actor:t},key:`actor:${t}`})}for(let e of t.replace(Nf,e=>` `.repeat(e.length)).matchAll(Mf)){let t=e[1]?.toLowerCase();t!==void 0&&n.push({index:e.index,token:{kind:`handle`,handle:t},key:`handle:${t}`})}let r=/* @__PURE__ */ new Set;return n.sort((e,t)=>e.index-t.index).filter(({key:e})=>!r.has(e)&&r.add(e)).map(({token:e})=>e)}function If(e,t){let n=Pf(e),r=[];for(let e of n.matchAll(Nf))r.push({index:e.index,length:e[0].length,token:{kind:`actor`,actor:e[1]}});for(let e of n.replace(Nf,e=>` `.repeat(e.length)).matchAll(Mf))r.push({index:e.index,length:e[0].length,token:{kind:`handle`,handle:e[1].toLowerCase()}});let i=``,a=0;for(let{index:n,length:o,token:s}of r.sort((e,t)=>e.index-t.index)){let r=e.slice(n,n+o);i+=e.slice(a,n)+(t(s,r)??r),a=n+o}return i+e.slice(a)}const Lf=[`read`,`post`,`react`,`label`,`sync`,`manage`],Rf={read:[],post:[],react:[`read`],label:[`read`],sync:[`read`],manage:[`read`,`post`,`react`,`label`,`sync`]},zf=new Map(Lf.map((e,t)=>[e,t])),Bf=`write *, a channel, or a channel and its subtree (feedback/)`;function Vf(e){if(e===`*`)return{kind:`all`};if(e.includes(`*`)){let t=e.slice(0,e.indexOf(`*`)).replace(/\/+$/,``),n=t===``?`write * for every channel`:Yl.safeParse(t).success?`write ${t}/ for ${t} and its subtree`:Bf;throw Error(`invalid channel pattern ${e}: ${n}`)}let t=e.endsWith(`/`),n=t?e.slice(0,-1):e;if(!Yl.safeParse(n).success)throw Error(`invalid channel pattern ${e||`(empty)`}: ${Bf}`);return t?{kind:`subtree`,path:n}:{kind:`exact`,path:n}}const Hf=e=>e.kind===`all`?`*`:e.kind===`subtree`?`${e.path}/`:e.path;function Uf(e){let t=/* @__PURE__ */ new Set,n=e=>{if(!zf.has(e))throw Error(`unknown permission ${String(e)}: use ${Lf.join(`, `)}`);if(!t.has(e)){t.add(e);for(let t of Rf[e])n(t)}};for(let t of e===`all`?Lf:e)n(t);return t}const Wf=/* @__PURE__ */ new Set;function Gf(e){let t=null,n=/* @__PURE__ */ new Map,r=[];for(let[i,a]of e)i.kind===`all`?t=a:i.kind===`exact`?n.set(i.path,a):r.push([i.path,a]);return r.sort((e,t)=>t[0].length-e[0].length),{all:t,exact:n,subtrees:r}}const Kf=(e,t)=>e===t||e.startsWith(`${t}/`);function qf(e,t,n=!1){if(!n){let n=e.exact.get(t);if(n)return n}for(let[n,r]of e.subtrees)if(Kf(t,n))return r;return e.all??Wf}const Jf=(e,t)=>t.kind===`all`?e.all??Wf:qf(e,t.path,t.kind===`subtree`),Yf=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e));function Xf(e,t){if(t.kind===`exact`)return qf(e,t.path,!0);if(t.kind===`subtree`){for(let[n,r]of e.subtrees)if(n!==t.path&&Kf(t.path,n))return r}return e.all??Wf}function Zf(e){let t=Gf(e);return Gf(e.filter(([e,n])=>e.kind===`all`?n.size>0:!Yf(n,Xf(t,e))))}function Qf(e){return e===`all`||Array.isArray(e)?[[{kind:`all`},Uf(e)]]:Object.entries(e).map(([e,t])=>[Vf(e),Uf(t)])}const $f=e=>[...e.all?[[{kind:`all`},e.all]]:[],...e.subtrees.map(([e,t])=>[{kind:`subtree`,path:e},t]),...[...e.exact].map(([e,t])=>[{kind:`exact`,path:e},t])],ep=Symbol(`board.access`),tp=e=>typeof e==`object`&&ep in e;function np(e){let t=$f(e),n=n=>(e.all?.has(n)??!1)&&t.every(([,e])=>e.has(n)),r=/* @__PURE__ */ new Map;return{[ep]:e,can:(t,n)=>qf(e,n).has(t),readable(t){let n=r.get(t);return n===void 0&&r.set(t,n=qf(e,t).has(`read`)),n},readsAll:n(`read`),everywhere:n,anywhere:e=>t.some(([,t])=>t.has(e)),narrow(n){let r=tp(n)?n[ep]:Zf(Qf(n)),i=/* @__PURE__ */ new Map([[`*`,{kind:`all`}]]);for(let[e]of[...t,...$f(r)])i.set(Hf(e),e);return np(Zf([...i.values()].map(t=>{let n=Jf(r,t);return[t,new Set([...Jf(e,t)].filter(e=>n.has(e)))]})))},summary(){let e=t.map(([e,t])=>[Hf(e),t]);e.sort(([e],[t])=>e===`*`?-1:t===`*`?1:e.localeCompare(t));let n={};for(let[t,r]of e)n[t]=[...r].sort((e,t)=>zf.get(e)-zf.get(t));return n}}}function rp(e){return np(Zf(Qf(e)))}const ip=rp(`all`);function ap(e){if(e.length>4e3)throw Error(`x-board-scope is longer than 4000 characters`);let t={},n=e.split(`;`).map(e=>e.trim());if(n.every(e=>e===``))throw Error(`x-board-scope is empty: write pattern=permissions, like dev/=read,post`);for(let e of n){if(e===``)continue;let n=e.indexOf(`=`);if(n<0)throw Error(`x-board-scope entry ${e} needs =: write pattern=permissions, like dev/=read,post`);let r=e.slice(0,n).trim(),i=e.slice(n+1).trim();if(Object.hasOwn(t,r))throw Error(`x-board-scope lists ${r} twice`);Vf(r);let a=i===``?[]:i.split(`,`).map(e=>e.trim());if(a.length===1&&a[0]===`all`){t[r]=`all`;continue}for(let e of a)if(!zf.has(e))throw Error(`x-board-scope: unknown permission ${e||`(empty)`}: use ${Lf.join(`, `)}, or all`);t[r]=a}return t}const op=[`claude`,`codex`,`grok`,`pi`],sp=/^[A-Za-z][A-Za-z0-9-]{0,31}$/,cp=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/;function lp(e){let t=e.get(`x-board-profile`)?.trim()||null;if(t!==null&&!sp.test(t))throw Ld(`profile names start with a letter and use up to 32 letters, numbers, and hyphens`);let n=e.get(`x-board-avatar`)?.trim()||null;if(n!==null&&!dp(n))throw Ld(`avatars must be https URLs (http only on localhost)`);let r=e.get(`x-board-session`)?.trim().slice(0,200)||null,i=e.get(`x-board-handle`)?.trim().toLowerCase()||null;if(i!==null&&!cp.test(i))throw Ld(`invalid handle: ${i}`);let a=e.get(`x-board-name`),o=null;if(a)try{o=decodeURIComponent(a).replace(/[\u0000-\u001f\u007f]/g,``).trim().slice(0,128)||null}catch{throw Ld(`x-board-name must be URI-encoded`)}let s=e.get(`x-board-scope`);if(s!==null)try{ap(s)}catch(e){throw Ld(e.message,`invalid_scope`)}return{profile:t,avatar:n,session:r,handle:i,name:o,scope:s}}function up(e,t,n){let r=e.kind===`person`&&e.facts?.issuer!==`host`&&t.handle?t.handle:e.handle,i=e.kind===`person`?t.name:null,a=t.profile?.toLowerCase()??null,o=a===null?e.id:`${e.id}+${a}`,s=a!==null&&op.includes(a),c={id:o,kind:a===null?e.kind:`agent`,handle:a===null?r:`${r}/${a}`,name:t.profile??i??r,avatar:t.avatar??(s?`${n}/avatars/${a}`:null)};return{author:{actor:o,principal:e.id,profile:a,session:t.session},actor:c}}function dp(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`&&[`localhost`,`127.0.0.1`].includes(t.hostname)}catch{return!1}}const fp=e=>zd(`this token can't use this board: add ${e} to access`),pp=e=>{let t=new URL(e);return`${t.host}${t.pathname.replace(/\/+$/,``)}`.replace(/[%:]/g,e=>e===`%`?`%25`:`%3A`)};function mp(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=pp(n),r=t.get(e);if(r!==void 0&&r!==n)throw Error(`access: oidc issuers ${r} and ${n} name the same principals, oidc:${e}:<sub>: pin one of them`);t.set(e,n)}return new Set(e)}const hp=e=>[...new Set(e.flatMap(e=>typeof e!=`function`&&e.issuer===`oidc`?[e.url]:[]))];function gp(e){let t=typeof e.access==`function`?[]:e.access,n=typeof e.access==`function`?e.access:null,r=mp(hp(t));async function i(n,i){if(i?.issuer===`host`)throw zd(`this token can't use this board: its board no longer takes a host's principals`);if(i?.issuer===`oidc`&&!r.has(i.iss))throw Rd(`untrusted issuer: ${i.iss}`);let a=i?.claims??{},o=i?.issuer===`vercel`?await e.project():null,s=o?{teamId:i.team??o.teamId,projectId:o.id}:{teamId:null,projectId:null},c=String(a.environment??``),l=_p(),u=o!==null&&o.id!==null&&a.project_id===o.id,d=u&&l!==null&&c===l;for(let e of t){if(typeof e==`function`){if(d)continue;let t=await e(n);if(t===void 0)continue;if(t===null)throw zd(`this token can't use this board`);return rp(t)}if(i&&e.issuer===i.issuer&&(e.issuer!==`oidc`||e.url===i.iss)&&e.matches(a,s))return e.access}if(d)return ip;throw i?i.issuer===`oidc`?fp(`oidc({ issuer: '${i.iss}', claims, can })`):i.issuer===`github`?fp(`githubActions({ repository: '${String(a.repository)}', can })`):u?zd(`this token can't use this board: it runs in ${l??`no Vercel environment`}, so its ${c||`unnamed`} deployments need vercelProject({ project: 'self', environments: ['${c}'], can })`):fp(`vercelProject({ project: '${String(a.project??``)||String(a.project_id)}', can })`):zd(`this token can't use this board`)}async function a(t){let r=ip,a=t.facts?.issuer===`host`;if(t.id.startsWith(`board:`)||t.kind===`external`&&!a)r=ip;else{if(a){if(!e.hosts)throw zd(`this token can't use this board: its board no longer takes a host's principals`);let{exp:n}=t.facts.claims;if(typeof n==`number`&&n*1e3<=Date.now())throw Rd(`token expired`)}if(n){let e=await n(t);if(e==null)throw zd(`this token can't use this board`);r=rp(e)}else t.kind!==`person`&&(r=await i(t,(a?void 0:t.facts)??vp(t.id)))}return t.scope===void 0?r:r.narrow(ap(t.scope))}async function o(e){try{return await a(e)}catch(e){let t=e.status;if(t===401||t===403)return null;throw e}}return{grant:a,accessNow:o}}const _p=()=>process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||null;function vp(e){let t=e.match(/^vercel:project:([^:]+):([^:]+)$/);return t?{issuer:`vercel`,iss:``,claims:{project_id:t[1],environment:t[2]}}:null}const yp=Symbol(`board.oidcTokens`),bp=/* @__PURE__ */ new WeakSet,xp=e=>yp in e,Sp=e=>bp.has(e),Cp=/^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*:[^\s+\]]{1,200}$/,wp=[`person`,`deployment`,`workflow`,`external`];function Tp(e){let t=e=>{throw TypeError(`authenticate returned an invalid principal: ${e}`)};(typeof e!=`object`||!e)&&t(`not an object`),(typeof e.id!=`string`||!Cp.test(e.id)||e.id.startsWith(`board:`))&&t(`id must look like \`vercel:user:<id>\`, got ${JSON.stringify(e.id)}`),wp.includes(e.kind)||t(`kind must be one of ${wp.join(`, `)}`),(typeof e.handle!=`string`||!/^\S{1,64}$/.test(e.handle))&&t(`handle must be 1-64 characters, no spaces`);let n=e.expiresAt??null;if(n!==null&&(!(n instanceof Date)||Number.isNaN(n.getTime()))&&t(`expiresAt must be a Date or null`),n!==null&&n.getTime()<=Date.now())throw Rd(`token expired`);let r=n===null?{}:{exp:Math.floor(n.getTime()/1e3)};return{id:e.id,kind:e.kind,handle:e.handle,expiresAt:n,facts:{issuer:`host`,iss:``,claims:r}}}function Ep(e,t,n){let r=t||e.access!==void 0,i=e.access??[],a=null,o=()=>(a??=(async()=>{if(!n)return{id:e.project?.id??null,teamId:e.project?.teamId??null};let t=await n(),[r,i]=await Promise.all([t.ownProjectId(e.project),t.ownTeamId(e.project)]);return{id:r,teamId:i}})()).catch(e=>{throw a=null,e});async function s(t){return n?(await n()).discoveryIdentity(t,e.project):{projectId:e.project?.id??null,teamId:e.project?.teamId??null}}let c=null,l=()=>e.authenticate?Promise.resolve(e.authenticate):c??=n?n().then(e=>e.oidcTokens()):Promise.reject(new Fd(501,`no_verifier`,`this build of board verifies no tokens: pass board({ authenticate })`)),u=gp({access:i,project:o,hosts:e.authenticate!==void 0&&!xp(e.authenticate)}),d={project:o,issuers:typeof i==`function`?[]:hp(i)},f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new WeakMap;async function m(e){let t=e=>e.expiresAt===null||e.expiresAt.getTime()>Date.now(),n=p.get(e);if(n){let e=await n;if(t(e))return e}let r=e.credential===null?null:[e.audience,e.credential,e.headers.get(`x-vercel-oidc-token`)??``].join(``),i=r===null?void 0:f.get(r);if(i&&i.until>Date.now())return p.set(e,i.principal),i.principal;let a=h(e);return p.set(e,a),r!==null&&a.then(e=>{e.facts?.issuer!==`host`&&e.expiresAt!==null&&(f.size>=1e3&&f.delete(f.keys().next().value),f.set(r,{principal:a,until:e.expiresAt.getTime()}))},()=>p.delete(e)),a}async function h(e){let t=await l(),n;try{n=await t({...e,board:d})}catch(e){throw e instanceof Response?new Id(e):e}if(n instanceof Response)throw new Id(n);if(n==null)throw Rd(`missing bearer token`);return Sp(n)?n:Tp(n)}return{open:r,project:o,discoveryIdentity:s,async identify(e){let t=await m(e),n=e.claims.scope===null?t:{...t,scope:e.claims.scope},{author:r,actor:i}=up(n,e.claims,e.audience);return{principal:{...n,access:await u.grant(n)},author:r,actor:i}},accessNow:e=>u.accessNow(e)}}const Dp={claude:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`,openai:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,x:`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`,slack:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`,github:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`,whatsapp:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z`},Op={claude:{background:`#D97757`,mark:{path:Dp.claude}},codex:{background:`#000000`,mark:{path:Dp.openai}},grok:{background:`#000000`,mark:{path:Dp.x}},pi:{background:`#1f1f1f`,mark:{glyph:`π`}}};function kp(e){let t=Op[e]??{background:`#666666`,mark:{glyph:e.slice(0,1).toUpperCase()}},n=`path`in t.mark?`<path transform="translate(30 30) scale(2.8333)" fill="#ffffff" d="${t.mark.path}"/>`:`<text x="64" y="86" font-family="ui-sans-serif,system-ui,sans-serif" font-size="66" font-weight="600" text-anchor="middle" fill="#ffffff">${t.mark.glyph}</text>`;return`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"><rect width="128" height="128" rx="28" fill="${t.background}"/>${n}</svg>`}var Ap=class extends Fd{responses;constructor(e){super(422,`dropped`,e.join(`
346
- `)||`the board dropped this message`),this.responses=e}};const jp=q({text:K().max(ql).optional(),labels:ru.optional()}).strict();async function Mp(e,t,n){let r=[],i=null,a=async(o,s)=>{if(o===e.length){if(s.text.trim()===``&&(s.kind===`edit`||s.attachments.length===0))return;i={value:await n(s)};return}let c=null;await e[o]({write:Object.freeze({...s}),author:Object.freeze({...t.author}),source:Object.freeze({...t.source}),board:t.board(),respond:async e=>{r.push(e)},next:(e={})=>{if(c)throw Error(`next() was already called`);let{text:t,labels:n}=jp.parse(e);return c=a(o+1,{...s,...t===void 0?{}:{text:t},...s.kind===`post`&&n?{labels:{...s.labels,...n}}:{}}),c}}),c&&await c};if(await a(0,t.write),!i)throw new Ap(r);return i.value}const Np=e=>typeof e==`string`?{target:e,kind:vu(e)?`thread`:`channel`}:e,Pp=e=>Ff(e).some(e=>e.kind===`actor`&&e.actor.includes(`@`));async function Fp(e,t){let n=Ff(e).flatMap(e=>e.kind===`actor`&&e.actor.includes(`@`)?[e.actor]:[]);if(n.length===0)return{text:e,found:[]};let r=/* @__PURE__ */ new Map;for(let e of n)r.set(e,await t?.(e).catch(()=>null)??null);return{text:If(e,e=>{if(e.kind!==`actor`||!r.has(e.actor))return null;let t=r.get(e.actor);return t?`@[${t.id}]`:e.actor}),found:[...r.values()].filter(e=>e!==null)}}const Ip=/* @__PURE__ */ new Set([`post`,`schedule`,`upload`,`uploadFinish`]),Lp=/^(image\/(png|jpeg|gif|webp|avif)|video\/(mp4|webm)|text\/plain)$/;function Rp({attachment:e,data:t}){let n=Lp.test(e.type)?`inline`:`attachment`,r=t instanceof Uint8Array?new Blob([t]):t;return new Response(r,{headers:{"content-type":e.type,"content-length":String(e.size),"content-disposition":`${n}; filename*=UTF-8''${encodeURIComponent(e.name)}`,"content-security-policy":`sandbox; default-src 'none'`,"x-content-type-options":`nosniff`,"cache-control":`private, max-age=31536000, immutable`}})}async function zp(e,t,n,r){let i=r.id??``,a=r.key??``,o=()=>Qd(t);switch(e){case`discovery`:case`me`:case`channels`:case`actors`:case`identity`:case`watchers`:return{};case`message`:case`posted`:case`synced`:case`delete`:case`cancelSchedule`:case`attachment`:case`uploadFinish`:return{id:i};case`messages`:return Du.parse(Zd(n));case`threads`:return Ou.parse(Zd(n));case`schedules`:return Pu.parse(Zd(n));case`matches`:return zu.parse(Zd(n));case`events`:{let e=ku.parse(Zd(n)),r=t.headers.get(`last-event-id`);return e.after===void 0&&r&&xu.safeParse(r).success&&(e.after=r),e}case`post`:return Au.parse(await o());case`schedule`:return Nu.parse(await o());case`register`:return Ru.parse(await o());case`edit`:return{id:i,...fd.parse(await o())};case`react`:return{id:i,...hd.parse(await o())};case`label`:return{id:i,...gd.parse(await o())};case`ack`:return{id:i,...Bu.parse(await o())};case`upload`:{let e=t.headers.get(`x-board-filename`),n=null;try{n=e===null?null:decodeURIComponent(e)}catch{throw Ld("`x-board-filename` is not URI-encoded")}return{data:await ef(t,Oe),name:n,type:t.headers.get(`content-type`)}}case`uploadStart`:return dd.parse(await o());case`syncImport`:return Qu.parse(await o());case`syncReceipt`:return ed.parse(await o());case`syncThread`:return{thread:r.thread??``};case`syncFind`:return td.parse(Zd(n));case`syncCopies`:return nd.parse(Zd(n));case`syncRoots`:return rd.parse(Zd(n));case`inboxPush`:return{key:a,...id.parse(await o())};case`inboxNext`:return{key:a,...ad.parse(Zd(n))};case`inboxAck`:return{key:a,id:i,...od.parse(await o())};case`inbox`:return{key:a,...Iu.parse(Zd(n))};case`syncCode`:return sd.parse(await o());case`syncAccount`:return cd.parse(await o());case`syncUnlink`:return ud.parse(await o());case`typing`:return{id:i,...md.parse(await o())??{}};case`readSource`:return{key:a,...Vu.parse(Zd(n))};case`joinSource`:return{key:a,...Hu.parse(await o())};case`linked`:return Uu.parse(Zd(n))}}const Bp=e=>({id:e.id,kind:`external`,handle:e.handle,name:e.name,avatar:e.avatar});function Vp(e){let t=e.origin.via;return t?.kind===`middleware`||t?.kind===`engine`?null:t??{kind:`api`}}const Hp={self:`middleware`,origin:{via:{kind:`middleware`}}},Up={self:null,origin:{via:{kind:`client`,name:null}}};async function Wp(e){let{options:t,backend:n,runtime:r,policy:i}=e,a=t.sync??{},o=Object.keys(a).length>0?(await r.sync()).createSyncEngine(a):null,s=t.streamMaxMs??28e4,c=Xd(n.routes,t.basePath),{state:l,ownUrl:u,clientAs:d,handleOf:f}=e,p=t.watch??{},m=t.middleware??[];function h(e,t){return{credential:(e.headers.get(`authorization`)??``).match(/^Bearer\s+(.+)$/i)?.[1]??null,claims:lp(e.headers),audience:t,headers:e.headers}}async function g(e){return{identity:await i.identify(e),origin:{via:{kind:`api`}}}}let _=()=>new Fd(404,`not_found`,`${u()??`this board`} answers only wake-ups and webhooks`);async function v(e){return(await Fp(e,o?async e=>{let t=await o.findByEmail(e);return t&&await n.syncImport(o.caller,{op:`seen`,author:{...t,isBot:!1}},new AbortController().signal),t}:void 0)).text}async function y(e){if(typeof e!=`string`)return e;let t=e.indexOf(`:`);if(t<=0)throw Ld(`sync targets look like <key>:<channel or thread>, got: ${e}`);let n=e.slice(0,t);if(o&&a[n])return o.normalizeTarget(e);if(o)throw Ld(`no sync entry named ${n}`);return Np(e)}let b=e=>`identity`in e?e.identity.principal.access:null;async function x(e,t,n){let r=b(e);if(r===null)return{access:null,channel:t.channel??``};let i=t.channel??(t.re===void 0?void 0:(await P(e,t.re,n))?.channel);return i===void 0?null:r.can(`post`,i)?{access:r,channel:i}:null}let S=/* @__PURE__ */ new Map;async function C(e,t){if(`identity`in e)return{principal:e.identity.principal.id,actor:e.identity.actor};let r=JSON.stringify([e.origin.via?.kind??``,e.self,e.profile??null]),i=S.get(r);return i||(S.set(r,i=n.me(e,{},t).then(e=>({principal:e.principal,actor:{id:e.actor,kind:e.kind,handle:e.handle,name:e.name,avatar:e.avatar}}))),i.catch(()=>S.delete(r))),i}let w=null,T=(e,t,n,r)=>Mp(m,{write:e,author:t,source:n,board:()=>w??=f(Hp,null)},r);async function E(e){try{return await e(),!0}catch(e){if(e instanceof Fd&&e.status===404)return!1;throw e}}async function D(e,t,r){let i=[];for(let a of new Set(t??[])){let{attachment:t,data:o}=await n.attachment(e,{id:a},r);o instanceof ReadableStream&&await o.cancel().catch(()=>{}),i.push(t)}return i}async function O(e,t,r,i){let a=Vp(e);if(m.length===0||a===null||t.id!==void 0&&await E(()=>n.posted(e,{id:t.id},r)))return i(t);let o=t.channel,s=null;if(t.re!==void 0){let n=await P(e,t.re,r);if(!n)return i(t);o=n.channel,s=n.re??n.id}let c=b(e),l=Object.keys(t.labels??{}).length>0,u=t.re===void 0&&(t.sync?.length??0)>0;if(o===void 0||c&&(!c.can(`post`,o)||l&&!c.can(`label`,o)||u&&!c.can(`sync`,o)))return i(t);let d=await D(e,t.attachments,r),{actor:f}=await C(e,r);return T({kind:`post`,channel:o,re:s,text:t.text,labels:t.labels??{},attachments:d},f,a,e=>i({...t,text:e.text,labels:e.labels}))}async function k(e,t,n){let r=b(e),i=await P(e,t,n),a=i??(r===null?null:await P(Up,t,n));return!a||a.deleted||r&&!r.can(`post`,a.channel)||!i&&!a.blind?null:a.by.principal===(await C(e,n)).principal?a:null}async function A(e,t,n,r){let i=Vp(e);if(m.length===0||i===null)return r(t);let a=await k(e,t.id,n);if(!a)return r(t);let{actor:o}=await C(e,n);return T({kind:`edit`,id:a.id,channel:a.channel,re:a.re,text:t.text},o,i,e=>r({...t,text:e.text}))}async function j(e,t,r,i){let o=t.source?.key??t.from;if(t.source&&!(`identity`in e?(await n.watchers(e,{},i)).watchers.some(t=>t.owner===e.identity.principal.id&&t.sync.some(e=>e.key===o)):a[t.source.key]!==void 0))return null;let s=(t.op===`post`?t.origin:null)??r?.origin??null;return{kind:`sync`,key:o??``,platform:t.author.id.slice(0,Math.max(0,t.author.id.indexOf(`:`))),channel:t.source?.channel??r?.origin?.channel??s?.channel??``,thread:t.source?.thread??(s?s.subthread??s.thread:``)}}async function M(e,t,r){let i=t.message??null;if(t.origin!==void 0){let{thread:a,message:o}=await n.syncFind(e,{thread:t.origin.thread,...t.origin.message===void 0?{}:{message:t.origin.message}},r);i=t.origin.message===void 0?a===null?null:(await n.syncThread(e,{thread:a},r)).root:o}return i===null?null:P(e,i,r)}async function N(e,t,r){let i=t=>n.syncImport(e,t,r);if(m.length===0||e.origin.via?.kind===`middleware`||t.op!==`post`&&t.op!==`edit`)return i(t);let a=b(e);if(a&&(!a.anywhere(`sync`)||`identity`in e&&e.identity.principal.scope!==void 0))return i(t);let o=async e=>{try{return await e()}catch(e){if(!(e instanceof Ap))throw e;return{message:null,dropped:[...e.responses]}}};if(t.op===`post`){if(t.id!==void 0&&(await n.syncFind(e,{post:t.id},r)).message!==null)return i(t);let s=t.channel,c=null;if(t.re!==void 0){let n=await P(e,t.re,r);if(!n)return i(t);s=n.channel,c=n.re??n.id}if(s===void 0||a&&!a.can(`sync`,s))return i(t);let l=await j(e,t,null,r);if(!l)return i(t);let u=await D(e,t.attachments,r);return o(async()=>T({kind:`post`,channel:s,re:c,text:t.text,labels:t.labels??{},attachments:u},Bp(t.author),l,async e=>i({...t,text:e.text,labels:e.labels})))}if(t.origin===void 0==(t.message===void 0))return i(t);let s=await M(e,t,r);if(!s||s.deleted||a&&!a.can(`sync`,s.channel)||t.message!==void 0&&s.by.principal!==t.author.id)return i(t);let c=await j(e,t,s,r);return c?o(async()=>T({kind:`edit`,id:s.id,channel:s.channel,re:s.re,text:t.text},Bp(t.author),c,async e=>i({...t,text:e.text}))):i(t)}async function P(e,t,r){try{let{message:i,replies:a}=await n.message(e,{id:t},r);return[i,...a].find(e=>e.id===t)??null}catch(e){if(e instanceof Fd&&e.status===404)return null;throw e}}async function F(e,t,r){let i=(e,t)=>O(e,t,r,t=>n.post(e,t,r));if(!o)return i(e,t.sync?.length?{...t,sync:await Promise.all(t.sync.map(y))}:t);let a=(t.sync?.length??0)>0||Pp(t.text)?await x(e,t,r):null;if(!a)return i(e,t);let{access:s,channel:c}=a,l=t.re===void 0&&(t.sync?.length??0)>0&&(s===null||s.can(`sync`,c))?{...t,sync:await Promise.all(t.sync.map(y))}:t,u=await v(l.text),d=await i(e,{...l,text:u});return u!==t.text&&s!==null&&!s.readable(d.message.channel)?{...d,message:{...d.message,text:t.text}}:d}async function I(e,t){if(!t.dropped)return t.message;for(let n of t.dropped)await e.platform.respond(n);throw new Ap(t.dropped)}async function L(e,t,n,r){let i=o.caller,{author:a,key:s}=t.platform,{via:c}=t.origin,l={key:s,channel:c.channel,thread:c.thread},u=async e=>{if(await I(t,await N(i,e,r))===null)throw Bd(`message not found: #${e.message}`,`message_not_found`);return{ok:!0}};switch(e){case`post`:return R(t,n,r);case`edit`:{let{id:e,text:t}=n;return u({op:`edit`,author:a,from:null,message:e,text:await v(t),source:l})}case`delete`:return u({op:`delete`,author:a,from:null,message:n.id});case`react`:{let{id:e,emoji:t,remove:r}=n;return u({op:`react`,author:a,from:null,message:e,emoji:t,...r===void 0?{}:{remove:r}})}case`label`:{let{id:e,set:t,unset:r}=n;return u({op:`labels`,author:a,from:null,message:e,...t?{set:t}:{},...r?{unset:r}:{}})}default:return z(e,i,n,r)}}async function R(e,t,r){let i=o.caller,{author:a,key:s}=e.platform,{via:c}=e.origin,l=async e=>{let t=await P(i,e,r);if(!t)throw Bd(`message not found: #${e}`,`message_not_found`);return t};if(t.id!==void 0){let e=(await n.syncFind(i,{post:t.id},r)).message;if(e!==null)return{message:await l(e)}}let u=await Promise.all((t.sync??[]).map(y)),d=await I(e,await N(i,{op:`post`,author:a,from:null,origin:null,source:{key:s,channel:c.channel,thread:c.thread},...t.channel===void 0?{re:t.re}:{channel:t.channel},text:await v(t.text),...t.labels?{labels:t.labels}:{},...t.noSync?{noSync:!0}:{},...t.attachments?.length?{attachments:t.attachments}:{},...t.id===void 0?{}:{id:t.id}},r));for(let e of u)await n.syncReceipt(i,{kind:`thread`,message:d,target:e.target,targetKind:e.kind,cause:`request`},r);return{message:await l(d)}}async function z(e,t,r,i){switch(e){case`post`:return F(t,r,i);case`edit`:{let{id:e,text:a}=r,s=e=>A(t,e,i,e=>n.edit(t,e,i));return!o||!Pp(a)||!await x(t,{re:e},i)?s({id:e,text:a}):s({id:e,text:await v(a)})}case`syncImport`:return N(t,r,i);case`schedule`:{let e=r,a=o&&Pp(e.text)?await x(t,e,i):null;if(!a)return n.schedule(t,e,i);let s=await v(e.text),c=await n.schedule(t,{...e,text:s},i),{access:l}=a;return s!==e.text&&l!==null&&!l.readable(c.schedule.channel)?{...c,schedule:{...c.schedule,text:e.text}}:c}case`inbox`:{let e=r;if(o&&a[e.key]&&e.channel!==void 0){let r=b(t);if(r===null||r.anywhere(`sync`))return n.inbox(t,{...e,channel:await o.inboxChannel(e.key,e.channel)},i)}return n.inbox(t,e,i)}default:{let a=n[e];if(typeof a!=`function`)throw Bd(`no route: ${e}`);return a.call(n,t,r,i)}}}async function ee(e,t,r){let{sync:i,code:s}=ld.parse(Zd(t));if(!o||!a[i])throw Bd(`no sync entry named ${i}`);let c=(e,t)=>new Response(`${t}\n`,{status:e,headers:{"content-type":`text/plain; charset=utf-8`}}),{holder:l}=await n.syncFind(o.caller,{code:s},r);if(l===null)return c(404,"That link has expired or been used. Run `vb identity link` again for a new one.");if(e===`signIn`){let e=u(),t=await o.signIn(i,l,e?`${e}/identity/signed-in?${new URLSearchParams({sync:i,code:s})}`:void 0);return new Response(null,{status:302,headers:{location:t}})}let d=await o.redeemSignIn(i,l,s);return d?c(200,`Linked ${d.handle?`@${d.handle}`:d.actor}. You can close this tab.`):c(409,`${a[i].platform} hasn't said you approved yet: finish signing in, then open this page again.`)}async function te(e,t,r,i,a){let s=r.signal;switch(e){case`sync`:{let e=Fu.parse(await Qd(r)),i=a.id??``,c=b(t);if(c&&o){let e=await P(t,i,s);if(!e)throw Bd(`message not found: #${i}`,`message_not_found`);if(!c.can(`sync`,e.channel))throw zd(`this token can't sync in ${e.channel}`)}let l=await y(e.target),{attached:u}=await n.syncReceipt(t,{kind:`thread`,message:i,target:l.target,targetKind:l.kind,cause:`request`},s);return Hd({target:l.target,attached:u??!0})}case`identityUnlink`:{let e=Wu.parse(await Qd(r)),{links:i}=await n.identity(t,{},s),a=e.actor.replace(/^@/,``).toLowerCase(),o=i.filter(t=>t.actor===e.actor||t.handle?.toLowerCase()===a).map(e=>e.actor);if(o.length===0)throw Bd(`${e.actor} isn't linked to you`,`not_linked`);if(o.length>1)throw Ld(`${e.actor} names several of your accounts: use ${o.join(` or `)}`,`ambiguous_actor`);return await n.syncUnlink(t,{account:o[0]},s),Hd({ok:!0,actor:o[0]})}default:throw Bd(`no route: ${r.method} ${i.pathname}`)}}let ne=Object.fromEntries(qd.map(e=>[e,e===`syncImport`?N:(t,r,i)=>n[e].call(n,t,r,i)]));o?.bind({backend:ne,client:(e,t)=>d({platform:{author:e.author,key:e.key,respond:e.respond},origin:{via:e.via}},t)});async function re(e,t,r,i){let a=await n.events(e,{...t,wait:0},r.signal),o=new TextEncoder,c=new AbortController,l=Date.now()+s,u=AbortSignal.any([r.signal,c.signal,AbortSignal.timeout(s)]),d=new ReadableStream({async start(r){let s=e=>{try{r.enqueue(o.encode(e))}catch{}},c=setInterval(()=>s(`: ping
344
+ 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 Bo(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;Bo(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}const Vo=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ho=[`oneOf`,`anyOf`];function Uo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Wo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Vo.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ 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]??Uo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ke(n,r,e.length===1?e[0]:Wo(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=Uo(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 Go(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Vo)if(t in e)return;let n=t.filter(e=>Ho.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Wo(t);else{let e=n[0],i=Ho.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=>Wo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Po(e,r))}function Ko(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)):Po(i,s),Po(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())Bo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ 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)??[])Go(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)}Po(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,Ke(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:Yo(t,`input`,e.processors),output:Yo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function qo(e,t){let n=t??{seen:/* @__PURE__ */ 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 qo(r.element,n);if(r.type===`set`)return qo(r.valueType,n);if(r.type===`lazy`)return qo(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 qo(r.innerType,n);if(r.type===`intersection`)return qo(r.left,n)||qo(r.right,n);if(r.type===`record`||r.type===`map`)return qo(r.keyType,n)||qo(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:qo(r.in,n)||qo(r.out,n);if(r.type===`object`){for(let e in r.shape)if(qo(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(qo(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(qo(e,n))return!0;return!!(r.rest&&qo(r.rest,n))}return!1}const Jo=(e,t={})=>n=>{let r=Fo({...n,processors:t});return Lo(e,r),zo(r,e),Ko(r,e)},Yo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Fo({...i??{},target:a,io:t,processors:n});return Lo(e,o),zo(o,e),Ko(o,e)},Xo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Zo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Qo=(e,t)=>{Xo(e,`minimum`,t),Zo(e,`maximum`,t)},$o=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},es=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},ts=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},ns=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},rs=(e,t)=>Xo(e,`minimum`,t.minimum),is=(e,t)=>Zo(e,`maximum`,t.maximum),as=e=>(t,n)=>{ns(t,n.format);let[r,i]=e[n.format];Xo(t,`minimum`,r),Zo(t,`maximum`,i)},os={greater_than:(e,t)=>Xo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Zo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>$o(e,t.value),number_format:as(dt),bigint_format:as(ft),min_length:rs,max_length:is,length_equals:(e,t)=>Qo(e,t.length),min_size:rs,max_size:is,size_equals:(e,t)=>Qo(e,t.size),string_format:(e,t)=>{ns(e,t.format),t.pattern&&es(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)=>ts(e,t.mime)};function ss(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)os[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Xo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Xo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Zo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Zo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&$o(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ts(t,i.mime);for(let e of i.patterns??[])es(t,e);return t}const cs={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ls=/* @__PURE__ */ new Map([[ui,Gn],[fi,Kn]]),us=e=>ls.get(e)??e,ds=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ss(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=cs[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(us);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}))])}},fs=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ss(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=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Io(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}))])}},ps=(e,t,n,r)=>{n.type=`boolean`},ms=(e,t,n,r)=>{Io(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},hs=(e,t,n,r)=>{Io(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},gs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},_s=(e,t,n,r)=>{Io(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},vs=(e,t,n,r)=>{Io(e,t,n,r,`Void cannot be represented in JSON Schema`)},ys=(e,t,n,r)=>{n.not={}},bs=(e,t,n,r)=>{},xs=(e,t,n,r)=>{},Ss=(e,t,n,r)=>{Io(e,t,n,r,`Date cannot be represented in JSON Schema`)},Cs=(e,t,n,r)=>{let i=e._zod.def,a=Re(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},ws=(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(Io(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Io(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}},Ts=(e,t,n,r)=>{Io(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Es=(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},Ds=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=ss(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})))},Os=(e,t,n,r)=>{n.type=`boolean`},ks=(e,t,n,r)=>{Io(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},As=(e,t,n,r)=>{Io(e,t,n,r,`Function types cannot be represented in JSON Schema`)},js=(e,t,n,r)=>{Io(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ms=(e,t,n,r)=>{Io(e,t,n,r,`Map cannot be represented in JSON Schema`)},Ns=(e,t,n,r)=>{Io(e,t,n,r,`Set cannot be represented in JSON Schema`)},Ps=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ss(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Lo(a.element,t,{...r,path:[...r.path,`items`]})};function Fs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Fs(t.out):t.type===`catch`?Fs(t.innerType):e._zod.optin}const Is=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Io(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ke(i.properties,e,Lo(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`?Fs(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=Lo(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ls=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Lo(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Rs=(e,t,n,r)=>{let i=e._zod.def,a=Lo(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Lo(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)},zs=(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)=>Lo(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Lo(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`?Fs(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}=ss(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Bs(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=Bs(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=>Bs(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`)?rr:nr).source),p):p}const Vs=/* @__PURE__ */ new WeakMap;function Hs(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Vs.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Bs(t,a,/* @__PURE__ */ 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)}}const Us=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ss(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Lo(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Ke(i.patternProperties,us(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Lo(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Vs.get(t);n||(n=[],Vs.set(t,n),t.deferred.push(()=>Hs(t))),n.push(e)}i.additionalProperties=Lo(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Fs(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))}},Ws=(e,t,n,r)=>{let i=e._zod.def,a=Lo(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`}]},Gs=(e,t,n,r)=>{let i=e._zod.def;Lo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ks=Symbol();function qs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Io(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ks):JSON.parse(o)}const Js=(e,t,n,r)=>{let i=e._zod.def;Lo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=qs(i.defaultValue,e,t,n,r);o!==Ks&&(n.default=o)},Ys=(e,t,n,r)=>{let i=e._zod.def;Lo(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=qs(i.defaultValue,e,t,n,r);o!==Ks&&(n._prefault=o)},Xs=(e,t,n,r)=>{let i=e._zod.def;Lo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Io(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Zs=(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;Lo(o,t,r);let s=t.seen.get(e);s.ref=o},Qs=(e,t,n,r)=>{let i=e._zod.def;Lo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},$s=(e,t,n,r)=>{let i=e._zod.def;Lo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ec=(e,t,n,r)=>{let i=e._zod.def;Lo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tc={string:ds,number:fs,boolean:ps,bigint:ms,symbol:hs,null:gs,undefined:_s,void:vs,never:ys,any:bs,unknown:xs,date:Ss,enum:Cs,literal:ws,nan:Ts,template_literal:Es,file:Ds,success:Os,custom:ks,function:As,transform:js,map:Ms,set:Ns,array:Ps,object:Is,union:Ls,intersection:Rs,tuple:zs,record:Us,nullable:Ws,nonoptional:Gs,default:Js,prefault:Ys,catch:Xs,pipe:Zs,readonly:Qs,promise:$s,optional:ec,lazy:(e,t,n,r)=>{let i=e._zod.innerType;Lo(i,t,r);let a=t.seen.get(e);a.ref=i}};function nc(e,t){if(`_idmap`in e){let n=e,r=Fo({...t,processors:tc}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Lo(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;zo(r,n),Ke(a,t,Ko(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Fo({...t,processors:tc});return Lo(e,n),zo(n,e),Ko(n,e)}const rc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function ic(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})}})}const ac=(e,t)=>{on.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);rc.has(n)||(rc.add(n),ic(n,`format`,e=>t=>ln(e,t)),ic(n,`flatten`,e=>t=>cn(e,t)),ic(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Be,2)}),ic(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Be,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},oc=/*@__PURE__*/ W(`ZodError`,ac),sc=/*@__PURE__*/ W(`ZodError`,ac,void 0,{Parent:Error}),cc=/* @__PURE__ */ dn(sc),lc=/* @__PURE__ */ fn(sc),uc=/* @__PURE__ */ pn(sc),dc=/* @__PURE__ */ hn(sc),fc=/* @__PURE__ */ xn(sc),pc=/* @__PURE__ */ Sn(sc),mc=/* @__PURE__ */ Cn(sc),hc=/* @__PURE__ */ wn(sc),gc=/* @__PURE__ */ Tn(sc),_c=/* @__PURE__ */ En(sc),vc=/* @__PURE__ */ Dn(sc),yc=/* @__PURE__ */ On(sc);function bc(){Zt.localeError||Qt(xa())}function xc(){Zt.memoizer||Qt({memoizer:va()})}const Sc=/*@__PURE__*/ W(`ZodType`,(e,t)=>(bc(),Or.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone($e(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 lt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Wl(e,t))},superRefine(e,t){return this.check(Gl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Co(e))},optional(){return Tl(this)},exactOptional(){return Dl(this)},nullable(){return kl(this)},nullish(){return Tl(kl(this))},nonoptional(e){return Fl(this,e)},array(){return cl(this)},or(e){return dl([this,e])},and(e){return hl(this,e)},transform(e){return zl(this,Cl(e))},default(e){return jl(this,e)},prefault(e){return Nl(this,e)},catch(e){return Ll(this,e)},pipe(e){return zl(this,e)},readonly(){return Vl(this)},describe(e){let t=this.clone();return Ta.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ta.get(this);let t=this.clone();return Ta.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 Ft(this,`~standard`,{...jr(this),jsonSchema:{input:Yo(this,`input`),output:Yo(this,`output`)}})},set"~standard"(e){Pt(this,`~standard`,e)},parse:function e(t,n){return cc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await lc(this,t,n,{callee:e})},safeParse(e,t){return uc(this,e,t)},async safeParseAsync(e,t){return dc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Pt(this,`spa`,e)},validate(e,t){return vn(this,e,t)},validateAsync(e,t){return bn(this,e,t)},encode:function e(t,n){return fc(this,t,n,{callee:e})},decode:function e(t,n){return pc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await mc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await hc(this,t,n,{callee:e})},safeEncode(e,t){return gc(this,e,t)},safeDecode(e,t){return _c(this,e,t)},async safeEncodeAsync(e,t){return vc(this,e,t)},async safeDecodeAsync(e,t){return yc(this,e,t)},toJSONSchema(e){return Jo(this,{})(e)},get description(){return Ta.get(this)?.description},get _def(){return this._zod.def}}),Cc=/*@__PURE__*/ W(`_ZodString`,(e,t)=>{Mr.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r)},/*@__PURE__*/ It({format:e=>ss(e).format??null,minLength:e=>ss(e).minimum??null,maxLength:e=>ss(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ _o(...e))},includes(...e){return this.check(/* @__PURE__ */ bo(...e))},startsWith(...e){return this.check(/* @__PURE__ */ xo(...e))},endsWith(...e){return this.check(/* @__PURE__ */ So(...e))},min(...e){return this.check(/* @__PURE__ */ ho(...e))},max(...e){return this.check(/* @__PURE__ */ mo(...e))},length(...e){return this.check(/* @__PURE__ */ go(...e))},nonempty(...e){return this.check(/* @__PURE__ */ ho(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ vo(e))},uppercase(e){return this.check(/* @__PURE__ */ yo(e))},trim(){return this.check(/* @__PURE__ */ To())},normalize(...e){return this.check(/* @__PURE__ */ wo(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Eo())},toUpperCase(){return this.check(/* @__PURE__ */ Do())},slugify(){return this.check(/* @__PURE__ */ Oo())}})),wc=/*@__PURE__*/ W(`ZodString`,(e,t)=>{Mr.init(e,t),Cc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Oa(Ac,e))},url(e){return this.check(/* @__PURE__ */ Pa(Nc,e))},jwt(e){return this.check(/* @__PURE__ */ Ya(Jc,e))},emoji(e){return this.check(/* @__PURE__ */ Fa(Pc,e))},guid(e){return this.check(/* @__PURE__ */ ka(jc,e))},uuid(e){return this.check(/* @__PURE__ */ Aa(Mc,e))},uuidv4(e){return this.check(/* @__PURE__ */ ja(Mc,e))},uuidv6(e){return this.check(/* @__PURE__ */ Ma(Mc,e))},uuidv7(e){return this.check(/* @__PURE__ */ Na(Mc,e))},nanoid(e){return this.check(/* @__PURE__ */ Ia(Fc,e))},cuid(e){return this.check(/* @__PURE__ */ La(Ic,e))},cuid2(e){return this.check(/* @__PURE__ */ Ra(Lc,e))},ulid(e){return this.check(/* @__PURE__ */ za(Rc,e))},base64(e){return this.check(/* @__PURE__ */ Ka(Gc,e))},base64url(e){return this.check(/* @__PURE__ */ qa(Kc,e))},xid(e){return this.check(/* @__PURE__ */ Ba(zc,e))},ksuid(e){return this.check(/* @__PURE__ */ Va(Bc,e))},ipv4(e){return this.check(/* @__PURE__ */ Ha(Vc,e))},ipv6(e){return this.check(/* @__PURE__ */ Ua(Hc,e))},cidrv4(e){return this.check(/* @__PURE__ */ Wa(Uc,e))},cidrv6(e){return this.check(/* @__PURE__ */ Ga(Wc,e))},e164(e){return this.check(/* @__PURE__ */ Ja(qc,e))},datetime(e){return this.check(/* @__PURE__ */ Xa(Ec,e))},date(e){return this.check(/* @__PURE__ */ Za(Dc,e))},time(e){return this.check(/* @__PURE__ */ Qa(Oc,e))},duration(e){return this.check(/* @__PURE__ */ $a(kc,e))}});function G(e){return/* @__PURE__ */ Da(wc,e)}const Tc=/*@__PURE__*/ W(`ZodStringFormat`,(e,t)=>{Nr.init(e,t),Cc.init(e,t)}),Ec=/*@__PURE__*/ W(`ZodISODateTime`,(e,t)=>{Qr.init(e,t),Tc.init(e,t)}),Dc=/*@__PURE__*/ W(`ZodISODate`,(e,t)=>{$r.init(e,t),Tc.init(e,t)}),Oc=/*@__PURE__*/ W(`ZodISOTime`,(e,t)=>{ei.init(e,t),Tc.init(e,t)}),kc=/*@__PURE__*/ W(`ZodISODuration`,(e,t)=>{ti.init(e,t),Tc.init(e,t)}),Ac=/*@__PURE__*/ W(`ZodEmail`,(e,t)=>{Ir.init(e,t),Tc.init(e,t)}),jc=/*@__PURE__*/ W(`ZodGUID`,(e,t)=>{Pr.init(e,t),Tc.init(e,t)}),Mc=/*@__PURE__*/ W(`ZodUUID`,(e,t)=>{Fr.init(e,t),Tc.init(e,t)}),Nc=/*@__PURE__*/ W(`ZodURL`,(e,t)=>{Wr.init(e,t),Tc.init(e,t)}),Pc=/*@__PURE__*/ W(`ZodEmoji`,(e,t)=>{Gr.init(e,t),Tc.init(e,t)}),Fc=/*@__PURE__*/ W(`ZodNanoID`,(e,t)=>{Kr.init(e,t),Tc.init(e,t)}),Ic=/*@__PURE__*/ W(`ZodCUID`,(e,t)=>{qr.init(e,t),Tc.init(e,t)}),Lc=/*@__PURE__*/ W(`ZodCUID2`,(e,t)=>{Jr.init(e,t),Tc.init(e,t)}),Rc=/*@__PURE__*/ W(`ZodULID`,(e,t)=>{Yr.init(e,t),Tc.init(e,t)}),zc=/*@__PURE__*/ W(`ZodXID`,(e,t)=>{Xr.init(e,t),Tc.init(e,t)}),Bc=/*@__PURE__*/ W(`ZodKSUID`,(e,t)=>{Zr.init(e,t),Tc.init(e,t)}),Vc=/*@__PURE__*/ W(`ZodIPv4`,(e,t)=>{ni.init(e,t),Tc.init(e,t)}),Hc=/*@__PURE__*/ W(`ZodIPv6`,(e,t)=>{ai.init(e,t),Tc.init(e,t)}),Uc=/*@__PURE__*/ W(`ZodCIDRv4`,(e,t)=>{oi.init(e,t),Tc.init(e,t)}),Wc=/*@__PURE__*/ W(`ZodCIDRv6`,(e,t)=>{ci.init(e,t),Tc.init(e,t)}),Gc=/*@__PURE__*/ W(`ZodBase64`,(e,t)=>{di.init(e,t),Tc.init(e,t)}),Kc=/*@__PURE__*/ W(`ZodBase64URL`,(e,t)=>{mi.init(e,t),Tc.init(e,t)}),qc=/*@__PURE__*/ W(`ZodE164`,(e,t)=>{hi.init(e,t),Tc.init(e,t)}),Jc=/*@__PURE__*/ W(`ZodJWT`,(e,t)=>{_i.init(e,t),Tc.init(e,t)}),Yc=/*@__PURE__*/ W(`ZodNumber`,(e,t)=>{vi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ It({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ss(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ss(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ss(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ss(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ uo(e,t))},gte(e,t){return this.check(/* @__PURE__ */ fo(e,t))},min(e,t){return this.check(/* @__PURE__ */ fo(e,t))},lt(e,t){return this.check(/* @__PURE__ */ co(e,t))},lte(e,t){return this.check(/* @__PURE__ */ lo(e,t))},max(e,t){return this.check(/* @__PURE__ */ lo(e,t))},int(e){return this.check(Qc(e))},safe(e){return this.check(Qc(e))},positive(e){return this.check(/* @__PURE__ */ uo(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ fo(0,e))},negative(e){return this.check(/* @__PURE__ */ co(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ lo(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ po(e,t))},step(e,t){return this.check(/* @__PURE__ */ po(e,t))},finite(){return this}}));function Xc(e){return/* @__PURE__ */ eo(Yc,e)}const Zc=/*@__PURE__*/ W(`ZodNumberFormat`,(e,t)=>{yi.init(e,t),Yc.init(e,t)});function Qc(e){return/* @__PURE__ */ no(Zc,e)}const $c=/*@__PURE__*/ W(`ZodBoolean`,(e,t)=>{bi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r)});function el(e){return/* @__PURE__ */ ro($c,e)}const tl=/*@__PURE__*/ W(`ZodNull`,(e,t)=>{xi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r)});function nl(e){return/* @__PURE__ */ ao(tl,e)}const rl=/*@__PURE__*/ W(`ZodUnknown`,(e,t)=>{Si.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function il(){return/* @__PURE__ */ oo(rl)}const al=/*@__PURE__*/ W(`ZodNever`,(e,t)=>{Ci.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r)});function ol(e){return/* @__PURE__ */ so(al,e)}const sl=/*@__PURE__*/ W(`ZodArray`,(e,t)=>{xc(),Ti.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ ho(e,t))},nonempty(e){return this.check(/* @__PURE__ */ ho(1,e))},max(e,t){return this.check(/* @__PURE__ */ mo(e,t))},length(e,t){return this.check(/* @__PURE__ */ go(e,t))},unwrap(){return this.element}});function cl(e,t){return/* @__PURE__ */ ko(sl,e,t)}const ll=/*@__PURE__*/ W(`ZodObject`,(e,t)=>{xc(),ji.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),Ut(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return yl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone($e(this._zod.def,{catchall:e}))},passthrough(){return this.clone($e(this._zod.def,{catchall:il()}))},loose(){return this.clone($e(this._zod.def,{catchall:il()}))},strict(){return this.clone($e(this._zod.def,{catchall:ol()}))},strip(){return this.clone($e(this._zod.def,{catchall:void 0}))},extend(e){return gt(this,e)},safeExtend(e){return vt(this,e)},merge(e){return yt(this,e)},pick(e){return pt(this,e)},omit(e){return ht(this,e)},partial(...e){return bt(wl,this,e[0])},exactPartial(...e){return bt(El,this,e[0],`exactPartial`)},required(...e){return xt(Pl,this,e[0])}});function K(e,t){let n={type:`object`,shape:e??{},...H(t)};return new ll(n)}const ul=/*@__PURE__*/ W(`ZodUnion`,(e,t)=>{Ni.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),e.options=t.options});function dl(e,t){return new ul({type:`union`,options:e,...H(t)})}const fl=/*@__PURE__*/ W(`ZodDiscriminatedUnion`,(e,t)=>{ul.init(e,t),Fi.init(e,t)});function pl(e,t,n){return new fl({type:`union`,options:t,discriminator:e,...H(n)})}const ml=/*@__PURE__*/ W(`ZodIntersection`,(e,t)=>{Ii.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r)});function hl(e,t){return new ml({type:`intersection`,left:e,right:t})}const gl=/*@__PURE__*/ W(`ZodRecord`,(e,t)=>{xc(),zi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function _l(e,t,n){return!t||!t._zod?new gl({type:`record`,keyType:G(),valueType:e,...H(t)}):new gl({type:`record`,keyType:e,valueType:t,...H(n)})}const vl=/*@__PURE__*/ W(`ZodEnum`,(e,t)=>{Bi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(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 vl({...t,checks:[],...H(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 vl({...t,checks:[],...H(r),entries:i})}});function yl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new vl({type:`enum`,entries:n,...H(t)})}const bl=/*@__PURE__*/ W(`ZodLiteral`,(e,t)=>{Vi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(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 xl(e,t){return new bl({type:`literal`,values:Array.isArray(e)?e:[e],...H(t)})}const Sl=/*@__PURE__*/ W(`ZodTransform`,(e,t)=>{xc(),Hi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Xt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Mt(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(Mt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Cl(e){return new Sl({type:`transform`,transform:e})}const wl=/*@__PURE__*/ W(`ZodOptional`,(e,t)=>{Wi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tl(e){return new wl({type:`optional`,innerType:e})}const El=/*@__PURE__*/ W(`ZodExactOptional`,(e,t)=>{Gi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dl(e){return new El({type:`optional`,innerType:e})}const Ol=/*@__PURE__*/ W(`ZodNullable`,(e,t)=>{Ki.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kl(e){return new Ol({type:`nullable`,innerType:e})}const Al=/*@__PURE__*/ W(`ZodDefault`,(e,t)=>{qi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jl(e,t){return new Al({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ot(t)}})}const Ml=/*@__PURE__*/ W(`ZodPrefault`,(e,t)=>{Yi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ys(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nl(e,t){return new Ml({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ot(t)}})}const Pl=/*@__PURE__*/ W(`ZodNonOptional`,(e,t)=>{Xi.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fl(e,t){return new Pl({type:`nonoptional`,innerType:e,...H(t)})}const Il=/*@__PURE__*/ W(`ZodCatch`,(e,t)=>{$i.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ll(e,t){return new Il({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Wt(t)})}const Rl=/*@__PURE__*/ W(`ZodPipe`,(e,t)=>{ea.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zs(e,t,n,r),e.in=t.in,e.out=t.out});function zl(e,t){return new Rl({type:`pipe`,in:e,out:t})}const Bl=/*@__PURE__*/ W(`ZodReadonly`,(e,t)=>{na.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vl(e){return new Bl({type:`readonly`,innerType:e})}const Hl=/*@__PURE__*/ W(`ZodCustom`,(e,t)=>{ia.init(e,t),Sc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r)});function Ul(e,t){return/* @__PURE__ */ Ao(Hl,e??(()=>!0),t)}function Wl(e,t={}){return/* @__PURE__ */ jo(Hl,e,t)}function Gl(e,t){return/* @__PURE__ */ Mo(e,t)}function Kl(e){return/* @__PURE__ */ to(Yc,e)}function ql(e){return/* @__PURE__ */ io($c,e)}const Jl=1e4,Yl=`[a-z0-9][a-z0-9_-]*`,Xl=G().max(80).regex(RegExp(`^${Yl}(?:/${Yl})*$`),`invalid channel path`),Zl=e=>!e.includes(`\0`)&&e.isWellFormed(),Ql=e=>e.replaceAll(`\0`,``).toWellFormed(),$l=G().max(Jl).refine(e=>e.trim().length>0,`message text is empty`).refine(Zl,`message text has a NUL character or a lone surrogate`),eu=Xc().int().positive(),tu=/* @__PURE__ */ new Set([...Object.getOwnPropertyNames(Object.prototype),`prototype`]),nu=e=>!tu.has(e),ru=G().max(64).regex(/^[a-z0-9][a-z0-9_.-]*$/,`invalid label key`).refine(nu,`label key is a reserved name`),iu=_l(ru,G().max(256).refine(Zl,`label value has a NUL character or a lone surrogate`)),au=G().max(64).regex(/^[a-z0-9_+-]+$/,`invalid emoji name`).refine(nu,`emoji name is a reserved name`),ou=G().min(1).max(256);dl([yl([`person`,`agent`,`deployment`,`workflow`,`external`]),xl(`profile`)]);const su=e=>e===`profile`?`agent`:e;G().min(1).max(128).refine(Zl,`handle has a NUL character or a lone surrogate`);function cu(e){if(e===null)return null;try{return new URL(e).protocol===`https:`?e:null}catch{return null}}K({actor:ou,principal:G().min(1),profile:G().nullable(),session:G().nullable()});const lu=G().regex(/^[A-Za-z0-9_-]{22}$/,`invalid attachment id`);K({id:lu,name:G().min(1).max(255),type:G().min(1).max(255),size:Xc().int().nonnegative()}),G().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/,`ids start with a letter and use up to 32 letters, numbers, and hyphens`);const uu=G().min(3).max(300),du=K({channel:uu.optional(),thread:uu,subthread:uu.nullable(),message:G().min(1).max(300),context:G().max(300).nullable()}),fu=K({author:G().min(1).max(256),text:G().max(Jl),createdAt:G().max(64).nullable(),files:cl(K({name:G().min(1).max(1e3),url:G().max(4e3).nullable()})).max(20)}),pu=K({url:G().min(1).max(4e3),message:eu.nullable(),snapshot:fu.nullable(),unavailable:G().max(300).nullable()}),mu=K({id:G().min(1),handle:G().min(1),name:G().min(1),avatar:G().nullable(),isBot:el()}),hu=K({type:yl([`image`,`file`,`video`,`audio`]),name:G().max(1e3).optional(),mimeType:G().max(255).optional(),size:Xc().int().nonnegative().optional(),url:G().max(4e3).optional(),fetchMetadata:_l(G(),G().max(4e3)).optional()}),gu=K({url:G().min(1).max(4e3),thread:uu,message:G().min(1).max(300),snapshot:fu.nullable()}),_u=K({channel:uu,thread:uu,subthread:uu.nullable()}),vu=pl(`kind`,[K({kind:xl(`message`),..._u.shape,message:G(),isRoot:el(),text:G(),context:G().nullable(),author:mu,files:cl(hu).max(20).optional(),links:cl(gu).max(10).optional()}),K({kind:xl(`edited`),..._u.shape,message:G(),text:G(),author:mu,links:cl(gu).max(10).optional(),linksOnly:el().optional()}),K({kind:xl(`deleted`),..._u.shape,message:G()}),K({kind:xl(`reaction`),..._u.shape,message:G(),emoji:G(),added:el(),author:mu}),K({kind:xl(`lifecycle`),..._u.omit({subthread:!0}).shape,type:G(),title:G(),url:G().nullable(),labels:_l(G(),G()),unset:cl(G()),owns:cl(G()).optional(),reply:G().nullable(),createRoot:el(),retitled:el().optional(),author:mu})]),yu=e=>e.slice(e.indexOf(`:`)+1).includes(`:`),bu=e=>{let t=e.indexOf(`:`),n=e.slice(t+1).indexOf(`:`);return n===-1?e:e.slice(0,t+1+n)},xu=(e,t)=>`${e}|${t}`,Su=G().min(1).max(128),Cu=Su,wu=dl([G(),cl(G())]).transform(e=>Array.isArray(e)?e:[e]),Tu=G().regex(/^[a-z0-9][a-z0-9_.-]*(=.*)?$/,`label filters look like key, key=value, or key=a|b`).transform(e=>{let t=e.indexOf(`=`);return t===-1?[e,null]:[e.slice(0,t),e.slice(t+1).split(`|`)]}),Eu=K({target:uu,kind:yl([`channel`,`thread`])}),Du=K({channel:G().optional(),re:Cu.optional(),by:G().optional(),mentions:G().optional(),label:wu.pipe(cl(Tu)).optional(),from:G().min(1).max(64).optional(),text:G().min(1).max(200).optional()}),Ou=Du.extend({after:Su.optional(),before:Cu.optional(),limit:Kl().int().min(1).max(500).optional()}),ku=Du.extend({after:Su.optional(),limit:Kl().int().min(1).max(500).optional()}),Au=Du.extend({after:Su.optional(),wait:Kl().min(0).max(300).optional(),all:ql().optional()}),ju=K({channel:Xl.optional(),re:Su.optional(),text:G().max(Jl).default(``),labels:iu.optional(),noSync:el().optional(),sync:cl(dl([G().min(3).max(300),Eu])).max(10).optional(),id:G().min(1).max(200).refine(Zl,`id has a NUL character or a lone surrogate`).optional(),attachments:cl(lu).max(10).optional()}).refine(e=>e.text.trim().length>0||(e.attachments?.length??0)>0,{message:`message text is empty`,path:[`text`]}).refine(e=>e.channel===void 0!=(e.re===void 0),{message:"a post needs `channel`; a reply needs `re`"}).refine(e=>!(e.noSync&&e.sync?.length),{message:"`noSync` and `sync` contradict each other"}),Mu=G().regex(/^\d+(\.\d+)?(s|m|h|d)$/,`durations look like 30s, 30m, 12h, or 1d`),Nu=G().datetime({offset:!0}),Pu=K({channel:Xl.optional(),re:Su.optional(),text:G().max(Jl).default(``),labels:iu.optional(),noSync:el().optional(),attachments:cl(lu).max(10).optional(),in:Mu.optional(),at:Nu.optional(),every:Mu.optional(),until:Nu.optional(),for:Mu.optional(),times:Xc().int().positive().optional()}).refine(e=>e.text.trim().length>0||(e.attachments?.length??0)>0,{message:`message text is empty`,path:[`text`]}).refine(e=>e.channel===void 0!=(e.re===void 0),{message:"a schedule needs `channel` for a new thread, or `re` for a reply"}).refine(e=>e.in!==void 0||e.at!==void 0||e.every!==void 0,{message:"say when: `in`, `at`, or `every`"}).refine(e=>e.in===void 0||e.at===void 0,{message:"`in` and `at` contradict each other"}).refine(e=>[e.until,e.for,e.times].filter(e=>e!==void 0).length<=1,{message:"pick one stop: `until`, `for`, or `times`"}).refine(e=>e.every!==void 0||e.until===void 0&&e.for===void 0&&e.times===void 0,{message:"`until`, `for`, and `times` stop a repeat: add `every`"}),Fu=K({re:Cu.optional(),channel:G().optional(),by:G().optional(),all:ql().optional()}),Iu=K({target:G().min(3).max(300)}),Lu=K({channel:G().optional(),limit:Kl().int().min(1).max(500).optional()}),Ru=K({watch:_l(G().max(100),K({tail:G().max(1e3),when:yl([`matches`,`enters`]).default(`matches`)})).refine(e=>Object.keys(e).length<=32,`a board registers at most 32 watchers`),sync:cl(K({key:G().min(1).max(64),platform:G().min(1).max(64),signIn:el().default(!1)})).max(32).optional()}),zu=dl([Ru.extend({url:G().url().max(500).refine(e=>/^https:\/\//.test(e),`wake-ups go over https`).transform(e=>e.replace(/\/+$/,``)).nullable().optional(),path:nl({error:`register a url or a path, not both`}).optional(),branch:nl({error:`a branch goes with a path`}).optional()}),Ru.extend({url:nl({error:`register a url or a path, not both`}).optional(),path:G().max(300).regex(/^\/[^?#]*$/,`a path starts with / and has no query or fragment`).transform(e=>e.replace(/(.)\/+$/,`$1`)),branch:G().min(1).max(255).nullable().optional()})]),Bu=K({limit:Kl().int().min(1).max(50).optional(),wait:Kl().min(0).max(25).optional()}),Vu=K({lease:G().min(1).max(64),error:G().min(1).max(500).optional(),skip:el().optional()}),Hu=K({target:G().min(1).max(4e3),limit:Kl().int().min(1).max(200).optional()}),Uu=K({target:G().min(1).max(4e3)}),Wu=K({url:G().url().max(4e3)}),Gu=K({actor:G().min(1).max(256)}),Ku=G().min(1).max(64),qu=K({thread:uu,message:G().min(1).max(300).optional()}),Ju=pu.extend({message:Su.nullable()}),Yu=mu.extend({avatar:G().nullable().transform(cu)}),Xu={author:Yu,from:Ku.nullable()},Zu=K({key:Ku,channel:uu,thread:uu}),Qu={origin:qu.optional(),message:Su.optional()},$u=pl(`op`,[K({op:xl(`post`),...Xu,origin:du.nullable().default(null),source:Zu.optional(),channel:Xl.optional(),re:Su.optional(),text:G().max(Jl).default(``),labels:iu.optional(),noSync:el().optional(),attachments:cl(lu).max(10).optional(),links:cl(Ju).max(10).optional(),id:G().min(1).max(200).refine(Zl,`id has a NUL character or a lone surrogate`).optional()}),K({op:xl(`edit`),...Xu,...Qu,text:$l,source:Zu.optional()}),K({op:xl(`delete`),...Xu,...Qu}),K({op:xl(`react`),...Xu,...Qu,emoji:au,remove:el().optional()}),K({op:xl(`labels`),...Xu,...Qu,set:iu.optional(),unset:cl(ru).optional()}),K({op:xl(`links`),...Xu,...Qu,links:cl(Ju).max(10)}),K({op:xl(`seen`),author:Yu})]),ed=cl(G().min(1).max(300)).max(10).nullable(),td=pl(`kind`,[K({kind:xl(`message`),message:Su,target:uu,external:K({thread:uu,message:G().min(1).max(300),asUser:xl(!0).optional()}),files:ed.optional()}),K({kind:xl(`files`),message:Su,target:uu,files:ed}),K({kind:xl(`failed`),message:Su,target:uu,error:G().min(1).max(500)}),K({kind:xl(`thread`),message:Su,target:uu,targetKind:yl([`channel`,`thread`]),cause:yl([`config`,`request`])})]),nd=K({code:G().min(1).max(64).optional(),post:G().min(1).max(200).optional(),thread:uu.optional(),message:G().min(1).max(300).optional(),account:ou.optional(),person:ou.optional()}),rd=K({message:wu.pipe(cl(Su).min(1).max(100))}),id=K({by:ou,since:Kl().int().nonnegative()}),ad=K({events:cl(K({id:G().min(1).max(300),event:vu,raw:il()})).min(1).max(50)}),od=K({limit:Kl().int().min(1).max(50).optional()}),sd=K({lease:G().min(1).max(64),error:G().min(1).max(500).optional()}),cd=K({sync:Ku}),ld=K({sync:Ku,account:Yu,code:G().min(1).max(64),message:G().max(1024).optional(),method:yl([`code`,`consent`]).optional()}),ud=K({sync:Ku,code:G().min(1).max(64)}),dd=K({account:ou}),fd=K({name:G().max(1024).nullable().optional(),type:G().max(1024).nullable().optional(),size:Xc().int().positive().max(je,`direct uploads are at most ${je/1024/1024} MB`)}),pd=K({text:$l}),md=K({}).optional(),hd=K({status:G().trim().min(1).max(100).optional()}).optional(),gd=K({emoji:au,remove:el().optional()}),_d=K({set:iu.optional(),unset:cl(ru).optional()}).refine(e=>e.set!==void 0||e.unset!==void 0,{message:"nothing to change: pass `set` or `unset`"}),vd={discovery:{method:`GET`,path:`/`},me:{method:`GET`,path:`/me`},channels:{method:`GET`,path:`/channels`},actors:{method:`GET`,path:`/actors`},messages:{method:`GET`,path:`/messages`,query:Ou},message:{method:`GET`,path:`/messages/:id`},threads:{method:`GET`,path:`/threads`,query:ku},post:{method:`POST`,path:`/messages`,body:ju},edit:{method:`POST`,path:`/messages/:id/edit`,body:pd},delete:{method:`POST`,path:`/messages/:id/delete`,body:md},react:{method:`POST`,path:`/messages/:id/reactions`,body:gd},label:{method:`POST`,path:`/messages/:id/labels`,body:_d},sync:{method:`POST`,path:`/messages/:id/sync`,body:Iu},synced:{method:`GET`,path:`/messages/:id/sync`},linked:{method:`GET`,path:`/links`,query:Wu},typing:{method:`POST`,path:`/messages/:id/typing`,body:hd},schedule:{method:`POST`,path:`/schedules`,body:Pu},schedules:{method:`GET`,path:`/schedules`,query:Fu},cancelSchedule:{method:`POST`,path:`/schedules/:id/cancel`},posted:{method:`GET`,path:`/posts/:id`},inbox:{method:`GET`,path:`/inbox/:key`,query:Lu},inboxPush:{method:`POST`,path:`/inbox/:key`,body:ad},inboxNext:{method:`GET`,path:`/inbox/:key/next`,query:od},inboxAck:{method:`POST`,path:`/inbox/:key/:id/ack`,body:sd},syncImport:{method:`POST`,path:`/sync/imports`,body:$u},syncReceipt:{method:`POST`,path:`/sync/receipts`,body:td},syncThread:{method:`GET`,path:`/sync/threads/:thread`},syncFind:{method:`GET`,path:`/sync/find`,query:nd},syncCopies:{method:`GET`,path:`/sync/copies`,query:rd},syncRoots:{method:`GET`,path:`/sync/roots`,query:id},syncCode:{method:`POST`,path:`/sync/codes`,body:cd},syncAccount:{method:`POST`,path:`/sync/accounts`,body:ld},syncUnlink:{method:`POST`,path:`/sync/accounts/unlink`,body:dd},readSource:{method:`GET`,path:`/sources/:key/read`,query:Hu},joinSource:{method:`POST`,path:`/sources/:key/join`,body:Uu},webhook:{method:`POST`,path:`/webhooks/:key`},events:{method:`GET`,path:`/events`,query:Au},avatar:{method:`GET`,path:`/avatars/:name`},upload:{method:`POST`,path:`/attachments`},attachment:{method:`GET`,path:`/attachments/:id`},uploadStart:{method:`POST`,path:`/attachments/uploads`,body:fd},uploadFinish:{method:`POST`,path:`/attachments/uploads/:id`},openapi:{method:`GET`,path:`/openapi.json`},identity:{method:`GET`,path:`/identity`},signIn:{method:`GET`,path:`/identity/sign-in`,query:ud},signedIn:{method:`GET`,path:`/identity/signed-in`,query:ud},identityUnlink:{method:`POST`,path:`/identity/unlink`,body:Gu},watchers:{method:`GET`,path:`/watchers`},register:{method:`POST`,path:`/watchers`,body:zu},matches:{method:`GET`,path:`/watchers/matches`,query:Bu},ack:{method:`POST`,path:`/watchers/matches/:id/ack`,body:Vu},wake:{method:`POST`,path:`/wake`}};async function*yd(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=()=>void n.cancel().catch(()=>{});t?.addEventListener(`abort`,a,{once:!0});try{for(;;){let{value:e,done:t}=await n.read();if(t)return;i+=r.decode(e,{stream:!0});let a;for(;(a=i.search(/\r?\n\r?\n/))!==-1;){let e=i.slice(0,a);i=i.slice(a).replace(/^\r?\n\r?\n/,``);let t={},n=[];for(let r of e.split(/\r?\n/)){if(r===``||r.startsWith(`:`))continue;let e=r.indexOf(`:`),i=e===-1?r:r.slice(0,e),a=e===-1?``:r.slice(e+1).replace(/^ /,``);i===`data`?n.push(a):i===`id`?t.id=a:i===`event`&&(t.event=a)}n.length>0&&(t.data=n.join(`
345
+ `)),(t.id!==void 0||t.data!==void 0)&&(yield t)}}}finally{t?.removeEventListener(`abort`,a),n.releaseLock()}}var bd=class extends Error{code;status;constructor(e,t,n){super(t),this.name=`BoardError`,this.code=e,this.status=n}};const xd=async e=>typeof e==`function`?await e():e,Sd=e=>{let{at:t,until:n,...r}=Cd(e);return{...r,...t===void 0?{}:{at:t instanceof Date?t.toISOString():t},...n===void 0?{}:{until:n instanceof Date?n.toISOString():n}}},Cd=e=>{if(typeof e==`string`)return{text:e};let{attachments:t,...n}=e;return t?.length?{...n,attachments:t.map(e=>typeof e==`string`?e:e.id)}:n},wd={ms:1,s:1e3,m:6e4,h:36e5,d:864e5};function Td(e){if(typeof e==`number`)return e;let t=e.trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/);if(!t)throw new bd(`invalid_duration`,`invalid duration: ${e}`,0);return Number(t[1])*wd[t[2]??`ms`]}const Ed=e=>encodeURIComponent(e);function Dd(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`label`){let e=Array.isArray(r)?r:typeof r==`object`?Object.entries(r).map(([e,t])=>`${e}=${String(t)}`):[r];for(let n of e)t.append(`label`,String(n))}else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}const Od=(e,t)=>t?.length?{...e,unknownMentions:t}:e;function kd(e){let t=e.url.replace(/\/+$/,``),n=e.fetch??((e,t)=>globalThis.fetch(e,t)),r=e.storeFetch??((e,t)=>globalThis.fetch(e,t));async function i(t,n){let r={...e.headers?await xd(e.headers):{}};if(!t)return r;e.token!==void 0&&(r.authorization=`Bearer ${await xd(e.token)}`);let i=n===void 0?e.profile===void 0?null:await xd(e.profile):n;if(i!==null){let{name:e,avatar:t}=typeof i==`string`?{name:i,avatar:void 0}:i;r[`x-board-profile`]=e,t&&(r[`x-board-avatar`]=t)}else{let t=e.person===void 0?null:await xd(e.person);t?.name&&(r[`x-board-name`]=encodeURIComponent(t.name)),t?.avatar&&(r[`x-board-avatar`]=t.avatar)}let a=n===void 0?e.session===void 0?null:await xd(e.session):null;a&&(r[`x-board-session`]=a);let o=e.handle===void 0?null:await xd(e.handle);return o&&(r[`x-board-handle`]=o),r}async function a(e,r,a={}){let o=await n(`${t}${r}`,{method:e,headers:{...await i(a.auth??!0),...a.body===void 0?{}:{"content-type":`application/json`},...a.headers},...a.body===void 0?{}:{body:JSON.stringify(a.body)},...a.signal?{signal:a.signal}:{}});if(!o.ok)throw await Ad(o);return o}async function o(e,t,n){return await(await a(e,t,n)).json()}let s=(e={})=>e;async function c(e={},t){return o(`GET`,`/events${Dd(e)}`,t?{signal:t}:{})}return{url:t,request:async(e,r={})=>n(`${t}${e}`,{method:r.method??`GET`,headers:{...r.headers,...await i(!0,r.as)},...r.body?{body:r.body}:{},...r.signal?{signal:r.signal}:{}}),discovery:()=>o(`GET`,`/`,{auth:!1}),me:()=>o(`GET`,`/me`),channels:async()=>(await o(`GET`,`/channels`)).channels,actors:async()=>(await o(`GET`,`/actors`)).actors,identity:()=>o(`GET`,`/identity`),unlinkAccount:e=>o(`POST`,`/identity/unlink`,{body:{actor:e}}),messages:(e={})=>o(`GET`,`/messages${Dd(e)}`),thread:e=>o(`GET`,`/messages/${Ed(e)}`),posted:async e=>(await o(`GET`,`/posts/${Ed(e)}`)).message,threads:(e={})=>o(`GET`,`/threads${Dd(e)}`),async post(e,t){let{message:n,unknownMentions:r}=await o(`POST`,`/messages`,{body:{channel:e,...Cd(t)}});return Od(n,r)},async reply(e,t){let{message:n,unknownMentions:r}=await o(`POST`,`/messages`,{body:{re:e,...Cd(t)}});return Od(n,r)},async schedule(e,t){let{schedule:n,unknownMentions:r}=await o(`POST`,`/schedules`,{body:{...typeof e==`string`?{channel:e}:{re:e.re},...Sd(t)}});return Od(n,r)},schedules:async(e={})=>(await o(`GET`,`/schedules${Dd(e)}`)).schedules,cancelSchedule:e=>o(`POST`,`/schedules/${Ed(e)}/cancel`,{body:{}}),async upload(e){let a=e.type||(e.data instanceof Blob?e.data.type:``)||Pe(e.name),s=e.data instanceof Blob?e.data.size:e.data.byteLength;if(s>4194304){if(s>104857600)throw new bd(`too_large`,`attachments are at most ${je/1024/1024} MB`,413);let t=await o(`POST`,`/attachments/uploads`,{body:{name:e.name,type:a,size:s}}).catch(e=>{throw e instanceof bd&&e.status===404&&e.code===`not_found`?new bd(`too_large`,`this board takes files of at most ${ke/1024/1024} MB`,413):e}),n=await r(t.url,{method:`PUT`,headers:t.headers,body:e.data});if(!n.ok)throw new bd(`upload_failed`,`the blob store refused the file: ${n.status} ${(await n.text().catch(()=>``)).slice(0,300)||n.statusText}`,n.status);return(await o(`POST`,`/attachments/uploads/${encodeURIComponent(t.id)}`,{body:{}})).attachment}let c=await n(`${t}/attachments`,{method:`POST`,headers:{...await i(!0),"content-type":a,"x-board-filename":encodeURIComponent(e.name)},body:e.data});if(!c.ok)throw await Ad(c);return(await c.json()).attachment},download:(e,t={})=>a(`GET`,`/attachments/${encodeURIComponent(e)}`,t.signal?{signal:t.signal}:{}),edit:(e,t)=>o(`POST`,`/messages/${Ed(e)}/edit`,{body:{text:t}}),delete:e=>o(`POST`,`/messages/${Ed(e)}/delete`,{body:{}}),react:(e,t,n={})=>o(`POST`,`/messages/${Ed(e)}/reactions`,{body:{emoji:De(t),...n}}),label:(e,t)=>o(`POST`,`/messages/${Ed(e)}/labels`,{body:t}),typing:async(e,t)=>(await o(`POST`,`/messages/${Ed(e)}/typing`,{body:t?{status:t}:{}})).targets,sync:((e,t)=>t===void 0?o(`GET`,`/messages/${Ed(e)}/sync`):o(`POST`,`/messages/${Ed(e)}/sync`,{body:{target:t}})),linked:e=>o(`GET`,`/links${Dd({url:e})}`),inbox:async(e,t={})=>(await o(`GET`,`/inbox/${e}${Dd(t)}`)).events,register:e=>o(`POST`,`/watchers`,{body:e}),watchers:async()=>(await o(`GET`,`/watchers`)).watchers,matches:async(e={})=>{let{signal:t,...n}=e;return(await o(`GET`,`/watchers/matches${Dd(n)}`,t?{signal:t}:{})).matches},ack:(e,t)=>o(`POST`,`/watchers/matches/${encodeURIComponent(e)}/ack`,{body:t}),readSource:(e,t,n={})=>o(`GET`,`/sources/${e}/read${Dd({target:t,...n})}`),joinSource:(e,t)=>o(`POST`,`/sources/${e}/join`,{body:{target:t}}),poll:c,syncImport:e=>o(`POST`,`/sync/imports`,{body:e}),syncReceipt:e=>o(`POST`,`/sync/receipts`,{body:e}),syncThread:e=>o(`GET`,`/sync/threads/${Ed(e)}`),syncFind:(e,t={})=>o(`GET`,`/sync/find${Dd(e)}`,t.signal?{signal:t.signal}:{}),syncCopies:async e=>(await o(`GET`,`/sync/copies?${e.map(e=>`message=${encodeURIComponent(e)}`).join(`&`)}`)).copies,syncRoots:async(e,t)=>(await o(`GET`,`/sync/roots${Dd({by:e,since:t instanceof Date?t.getTime():t})}`)).roots,inboxPush:(e,t)=>o(`POST`,`/inbox/${Ed(e)}`,{body:{events:t}}),inboxNext:async(e,t={})=>(await o(`GET`,`/inbox/${Ed(e)}/next${Dd(t)}`)).items,inboxAck:(e,t,n)=>o(`POST`,`/inbox/${Ed(e)}/${Ed(t)}/ack`,{body:n}),syncCode:e=>o(`POST`,`/sync/codes`,{body:{sync:e}}),syncAccount:e=>o(`POST`,`/sync/accounts`,{body:e}),syncUnlink:e=>o(`POST`,`/sync/accounts/unlink`,{body:{account:e}}),async*events(e={},t={}){let n=e.after,r=0;for(;!t.signal?.aborted;){let i;try{i=await a(`GET`,`/events${Dd({...s(e),after:n})}`,{headers:{accept:`text/event-stream`},...t.signal?{signal:t.signal}:{}})}catch(e){if(t.signal?.aborted)return;if(e instanceof bd&&e.status>=400&&e.status<500)throw e;await new Promise(e=>setTimeout(e,Math.min(3e4,500*2**r++)));continue}r=0;try{for await(let e of yd(i.body,t.signal))e.id!==void 0&&(n=e.id),e.event===`board`&&e.data&&(yield JSON.parse(e.data))}catch{if(t.signal?.aborted)return;await new Promise(e=>setTimeout(e,Math.min(3e4,500*2**r++)))}}},async wait(e={},t={}){let n=Date.now()+Td(t.timeout??`30m`),r=e.after??(await c({...e,after:void 0,wait:0},t.signal)).cursor;for(;Date.now()<n&&!t.signal?.aborted;){let i=Math.max(0,Math.min(25,Math.ceil((n-Date.now())/1e3))),a=await c({...e,after:r,wait:i},t.signal);if(a.events.length>0)return a.events[0];r=a.cursor}return null}}}async function Ad(e){try{let t=await e.json();if(t.error?.message)return new bd(t.error.code??`error`,t.error.message,e.status)}catch{}return new bd(`http_error`,`${e.status} ${e.statusText}`,e.status)}const jd=e=>Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);async function Md(e){return jd(new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e))))}async function Nd(...e){let t=new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(JSON.stringify(e)))).slice(0,16);t[6]=t[6]&15|128,t[8]=t[8]&63|128;let n=jd(t);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}const Pd=/^[0-9a-f]{8}-[0-9a-f]{4}-8[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,Fd=async(e,t)=>`key:${e}:${(await Md(`board-key\u001f${t}`)).slice(0,32)}`;var Id=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t}},Ld=class extends Id{response;constructor(e){super(e.status,`rejected`,`rejected with ${e.status}`),this.response=e}};const Rd=(e,t=`invalid_request`)=>new Id(400,t,e),zd=e=>new Id(401,`unauthorized`,e),Bd=e=>new Id(403,`forbidden`,e),Vd=(e,t=`not_found`)=>new Id(404,t,e),Hd=()=>new Id(409,`duplicate_id`,`that id was already used for a different write`),Ud=(e,t=200,n)=>new Response(JSON.stringify(e),{status:t,headers:{"content-type":`application/json`,...n}});function Wd(e){if(e.code!==`invalid_union`||e.errors.length===0)return e;let t=e.errors.reduce((e,t)=>t.length<e.length?t:e)[0];return t?Wd({...t,path:[...e.path,...t.path]}):e}function Gd(e){if(e instanceof Ld)return e.response;if(e instanceof Id)return Ud({error:{code:e.code,message:e.message}},e.status);if(e instanceof oc){let t=e.issues[0]&&Wd(e.issues[0]),n=t?.path.length?`${t.path.join(`.`)}: `:``;return Ud({error:{code:`invalid_request`,message:`${n}${t?.message??`invalid request`}`}},400)}let t=e?.code;return t===`INVALID_PAYLOAD`?Ud({error:{code:`invalid_request`,message:e.message}},400):t===`PARTIAL_DUPLICATE_BATCH`||t===`DUPLICATE_EVENT_ID`?Gd(Hd()):t===`STORE_UNAVAILABLE`||t===`STORE_NOT_CONFIGURED`?Ud({error:{code:`unavailable`,message:e.message}},503):(console.error(`[board]`,e),Ud({error:{code:`internal`,message:`internal error`}},500))}const Kd=`0.22.0`,qd=[`avatar`,`openapi`,`webhook`,`signIn`,`signedIn`,`identityUnlink`,`sync`],Jd=/* @__PURE__ */ `discovery.me.channels.actors.identity.messages.threads.message.post.posted.edit.delete.react.label.schedule.schedules.cancelSchedule.upload.attachment.uploadStart.uploadFinish.watchers.register.matches.ack.events.syncImport.syncReceipt.syncThread.syncFind.syncCopies.syncRoots.inboxPush.inboxNext.inboxAck.inbox.syncCode.syncAccount.syncUnlink.typing.readSource.joinSource.synced.linked`.split(`.`),Yd=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Xd(e,t,n,r){let i=t.split(`/`).filter(Boolean),a=i.map(e=>e.startsWith(`:`)?`/([^/]+)`:`/${Yd(e)}`).join(``);return{method:e,pattern:RegExp(`${a}$`),names:i.filter(e=>e.startsWith(`:`)).map(e=>e.slice(1)),target:n,segments:i.length,literals:i.filter(e=>!e.startsWith(`:`)).length,own:r}}function Zd(e,t){let n=[...qd.map(e=>Xd(vd[e].method,vd[e].path,{kind:`board`,name:e},!1)),...Jd.filter(e=>e!==`discovery`).map(e=>Xd(vd[e].method,vd[e].path,{kind:`protocol`,name:e},!1)),...e.map(e=>Xd(e.method,e.path,{kind:`backend`,route:e},!0))].sort((e,t)=>t.segments-e.segments||t.literals-e.literals||Number(t.own)-Number(e.own)),r=(e,t,n)=>{let r={};try{e.names.forEach((e,t)=>r[e]=decodeURIComponent(n[t]))}catch{return null}let i=e.names[0];return{target:e.target,base:t,param:i===void 0?null:r[i],params:r}},i=e=>({target:{kind:`protocol`,name:`discovery`},base:e,param:null,params:{},root:!0});return function(e,a){let o=a.length>1?a.replace(/\/+$/,``):a;if(t!==void 0){let a=t.replace(/\/+$/,``);if(o!==a&&!o.startsWith(`${a}/`))return null;let s=o.slice(a.length)||`/`;if(s===`/`)return e===`GET`?i(a):null;for(let t of n){let n=t.method===e?s.match(RegExp(`^${t.pattern.source}`)):null;if(n)return r(t,a,n.slice(1))}return null}for(let t of n){if(t.method!==e)continue;let n=o.match(t.pattern);if(n)return r(t,o.slice(0,n.index),n.slice(1))}return e===`GET`?i(o===`/`?``:o):null}}function Qd(e){let t={};for(let n of new Set(e.searchParams.keys())){let r=e.searchParams.getAll(n);t[n]=r.length>1?r:r[0]}return t}async function $d(e){let t=await e.text();if(t.trim()!==``)try{return JSON.parse(t)}catch{throw Rd(`request body is not valid JSON`)}}const ef=()=>new Id(413,`too_large`,`attachments are at most ${ke/1024/1024} MB`);async function tf(e,t){if(Number(e.headers.get(`content-length`)??0)>t)throw ef();let n=[],r=0;for await(let i of e.body??[]){if(r+=i.byteLength,r>t)throw ef();n.push(i)}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;return i}function nf(){let e={};for(let[t,n]of Object.entries(vd)){let r=n.path.replace(/:(\w+)/g,`{$1}`),i={operationId:t};`query`in n&&(i[`x-query-schema`]=nc(n.query,{io:`input`})),`body`in n&&(i.requestBody={content:{"application/json":{schema:nc(n.body,{io:`input`})}}}),(e[r]??={})[n.method.toLowerCase()]=i}return{openapi:`3.1.0`,info:{title:`board`,version:Kd},paths:e}}const rf={re:{type:`string`,value:`id`,description:`in a thread: its root's ID`},by:{type:`string`,value:`handle`,description:`by an author: a handle, me, or an actor ID`},mentions:{type:`string`,value:`@handle`,optionalValue:!0,description:`mentioning a handle, or you without one`},label:{type:`string`,multiple:!0,value:`k[=v|w]`,description:`with a label on the message or its thread's root`},from:{type:`string`,value:`source`,description:`from a source: a sync key such as slack, or board`},text:{type:`string`,value:`words`,description:`containing these words`},after:{type:`string`,value:`id`,description:`after a message or a cursor`},url:{type:`string`,value:`url`,description:`the board at this URL, not the one the environment points at`},scope:{type:`string`,value:`team`,description:`a team's board in Vercel's API, by its slug or ID`},team:{type:`string`,value:`team`,description:`the same as --scope`,hidden:!0},as:{type:`string`,value:`profile`,description:`write as a profile, such as an agent's name`},avatar:{type:`string`,value:`url`,description:`the profile's avatar, with --as`},human:{type:`boolean`,description:`write as yourself, with no profile or session`},handle:{type:`string`,value:`h`,description:`your handle (default: your Vercel username)`},json:{type:`boolean`,description:`one JSON object per line, for programs`},help:{type:`boolean`,short:`h`,description:`this help, or a command's`},version:{type:`boolean`,short:`v`,description:`the CLI's version`},limit:{type:`string`,short:`n`,value:`N`,description:`how many`},id:{type:`string`,value:`key`,description:`a client ID: sending the same one again posts once`},sync:{type:`string`,multiple:!0,value:`target`,description:`sync the new thread to a target too, e.g. slack:#incidents`},"no-sync":{type:`boolean`,description:`keep it on the board: sync it nowhere`},attach:{type:`string`,multiple:!0,value:`file`,description:`attach a file`},unset:{type:`string`,multiple:!0,value:`k`,description:`remove a label`},channel:{type:`string`,value:`c`,description:`in a channel`},remove:{type:`boolean`,description:`take the reaction back`},all:{type:`boolean`,short:`a`,description:`everything, not only what most want`},timeout:{type:`string`,value:`duration`,description:`how long to wait (default: 30m)`},code:{type:`boolean`,description:`post a code from your account instead of signing in`},"no-wait":{type:`boolean`,description:`start linking, and don't wait for it to finish`},"no-open":{type:`boolean`,description:`don't open the browser`},in:{type:`string`,value:`duration`,description:`once, this long from now, e.g. 1d`},at:{type:`string`,value:`time`,description:`at a time: once, or with --every, the first`},every:{type:`string`,value:`duration`,description:`repeating at this interval, e.g. 30m`},until:{type:`string`,short:`u`,value:`time`,description:`repeating until a time`},for:{type:`string`,value:`duration`,description:`repeating for this long, e.g. 24h`},times:{type:`string`,value:`N`,description:`repeating this many times`},port:{type:`string`,value:`N`,description:`the port to listen on`},dir:{type:`string`,value:`dir`,description:`where the board keeps its log (default: .board/)`},"no-inspect":{type:`boolean`,description:`don't start the inspector`},agent:{type:`string`,value:`name`,description:`the agent whose turn ended`,hidden:!0}},af=(e,t,n)=>({name:e,...rf[e],...t?{description:t}:{},...n?{value:n}:{}});[`re`,`by`,`from`,`label`,`text`,`mentions`,`after`].map(e=>af(e)),[`url`,`scope`,`team`,`as`,`avatar`,`human`,`handle`,`json`,`help`,`version`].map(e=>af(e)),af(`code`),af(`no-wait`),af(`no-open`),af(`limit`,`threads to list (default: 50)`),af(`label`,`label it`,`k=v`),af(`attach`),af(`sync`),af(`no-sync`),af(`id`),af(`attach`),af(`id`),af(`no-sync`),af(`in`),af(`at`),af(`every`),af(`until`),af(`for`),af(`times`),af(`label`,`label it`,`k=v`),af(`attach`),af(`no-sync`),af(`by`,`scheduled by a handle`),af(`channel`,`posting in a channel`),af(`all`,`done and canceled ones too`),af(`remove`),af(`unset`),af(`limit`,`events to list`),af(`limit`,`messages to read`),af(`channel`,`the channel to check in (default: conformance)`),af(`agent`),af(`all`,`delivery receipts too`),af(`timeout`);const of={re:rf.re,by:rf.by,mentions:rf.mentions,label:rf.label,from:rf.from,text:rf.text};function sf(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r===`--mentions`?e[n+1]?.startsWith(`@`)?t.push(`--mentions=${e[++n]}`):t.push(`--mentions=me`):t.push(r)}return t}function cf(e){let t=[],n=null,r=null;for(let i=0;i<e.length;i++){let a=e[i];r?a===r?r=null:a===`\\`&&r===`"`&&i+1<e.length?n+=e[++i]:n+=a:/\s/.test(a)?(n!==null&&t.push(n),n=null):a===`"`||a===`'`?(r=a,n??=``):n=a===`\\`&&i+1<e.length?(n??``)+e[++i]:(n??``)+a}if(r)throw Error(`unterminated ${r}`);return n!==null&&t.push(n),t}const lf={...of,all:{type:`boolean`}};function uf(e){let t={},n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`--`){n.push(...e.slice(r+1));break}if(!i.startsWith(`-`)||i===`-`){n.push(i);continue}let a=i.indexOf(`=`),o=i.startsWith(`--`)?i.slice(2,a===-1?void 0:a):null,s=o!==null&&Object.hasOwn(lf,o)?lf[o]:null;if(!s)throw Error(`${o===null?i.slice(0,2):`--${o}`} isn't a filter`);if(s.type===`boolean`){if(a!==-1)throw Error(`--${o} takes no value`);t[o]=!0;continue}let c;if(a!==-1)c=i.slice(a+1);else{let t=e[r+1];if(t===void 0||t.length>1&&t.startsWith(`-`))throw Error(`--${o} needs a value`);c=t,r++}t[o]=`multiple`in s?[...t[o]??[],c]:c}return{values:t,positionals:n}}function df(e){let{values:t,positionals:n}=uf(sf(cf(e)));if(n.length>1)throw Error(`expected one channel, got: ${n.join(` `)}`);let r=n[0],i=Du.safeParse({...r?{channel:r}:{},...t.re?{re:t.re.replace(/^#/,``)}:{},...t.by?{by:t.by.replace(/^@/,``)}:{},...t.mentions?{mentions:t.mentions.replace(/^@/,``)}:{},...t.label?.length?{label:t.label}:{},...t.from?{from:t.from}:{},...t.text?{text:t.text}:{}});if(!i.success){let e=i.error.issues[0];throw Error(`${e?.path.length?`--${String(e.path[0])}: `:``}${e?.message??`invalid filters`}`)}return{filters:i.data,all:t.all===!0}}const ff=e=>e.channel!==void 0||e.re!==void 0||e.by!==void 0||e.mentions!==void 0||e.from!==void 0||e.text!==void 0||(e.label?.length??0)>0;function pf(e,t){let n,r;try{({filters:n,all:r}=df(t.tail))}catch(t){throw Error(`watch ${e}: ${t.message}`)}if(n.mentions===`me`)throw Error(`watch ${e}: a watcher has no "me": use --mentions @handle`);let i=ff(n);if(t.when===`enters`&&!i)throw Error(`watch ${e}: \`when: enters\` needs a filter to enter`);return{filters:n,criteria:i,enters:t.when===`enters`,all:r}}const mf=1e4,hf=e=>((e instanceof Error?e.message:String(e))||`unknown error`).slice(0,500),gf=e=>e?.startsWith(`https://`)?e:null;function _f(e){let t=typeof process<`u`&&process.env.VERCEL===`1`?process.env:null,n=t?.VERCEL_TARGET_ENV||t?.VERCEL_ENV,r=n===`preview`&&t?.VERCEL_GIT_COMMIT_REF||null;return!e||n!==`production`&&!r?null:{path:new URL(e).pathname,...r?{branch:r}:{}}}function vf(e){let{registry:t,rethrow:n}=e,r=e.binding,i=null,a=null;async function o(n){let r=await e.hash();return i&&i.url===n&&i.result.hash===r&&Date.now()-i.at<mf?i.result:(a??=e.wakeAt(n).then(e=>t.register(e)).then(e=>(i={url:n,at:Date.now(),result:e},e)).finally(()=>{a=null}),a)}async function s(e){let n={};if(!r().subscriptions[e.watcher])n={skip:!0};else try{await r().run(e.watcher,e.event,{trigger:`watch:${e.watcher}:${e.id}`,attempt:e.attempt+1})}catch(t){console.error(`[board] watcher ${e.watcher} failed:`,t),n={error:hf(t)}}await t.ack(e.id,{lease:e.lease,...n}).catch(e=>console.error(`[board] couldn't ack a match:`,hf(e)))}async function c(){let e=0,n=Date.now()+24e4;for(;Date.now()<n;){let n=await t.matches({limit:10});if(n.length===0)break;await Promise.all(n.map(s)),e+=n.length}return e+await r().pull()}let l=null;function u(){if(l)return;let n=l=new AbortController;(async()=>{for(let i=1e3;!n.signal.aborted;)try{await o(null);let e=await t.matches({limit:10,wait:25,signal:n.signal});await Promise.all(e.map(s)),await r().pull(),i=1e3}catch(t){if(n.signal.aborted)break;console.error(`[board] couldn't pull matches from ${e.remote}:`,hf(t)),await new Promise(e=>setTimeout(e,i)),i=Math.min(i*2,6e4)}})()}let d=null,f=0;function p(){if(d)return d;if(!e.hasWork()||Date.now()-f<mf)return Promise.resolve();let t=gf(r().url());return!t&&typeof process<`u`&&process.env.VERCEL===`1`?Promise.resolve():(d=o(t).then(()=>{},t=>{d=null,f=Date.now(),console.error(`[board] couldn't register with ${e.remote}:`,hf(t))}),t||u(),d)}return{start:p,routes:[{method:`POST`,path:`/wake`,async handle(t){return d??=Promise.resolve(),t.headers.get(`x-board-watchers`)!==await e.hash()&&await o(gf(r().url())).catch(n),Ud({ran:await c().catch(n)})}},{method:`POST`,path:`/watchers`,async handle(t,{caller:i}){if(i)return e.registerFor(i,t);d??=Promise.resolve();let a=gf(r().url()),s=await o(a).catch(n);return a||u(),Ud(s)}}],registerNow:()=>o(gf(r().url())),close:()=>{l?.abort(),l=null}}}const yf=(e,t)=>e<t?-1:+(e>t);function bf(e,t=[]){let n=Object.keys(e).sort(yf).map(t=>[t,e[t].tail,e[t].when]);return t.length>0&&n.push([`sync`,[...t].sort((e,t)=>yf(e.key,t.key)).map(e=>[e.key,e.platform,e.signIn])]),JSON.stringify(n)}const xf=/^[A-Za-z][A-Za-z0-9-]{0,31}$/,Sf=/* @__PURE__ */ new Set([`identity`,`edit`,`delete`,`schedule`,`cancelSchedule`,`upload`,`uploadStart`,`uploadFinish`,`watchers`,`register`,`matches`,`ack`,`syncImport`,`syncReceipt`,`syncThread`,`syncFind`,`syncCopies`,`syncRoots`,`inboxPush`,`inboxNext`,`inboxAck`,`inbox`,`syncCode`,`syncAccount`,`syncUnlink`]);function Cf(e){let t=e.replace(/[^A-Za-z0-9-]+/g,`-`).replace(/^-+|-+$/g,``);return/^[A-Za-z]/.test(t)||(t=`u-${t}`),t.slice(0,32).replace(/-+$/,``)}function wf(e,t){let n=new Set([...t,`middleware`,`client`].map(e=>e.toLowerCase())),r=Cf(e),i=r;for(let e=2;n.has(i.toLowerCase());e++)i=`${r.slice(0,31-String(e).length)}-${e}`;return i}function Tf(e){let{access:t}=e.principal;if(t.everywhere(`manage`))return null;let n=Object.entries(t.summary()).map(([e,t])=>`${e}=${t.join(`,`)}`);return n.length>0?n.join(`;`):`*=`}const Ef=e=>((e instanceof Error?e.message:String(e))||`unknown error`).slice(0,500),Df=e=>{throw e instanceof bd?new Id(e.status>=400?e.status:502,e.code,e.message):e instanceof Id||e instanceof Error&&e.name===`AbortError`?e:new Id(502,`unreachable`,`the board didn't answer: ${Ef(e)}`)};function Of(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null&&r!==!1){if(n===`label`&&Array.isArray(r))for(let[e,n]of r)t.append(`label`,n===null?e:`${e}=${n.join(`|`)}`);else if(Array.isArray(r))for(let e of r)t.append(n,String(e));else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}function kf(e,t){let n=(t.headers.get(`content-disposition`)??``).match(/filename\*=UTF-8''([^;]+)/)?.[1],r=`file`;try{n&&(r=decodeURIComponent(n))}catch{}return{attachment:{id:e,name:r,type:t.headers.get(`content-type`)??`application/octet-stream`,size:Number(t.headers.get(`content-length`)??0)},data:t.body??/* @__PURE__ */ new Uint8Array}}function Af(e,t,n){if(e!==void 0&&!/^https?:\/\/[^/]/.test(e))throw Error(`http: ${e} isn't a URL: pass the board's, like https://board.example.com/api/board`);if(e===void 0&&!n)throw Error(`http: pass the board's URL: outside Node there's no environment to find it in`);let r=(e??n.url()).replace(/\/+$/,``),i=t.fetch??n?.fetch(r)??((e,t)=>globalThis.fetch(e,t)),a=null,o={},s=[],c=null,l=()=>c??=Md(bf(o,s)).then(e=>e.slice(0,32)),u=()=>{if(!a)throw Error(`http: this backend isn't serving a board yet: pass it to board({ backend })`);return a},d=(e,t)=>kd({url:r,fetch:i,profile:e===void 0?()=>n?.profile().profile??null:e,session:t||e===null?null:()=>n?.profile().session??null}),f=d(null,!0),p=/* @__PURE__ */ new Map;function m(e){if(!xf.test(e))throw new Id(400,`invalid_request`,`as: ${e}: profiles start with a letter and use up to 32 letters, numbers, and hyphens`);let t=p.get(e);return t||p.set(e,t=d(e,!0)),t}let h=/* @__PURE__ */ new Map;function g(e){let t=JSON.stringify(e??(e===null?null:`\0`)),n=h.get(t);return n||h.set(t,n=d(e,!1)),n}function _(e){return e.origin.via?.kind===`engine`?f:e.origin.via?.kind===`client`?(e.self!==null&&m(e.self),g(`profile`in e?e.profile:e.self??void 0)):m(e.self??`client`)}let v=null,y=()=>(v??=i(r).then(async e=>{if(!e.ok)throw new Id(e.status>=400?e.status:502,`no_board`,`no board at ${r} (${e.status})`);return await e.json()},Df)).catch(e=>{throw v=null,e}),b=null,x=()=>b??=f.me().then(e=>e.principal).catch(e=>{throw b=null,e}),S=async e=>Fd(await x(),e);async function C(e,t,n,i){let a=vd[t],o={...n},s=a.path.replace(/:(\w+)/g,(e,t)=>{let n=o[t];return delete o[t],encodeURIComponent(String(n))}),c;if(t===`upload`){let{data:t,name:r,type:a}=n;if(t.byteLength>4194304){let n=await e.upload({data:t,name:r??`file`,...a?{type:a}:{}}).catch(Df);return Response.json({attachment:n})}c=await e.request(s,{method:`POST`,body:t,headers:{...a?{"content-type":a}:{},...r===null?{}:{"x-board-filename":encodeURIComponent(r)}},signal:i}).catch(Df)}else c=a.method===`GET`?await e.request(`${s}${Of(o)}`,{signal:i}).catch(Df):await e.request(s,{method:`POST`,body:new TextEncoder().encode(JSON.stringify(o)),headers:{"content-type":`application/json`},signal:i}).catch(Df);if(c.ok)return c;try{let e=await c.json();if(e.error?.message)throw new Id(c.status,e.error.code??`error`,e.error.message)}catch(e){if(e instanceof Id)throw e}throw new Id(502,`remote_error`,`${r} answered ${c.status}`)}async function w(e,t,n,a){if(e===`me`){let{principal:e,author:n,actor:r}=t;return{actor:r.id,principal:e.id,kind:r.kind,handle:r.handle,name:r.name,avatar:r.avatar,profile:n.profile,session:n.session,expiresAt:e.expiresAt?.toISOString()??null,can:e.access.summary()}}if(Sf.has(e))throw Bd(`this board's callers act as its project on ${r}, which can't tell them apart: ${e} is the project's own to do there`);let s=Tf(t),c=t.actor.avatar?.startsWith(`https://`)?t.actor.avatar:void 0,l=kd({url:r,fetch:i,profile:{name:wf(t.actor.handle,Object.keys(o)),...c?{avatar:c}:{}},session:null,...s===null?{}:{headers:{"x-board-scope":s}}});(e===`post`||e===`posted`)&&typeof n.id==`string`&&(n={...n,id:await S(await Nd(`board-gateway`,t.principal.id,n.id)).catch(Df)});let u=await C(l,e,n,a);return e===`attachment`?kf(String(n.id),u):u.json()}async function T(e,t,n,r){let i=k();if(`identity`in t)return w(e,t.identity,n,r);let a=_(t);`self`in t&&t.origin.via?.kind===`engine`&&await i,(e===`post`||e===`posted`)&&`self`in t&&typeof n.id==`string`&&Pd.test(n.id)&&(n={...n,id:await S(n.id).catch(Df)});let o=await C(a,e,n,r);return e===`attachment`?kf(String(n.id),o):o.json()}let E={...Object.fromEntries(Jd.map(e=>[e,(t,n,r)=>T(e,t,n,r)])),async discovery(){return y()},async readSource(e,t,n){return`self`in e&&u().sync.some(e=>e.key===t.key)?u().readSource(t.key,t.target,t.limit??50):T(`readSource`,e,t,n)},async joinSource(e,t,n){return`self`in e&&u().sync.some(e=>e.key===t.key)?u().joinSource(t.key,t.target):T(`joinSource`,e,t,n)},async synced(e,t,n){let{targets:r}=await T(`synced`,e,t,n);return{targets:await Promise.all(r.map(async e=>({...e,url:e.url??(e.thread!==null&&e.message!==null?await u().linkOf(e.key,e.thread,e.message):null)})))}},async linked(e,t,n){let r=()=>new Id(404,`message_not_found`,`no message on this board for that link`),i=await(async()=>{for(let{platform:e,thread:r,message:i}of u().locate(t.url))for(let t of u().sync.filter(t=>t.platform===e)){let e=await f.syncFind({thread:`${t.key}:${r}`,...i===null?{}:{message:i}},{signal:n}).catch(Df),a=i===null?e.thread===null?null:(await f.syncThread(e.thread).catch(Df)).root:e.message;if(a!==null)return a}return null})();if(i===null)return T(`linked`,e,t,n);try{return await E.message(e,{id:i},n)}catch(e){throw e instanceof Id&&e.status===404?r():e}},async typing(e,t,n){let{targets:r}=await T(`typing`,e,t,n);if(!(`self`in e)||u().sync.length===0)return{targets:r};let{message:i,replies:a}=await E.message(e,{id:t.id},n),o=await u().typing([i,...a],t.status).catch(e=>(console.warn(`[board] skipped typing where this board syncs:`,Ef(e)),[]));return{targets:[...r,...o]}}};async function D(e){let t=_f(e);return t&&(await y()).wake_by_path?t:{url:e}}let O=vf({remote:r,registry:{register:e=>f.register({...e,watch:o,...s.length>0?{sync:s}:{}}),matches:e=>f.matches(e),ack:(e,t)=>f.ack(e,t)},wakeAt:D,binding:u,hash:l,hasWork:()=>Object.keys(o).length>0||s.length>0,rethrow:Df,registerFor:async(e,t)=>Ud(await E.register(e,zu.parse(await t.json()),t.signal))}),k=O.start;return{...E,routes:O.routes,keeps:!1,bind(e){if(a)throw Error(`http: this backend already serves a board: create one http() per board()`);for(let[t,n]of Object.entries(e.subscriptions)){if(n.kind===`sync`){t===`@sync`&&(s=e.sync.map(e=>({...e})));continue}if(!xf.test(t))throw Error(`watch ${t}: ids start with a letter and use up to 32 letters, numbers, and hyphens`);pf(t,n),o[t]={tail:n.tail,when:n.when}}c=null,a=e},registerWatchers:O.registerNow,close:O.close}}function jf(e,t={}){return Af(e,t,null)}const Mf=/```[\s\S]*?```/g,Nf=/`[^`\n]*`/g,Pf=`[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?`,Ff=RegExp(`(?<![\\w@.-])@(${Pf}(?:/${Pf})?)(?!:|[a-z0-9_/-]|\\.(?=[a-z0-9]))`,`gi`),If=/(?<![\w@.-])@\[([^\]\s]+)\]/g,Lf=e=>e.replace(Mf,e=>` `.repeat(e.length)).replace(Nf,e=>` `.repeat(e.length));function Rf(e){let t=Lf(e),n=[];for(let e of t.matchAll(If)){let t=e[1];t!==void 0&&n.push({index:e.index,token:{kind:`actor`,actor:t},key:`actor:${t}`})}for(let e of t.replace(If,e=>` `.repeat(e.length)).matchAll(Ff)){let t=e[1]?.toLowerCase();t!==void 0&&n.push({index:e.index,token:{kind:`handle`,handle:t},key:`handle:${t}`})}let r=/* @__PURE__ */ new Set;return n.sort((e,t)=>e.index-t.index).filter(({key:e})=>!r.has(e)&&r.add(e)).map(({token:e})=>e)}function zf(e,t){let n=Lf(e),r=[];for(let e of n.matchAll(If))r.push({index:e.index,length:e[0].length,token:{kind:`actor`,actor:e[1]}});for(let e of n.replace(If,e=>` `.repeat(e.length)).matchAll(Ff))r.push({index:e.index,length:e[0].length,token:{kind:`handle`,handle:e[1].toLowerCase()}});let i=``,a=0;for(let{index:n,length:o,token:s}of r.sort((e,t)=>e.index-t.index)){let r=e.slice(n,n+o);i+=e.slice(a,n)+(t(s,r)??r),a=n+o}return i+e.slice(a)}const Bf=[`read`,`post`,`react`,`label`,`sync`,`manage`],Vf={read:[],post:[],react:[`read`],label:[`read`],sync:[`read`],manage:[`read`,`post`,`react`,`label`,`sync`]},Hf=new Map(Bf.map((e,t)=>[e,t])),Uf=`write *, a channel, or a channel and its subtree (feedback/)`;function Wf(e){if(e===`*`)return{kind:`all`};if(e.includes(`*`)){let t=e.slice(0,e.indexOf(`*`)).replace(/\/+$/,``),n=t===``?`write * for every channel`:Xl.safeParse(t).success?`write ${t}/ for ${t} and its subtree`:Uf;throw Error(`invalid channel pattern ${e}: ${n}`)}let t=e.endsWith(`/`),n=t?e.slice(0,-1):e;if(!Xl.safeParse(n).success)throw Error(`invalid channel pattern ${e||`(empty)`}: ${Uf}`);return t?{kind:`subtree`,path:n}:{kind:`exact`,path:n}}const Gf=e=>e.kind===`all`?`*`:e.kind===`subtree`?`${e.path}/`:e.path;function Kf(e){let t=/* @__PURE__ */ new Set,n=e=>{if(!Hf.has(e))throw Error(`unknown permission ${String(e)}: use ${Bf.join(`, `)}`);if(!t.has(e)){t.add(e);for(let t of Vf[e])n(t)}};for(let t of e===`all`?Bf:e)n(t);return t}const qf=/* @__PURE__ */ new Set;function Jf(e){let t=null,n=/* @__PURE__ */ new Map,r=[];for(let[i,a]of e)i.kind===`all`?t=a:i.kind===`exact`?n.set(i.path,a):r.push([i.path,a]);return r.sort((e,t)=>t[0].length-e[0].length),{all:t,exact:n,subtrees:r}}const Yf=(e,t)=>e===t||e.startsWith(`${t}/`);function Xf(e,t,n=!1){if(!n){let n=e.exact.get(t);if(n)return n}for(let[n,r]of e.subtrees)if(Yf(t,n))return r;return e.all??qf}const Zf=(e,t)=>t.kind===`all`?e.all??qf:Xf(e,t.path,t.kind===`subtree`),Qf=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e));function $f(e,t){if(t.kind===`exact`)return Xf(e,t.path,!0);if(t.kind===`subtree`){for(let[n,r]of e.subtrees)if(n!==t.path&&Yf(t.path,n))return r}return e.all??qf}function ep(e){let t=Jf(e);return Jf(e.filter(([e,n])=>e.kind===`all`?n.size>0:!Qf(n,$f(t,e))))}function tp(e){return e===`all`||Array.isArray(e)?[[{kind:`all`},Kf(e)]]:Object.entries(e).map(([e,t])=>[Wf(e),Kf(t)])}const np=e=>[...e.all?[[{kind:`all`},e.all]]:[],...e.subtrees.map(([e,t])=>[{kind:`subtree`,path:e},t]),...[...e.exact].map(([e,t])=>[{kind:`exact`,path:e},t])],rp=Symbol(`board.access`),ip=e=>typeof e==`object`&&rp in e;function ap(e){let t=np(e),n=n=>(e.all?.has(n)??!1)&&t.every(([,e])=>e.has(n)),r=/* @__PURE__ */ new Map;return{[rp]:e,can:(t,n)=>Xf(e,n).has(t),readable(t){let n=r.get(t);return n===void 0&&r.set(t,n=Xf(e,t).has(`read`)),n},readsAll:n(`read`),everywhere:n,anywhere:e=>t.some(([,t])=>t.has(e)),narrow(n){let r=ip(n)?n[rp]:ep(tp(n)),i=/* @__PURE__ */ new Map([[`*`,{kind:`all`}]]);for(let[e]of[...t,...np(r)])i.set(Gf(e),e);return ap(ep([...i.values()].map(t=>{let n=Zf(r,t);return[t,new Set([...Zf(e,t)].filter(e=>n.has(e)))]})))},summary(){let e=t.map(([e,t])=>[Gf(e),t]);e.sort(([e],[t])=>e===`*`?-1:t===`*`?1:e.localeCompare(t));let n={};for(let[t,r]of e)n[t]=[...r].sort((e,t)=>Hf.get(e)-Hf.get(t));return n}}}function op(e){return ap(ep(tp(e)))}const sp=op(`all`);function cp(e){if(e.length>4e3)throw Error(`x-board-scope is longer than 4000 characters`);let t={},n=e.split(`;`).map(e=>e.trim());if(n.every(e=>e===``))throw Error(`x-board-scope is empty: write pattern=permissions, like dev/=read,post`);for(let e of n){if(e===``)continue;let n=e.indexOf(`=`);if(n<0)throw Error(`x-board-scope entry ${e} needs =: write pattern=permissions, like dev/=read,post`);let r=e.slice(0,n).trim(),i=e.slice(n+1).trim();if(Object.hasOwn(t,r))throw Error(`x-board-scope lists ${r} twice`);Wf(r);let a=i===``?[]:i.split(`,`).map(e=>e.trim());if(a.length===1&&a[0]===`all`){t[r]=`all`;continue}for(let e of a)if(!Hf.has(e))throw Error(`x-board-scope: unknown permission ${e||`(empty)`}: use ${Bf.join(`, `)}, or all`);t[r]=a}return t}const lp=[`claude`,`codex`,`grok`,`pi`],up=/^[A-Za-z][A-Za-z0-9-]{0,31}$/,dp=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/;function fp(e){let t=e.get(`x-board-profile`)?.trim()||null;if(t!==null&&!up.test(t))throw Rd(`profile names start with a letter and use up to 32 letters, numbers, and hyphens`);let n=e.get(`x-board-avatar`)?.trim()||null;if(n!==null&&!mp(n))throw Rd(`avatars must be https URLs (http only on localhost)`);let r=e.get(`x-board-session`)?.trim().slice(0,200)||null,i=e.get(`x-board-handle`)?.trim().toLowerCase()||null;if(i!==null&&!dp.test(i))throw Rd(`invalid handle: ${i}`);let a=e.get(`x-board-name`),o=null;if(a)try{o=decodeURIComponent(a).replace(/[\u0000-\u001f\u007f]/g,``).trim().slice(0,128)||null}catch{throw Rd(`x-board-name must be URI-encoded`)}let s=e.get(`x-board-scope`);if(s!==null)try{cp(s)}catch(e){throw Rd(e.message,`invalid_scope`)}return{profile:t,avatar:n,session:r,handle:i,name:o,scope:s}}function pp(e,t,n){let r=e.kind===`person`&&e.facts?.issuer!==`host`&&t.handle?t.handle:e.handle,i=e.kind===`person`?t.name:null,a=t.profile?.toLowerCase()??null,o=a===null?e.id:`${e.id}+${a}`,s=a!==null&&lp.includes(a),c={id:o,kind:a===null?e.kind:`agent`,handle:a===null?r:`${r}/${a}`,name:t.profile??i??r,avatar:t.avatar??(s?`${n}/avatars/${a}`:null)};return{author:{actor:o,principal:e.id,profile:a,session:t.session},actor:c}}function mp(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`&&[`localhost`,`127.0.0.1`].includes(t.hostname)}catch{return!1}}const hp=e=>Bd(`this token can't use this board: add ${e} to access`),gp=e=>{let t=new URL(e);return`${t.host}${t.pathname.replace(/\/+$/,``)}`.replace(/[%:]/g,e=>e===`%`?`%25`:`%3A`)};function _p(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=gp(n),r=t.get(e);if(r!==void 0&&r!==n)throw Error(`access: oidc issuers ${r} and ${n} name the same principals, oidc:${e}:<sub>: pin one of them`);t.set(e,n)}return new Set(e)}const vp=e=>[...new Set(e.flatMap(e=>typeof e!=`function`&&e.issuer===`oidc`?[e.url]:[]))];function yp(e){let t=typeof e.access==`function`?[]:e.access,n=typeof e.access==`function`?e.access:null,r=_p(vp(t));async function i(n,i){if(i?.issuer===`host`)throw Bd(`this token can't use this board: its board no longer takes a host's principals`);if(i?.issuer===`oidc`&&!r.has(i.iss))throw zd(`untrusted issuer: ${i.iss}`);let a=i?.claims??{},o=i?.issuer===`vercel`?await e.project():null,s=o?{teamId:i.team??o.teamId,projectId:o.id}:{teamId:null,projectId:null},c=String(a.environment??``),l=bp(),u=o!==null&&o.id!==null&&a.project_id===o.id,d=u&&l!==null&&c===l;for(let e of t){if(typeof e==`function`){if(d)continue;let t=await e(n);if(t===void 0)continue;if(t===null)throw Bd(`this token can't use this board`);return op(t)}if(i&&e.issuer===i.issuer&&(e.issuer!==`oidc`||e.url===i.iss)&&e.matches(a,s))return e.access}if(d)return sp;throw i?i.issuer===`oidc`?hp(`oidc({ issuer: '${i.iss}', claims, can })`):i.issuer===`github`?hp(`githubActions({ repository: '${String(a.repository)}', can })`):u?Bd(`this token can't use this board: it runs in ${l??`no Vercel environment`}, so its ${c||`unnamed`} deployments need vercelProject({ project: 'self', environments: ['${c}'], can })`):hp(`vercelProject({ project: '${String(a.project??``)||String(a.project_id)}', can })`):Bd(`this token can't use this board`)}async function a(t){let r=sp,a=t.facts?.issuer===`host`;if(t.id.startsWith(`board:`)||t.kind===`external`&&!a)r=sp;else{if(a){if(!e.hosts)throw Bd(`this token can't use this board: its board no longer takes a host's principals`);let{exp:n}=t.facts.claims;if(typeof n==`number`&&n*1e3<=Date.now())throw zd(`token expired`)}if(n){let e=await n(t);if(e==null)throw Bd(`this token can't use this board`);r=op(e)}else t.kind!==`person`&&(r=await i(t,(a?void 0:t.facts)??xp(t.id)))}return t.scope===void 0?r:r.narrow(cp(t.scope))}async function o(e){try{return await a(e)}catch(e){let t=e.status;if(t===401||t===403)return null;throw e}}return{grant:a,accessNow:o}}const bp=()=>process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||null;function xp(e){let t=e.match(/^vercel:project:([^:]+):([^:]+)$/);return t?{issuer:`vercel`,iss:``,claims:{project_id:t[1],environment:t[2]}}:null}const Sp=Symbol(`board.oidcTokens`),Cp=/* @__PURE__ */ new WeakSet,wp=e=>Sp in e,Tp=e=>Cp.has(e),Ep=/^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*:[^\s+\]]{1,200}$/,Dp=[`person`,`deployment`,`workflow`,`external`];function Op(e){let t=e=>{throw TypeError(`authenticate returned an invalid principal: ${e}`)};(typeof e!=`object`||!e)&&t(`not an object`),(typeof e.id!=`string`||!Ep.test(e.id)||e.id.startsWith(`board:`))&&t(`id must look like \`vercel:user:<id>\`, got ${JSON.stringify(e.id)}`),Dp.includes(e.kind)||t(`kind must be one of ${Dp.join(`, `)}`),(typeof e.handle!=`string`||!/^\S{1,64}$/.test(e.handle))&&t(`handle must be 1-64 characters, no spaces`);let n=e.expiresAt??null;if(n!==null&&(!(n instanceof Date)||Number.isNaN(n.getTime()))&&t(`expiresAt must be a Date or null`),n!==null&&n.getTime()<=Date.now())throw zd(`token expired`);let r=n===null?{}:{exp:Math.floor(n.getTime()/1e3)};return{id:e.id,kind:e.kind,handle:e.handle,expiresAt:n,facts:{issuer:`host`,iss:``,claims:r}}}function kp(e,t,n){let r=t||e.access!==void 0,i=e.access??[],a=null,o=()=>(a??=(async()=>{if(!n)return{id:e.project?.id??null,teamId:e.project?.teamId??null};let t=await n(),[r,i]=await Promise.all([t.ownProjectId(e.project),t.ownTeamId(e.project)]);return{id:r,teamId:i}})()).catch(e=>{throw a=null,e});async function s(t){return n?(await n()).discoveryIdentity(t,e.project):{projectId:e.project?.id??null,teamId:e.project?.teamId??null}}let c=null,l=()=>e.authenticate?Promise.resolve(e.authenticate):c??=n?n().then(e=>e.oidcTokens()):Promise.reject(new Id(501,`no_verifier`,`this build of board verifies no tokens: pass board({ authenticate })`)),u=yp({access:i,project:o,hosts:e.authenticate!==void 0&&!wp(e.authenticate)}),d={project:o,issuers:typeof i==`function`?[]:vp(i)},f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new WeakMap;async function m(e){let t=e=>e.expiresAt===null||e.expiresAt.getTime()>Date.now(),n=p.get(e);if(n){let e=await n;if(t(e))return e}let r=e.credential===null?null:[e.audience,e.credential,e.headers.get(`x-vercel-oidc-token`)??``].join(``),i=r===null?void 0:f.get(r);if(i&&i.until>Date.now())return p.set(e,i.principal),i.principal;let a=h(e);return p.set(e,a),r!==null&&a.then(e=>{e.facts?.issuer!==`host`&&e.expiresAt!==null&&(f.size>=1e3&&f.delete(f.keys().next().value),f.set(r,{principal:a,until:e.expiresAt.getTime()}))},()=>p.delete(e)),a}async function h(e){let t=await l(),n;try{n=await t({...e,board:d})}catch(e){throw e instanceof Response?new Ld(e):e}if(n instanceof Response)throw new Ld(n);if(n==null)throw zd(`missing bearer token`);return Tp(n)?n:Op(n)}return{open:r,project:o,discoveryIdentity:s,async identify(e){let t=await m(e),n=e.claims.scope===null?t:{...t,scope:e.claims.scope},{author:r,actor:i}=pp(n,e.claims,e.audience);return{principal:{...n,access:await u.grant(n)},author:r,actor:i}},accessNow:e=>u.accessNow(e)}}const Ap={claude:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`,openai:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,x:`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`,slack:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`,github:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`,whatsapp:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z`},jp={claude:{background:`#D97757`,mark:{path:Ap.claude}},codex:{background:`#000000`,mark:{path:Ap.openai}},grok:{background:`#000000`,mark:{path:Ap.x}},pi:{background:`#1f1f1f`,mark:{glyph:`π`}}};function Mp(e){let t=jp[e]??{background:`#666666`,mark:{glyph:e.slice(0,1).toUpperCase()}},n=`path`in t.mark?`<path transform="translate(30 30) scale(2.8333)" fill="#ffffff" d="${t.mark.path}"/>`:`<text x="64" y="86" font-family="ui-sans-serif,system-ui,sans-serif" font-size="66" font-weight="600" text-anchor="middle" fill="#ffffff">${t.mark.glyph}</text>`;return`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"><rect width="128" height="128" rx="28" fill="${t.background}"/>${n}</svg>`}var Np=class extends Id{responses;constructor(e){super(422,`dropped`,e.join(`
346
+ `)||`the board dropped this message`),this.responses=e}};const Pp=K({text:G().max(Jl).optional(),labels:iu.optional()}).strict();async function Fp(e,t,n){let r=[],i=null,a=async(o,s)=>{if(o===e.length){if(s.text.trim()===``&&(s.kind===`edit`||s.attachments.length===0))return;i={value:await n(s)};return}let c=null;await e[o]({write:Object.freeze({...s}),author:Object.freeze({...t.author}),source:Object.freeze({...t.source}),board:t.board(),respond:async e=>{r.push(e)},next:(e={})=>{if(c)throw Error(`next() was already called`);let{text:t,labels:n}=Pp.parse(e);return c=a(o+1,{...s,...t===void 0?{}:{text:t},...s.kind===`post`&&n?{labels:{...s.labels,...n}}:{}}),c}}),c&&await c};if(await a(0,t.write),!i)throw new Np(r);return i.value}const Ip=e=>typeof e==`string`?{target:e,kind:yu(e)?`thread`:`channel`}:e,Lp=e=>Rf(e).some(e=>e.kind===`actor`&&e.actor.includes(`@`));async function Rp(e,t){let n=Rf(e).flatMap(e=>e.kind===`actor`&&e.actor.includes(`@`)?[e.actor]:[]);if(n.length===0)return{text:e,found:[]};let r=/* @__PURE__ */ new Map;for(let e of n)r.set(e,await t?.(e).catch(()=>null)??null);return{text:zf(e,e=>{if(e.kind!==`actor`||!r.has(e.actor))return null;let t=r.get(e.actor);return t?`@[${t.id}]`:e.actor}),found:[...r.values()].filter(e=>e!==null)}}const zp=/* @__PURE__ */ new Set([`post`,`schedule`,`upload`,`uploadFinish`]),Bp=/^(image\/(png|jpeg|gif|webp|avif)|video\/(mp4|webm)|text\/plain)$/;function Vp({attachment:e,data:t}){let n=Bp.test(e.type)?`inline`:`attachment`,r=t instanceof Uint8Array?new Blob([t]):t;return new Response(r,{headers:{"content-type":e.type,"content-length":String(e.size),"content-disposition":`${n}; filename*=UTF-8''${encodeURIComponent(e.name)}`,"content-security-policy":`sandbox; default-src 'none'`,"x-content-type-options":`nosniff`,"cache-control":`private, max-age=31536000, immutable`}})}async function Hp(e,t,n,r){let i=r.id??``,a=r.key??``,o=()=>$d(t);switch(e){case`discovery`:case`me`:case`channels`:case`actors`:case`identity`:case`watchers`:return{};case`message`:case`posted`:case`synced`:case`delete`:case`cancelSchedule`:case`attachment`:case`uploadFinish`:return{id:i};case`messages`:return Ou.parse(Qd(n));case`threads`:return ku.parse(Qd(n));case`schedules`:return Fu.parse(Qd(n));case`matches`:return Bu.parse(Qd(n));case`events`:{let e=Au.parse(Qd(n)),r=t.headers.get(`last-event-id`);return e.after===void 0&&r&&Su.safeParse(r).success&&(e.after=r),e}case`post`:return ju.parse(await o());case`schedule`:return Pu.parse(await o());case`register`:return zu.parse(await o());case`edit`:return{id:i,...pd.parse(await o())};case`react`:return{id:i,...gd.parse(await o())};case`label`:return{id:i,..._d.parse(await o())};case`ack`:return{id:i,...Vu.parse(await o())};case`upload`:{let e=t.headers.get(`x-board-filename`),n=null;try{n=e===null?null:decodeURIComponent(e)}catch{throw Rd("`x-board-filename` is not URI-encoded")}return{data:await tf(t,ke),name:n,type:t.headers.get(`content-type`)}}case`uploadStart`:return fd.parse(await o());case`syncImport`:return $u.parse(await o());case`syncReceipt`:return td.parse(await o());case`syncThread`:return{thread:r.thread??``};case`syncFind`:return nd.parse(Qd(n));case`syncCopies`:return rd.parse(Qd(n));case`syncRoots`:return id.parse(Qd(n));case`inboxPush`:return{key:a,...ad.parse(await o())};case`inboxNext`:return{key:a,...od.parse(Qd(n))};case`inboxAck`:return{key:a,id:i,...sd.parse(await o())};case`inbox`:return{key:a,...Lu.parse(Qd(n))};case`syncCode`:return cd.parse(await o());case`syncAccount`:return ld.parse(await o());case`syncUnlink`:return dd.parse(await o());case`typing`:return{id:i,...hd.parse(await o())??{}};case`readSource`:return{key:a,...Hu.parse(Qd(n))};case`joinSource`:return{key:a,...Uu.parse(await o())};case`linked`:return Wu.parse(Qd(n))}}const Up=e=>({id:e.id,kind:`external`,handle:e.handle,name:e.name,avatar:e.avatar});function Wp(e){let t=e.origin.via;return t?.kind===`middleware`||t?.kind===`engine`?null:t??{kind:`api`}}const Gp={self:`middleware`,origin:{via:{kind:`middleware`}}},Kp={self:null,origin:{via:{kind:`client`,name:null}}};async function qp(e){let{options:t,backend:n,runtime:r,policy:i}=e,a=t.sync??{},o=Object.keys(a).length>0?(await r.sync()).createSyncEngine(a):null,s=t.streamMaxMs??28e4,c=Zd(n.routes,t.basePath),{state:l,ownUrl:u,clientAs:d,handleOf:f}=e,p=t.watch??{},m=t.middleware??[];function h(e,t){return{credential:(e.headers.get(`authorization`)??``).match(/^Bearer\s+(.+)$/i)?.[1]??null,claims:fp(e.headers),audience:t,headers:e.headers}}async function g(e){return{identity:await i.identify(e),origin:{via:{kind:`api`}}}}let _=()=>new Id(404,`not_found`,`${u()??`this board`} answers only wake-ups and webhooks`);async function v(e){return(await Rp(e,o?async e=>{let t=await o.findByEmail(e);return t&&await n.syncImport(o.caller,{op:`seen`,author:{...t,isBot:!1}},new AbortController().signal),t}:void 0)).text}async function y(e){if(typeof e!=`string`)return e;let t=e.indexOf(`:`);if(t<=0)throw Rd(`sync targets look like <key>:<channel or thread>, got: ${e}`);let n=e.slice(0,t);if(o&&a[n])return o.normalizeTarget(e);if(o)throw Rd(`no sync entry named ${n}`);return Ip(e)}let b=e=>`identity`in e?e.identity.principal.access:null;async function x(e,t,n){let r=b(e);if(r===null)return{access:null,channel:t.channel??``};let i=t.channel??(t.re===void 0?void 0:(await P(e,t.re,n))?.channel);return i===void 0?null:r.can(`post`,i)?{access:r,channel:i}:null}let S=/* @__PURE__ */ new Map;async function C(e,t){if(`identity`in e)return{principal:e.identity.principal.id,actor:e.identity.actor};let r=JSON.stringify([e.origin.via?.kind??``,e.self,e.profile??null]),i=S.get(r);return i||(S.set(r,i=n.me(e,{},t).then(e=>({principal:e.principal,actor:{id:e.actor,kind:e.kind,handle:e.handle,name:e.name,avatar:e.avatar}}))),i.catch(()=>S.delete(r))),i}let w=null,T=(e,t,n,r)=>Fp(m,{write:e,author:t,source:n,board:()=>w??=f(Gp,null)},r);async function E(e){try{return await e(),!0}catch(e){if(e instanceof Id&&e.status===404)return!1;throw e}}async function D(e,t,r){let i=[];for(let a of new Set(t??[])){let{attachment:t,data:o}=await n.attachment(e,{id:a},r);o instanceof ReadableStream&&await o.cancel().catch(()=>{}),i.push(t)}return i}async function O(e,t,r,i){let a=Wp(e);if(m.length===0||a===null||t.id!==void 0&&await E(()=>n.posted(e,{id:t.id},r)))return i(t);let o=t.channel,s=null;if(t.re!==void 0){let n=await P(e,t.re,r);if(!n)return i(t);o=n.channel,s=n.re??n.id}let c=b(e),l=Object.keys(t.labels??{}).length>0,u=t.re===void 0&&(t.sync?.length??0)>0;if(o===void 0||c&&(!c.can(`post`,o)||l&&!c.can(`label`,o)||u&&!c.can(`sync`,o)))return i(t);let d=await D(e,t.attachments,r),{actor:f}=await C(e,r);return T({kind:`post`,channel:o,re:s,text:t.text,labels:t.labels??{},attachments:d},f,a,e=>i({...t,text:e.text,labels:e.labels}))}async function k(e,t,n){let r=b(e),i=await P(e,t,n),a=i??(r===null?null:await P(Kp,t,n));return!a||a.deleted||r&&!r.can(`post`,a.channel)||!i&&!a.blind?null:a.by.principal===(await C(e,n)).principal?a:null}async function A(e,t,n,r){let i=Wp(e);if(m.length===0||i===null)return r(t);let a=await k(e,t.id,n);if(!a)return r(t);let{actor:o}=await C(e,n);return T({kind:`edit`,id:a.id,channel:a.channel,re:a.re,text:t.text},o,i,e=>r({...t,text:e.text}))}async function j(e,t,r,i){let o=t.source?.key??t.from;if(t.source&&!(`identity`in e?(await n.watchers(e,{},i)).watchers.some(t=>t.owner===e.identity.principal.id&&t.sync.some(e=>e.key===o)):a[t.source.key]!==void 0))return null;let s=(t.op===`post`?t.origin:null)??r?.origin??null;return{kind:`sync`,key:o??``,platform:t.author.id.slice(0,Math.max(0,t.author.id.indexOf(`:`))),channel:t.source?.channel??r?.origin?.channel??s?.channel??``,thread:t.source?.thread??(s?s.subthread??s.thread:``)}}async function M(e,t,r){let i=t.message??null;if(t.origin!==void 0){let{thread:a,message:o}=await n.syncFind(e,{thread:t.origin.thread,...t.origin.message===void 0?{}:{message:t.origin.message}},r);i=t.origin.message===void 0?a===null?null:(await n.syncThread(e,{thread:a},r)).root:o}return i===null?null:P(e,i,r)}async function N(e,t,r){let i=t=>n.syncImport(e,t,r);if(m.length===0||e.origin.via?.kind===`middleware`||t.op!==`post`&&t.op!==`edit`)return i(t);let a=b(e);if(a&&(!a.anywhere(`sync`)||`identity`in e&&e.identity.principal.scope!==void 0))return i(t);let o=async e=>{try{return await e()}catch(e){if(!(e instanceof Np))throw e;return{message:null,dropped:[...e.responses]}}};if(t.op===`post`){if(t.id!==void 0&&(await n.syncFind(e,{post:t.id},r)).message!==null)return i(t);let s=t.channel,c=null;if(t.re!==void 0){let n=await P(e,t.re,r);if(!n)return i(t);s=n.channel,c=n.re??n.id}if(s===void 0||a&&!a.can(`sync`,s))return i(t);let l=await j(e,t,null,r);if(!l)return i(t);let u=await D(e,t.attachments,r);return o(async()=>T({kind:`post`,channel:s,re:c,text:t.text,labels:t.labels??{},attachments:u},Up(t.author),l,async e=>i({...t,text:e.text,labels:e.labels})))}if(t.origin===void 0==(t.message===void 0))return i(t);let s=await M(e,t,r);if(!s||s.deleted||a&&!a.can(`sync`,s.channel)||t.message!==void 0&&s.by.principal!==t.author.id)return i(t);let c=await j(e,t,s,r);return c?o(async()=>T({kind:`edit`,id:s.id,channel:s.channel,re:s.re,text:t.text},Up(t.author),c,async e=>i({...t,text:e.text}))):i(t)}async function P(e,t,r){try{let{message:i,replies:a}=await n.message(e,{id:t},r);return[i,...a].find(e=>e.id===t)??null}catch(e){if(e instanceof Id&&e.status===404)return null;throw e}}async function F(e,t,r){let i=(e,t)=>O(e,t,r,t=>n.post(e,t,r));if(!o)return i(e,t.sync?.length?{...t,sync:await Promise.all(t.sync.map(y))}:t);let a=(t.sync?.length??0)>0||Lp(t.text)?await x(e,t,r):null;if(!a)return i(e,t);let{access:s,channel:c}=a,l=t.re===void 0&&(t.sync?.length??0)>0&&(s===null||s.can(`sync`,c))?{...t,sync:await Promise.all(t.sync.map(y))}:t,u=await v(l.text),d=await i(e,{...l,text:u});return u!==t.text&&s!==null&&!s.readable(d.message.channel)?{...d,message:{...d.message,text:t.text}}:d}async function I(e,t){if(!t.dropped)return t.message;for(let n of t.dropped)await e.platform.respond(n);throw new Np(t.dropped)}async function L(e,t,n,r){let i=o.caller,{author:a,key:s}=t.platform,{via:c}=t.origin,l={key:s,channel:c.channel,thread:c.thread},u=async e=>{if(await I(t,await N(i,e,r))===null)throw Vd(`message not found: #${e.message}`,`message_not_found`);return{ok:!0}};switch(e){case`post`:return ee(t,n,r);case`edit`:{let{id:e,text:t}=n;return u({op:`edit`,author:a,from:null,message:e,text:await v(t),source:l})}case`delete`:return u({op:`delete`,author:a,from:null,message:n.id});case`react`:{let{id:e,emoji:t,remove:r}=n;return u({op:`react`,author:a,from:null,message:e,emoji:t,...r===void 0?{}:{remove:r}})}case`label`:{let{id:e,set:t,unset:r}=n;return u({op:`labels`,author:a,from:null,message:e,...t?{set:t}:{},...r?{unset:r}:{}})}default:return R(e,i,n,r)}}async function ee(e,t,r){let i=o.caller,{author:a,key:s}=e.platform,{via:c}=e.origin,l=async e=>{let t=await P(i,e,r);if(!t)throw Vd(`message not found: #${e}`,`message_not_found`);return t};if(t.id!==void 0){let e=(await n.syncFind(i,{post:t.id},r)).message;if(e!==null)return{message:await l(e)}}let u=await Promise.all((t.sync??[]).map(y)),d=await I(e,await N(i,{op:`post`,author:a,from:null,origin:null,source:{key:s,channel:c.channel,thread:c.thread},...t.channel===void 0?{re:t.re}:{channel:t.channel},text:await v(t.text),...t.labels?{labels:t.labels}:{},...t.noSync?{noSync:!0}:{},...t.attachments?.length?{attachments:t.attachments}:{},...t.id===void 0?{}:{id:t.id}},r));for(let e of u)await n.syncReceipt(i,{kind:`thread`,message:d,target:e.target,targetKind:e.kind,cause:`request`},r);return{message:await l(d)}}async function R(e,t,r,i){switch(e){case`post`:return F(t,r,i);case`edit`:{let{id:e,text:a}=r,s=e=>A(t,e,i,e=>n.edit(t,e,i));return!o||!Lp(a)||!await x(t,{re:e},i)?s({id:e,text:a}):s({id:e,text:await v(a)})}case`syncImport`:return N(t,r,i);case`schedule`:{let e=r,a=o&&Lp(e.text)?await x(t,e,i):null;if(!a)return n.schedule(t,e,i);let s=await v(e.text),c=await n.schedule(t,{...e,text:s},i),{access:l}=a;return s!==e.text&&l!==null&&!l.readable(c.schedule.channel)?{...c,schedule:{...c.schedule,text:e.text}}:c}case`inbox`:{let e=r;if(o&&a[e.key]&&e.channel!==void 0){let r=b(t);if(r===null||r.anywhere(`sync`))return n.inbox(t,{...e,channel:await o.inboxChannel(e.key,e.channel)},i)}return n.inbox(t,e,i)}default:{let a=n[e];if(typeof a!=`function`)throw Vd(`no route: ${e}`);return a.call(n,t,r,i)}}}async function te(e,t,r){let{sync:i,code:s}=ud.parse(Qd(t));if(!o||!a[i])throw Vd(`no sync entry named ${i}`);let c=(e,t)=>new Response(`${t}\n`,{status:e,headers:{"content-type":`text/plain; charset=utf-8`}}),{holder:l}=await n.syncFind(o.caller,{code:s},r);if(l===null)return c(404,"That link has expired or been used. Run `vb identity link` again for a new one.");if(e===`signIn`){let e=u(),t=await o.signIn(i,l,e?`${e}/identity/signed-in?${new URLSearchParams({sync:i,code:s})}`:void 0);return new Response(null,{status:302,headers:{location:t}})}let d=await o.redeemSignIn(i,l,s);return d?c(200,`Linked ${d.handle?`@${d.handle}`:d.actor}. You can close this tab.`):c(409,`${a[i].platform} hasn't said you approved yet: finish signing in, then open this page again.`)}async function ne(e,t,r,i,a){let s=r.signal;switch(e){case`sync`:{let e=Iu.parse(await $d(r)),i=a.id??``,c=b(t);if(c&&o){let e=await P(t,i,s);if(!e)throw Vd(`message not found: #${i}`,`message_not_found`);if(!c.can(`sync`,e.channel))throw Bd(`this token can't sync in ${e.channel}`)}let l=await y(e.target),{attached:u}=await n.syncReceipt(t,{kind:`thread`,message:i,target:l.target,targetKind:l.kind,cause:`request`},s);return Ud({target:l.target,attached:u??!0})}case`identityUnlink`:{let e=Gu.parse(await $d(r)),{links:i}=await n.identity(t,{},s),a=e.actor.replace(/^@/,``).toLowerCase(),o=i.filter(t=>t.actor===e.actor||t.handle?.toLowerCase()===a).map(e=>e.actor);if(o.length===0)throw Vd(`${e.actor} isn't linked to you`,`not_linked`);if(o.length>1)throw Rd(`${e.actor} names several of your accounts: use ${o.join(` or `)}`,`ambiguous_actor`);return await n.syncUnlink(t,{account:o[0]},s),Ud({ok:!0,actor:o[0]})}default:throw Vd(`no route: ${r.method} ${i.pathname}`)}}let re=Object.fromEntries(Jd.map(e=>[e,e===`syncImport`?N:(t,r,i)=>n[e].call(n,t,r,i)]));o?.bind({backend:re,client:(e,t)=>d({platform:{author:e.author,key:e.key,respond:e.respond},origin:{via:e.via}},t)});async function ie(e,t,r,i){let a=await n.events(e,{...t,wait:0},r.signal),o=new TextEncoder,c=new AbortController,l=Date.now()+s,u=AbortSignal.any([r.signal,c.signal,AbortSignal.timeout(s)]),d=new ReadableStream({async start(r){let s=e=>{try{r.enqueue(o.encode(e))}catch{}},c=setInterval(()=>s(`: ping
347
347
 
348
348
  `),15e3);try{s(`: connected
349
349
 
350
- `);let r=a,o;for(;;){for(let e of r.events)s(`id: ${e.cursor}\nevent: board\ndata: ${JSON.stringify(e)}\n\n`);r.cursor!==(r.events.at(-1)?.cursor??o)&&s(`id: ${r.cursor}\n\n`),o=r.cursor;let a=l-Date.now();if(u.aborted||a<=0)break;r=await n.events(i?await i():e,{...t,after:o,wait:Math.min(300,a/1e3)},u)}}catch(e){u.aborted||console.error(`[board] feed failed`,e)}finally{clearInterval(c);try{r.close()}catch{}}},cancel(){c.abort()}});return new Response(d,{headers:{"content-type":`text/event-stream`,"cache-control":`no-cache, no-transform`,connection:`keep-alive`}})}async function ie(e,t,r){let{projectId:o,teamId:s}=await i.discoveryIdentity(e.headers),c=n.keeps?(await n.discovery(Up,{},r)).sync:Object.entries(a).map(([e,t])=>({key:e,platform:t.platform}));return{version:Gd,url:t,audience:t,team_id:s,project_id:o,sync:c}}async function B(e,r){try{let s=new URL(e.url),u=c(e.method,s.pathname);if(!u)throw Bd(`no route: ${e.method} ${s.pathname}`);let{target:d}=u;!r&&!u.root&&(l.learned===null||l.learned.startsWith(`${u.base}/`))&&(l.learned=u.base);let f=(t.url??`${s.origin}${u.base}`).replace(/\/+$/,``);if(d.kind===`board`&&d.name===`webhook`){if(!o||!a[u.params.key??``])throw Bd(`no sync entry named ${u.params.key}`);return await o.handleWebhook(u.params.key,e)}if(d.kind===`board`&&(d.name===`signIn`||d.name===`signedIn`))return await ee(d.name,s,e.signal);if(d.kind===`board`&&d.name===`avatar`){let e=u.param??``;if(!op.includes(e))throw Bd(`no avatar: ${e}`);return new Response(kp(e),{headers:{"content-type":`image/svg+xml`,"cache-control":`public, max-age=86400`}})}if(d.kind===`board`&&d.name===`openapi`)return Hd(tf());if(d.kind===`backend`)return await d.route.handle(e,{caller:r&&`platform`in r?o.caller:r,param:u.param});if(!r&&!i.open)throw _();if(!r&&d.kind===`protocol`&&d.name===`discovery`)return Hd(await ie(e,f,e.signal));if(d.kind===`protocol`&&typeof n[d.name]!=`function`)throw Bd(`no route: ${e.method} ${s.pathname}`);let p=r&&`platform`in r?o.caller:r,m=p?null:h(e,f),v=p??await g(m);if(d.kind===`board`)return await te(d.name,v,e,s,u.params);let y=await zp(d.name,e,s,u.params);if(d.name===`events`&&(e.headers.get(`accept`)??``).includes(`text/event-stream`))return await re(v,y,e,m?()=>g(m):null);let b=r&&`platform`in r?await L(d.name,r,y,e.signal):await z(d.name,v,y,e.signal);return d.name===`attachment`?Rp(b):Hd(b,Ip.has(d.name)?201:200)}catch(e){return Wd(e)}}return{dispatch:B,async inject(e,t,n,r){if(n!==null&&e.method===`POST`&&new URL(e.url).pathname.endsWith(`/messages`)){let t=await e.json()??{};t.id??=await Md(`board-inbound`,n,`client`,String(r.made++)),e=new Request(e.url,{method:`POST`,headers:e.headers,body:JSON.stringify(t)})}return B(e,t)},async run(e,t,{trigger:n,attempt:r}){if(e===`@sync`&&o)return o.deliver(t,{attempt:r});let i=p[e];if(!i)throw Error(`this board has no watcher ${e}`);await i.run({event:t,board:f({self:e,origin:{via:{kind:`watcher`,id:e}}},n)})},async receive(e,t,{id:n,attempt:r}){if(!o)throw Error(`this board has no sync, so nothing reads ${e}'s inbox`);await o.receive(e,t,{id:n,attempt:r})},pull:()=>o?o.pull():Promise.resolve(0),async readSource(e,t,n){if(!o||!a[e])throw Bd(`this board doesn't run sync entry ${e}: read it where its sync runs`,`not_synced_here`);return o.readSource(e,t,n)},async joinSource(e,t){if(!o||!a[e])throw Bd(`this board doesn't run sync entry ${e}: join it where its sync runs`,`not_synced_here`);return o.joinSource(e,t)},typing:async(e,t)=>o?o.typing(e,t):[]}}function Gp(e,t){let n=e.backend??t.http(),r=Ep(e,n.keeps,t.serving),i=e.watch??{},a=e.sync??{},o={learned:null},s=`http://in-process.board${(e.basePath??``).replace(/\/+$/,``)}`;function c(){if(e.url)return e.url.replace(/\/+$/,``);let t=typeof process>`u`?void 0:process.env,n=t?.VERCEL_ENV===`production`?t.VERCEL_PROJECT_PRODUCTION_URL:t?.VERCEL_URL,r=e.basePath??o.learned;return n&&r!==null?`https://${n}${r}`.replace(/\/+$/,``):null}let l=null;function u(){return l??=Wp(_),l.catch(()=>l=null),l}function d(e,t){let n={made:0};return Od({url:s,token:`in-process`,fetch:(async(r,i)=>(await u()).inject(new Request(r,i),e,t,n))})}let f=async e=>(await u()).dispatch(e,null);function p(e,t){let n={...e,fetch:f,as:g};return t&&Object.defineProperty(n,"url",{get:t,enumerable:!0}),n}function m(e,t){let n=d(e,t);if(`identity`in e)return p({...n,events:(e,t)=>Kp(n,e,t)},()=>c()??s);let r=e.origin.via?.kind??`client`,i=t=>Md(`board-${r===`watcher`?`watch`:r}`,e.self??``,t),a=async e=>typeof e==`string`||e.id===void 0?e:{...e,id:await i(e.id)};return p({...n,post:async(e,t)=>n.post(e,await a(t)),reply:async(e,t)=>n.reply(e,await a(t)),posted:async e=>n.posted(await i(e)),request:(e,t={})=>{let{as:r,...i}=t;return r===void 0?n.request(e,i):g(r).request(e,i)},events:(e,t)=>Kp(n,e,t)},()=>c()??s)}let h=e=>{let t=e===null?null:typeof e==`string`?e:e.name;return{self:t,profile:e,origin:{via:{kind:`client`,name:t}}}};function g(e){return m(h(e),null)}let _={options:e,backend:n,runtime:t,policy:r,state:o,ownUrl:c,clientAs:d,handleOf:m},v=Object.fromEntries(Object.entries(i).map(([e,t])=>[e,{kind:`tail`,tail:t.tail,when:t.when??`matches`}]));Object.keys(a).length>0&&(v[`@sync`]={kind:`sync`});let y=Object.entries(a).map(([e,t])=>({key:e,platform:t.platform,signIn:t.users!==null})),b={subscriptions:v,run:async(e,t,n)=>(await u()).run(e,t,n),receive:async(e,t,n)=>(await u()).receive(e,t,n),pull:async()=>y.length>0?(await u()).pull():0,sync:y,readSource:async(e,t,n)=>(await u()).readSource(e,t,n),joinSource:async(e,t)=>(await u()).joinSource(e,t),locate:e=>{let t=/* @__PURE__ */ new Map;for(let n of Object.values(a)){let r=n.locate(e);r&&t.set(JSON.stringify([n.platform,r.thread,r.message]),{platform:n.platform,...r})}return[...t.values()]},linkOf:async(e,t,n)=>{let r=Object.hasOwn(a,e)?a[e]:void 0;return!r||!t.startsWith(`${e}:`)?null:r.url(t.slice(e.length+1),n).catch(()=>null)},typing:async(e,t)=>(await u()).typing(e,t),accessNow:e=>r.accessNow(e),project:()=>r.project(),handle:e=>m(e,null),url:c};return n.bind(b),m({self:null,origin:{via:{kind:`client`,name:null}}},null)}async function*Kp(e,t={},n={}){let r=t.after,i=0;for(;!n.signal?.aborted;){let a;try{a=await e.poll({...t,...r===void 0?{}:{after:r},wait:25},n.signal)}catch(e){if(n.signal?.aborted)return;if(e instanceof yd&&e.status>=400&&e.status<500)throw e;await new Promise(e=>setTimeout(e,Math.min(3e4,500*2**i++)));continue}i=0;for(let e of a.events)if(yield e,n.signal?.aborted)return;r=a.cursor}}function qp(e={}){return Gp(e,{http:()=>Of(),sync:()=>import(`./engine.js`),serving:null})}const Jp={me:null,discovery:null,channels:{},messages:{},ops:{},pending:[],actors:{},cursor:null,live:`connecting`};function Yp(e,t,n){switch(t.kind){case`react`:{let r=(e.reactions[Te(t.emoji)]??[]).includes(n);return t.remove?!r:r||e.deleted}case`edit`:return e.text===t.text||e.deleted;case`delete`:return e.deleted;case`label`:return e.deleted||Object.entries(t.set).every(([t,n])=>e.labels[t]===n)&&t.unset.every(t=>!(t in e.labels))}}function Xp(e,t,n,r){switch(t.kind){case`react`:{let r=Te(t.emoji),i=(e.reactions[r]??[]).filter(e=>e!==n),a={...e.reactions,[r]:t.remove?i:[...i,n]};return a[r].length===0&&delete a[r],{...e,reactions:a}}case`edit`:return{...e,text:t.text,editedAt:r};case`delete`:return{...e,deleted:!0,text:``,reactions:{},mentions:[]};case`label`:{let n={...e.labels,...t.set};for(let e of t.unset)delete n[e];return{...e,labels:n}}}}function Zp(e,t){let n=e.messages,r=e.ops;for(let i of t){if((n[i.id]?.version??-1)>i.version)continue;n===e.messages&&(n={...n}),n[i.id]=i;let t=r[i.id];if(t&&e.me){let n=t.filter(({op:t})=>!Yp(i,t,e.me.actor));n.length!==t.length&&(r={...r},n.length>0?r[i.id]=n:delete r[i.id])}}return n===e.messages&&r===e.ops?e:{...e,messages:n,ops:r}}function Qp(e,t){if(t.by.actor===e.me?.actor)return e.pending.find(e=>e.error===null&&e.channel===t.channel&&e.re===t.re&&e.text===t.text)}function $p(e,t){let n=t.message?Zp(e,[t.message]):e;if(t.type===`message.posted`&&t.message){let e=Qp(n,t.message);e&&(n={...n,pending:n.pending.filter(t=>t!==e)});let{channel:r,re:i}=t.message,a=n.channels[r];(!a||a.lastIndex<t.message.version)&&(n={...n,channels:{...n.channels,[r]:{path:r,lastIndex:t.message.version,messages:(a?.messages??0)+1,threads:(a?.threads??0)+ +(i===null)}}})}if(t.type===`actor.seen`){let{actor:e,kind:r,handle:i,name:a,avatar:o}=t.payload;n={...n,actors:{...n.actors,[e]:{kind:ou(r),handle:i,name:a,avatar:o}}}}return{...n,cursor:t.cursor}}function em(e,t,n,r){return{...e,ops:{...e.ops,[t]:[...e.ops[t]??[],{id:n,op:r}]}}}function tm(e,t,n){let r=(e.ops[t]??[]).filter(e=>e.id!==n),i={...e.ops};return r.length>0?i[t]=r:delete i[t],{...e,ops:i}}function nm(e,t,n=(/* @__PURE__ */ new Date()).toISOString()){let r=e.messages[t];if(!r)return;let i=r;for(let{op:r}of e.ops[t]??[])i=Xp(i,r,e.me?.actor??``,n);let a=e.actors[r.by.actor];return a?{...i,author:a}:i}const rm=(e,t)=>e.createdAt<t.createdAt?-1:e.createdAt>t.createdAt?1:e.id.localeCompare(t.id,void 0,{numeric:!0});function im(e,t){let n=[],r=/* @__PURE__ */ new Map;for(let i of Object.values(e.messages)){if(i.channel!==t)continue;let a=nm(e,i.id);i.re===null?n.push(a):r.set(i.re,[...r.get(i.re)??[],a])}return n.sort(rm),{threads:n.map(t=>({root:t,replies:(r.get(t.id)??[]).sort(rm),pending:e.pending.filter(e=>e.re===t.id)})),pending:e.pending.filter(e=>e.channel===t&&e.re===null)}}function am(e,t){let n=nm(e,t);return n?{root:n,replies:Object.values(e.messages).filter(e=>e.re===t).sort(rm).map(t=>nm(e,t.id)),pending:e.pending.filter(e=>e.re===t)}:null}function om(e,t=200,n=()=>!0){return Object.values(e.messages).filter(n).sort((e,t)=>rm(t,e)).slice(0,t).reverse().map(t=>nm(e,t.id))}const sm=e=>!!(e.from||e.text||e.label.length);function cm(e,t){let n=t.indexOf(`=`);if(n===-1)return t in e;let r=t.slice(0,n);return r in e&&t.slice(n+1).split(`|`).includes(e[r])}function lm(e,t,n){if(n.from&&(t.from??`board`)!==n.from||n.text&&!t.text.toLowerCase().includes(n.text.toLowerCase()))return!1;let r=t.re===null?void 0:e.messages[t.re];return n.label.every(e=>cm(t.labels,e)||r!==void 0&&cm(r.labels,e))}function um(e){let t=/* @__PURE__ */ new Map;for(let n of Object.values(e.messages))for(let[e,r]of Object.entries(n.labels)){let n=t.get(e);n||t.set(e,n=/* @__PURE__ */ new Set),n.add(r)}return t}const dm=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString();function fm(e,t,n=!1){return!!e&&!n&&!e.deleted&&e.by.actor===t.by.actor&&e.channel===t.channel&&e.re===t.re&&dm(e.createdAt,t.createdAt)&&Date.parse(t.createdAt)-Date.parse(e.createdAt)<3e5}const pm=document.querySelector(`meta[name="inspect-token"]`)?.content??``;let mm=Jp;const hm=/* @__PURE__ */ new Set;function gm(e){let t=e(mm);if(t!==mm){mm=t;for(let e of hm)e()}}function _m(){return(0,O.useSyncExternalStore)(e=>(hm.add(e),()=>hm.delete(e)),()=>mm)}const vm=()=>mm,ym=`board.profile`;let bm=(()=>{try{let e=localStorage.getItem(ym);return e===null?void 0:JSON.parse(e)}catch{return}})();const xm=()=>bm,Sm=qp({backend:Of(`${location.origin}/board`,{fetch:async(e,t)=>{let n=new Headers(t?.headers);n.set(`x-inspect-token`,pm),bm!==void 0&&n.set(`x-inspect-profile`,bm??``);let r=String(e).includes(`/board/events`);r&&gm(e=>e.live===`reconnecting`?e:{...e,live:`live`});try{let i=await fetch(e,{...t,headers:n});return r&&gm(e=>({...e,live:i.ok?`live`:`reconnecting`})),i}catch(e){throw r&&!t?.signal?.aborted&&gm(e=>({...e,live:`reconnecting`})),e}}})});async function Cm(e){let t=bm;bm=e;try{e===void 0?localStorage.removeItem(ym):localStorage.setItem(ym,JSON.stringify(e))}catch{}try{let e=await Sm.me();gm(t=>({...t,me:e}))}catch(e){bm=t,jm(`couldn't switch: ${Nm(e)}`)}}let wm=null;const Tm=/* @__PURE__ */ new Set;function Em(e){wm=e,Tm.forEach(e=>e())}function Dm(){return(0,O.useSyncExternalStore)(e=>(Tm.add(e),()=>Tm.delete(e)),()=>wm)}let Om=[];const km=/* @__PURE__ */ new Set;let Am=0;function jm(e){let t=++Am;Om=[...Om,{id:t,text:e}],km.forEach(e=>e()),setTimeout(()=>{Om=Om.filter(e=>e.id!==t),km.forEach(e=>e())},6e3)}function Mm(){return(0,O.useSyncExternalStore)(e=>(km.add(e),()=>km.delete(e)),()=>Om)}const Nm=e=>e instanceof Error?e.message:String(e),Pm=/* @__PURE__ */ new Map;function Fm(e,t){let n=Pm.get(e);return n||(n=t().catch(t=>{Pm.delete(e),jm(Nm(t))}),Pm.set(e,n)),n}async function Im(){let[e,t,n,r]=await Promise.all([Sm.me(),Sm.discovery().catch(()=>null),Sm.channels(),Sm.messages({limit:200})]);gm(i=>Zp({...i,me:e,discovery:t,channels:Object.fromEntries(n.map(e=>[e.path,e])),cursor:r.cursor},r.messages)),Lm(r.cursor)}async function Lm(e){let t=[],n=!1,r=()=>{n=!1;let e=t;t=[],gm(t=>e.reduce($p,t))};try{for await(let i of Sm.events({all:!0,after:e}))t.push(i),n||(n=!0,requestAnimationFrame(r))}catch(e){gm(e=>({...e,live:`reconnecting`})),jm(`live updates stopped: ${Nm(e)}`)}}const Rm=/* @__PURE__ */ new Set,zm=e=>Fm(`channel:${e}`,async()=>{let t=await Sm.messages({channel:e,limit:200});t.messages.length<200&&Rm.add(e),gm(e=>Zp(e,t.messages))});async function Bm(e){let t=Object.values(mm.messages).filter(t=>t.channel===e).sort(rm)[0];if(Rm.has(e)||!t)return!1;try{let n=await Sm.messages({channel:e,before:t.id,limit:200});return n.messages.length<200&&Rm.add(e),gm(e=>Zp(e,n.messages)),!Rm.has(e)}catch(e){return jm(Nm(e)),!0}}const Vm=e=>Fm(`thread:${e}`,async()=>{let{message:t,replies:n}=await Sm.thread(e);gm(e=>Zp(e,[t,...n]))}),Hm=e=>Sm.inbox(e,{limit:100}),Um=(e,t)=>Fm(`filtered:${e??`*`}:${JSON.stringify(t)}`,async()=>{let n=await Sm.messages({...e?{channel:e}:{},...t.from?{from:t.from}:{},...t.text?{text:t.text}:{},...t.label.length>0?{label:t.label}:{},limit:200});gm(e=>Zp(e,n.messages));let r=[...new Set(n.messages.flatMap(e=>e.re!==null&&!mm.messages[e.re]?[e.re]:[]))].slice(0,30);await Promise.all(r.map(e=>Vm(e)))}),Wm=/* @__PURE__ */ new Map;async function Gm(e,t=crypto.randomUUID()){let n=e.files??Wm.get(t)??[];Wm.set(t,n);let r={channel:e.channel,re:e.re,text:e.text,noSync:e.noSync,labels:e.labels,...n.length?{files:n.map(e=>({name:e.name,size:e.size}))}:{},key:t,createdAt:(/* @__PURE__ */ new Date()).toISOString(),error:null};gm(e=>({...e,pending:[...e.pending.filter(e=>e.key!==t),r]}));try{let r=await Promise.all(n.map(e=>Sm.upload({data:e,name:e.name}))),i={text:e.text,id:t,...r.length?{attachments:r}:{},...e.noSync?{noSync:!0}:{},...Object.keys(e.labels).length>0?{labels:e.labels}:{}},a=e.re===null?await Sm.post(e.channel,i):await Sm.reply(e.re,i);Wm.delete(t),gm(e=>Zp({...e,pending:e.pending.filter(e=>e.key!==t)},[a]))}catch(e){gm(n=>({...n,pending:n.pending.map(n=>n.key===t?{...n,error:Nm(e)}:n)}))}}const Km=({files:e,...t})=>Gm(t,t.key),qm=/* @__PURE__ */ new Map;function Jm(e){let t=qm.get(e);return t||(t=Sm.download(e).then(async e=>URL.createObjectURL(await e.blob())),t.catch(()=>qm.delete(e)),qm.set(e,t)),t}async function Ym(e){try{let t=document.createElement(`a`);t.href=await Jm(e.id),t.download=e.name,t.click()}catch(t){jm(`couldn't download ${e.name}: ${Nm(t)}`)}}const Xm=e=>{Wm.delete(e),gm(t=>({...t,pending:t.pending.filter(t=>t.key!==e)}))};async function Zm(e,t,n){let r=crypto.randomUUID();gm(n=>em(n,e,r,t));try{await n(),setTimeout(()=>gm(t=>tm(t,e,r)),8e3)}catch(t){gm(t=>tm(t,e,r)),jm(Nm(t))}}const Qm=(e,t,n)=>Zm(e,{kind:`react`,emoji:t,remove:n},()=>Sm.react(e,t,{remove:n})),$m=(e,t)=>Zm(e,{kind:`edit`,text:t},()=>Sm.edit(e,t)),eh=e=>Zm(e,{kind:`delete`},()=>Sm.delete(e)),th=(e,t,n)=>Zm(e,{kind:`label`,set:t,unset:n},()=>Sm.label(e,{set:t,unset:n}));function nh(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}const rh=nh(`https://base-ui.com/production-error`,`Base UI`);function ih({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=O.useRef(e!==void 0),[a,o]=O.useState(t);return[i&&e!==void 0?e:a,O.useCallback(e=>{i||o(e)},[])]}const J=typeof document<`u`?O.useLayoutEffect:()=>{};function ah(e){let t=O.useRef(!0);t.current&&(t.current=!1,e())}const oh={...O},sh={};function ch(e,t){let n=O.useRef(sh);return n.current===sh&&(n.current=e(t)),n}const lh=oh.useInsertionEffect,uh=lh&&lh!==oh.useLayoutEffect?lh:e=>e();function Y(e){let t=ch(dh).current;return t.next=e,uh(t.effect),t.trampoline}function dh(){let e={next:void 0,callback:fh,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function fh(){}function ph(e,t,n,r){let i=ch(hh).current;return gh(i,e,t,n,r)&&vh(i,[e,t,n,r]),i.callback}function mh(e){let t=ch(hh).current;return _h(t,e)&&vh(t,e),t.callback}function hh(){return{callback:null,cleanup:null,refs:[]}}function gh(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function _h(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function vh(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function yh(e){let t=ch(bh,e).current;return t.next=e,J(t.effect),t}function bh(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const xh={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Sh={...xh,position:`fixed`,top:0,left:0},Ch={...xh,position:`absolute`};
350
+ `);let r=a,o;for(;;){for(let e of r.events)s(`id: ${e.cursor}\nevent: board\ndata: ${JSON.stringify(e)}\n\n`);r.cursor!==(r.events.at(-1)?.cursor??o)&&s(`id: ${r.cursor}\n\n`),o=r.cursor;let a=l-Date.now();if(u.aborted||a<=0)break;r=await n.events(i?await i():e,{...t,after:o,wait:Math.min(300,a/1e3)},u)}}catch(e){u.aborted||console.error(`[board] feed failed`,e)}finally{clearInterval(c);try{r.close()}catch{}}},cancel(){c.abort()}});return new Response(d,{headers:{"content-type":`text/event-stream`,"cache-control":`no-cache, no-transform`,connection:`keep-alive`}})}async function ae(e,t,r){let{projectId:o,teamId:s}=await i.discoveryIdentity(e.headers),c=n.keeps?(await n.discovery(Kp,{},r)).sync:Object.entries(a).map(([e,t])=>({key:e,platform:t.platform}));return{version:Kd,url:t,audience:t,team_id:s,project_id:o,sync:c}}async function z(e,r){try{let s=new URL(e.url),u=c(e.method,s.pathname);if(!u)throw Vd(`no route: ${e.method} ${s.pathname}`);let{target:d}=u;!r&&!u.root&&(l.learned===null||l.learned.startsWith(`${u.base}/`))&&(l.learned=u.base);let f=(t.url??`${s.origin}${u.base}`).replace(/\/+$/,``);if(d.kind===`board`&&d.name===`webhook`){if(!o||!a[u.params.key??``])throw Vd(`no sync entry named ${u.params.key}`);return await o.handleWebhook(u.params.key,e)}if(d.kind===`board`&&(d.name===`signIn`||d.name===`signedIn`))return await te(d.name,s,e.signal);if(d.kind===`board`&&d.name===`avatar`){let e=u.param??``;if(!lp.includes(e))throw Vd(`no avatar: ${e}`);return new Response(Mp(e),{headers:{"content-type":`image/svg+xml`,"cache-control":`public, max-age=86400`}})}if(d.kind===`board`&&d.name===`openapi`)return Ud(nf());if(d.kind===`backend`)return await d.route.handle(e,{caller:r&&`platform`in r?o.caller:r,param:u.param});if(!r&&!i.open)throw _();if(!r&&d.kind===`protocol`&&d.name===`discovery`)return Ud(await ae(e,f,e.signal));if(d.kind===`protocol`&&typeof n[d.name]!=`function`)throw Vd(`no route: ${e.method} ${s.pathname}`);let p=r&&`platform`in r?o.caller:r,m=p?null:h(e,f),v=p??await g(m);if(d.kind===`board`)return await ne(d.name,v,e,s,u.params);let y=await Hp(d.name,e,s,u.params);if(d.name===`events`&&(e.headers.get(`accept`)??``).includes(`text/event-stream`))return await ie(v,y,e,m?()=>g(m):null);let b=r&&`platform`in r?await L(d.name,r,y,e.signal):await R(d.name,v,y,e.signal);return d.name===`attachment`?Vp(b):Ud(b,zp.has(d.name)?201:200)}catch(e){return Gd(e)}}return{dispatch:z,async inject(e,t,n,r){if(n!==null&&e.method===`POST`&&new URL(e.url).pathname.endsWith(`/messages`)){let t=await e.json()??{};t.id??=await Nd(`board-inbound`,n,`client`,String(r.made++)),e=new Request(e.url,{method:`POST`,headers:e.headers,body:JSON.stringify(t)})}return z(e,t)},async run(e,t,{trigger:n,attempt:r}){if(e===`@sync`&&o)return o.deliver(t,{attempt:r});let i=p[e];if(!i)throw Error(`this board has no watcher ${e}`);await i.run({event:t,board:f({self:e,origin:{via:{kind:`watcher`,id:e}}},n)})},async receive(e,t,{id:n,attempt:r}){if(!o)throw Error(`this board has no sync, so nothing reads ${e}'s inbox`);await o.receive(e,t,{id:n,attempt:r})},pull:()=>o?o.pull():Promise.resolve(0),async readSource(e,t,n){if(!o||!a[e])throw Vd(`this board doesn't run sync entry ${e}: read it where its sync runs`,`not_synced_here`);return o.readSource(e,t,n)},async joinSource(e,t){if(!o||!a[e])throw Vd(`this board doesn't run sync entry ${e}: join it where its sync runs`,`not_synced_here`);return o.joinSource(e,t)},typing:async(e,t)=>o?o.typing(e,t):[]}}function Jp(e,t){let n=e.backend??t.http(),r=kp(e,n.keeps,t.serving),i=e.watch??{},a=e.sync??{},o={learned:null},s=`http://in-process.board${(e.basePath??``).replace(/\/+$/,``)}`;function c(){if(e.url)return e.url.replace(/\/+$/,``);let t=typeof process>`u`?void 0:process.env,n=t?.VERCEL_ENV===`production`?t.VERCEL_PROJECT_PRODUCTION_URL:t?.VERCEL_URL,r=e.basePath??o.learned;return n&&r!==null?`https://${n}${r}`.replace(/\/+$/,``):null}let l=null;function u(){return l??=qp(_),l.catch(()=>l=null),l}function d(e,t){let n={made:0};return kd({url:s,token:`in-process`,fetch:(async(r,i)=>(await u()).inject(new Request(r,i),e,t,n))})}let f=async e=>(await u()).dispatch(e,null);function p(e,t){let n={...e,fetch:f,as:g};return t&&Object.defineProperty(n,"url",{get:t,enumerable:!0}),n}function m(e,t){let n=d(e,t);if(`identity`in e)return p({...n,events:(e,t)=>Yp(n,e,t)},()=>c()??s);let r=e.origin.via?.kind??`client`,i=t=>Nd(`board-${r===`watcher`?`watch`:r}`,e.self??``,t),a=async e=>typeof e==`string`||e.id===void 0?e:{...e,id:await i(e.id)};return p({...n,post:async(e,t)=>n.post(e,await a(t)),reply:async(e,t)=>n.reply(e,await a(t)),posted:async e=>n.posted(await i(e)),request:(e,t={})=>{let{as:r,...i}=t;return r===void 0?n.request(e,i):g(r).request(e,i)},events:(e,t)=>Yp(n,e,t)},()=>c()??s)}let h=e=>{let t=e===null?null:typeof e==`string`?e:e.name;return{self:t,profile:e,origin:{via:{kind:`client`,name:t}}}};function g(e){return m(h(e),null)}let _={options:e,backend:n,runtime:t,policy:r,state:o,ownUrl:c,clientAs:d,handleOf:m},v=Object.fromEntries(Object.entries(i).map(([e,t])=>[e,{kind:`tail`,tail:t.tail,when:t.when??`matches`}]));Object.keys(a).length>0&&(v[`@sync`]={kind:`sync`});let y=Object.entries(a).map(([e,t])=>({key:e,platform:t.platform,signIn:t.users!==null})),b={subscriptions:v,run:async(e,t,n)=>(await u()).run(e,t,n),receive:async(e,t,n)=>(await u()).receive(e,t,n),pull:async()=>y.length>0?(await u()).pull():0,sync:y,readSource:async(e,t,n)=>(await u()).readSource(e,t,n),joinSource:async(e,t)=>(await u()).joinSource(e,t),locate:e=>{let t=/* @__PURE__ */ new Map;for(let n of Object.values(a)){let r=n.locate(e);r&&t.set(JSON.stringify([n.platform,r.thread,r.message]),{platform:n.platform,...r})}return[...t.values()]},linkOf:async(e,t,n)=>{let r=Object.hasOwn(a,e)?a[e]:void 0;return!r||!t.startsWith(`${e}:`)?null:r.url(t.slice(e.length+1),n).catch(()=>null)},typing:async(e,t)=>(await u()).typing(e,t),accessNow:e=>r.accessNow(e),project:()=>r.project(),handle:e=>m(e,null),url:c};return n.bind(b),m({self:null,origin:{via:{kind:`client`,name:null}}},null)}async function*Yp(e,t={},n={}){let r=t.after,i=0;for(;!n.signal?.aborted;){let a;try{a=await e.poll({...t,...r===void 0?{}:{after:r},wait:25},n.signal)}catch(e){if(n.signal?.aborted)return;if(e instanceof bd&&e.status>=400&&e.status<500)throw e;await new Promise(e=>setTimeout(e,Math.min(3e4,500*2**i++)));continue}i=0;for(let e of a.events)if(yield e,n.signal?.aborted)return;r=a.cursor}}function Xp(e={}){return Jp(e,{http:()=>jf(),sync:()=>import(`./engine.js`),serving:null})}const Zp={me:null,discovery:null,channels:{},messages:{},ops:{},pending:[],actors:{},cursor:null,live:`connecting`};function Qp(e,t,n){switch(t.kind){case`react`:{let r=(e.reactions[Ee(t.emoji)]??[]).includes(n);return t.remove?!r:r||e.deleted}case`edit`:return e.text===t.text||e.deleted;case`delete`:return e.deleted;case`label`:return e.deleted||Object.entries(t.set).every(([t,n])=>e.labels[t]===n)&&t.unset.every(t=>!(t in e.labels))}}function $p(e,t,n,r){switch(t.kind){case`react`:{let r=Ee(t.emoji),i=(e.reactions[r]??[]).filter(e=>e!==n),a={...e.reactions,[r]:t.remove?i:[...i,n]};return a[r].length===0&&delete a[r],{...e,reactions:a}}case`edit`:return{...e,text:t.text,editedAt:r};case`delete`:return{...e,deleted:!0,text:``,reactions:{},mentions:[]};case`label`:{let n={...e.labels,...t.set};for(let e of t.unset)delete n[e];return{...e,labels:n}}}}function em(e,t){let n=e.messages,r=e.ops;for(let i of t){if((n[i.id]?.version??-1)>i.version)continue;n===e.messages&&(n={...n}),n[i.id]=i;let t=r[i.id];if(t&&e.me){let n=t.filter(({op:t})=>!Qp(i,t,e.me.actor));n.length!==t.length&&(r={...r},n.length>0?r[i.id]=n:delete r[i.id])}}return n===e.messages&&r===e.ops?e:{...e,messages:n,ops:r}}function tm(e,t){if(t.by.actor===e.me?.actor)return e.pending.find(e=>e.error===null&&e.channel===t.channel&&e.re===t.re&&e.text===t.text)}function nm(e,t){let n=t.message?em(e,[t.message]):e;if(t.type===`message.posted`&&t.message){let e=tm(n,t.message);e&&(n={...n,pending:n.pending.filter(t=>t!==e)});let{channel:r,re:i}=t.message,a=n.channels[r];(!a||a.lastIndex<t.message.version)&&(n={...n,channels:{...n.channels,[r]:{path:r,lastIndex:t.message.version,messages:(a?.messages??0)+1,threads:(a?.threads??0)+ +(i===null)}}})}if(t.type===`actor.seen`){let{actor:e,kind:r,handle:i,name:a,avatar:o}=t.payload;n={...n,actors:{...n.actors,[e]:{kind:su(r),handle:i,name:a,avatar:o}}}}return{...n,cursor:t.cursor}}function rm(e,t,n,r){return{...e,ops:{...e.ops,[t]:[...e.ops[t]??[],{id:n,op:r}]}}}function im(e,t,n){let r=(e.ops[t]??[]).filter(e=>e.id!==n),i={...e.ops};return r.length>0?i[t]=r:delete i[t],{...e,ops:i}}function am(e,t,n=(/* @__PURE__ */ new Date()).toISOString()){let r=e.messages[t];if(!r)return;let i=r;for(let{op:r}of e.ops[t]??[])i=$p(i,r,e.me?.actor??``,n);let a=e.actors[r.by.actor];return a?{...i,author:a}:i}const om=(e,t)=>e.createdAt<t.createdAt?-1:e.createdAt>t.createdAt?1:e.id.localeCompare(t.id,void 0,{numeric:!0});function sm(e,t){let n=[],r=/* @__PURE__ */ new Map;for(let i of Object.values(e.messages)){if(i.channel!==t)continue;let a=am(e,i.id);i.re===null?n.push(a):r.set(i.re,[...r.get(i.re)??[],a])}return n.sort(om),{threads:n.map(t=>({root:t,replies:(r.get(t.id)??[]).sort(om),pending:e.pending.filter(e=>e.re===t.id)})),pending:e.pending.filter(e=>e.channel===t&&e.re===null)}}function cm(e,t){let n=am(e,t);return n?{root:n,replies:Object.values(e.messages).filter(e=>e.re===t).sort(om).map(t=>am(e,t.id)),pending:e.pending.filter(e=>e.re===t)}:null}function lm(e,t=200,n=()=>!0){return Object.values(e.messages).filter(n).sort((e,t)=>om(t,e)).slice(0,t).reverse().map(t=>am(e,t.id))}const um=e=>!!(e.from||e.text||e.label.length);function dm(e,t){let n=t.indexOf(`=`);if(n===-1)return t in e;let r=t.slice(0,n);return r in e&&t.slice(n+1).split(`|`).includes(e[r])}function fm(e,t,n){if(n.from&&(t.from??`board`)!==n.from||n.text&&!t.text.toLowerCase().includes(n.text.toLowerCase()))return!1;let r=t.re===null?void 0:e.messages[t.re];return n.label.every(e=>dm(t.labels,e)||r!==void 0&&dm(r.labels,e))}function pm(e){let t=/* @__PURE__ */ new Map;for(let n of Object.values(e.messages))for(let[e,r]of Object.entries(n.labels)){let n=t.get(e);n||t.set(e,n=/* @__PURE__ */ new Set),n.add(r)}return t}const mm=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString();function hm(e,t,n=!1){return!!e&&!n&&!e.deleted&&e.by.actor===t.by.actor&&e.channel===t.channel&&e.re===t.re&&mm(e.createdAt,t.createdAt)&&Date.parse(t.createdAt)-Date.parse(e.createdAt)<3e5}const gm=document.querySelector(`meta[name="inspect-token"]`)?.content??``;let _m=Zp;const vm=/* @__PURE__ */ new Set;function ym(e){let t=e(_m);if(t!==_m){_m=t;for(let e of vm)e()}}function bm(){return(0,O.useSyncExternalStore)(e=>(vm.add(e),()=>vm.delete(e)),()=>_m)}const xm=()=>_m,Sm=`board.profile`;let Cm=(()=>{try{let e=localStorage.getItem(Sm);return e===null?void 0:JSON.parse(e)}catch{return}})();const wm=()=>Cm,Tm=Xp({backend:jf(`${location.origin}/board`,{fetch:async(e,t)=>{let n=new Headers(t?.headers);n.set(`x-inspect-token`,gm),Cm!==void 0&&n.set(`x-inspect-profile`,Cm??``);let r=String(e).includes(`/board/events`);r&&ym(e=>e.live===`reconnecting`?e:{...e,live:`live`});try{let i=await fetch(e,{...t,headers:n});return r&&ym(e=>({...e,live:i.ok?`live`:`reconnecting`})),i}catch(e){throw r&&!t?.signal?.aborted&&ym(e=>({...e,live:`reconnecting`})),e}}})});async function Em(e){let t=Cm;Cm=e;try{e===void 0?localStorage.removeItem(Sm):localStorage.setItem(Sm,JSON.stringify(e))}catch{}try{let e=await Tm.me();ym(t=>({...t,me:e}))}catch(e){Cm=t,Pm(`couldn't switch: ${Im(e)}`)}}let Dm=null;const Om=/* @__PURE__ */ new Set;function km(e){Dm=e,Om.forEach(e=>e())}function Am(){return(0,O.useSyncExternalStore)(e=>(Om.add(e),()=>Om.delete(e)),()=>Dm)}let jm=[];const Mm=/* @__PURE__ */ new Set;let Nm=0;function Pm(e){let t=++Nm;jm=[...jm,{id:t,text:e}],Mm.forEach(e=>e()),setTimeout(()=>{jm=jm.filter(e=>e.id!==t),Mm.forEach(e=>e())},6e3)}function Fm(){return(0,O.useSyncExternalStore)(e=>(Mm.add(e),()=>Mm.delete(e)),()=>jm)}const Im=e=>e instanceof Error?e.message:String(e),Lm=/* @__PURE__ */ new Map;function Rm(e,t){let n=Lm.get(e);return n||(n=t().catch(t=>{Lm.delete(e),Pm(Im(t))}),Lm.set(e,n)),n}async function zm(){let[e,t,n,r]=await Promise.all([Tm.me(),Tm.discovery().catch(()=>null),Tm.channels(),Tm.messages({limit:200})]);ym(i=>em({...i,me:e,discovery:t,channels:Object.fromEntries(n.map(e=>[e.path,e])),cursor:r.cursor},r.messages)),Bm(r.cursor)}async function Bm(e){let t=[],n=!1,r=()=>{n=!1;let e=t;t=[],ym(t=>e.reduce(nm,t))};try{for await(let i of Tm.events({all:!0,after:e}))t.push(i),n||(n=!0,requestAnimationFrame(r))}catch(e){ym(e=>({...e,live:`reconnecting`})),Pm(`live updates stopped: ${Im(e)}`)}}const Vm=/* @__PURE__ */ new Set,Hm=e=>Rm(`channel:${e}`,async()=>{let t=await Tm.messages({channel:e,limit:200});t.messages.length<200&&Vm.add(e),ym(e=>em(e,t.messages))});async function Um(e){let t=Object.values(_m.messages).filter(t=>t.channel===e).sort(om)[0];if(Vm.has(e)||!t)return!1;try{let n=await Tm.messages({channel:e,before:t.id,limit:200});return n.messages.length<200&&Vm.add(e),ym(e=>em(e,n.messages)),!Vm.has(e)}catch(e){return Pm(Im(e)),!0}}const Wm=e=>Rm(`thread:${e}`,async()=>{let{message:t,replies:n}=await Tm.thread(e);ym(e=>em(e,[t,...n]))}),Gm=e=>Tm.inbox(e,{limit:100}),Km=(e,t)=>Rm(`filtered:${e??`*`}:${JSON.stringify(t)}`,async()=>{let n=await Tm.messages({...e?{channel:e}:{},...t.from?{from:t.from}:{},...t.text?{text:t.text}:{},...t.label.length>0?{label:t.label}:{},limit:200});ym(e=>em(e,n.messages));let r=[...new Set(n.messages.flatMap(e=>e.re!==null&&!_m.messages[e.re]?[e.re]:[]))].slice(0,30);await Promise.all(r.map(e=>Wm(e)))}),qm=/* @__PURE__ */ new Map;async function Jm(e,t=crypto.randomUUID()){let n=e.files??qm.get(t)??[];qm.set(t,n);let r={channel:e.channel,re:e.re,text:e.text,noSync:e.noSync,labels:e.labels,...n.length?{files:n.map(e=>({name:e.name,size:e.size}))}:{},key:t,createdAt:(/* @__PURE__ */ new Date()).toISOString(),error:null};ym(e=>({...e,pending:[...e.pending.filter(e=>e.key!==t),r]}));try{let r=await Promise.all(n.map(e=>Tm.upload({data:e,name:e.name}))),i={text:e.text,id:t,...r.length?{attachments:r}:{},...e.noSync?{noSync:!0}:{},...Object.keys(e.labels).length>0?{labels:e.labels}:{}},a=e.re===null?await Tm.post(e.channel,i):await Tm.reply(e.re,i);qm.delete(t),ym(e=>em({...e,pending:e.pending.filter(e=>e.key!==t)},[a]))}catch(e){ym(n=>({...n,pending:n.pending.map(n=>n.key===t?{...n,error:Im(e)}:n)}))}}const Ym=({files:e,...t})=>Jm(t,t.key),Xm=/* @__PURE__ */ new Map;function Zm(e){let t=Xm.get(e);return t||(t=Tm.download(e).then(async e=>URL.createObjectURL(await e.blob())),t.catch(()=>Xm.delete(e)),Xm.set(e,t)),t}async function Qm(e){try{let t=document.createElement(`a`);t.href=await Zm(e.id),t.download=e.name,t.click()}catch(t){Pm(`couldn't download ${e.name}: ${Im(t)}`)}}const $m=e=>{qm.delete(e),ym(t=>({...t,pending:t.pending.filter(t=>t.key!==e)}))};async function eh(e,t,n){let r=crypto.randomUUID();ym(n=>rm(n,e,r,t));try{await n(),setTimeout(()=>ym(t=>im(t,e,r)),8e3)}catch(t){ym(t=>im(t,e,r)),Pm(Im(t))}}const th=(e,t,n)=>eh(e,{kind:`react`,emoji:t,remove:n},()=>Tm.react(e,t,{remove:n})),nh=(e,t)=>eh(e,{kind:`edit`,text:t},()=>Tm.edit(e,t)),rh=e=>eh(e,{kind:`delete`},()=>Tm.delete(e)),ih=(e,t,n)=>eh(e,{kind:`label`,set:t,unset:n},()=>Tm.label(e,{set:t,unset:n}));function ah(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}const oh=ah(`https://base-ui.com/production-error`,`Base UI`);function sh({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=O.useRef(e!==void 0),[a,o]=O.useState(t);return[i&&e!==void 0?e:a,O.useCallback(e=>{i||o(e)},[])]}const q=typeof document<`u`?O.useLayoutEffect:()=>{};function ch(e){let t=O.useRef(!0);t.current&&(t.current=!1,e())}const lh={...O},uh={};function dh(e,t){let n=O.useRef(uh);return n.current===uh&&(n.current=e(t)),n}const fh=lh.useInsertionEffect,ph=fh&&fh!==lh.useLayoutEffect?fh:e=>e();function J(e){let t=dh(mh).current;return t.next=e,ph(t.effect),t.trampoline}function mh(){let e={next:void 0,callback:hh,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function hh(){}function gh(e,t,n,r){let i=dh(vh).current;return yh(i,e,t,n,r)&&xh(i,[e,t,n,r]),i.callback}function _h(e){let t=dh(vh).current;return bh(t,e)&&xh(t,e),t.callback}function vh(){return{callback:null,cleanup:null,refs:[]}}function yh(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function bh(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function xh(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Sh(e){let t=dh(Ch,e).current;return t.next=e,q(t.effect),t}function Ch(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const wh={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Th={...wh,position:`fixed`,top:0,left:0},Eh={...wh,position:`absolute`};
351
351
  /**
352
352
  * @license React
353
353
  * use-sync-external-store-shim.production.js
@@ -357,7 +357,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
357
357
  * This source code is licensed under the MIT license found in the
358
358
  * LICENSE file in the root directory of this source tree.
359
359
  */
360
- var wh=/* @__PURE__ */ o((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Th=/* @__PURE__ */ o(((e,t)=>{t.exports=wh()})),Eh=/* @__PURE__ */ o((e=>{
360
+ var Dh=/* @__PURE__ */ o((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Oh=/* @__PURE__ */ o(((e,t)=>{t.exports=Dh()})),kh=/* @__PURE__ */ o((e=>{
361
361
  /**
362
362
  * @license React
363
363
  * use-sync-external-store-shim/with-selector.production.js
@@ -367,7 +367,7 @@ var wh=/* @__PURE__ */ o((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/
367
367
  * This source code is licensed under the MIT license found in the
368
368
  * LICENSE file in the root directory of this source tree.
369
369
  */
370
- var t=p(),n=Th();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}})),Dh=/* @__PURE__ */ o(((e,t)=>{t.exports=Eh()}));function Oh(e){return 19>=e}const kh=[];let Ah;function jh(){return Ah}function Mh(e){kh.push(e)}function Nh(e){let t=(t,n)=>{let r=ch(Fh).current,i;try{Ah=r;for(let e of kh)e.before(r);i=e(t,n);for(let e of kh)e.after(r);r.didInitialize=!0}finally{Ah=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ph(e){return/*#__PURE__*/ O.forwardRef(Nh(e))}function Fh(){return{didInitialize:!1}}var Ih=Th(),Lh=Dh();const Rh=Oh(19)?Vh:Hh;function zh(e,t,n,r,i){return Rh(e,t,n,r,i)}function Bh(e,t,n,r,i){let a=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Ih.useSyncExternalStore)(e.subscribe,a,a)}Mh({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=/* @__PURE__ */ new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Ih.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Vh(e,t,n,r,i){let a=jh();if(!a)return Bh(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Hh(e,t,n,r,i){return(0,Lh.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Uh=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=/* @__PURE__ */ new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return zh(this,e,t,n,r)}};function Wh(){}const Gh=Object.freeze([]),Kh=Object.freeze({});var qh=class extends Uh{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){O.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);J(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){O.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return O.useDebugValue(e),zh(this,this.selectors[e],t,n,r)}useContextCallback(e,t){O.useDebugValue(e);let n=Y(t??Wh);this.context[e]=n}useStateSetter(e){let t=O.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Jh(){return typeof window<`u`}function Yh(e){return Qh(e)?(e.nodeName||``).toLowerCase():`#document`}function Xh(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zh(e){return((Qh(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Qh(e){return Jh()?e instanceof Node||e instanceof Xh(e).Node:!1}function $h(e){return Jh()?e instanceof Element||e instanceof Xh(e).Element:!1}function eg(e){return Jh()?e instanceof HTMLElement||e instanceof Xh(e).HTMLElement:!1}function tg(e){return!Jh()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Xh(e).ShadowRoot}function ng(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function rg(e){return/^(table|td|th)$/.test(Yh(e))}function ig(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}const ag=/transform|translate|scale|rotate|perspective|filter/,og=/paint|layout|strict|content/,sg=e=>!!e&&e!==`none`;let cg;function lg(e){let t=$h(e)?pg(e):e;return sg(t.transform)||sg(t.translate)||sg(t.scale)||sg(t.rotate)||sg(t.perspective)||!dg()&&(sg(t.backdropFilter)||sg(t.filter))||ag.test(t.willChange||``)||og.test(t.contain||``)}function ug(e){let t=hg(e);for(;eg(t)&&!fg(t);){if(lg(t))return t;if(ig(t))return null;t=hg(t)}return null}function dg(){return cg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cg}function fg(e){return/^(html|body|#document)$/.test(Yh(e))}function pg(e){return Xh(e).getComputedStyle(e)}function mg(e){return $h(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hg(e){if(Yh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||tg(e)&&e.host||Zh(e);return tg(t)?t.host:t}function gg(e){let t=hg(e);return fg(t)?(e.ownerDocument||e).body:eg(t)&&ng(t)?t:gg(t)}function _g(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gg(e),i=r===e.ownerDocument?.body,a=Xh(r);if(i){let e=vg(a);return t.concat(a,a.visualViewport||[],ng(r)?r:[],e&&n?_g(e):[])}return t.concat(r,_g(r,[],n))}function vg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yg(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function bg(e){return e?.ownerDocument||document}function xg(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Sg(e){O.useEffect(e,Gh)}globalThis.requestAnimationFrame;let Cg=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}};var wg=class e{static create(){return new e}static request(e){return Cg.request(e)}static cancel(e){return Cg.cancel(e)}currentId=null;request(e){this.cancel(),this.currentId=Cg.request(()=>{this.currentId=null,e()})}cancel=()=>{this.currentId!==null&&(Cg.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel};function Tg(){let e=ch(wg.create).current;return Sg(e.disposeEffect),e}var Eg=class e{static create(){return new e}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return this.currentId!==0}clear=()=>{this.currentId!==0&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear};function Dg(){let e=ch(Eg.create).current;return Sg(e.disposeEffect),e}
370
+ var t=p(),n=Oh();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}})),Ah=/* @__PURE__ */ o(((e,t)=>{t.exports=kh()}));function jh(e){return 19>=e}const Mh=[];let Nh;function Ph(){return Nh}function Fh(e){Mh.push(e)}function Ih(e){let t=(t,n)=>{let r=dh(Rh).current,i;try{Nh=r;for(let e of Mh)e.before(r);i=e(t,n);for(let e of Mh)e.after(r);r.didInitialize=!0}finally{Nh=void 0}return i};return t.displayName=e.displayName||e.name,t}function Lh(e){return/*#__PURE__*/ O.forwardRef(Ih(e))}function Rh(){return{didInitialize:!1}}var zh=Oh(),Bh=Ah();const Vh=jh(19)?Wh:Gh;function Hh(e,t,n,r,i){return Vh(e,t,n,r,i)}function Uh(e,t,n,r,i){let a=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,zh.useSyncExternalStore)(e.subscribe,a,a)}Fh({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=/* @__PURE__ */ new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,zh.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Wh(e,t,n,r,i){let a=Ph();if(!a)return Uh(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Gh(e,t,n,r,i){return(0,Bh.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Kh=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=/* @__PURE__ */ new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Hh(this,e,t,n,r)}};function qh(){}const Jh=Object.freeze([]),Yh=Object.freeze({});var Xh=class extends Kh{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){O.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);q(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){O.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return O.useDebugValue(e),Hh(this,this.selectors[e],t,n,r)}useContextCallback(e,t){O.useDebugValue(e);let n=J(t??qh);this.context[e]=n}useStateSetter(e){let t=O.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Zh(){return typeof window<`u`}function Qh(e){return tg(e)?(e.nodeName||``).toLowerCase():`#document`}function $h(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function eg(e){return((tg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tg(e){return Zh()?e instanceof Node||e instanceof $h(e).Node:!1}function ng(e){return Zh()?e instanceof Element||e instanceof $h(e).Element:!1}function rg(e){return Zh()?e instanceof HTMLElement||e instanceof $h(e).HTMLElement:!1}function ig(e){return!Zh()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $h(e).ShadowRoot}function ag(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=gg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function og(e){return/^(table|td|th)$/.test(Qh(e))}function sg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}const cg=/transform|translate|scale|rotate|perspective|filter/,lg=/paint|layout|strict|content/,ug=e=>!!e&&e!==`none`;let dg;function fg(e){let t=ng(e)?gg(e):e;return ug(t.transform)||ug(t.translate)||ug(t.scale)||ug(t.rotate)||ug(t.perspective)||!mg()&&(ug(t.backdropFilter)||ug(t.filter))||cg.test(t.willChange||``)||lg.test(t.contain||``)}function pg(e){let t=vg(e);for(;rg(t)&&!hg(t);){if(fg(t))return t;if(sg(t))return null;t=vg(t)}return null}function mg(){return dg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dg}function hg(e){return/^(html|body|#document)$/.test(Qh(e))}function gg(e){return $h(e).getComputedStyle(e)}function _g(e){return ng(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vg(e){if(Qh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ig(e)&&e.host||eg(e);return ig(t)?t.host:t}function yg(e){let t=vg(e);return hg(t)?(e.ownerDocument||e).body:rg(t)&&ag(t)?t:yg(t)}function bg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=yg(e),i=r===e.ownerDocument?.body,a=$h(r);if(i){let e=xg(a);return t.concat(a,a.visualViewport||[],ag(r)?r:[],e&&n?bg(e):[])}return t.concat(r,bg(r,[],n))}function xg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sg(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Cg(e){return e?.ownerDocument||document}function wg(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Tg(e){O.useEffect(e,Jh)}globalThis.requestAnimationFrame;let Eg=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}};var Dg=class e{static create(){return new e}static request(e){return Eg.request(e)}static cancel(e){return Eg.cancel(e)}currentId=null;request(e){this.cancel(),this.currentId=Eg.request(()=>{this.currentId=null,e()})}cancel=()=>{this.currentId!==null&&(Eg.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel};function Og(){let e=dh(Dg.create).current;return Tg(e.disposeEffect),e}var kg=class e{static create(){return new e}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return this.currentId!==0}clear=()=>{this.currentId!==0&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear};function Ag(){let e=dh(kg.create).current;return Tg(e.disposeEffect),e}
371
371
  /**
372
372
  * @license React
373
373
  * react-jsx-runtime.production.js
@@ -377,41 +377,41 @@ var t=p(),n=Th();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}v
377
377
  * This source code is licensed under the MIT license found in the
378
378
  * LICENSE file in the root directory of this source tree.
379
379
  */
380
- var Og=/* @__PURE__ */ 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})),kg=/* @__PURE__ */ o(((e,t)=>{t.exports=Og()}));function Ag(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:jg,platform:Mg,maxTouchPoints:Ng}=Ag(),Pg=jg.toLowerCase(),Fg=Mg.toLowerCase(),Ig=/^i(os$|p)/.test(Fg)||Fg===`macintel`&&Ng>1,Lg=`android`,Rg=Fg===Lg||Pg.includes(Lg),zg=!Ig&&Fg.startsWith(`mac`);Fg.startsWith(`win`),!Rg&&/^(linux|chrome os)/.test(Fg);const Bg=zg||Ig,Vg=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Hg=!Vg&&Pg.includes(`firefox`);!Vg&&Pg.includes(`chrom`);const Ug=Bg,Wg=/jsdom|happydom/.test(Pg);function Gg(e){e.preventDefault(),e.stopPropagation()}function Kg(e){return`nativeEvent`in e}function qg(e){return e.pointerType===``&&e.isTrusted?!0:Rg&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Jg(e){return Wg?!1:!Rg&&e.width===0&&e.height===0||Rg&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Yg(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Xg(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Zg(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function X(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&tg(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Qg(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}const $g=`ArrowLeft`,e_=`ArrowRight`,t_=`data-starting-style`,n_={[t_]:``},r_={"data-ending-style":``},i_={transitionStatus(e){return e===`starting`?n_:e===`ending`?r_:null}},a_=`data-popup-open`,o_={[a_]:``},s_={[a_]:``,"data-pressed":``},c_={"data-open":``},l_={"data-closed":``},u_={"data-anchor-hidden":``},d_={open(e){return e?o_:null}},f_={open(e){return e?s_:null}},p_={open(e){return e?c_:l_},anchorHidden(e){return e?u_:null}},m_={...p_,...i_},h_=`data-trigger-disabled`;function g_(e,t){if(!$h(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(h_);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(h_);return!1}function __(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 v_(e){return e.matches(`html,body`)}function y_(e){return eg(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function b_(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)!=null}function x_(e){return e?e.getAttribute(`role`)===`combobox`&&y_(e):!1}function S_(e){if(!e||Wg)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function C_(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function w_(e,t){return t!=null&&!Yg(t)?0:typeof e==`function`?e():e}function T_(e,t,n){let r=w_(e,n);return typeof r==`number`?r:r?.[t]}function E_(e){return typeof e==`function`?e():e}function D_(e,t){return t||e===`click`||e===`mousedown`}function O_(e){return e?.includes(`mouse`)&&e!==`mousedown`}const k_=`none`,A_=`trigger-press`,j_=`trigger-hover`,M_=`trigger-focus`,N_=`item-press`,P_=`input-change`,F_=`input-clear`,I_=`focus-out`,L_=`escape-key`,R_=`list-navigation`,z_=`keyboard`,B_=`pointer`,V_=`cancel-open`,H_=`sibling-open`,U_=`imperative-action`;function Z(e,t,n,r){let i=!1,a=!1,o=r??Kh;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 W_(e,t,n){let r=n??Kh;return{reason:e,event:t??new Event(`base-ui`),...r}}var Q=kg();const G_=/*#__PURE__*/ O.forwardRef(function(e,t){let[n,r]=O.useState();J(()=>{Ug&&Vg&&r(`button`)},[]);let i={tabIndex:0,role:n};return/*#__PURE__*/ (0,Q.jsx)(`span`,{...e,ref:t,style:Sh,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),K_=Math.min,q_=Math.max,J_=Math.round,Y_=Math.floor,X_=e=>({x:e,y:e}),Z_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Q_(e,t,n){return q_(e,K_(t,n))}function $_(e,t){return typeof e==`function`?e(t):e}function ev(e){return e.split(`-`)[0]}function tv(e){return e.split(`-`)[1]}function nv(e){return e===`x`?`y`:`x`}function rv(e){return e===`y`?`height`:`width`}function iv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function av(e){return nv(iv(e))}function ov(e,t,n){n===void 0&&(n=!1);let r=tv(e),i=av(e),a=rv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=hv(o)),[o,hv(o)]}function sv(e){let t=hv(e);return[cv(e),t,cv(t)]}function cv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}const lv=[`left`,`right`],uv=[`right`,`left`],dv=[`top`,`bottom`],fv=[`bottom`,`top`];function pv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uv:lv:t?lv:uv;case`left`:case`right`:return t?dv:fv;default:return[]}}function mv(e,t,n,r){let i=tv(e),a=pv(ev(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(cv)))),a}function hv(e){let t=ev(e);return Z_[t]+e.slice(t.length)}function gv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function _v(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:gv(e)}function vv(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 yv(e,t,n){return Math.floor(e/t)!==n}function bv(e,t){return t<0||t>=e.length}function xv(e,t){return Cv(e.current,{disabledIndices:t})}function Sv(e,t){return Cv(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Cv(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Tv(e,a,r));return a}function wv(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Tv(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Y_(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Tv(e,r,s))return r}};d&&Gg(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Cv(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Cv(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}bv(e,f)&&(f=u)}if(n===`both`){let n=Y_(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Gg(t),u%o===o-1?r&&(f=Cv(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Cv(e,{startingIndex:u,disabledIndices:s}),r&&yv(f,o,n)&&(f=Cv(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),yv(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Gg(t),u%o===0?r&&(f=Cv(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Cv(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&yv(f,o,n)&&(f=Cv(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),yv(f,o,n)&&(f=u));let c=Y_(l/o)===n;bv(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Cv(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Tv(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Dv(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ev(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Dv(e,t=e?pg(e):null){return!e||!e.isConnected||!t||Ev(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}function Ov(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return tg(n)?n.host:null}function kv(e){for(let t of Array.from(e.children))if(Yh(t)===`summary`)return t;return null}function Av(e,t){let n=kv(t);return!!n&&(e===n||X(n,e))}function jv(e){let t=e?Yh(e):``;return e!=null&&e.matches(`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`)&&(t!==`summary`||e.parentElement!=null&&Yh(e.parentElement)===`details`&&kv(e.parentElement)===e)&&(t!==`details`||kv(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Mv(e){if(!jv(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ov(t)){let n=t!==e,r=Yh(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Yh(t)===`details`&&!t.open&&!Av(e,t)||t.hasAttribute(`hidden`)||!r&&!Nv(t,n))return!1}return!0}function Nv(e,t){let n=pg(e);return t?n.display!==`none`:Dv(e,n)}function Pv(e){let t=e.tabIndex;if(t<0){let t=Yh(e);if(t===`details`||t===`audio`||t===`video`||eg(e)&&e.isContentEditable)return 0}return t}function Fv(e){if(Yh(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Iv(e,t){let n=Fv(e);if(!n)return!0;let r=t.find(e=>{let t=Fv(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Fv(e);return t?.name===n.name&&t.form===n.form})===n}function Lv(e){if(eg(e)&&Yh(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return eg(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Rv(e,t){Lv(e).forEach(e=>{jv(e)&&t.push(e),Rv(e,t)})}function zv(e,t,n){Lv(e).forEach(e=>{eg(e)&&e.matches(t)&&n.push(e),zv(e,t,n)})}function Bv(e){return Mv(e)&&Pv(e)>=0}function Vv(e){let t=[];return Rv(e,t),t.filter(Mv)}function Hv(e){let t=Vv(e);return t.filter(e=>Pv(e)>=0&&Iv(e,t))}function Uv(e,t){let n=Hv(e),r=n.length;if(r===0)return;let i=Zg(bg(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Wv(e){return Uv(bg(e).body,1)||e}function Gv(e){return Uv(bg(e).body,-1)||e}function Kv(e,t){if(!e)return null;let n=Hv(bg(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function qv(e){return Kv(e,1)}function Jv(e){return Kv(e,-1)}function Yv(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function Xv(e){Hv(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Zv(e){let t=[];zv(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Qv(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Qv(e,t.id,n)])}function $v(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ey(e){return`data-base-ui-${e}`}let ty=0;function ny(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(ty);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Wh;let o=requestAnimationFrame(a);return ty=o,()=>{ty===o&&(cancelAnimationFrame(o),ty=0)}}const ry={inert:/* @__PURE__ */ new WeakMap,"aria-hidden":/* @__PURE__ */ new WeakMap},iy=`data-base-ui-inert`,ay={inert:/* @__PURE__ */ new WeakSet,"aria-hidden":/* @__PURE__ */ new WeakSet};let oy=/* @__PURE__ */ new WeakMap,sy=0;function cy(e){return ay[e]}function ly(e){return e?tg(e)?e.host:ly(e.parentNode):null}const uy=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ly(t);return e.contains(n)?n:null}).filter(e=>e!=null),dy=e=>{let t=/* @__PURE__ */ new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},fy=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Yh(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function py(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=uy(t,e),l=i?fy(t,dy(c),new Set(c)):[],u=[],d=[];if(a){let e=ry[a],n=cy(a);s=n,o=e;let r=uy(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);fy(t,dy(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(oy.get(e)||0)+1;oy.set(e,t),d.push(e),t===1&&e.setAttribute(iy,``)}),sy+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(oy.get(e)||0)-1;oy.set(e,t),t||e.removeAttribute(iy)}),--sy,sy||(ry.inert=/* @__PURE__ */ new WeakMap,ry[`aria-hidden`]=/* @__PURE__ */ new WeakMap,ay.inert=/* @__PURE__ */ new WeakSet,ay[`aria-hidden`]=/* @__PURE__ */ new WeakSet,oy=/* @__PURE__ */ new WeakMap)}}function my(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=bg(e[0]).body;return py(e,a,n,r,{mark:i})}let hy=0;function gy(e,t=`mui`){let[n,r]=O.useState(e),i=e||n;return O.useEffect(()=>{n??(hy+=1,r(`${t}-${hy}`))},[n,t]),i}const _y=oh.useId;function vy(e,t){if(_y!==void 0){let n=_y();return e??(t?`${t}-${n}`:n)}return gy(e,t)}function yy(e){if(!/*#__PURE__*/ O.isValidElement(e))return null;let t=e,n=t.props;return(Oh(19)?n?.ref:t.ref)??null}function by(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function xy(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 Sy(e,t){return typeof e==`function`?e(t):e}function Cy(e,t){return typeof e==`function`?e(t):e}const wy={};function Ty(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Dy(t);let a=Dy(e);return t&&(a=Oy(a,t)),n&&(a=Oy(a,n)),r&&(a=Oy(a,r)),i&&(a=Oy(a,i)),a}function Ey(e){if(e.length===0)return wy;if(e.length===1)return Dy(e[0]);let t=Dy(e[0]);for(let n=1;n<e.length;n+=1)t=Oy(t,e[n]);return t}function Dy(e){return My(e)?{...Ny(e,wy)}:ky(e)}function Oy(e,t){return My(t)?Ny(t,e):Ay(e,t)}function ky(e){let t={...e};for(let e in t){let n=t[e];jy(e,n)&&(t[e]=Fy(n))}return t}function Ay(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=by(e.style,r);break;case`className`:e[n]=Ly(e.className,r);break;default:e[n]=jy(n,r)?Py(e[n],r):r}}return e}function jy(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 My(e){return typeof e==`function`}function Ny(e,t){return My(e)?e(t):e??wy}function Py(e,t){return t?e?(...n)=>{let r=n[0];if(Ry(r)){let i=r;Iy(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Fy(t):e}function Fy(e){return e&&((...t)=>{let n=t[0];return Ry(n)&&Iy(n),e(...t)})}function Iy(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ly(e,t){return t?e?t+` `+e:t:e}function Ry(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function zy(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Uy(r));let i=By(t,n,r);if(n.enabled===!1)return null;let a=n.state??Kh;return Wy(e,r,i,a)}function By(e,t,n){let{className:r,style:i}=e,{state:a=Kh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Sy(r,a):void 0,d=l?Cy(i,a):void 0,f=l?xy(a,c):Kh,p=l&&s?Vy(s):void 0,m=l?by(f,p)??{}:Kh;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?mh([m.ref,yy(n),...o]):ph(m.ref,yy(n),o):ph(null,null)),l?(u!==void 0&&(m.className=Ly(m.className,u)),d!==void 0&&(m.style=by(m.style,d)),m):Kh}function Vy(e){return Array.isArray(e)?Ey(e):Ty(void 0,e)}const Hy=Symbol.for(`react.lazy`);function Uy(e){if(e?.$$typeof!==Hy)return e;let t=O.Children.toArray(e)[0];return/*#__PURE__*/ O.isValidElement(t)?t:e}function Wy(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ty(n,t.props);return e.ref=n.ref,/*#__PURE__*/ O.cloneElement(t,e)}if(e&&typeof e==`string`)return Gy(e,n);throw Error(rh(8))}function Gy(e,t){return e===`button`?/*#__PURE__*/ (0,O.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?/*#__PURE__*/ (0,O.createElement)(`img`,{alt:``,...t,key:t.key}):/*#__PURE__*/ O.createElement(e,t)}const Ky={style:{transition:`none`}},qy={fallbackAxisSide:`none`},Jy={fallbackAxisSide:`end`},Yy={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};var Xy=/* @__PURE__ */ l(h(),1);const Zy=/*#__PURE__*/ O.createContext(null),Qy=()=>O.useContext(Zy),$y=ey(`portal`);function eb(e={}){let{ref:t,container:n,componentProps:r=Kh,elementProps:i}=e,a=vy(),o=Qy()?.portalNode,[s,c]=O.useState(null),[l,u]=O.useState(null),d=Y(e=>{e!==null&&u(e)}),f=O.useRef(null);J(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Qh(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=zy(`div`,r,{ref:[t,d],props:[{id:a,[$y]:``},i]}),m=s&&p?/*#__PURE__*/ Xy.createPortal(p,s):null;return{node:l,nodeId:/*#__PURE__*/ O.isValidElement(p)?p.props.id:void 0,subtree:m}}const tb=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=eb({container:o,ref:t,componentProps:e,elementProps:c}),f=O.useRef(null),p=O.useRef(null),m=O.useRef(null),h=O.useRef(null),[g,_]=O.useState(null),v=O.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;O.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Yv(e)&&(e.type===`focusin`?v.current&&=(Zv(l),!1):(Xv(l),v.current=!0))}return yg(xg(l,`focusin`,e,!0),xg(l,`focusout`,e,!0))},[l,y]),J(()=>{l&&b===!0&&v.current&&(Zv(l),v.current=!1)},[b,l]);let S=O.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return/*#__PURE__*/ (0,Q.jsxs)(O.Fragment,{children:[d,/*#__PURE__*/ (0,Q.jsxs)(Zy.Provider,{value:S,children:[x&&l&&/*#__PURE__*/ (0,Q.jsx)(G_,{"data-type":`outside`,ref:f,onFocus:e=>{Yv(e,l)?m.current?.focus():Gv(g?g.domReference:null)?.focus()}}),x&&l&&/*#__PURE__*/ (0,Q.jsx)(`span`,{role:s,"aria-owns":u,style:Yy}),l&&/*#__PURE__*/ Xy.createPortal(a,l),x&&l&&/*#__PURE__*/ (0,Q.jsx)(G_,{"data-type":`outside`,ref:p,onFocus:e=>{Yv(e,l)?h.current?.focus():(Wv(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Z(`focus-out`,e.nativeEvent)))}})]})]})});function nb(){let e=/* @__PURE__ */ new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,/* @__PURE__ */ new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var rb=class{nodesRef={current:[]};events=nb();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}};const ib=/*#__PURE__*/ O.createContext(null),ab=/*#__PURE__*/ O.createContext(null),ob=()=>O.useContext(ib)?.id||null,sb=e=>{let t=O.useContext(ab);return e??t};function cb(e){let t=vy(),n=sb(e),r=ob();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function lb(e){let{children:t,id:n}=e,r=ob();return/*#__PURE__*/ (0,Q.jsx)(ib.Provider,{value:O.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ub(e){let{children:t,externalTree:n}=e,r=ch(()=>n??new rb).current;return/*#__PURE__*/ (0,Q.jsx)(ab.Provider,{value:r,children:t})}function db(e){return e==null?e:`current`in e?e.current:e}function fb(e,t){let n=Xh(Qg(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}let pb=[];function mb(){pb=pb.filter(e=>e.deref()?.isConnected)}function hb(e){mb(),e&&Yh(e)!==`body`&&(pb.push(new WeakRef(e)),pb.length>20&&(pb=pb.slice(-20)))}function gb(){return mb(),pb[pb.length-1]?.deref()}function _b(e){return e?Bv(e)?e:Hv(e)[0]||e:null}function vb(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Vv(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Bv(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function yb(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=Y(()=>b.current.floatingContext?.nodeId),S=i===!1,C=x_(_)&&S,w=yh(i),T=yh(a),E=yh(l),D=yh(g),k=sb(p),A=Qy(),j=O.useRef(!1),M=O.useRef(!1),N=O.useRef(!1),P=O.useRef(null),F=O.useRef(``),I=O.useRef(``),L=O.useRef(null),R=O.useRef(null),z=ph(L,f,A?.beforeInsideRef),ee=ph(R,A?.afterInsideRef),te=Dg(),ne=Dg(),re=Tg(),ie=A!=null,B=C_(v),ae=Y((e=B)=>e?Hv(e):[]),oe=Y(()=>m?.().filter(e=>e!=null)??[]);O.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&X(B,Zg(bg(B)))&&ae().length===0&&!C&&Gg(e)}return xg(bg(B),`keydown`,e)},[r,B,s,C,ae]),O.useEffect(()=>{if(r||!g)return;let e=bg(B);function t(){N.current=!1}function n(e){let t=Qg(e),n=oe(),r=X(v,t)||X(_,t)||X(A?.portalNode,t)||n.some(e=>e===t||X(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,ne.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return yg(xg(e,`pointerdown`,n,!0),xg(e,`pointerup`,t,!0),xg(e,`pointercancel`,t,!0),xg(e,`keydown`,i,!0),t)},[r,v,_,B,g,A,ne,oe]),O.useEffect(()=>{if(r||!c)return;let e=bg(B);function t(){M.current=!0,ne.start(0,()=>{M.current=!1})}function n(e){let t=Qg(e);Bv(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Qg(t);s&&n==null&&i!=null&&X(v,i)&&hb(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=oe(),f=n?.hasAttribute(ey(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,db(d),db(u)].includes(n),p=!(X(_,n)||X(v,n)||X(n,v)||X(A?.portalNode,n)||l.some(e=>e===n||X(e,n))||c.hasMatchingElement(e=>X(e,n))||f||k&&(Qv(k.nodesRef.current,a).find(e=>X(e.context?.elements.floating,n)||X(e.context?.elements.domReference,n))||$v(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,C_(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&B&&vb(B),o&&r!==_&&!Dv(i)&&Zg(e)===e.body){if(eg(B)&&(B.focus(),o===`popup`)){re.request(()=>{B.focus()});return}let e=ae(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;eg(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!M.current&&(C||n!==gb())&&(j.current=!0,h.setOpen(!1,Z(I_,t)))})}function a(){N.current||(b.current.insideReactTree=!0,te.start(0,()=>{b.current.insideReactTree=!1}))}let l=eg(_)?_:null;if(v||l)return yg(l&&xg(l,`focusout`,i),l&&xg(l,`pointerdown`,t),v&&xg(v,`focusin`,n),v&&xg(v,`focusout`,i),v&&A&&xg(v,`focusout`,a,!0))},[r,_,v,B,s,k,A,h,c,o,ae,C,x,b,te,ne,re,u,d,oe]),O.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${ey(`portal`)}]`)||[]),t=(k?$v(k.nodesRef.current,x()):[]).find(e=>x_(e.context?.elements.domReference||null))?.context?.elements.domReference,n=my([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...oe(),t,db(d),db(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=my([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,A,C,k,x,u,d,oe]),J(()=>{if(!g||r||!eg(B))return;F.current=``,I.current=``;let e=bg(B),t=Zg(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||X(B,t))return;let i=null,a=()=>(i??=ae(B),i[0]||B),o;o=r===!0||r===null?a():db(r),o||=a();let s=X(B,Zg(e));ny(o,{preventScroll:o===B,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=Zg(e);return!(t!==o&&X(B,t))}})})},[r,g,B,ae,w,E,D]),J(()=>{if(r||!B)return;let e=bg(B),t=Zg(e),n=E.current==null;hb(t);function i(e){if(e.open||(F.current=fb(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(qg(e.nativeEvent)||Jg(e.nativeEvent))j.current=!1;else{let e=!1;bg(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Yh(t)!==`body`?t:null,s=n?o||a:a||o;return s||=gb()||null,typeof i==`boolean`?s:db(i)||s||null}return()=>{y.off(`openchange`,i);let t=Zg(e),n=oe(),r=X(v,t)||n.some(e=>e===t||X(e,t))||k&&Qv(k.nodesRef.current,x(),!1).some(e=>X(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=_b(c),i=typeof o!=`boolean`;if(o&&!j.current&&eg(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,B,T,E,y,k,_,x,oe]),J(()=>{if(!Vg||g||!v)return;let e=Zg(bg(v));eg(e)&&y_(e)&&X(v,e)&&e.blur()},[g,v]),J(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),J(()=>{if(!r&&B)return vb(B),()=>{queueMicrotask(mb)}},[r,B]);let se=!r&&(!s||!C)&&(ie||s);return/*#__PURE__*/ (0,Q.jsxs)(O.Fragment,{children:[se&&/*#__PURE__*/ (0,Q.jsx)(G_,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=ae();ny(e[e.length-1])}else A?.portalNode&&(j.current=!1,Yv(e,A.portalNode)?Wv(_)?.focus():db(d??A.beforeOutsideRef)?.focus())}}),n,se&&/*#__PURE__*/ (0,Q.jsx)(G_,{"data-type":`inside`,ref:ee,onFocus:e=>{s?ny(ae()[0]):A?.portalNode&&(c&&(j.current=!0),Yv(e,A.portalNode)?Gv(_)?.focus():db(u??A.afterOutsideRef)?.focus())}})]})}function bb(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=A_}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=O.useRef(void 0),f=Tg(),p=Dg(),m=O.useMemo(()=>{function e(e,t,n,r){let i=Z(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=Yg(e.pointerType,!0)&&Jg(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Yg(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Qg(o);if(y_(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Yg(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return O.useMemo(()=>n?{reference:m}:Kh,[n,m])}function xb(){return!1}function Sb(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Cb(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=xb,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=sb(c),h=Y(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Y(()=>a),{escapeKey:y,outsidePress:b}=Sb(s),x=O.useRef(!1),S=O.useRef(!1),C=O.useRef(!1),w=O.useRef(!1),T=O.useRef(!1),E=O.useRef(``),D=O.useRef(null),k=Dg(),A=Dg(),j=Y(()=>{A.clear(),f.current.insideReactTree=!1}),M=Y(e=>{let t=f.current.floatingContext?.nodeId;return(m?Qv(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Y(e=>__(e,l.select(`floatingElement`))||__(e,l.select(`domReferenceElement`))),P=Y(e=>{o()&&l.setOpen(!1,Z(A_,e.nativeEvent))}),F=Y(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&M(`__escapeKeyBubbles`))return;let t=Kg(e)?e.nativeEvent:e,i=Z(L_,t);l.setOpen(!1,i),i.isCanceled||e.preventDefault(),!y&&!i.isPropagationAllowed&&e.stopPropagation()}),I=Y(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=Y(e=>{if(!u||!n||e.button!==0)return;let t=Qg(e.nativeEvent);X(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),R=Y(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});O.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),O.useEffect(()=>{if(!u||!n)return u||(w.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new Eg,t=new Eg,i=bg(d);function a(){e.clear(),T.current=!0}function o(){e.start(Vg?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=f.current.floatingContext?.nodeId,n=m&&Qv(m.nodesRef.current,t).some(t=>__(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=Qg(e),r=`[${ey(`inert`)}]`,i=$h(n)?n.getRootNode():null,a=Array.from((tg(i)?i:bg(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>X(e,n))))return;let s=$h(n)?n:null;for(;s&&!fg(s);){let e=hg(s);if(fg(e)||!$h(e))break;s=e}if(!(a.length&&$h(n)&&!v_(n)&&!X(n,l.select(`floatingElement`))&&a.every(e=>!X(s,e)))){if(eg(n)&&!(`touches`in e)){let t=fg(n),r=pg(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!O(e)){if(p()===`intentional`){if(e.detail!==0&&!qg(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,Z(`outside-press`,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Qg(e);if(!n)return;let r=xg(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function ee(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!O(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())}}}function te(e){if(p()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),D.current=null)}function ne(e){L(e,te)}function re(e){p()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&A(e),k.clear(),D.current=null)}function ie(e){L(e,re)}let B=yg(r&&yg(xg(i,`keydown`,F),xg(i,`compositionstart`,a),xg(i,`compositionend`,o)),_&&yg(xg(i,`click`,z,!0),xg(i,`pointerdown`,z,!0),xg(i,`pointerup`,ee,!0),xg(i,`pointercancel`,ee,!0),xg(i,`mousedown`,z,!0),xg(i,`mouseup`,ee,!0),xg(i,`touchstart`,R,{capture:!0,passive:!0}),xg(i,`touchmove`,ne,{capture:!0,passive:!0}),xg(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{B(),e.clear(),t.clear(),c(),C.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,k]);let z=O.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=O.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return O.useMemo(()=>n?{reference:z,floating:ee,trigger:z}:{},[n,z,ee])}function wb(e,t,n){let{reference:r,floating:i}=e,a=iv(t),o=av(t),s=rv(o),c=ev(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=tv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Tb(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}=$_(t,e),p=_v(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=vv(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=vv(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}}const Eb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Tb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=wb(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<50&&(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}=wb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Db=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}=$_(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ev(r),_=iv(o),v=ev(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[hv(o)]:sv(o)),x=p!==`none`;!d&&x&&b.push(...mv(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=ov(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`||_===iv(t)||T.every(e=>iv(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=iv(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{}}}},Ob=/*#__PURE__*/ new Set([`left`,`top`]);async function kb(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ev(n),s=tv(n),c=iv(n)===`y`,l=Ob.has(o)?-1:1,u=a&&c?-1:1,d=$_(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}}const Ab=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 kb(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}}}}},jb=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}=$_(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=iv(i),p=nv(f),m=u[p],h=u[f],g=(e,t)=>Q_(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}}}}}},Mb=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}=$_(e,t),u={x:n,y:r},d=iv(i),f=nv(d),p=u[f],m=u[d],h=$_(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=Ob.has(ev(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}}}},Nb=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}=$_(e,t),c=await i.detectOverflow(t,s),l=ev(n),u=tv(n),d=iv(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=K_(p-c[m],g),y=K_(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*q_(c.left,c.right):S=p-2*q_(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 Pb(e){let t=pg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=eg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=J_(n)!==a||J_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Fb(e){return $h(e)?e:e.contextElement}function Ib(e){let t=Fb(e);if(!eg(t))return X_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Pb(t),o=(a?J_(n.width):n.width)/r,s=(a?J_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Lb=/*#__PURE__*/ X_(0);function Rb(e){let t=Xh(e);return!dg()||!t.visualViewport?Lb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zb(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Xh(e)}function Bb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Fb(e),o=X_(1);t&&(r?$h(r)&&(o=Ib(r)):o=Ib(e));let s=zb(a,n,r)?Rb(a):X_(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=Xh(a),t=$h(r)?Xh(r):r,n=e,i=vg(n);for(;i&&t!==n;){let e=Ib(i),t=i.getBoundingClientRect(),r=pg(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=Xh(i),i=vg(n)}}return vv({width:u,height:d,x:c,y:l})}function Vb(e,t){let n=mg(e).scrollLeft;return t?t.left+n:Bb(Zh(e)).left+n}function Hb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vb(e,n),y:n.top+t.scrollTop}}function Ub(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Zh(r),s=t?ig(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=X_(1),u=X_(0),d=eg(r);if((d||!a)&&((Yh(r)!==`body`||ng(o))&&(c=mg(r)),d)){let e=Bb(r);l=Ib(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hb(o,c):X_(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 Wb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Gb(e){let t=mg(e),n=e.ownerDocument.body,r=q_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=q_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Vb(e),o=-t.scrollTop;return pg(n).direction===`rtl`&&(a+=q_(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function Kb(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Xh(e),a=Zh(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!dg()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Vb(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<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}function qb(e,t){let n=Bb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ib(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Jb(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Kb(e,n,t);else if(t===`document`)r=Gb(Zh(e));else if($h(t))r=qb(t,n);else{let n=Rb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vv(r)}function Yb(e,t){let n=t.get(e);if(n)return n;let r=_g(e,[],!1).filter(e=>$h(e)&&Yh(e)!==`body`),i=null,a=pg(e).position===`fixed`,o=a?hg(e):e;for(;$h(o)&&!fg(o);){let e=pg(o),t=lg(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=hg(o)}return t.set(e,r),r}function Xb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ig(t)?[]:Yb(t,this._c):[].concat(n),r],o=Jb(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=Jb(t,a[e],i);s=q_(n.top,s),c=K_(n.right,c),l=K_(n.bottom,l),u=q_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Zb(e){let{width:t,height:n}=Pb(e);return{width:t,height:n}}function Qb(e,t,n){let r=eg(t),i=Zh(t),a=n===`fixed`,o=Bb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=X_(0);if((r||!a)&&((Yh(t)!==`body`||ng(i))&&(s=mg(t)),r)){let e=Bb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Vb(i));let l=i&&!r&&!a?Hb(i,s):X_(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 $b(e){return pg(e).position===`static`}function ex(e,t){if(!eg(e)||pg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Zh(e)===n&&(n=n.ownerDocument.body),n}function tx(e,t){let n=Xh(e);if(ig(e))return n;if(!eg(e)){let t=hg(e);for(;t&&!fg(t);){if($h(t)&&!$b(t))return t;t=hg(t)}return n}let r=ex(e,t);for(;r&&rg(r)&&$b(r);)r=ex(r,t);return r&&fg(r)&&$b(r)&&!lg(r)?n:r||ug(e)||n}const nx=async function(e){let t=this.getOffsetParent||tx,n=this.getDimensions,r=await n(e.floating);return{reference:Qb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rx(e){return pg(e).direction===`rtl`}const ix={convertOffsetParentRelativeRectToViewportRelativeRect:Ub,getDocumentElement:Zh,getClippingRect:Xb,getOffsetParent:tx,getElementRects:nx,getClientRects:Wb,getDimensions:Zb,getScale:Ib,isElement:$h,isRTL:rx};function ax(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ox(e,t,n){let r=null,i,a=Zh(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=Y_(d),h=Y_(a.clientWidth-(u+f)),g=Y_(a.clientHeight-(d+p)),_=Y_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:q_(0,K_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ax(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=Xh(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function sx(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=Fb(e),u=i||a?[...l?_g(l):[],...t?_g(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ox(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?Bb(e):null;c&&g();function g(){let t=Bb(e);h&&!ax(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)}}const cx=Ab,lx=jb,ux=Db,dx=Nb,fx=Mb,px=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i=n??{},a={...ix,...i.platform,_c:r};return Eb(e,t,{...i,platform:a})};var mx=typeof document<`u`?O.useLayoutEffect:function(){};function hx(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(!hx(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)&&!hx(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function gx(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _x(e,t){let n=gx(e);return Math.round(t*n)/n}function vx(e){let t=O.useRef(e);return mx(()=>{t.current=e}),t}function yx(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]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);hx(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=O.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=O.useRef(null),C=O.useRef(null),w=O.useRef(u),T=c!=null,E=vx(c),D=vx(i),k=vx(l),A=O.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),px(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!hx(w.current,t)&&(w.current=t,Xy.flushSync(()=>{d(t)}))})},[f,t,n,D,k]);mx(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=O.useRef(!1);mx(()=>(j.current=!0,()=>{j.current=!1}),[]),mx(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,A);A()}},[b,x,A,E,T]);let M=O.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=O.useMemo(()=>({reference:b,floating:x}),[b,x]),P=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=_x(N.floating,u.x),r=_x(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...gx(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}const bx=(e,t)=>{let n=cx(e);return{name:n.name,fn:n.fn,options:[e,t]}},xx=(e,t)=>{let n=lx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sx=(e,t)=>({fn:fx(e).fn,options:[e,t]}),Cx=(e,t)=>{let n=ux(e);return{name:n.name,fn:n.fn,options:[e,t]}},wx=(e,t)=>{let n=dx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tx={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};var Ex=class extends qh{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:nb(),nested:n,triggerElements:i},Tx),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Xg(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Dx(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=O.useRef(null);r===void 0&&f.current===null&&(f.current=new Ex({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};$h(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Ox(e,t=!1,n=!1,r=!1){let[i,a]=O.useState(e&&t?`idle`:void 0),[o,s]=O.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),J(()=>{if(!e&&o&&i!==`ending`&&n){let e=wg.request(()=>{a(`ending`)});return()=>{wg.cancel(e)}}},[e,o,i,n]),J(()=>{if(!e||t)return;let n=wg.request(()=>{a(void 0)});return()=>{wg.cancel(n)}},[t,e]),J(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=wg.request(()=>{a(`idle`)});return()=>{wg.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}let kx=null;function Ax(e){if(!kx){let e=[];kx=e,queueMicrotask(()=>{kx=null,Xy.flushSync(()=>{for(let t of e)t()})})}kx.push(e)}function jx(e,t=!1,n=!1){let r=Tg();return Y((i,a=null)=>{r.cancel();let o=db(e);if(o==null)return;let s=o,c=()=>{if(!n){Xy.flushSync(i);return}Ax(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=t_;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Mx(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Y(a),s=jx(r,n,i);O.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}const Nx={tabIndex:-1,"data-base-ui-focusable":``};function Px(e){return t=>t!==`touch`||e.current}function Fx(e,t=!1){let n=vy(),r=ob()!=null,i=ch(()=>e(n,r)).current;return Dx({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ix({handle:e,store:t}){return J(()=>e.attachStore(t),[e,t]),null}function Lx(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Rx(e,t){let n=O.useRef(null);return Y(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Lx(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Lx(t))})}function zx(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Bx(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Vx(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Rx(e,n),o=Y(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Y(e=>{a(e),e&&o(e)});return J(()=>(s(t.current),()=>s(null)),[s,t,n,e]),J(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Hx(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=O.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);J(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Z(k_);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Ux(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=Ox(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=Y(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Mx({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function Wx(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:Kh,inactiveTriggerProps:Kh,popupProps:Kh})},[e])}function Gx(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Kx=class{constructor(){this.idMap=/* @__PURE__ */ new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function qx(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ex({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Kh,inactiveTriggerProps:Kh,popupProps:Kh}}const Jx=e=>e.triggerIdProp??e.activeTriggerId,Yx=e=>e.openProp??e.open,Xx=e=>(e.popupElement?.id??e.floatingId)||void 0;function Zx(e,t){return t!==void 0&&Yx(e)&&Jx(e)===t}function Qx(e,t){return Zx(e,t)?!0:t!==void 0&&Yx(e)&&Jx(e)==null&&e.triggerCount===1}const $x={open:Yx,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Jx,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Xx,isTriggerActive:(e,t)=>t!==void 0&&Jx(e)===t,isOpenedByTrigger:(e,t)=>Zx(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Jx(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Qx(e,t)?Xx(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function eS(e){let t=O.useCallback(t=>e===void 0?Wh:e.subscribeStore(t),[e]),n=O.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Ih.useSyncExternalStore)(t,n,()=>e?.serverStore)}function tS(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=vy(),a=ob()!=null,o=ch(()=>new Ex({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Kx,floatingId:i,syncOnly:!1,nested:a})).current;return J(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=$h(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function nS(e){return rS(e,e.rootContext)}function rS(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=O.useState(null),[d,f]=O.useState(void 0),[p,m]=O.useState(void 0),h=O.useRef(null),g=sb(r),_=O.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=yx({...e,elements:{..._,...l&&{reference:l}}}),y=$h(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=O.useCallback(e=>{let t=$h(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=O.useCallback(e=>{($h(e)||e===null)&&(h.current=e,f(e)),($h(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!$h(e))&&v.refs.setReference(e)},[v.refs,f]),C=O.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=O.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=O.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=O.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return J(()=>{o&&(h.current=o)},[o]),J(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),O.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}const iS=zg&&Vg;function aS(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=O.useRef(!1),c=O.useRef(null),l=O.useRef(!0),u=Dg();O.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=Xh(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&eg(e)&&e===Zg(bg(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return yg(xg(t,`blur`,r),iS&&xg(t,`keydown`,a,!0),iS&&xg(t,`pointerdown`,o,!0))},[i,n]),O.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);$h(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=O.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Qg(t.nativeEvent);if($h(a)){if(iS&&!t.relatedTarget){if(!l.current&&!y_(a))return}else if(!S_(a))return}let o=g_(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,Z(M_,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,Z(M_,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=$h(n)&&n.hasAttribute(ey(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Zg(bg(e));(n||t!==e)&&(X(o.current.floatingContext?.refs.floating.current,t)||X(e,t)||a||g_(n??t,i.context.triggerElements)||i.setOpen(!1,Z(M_,r)))})}}},[o,r,i,u]);return O.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var oS=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Eg,this.restTimeout=new Eg,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};const sS=/* @__PURE__ */ new WeakMap;function cS(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&sS.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),sS.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function lS(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=sS.get(n);a&&a!==e&&cS(a),cS(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,sS.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function uS(e){let t=e.context.dataRef.current,n=ch(()=>t.hoverInteractionState??oS.create()).current;return t.hoverInteractionState||=n,Sg(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function dS(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=sb(),d=ob(),f=uS(a),p=Dg(),m=Y(()=>D_(l.current.openEvent?.type,f.interactedInside)),h=Y(()=>O_(l.current.openEvent?.type)),g=Y(()=>{cS(f)});J(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),O.useEffect(()=>g,[g]),J(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&$h(c)&&s){let e=c,t=s,n=bg(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return lS(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),O.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Qv(u.nodesRef.current,d).length>0)}function t(e){let t=T_(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Z(j_,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Qg(e);if(!b_(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(g_(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&$h(o)&&Qv(u.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,Z(j_,t)),u.events.emit(`floating.closed`,t)})}let y=s;return yg(y&&xg(y,`mouseenter`,c),y&&xg(y,`mouseleave`,_),y&&xg(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}const fS={current:null};function pS(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=fS,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=sb(l),y=uS(h),b=O.useRef(!1),x=yh(i),S=yh(r),C=yh(o),w=yh(n),T=yh(p),E=yh(f),D=Y(()=>D_(g.current.openEvent?.type,y.interactedInside)),k=Y(()=>T.current?.()!==!1),A=Y((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!X(e,t);if(!$h(n))return!1;let i=n;return r.hasMatchingElement(e=>X(e,i))&&(!e||!X(e,i))}),j=Y(()=>{y.handler&&=(bg(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=Y(()=>{cS(y)});return u&&(y.handleCloseOptions=i?.__options),O.useEffect(()=>j,[j]),O.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===j_,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),O.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=T_(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,Z(j_,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,Z(j_,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!$h(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Yg(y.pointerType))return;let t=E_(C.current),n=T_(S.current,`open`,y.pointerType),r=Qg(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if($h(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(X(e,r)){s=e;break}}$h(i)&&$h(o)&&!h.context.triggerElements.hasElement(i)&&X(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&$h(s)&&$h(o)&&X(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,Z(j_,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,Z(j_,e,s))}):g&&k()&&h.setOpen(!0,Z(j_,e,s)))}function i(t){if(D()){M();return}j();let n=bg(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!g_(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!X(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){X(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?xg(t,`mouseout`,o):void 0;return s?yg(xg(t,`mousemove`,r,{once:!0}),xg(t,`mouseenter`,r),xg(t,`mouseleave`,i),l):yg(xg(t,`mouseenter`,r),xg(t,`mouseleave`,i),l)},[j,M,g,S,h,n,x,y,u,A,D,a,s,C,c,v,w,d,E,k,m]),O.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!Yg(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;lS(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=E_(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,Z(j_,t,n))}y.pointerType===`touch`?Xy.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,A,a,h,C,k])}function mS(e){return Vg&&e.movementX===0&&e.movementY===0}function hS(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gS(e,t){return hS(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _S(e,t,n){return hS(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vS(e,t,n){return hS(t,n?e===$g:e===e_,e===`ArrowDown`)}function yS(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:hS(t,n?e===e_:e===$g,e===`ArrowUp`)}function bS(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,k=C_(T),A=x_(E),j=yh(k),M=ob(),N=sb(b),P=O.useRef(f),F=O.useRef(o??-1),I=O.useRef(null),L=O.useRef(!0),R=Y(e=>{i(F.current===-1?null:F.current,e)}),z=O.useRef(!!T),ee=O.useRef(w),te=O.useRef(!1),ne=O.useRef(!1),re=O.useRef(null),ie=yh(h),B=yh(w),ae=yh(o),oe=yh(y),se=Tg(),ce=Tg(),le=Y(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):re.current=ny(e,{sync:te.current,preventScroll:!0})}let t=n.current[F.current],r=ne.current;t&&e(t),(te.current?e=>e():e=>se.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});J(()=>{D.current.orientation=g},[D,g]),J(()=>{a&&(w&&T?(F.current=o??-1,P.current&&o!=null&&(ne.current=!0,R())):z.current&&(F.current=-1,R()))},[a,w,T,o,R]),J(()=>{if(a){if(!w){te.current=!1;return}if(T){if(r==null){if(te.current=!1,ae.current!=null)return;if(z.current&&(F.current=-1,le()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||_S(I.current,g,u)||l?xv(n):Sv(n),I.current=null,R())};t()}}else bv(n.current,r)||(F.current=r,le(),ne.current=!1)}}},[a,w,T,r,ae,l,n,g,u,R,le,ce]),J(()=>{if(!a||T||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=Zg(bg(E??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,T,E,N,M,d]),J(()=>{ee.current=w,z.current=!!T}),J(()=>{w||(I.current=null,P.current=f)},[w,f]);let V=r!=null,H=Y(e=>{if(!B.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ue=Y(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=Y(()=>xv(n,ie.current)),fe=Y(e=>{if(L.current=!1,te.current=!0,e.which===229||!B.current&&e.currentTarget===j.current)return;if(l&&yS(e.key,g,u,S)){gS(e.key,ue())||Gg(e),C.setOpen(!1,Z(R_,e.nativeEvent)),eg(E)&&(d?N?.events.emit(`virtualfocus`,E):E.focus());return}let t=F.current,r=xv(n,h),i=Sv(n,h);if(A||(e.key===`Home`&&(Gg(e),F.current=r,R(e)),e.key===`End`&&(Gg(e),F.current=i,R(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,R(e)),g===`both`)return}if(gS(e.key,g)){if(Gg(e),w&&!d&&Zg(e.currentTarget.ownerDocument)===e.currentTarget){F.current=_S(e.key,g,u)?r:i,R(e);return}_S(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(te.current=!1,F.current=r):F.current=Cv(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,Cv(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(te.current=!1,F.current=i):F.current=Cv(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,Cv(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),bv(n.current,F.current)&&(F.current=-1),R(e)}}),pe=O.useMemo(()=>({onFocus(e){te.current=!0,H(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){mS(e)||(te.current=!0,ne.current=!1,p&&H(e))},onPointerLeave(e){if(!B.current||!L.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&oe.current&&(re.current?.(),re.current=null,F.current=-1,R(e),!d)){let e=j.current,t=Zg(bg(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[H,B,j,p,n,R,oe,d]),me=O.useMemo(()=>d&&w&&V&&{"aria-activedescendant":`${v}-${r}`},[d,w,V,v,r]),he=O.useMemo(()=>({...A?{}:me,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=Qg(e.nativeEvent);if(t&&!X(j.current,t))return;Gg(e),C.setOpen(!1,Z(I_,e.nativeEvent)),eg(E)&&E.focus();return}fe(e)},onPointerMove(e){mS(e)||(L.current=!0)}}),[me,fe,j,A,C,w,d,E]),ge=O.useMemo(()=>{function e(e){C.setOpen(!0,Z(R_,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&qg(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&Jg(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=C.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=vS(t.key,ue(),u),a=gS(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return fe(t);if(n||m||!r){if(o){let e=gS(t.key,ue());I.current=l&&e?null:t.key}if(l){i&&(Gg(t),n?(F.current=de(),R(t)):e(t));return}a&&(ae.current!=null&&(F.current=ae.current),Gg(t),!n&&m?e(t):fe(t),n&&R(t))}},onFocus(e){C.select(`open`)&&!d&&(F.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[fe,f,de,l,R,C,m,g,ue,u,ae,d]),_e=O.useMemo(()=>({...me,...ge}),[me,ge]);return O.useMemo(()=>a?{reference:_e,floating:he,item:pe,trigger:ge}:{},[a,_e,he,ge,pe])}function xS(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=Dg(),m=O.useRef(``),h=O.useRef(u??i??-1),g=O.useRef(null),_=Y(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!Dv(n)||n?.matches(`:disabled`)?!1:o==null||!Tv(Gh,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Gg(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Gg(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=Y(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);X(n,t)||X(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});J(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=O.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return O.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}const SS=.5;function CS(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function wS(e,t,n,r,i,a,o,s,c,l){let u=!1;return CS(e,t,n,r,i,a)&&(u=!u),CS(e,t,i,a,o,s)&&(u=!u),CS(e,t,o,s,c,l)&&(u=!u),CS(e,t,c,l,n,r)&&(u=!u),u}function TS(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ES(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function DS(e={}){let{blockPointerEvents:t=!1}=e,n=new Eg,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*.010000000000000002;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Qg(r),g=r.type===`mouseleave`,_=X(u,h),v=X(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&$h(r.relatedTarget)&&X(u,r.relatedTarget))return;function y(){return!!(s&&Qv(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=ES(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=ES(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=ES(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=ES(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!TS(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?SS/2:SS*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+SS+1,o=C||T?S.bottom-SS:S.top,s=C?T?S.bottom-SS:S.top:S.bottom-SS;M=wS(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?SS/2:SS*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-SS,o=C||T?S.top+SS:S.bottom,s=C?T?S.top+SS:S.bottom:S.top+SS;M=wS(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?SS/2:SS*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+SS+1,o=w||E?S.right-SS:S.left,s=w?E?S.right-SS:S.left:S.right-SS;M=wS(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?SS/2:SS*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-SS,o=w||E?S.left+SS:S.right,s=w?E?S.left+SS:S.right:S.left+SS;M=wS(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function OS(e,t,n,r,i,a,o,s,c,l=2){let u=wv(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return bv(n.current,u)?void 0:u}const kS=/*#__PURE__*/ O.createContext(void 0),AS=/*#__PURE__*/ O.createContext(void 0),jS=/*#__PURE__*/ O.createContext(void 0),MS=/*#__PURE__*/ O.createContext(!1),NS=/*#__PURE__*/ O.createContext(``);function PS(){let e=O.useContext(kS);if(!e)throw Error(rh(22));return e}function FS(){let e=O.useContext(AS);if(!e)throw Error(rh(23));return e}function IS(){let e=O.useContext(jS);if(!e)throw Error(rh(24));return e}function LS(){return O.useContext(NS)}function RS(){return O.useContext(MS)}function zS(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}const BS=(e,t)=>Object.is(e,t);function VS(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function HS(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!zS(e,t,(e,t)=>VS(e,t,n)):e!==t}function US(e,t,n){return e?e.some(e=>e!==void 0&&VS(t,e,n)):!1}function WS(e,t,n){return e?e.findIndex(e=>e!==void 0&&VS(e,t,n)):-1}function GS(e,t){if(t!==BS)return n=>US(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function KS(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(GS(t,n)):WS(e,t,n);return i===-1?null:i}function qS(e,t,n,r,i,a){return US(r,t,i)?a!=null&&e>a&&US(r,n[a],i)?a:e:e===a?KS(n,r,i,!0):a}function JS(e,t,n){return e.filter(e=>!VS(t,e,n))}function YS(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function XS(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function ZS(e){return XS(e?.[0])}function QS(e){return ZS(e)?e.flatMap(e=>e.items):e}function $S(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(ZS(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function eC(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return YS(e)}function tC(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?YS(e.value):YS(e)}const nC={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?$S(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>VS(t,e,n)):VS(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight},rC={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},iC={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},aC={disabled:!1,...iC},oC={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},sC={invalid:void 0,name:void 0,validityData:{state:rC,errors:[],error:``,value:``,initialValue:null},setValidityData:Wh,disabled:void 0,setTouched:Wh,setDirty:Wh,setFilled:Wh,setFocused:Wh,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:aC,registerFieldControl:Wh,validation:{getValidationProps:(e,t=Kh)=>t,inputRef:{current:null},registeredInputs:/* @__PURE__ */ new Map,registerInput:Wh,getInputControl:()=>null,commit:async()=>{},change:Wh}},cC=/*#__PURE__*/ O.createContext(sC);function lC(e=!0){let t=O.useContext(cC);if(t.setValidityData===Wh&&!e)throw Error(rh(28));return t}function uC(e,t,n,r,i=!0,a){let{registerFieldControl:o}=lC(),s=ch(()=>Symbol());J(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),J(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}const dC=/*#__PURE__*/ O.createContext({elementRef:{current:null},formRef:{current:{fields:/* @__PURE__ */ new Map}},errors:{},clearErrors:Wh,validationMode:`onSubmit`,submitCountRef:{current:0}});function fC(){return O.useContext(dC)}function pC(e){return vy(e,`base-ui`)}const mC=/*#__PURE__*/ O.createContext({controlId:void 0,registerControlId:Wh,resetControlId:Wh,labelId:void 0,setLabelId:Wh,messageIds:[],setMessageIds:Wh,getDescriptionProps:e=>e});function hC(){return O.useContext(mC)}function gC(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=hC(),o=pC(),s=ch(()=>Symbol()),c=O.useRef(!1),l=O.useRef(!1),u=Y(()=>{c.current&&i!==Wh&&(c.current=!1,i(s.current,void 0))});return J(()=>{if(!n||i===Wh){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),J(()=>u,[u]),(n?r:void 0)??t??o}function _C(e){return e==null?void 0:`${e}-popup`}function vC(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function yC(e){return Array.isArray(e)?e.map(e=>yC(e)).join(`,`):e==null?``:String(e)}const bC=/* @__PURE__ */ new Map;function xC(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${yC(e.locale)}|${JSON.stringify(t)}`,r=bC.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=eC(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=eC(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=eC(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return bC.set(n,a),a}const SC=xC;function CC(e){let t=O.useRef(``),n=O.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:O.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function wC(e,t){let n=O.useRef(e),r=Y(t);J(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function TC(e,t){let{onClick:n,onPointerDown:r}=CC(Y((n,r)=>{(typeof e==`function`?e():e)||t(r||(Ig?`touch`:``))}));return O.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function EC(e){let[t,n]=O.useState(null),r=TC(e,n);return wC(e,t=>{t&&!e&&n(null)}),O.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function DC(e,t=!1){let{overflowY:n}=pg(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}const OC=Symbol(`none`),kC={value:OC,index:-1},AC=/*#__PURE__*/ O.createContext(void 0);function jC(){return O.useContext(AC)?.direction??`ltr`}function MC(e,t,n){let r=e.get(t);if(r!==void 0||n===BS)return r;for(let[r,i]of e)if(VS(r,t,n))return i}function NC(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,filterQuery:S,openOnInputClick:C=!0,autoHighlight:w=!1,keepHighlight:T=!1,highlightItemOnHover:E=!0,loopFocus:D=!0,itemToStringLabel:k,itemToStringValue:A,isItemEqualToValue:j=BS,virtualized:M=!1,inline:N=!1,fillInputOnItemPress:P=!0,modal:F=!1,limit:I=-1,autoComplete:L=`list`,formAutoComplete:R,locale:z,submitOnItemClick:ee=!1}=e,{clearErrors:te}=fC(),{setDirty:ne,validityData:re,setFilled:ie,name:B,disabled:ae,setTouched:oe,setFocused:se,validationMode:ce,validation:le}=lC(),V=jC(),H=gC({id:t}),ue=SC({locale:z}),de=Array.isArray(y)?null:y;if(de&&typeof de.label!=`function`)throw Error(rh(100));let fe=de?de.data:y,pe=de?.value,me=pe?void 0:fe,he=O.useMemo(()=>{if(!b||!pe)return;let e=QS(b),t=e.map(pe),n;return{values:t,findItem(r,i){if(!n){n=/* @__PURE__ */ new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return MC(n,r,i)}}},[b,pe]),ge=O.useMemo(()=>de?e=>de.label(e,j,e=>{let t=he?.findItem(e,j);return t==null?eC(e,k):de.itemLabel(t)}):k,[de,k,he,j]),_e=O.useMemo(()=>de?Object.assign(e=>de.itemLabel(e),{selected:e=>eC(e,ge)}):k,[de,ge,k]);function ve(e){return eC(e,ge)}let[ye,be]=O.useState(!1),[xe,Se]=O.useState(null),Ce=O.useRef(xe),we=O.useRef([]),Te=O.useRef([]),Ee=O.useRef(null),De=O.useRef(null),Oe=O.useRef(null),ke=O.useRef(null),Ae=O.useRef(null),je=O.useRef(!0),Me=O.useRef(!1),Ne=O.useRef(null),Pe=O.useRef(null),Fe=O.useRef(null),Ie=O.useRef(kC),Le=O.useRef(null),Re=O.useRef([]),ze=O.useRef(null),Be=ae||m,Ve=B??f,He=u===`multiple`,Ue=u===`single`,We=s!==void 0||o!==void 0,Ge=fe!==void 0,Ke=b!==void 0,qe;qe=w===`always`?`always`:w?`input-change`:!1;let[Je,Ye]=ih({controlled:i,default:He?r??Gh:r,name:`Combobox`,state:`selectedValue`}),Xe=O.useMemo(()=>x===null?()=>!0:x===void 0?vC(ue,_e):x,[x,ue,_e]),Ze=ch(()=>We?o??``:Ue?ve(Je):``).current,[Qe,$e]=ih({controlled:s,default:Ze,name:`Combobox`,state:`inputValue`}),[et,tt]=ih({controlled:c,default:l,name:`Combobox`,state:`open`}),nt=ZS(fe),rt=!et&&xe!==null?xe:String(Qe).trim(),it=Ue?ve(Je):``,at=Ue&&!ye&&rt!==``&&it.length===rt.length&&ue.contains(it,rt),ot=at?``:S??rt,st=Ge&&Ke&&at&&(!de||de.hasValue(Je,j)),ct=O.useMemo(()=>fe?QS(fe):Gh,[fe]),U=O.useMemo(()=>{if(b&&!st)return b;if(!fe)return Gh;if(nt){let e=fe,t=[],n=0;for(let r of e){if(I>-1&&n>=I)break;let e=I>-1?I-n:1/0,i=ot===``?r.items.slice(0,e):[];if(ot!==``)for(let t of r.items){if(i.length>=e)break;Xe(t,ot,_e)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(ot===``)return I>-1?ct.slice(0,I):ct;let e=[];for(let t of ct){if(I>-1&&e.length>=I)break;Xe(t,ot,_e)&&e.push(t)}return e},[b,st,fe,nt,ot,I,Xe,_e,ct]),lt=O.useMemo(()=>{if(he&&U===b)return he.values;let e=QS(U);return pe?e.map(e=>pe(e)):e},[U,b,he,pe]),W=ch(()=>{let e=null;return N&&et&&Ge&&u!==`none`&&(e=KS(lt,Je,j,He)),new qh({id:H,labelId:void 0,selectedValue:Je,open:et,items:me,selectionMode:u,name:Ve,form:p,disabled:Be,readOnly:h,required:g,grid:v,virtualized:M,openOnInputClick:C,itemToStringLabel:ge,isItemEqualToValue:j,modal:F,autoHighlight:qe,submitOnItemClick:ee,hasInputValue:We,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:N,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:Kh,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:Wh,setOpen:Wh,setInputValue:Wh,setSelectedValue:Wh,setIndices:Wh,handleSelection:Wh,forceMount:Wh,requestSubmit:Wh,listRef:we,labelsRef:Te,popupRef:Ee,emptyRef:Ae,inputRef:De,startDismissRef:Oe,endDismissRef:ke,keyboardActiveRef:je,chipsContainerRef:Ne,clearRef:Pe,valuesRef:Re,pointerDownItemRef:ze,selectionEventRef:Fe},nC)}).current,ut=u===`none`?Qe:Je,dt=O.useMemo(()=>u===`none`?ut:Array.isArray(Je)?Je.map(e=>tC(e,A)):tC(Je,A),[ut,A,u,Je]),ft=Y(d),pt=Y(n),mt=W.useState(`activeIndex`),ht=W.useState(`selectedIndex`),gt=W.useState(`positionerElement`),_t=W.useState(`listElement`),vt=W.useState(`triggerElement`),yt=W.useState(`inputElement`),bt=W.useState(`inputGroupElement`),xt=W.useState(`inline`),St=W.useState(`inputInsidePopup`),Ct=W.useState(`inputOwnsFormValue`),wt=Ue&&!St&&Qe===it,Tt=yh(vt),{mounted:Et,setMounted:Dt,transitionStatus:Ot}=Ox(et),{openMethod:kt,triggerProps:At}=EC(et),jt=Y(()=>dt);uC(St?Tt:De,H,ut,jt,!Be,f);let Mt=Y(()=>{fe?Te.current=lt.map(ve):W.set(`forceMounted`,!0)}),Nt=Y((e,t,n)=>{if(t===-1){if(Ie.current===kC)return;Ie.current=kC}else Ie.current={value:e,index:t};ft(e,W_(n,void 0,{index:t}))}),Pt=Y(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),W.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Nt(void 0,-1,r):Nt(Re.current[n],n,r)}),Ft=Y((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Me.current=n.reason===F_,n.reason===`input-change`){et&&xe!==null&&Se(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&be(!0),Le.current={hasQuery:e};let n=W.state.listElement;if(!W.state.virtualized&&n){let e=Ee.current;for(let t of _g(n.firstElementChild??n)){if(!eg(t)||(e?!X(e,t):t.getAttribute(`role`)===`dialog`))break;if(DC(t)){t.scrollTop=0;break}}}e&&qe&&W.state.activeIndex==null&&(et||xt)&&W.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&W.state.inputInsidePopup&&(Le.current={hasQuery:!1,selection:!0});$e(t)}}),It=Y(e=>{let t=!e&&St&&!xt&&Qe!==``&&(String(Qe).trim()===xe||Qe===it);!e&&(t||Qe===``||wt)&&be(!1),Se(null),t&&Ft(``,Z(F_))}),Lt=Y((t,n)=>{if(et!==t&&(n.reason===`escape-key`&&Ge&&lt.length===0&&!Ae.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&xe!==null&&It(n.reason===P_),!t&&ye&&(Ue?(xt||Se(rt),rt===``&&be(!1)):He&&(xt||Se(rt),St&&Pt({activeIndex:null}),(!St||xt)&&Ft(``,Z(F_,n.event,void 0,{isItemPress:n.reason===N_})))),tt(t),!t&&St&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(oe(!0),se(!1),ce===`onBlur`)))){let e=u===`none`?Qe:Je;le.commit(e)}}),Rt=Y((e,t)=>{a?.(e,t),!t.isCanceled&&(Ye(e),(u===`none`&&Ee.current&&P||Ue&&!W.state.inputInsidePopup)&&Ft(ve(e),Z(t.reason,t.event)))}),zt=Y((e,t)=>{let n=Qg(e),r=Fe.current??e;Fe.current=null;let i=Z(N_,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Lt(!1,i);return}if(He){let e=Array.isArray(Je)?Je:[],n=US(e,t,j),r=n?JS(e,t,j):[...e,t];if(Rt(r,i),i.isCanceled||!(De.current&&De.current.value.trim()!==``))return;if(W.state.inputInsidePopup){Ft(``,Z(F_,i.event,void 0,{isItemPress:!0}));let e=Le.current;e&&!n&&(e.toggledValue=t)}else Lt(!1,i)}else{if(Rt(t,i),i.isCanceled)return;Lt(!1,i)}}),Bt=Y(()=>{let e=le.inputRef.current?.form??W.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Vt=Y(()=>{if(Dt(!1),pt?.(!1),be(!1),Se(null),Pt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),He&&De.current&&De.current.value!==``&&!Me.current&&Ft(``,Z(F_)),Ue){if(W.state.inputInsidePopup)De.current&&De.current.value!==``&&Ft(``,Z(F_));else{let e=ve(Je);De.current&&De.current.value!==e&&Ft(e,Z(e===``?F_:k_))}}}),Ht=O.useMemo(()=>xt&&gt?{current:gt.closest(`[role="dialog"]`)}:Ee,[xt,gt]);Mx({enabled:!e.actionsRef,open:et,ref:Ht,onComplete(){et||Vt()}}),O.useImperativeHandle(e.actionsRef,()=>({unmount:Vt}),[Vt]),J(function(){let e=Ce.current!==null&&xe===null;if(Ce.current=xe,et&&(!e||!Ge)||(et||(ze.current=null),u===`none`))return;let t=Ge?lt:Re.current;Pt({selectedIndex:KS(t,Je,j,He)})},[et,xe,Je,u,He,Ge,lt,j,Pt]),J(()=>{fe&&(Re.current=lt,we.current.length=lt.length)},[fe,lt]),J(()=>{let e=Le.current;if(e){let t=et||xt||W.state.positionerElement?.hidden===!1;if(e.hasQuery)qe&&t&&W.set(`activeIndex`,0),Le.current=null;else if(String(Qe).trim()===``&&(Le.current=null,t)){let t=e.selection;qe===`always`&&!t&&W.state.selectionMode===`none`&&W.set(`activeIndex`,0),queueMicrotask(()=>{if(!W.state.open&&!W.state.inline||De.current&&De.current.value.trim()!==``)return;let n=W.state.selectedValue,r=W.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:W.state.selectionMode!==`none`&&n!=null){let t=Ge||Ke?lt:Re.current,i=WS(t,e.toggledValue,W.state.isItemEqualToValue);W.set(`activeIndex`,i===-1?KS(t,n,W.state.isItemEqualToValue,r):i)}else t?W.set(`activeIndex`,null):qe===`always`&&W.set(`activeIndex`,0)})}}if(!et&&!xt)return;let t=Ge||Ke?lt:Re.current,n=W.state.activeIndex;if(n==null){if(qe===`always`&&t.length>0){W.set(`activeIndex`,0);return}Nt(void 0,-1,k_);return}if(n>=t.length){Nt(void 0,-1,k_),W.set(`activeIndex`,null);return}let r=t[n],i=Ie.current.value,a=i!==OC&&VS(r,i,W.state.isItemEqualToValue);(Ie.current.index!==n||!a)&&Nt(r,n,k_)},[mt,qe,Nt,Ke,Ge,lt,xt,et,W,Qe]),J(()=>{if(u===`none`){ie(String(Qe)!==``);return}ie(He?Array.isArray(Je)&&Je.length>0:Je!=null)},[ie,u,Qe,Je,He]),O.useEffect(()=>{Ge&&qe&&lt.length===0&&Pt({activeIndex:null})},[Ge,qe,lt.length,Pt]);function Ut(){et&&rt!==``&&rt!==String(Ze)&&!wt&&be(!0)}function Wt(){et&&xe!==null&&It(!1)}let Gt=!1;function Kt(){!Gt&&Qe!==it&&(Gt=!0,Ft(it,Z(k_)))}function qt(){u!==`none`&&(te(Ve),ne(HS(Je,re.initialValue,j)),le.change(Je),Ue&&!We&&!St&&Kt())}function G(){Ue&&!We&&!St&&!ye&&Kt()}function Jt(){u===`none`&&(te(Ve),ne(Qe!==re.initialValue),le.change(Qe))}wC(rt,Ut),wC(et,Wt),wC(Je,qt),wC(it,G),wC(fe,G),wC(Qe,Jt);let Yt=tS({open:xt?!0:et,onOpenChange:Lt,elements:{reference:St?vt:yt,floating:gt}}),Xt=v?`grid`:`listbox`,Zt=et||xt,Qt=Zt?`true`:`false`,$t=O.useMemo(()=>{let e=yt?.tagName===`INPUT`,t=yt==null||e,n=t||Zt,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=Qt,r[`aria-haspopup`]=Xt,r[`aria-controls`]=Zt?_t?.id:void 0,r[`aria-autocomplete`]=h?`none`:L),{reference:r,floating:{role:`presentation`}}},[yt,Zt,Qt,Xt,_t?.id,L,h]),en=bb(Yt,{enabled:!Be&&C,event:`mousedown-only`,toggle:!1,touchOpenDelay:St?0:100,reason:`input-press`}),tn=Cb(Yt,{enabled:!Be&&!xt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:xt?!0:void 0,outsidePress(e){let t=Qg(e);return!X(vt,t)&&!X(Pe.current,t)&&!X(Ne.current,t)&&!X(bt,t)}}),nn=bS(Yt,{enabled:!Be,id:H,listRef:we,activeIndex:mt,selectedIndex:ht,virtual:!0,loopFocus:D,allowEscape:D&&!qe,focusItemOnOpen:ye||u===`none`&&!qe?!1:`auto`,focusItemOnHover:E,resetOnPointerLeave:!T,orientation:v?`horizontal`:void 0,rtl:V===`rtl`,disabledIndices:Gh,grid:v?OS:void 0,onNavigate(e,t){(t||et)&&Ot!==`ending`&&Pt(t?{activeIndex:e,type:je.current?z_:B_}:{activeIndex:e})}}),rn=O.useMemo(()=>Ty(nn.reference,{onKeyDown(e){v&&W.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},tn.reference,en.reference,$t.reference),[nn.reference,tn.reference,en.reference,$t.reference,v,W]),an=O.useMemo(()=>Ty(Nx,tn.floating),[tn.floating]),on=O.useMemo(()=>Ty(nn.floating,$t.floating),[nn.floating,$t.floating]),sn=O.useMemo(()=>{let e=nn.item;return e?{...e,onFocus:void 0}:Kh},[nn.item]);W.useContextCallback(`setOpen`,Lt),W.useContextCallback(`setInputValue`,Ft),W.useContextCallback(`setSelectedValue`,Rt),W.useContextCallback(`setIndices`,Pt),W.useContextCallback(`handleSelection`,zt),W.useContextCallback(`forceMount`,Mt),W.useContextCallback(`requestSubmit`,Bt),W.useContextCallback(`onOpenChangeComplete`,n),ah(()=>{W.update({inline:N,popupProps:an,listProps:on,inputProps:rn,triggerProps:At,itemProps:sn})});let cn={id:H,selectedValue:Je,open:et,mounted:Et,transitionStatus:Ot,items:me,inline:N,popupProps:an,listProps:on,inputProps:rn,triggerProps:At,itemProps:sn,openMethod:kt,selectionMode:u,name:Ve,form:p,disabled:Be,readOnly:h,required:g,grid:v,virtualized:M,openOnInputClick:C,itemToStringLabel:ge,modal:F,autoHighlight:qe,isItemEqualToValue:j,submitOnItemClick:ee,hasInputValue:We};J(()=>{W.update({...cn,inputOwnsFormValue:u===`none`&&(N||!W.state.inputInsidePopup)})},[W,...Object.values(cn)]);let ln=ph(_,le.inputRef),un=O.useMemo(()=>({query:rt,hasItems:Ge,filteredItems:U,flatFilteredValues:lt}),[rt,Ge,U,lt]),dn=O.useMemo(()=>Array.isArray(ut)?``:tC(ut,A),[ut,A]),fn=He&&Array.isArray(Je)&&Je.length>0,pn=He||u===`none`&&Ct?void 0:Ve,mn=O.useMemo(()=>!He||!Array.isArray(Je)||!Ve?null:Je.map(e=>{let t=tC(e,A);return/*#__PURE__*/ (0,Q.jsx)(`input`,{type:`hidden`,form:p,name:Ve,value:t,disabled:Be},t)}),[He,Je,p,Ve,A,Be]),hn=/*#__PURE__*/ (0,Q.jsxs)(O.Fragment,{children:[e.children,/*#__PURE__*/ (0,Q.jsx)(`input`,{...le.getValidationProps(Be,{onFocus(){if(St){vt?.focus();return}(De.current||vt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Be||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=Z(k_,e.nativeEvent),i=()=>Re.current.findIndex(e=>tC(e,A).toLowerCase()===n||ve(e).toLowerCase()===n);function a(){if(He)return;if(u===`none`){Ft(t,r);return}let e=i();e===-1&&(e=Re.current.findIndex((e,t)=>{let r=Te.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Re.current[e];a!=null&&Rt?.(a,r)}Ue&&(Mt(),fe&&i()===-1&&W.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:H&&pn==null?`${H}-hidden-input`:void 0,form:p,name:pn,autoComplete:R,disabled:Be,required:g&&!fn,readOnly:h,value:dn,ref:ln,style:pn?Ch:Sh,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),mn]});return/*#__PURE__*/ (0,Q.jsx)(kS.Provider,{value:W,children:/*#__PURE__*/ (0,Q.jsx)(AS.Provider,{value:Yt,children:/*#__PURE__*/ (0,Q.jsx)(MS.Provider,{value:Ge,children:/*#__PURE__*/ (0,Q.jsx)(jS.Provider,{value:un,children:/*#__PURE__*/ (0,Q.jsx)(NS.Provider,{value:Qe,children:hn})})})})})}function PC(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=(a===`inline`||a===`both`)&&!e.readOnly,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=O.useState(r??``),[p,m]=O.useState(``);O.useEffect(()=>{(u||!c)&&m(``)},[n,u,c]);let h;h=c&&p!==``?p:u?n??``:d;let g=SC({locale:s.locale}),_=String((u?n:d)??``).trim(),v=l||s.filter===null?null:s.filter??g.contains;function y(e,t){m(``),u||f(e),i?.(e,t)}function b(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?eC(t,o):``)}return/*#__PURE__*/ (0,Q.jsx)(NC,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:v,filterQuery:a===`both`?_:void 0,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:y,onItemHighlighted:b})}const FC=/*#__PURE__*/ O.createContext(void 0);function IC(e=!1){let t=O.useContext(FC);if(t===void 0&&!e)throw Error(rh(16));return t}function LC(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:O.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 RC(e,t,{detail:n=0}={}){e.dispatchEvent(new(Xh(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function zC(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=O.useRef(null),s=IC(!0),c=a??s!==void 0,{props:l}=LC({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=O.useCallback(()=>{let e=o.current;BC(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return J(u,[u]),{getButtonProps:O.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Ty({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Iy(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=BC(r),s=!i&&VC(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),RC(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),RC(r,e)))},onKeyUp(e){if(!t){if(Iy(e),a?.(e),e.target===e.currentTarget&&i&&c&&BC(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),RC(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Y(e=>{o.current=e,u()})}}function BC(e){return eg(e)&&e.tagName===`BUTTON`}function VC(e){return eg(e)&&e.tagName===`A`&&!!e.href}const HC={...f_,...oC,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null};function UC(e,t){let n=WC(t);return e.clientX>=n.left-5&&e.clientX<=n.right+5&&e.clientY>=n.top-5&&e.clientY<=n.bottom+5}function WC(e){let t=e.getBoundingClientRect(),n=Xh(e);if(Wg)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function GC(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function KC(){return IS().filteredItems.length===0}function qC(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function JC(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function YC(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}const XC=/*#__PURE__*/ O.createContext(void 0);function ZC(){return O.useContext(XC)}const QC=/*#__PURE__*/ O.createContext(void 0);function $C(e){let t=O.useContext(QC);if(t===void 0&&!e)throw Error(rh(21));return t}const ew=/*#__PURE__*/ O.forwardRef(function(e,t){let n=PS(),{buttonRef:r,getButtonProps:i}=zC({native:!1}),a=ph(t,r);function o(e){n.context.setOpen(!1,Z(`close-press`,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return/*#__PURE__*/ (0,Q.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:Ch})}),tw=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=lC(),{labelId:m}=hC(),h=ZC(),g=!!$C(!0),_=PS(),v=LS(),y=jC(),b=_.useState(`required`),x=_.useState(`disabled`),S=_.useState(`readOnly`),C=_.useState(`name`),w=_.useState(`form`),T=_.useState(`selectionMode`),E=_.useState(`autoHighlight`),D=_.useState(`inputProps`),k=_.useState(`triggerProps`),A=_.useState(`open`),j=_.useState(`mounted`),M=_.useState(`selectedValue`),N=_.useState(`id`),P=_.useState(`inline`),F=_.useState(`modal`),I=!!E,L=GC(_),R=l||x||i,z=KC(),ee=g||P,te=!ee||F,ne=pC(a??(ee?void 0:N)),re=g?iC:c,[ie,B]=O.useState(null),ae=O.useRef(!1),oe=O.useRef(null),se=O.useRef(!1),ce=T===`none`&&!g,le=Y(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,Z(k_)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ce})}),V=g?s:p.getValidationProps(R,s);function H(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?z_:B_})}function ue(){_.context.keyboardActiveRef.current=!1}let de={...re,open:A,disabled:R,readOnly:S,popupSide:L,listEmpty:z};function fe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=qC(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&M.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=JC(n,M.length),H()),t)}let pe=zy(`input`,e,{state:de,ref:[t,_.context.inputRef,le],props:[D,k,{value:ie??v,"aria-readonly":S||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:R,readOnly:S,required:T===`none`?b:void 0,form:w,...ce&&C&&{name:C},id:ne,onFocus(){if(d(!0),!P||!se.current)return;se.current=!1;let e=oe.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(P&&e!==null&&E!==`always`&&(oe.current=e,se.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:M;p.commit(e)}},onCompositionStart(e){Rg||(ae.current=!0,B(e.currentTarget.value))},onCompositionEnd(e){ae.current=!1;let t=e.currentTarget.value;B(null),_.context.setInputValue(t,Z(P_,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=ae.current||!r;function a(e){!S&&!R&&e&&i&&(_.context.setOpen(!0,Z(P_,t)),I||H())}if(ae.current){let n=e.currentTarget.value;B(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,Z(F_,t));let r=n.trim(),i=I&&r!==``;a(r),A&&_.state.activeIndex!==null&&!i&&H();return}let o=Z(P_,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=Z(F_,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),A&&_.state.activeIndex!==null&&!I&&H()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,R||S){S&&e.key===`Enter`&&A&&_.state.activeIndex!==null&&Gg(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){Gg(e);let n=Hg&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){Gg(e);let i=Hg&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!j&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=Z(L_,e.nativeEvent),r=T===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:M.length-1,r=M.filter((e,t)=>t!==n);H(),_.context.setSelectedValue(r,Z(k_,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=fe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;_.context.setOpen(!1,Z(k_,n));return}Gg(e),YC(_,t,n)}},onPointerMove:ue,onPointerDown:ue},V],stateAttributesMapping:HC}),me=g?/*#__PURE__*/ (0,Q.jsx)(cC.Provider,{value:sC,children:pe}):pe;return/*#__PURE__*/ (0,Q.jsxs)(O.Fragment,{children:[A&&te&&/*#__PURE__*/ (0,Q.jsx)(ew,{ref:_.context.startDismissRef}),me]})}),nw=/*#__PURE__*/ O.createContext(null);function rw(){return O.useContext(nw)}function iw(e){let{children:t}=e,{filteredItems:n}=IS(),r=rw(),i=r?r.items:n;return/*#__PURE__*/ (0,Q.jsx)(O.Fragment,{children:i.map(t)})}const aw=/*#__PURE__*/ O.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ow(){return O.useContext(aw)}function sw(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Y(i),[,o]=O.useState(!1),s=ch(lw).current,c=ch(cw).current,l=O.useRef(0),u=O.useRef(!0),d=O.useRef(null),f=O.useRef(null),p=Y(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Y((e,t)=>{c.set(e,t),p()}),h=Y(e=>{c.delete(e),p()}),g=Y(e=>{let t=/* @__PURE__ */ new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!fw(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&pw(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=/* @__PURE__ */ new Set;for(let t=1;t<e.length;t+=1){let r=dw(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Y(()=>{let[e,t]=uw(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});J(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),J(()=>{u.current&&v()}),J(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Y(e=>(s.add(e),()=>{s.delete(e)})),b=O.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return/*#__PURE__*/ (0,Q.jsx)(aw.Provider,{value:b,children:t})}function cw(){return/* @__PURE__ */ new Map}function lw(){return/* @__PURE__ */ new Set}function uw(e){let t=/* @__PURE__ */ new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>pw(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function dw(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function fw(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function pw(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const mw=/*#__PURE__*/ O.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=PS(),l=FS(),u=!!$C(!0),{filteredItems:d,hasItems:f}=IS(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=Y(e=>{c.set(`positionerElement`,e)}),S=Y(e=>{c.set(`listElement`,e)}),C=O.useMemo(()=>typeof o==`function`?n||=/*#__PURE__*/ (0,Q.jsx)(iw,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=zy(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;Gg(e),YC(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return/*#__PURE__*/ (0,Q.jsx)(sw,{elementsRef:c.context.listRef,labelsRef:D,children:E})});function hw(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function gw(){let e=Dg(),t=O.useRef(null);return O.useEffect(()=>{if(Ig)return;let n=t.current;if(n==null)return;let r=hw(n);if(r==null)return;let i=r.data,a=`${i}⁠`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}const _w=/*#__PURE__*/ O.createContext(void 0);function vw(){let e=O.useContext(_w);if(e===void 0)throw Error(rh(20));return e}const yw=/*#__PURE__*/ O.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=PS(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?/*#__PURE__*/ (0,Q.jsx)(_w.Provider,{value:n,children:/*#__PURE__*/ (0,Q.jsx)(tb,{ref:t,...r})}):null});function bw(e){return Oh(19)?e:e?`true`:void 0}const xw=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`}=$_(e,t)||{};if(l==null)return{};let f=_v(u),p={x:n,y:r},m=av(i),h=rv(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=Q_(k,j,A),N=!c.arrow&&tv(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Sw=(e,t)=>{let{name:n,fn:r}=xw(e);return{name:n,fn:r,options:[e,t]}},Cw={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},ww={sideX:`left`,sideY:`top`},Tw=`--available-width`,Ew=`--available-height`;function Dw(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 Ow(e,t,n){let{rects:r,placement:i}=e;return{side:Dw(t,ev(i),n),align:tv(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function kw(e){return Aw(e,nS)}function Aw(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=O.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=Y(j),N=j?M:n,P=yh(n),F=yh(g),I=jC()===`rtl`,L=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),re=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},B=O.useRef(null),ae=yh(a),oe=yh(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(bx(e=>{let t=Ow(e,i,I),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,I,i]));let V=E===`none`&&T!==`shift`,H=!V&&(u||k||T===`shift`),ue=T===`none`?null:Cx({...ie,padding:{top:z.top+1+ee,right:z.right+1+re,bottom:z.bottom+1+te,left:z.left+1+ne},mainAxis:!k&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),de=V?null:xx({...ie,rootBoundary:A,mainAxis:E!==`none`,crossAxis:H,limiter:u||k?void 0:Sx(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=iv(ev(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[ie,u,k,A,z,E]);T===`shift`||E===`shift`||o===`center`?le.push(de,ue):le.push(ue,de),le.push(wx({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(Tw,`${t}px`),i.setProperty(Ew,`${n}px`);let a=Xh(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Sw(e=>({element:B.current||bg(e.elements.floating).createElement(`div`),padding:B.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=ev(r),u=tv(r),d=iv(l)===`y`,f=B.current,p=typeof a==`function`?a(Ow(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return H&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(`--transform-origin`,d?`${m} ${h}`:`${h} ${m}`),{}}},Cw,b),J(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=O.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>sx(...e,fe),nodeId:y,externalTree:S}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||ww,Te=xe?r:`fixed`,Ee=O.useMemo(()=>{let e;return e=xe?b?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[Tw]=`100vw`,e[Ew]=`100vh`,xe||(e.opacity=0),e},[b,Te,Ce,he,we,ge,Se,xe]),De=O.useRef(null);J(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(jw(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[g,pe,N,P]),O.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&jw(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[g,pe,N,P]),O.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return sx(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=ev(ye),ke=Dw(i,Oe,I),Ae=tv(ye)||`center`,je=!!_e.hide?.referenceHidden;J(()=>{x&&g&&xe&&Oe!==L&&w(Oe)},[x,g,xe,Oe,L]);let Me=O.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return O.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:B,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,B,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function jw(e){return e!=null&&`current`in e}const Mw=/*#__PURE__*/ O.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return/*#__PURE__*/ (0,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Nw(e){return e===`starting`?Ky:Kh}function Pw(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),zy(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Nw(r),i],stateAttributesMapping:p_})}let Fw={},Iw={},Lw=``;function Rw(e,t){return ng(e)?e:t}function zw(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Rw(t,n)).overflowY)}function Bw(e){if(typeof document>`u`)return!1;let t=bg(e);return Xh(t).innerWidth-t.documentElement.clientWidth>0}function Vw(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=bg(e),n=t.documentElement,r=t.body,i=Rw(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Hw(e){let t=bg(e),n=t.documentElement,r=t.body,i=Rw(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Uw(e){let t=bg(e),n=t.documentElement,r=t.body,i=Xh(n),a=0,o=0,s=!1,c=wg.create();if(Vg&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Fw={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Lw=n.style.scrollBehavior,Iw={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Rw(n,r);if(s=Vw(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Fw),Object.assign(r.style,Iw),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Lw)}function d(){u(),c.request(l)}l();let f=xg(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}const Ww=new class{lockCount=0;restore=null;timeoutLock=Eg.create();timeoutUnlock=Eg.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=bg(e),n=t.documentElement,r=t.body,i=Xh(n);if(zw(i,n,r)){let t=new i.MutationObserver(()=>{zw(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Ig||!Bw(e);this.restore=a?Hw(e):Uw(e)}};function Gw(e=!0,t=null){J(()=>{if(e)return Ww.acquire(t)},[e,t])}function Kw(e,t,n,r){let[i,a]=O.useState(!1);J(()=>{if(!e||!t||n==null){a(!1);return}let r=bg(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-20)},[e,t,n]),Gw(e&&(!t||i),r)}const qw=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=qy,style:g,..._}=e,v=PS(),y=FS(),b=vw(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=KC(),M=kw({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});Kw(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};J(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=Y(e=>{v.set(`positionerElement`,e)}),F=Pw(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return/*#__PURE__*/ (0,Q.jsxs)(QC.Provider,{value:M,children:[C&&x&&/*#__PURE__*/ (0,Q.jsx)(Mw,{inert:bw(!S),cutout:O??D??E}),F]})}),Jw={...p_,...i_},Yw=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=PS(),l=$C(),u=FS(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=KC(),x=s.id??(g?_C(y):void 0);J(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),Mx({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S=zy(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=Qg(e.nativeEvent);p!==`touch`&&(X(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Nw(h),s],stateAttributesMapping:Jw}),C=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,w;w=o??(g?void 0:!1);let T=!g||v;return/*#__PURE__*/ (0,Q.jsx)(yb,{context:u,disabled:!d,modal:T,openInteractionType:p,initialFocus:C,returnFocus:w,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:/*#__PURE__*/ (0,Q.jsxs)(O.Fragment,{children:[S,T&&/*#__PURE__*/ (0,Q.jsx)(ew,{ref:c.context.endDismissRef})]})})});function Xw(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=ow(),u=O.useRef(-1),[d,f]=O.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=O.useRef(null),h=O.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return J(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}const Zw=/*#__PURE__*/ O.createContext(void 0),Qw=/*#__PURE__*/ O.createContext(!1);function $w(){return O.useContext(Qw)}function eT(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=O.useRef(null),m=Xw({guess:!0,index:l,textRef:p}),h=PS(),g=$w(),_=RS(),v=h.useState(`selectionMode`),y=h.useState(`disabled`),b=h.useState(`readOnly`),x=h.useState(`isItemEqualToValue`),S=y||u,C=v!==`none`,w=l??i??m.index,T=w!==-1,E=h.useState(`id`),D=h.useState(`isActive`,w),k=h.useState(`isSelected`,c),A=h.useState(`itemProps`),j=O.useRef(null),M=E!=null&&T?`${E}-${w}`:void 0,N=k&&C;J(()=>{if(!T||!r&&l==null)return;let e=h.context.listRef.current;return e[w]=j.current,()=>{delete e[w]}},[T,r,w,l,h]),J(()=>{if(!T||_)return;let e=h.context.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,_,w,c,h]),J(()=>{if(!T||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=qS(w,c,h.context.valuesRef.current,e,x,t):VS(c,e,x)&&(t=w),h.set(`selectedIndex`,t)},[T,_,h,w,c,x]);let{getButtonProps:P,buttonRef:F}=zC({disabled:S,focusableWhenDisabled:!0,native:d,composite:!0}),I={disabled:S,selected:N,highlighted:D};function L(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(Xy.flushSync(t),h.context.requestSubmit()):t()}let R={id:M,role:g?`gridcell`:`option`,"aria-selected":C?N:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||b||L(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(S||b||e.button!==0||t||!D)&&L(e.nativeEvent)}},z=zy(`div`,t,{ref:[F,n,m.ref,j],state:I,props:[A,R,f,P]}),ee=O.useMemo(()=>({selected:N,textRef:p}),[N,p]);return/*#__PURE__*/ (0,Q.jsx)(Zw.Provider,{value:ee,children:z})}function tT(e){let{componentProps:t,forwardedRef:n}=e,r=PS().useState(`isItemEqualToValue`),{flatFilteredValues:i}=IS(),a=WS(i,t.value??null,r);return/*#__PURE__*/ (0,Q.jsx)(eT,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}const nT=/* @__PURE__ */ O.memo(/*#__PURE__*/ O.forwardRef(function(e,t){let n=PS().useState(`virtualized`);return n&&e.index==null?/*#__PURE__*/ (0,Q.jsx)(tT,{componentProps:e,forwardedRef:t}):/*#__PURE__*/ (0,Q.jsx)(eT,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),rT=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=IS(),c=PS(),l=gw(),u=s.length===0?a:null;return zy(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),iT=/*#__PURE__*/ O.createContext(void 0);function aT(e=!0){let t=O.useContext(iT);if(t===void 0&&!e)throw Error(rh(25));return t}const oT=/*#__PURE__*/ O.createContext(void 0);function sT(e){let t=O.useContext(oT);if(t===void 0&&!e)throw Error(rh(33));return t}const cT=/*#__PURE__*/ O.createContext(void 0);function lT(e){let t=O.useContext(cT);if(t===void 0&&!e)throw Error(rh(36));return t}function uT(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=aT(!0),f=d!==void 0;return O.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:N_})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!zg&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&RC(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}const dT={type:`regular-item`};function fT(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=O.useRef(null),{getButtonProps:d,buttonRef:f}=zC({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=uT({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=O.useCallback(e=>Ty(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=ph(u,f);return O.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}const pT=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=Xw({guess:!0,label:a}),f=sT(!0),p=pC(i),{store:m}=lT(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=fT({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:dT});return zy(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),mT=/*#__PURE__*/ O.createContext(void 0);function hT(e){let t=O.useContext(mT);if(t===void 0&&!e)throw Error(rh(69));return t}const gT=/* @__PURE__ */ new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),_T=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=lT(),{side:c,align:l}=sT(),u=hT(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;Mx({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),O.useEffect(()=>{function e(e){s.setOpen(!1,Z(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),dS(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),k=zy(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:m_,props:[p,{onKeyDown(e){u&&gT.has(e.key)&&e.stopPropagation()}},Nw(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),/*#__PURE__*/ (0,Q.jsx)(yb,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),vT=/*#__PURE__*/ O.createContext(void 0);function yT(){let e=O.useContext(vT);if(e===void 0)throw Error(rh(32));return e}const bT=/*#__PURE__*/ O.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=lT();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return/*#__PURE__*/ (0,Q.jsx)(vT.Provider,{value:n,children:/*#__PURE__*/ (0,Q.jsx)(tb,{ref:t,...r,portalOwnerRole:o})})}),xT=/*#__PURE__*/ O.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=qy,style:g,..._}=e,{store:v}=lT(),y=yT(),b=aT(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),k=v.useState(`activeTriggerElement`),A=v.useState(`transitionStatus`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),N=v.useState(`adaptiveOrigin`),P=v.useState(`lastOpenChangeReason`),F=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),L=S.useState(`domReferenceElement`),R=O.useRef(null),z=jx(j),ee=n,te=c,ne=l,re=s,ie=h;x.type===`context-menu`&&(ee=n??x.context?.anchor,re??=`start`,!o&&re!==`center`&&(ne=e.alignOffset??2,te=e.sideOffset??-5));let B=o,ae=re;x.type===`menu`?(B??=`inline-end`,ae??=`start`,ie=e.collisionAvoidance??Jy):x.type===`menubar`&&(B??=x.context.orientation===`vertical`?`inline-end`:`bottom`,ae??=`start`);let oe=x.type===`context-menu`,se=kw({anchor:ee,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:B,sideOffset:te,align:ae,alignOffset:ne,arrowPadding:oe?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ie,shift:oe?{crossAxis:!(`side`in ie&&ie.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:N});O.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&v.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Z(H_)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,F]),O.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,Z(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let ce=Dg();O.useEffect(()=>{T||ce.clear()},[T,ce]),O.useEffect(()=>{function e(e){if(T&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=v.select(`closeDelay`);e>0?ce.isStarted()||ce.start(e,()=>{v.setOpen(!1,Z(H_))}):v.setOpen(!1,Z(H_))}else ce.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,k,v,ce]),O.useEffect(()=>{let e={open:T,nodeId:F,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,F,I]),J(()=>{let e=L,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return z(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,z,v]);let le={open:T,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:x.type===`menu`,instant:M},V=x.type===`menubar`&&x.context.modal;Kw(T&&(V||E&&P!==`trigger-hover`),D===`touch`,j,k);let H=Pw(e,le,{styles:se.positionerStyles,transitionStatus:A,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),ue=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&P!==`trigger-hover`||x.type===`menubar`&&x.context.modal),de=null;return x.type===`menubar`?de=x.context.contentElement:x.type===void 0&&(de=k),/*#__PURE__*/ (0,Q.jsxs)(oT.Provider,{value:se,children:[ue&&/*#__PURE__*/ (0,Q.jsx)(Mw,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:bw(!T),cutout:de}),/*#__PURE__*/ (0,Q.jsx)(lb,{id:F,children:/*#__PURE__*/ (0,Q.jsx)(sw,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:H})})]})}),ST=/*#__PURE__*/ O.createContext(null);function CT(e){let t=O.useContext(ST);if(t===null&&!e)throw Error(rh(5));return t}const wT={...$x,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}};var TT=class extends qh{constructor(e,t,n=!1){let r=new Kx,i=DT(r,t,n,e);super(i,ET(r),wT),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function ET(e){return{positionerRef:/*#__PURE__*/ O.createRef(),popupRef:/*#__PURE__*/ O.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:/*#__PURE__*/ O.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ O.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function DT(e,t,n=!1,r){return{...qx(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new rb,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Kh,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const OT=/*#__PURE__*/ O.createContext(void 0);function kT(){return O.useContext(OT)}const AT=Nh(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=aT(!0),_=lT(!0),v=CT(!0),y=kT(),b=O.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=vy(),S=vy(),C=ob(),w=b.type===`menu`?b.store:void 0,T=(n??a)&&w?.state.transitionStatus===`starting`,E=ch(()=>T?w?.state.instantType:void 0).current,D=jT({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b,disabled:o,highlightItemOnHover:h,modal:b.type===void 0?s:void 0,rootId:x,instantType:E},S,C!=null);D.useControlledProp(`openProp`,n),D.useControlledProp(`triggerIdProp`,p),D.useContextCallback(`onOpenChangeComplete`,i);let k=D.useState(`floatingTreeRoot`),A=cb(k),j=D.useState(`open`),M=D.useState(`activeTriggerElement`),N=D.useState(`positionerElement`),P=D.useState(`hoverEnabled`),F=D.useState(`disabled`),I=D.useState(`lastOpenChangeReason`),L=D.useState(`parent`),R=D.useState(`activeIndex`),z=D.useState(`payload`),ee=D.useState(`floatingParentNodeId`),te=O.useRef(null),ne=O.useRef(L.type!==`context-menu`),re=Dg(),ie=O.useRef(!0),B=Dg(),ae=ee!=null,{openMethod:oe,triggerProps:se}=EC(j);D.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:L.type===void 0?s:void 0,openMethod:oe,rootId:x}),Hx(D);let{forceUnmount:ce,transitionStatus:le}=Ux(j,D,()=>{D.set(`allowMouseEnter`,!1)},T),V=jx(D.context.popupRef);O.useEffect(()=>{if(E===void 0)return;let e=()=>{D.state.instantType===E&&D.set(`instantType`,void 0)};if(!j){e();return}if(le!==void 0)return;if(D.context.popupRef.current==null){e();return}let t=new AbortController;return V(e,t.signal),()=>{t.abort()}},[E,j,le,V,D]),J(()=>{g&&!_?D.update({parent:{type:`context-menu`,context:g},floatingNodeId:A,floatingParentNodeId:C}):_&&D.update({floatingNodeId:A,floatingParentNodeId:C})},[g,_,A,C,D]),O.useEffect(()=>{if(j||(te.current=null),L.type===`context-menu`){if(!j){re.clear(),ne.current=!1;return}re.start(500,()=>{ne.current=!0})}},[re,j,L.type]),J(()=>{!j&&!P&&D.set(`hoverEnabled`,!0)},[j,P,D]);let H=Y((e,t)=>{let n=t.reason;if(!e&&!D.select(`open`)||j===e&&t.trigger===M&&I===n)return;let i=Bx(t);if(!e&&t.trigger==null&&(t.trigger=M??void 0),r?.(e,t),t.isCanceled)return;D.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!ie.current)return;e&&n===`trigger-focus`?(ie.current=!1,B.start(300,()=>{ie.current=!0})):(ie.current=!0,B.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);te.current=t.event;let c=zx(D.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,D.update(c)}),ue=Dx({popupStore:D,floatingRootContext:D.state.floatingRootContext,floatingId:S,nested:C!=null,onOpenChange:H}),de=ue.context.events;J(()=>{let e=({open:e,eventDetails:t})=>H(e,t);return de.on(`setOpen`,e),()=>{de?.off(`setOpen`,e)}},[de,H]);let fe=O.useCallback(()=>{D.setOpen(!1,Z(U_))},[D]);O.useImperativeHandle(u,()=>({unmount:ce,close:fe}),[ce,fe]);let pe;L.type===`context-menu`&&(pe=L.context),O.useImperativeHandle(pe?.positionerRef,()=>N,[N]),O.useImperativeHandle(pe?.actionsRef,()=>({setOpen:H}),[H]);let me=Cb(ue,{enabled:!F,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||te.current?.type===`contextmenu`||ne.current},externalTree:ae?k:void 0}),he=jC(),ge=O.useCallback(e=>{D.select(`activeIndex`)!==e&&D.set(`activeIndex`,e)},[D]),_e=bS(ue,{enabled:!F,listRef:D.context.itemDomElements,activeIndex:R,nested:L.type!==void 0,loopFocus:c,orientation:l,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:he===`rtl`,disabledIndices:Gh,onNavigate:ge,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:ae?k:void 0,focusItemOnHover:h}),ve=O.useCallback(e=>{D.context.typingRef.current=e},[D]),ye=xS(ue,{enabled:!F,listRef:D.context.itemLabels,elementsRef:D.context.itemDomElements,activeIndex:R,resetMs:500,onMatch:e=>{j&&e!==R&&D.set(`activeIndex`,e)},onTyping:ve}),be=O.useMemo(()=>{let e=Ty(ye.reference,_e.reference,me.reference,{onMouseMove(){D.set(`allowMouseEnter`,!0)}},se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=j,e},[D,ye.reference,_e.reference,me.reference,se,j]),xe=O.useMemo(()=>{let e=Ty(_e.trigger,me.trigger,se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[_e.trigger,me.trigger,se]);ch(()=>(D.update({inactiveTriggerProps:xe}),null)),Wx(D,{floatingRootContext:ue,activeTriggerProps:be,inactiveTriggerProps:xe,popupProps:O.useMemo(()=>Ty(Nx,{id:S,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":M?.id,onMouseMove(){D.set(`allowMouseEnter`,!0),L.type===`menu`&&D.set(`hoverEnabled`,!1)},onClick(){D.select(`hoverEnabled`)&&D.set(`hoverEnabled`,!1)},onKeyDown(e){let t=D.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ye.floating,_e.floating,me.floating),[M,S,l,L.type,D,ye.floating,_e.floating,me.floating]),itemProps:_e.item??Kh});let Se=O.useMemo(()=>({store:D,parent:b}),[D,b]),Ce=/*#__PURE__*/ (0,Q.jsxs)(cT.Provider,{value:Se,children:[f&&/*#__PURE__*/ (0,Q.jsx)(Ix,{handle:f,store:D}),typeof t==`function`?t({payload:z}):t]});return L.type===void 0||L.type===`context-menu`?/*#__PURE__*/ (0,Q.jsx)(ub,{externalTree:k,children:Ce}):Ce});function jT(e,t,n){return ch(()=>new TT(e,t,n)).current}function MT(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=IC(),{ref:i,index:a}=Xw(e),o=n===a,s=O.useRef(null),c=ph(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function NT(e){let{render:t,className:n,style:r,state:i=Kh,props:a=Gh,refs:o=Gh,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=MT({metadata:s});return zy(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function PT(e){if(eg(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!fg(e))return PT(hg(e))}function FT(e,t){let n=O.useRef(null);function r(t){Xy.flushSync(()=>{e.setOpen(!1,Z(I_,t.nativeEvent,t.currentTarget))}),Jv(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Yv(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Xy.flushSync(()=>{e.setOpen(!1,Z(I_,n.nativeEvent,n.currentTarget))});let i=qv(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&X(r,i);){let e=i;if(i=Wv(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function IT(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=O.useRef(!1);return O.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,bg(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Kh,[t,n,r])}const LT=Ph(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=lT(!0),h=eS(d)??m?.store;if(!h)throw Error(rh(85));let g=pC(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=O.useRef(null),S=zT(),C=IC(!0),w=sb(),T=O.useMemo(()=>w??new rb,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Vx(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:cb(T),floatingParentNodeId:ob(),keyboardEventRelay:C?.relayKeyboardEvent}),k=S.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&S.context.disabled,{getButtonProps:M,buttonRef:N}=zC({disabled:j,native:o});O.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let P=O.useRef(null),F=Dg(),I=Y(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;X(P.current,t)||X(h.select(`positionerElement`),t)||t===P.current||(t==null||PT(t)!==h.select(`rootId`))&&(UC(e,P.current)||T.events.emit(`close`,{domEvent:e,reason:V_}))});O.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&bg(P.current).addEventListener(`mouseup`,I,{once:!0})},[y,I,h]);let L=k&&S.context.hasSubmenuOpen,R=pS(v,{enabled:(c??L)&&!j&&(!k||L&&!D),handleClose:DS({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=RT(y,h.select(`lastOpenChangeReason`)),ee=bb(v,{enabled:!j,event:y&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&z}),te=aS(v,{enabled:!j&&L}),ne=IT({open:y,enabled:k,mouseDownAction:`open`}),re=O.useMemo(()=>Ty(te.reference,ee.reference),[te.reference,ee.reference]),ie=h.useState(`triggerProps`,D),{preFocusGuardRef:B,handlePreFocusGuardFocus:ae,handleFocusTargetFocus:oe}=FT(h,x),se={disabled:j,open:y},ce=[P,t,N,E,x],le=[re,R??Kh,ie,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),bg(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},ne,p,M],V=zy(`button`,e,{enabled:!k,stateAttributesMapping:f_,state:se,ref:ce,props:le});return k?/*#__PURE__*/ (0,Q.jsx)(NT,{tag:`button`,render:n,className:r,style:i,state:se,refs:ce,props:le,stateAttributesMapping:f_}):y?/*#__PURE__*/ (0,Q.jsxs)(O.Fragment,{children:[/*#__PURE__*/ (0,Q.jsx)(G_,{ref:B,onFocus:ae},`${g}-pre-focus-guard`),/*#__PURE__*/ (0,Q.jsx)(O.Fragment,{children:V},g),/*#__PURE__*/ (0,Q.jsx)(G_,{ref:h.context.triggerFocusTargetRef,onFocus:oe},`${g}-post-focus-guard`)]}):/*#__PURE__*/ (0,Q.jsx)(O.Fragment,{children:V},g)});function RT(e,t){let n=Dg(),[r,i]=O.useState(!1);return J(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function zT(){let e=CT(!0);return O.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}const BT=/*#__PURE__*/ O.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return zy(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function VT(e){let[t,n]=O.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=O.useRef(null),i=O.useRef(null),a=O.useRef(null),o=O.useRef(null),s=O.useRef(!0),c=O.useRef(null),l=vy(),u=O.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return/*#__PURE__*/ (0,Q.jsx)(iT.Provider,{value:u,children:/*#__PURE__*/ (0,Q.jsx)(cT.Provider,{value:void 0,children:/*#__PURE__*/ (0,Q.jsx)(AT,{...e})})})}const HT=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=aT(!1),{store:m}=lT(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=O.useRef(null),v=O.useRef(null),y=Dg(),b=Dg(),x=O.useRef(!1),S=O.useRef(null);function C(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),x.current=!1,s.current?.setOpen(!0,Z(A_,n)),b.start(500,()=>{x.current=!0})}function w(e){if(g)return;d.current=!0,Gg(e),C(e.clientX,e.clientY,e.nativeEvent);let t=bg(_.current);S.current?.abort();let n=new AbortController;S.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!x.current)return;b.clear(),x.current=!1;let t=Qg(e);X(u.current,t)||p&&t&&PT(t)===p||s.current?.setOpen(!1,Z(V_,e))},{once:!0,signal:n.signal})}function T(){y.clear(),v.current=null}function E(e){if(g){T();return}if(d.current=!1,e.touches.length!==1){T();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(500,()=>{C(n.x,n.y,e.nativeEvent)})}function D(e){if(e.touches.length!==1){T();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&T()}}return O.useEffect(()=>()=>{S.current?.abort()},[]),O.useEffect(()=>{function e(e){if(g)return;let t=Qg(e);(X(_.current,t)||X(c.current,t)||X(l.current,t))&&e.preventDefault()}return xg(bg(_.current),`contextmenu`,e)},[l,g,c]),zy(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:w,onTouchStart:E,onTouchMove:D,onTouchEnd:T,onTouchCancel:T,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:f_})}),UT=xT,WT=/*#__PURE__*/ O.createContext(void 0);function GT(e){let t=O.useContext(WT);if(t===void 0&&!e)throw Error(rh(47));return t}const KT={...$x,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};var qT=class extends qh{constructor(e,t,n){let r=new Kx;super(JT(e,r,t,n),YT(r),KT)}setOpen=(e,t)=>{let n=t.reason===j_,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Bx(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=zx(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Xy.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function JT(e,t,n,r=!1){let i={...qx(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function YT(e){return{popupRef:/*#__PURE__*/ O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:/*#__PURE__*/ O.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ O.createRef(),stickIfOpenTimeout:new Eg,triggerElements:e}}const XT=Nh(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=QT(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Gx(u,d),Hx(u);let{forceUnmount:m}=Ux(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),O.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),O.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,Z(U_))}),[m,u]);let h=d||f;return/*#__PURE__*/ (0,Q.jsxs)(WT.Provider,{value:u,children:[s&&/*#__PURE__*/ (0,Q.jsx)(Ix,{handle:s,store:u}),h&&/*#__PURE__*/ (0,Q.jsx)($T,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function ZT(e){return GT(!0)?/*#__PURE__*/ (0,Q.jsx)(XT,{props:e}):/*#__PURE__*/ (0,Q.jsx)(ub,{children:/*#__PURE__*/ (0,Q.jsx)(XT,{props:e})})}function QT(e,t){let n=Fx((e,n)=>new qT(t,e,n));return O.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function $T({store:e,modal:t}){let n=Cb(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Wx(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}const eE=Ph(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=GT(!0),h=eS(s)??m;if(!h)throw Error(rh(74));let g=pC(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=O.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=Vx(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),k=pS(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:DS(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=bb(v,{stickIfOpen:T}),j=TC(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,C),{getButtonProps:N,buttonRef:P}=zC({disabled:a,native:o}),F={open(e){return e&&w===`trigger-press`?f_.open(e):d_.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=FT(h,x),z=zy(`button`,e,{state:{disabled:a,open:y},ref:[P,t,S,x],props:[A.reference,k,M,j,{"data-base-ui-click-trigger":``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,N],stateAttributesMapping:F}),ee=/*#__PURE__*/ (0,Q.jsx)(O.Fragment,{children:z},g);return C&&!D?/*#__PURE__*/ (0,Q.jsxs)(O.Fragment,{children:[/*#__PURE__*/ (0,Q.jsx)(G_,{ref:I,onFocus:L}),ee,/*#__PURE__*/ (0,Q.jsx)(G_,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):ee}),tE=/*#__PURE__*/ O.createContext(void 0);function nE(){let e=O.useContext(tE);if(e===void 0)throw Error(rh(45));return e}const rE=/*#__PURE__*/ O.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return GT().useState(`mounted`)||n?/*#__PURE__*/ (0,Q.jsx)(tE.Provider,{value:n,children:/*#__PURE__*/ (0,Q.jsx)(tb,{ref:t,...r})}):null}),iE=/*#__PURE__*/ O.createContext(void 0);function aE(){let e=O.useContext(iE);if(!e)throw Error(rh(46));return e}const oE=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Jy,..._}=e,v=GT(),y=nE(),b=cb(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),N=O.useRef(null),P=jx(k),F=kw({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:M}),I=x.useState(`domReferenceElement`);J(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return P(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,v]);let L=E===!0&&w!==`trigger-hover`;Kw(C&&L,D===`touch`,k,T);let R=v.useStateSetter(`positionerElement`),z=Pw(e,{open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:_,refs:[t,R],hidden:!S,inert:!C});return/*#__PURE__*/ (0,Q.jsxs)(iE.Provider,{value:F,children:[S&&L&&/*#__PURE__*/ (0,Q.jsx)(Mw,{inert:bw(!C),cutout:T}),/*#__PURE__*/ (0,Q.jsx)(lb,{id:b,children:z})]})}),sE=/*#__PURE__*/ O.createContext(void 0);function cE(){let[e,t]=O.useState(0),n=Y(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:O.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const lE=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=GT(),l=aE(),u=hT(!0)!=null,{context:d,hasClosePart:f}=cE(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Mx({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),dS(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Px(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=zy(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Nx,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&gT.has(e.key)&&e.stopPropagation()}},Nw(g),s],stateAttributesMapping:m_});return/*#__PURE__*/ (0,Q.jsx)(yb,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:eg(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:/*#__PURE__*/ (0,Q.jsx)(sE.Provider,{value:d,children:M})})}),uE=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=GT(),s=pC(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),zy(`h2`,e,{ref:t,props:[{id:s},a]})});function dE({children:e}){return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`frame`,children:[e,/* @__PURE__ */ (0,Q.jsx)(`i`,{className:`dots`,"aria-hidden":!0})]})}function fE(e){return/* @__PURE__ */ (0,Q.jsxs)(AT,{...e.onOpenChange?{onOpenChange:e.onOpenChange}:{},children:[/* @__PURE__ */ (0,Q.jsx)(LT,{className:e.className??`tool`,"aria-label":e.title,title:e.title,children:e.trigger}),/* @__PURE__ */ (0,Q.jsx)(bT,{children:/* @__PURE__ */ (0,Q.jsx)(xT,{className:`positioner`,align:`end`,sideOffset:4,children:/* @__PURE__ */ (0,Q.jsx)(dE,{children:/* @__PURE__ */ (0,Q.jsx)(_T,{className:`menu`,children:e.children})})})})]})}function pE(e){return/* @__PURE__ */ (0,Q.jsxs)(VT,{...e.onOpenChange?{onOpenChange:e.onOpenChange}:{},children:[/* @__PURE__ */ (0,Q.jsx)(HT,{render:e.children}),/* @__PURE__ */ (0,Q.jsx)(bT,{children:/* @__PURE__ */ (0,Q.jsx)(UT,{className:`positioner`,children:/* @__PURE__ */ (0,Q.jsx)(dE,{children:/* @__PURE__ */ (0,Q.jsx)(_T,{className:`menu`,children:e.menu})})})})]})}const mE={onContextMenuCapture:e=>e.stopPropagation()};function hE(e){return/* @__PURE__ */ (0,Q.jsxs)(pT,{className:`item${e.danger?` danger`:``}`,onClick:e.onClick,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`grow`,children:e.children}),e.hint&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`hint`,children:e.hint})]})}const gE=()=>/* @__PURE__ */ (0,Q.jsx)(BT,{className:`separator`});function _E({emojis:e,onPick:t}){return/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`emoji-row`,children:e.map(e=>/* @__PURE__ */ (0,Q.jsx)(pT,{className:`item emoji`,title:`:${e}:`,onClick:()=>t(e),children:De(e)},e))})}const vE=Object.keys(ye);function yE(e){let[t,n]=(0,O.useState)(!1),r=t=>{n(t),e.onOpenChange?.(t)};return/* @__PURE__ */ (0,Q.jsxs)(ZT,{open:t,onOpenChange:r,children:[/* @__PURE__ */ (0,Q.jsx)(eE,{className:`tool`,"aria-label":`add a reaction`,title:`add a reaction`,children:e.trigger}),/* @__PURE__ */ (0,Q.jsx)(rE,{children:/* @__PURE__ */ (0,Q.jsx)(oE,{className:`positioner`,align:`end`,sideOffset:4,children:/* @__PURE__ */ (0,Q.jsx)(dE,{children:/* @__PURE__ */ (0,Q.jsx)(lE,{className:`menu emoji-grid`,children:vE.map(t=>/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`emoji`,title:`:${t}:`,onClick:()=>{e.onPick(t),r(!1)},children:De(t)},t))})})})})]})}function bE(e){return/* @__PURE__ */ (0,Q.jsxs)(PC,{items:e.items,value:e.value,onValueChange:e.onChange,openOnInputClick:!0,autoHighlight:!1,children:[/* @__PURE__ */ (0,Q.jsxs)(`label`,{className:`suggest ${e.className??``}`,children:[e.prefix&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`prefix`,children:e.prefix}),/* @__PURE__ */ (0,Q.jsx)(tw,{placeholder:e.placeholder,autoFocus:e.autoFocus,spellCheck:!1,onKeyDown:t=>{t.key===`Enter`&&!t.currentTarget.getAttribute(`aria-activedescendant`)&&e.onEnter&&(t.preventDefault(),e.onEnter())}})]}),/* @__PURE__ */ (0,Q.jsx)(yw,{children:/* @__PURE__ */ (0,Q.jsx)(qw,{className:`positioner`,align:`start`,sideOffset:4,children:/* @__PURE__ */ (0,Q.jsx)(dE,{children:/* @__PURE__ */ (0,Q.jsxs)(Yw,{className:`menu list`,children:[/* @__PURE__ */ (0,Q.jsx)(rT,{className:`empty-item`,children:`nothing yet: type a new one`}),/* @__PURE__ */ (0,Q.jsx)(mw,{children:t=>/* @__PURE__ */ (0,Q.jsx)(nT,{value:t,className:`item`,children:e.label?e.label(t):t},t)})]})})})})]})}function xE(e){let[t,n]=(0,O.useState)(``),[r,i]=(0,O.useState)(``),a=(0,O.useRef)(null),o=()=>{let a=t.trim();a&&(e.onSet(a,r.trim()),n(``),i(``))},s=Object.entries(e.labels);return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`labels-editor`,children:[s.length===0?/* @__PURE__ */ (0,Q.jsx)(`p`,{className:`hint`,children:`no labels`}):/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`label-rows`,children:s.map(([t,n])=>/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`label-row`,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`label-key`,children:t}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`label-value`,children:n||`—`}),/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`remove ${t}`,onClick:()=>e.onUnset(t),children:/* @__PURE__ */ (0,Q.jsx)(_e,{size:13})})]},t))}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`label-add`,children:[/* @__PURE__ */ (0,Q.jsx)(bE,{value:t,onChange:n,items:[...e.known.keys()].filter(t=>!(t in e.labels)),placeholder:`key`,autoFocus:!0,onEnter:()=>a.current?.querySelector(`input`)?.focus()}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faint`,children:`=`}),/* @__PURE__ */ (0,Q.jsx)(`div`,{ref:a,className:`grow`,children:/* @__PURE__ */ (0,Q.jsx)(bE,{value:r,onChange:i,items:[...e.known.get(t.trim())??[]],placeholder:`value`,onEnter:o})}),/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`send small`,disabled:!t.trim(),onClick:o,children:`set`})]})]})}function SE(e){return/* @__PURE__ */ (0,Q.jsxs)(ZT,{open:e.open,onOpenChange:e.onOpenChange,children:[e.trigger&&/* @__PURE__ */ (0,Q.jsx)(eE,{className:`tool`,"aria-label":e.triggerTitle??e.title,title:e.triggerTitle??e.title,children:e.trigger}),/* @__PURE__ */ (0,Q.jsx)(rE,{children:/* @__PURE__ */ (0,Q.jsx)(oE,{className:`positioner`,align:`end`,sideOffset:6,...e.anchor?{anchor:e.anchor}:{},children:/* @__PURE__ */ (0,Q.jsx)(dE,{children:/* @__PURE__ */ (0,Q.jsxs)(lE,{className:`menu popover`,children:[/* @__PURE__ */ (0,Q.jsx)(uE,{className:`popover-title`,children:e.title}),e.children]})})})})]})}function CE(e){let[t,n]=(0,O.useState)(!1);return/* @__PURE__ */ (0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":e.label,tabIndex:0,className:`resize ${e.side}${t?` dragging`:``}`,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),n(!0)},onPointerMove:n=>t&&e.onDrag(n.clientX),onPointerUp:()=>{n(!1),e.onDone()},onPointerCancel:()=>{n(!1),e.onDone()},onKeyDown:t=>{t.key===`ArrowLeft`&&e.onStep(-16),t.key===`ArrowRight`&&e.onStep(16)},children:/* @__PURE__ */ (0,Q.jsx)(`i`,{})})}const wE=e=>`board.draft:${e}`;function TE(e){try{return sessionStorage.getItem(wE(e))??``}catch{return``}}function EE(e,t){try{t?sessionStorage.setItem(wE(e),t):sessionStorage.removeItem(wE(e))}catch{}}function DE(e,t,n,r,i){e.focus(),e.setSelectionRange(t,n),document.execCommand(`insertText`,!1,r)||e.setRangeText(r,t,n,`end`),e.setSelectionRange(i[0],i[1]),e.dispatchEvent(new Event(`input`,{bubbles:!0}))}const OE=/^(\s*)([-*]|\d+\.)\s(.*)$/;function kE(e){let[t,n]=(0,O.useState)(()=>TE(e.scope)),[r,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)({}),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)([]),p=(0,O.useRef)(null),m=(0,O.useRef)(null),h=e=>{let t=e.filter(e=>e.size<=4194304||(jm(`${e.name} is over ${Oe/1024/1024} MB`),!1));f(e=>{let n=[...e,...t];return n.length>10&&jm(`a message carries at most 10 files`),n.slice(0,10)}),p.current?.focus()};(0,O.useEffect)(()=>{n(TE(e.scope)),!matchMedia(`(max-width: 900px)`).matches&&!e.channels&&p.current?.focus({preventScroll:!0})},[e.scope]),(0,O.useLayoutEffect)(()=>{let e=p.current;e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,160)}px`},[t]);let g=t=>{n(t),EE(e.scope,t)},_=r.trim().replace(/^#/,``),v=(t.trim().length>0||d.length>0)&&(!e.channels||_.length>0),y=()=>{if(t.trim()||d.length!==0){if(e.channels&&!_)return jm(`pick a channel to post in`);e.onSend({text:t.trim(),noSync:a,channel:_,labels:s,files:d}),g(``),c({}),f([])}},b=(e,t)=>{let{selectionStart:n,selectionEnd:r,value:i}=e;DE(e,n,r,`${t}${i.slice(n,r)}${t}`,[n+t.length,r+t.length])},x=t=>{let n=t.currentTarget,r=t.metaKey||t.ctrlKey;if(t.key===`Escape`)return n.blur();if(r&&!t.shiftKey&&[`b`,`i`,`e`].includes(t.key.toLowerCase()))return t.preventDefault(),b(n,{b:`**`,i:`_`,e:"`"}[t.key.toLowerCase()]);if(t.key===`ArrowUp`&&!n.value&&e.onEditLast)return t.preventDefault(),e.onEditLast();if(t.key!==`Enter`||t.nativeEvent.isComposing)return;if(r)return t.preventDefault(),y();if(t.shiftKey)return;let i=n.selectionStart;if(i===n.selectionEnd){let e=n.value.lastIndexOf(`
381
- `,i-1)+1,r=n.value.slice(e,i),a=OE.exec(r);if(a){if(t.preventDefault(),!a[3].trim())return DE(n,e,i,``,[e,e]);let r=/^\d+\.$/.test(a[2])?`${Number.parseInt(a[2],10)+1}.`:a[2],o=`\n${a[1]}${r} `;return DE(n,i,i,o,[i+o.length,i+o.length])}}t.preventDefault(),y()},S=Object.entries(s);return/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`composer`,children:/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`composer-box`,onClick:e=>{e.target.closest(`button, input, [role="dialog"]`)||p.current?.focus()},children:[e.channels&&/* @__PURE__ */ (0,Q.jsx)(bE,{className:`composer-channel`,prefix:`#`,value:r,onChange:i,items:e.channels,placeholder:`channel`,label:e=>/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faint`,children:`#`}),e]}),onEnter:()=>p.current?.focus()}),S.length>0&&/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`chips composer-labels`,children:S.map(([e,t])=>/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`label`,children:[e,`=`,t,/* @__PURE__ */ (0,Q.jsx)(`button`,{title:`remove ${e}`,onClick:()=>c(t=>{let n={...t};return delete n[e],n}),children:/* @__PURE__ */ (0,Q.jsx)(_e,{size:11})})]},e))}),/* @__PURE__ */ (0,Q.jsx)(`textarea`,{ref:p,"data-composer":e.role,rows:2,maxLength:1e4,value:t,placeholder:e.placeholder,onChange:e=>g(e.target.value),onKeyDown:x,onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),h(t))}}),d.length>0&&/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`chips composer-files`,children:d.map((e,t)=>/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`file`,children:[/* @__PURE__ */ (0,Q.jsx)(ie,{size:14,strokeWidth:1.75}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`file-name`,children:e.name}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faint`,children:je(e.size)}),/* @__PURE__ */ (0,Q.jsx)(`button`,{title:`remove ${e.name}`,onClick:()=>f(e=>e.filter((e,n)=>n!==t)),children:/* @__PURE__ */ (0,Q.jsx)(_e,{size:11})})]},t))}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`composer-footer`,children:[/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`attach files (or paste them)`,onClick:()=>m.current?.click(),children:/* @__PURE__ */ (0,Q.jsx)(de,{size:14})}),/* @__PURE__ */ (0,Q.jsx)(`input`,{ref:m,type:`file`,multiple:!0,hidden:!0,onChange:e=>{h([...e.target.files??[]]),e.target.value=``}}),/* @__PURE__ */ (0,Q.jsx)(SE,{title:`labels`,trigger:/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(he,{size:14}),S.length>0&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`count`,children:S.length})]}),triggerTitle:`labels for this message`,open:l,onOpenChange:u,children:/* @__PURE__ */ (0,Q.jsx)(xE,{labels:s,known:e.known,onSet:(e,t)=>c(n=>({...n,[e]:t})),onUnset:e=>c(t=>{let n={...t};return delete n[e],n})})}),/* @__PURE__ */ (0,Q.jsxs)(`button`,{className:`tool${a?` on`:``}`,"aria-pressed":a,title:a?`board only: this message stays off Slack and GitHub`:`syncs to Slack and GitHub (click to keep it on the board)`,onClick:()=>o(!a),children:[/* @__PURE__ */ (0,Q.jsx)(R,{size:14}),a&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`tool-label`,children:`board only`})]}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`hint`,children:`enter to send · shift+enter for a new line`}),/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`send`,disabled:!v,onMouseDown:e=>e.preventDefault(),onClick:y,children:`send`})]})]})})}function AE(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(!0),i=(0,O.useRef)(null),a=(0,O.useRef)(!1),o=(0,O.useRef)(!1),s=(0,O.useRef)(e.first);s.current=e.first;let c=(0,O.useRef)(e.last),[l,u]=(0,O.useState)(!1),d=()=>{let e=t.current;e.scrollTop=e.scrollHeight,r.current=!0,u(!1)};return(0,O.useLayoutEffect)(()=>{d(),c.current=e.last,o.current=!1},[e.scope]),(0,O.useLayoutEffect)(()=>{let n=t.current;i.current?(n.scrollTop=n.scrollHeight-i.current.height+i.current.top,i.current=null):r.current?n.scrollTop=n.scrollHeight:e.last!==c.current&&u(!0),c.current=e.last},[e.first,e.last]),(0,O.useEffect)(()=>{let e=new ResizeObserver(()=>{r.current&&!i.current&&(t.current.scrollTop=t.current.scrollHeight)});return e.observe(n.current),()=>e.disconnect()},[]),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`feed-wrap`,children:[/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`feed`,ref:t,onScroll:()=>{let n=t.current;if(r.current=n.scrollHeight-n.scrollTop-n.clientHeight<48,r.current&&u(!1),n.scrollTop<240&&e.older&&!a.current&&!o.current){a.current=!0;let t=s.current;i.current={height:n.scrollHeight,top:n.scrollTop},e.older().then(e=>requestAnimationFrame(()=>{s.current===t&&(i.current=null),a.current=!1,o.current=!e}))}},children:/* @__PURE__ */ (0,Q.jsx)(`div`,{ref:n,children:e.children})}),l&&/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`jump`,onClick:d,children:`new messages ↓`})]})}function jE(){let e=Mm();return/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`toasts`,role:`status`,children:e.map(e=>/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`toast`,children:e.text},e.id))})}function ME(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const NE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FE={};function IE(e,t){return((t||FE).jsx?PE:NE).test(e)}const LE=/[ \t\n\f\r]/g;function RE(e){return typeof e==`object`?e.type===`text`&&zE(e.value):zE(e)}function zE(e){return e.replace(LE,``)===``}var BE=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};BE.prototype.normal={},BE.prototype.property={},BE.prototype.space=void 0;function VE(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new BE(n,r,t)}function HE(e){return e.toLowerCase()}var UE=class{constructor(e,t){this.attribute=t,this.property=e}};UE.prototype.attribute=``,UE.prototype.booleanish=!1,UE.prototype.boolean=!1,UE.prototype.commaOrSpaceSeparated=!1,UE.prototype.commaSeparated=!1,UE.prototype.defined=!1,UE.prototype.mustUseProperty=!1,UE.prototype.number=!1,UE.prototype.overloadedBoolean=!1,UE.prototype.property=``,UE.prototype.spaceSeparated=!1,UE.prototype.space=void 0;var WE=/* @__PURE__ */ s({boolean:()=>KE,booleanish:()=>qE,commaOrSpaceSeparated:()=>ZE,commaSeparated:()=>XE,number:()=>$,overloadedBoolean:()=>JE,spaceSeparated:()=>YE});let GE=0;const KE=QE(),qE=QE(),JE=QE(),$=QE(),YE=QE(),XE=QE(),ZE=QE();function QE(){return 2**++GE}const $E=Object.keys(WE);var eD=class extends UE{constructor(e,t,n,r){let i=-1;if(super(e,t),tD(this,`space`,r),typeof n==`number`)for(;++i<$E.length;){let e=$E[i];tD(this,$E[i],(n&WE[e])===WE[e])}}};eD.prototype.defined=!0;function tD(e,t,n){n&&(e[t]=n)}function nD(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new eD(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[HE(r)]=r,n[HE(a.attribute)]=r}return new BE(t,n,e.space)}const rD=nD({properties:{ariaActiveDescendant:null,ariaAtomic:qE,ariaAutoComplete:null,ariaBusy:qE,ariaChecked:qE,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:YE,ariaCurrent:null,ariaDescribedBy:YE,ariaDetails:null,ariaDisabled:qE,ariaDropEffect:YE,ariaErrorMessage:null,ariaExpanded:qE,ariaFlowTo:YE,ariaGrabbed:qE,ariaHasPopup:null,ariaHidden:qE,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:YE,ariaLevel:$,ariaLive:null,ariaModal:qE,ariaMultiLine:qE,ariaMultiSelectable:qE,ariaOrientation:null,ariaOwns:YE,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:qE,ariaReadOnly:qE,ariaRelevant:null,ariaRequired:qE,ariaRoleDescription:YE,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:qE,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function iD(e,t){return t in e?e[t]:t}function aD(e,t){return iD(e,t.toLowerCase())}const oD=nD({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:XE,acceptCharset:YE,accessKey:YE,action:null,allow:null,allowFullScreen:KE,allowPaymentRequest:KE,allowUserMedia:KE,alpha:KE,alt:null,as:null,async:KE,autoCapitalize:null,autoComplete:YE,autoFocus:KE,autoPlay:KE,blocking:YE,capture:null,charSet:null,checked:KE,cite:null,className:YE,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:qE,controls:KE,controlsList:YE,coords:$|XE,crossOrigin:null,data:null,dateTime:null,decoding:null,default:KE,defer:KE,dir:null,dirName:null,disabled:KE,download:JE,draggable:qE,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:KE,formTarget:null,headers:YE,height:$,hidden:JE,high:$,href:null,hrefLang:null,htmlFor:YE,httpEquiv:YE,id:null,imageSizes:null,imageSrcSet:null,inert:KE,inputMode:null,integrity:null,is:null,isMap:KE,itemId:null,itemProp:YE,itemRef:YE,itemScope:KE,itemType:YE,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:KE,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:KE,muted:KE,name:null,nonce:null,noModule:KE,noValidate:KE,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:KE,optimum:$,pattern:null,ping:YE,placeholder:null,playsInline:KE,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:KE,referrerPolicy:null,rel:YE,required:KE,reversed:KE,rows:$,rowSpan:$,sandbox:YE,scope:null,scoped:KE,seamless:KE,selected:KE,shadowRootClonable:KE,shadowRootCustomElementRegistry:KE,shadowRootDelegatesFocus:KE,shadowRootMode:null,shadowRootSerializable:KE,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:qE,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:KE,useMap:null,value:qE,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:YE,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:KE,declare:KE,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:KE,noHref:KE,noShade:KE,noWrap:KE,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:qE,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:KE,disablePictureInPicture:KE,disableRemotePlayback:KE,exportParts:XE,part:YE,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:aD}),sD=nD({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:ZE,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:YE,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:KE,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:XE,g2:XE,glyphName:XE,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:ZE,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:YE,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ZE,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ZE,rev:ZE,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ZE,requiredFeatures:ZE,requiredFonts:ZE,requiredFormats:ZE,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:ZE,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ZE,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ZE,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:iD}),cD=nD({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),lD=nD({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:aD}),uD=nD({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),dD={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},fD=/[A-Z]/g,pD=/-[a-z]/g,mD=/^data[-\w.:]+$/i;function hD(e,t){let n=HE(t),r=t,i=UE;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&mD.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(pD,_D);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!pD.test(e)){let n=e.replace(fD,gD);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=eD}return new i(r,t)}function gD(e){return`-`+e.toLowerCase()}function _D(e){return e.charAt(1).toUpperCase()}const vD=VE([rD,oD,cD,lD,uD],`html`),yD=VE([rD,sD,cD,lD,uD],`svg`);function bD(e){return e.join(` `).trim()}var xD=/* @__PURE__ */ o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
382
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=/* @__PURE__ */ Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),SD=/* @__PURE__ */ o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;let n=t(xD());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),CD=/* @__PURE__ */ o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),wD=/* @__PURE__ */ o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(SD()),r=CD();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const TD=DD(`end`),ED=DD(`start`);function DD(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function OD(e){let t=ED(e),n=TD(e);if(t&&n)return{start:t,end:n}}function kD(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?jD(e.position):`start`in e||`end`in e?jD(e):`line`in e||`column`in e?AD(e):``}function AD(e){return MD(e&&e.line)+`:`+MD(e&&e.column)}function jD(e){return AD(e&&e.start)+`-`+AD(e&&e.end)}function MD(e){return e&&typeof e==`number`?e:1}var ND=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=kD(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ND.prototype.file=``,ND.prototype.name=``,ND.prototype.reason=``,ND.prototype.message=``,ND.prototype.stack=``,ND.prototype.column=void 0,ND.prototype.line=void 0,ND.prototype.ancestors=void 0,ND.prototype.cause=void 0,ND.prototype.fatal=void 0,ND.prototype.place=void 0,ND.prototype.ruleId=void 0,ND.prototype.source=void 0;var PD=/* @__PURE__ */ l(wD(),1);const FD={}.hasOwnProperty,ID=/* @__PURE__ */ new Map,LD=/[A-Z]/g,RD=/* @__PURE__ */ new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),zD=/* @__PURE__ */ new Set([`td`,`th`]),BD=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function VD(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=QD(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ZD(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?yD:vD,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=HD(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function HD(e,t,n){if(t.type===`element`)return UD(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return WD(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return KD(e,t,n);if(t.type===`mdxjsEsm`)return GD(e,t);if(t.type===`root`)return qD(e,t,n);if(t.type===`text`)return JD(e,t)}function UD(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=yD,e.schema=i),e.ancestors.push(t);let a=iO(e,t.tagName,!1),o=$D(e,t),s=tO(e,t);return RD.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!RE(e)})),YD(e,o,a,t),XD(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function WD(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}aO(e,t.position)}function GD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);aO(e,t.position)}function KD(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=yD,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:iO(e,t.name,!0),o=eO(e,t),s=tO(e,t);return YD(e,o,a,t),XD(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qD(e,t,n){let r={};return XD(r,tO(e,t)),e.create(t,e.Fragment,r,n)}function JD(e,t){return t.value}function YD(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function XD(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ZD(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function QD(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ED(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function $D(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&FD.call(t.properties,i)){let a=nO(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&zD.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function eO(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else aO(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else aO(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function tO(e,t){let n=[],r=-1,i=e.passKeys?/* @__PURE__ */ new Map:ID;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=HD(e,a,o);s!==void 0&&n.push(s)}return n}function nO(e,t,n){let r=hD(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ME(n):bD(n)),r.property===`style`){let t=typeof n==`object`?n:rO(e,String(n));return e.stylePropertyNameCase===`css`&&(t=oO(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?dD[r.property]||r.property:r.attribute,n]}}function rO(e,t){try{return(0,PD.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ND("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=BD+`#cannot-parse-style-attribute`,r}}function iO(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=IE(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=IE(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return FD.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);aO(e)}function aO(e,t){let n=new ND("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=BD+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function oO(e){let t={},n;for(n in e)FD.call(e,n)&&(t[sO(n)]=e[n]);return t}function sO(e){let t=e.replace(LD,cO);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function cO(e){return`-`+e.toLowerCase()}const lO={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},uO={};function dO(e,t){let n=t||uO;return fO(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function fO(e,t,n){if(mO(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return pO(e.children,t,n)}return Array.isArray(e)?pO(e,t,n):``}function pO(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=fO(e[i],t,n);return r.join(``)}function mO(e){return!!(e&&typeof e==`object`)}const hO=document.createElement(`i`);function gO(e){let t=`&`+e+`;`;hO.innerHTML=t;let n=hO.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function _O(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function vO(e,t){return e.length>0?(_O(e,e.length,0,t),e):t}const yO={}.hasOwnProperty;function bO(e){let t={},n=-1;for(;++n<e.length;)xO(t,e[n]);return t}function xO(e,t){let n;for(n in t){let r=(yO.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){yO.call(r,a)||(r[a]=[]);let e=i[a];SO(r[a],Array.isArray(e)?e:e?[e]:[])}}}function SO(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);_O(e,0,0,r)}function CO(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function wO(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const TO=LO(/[A-Za-z]/),EO=LO(/[\dA-Za-z]/),DO=LO(/[#-'*+\--9=?A-Z^-~]/);function OO(e){return e!==null&&(e<32||e===127)}const kO=LO(/\d/),AO=LO(/[\dA-Fa-f]/),jO=LO(/[!-/:-@[-`{-~]/);function MO(e){return e!==null&&e<-2}function NO(e){return e!==null&&(e<0||e===32)}function PO(e){return e===-2||e===-1||e===32}const FO=LO(/\p{P}|\p{S}/u),IO=LO(/\s/);function LO(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function RO(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&EO(e.charCodeAt(n+1))&&EO(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function zO(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return PO(r)?(e.enter(n),s(r)):t(r)}function s(r){return PO(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function BO(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&PO(t)?(e.enter(r),c(t)):l(t)}function c(t){return PO(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}const VO={tokenize:HO};function HO(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),zO(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return MO(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var UO=class{constructor(){this.index=/* @__PURE__ */ new Map,this.map=[]}add(e,t,n){WO(this,e,t,n,!1)}addBefore(e,t,n){WO(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function WO(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}const GO={tokenize:qO},KO={tokenize:JO};function qO(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new UO;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(KO,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(KO,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return MO(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new UO;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function JO(e,t,n){return zO(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function YO(e){if(e===null||NO(e)||IO(e))return 1;if(FO(e))return 2}function XO(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const ZO={name:`attention`,resolveAll:QO,tokenize:$O};function QO(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};ek(o,-a),ek(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=vO(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=vO(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=vO(r,XO(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=vO(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=vO(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),_O(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function $O(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=YO(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=YO(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ek(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const tk={name:`autolink`,tokenize:nk};function nk(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return TO(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||EO(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||EO(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||OO(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):DO(t)?(e.consume(t),l):n(t)}function u(e){return EO(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||EO(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const rk={partial:!0,tokenize:ik};function ik(e,t,n){return r;function r(t){return PO(t)?zO(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||MO(e)?t(e):n(e)}}const ak={continuation:{tokenize:sk},exit:ck,name:`blockQuote`,tokenize:ok};function ok(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return PO(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function sk(e,t,n){let r=this;return i;function i(t){return PO(t)?zO(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ak,t,n)(r)}}function ck(e){e.exit(`blockQuote`)}const lk={name:`characterEscape`,tokenize:uk};function uk(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return jO(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const dk={name:`characterReference`,tokenize:fk};function fk(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=EO,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=AO,u):(e.enter(`characterReferenceValue`),a=7,o=kO,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===EO&&!gO(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const pk={partial:!0,tokenize:mk};function mk(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const hk={concrete:!0,name:`codeFenced`,tokenize:gk};function gk(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),PO(t)?zO(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||MO(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(pk,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||MO(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):PO(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),zO(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||MO(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||MO(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&PO(t)?zO(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||MO(t)?e.check(pk,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||MO(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),PO(t)?zO(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),PO(t)?zO(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||MO(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}const _k={name:`codeIndented`,tokenize:yk},vk={partial:!0,tokenize:bk};function yk(e,t,n){return r;function r(t){return e.enter(`codeIndented`),BO(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):MO(t)?e.attempt(vk,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||MO(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function bk(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):MO(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):BO(e,t,a,`linePrefix`,4,4)(o)}function a(e){return MO(e)?i(e):n(e)}}const xk={name:`codeText`,previous:Ck,resolve:Sk,tokenize:wk};function Sk(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ck(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function wk(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):MO(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||MO(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Tk=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ek(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ek(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ek(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Ek(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ek(this.left,t.reverse())}}}};function Ek(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Dk(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Tk(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ok(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return _O(e,0,1/0,u.slice(0)),!l}function Ok(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const kk={resolve:jk,tokenize:Mk},Ak={partial:!0,tokenize:Nk};function jk(e){return Dk(e),e}function Mk(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):MO(t)?e.check(Ak,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Nk(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),zO(e,a,`linePrefix`)}function a(i){if(i===null||MO(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Pk(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||OO(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||MO(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||NO(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||OO(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Fk(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||
380
+ var jg=/* @__PURE__ */ 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})),Mg=/* @__PURE__ */ o(((e,t)=>{t.exports=jg()}));function Ng(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Pg,platform:Fg,maxTouchPoints:Ig}=Ng(),Lg=Pg.toLowerCase(),Rg=Fg.toLowerCase(),zg=/^i(os$|p)/.test(Rg)||Rg===`macintel`&&Ig>1,Bg=`android`,Vg=Rg===Bg||Lg.includes(Bg),Hg=!zg&&Rg.startsWith(`mac`);Rg.startsWith(`win`),!Vg&&/^(linux|chrome os)/.test(Rg);const Ug=Hg||zg,Wg=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Gg=!Wg&&Lg.includes(`firefox`);!Wg&&Lg.includes(`chrom`);const Kg=Ug,qg=/jsdom|happydom/.test(Lg);function Jg(e){e.preventDefault(),e.stopPropagation()}function Yg(e){return`nativeEvent`in e}function Xg(e){return e.pointerType===``&&e.isTrusted?!0:Vg&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Zg(e){return qg?!1:!Vg&&e.width===0&&e.height===0||Vg&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Qg(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function $g(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function e_(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ig(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function t_(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}const n_=`ArrowLeft`,r_=`ArrowRight`,i_=`data-starting-style`,a_={[i_]:``},o_={"data-ending-style":``},s_={transitionStatus(e){return e===`starting`?a_:e===`ending`?o_:null}},c_=`data-popup-open`,l_={[c_]:``},u_={[c_]:``,"data-pressed":``},d_={"data-open":``},f_={"data-closed":``},p_={"data-anchor-hidden":``},m_={open(e){return e?l_:null}},h_={open(e){return e?u_:null}},g_={open(e){return e?d_:f_},anchorHidden(e){return e?p_:null}},__={...g_,...s_},v_=`data-trigger-disabled`;function y_(e,t){if(!ng(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(v_);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(v_);return!1}function b_(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 x_(e){return e.matches(`html,body`)}function S_(e){return rg(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function C_(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)!=null}function w_(e){return e?e.getAttribute(`role`)===`combobox`&&S_(e):!1}function T_(e){if(!e||qg)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function E_(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function D_(e,t){return t!=null&&!Qg(t)?0:typeof e==`function`?e():e}function O_(e,t,n){let r=D_(e,n);return typeof r==`number`?r:r?.[t]}function k_(e){return typeof e==`function`?e():e}function A_(e,t){return t||e===`click`||e===`mousedown`}function j_(e){return e?.includes(`mouse`)&&e!==`mousedown`}const M_=`none`,N_=`trigger-press`,P_=`trigger-hover`,F_=`trigger-focus`,I_=`item-press`,L_=`input-change`,R_=`input-clear`,z_=`focus-out`,B_=`escape-key`,V_=`list-navigation`,H_=`keyboard`,U_=`pointer`,W_=`cancel-open`,G_=`sibling-open`,K_=`imperative-action`;function X(e,t,n,r){let i=!1,a=!1,o=r??Yh;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 q_(e,t,n){let r=n??Yh;return{reason:e,event:t??new Event(`base-ui`),...r}}var Z=Mg();const J_=/*#__PURE__*/ O.forwardRef(function(e,t){let[n,r]=O.useState();q(()=>{Kg&&Wg&&r(`button`)},[]);let i={tabIndex:0,role:n};return/*#__PURE__*/ (0,Z.jsx)(`span`,{...e,ref:t,style:Th,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Y_=Math.min,X_=Math.max,Z_=Math.round,Q_=Math.floor,$_=e=>({x:e,y:e}),ev={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function tv(e,t,n){return X_(e,Y_(t,n))}function nv(e,t){return typeof e==`function`?e(t):e}function rv(e){return e.split(`-`)[0]}function iv(e){return e.split(`-`)[1]}function av(e){return e===`x`?`y`:`x`}function ov(e){return e===`y`?`height`:`width`}function sv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function cv(e){return av(sv(e))}function lv(e,t,n){n===void 0&&(n=!1);let r=iv(e),i=cv(e),a=ov(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=vv(o)),[o,vv(o)]}function uv(e){let t=vv(e);return[dv(e),t,dv(t)]}function dv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}const fv=[`left`,`right`],pv=[`right`,`left`],mv=[`top`,`bottom`],hv=[`bottom`,`top`];function gv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?pv:fv:t?fv:pv;case`left`:case`right`:return t?mv:hv;default:return[]}}function _v(e,t,n,r){let i=iv(e),a=gv(rv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dv)))),a}function vv(e){let t=rv(e);return ev[t]+e.slice(t.length)}function yv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function bv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:yv(e)}function xv(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 Sv(e,t,n){return Math.floor(e/t)!==n}function Cv(e,t){return t<0||t>=e.length}function wv(e,t){return Ev(e.current,{disabledIndices:t})}function Tv(e,t){return Ev(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ev(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Ov(e,a,r));return a}function Dv(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Ov(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Q_(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Ov(e,r,s))return r}};d&&Jg(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Ev(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Ev(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Cv(e,f)&&(f=u)}if(n===`both`){let n=Q_(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Jg(t),u%o===o-1?r&&(f=Ev(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Ev(e,{startingIndex:u,disabledIndices:s}),r&&Sv(f,o,n)&&(f=Ev(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Sv(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Jg(t),u%o===0?r&&(f=Ev(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Ev(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Sv(f,o,n)&&(f=Ev(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Sv(f,o,n)&&(f=u));let c=Q_(l/o)===n;Cv(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Ev(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Ov(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Av(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function kv(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Av(e,t=e?gg(e):null){return!e||!e.isConnected||!t||kv(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}function jv(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ig(n)?n.host:null}function Mv(e){for(let t of Array.from(e.children))if(Qh(t)===`summary`)return t;return null}function Nv(e,t){let n=Mv(t);return!!n&&(e===n||Y(n,e))}function Pv(e){let t=e?Qh(e):``;return e!=null&&e.matches(`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`)&&(t!==`summary`||e.parentElement!=null&&Qh(e.parentElement)===`details`&&Mv(e.parentElement)===e)&&(t!==`details`||Mv(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Fv(e){if(!Pv(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=jv(t)){let n=t!==e,r=Qh(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Qh(t)===`details`&&!t.open&&!Nv(e,t)||t.hasAttribute(`hidden`)||!r&&!Iv(t,n))return!1}return!0}function Iv(e,t){let n=gg(e);return t?n.display!==`none`:Av(e,n)}function Lv(e){let t=e.tabIndex;if(t<0){let t=Qh(e);if(t===`details`||t===`audio`||t===`video`||rg(e)&&e.isContentEditable)return 0}return t}function Rv(e){if(Qh(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function zv(e,t){let n=Rv(e);if(!n)return!0;let r=t.find(e=>{let t=Rv(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Rv(e);return t?.name===n.name&&t.form===n.form})===n}function Bv(e){if(rg(e)&&Qh(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return rg(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Vv(e,t){Bv(e).forEach(e=>{Pv(e)&&t.push(e),Vv(e,t)})}function Hv(e,t,n){Bv(e).forEach(e=>{rg(e)&&e.matches(t)&&n.push(e),Hv(e,t,n)})}function Uv(e){return Fv(e)&&Lv(e)>=0}function Wv(e){let t=[];return Vv(e,t),t.filter(Fv)}function Gv(e){let t=Wv(e);return t.filter(e=>Lv(e)>=0&&zv(e,t))}function Kv(e,t){let n=Gv(e),r=n.length;if(r===0)return;let i=e_(Cg(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function qv(e){return Kv(Cg(e).body,1)||e}function Jv(e){return Kv(Cg(e).body,-1)||e}function Yv(e,t){if(!e)return null;let n=Gv(Cg(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Xv(e){return Yv(e,1)}function Zv(e){return Yv(e,-1)}function Qv(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function $v(e){Gv(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ey(e){let t=[];Hv(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ty(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ty(e,t.id,n)])}function ny(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ry(e){return`data-base-ui-${e}`}let iy=0;function ay(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(iy);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),qh;let o=requestAnimationFrame(a);return iy=o,()=>{iy===o&&(cancelAnimationFrame(o),iy=0)}}const oy={inert:/* @__PURE__ */ new WeakMap,"aria-hidden":/* @__PURE__ */ new WeakMap},sy=`data-base-ui-inert`,cy={inert:/* @__PURE__ */ new WeakSet,"aria-hidden":/* @__PURE__ */ new WeakSet};let ly=/* @__PURE__ */ new WeakMap,uy=0;function dy(e){return cy[e]}function fy(e){return e?ig(e)?e.host:fy(e.parentNode):null}const py=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=fy(t);return e.contains(n)?n:null}).filter(e=>e!=null),my=e=>{let t=/* @__PURE__ */ new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},hy=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Qh(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function gy(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=py(t,e),l=i?hy(t,my(c),new Set(c)):[],u=[],d=[];if(a){let e=oy[a],n=dy(a);s=n,o=e;let r=py(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);hy(t,my(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(ly.get(e)||0)+1;ly.set(e,t),d.push(e),t===1&&e.setAttribute(sy,``)}),uy+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(ly.get(e)||0)-1;ly.set(e,t),t||e.removeAttribute(sy)}),--uy,uy||(oy.inert=/* @__PURE__ */ new WeakMap,oy[`aria-hidden`]=/* @__PURE__ */ new WeakMap,cy.inert=/* @__PURE__ */ new WeakSet,cy[`aria-hidden`]=/* @__PURE__ */ new WeakSet,ly=/* @__PURE__ */ new WeakMap)}}function _y(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Cg(e[0]).body;return gy(e,a,n,r,{mark:i})}let vy=0;function yy(e,t=`mui`){let[n,r]=O.useState(e),i=e||n;return O.useEffect(()=>{n??(vy+=1,r(`${t}-${vy}`))},[n,t]),i}const by=lh.useId;function xy(e,t){if(by!==void 0){let n=by();return e??(t?`${t}-${n}`:n)}return yy(e,t)}function Sy(e){if(!/*#__PURE__*/ O.isValidElement(e))return null;let t=e,n=t.props;return(jh(19)?n?.ref:t.ref)??null}function Cy(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function wy(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 Ty(e,t){return typeof e==`function`?e(t):e}function Ey(e,t){return typeof e==`function`?e(t):e}const Dy={};function Oy(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ay(t);let a=Ay(e);return t&&(a=jy(a,t)),n&&(a=jy(a,n)),r&&(a=jy(a,r)),i&&(a=jy(a,i)),a}function ky(e){if(e.length===0)return Dy;if(e.length===1)return Ay(e[0]);let t=Ay(e[0]);for(let n=1;n<e.length;n+=1)t=jy(t,e[n]);return t}function Ay(e){return Fy(e)?{...Iy(e,Dy)}:My(e)}function jy(e,t){return Fy(t)?Iy(t,e):Ny(e,t)}function My(e){let t={...e};for(let e in t){let n=t[e];Py(e,n)&&(t[e]=Ry(n))}return t}function Ny(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Cy(e.style,r);break;case`className`:e[n]=By(e.className,r);break;default:e[n]=Py(n,r)?Ly(e[n],r):r}}return e}function Py(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 Fy(e){return typeof e==`function`}function Iy(e,t){return Fy(e)?e(t):e??Dy}function Ly(e,t){return t?e?(...n)=>{let r=n[0];if(Vy(r)){let i=r;zy(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ry(t):e}function Ry(e){return e&&((...t)=>{let n=t[0];return Vy(n)&&zy(n),e(...t)})}function zy(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function By(e,t){return t?e?t+` `+e:t:e}function Vy(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Hy(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ky(r));let i=Uy(t,n,r);if(n.enabled===!1)return null;let a=n.state??Yh;return qy(e,r,i,a)}function Uy(e,t,n){let{className:r,style:i}=e,{state:a=Yh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Ty(r,a):void 0,d=l?Ey(i,a):void 0,f=l?wy(a,c):Yh,p=l&&s?Wy(s):void 0,m=l?Cy(f,p)??{}:Yh;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?_h([m.ref,Sy(n),...o]):gh(m.ref,Sy(n),o):gh(null,null)),l?(u!==void 0&&(m.className=By(m.className,u)),d!==void 0&&(m.style=Cy(m.style,d)),m):Yh}function Wy(e){return Array.isArray(e)?ky(e):Oy(void 0,e)}const Gy=Symbol.for(`react.lazy`);function Ky(e){if(e?.$$typeof!==Gy)return e;let t=O.Children.toArray(e)[0];return/*#__PURE__*/ O.isValidElement(t)?t:e}function qy(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Oy(n,t.props);return e.ref=n.ref,/*#__PURE__*/ O.cloneElement(t,e)}if(e&&typeof e==`string`)return Jy(e,n);throw Error(oh(8))}function Jy(e,t){return e===`button`?/*#__PURE__*/ (0,O.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?/*#__PURE__*/ (0,O.createElement)(`img`,{alt:``,...t,key:t.key}):/*#__PURE__*/ O.createElement(e,t)}const Yy={style:{transition:`none`}},Xy={fallbackAxisSide:`none`},Zy={fallbackAxisSide:`end`},Qy={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};var $y=/* @__PURE__ */ l(h(),1);const eb=/*#__PURE__*/ O.createContext(null),tb=()=>O.useContext(eb),nb=ry(`portal`);function rb(e={}){let{ref:t,container:n,componentProps:r=Yh,elementProps:i}=e,a=xy(),o=tb()?.portalNode,[s,c]=O.useState(null),[l,u]=O.useState(null),d=J(e=>{e!==null&&u(e)}),f=O.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(tg(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Hy(`div`,r,{ref:[t,d],props:[{id:a,[nb]:``},i]}),m=s&&p?/*#__PURE__*/ $y.createPortal(p,s):null;return{node:l,nodeId:/*#__PURE__*/ O.isValidElement(p)?p.props.id:void 0,subtree:m}}const ib=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=rb({container:o,ref:t,componentProps:e,elementProps:c}),f=O.useRef(null),p=O.useRef(null),m=O.useRef(null),h=O.useRef(null),[g,_]=O.useState(null),v=O.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;O.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Qv(e)&&(e.type===`focusin`?v.current&&=(ey(l),!1):($v(l),v.current=!0))}return Sg(wg(l,`focusin`,e,!0),wg(l,`focusout`,e,!0))},[l,y]),q(()=>{l&&b===!0&&v.current&&(ey(l),v.current=!1)},[b,l]);let S=O.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return/*#__PURE__*/ (0,Z.jsxs)(O.Fragment,{children:[d,/*#__PURE__*/ (0,Z.jsxs)(eb.Provider,{value:S,children:[x&&l&&/*#__PURE__*/ (0,Z.jsx)(J_,{"data-type":`outside`,ref:f,onFocus:e=>{Qv(e,l)?m.current?.focus():Jv(g?g.domReference:null)?.focus()}}),x&&l&&/*#__PURE__*/ (0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:Qy}),l&&/*#__PURE__*/ $y.createPortal(a,l),x&&l&&/*#__PURE__*/ (0,Z.jsx)(J_,{"data-type":`outside`,ref:p,onFocus:e=>{Qv(e,l)?h.current?.focus():(qv(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,X(`focus-out`,e.nativeEvent)))}})]})]})});function ab(){let e=/* @__PURE__ */ new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,/* @__PURE__ */ new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ob=class{nodesRef={current:[]};events=ab();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}};const sb=/*#__PURE__*/ O.createContext(null),cb=/*#__PURE__*/ O.createContext(null),lb=()=>O.useContext(sb)?.id||null,ub=e=>{let t=O.useContext(cb);return e??t};function db(e){let t=xy(),n=ub(e),r=lb();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fb(e){let{children:t,id:n}=e,r=lb();return/*#__PURE__*/ (0,Z.jsx)(sb.Provider,{value:O.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pb(e){let{children:t,externalTree:n}=e,r=dh(()=>n??new ob).current;return/*#__PURE__*/ (0,Z.jsx)(cb.Provider,{value:r,children:t})}function mb(e){return e==null?e:`current`in e?e.current:e}function hb(e,t){let n=$h(t_(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}let gb=[];function _b(){gb=gb.filter(e=>e.deref()?.isConnected)}function vb(e){_b(),e&&Qh(e)!==`body`&&(gb.push(new WeakRef(e)),gb.length>20&&(gb=gb.slice(-20)))}function yb(){return _b(),gb[gb.length-1]?.deref()}function bb(e){return e?Uv(e)?e:Gv(e)[0]||e:null}function xb(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Wv(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Uv(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Sb(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=J(()=>b.current.floatingContext?.nodeId),S=i===!1,C=w_(_)&&S,w=Sh(i),T=Sh(a),E=Sh(l),D=Sh(g),k=ub(p),A=tb(),j=O.useRef(!1),M=O.useRef(!1),N=O.useRef(!1),P=O.useRef(null),F=O.useRef(``),I=O.useRef(``),L=O.useRef(null),ee=O.useRef(null),R=gh(L,f,A?.beforeInsideRef),te=gh(ee,A?.afterInsideRef),ne=Ag(),re=Ag(),ie=Og(),ae=A!=null,z=E_(v),oe=J((e=z)=>e?Gv(e):[]),se=J(()=>m?.().filter(e=>e!=null)??[]);O.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&Y(z,e_(Cg(z)))&&oe().length===0&&!C&&Jg(e)}return wg(Cg(z),`keydown`,e)},[r,z,s,C,oe]),O.useEffect(()=>{if(r||!g)return;let e=Cg(z);function t(){N.current=!1}function n(e){let t=t_(e),n=se(),r=Y(v,t)||Y(_,t)||Y(A?.portalNode,t)||n.some(e=>e===t||Y(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,re.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Sg(wg(e,`pointerdown`,n,!0),wg(e,`pointerup`,t,!0),wg(e,`pointercancel`,t,!0),wg(e,`keydown`,i,!0),t)},[r,v,_,z,g,A,re,se]),O.useEffect(()=>{if(r||!c)return;let e=Cg(z);function t(){M.current=!0,re.start(0,()=>{M.current=!1})}function n(e){let t=t_(e);Uv(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=t_(t);s&&n==null&&i!=null&&Y(v,i)&&vb(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=se(),f=n?.hasAttribute(ry(`focus-guard`))&&[L.current,ee.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,mb(d),mb(u)].includes(n),p=!(Y(_,n)||Y(v,n)||Y(n,v)||Y(A?.portalNode,n)||l.some(e=>e===n||Y(e,n))||c.hasMatchingElement(e=>Y(e,n))||f||k&&(ty(k.nodesRef.current,a).find(e=>Y(e.context?.elements.floating,n)||Y(e.context?.elements.domReference,n))||ny(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,E_(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&z&&xb(z),o&&r!==_&&!Av(i)&&e_(e)===e.body){if(rg(z)&&(z.focus(),o===`popup`)){ie.request(()=>{z.focus()});return}let e=oe(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||z;rg(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!M.current&&(C||n!==yb())&&(j.current=!0,h.setOpen(!1,X(z_,t)))})}function a(){N.current||(b.current.insideReactTree=!0,ne.start(0,()=>{b.current.insideReactTree=!1}))}let l=rg(_)?_:null;if(v||l)return Sg(l&&wg(l,`focusout`,i),l&&wg(l,`pointerdown`,t),v&&wg(v,`focusin`,n),v&&wg(v,`focusout`,i),v&&A&&wg(v,`focusout`,a,!0))},[r,_,v,z,s,k,A,h,c,o,oe,C,x,b,ne,re,ie,u,d,se]),O.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${ry(`portal`)}]`)||[]),t=(k?ny(k.nodesRef.current,x()):[]).find(e=>w_(e.context?.elements.domReference||null))?.context?.elements.domReference,n=_y([v,...e,L.current,ee.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...se(),t,mb(d),mb(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=_y([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,A,C,k,x,u,d,se]),q(()=>{if(!g||r||!rg(z))return;F.current=``,I.current=``;let e=Cg(z),t=e_(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||Y(z,t))return;let i=null,a=()=>(i??=oe(z),i[0]||z),o;o=r===!0||r===null?a():mb(r),o||=a();let s=Y(z,e_(e));ay(o,{preventScroll:o===z,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=e_(e);return!(t!==o&&Y(z,t))}})})},[r,g,z,oe,w,E,D]),q(()=>{if(r||!z)return;let e=Cg(z),t=e_(e),n=E.current==null;vb(t);function i(e){if(e.open||(F.current=hb(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Xg(e.nativeEvent)||Zg(e.nativeEvent))j.current=!1;else{let e=!1;Cg(z).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Qh(t)!==`body`?t:null,s=n?o||a:a||o;return s||=yb()||null,typeof i==`boolean`?s:mb(i)||s||null}return()=>{y.off(`openchange`,i);let t=e_(e),n=se(),r=Y(v,t)||n.some(e=>e===t||Y(e,t))||k&&ty(k.nodesRef.current,x(),!1).some(e=>Y(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=bb(c),i=typeof o!=`boolean`;if(o&&!j.current&&rg(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,z,T,E,y,k,_,x,se]),q(()=>{if(!Wg||g||!v)return;let e=e_(Cg(v));rg(e)&&S_(e)&&Y(v,e)&&e.blur()},[g,v]),q(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),q(()=>{if(!r&&z)return xb(z),()=>{queueMicrotask(_b)}},[r,z]);let ce=!r&&(!s||!C)&&(ae||s);return/*#__PURE__*/ (0,Z.jsxs)(O.Fragment,{children:[ce&&/*#__PURE__*/ (0,Z.jsx)(J_,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=oe();ay(e[e.length-1])}else A?.portalNode&&(j.current=!1,Qv(e,A.portalNode)?qv(_)?.focus():mb(d??A.beforeOutsideRef)?.focus())}}),n,ce&&/*#__PURE__*/ (0,Z.jsx)(J_,{"data-type":`inside`,ref:te,onFocus:e=>{s?ay(oe()[0]):A?.portalNode&&(c&&(j.current=!0),Qv(e,A.portalNode)?Jv(_)?.focus():mb(u??A.afterOutsideRef)?.focus())}})]})}function Cb(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=N_}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=O.useRef(void 0),f=Og(),p=Ag(),m=O.useMemo(()=>{function e(e,t,n,r){let i=X(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=Qg(e.pointerType,!0)&&Zg(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Qg(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=t_(o);if(S_(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Qg(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return O.useMemo(()=>n?{reference:m}:Yh,[n,m])}function wb(){return!1}function Tb(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Eb(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=wb,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=ub(c),h=J(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=J(()=>a),{escapeKey:y,outsidePress:b}=Tb(s),x=O.useRef(!1),S=O.useRef(!1),C=O.useRef(!1),w=O.useRef(!1),T=O.useRef(!1),E=O.useRef(``),D=O.useRef(null),k=Ag(),A=Ag(),j=J(()=>{A.clear(),f.current.insideReactTree=!1}),M=J(e=>{let t=f.current.floatingContext?.nodeId;return(m?ty(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=J(e=>b_(e,l.select(`floatingElement`))||b_(e,l.select(`domReferenceElement`))),P=J(e=>{o()&&l.setOpen(!1,X(N_,e.nativeEvent))}),F=J(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&M(`__escapeKeyBubbles`))return;let t=Yg(e)?e.nativeEvent:e,i=X(B_,t);l.setOpen(!1,i),i.isCanceled||e.preventDefault(),!y&&!i.isPropagationAllowed&&e.stopPropagation()}),I=J(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=J(e=>{if(!u||!n||e.button!==0)return;let t=t_(e.nativeEvent);Y(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),ee=J(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});O.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),O.useEffect(()=>{if(!u||!n)return u||(w.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new kg,t=new kg,i=Cg(d);function a(){e.clear(),T.current=!0}function o(){e.start(Wg?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=f.current.floatingContext?.nodeId,n=m&&ty(m.nodesRef.current,t).some(t=>b_(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=t_(e),r=`[${ry(`inert`)}]`,i=ng(n)?n.getRootNode():null,a=Array.from((ig(i)?i:Cg(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Y(e,n))))return;let s=ng(n)?n:null;for(;s&&!hg(s);){let e=vg(s);if(hg(e)||!ng(e))break;s=e}if(!(a.length&&ng(n)&&!x_(n)&&!Y(n,l.select(`floatingElement`))&&a.every(e=>!Y(s,e)))){if(rg(n)&&!(`touches`in e)){let t=hg(n),r=gg(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!O(e)){if(p()===`intentional`){if(e.detail!==0&&!Xg(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,X(`outside-press`,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=t_(e);if(!n)return;let r=wg(n,e.type,()=>{t(e),r()})}function ee(e){E.current=`touch`,L(e,I)}function R(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function te(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!O(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())}}}function ne(e){if(p()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),D.current=null)}function re(e){L(e,ne)}function ie(e){p()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&A(e),k.clear(),D.current=null)}function ae(e){L(e,ie)}let z=Sg(r&&Sg(wg(i,`keydown`,F),wg(i,`compositionstart`,a),wg(i,`compositionend`,o)),_&&Sg(wg(i,`click`,R,!0),wg(i,`pointerdown`,R,!0),wg(i,`pointerup`,te,!0),wg(i,`pointercancel`,te,!0),wg(i,`mousedown`,R,!0),wg(i,`mouseup`,te,!0),wg(i,`touchstart`,ee,{capture:!0,passive:!0}),wg(i,`touchmove`,re,{capture:!0,passive:!0}),wg(i,`touchend`,ae,{capture:!0,passive:!0})));return()=>{z(),e.clear(),t.clear(),c(),C.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,k]);let R=O.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),te=O.useMemo(()=>({onKeyDown:F,onPointerDown:ee,onMouseDown:ee,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,ee]);return O.useMemo(()=>n?{reference:R,floating:te,trigger:R}:{},[n,R,te])}function Db(e,t,n){let{reference:r,floating:i}=e,a=sv(t),o=cv(t),s=ov(o),c=rv(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=iv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ob(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}=nv(t,e),p=bv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xv(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=xv(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}}const kb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ob},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Db(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<50&&(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}=Db(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ab=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}=nv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=rv(r),_=sv(o),v=rv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[vv(o)]:uv(o)),x=p!==`none`;!d&&x&&b.push(..._v(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=lv(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`||_===sv(t)||T.every(e=>sv(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=sv(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{}}}},jb=/*#__PURE__*/ new Set([`left`,`top`]);async function Mb(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rv(n),s=iv(n),c=sv(n)===`y`,l=jb.has(o)?-1:1,u=a&&c?-1:1,d=nv(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}}const Nb=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 Mb(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}}}}},Pb=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}=nv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=sv(i),p=av(f),m=u[p],h=u[f],g=(e,t)=>tv(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}}}}}},Fb=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}=nv(e,t),u={x:n,y:r},d=sv(i),f=av(d),p=u[f],m=u[d],h=nv(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=jb.has(rv(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}}}},Ib=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}=nv(e,t),c=await i.detectOverflow(t,s),l=rv(n),u=iv(n),d=sv(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=Y_(p-c[m],g),y=Y_(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*X_(c.left,c.right):S=p-2*X_(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 Lb(e){let t=gg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Z_(n)!==a||Z_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Rb(e){return ng(e)?e:e.contextElement}function zb(e){let t=Rb(e);if(!rg(t))return $_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Lb(t),o=(a?Z_(n.width):n.width)/r,s=(a?Z_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Bb=/*#__PURE__*/ $_(0);function Vb(e){let t=$h(e);return!mg()||!t.visualViewport?Bb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hb(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$h(e)}function Ub(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Rb(e),o=$_(1);t&&(r?ng(r)&&(o=zb(r)):o=zb(e));let s=Hb(a,n,r)?Vb(a):$_(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=$h(a),t=ng(r)?$h(r):r,n=e,i=xg(n);for(;i&&t!==n;){let e=zb(i),t=i.getBoundingClientRect(),r=gg(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=$h(i),i=xg(n)}}return xv({width:u,height:d,x:c,y:l})}function Wb(e,t){let n=_g(e).scrollLeft;return t?t.left+n:Ub(eg(e)).left+n}function Gb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Wb(e,n),y:n.top+t.scrollTop}}function Kb(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=eg(r),s=t?sg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$_(1),u=$_(0),d=rg(r);if((d||!a)&&((Qh(r)!==`body`||ag(o))&&(c=_g(r)),d)){let e=Ub(r);l=zb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Gb(o,c):$_(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 qb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Jb(e){let t=_g(e),n=e.ownerDocument.body,r=X_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=X_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Wb(e),o=-t.scrollTop;return gg(n).direction===`rtl`&&(a+=X_(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function Yb(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=$h(e),a=eg(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!mg()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Wb(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<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Xb(e,t){let n=Ub(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=zb(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Zb(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Yb(e,n,t);else if(t===`document`)r=Jb(eg(e));else if(ng(t))r=Xb(t,n);else{let n=Vb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xv(r)}function Qb(e,t){let n=t.get(e);if(n)return n;let r=bg(e,[],!1).filter(e=>ng(e)&&Qh(e)!==`body`),i=null,a=gg(e).position===`fixed`,o=a?vg(e):e;for(;ng(o)&&!hg(o);){let e=gg(o),t=fg(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=vg(o)}return t.set(e,r),r}function $b(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?sg(t)?[]:Qb(t,this._c):[].concat(n),r],o=Zb(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=Zb(t,a[e],i);s=X_(n.top,s),c=Y_(n.right,c),l=Y_(n.bottom,l),u=X_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ex(e){let{width:t,height:n}=Lb(e);return{width:t,height:n}}function tx(e,t,n){let r=rg(t),i=eg(t),a=n===`fixed`,o=Ub(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$_(0);if((r||!a)&&((Qh(t)!==`body`||ag(i))&&(s=_g(t)),r)){let e=Ub(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Wb(i));let l=i&&!r&&!a?Gb(i,s):$_(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 nx(e){return gg(e).position===`static`}function rx(e,t){if(!rg(e)||gg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return eg(e)===n&&(n=n.ownerDocument.body),n}function ix(e,t){let n=$h(e);if(sg(e))return n;if(!rg(e)){let t=vg(e);for(;t&&!hg(t);){if(ng(t)&&!nx(t))return t;t=vg(t)}return n}let r=rx(e,t);for(;r&&og(r)&&nx(r);)r=rx(r,t);return r&&hg(r)&&nx(r)&&!fg(r)?n:r||pg(e)||n}const ax=async function(e){let t=this.getOffsetParent||ix,n=this.getDimensions,r=await n(e.floating);return{reference:tx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ox(e){return gg(e).direction===`rtl`}const sx={convertOffsetParentRelativeRectToViewportRelativeRect:Kb,getDocumentElement:eg,getClippingRect:$b,getOffsetParent:ix,getElementRects:ax,getClientRects:qb,getDimensions:ex,getScale:zb,isElement:ng,isRTL:ox};function cx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lx(e,t,n){let r=null,i,a=eg(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=Q_(d),h=Q_(a.clientWidth-(u+f)),g=Q_(a.clientHeight-(d+p)),_=Q_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:X_(0,Y_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!cx(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=$h(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function ux(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=Rb(e),u=i||a?[...l?bg(l):[],...t?bg(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?lx(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?Ub(e):null;c&&g();function g(){let t=Ub(e);h&&!cx(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)}}const dx=Nb,fx=Pb,px=Ab,mx=Ib,hx=Fb,gx=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i=n??{},a={...sx,...i.platform,_c:r};return kb(e,t,{...i,platform:a})};var _x=typeof document<`u`?O.useLayoutEffect:function(){};function vx(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(!vx(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)&&!vx(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function yx(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bx(e,t){let n=yx(e);return Math.round(t*n)/n}function xx(e){let t=O.useRef(e);return _x(()=>{t.current=e}),t}function Sx(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]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);vx(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=O.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=O.useRef(null),C=O.useRef(null),w=O.useRef(u),T=c!=null,E=xx(c),D=xx(i),k=xx(l),A=O.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),gx(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!vx(w.current,t)&&(w.current=t,$y.flushSync(()=>{d(t)}))})},[f,t,n,D,k]);_x(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=O.useRef(!1);_x(()=>(j.current=!0,()=>{j.current=!1}),[]),_x(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,A);A()}},[b,x,A,E,T]);let M=O.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=O.useMemo(()=>({reference:b,floating:x}),[b,x]),P=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=bx(N.floating,u.x),r=bx(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...yx(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}const Cx=(e,t)=>{let n=dx(e);return{name:n.name,fn:n.fn,options:[e,t]}},wx=(e,t)=>{let n=fx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tx=(e,t)=>({fn:hx(e).fn,options:[e,t]}),Ex=(e,t)=>{let n=px(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dx=(e,t)=>{let n=mx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ox={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};var kx=class extends Xh{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ab(),nested:n,triggerElements:i},Ox),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&$g(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ax(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=O.useRef(null);r===void 0&&f.current===null&&(f.current=new kx({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ng(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function jx(e,t=!1,n=!1,r=!1){let[i,a]=O.useState(e&&t?`idle`:void 0),[o,s]=O.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=Dg.request(()=>{a(`ending`)});return()=>{Dg.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t)return;let n=Dg.request(()=>{a(void 0)});return()=>{Dg.cancel(n)}},[t,e]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Dg.request(()=>{a(`idle`)});return()=>{Dg.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}let Mx=null;function Nx(e){if(!Mx){let e=[];Mx=e,queueMicrotask(()=>{Mx=null,$y.flushSync(()=>{for(let t of e)t()})})}Mx.push(e)}function Px(e,t=!1,n=!1){let r=Og();return J((i,a=null)=>{r.cancel();let o=mb(e);if(o==null)return;let s=o,c=()=>{if(!n){$y.flushSync(i);return}Nx(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=i_;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Fx(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=J(a),s=Px(r,n,i);O.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}const Ix={tabIndex:-1,"data-base-ui-focusable":``};function Lx(e){return t=>t!==`touch`||e.current}function Rx(e,t=!1){let n=xy(),r=lb()!=null,i=dh(()=>e(n,r)).current;return Ax({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function zx({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Bx(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Vx(e,t){let n=O.useRef(null);return J(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Bx(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Bx(t))})}function Hx(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Ux(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Wx(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Vx(e,n),o=J(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=J(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Gx(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=O.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=X(M_);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Kx(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=jx(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=J(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Fx({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function qx(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:Yh,inactiveTriggerProps:Yh,popupProps:Yh})},[e])}function Jx(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Yx=class{constructor(){this.idMap=/* @__PURE__ */ new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Xx(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new kx({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Yh,inactiveTriggerProps:Yh,popupProps:Yh}}const Zx=e=>e.triggerIdProp??e.activeTriggerId,Qx=e=>e.openProp??e.open,$x=e=>(e.popupElement?.id??e.floatingId)||void 0;function eS(e,t){return t!==void 0&&Qx(e)&&Zx(e)===t}function tS(e,t){return eS(e,t)?!0:t!==void 0&&Qx(e)&&Zx(e)==null&&e.triggerCount===1}const nS={open:Qx,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Zx,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:$x,isTriggerActive:(e,t)=>t!==void 0&&Zx(e)===t,isOpenedByTrigger:(e,t)=>eS(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Zx(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>tS(e,t)?$x(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function rS(e){let t=O.useCallback(t=>e===void 0?qh:e.subscribeStore(t),[e]),n=O.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,zh.useSyncExternalStore)(t,n,()=>e?.serverStore)}function iS(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=xy(),a=lb()!=null,o=dh(()=>new kx({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Yx,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ng(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function aS(e){return oS(e,e.rootContext)}function oS(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=O.useState(null),[d,f]=O.useState(void 0),[p,m]=O.useState(void 0),h=O.useRef(null),g=ub(r),_=O.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=Sx({...e,elements:{..._,...l&&{reference:l}}}),y=ng(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=O.useCallback(e=>{let t=ng(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=O.useCallback(e=>{(ng(e)||e===null)&&(h.current=e,f(e)),(ng(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!ng(e))&&v.refs.setReference(e)},[v.refs,f]),C=O.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=O.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=O.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=O.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return q(()=>{o&&(h.current=o)},[o]),q(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),O.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}const sS=Hg&&Wg;function cS(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=O.useRef(!1),c=O.useRef(null),l=O.useRef(!0),u=Ag();O.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=$h(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&rg(e)&&e===e_(Cg(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return Sg(wg(t,`blur`,r),sS&&wg(t,`keydown`,a,!0),sS&&wg(t,`pointerdown`,o,!0))},[i,n]),O.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);ng(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=O.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=t_(t.nativeEvent);if(ng(a)){if(sS&&!t.relatedTarget){if(!l.current&&!S_(a))return}else if(!T_(a))return}let o=y_(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,X(F_,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,X(F_,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=ng(n)&&n.hasAttribute(ry(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=e_(Cg(e));(n||t!==e)&&(Y(o.current.floatingContext?.refs.floating.current,t)||Y(e,t)||a||y_(n??t,i.context.triggerElements)||i.setOpen(!1,X(F_,r)))})}}},[o,r,i,u]);return O.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var lS=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new kg,this.restTimeout=new kg,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};const uS=/* @__PURE__ */ new WeakMap;function dS(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&uS.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),uS.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function fS(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=uS.get(n);a&&a!==e&&dS(a),dS(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,uS.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function pS(e){let t=e.context.dataRef.current,n=dh(()=>t.hoverInteractionState??lS.create()).current;return t.hoverInteractionState||=n,Tg(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function mS(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=ub(),d=lb(),f=pS(a),p=Ag(),m=J(()=>A_(l.current.openEvent?.type,f.interactedInside)),h=J(()=>j_(l.current.openEvent?.type)),g=J(()=>{dS(f)});q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),O.useEffect(()=>g,[g]),q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&ng(c)&&s){let e=c,t=s,n=Cg(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return fS(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),O.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&ty(u.nodesRef.current,d).length>0)}function t(e){let t=O_(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,X(P_,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=t_(e);if(!C_(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(y_(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&ng(o)&&ty(u.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,X(P_,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Sg(y&&wg(y,`mouseenter`,c),y&&wg(y,`mouseleave`,_),y&&wg(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}const hS={current:null};function gS(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=hS,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=ub(l),y=pS(h),b=O.useRef(!1),x=Sh(i),S=Sh(r),C=Sh(o),w=Sh(n),T=Sh(p),E=Sh(f),D=J(()=>A_(g.current.openEvent?.type,y.interactedInside)),k=J(()=>T.current?.()!==!1),A=J((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Y(e,t);if(!ng(n))return!1;let i=n;return r.hasMatchingElement(e=>Y(e,i))&&(!e||!Y(e,i))}),j=J(()=>{y.handler&&=(Cg(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=J(()=>{dS(y)});return u&&(y.handleCloseOptions=i?.__options),O.useEffect(()=>j,[j]),O.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===P_,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),O.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=O_(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,X(P_,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,X(P_,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!ng(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Qg(y.pointerType))return;let t=k_(C.current),n=O_(S.current,`open`,y.pointerType),r=t_(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(ng(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Y(e,r)){s=e;break}}ng(i)&&ng(o)&&!h.context.triggerElements.hasElement(i)&&Y(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&ng(s)&&ng(o)&&Y(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,X(P_,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,X(P_,e,s))}):g&&k()&&h.setOpen(!0,X(P_,e,s)))}function i(t){if(D()){M();return}j();let n=Cg(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!y_(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!Y(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Y(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?wg(t,`mouseout`,o):void 0;return s?Sg(wg(t,`mousemove`,r,{once:!0}),wg(t,`mouseenter`,r),wg(t,`mouseleave`,i),l):Sg(wg(t,`mouseenter`,r),wg(t,`mouseleave`,i),l)},[j,M,g,S,h,n,x,y,u,A,D,a,s,C,c,v,w,d,E,k,m]),O.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!Qg(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;fS(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=k_(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,X(P_,t,n))}y.pointerType===`touch`?$y.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,A,a,h,C,k])}function _S(e){return Wg&&e.movementX===0&&e.movementY===0}function vS(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function yS(e,t){return vS(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function bS(e,t,n){return vS(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function xS(e,t,n){return vS(t,n?e===n_:e===r_,e===`ArrowDown`)}function SS(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:vS(t,n?e===r_:e===n_,e===`ArrowUp`)}function CS(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,k=E_(T),A=w_(E),j=Sh(k),M=lb(),N=ub(b),P=O.useRef(f),F=O.useRef(o??-1),I=O.useRef(null),L=O.useRef(!0),ee=J(e=>{i(F.current===-1?null:F.current,e)}),R=O.useRef(!!T),te=O.useRef(w),ne=O.useRef(!1),re=O.useRef(!1),ie=O.useRef(null),ae=Sh(h),z=Sh(w),oe=Sh(o),se=Sh(y),ce=Og(),le=Og(),ue=J(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):ie.current=ay(e,{sync:ne.current,preventScroll:!0})}let t=n.current[F.current],r=re.current;t&&e(t),(ne.current?e=>e():e=>ce.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),me&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{D.current.orientation=g},[D,g]),q(()=>{a&&(w&&T?(F.current=o??-1,P.current&&o!=null&&(re.current=!0,ee())):R.current&&(F.current=-1,ee()))},[a,w,T,o,ee]),q(()=>{if(a){if(!w){ne.current=!1;return}if(T){if(r==null){if(ne.current=!1,oe.current!=null)return;if(R.current&&(F.current=-1,ue()),(!te.current||!R.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>le.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||bS(I.current,g,u)||l?wv(n):Tv(n),I.current=null,ee())};t()}}else Cv(n.current,r)||(F.current=r,ue(),re.current=!1)}}},[a,w,T,r,oe,l,n,g,u,ee,ue,le]),q(()=>{if(!a||T||!N||d||!R.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=e_(Cg(E??t??null)),r=e.some(e=>e.context&&Y(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,T,E,N,M,d]),q(()=>{te.current=w,R.current=!!T}),q(()=>{w||(I.current=null,P.current=f)},[w,f]);let B=r!=null,V=J(e=>{if(!z.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,ee(e))}),de=J(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),fe=J(()=>wv(n,ae.current)),pe=J(e=>{if(L.current=!1,ne.current=!0,e.which===229||!z.current&&e.currentTarget===j.current)return;if(l&&SS(e.key,g,u,S)){yS(e.key,de())||Jg(e),C.setOpen(!1,X(V_,e.nativeEvent)),rg(E)&&(d?N?.events.emit(`virtualfocus`,E):E.focus());return}let t=F.current,r=wv(n,h),i=Tv(n,h);if(A||(e.key===`Home`&&(Jg(e),F.current=r,ee(e)),e.key===`End`&&(Jg(e),F.current=i,ee(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,ee(e)),g===`both`)return}if(yS(e.key,g)){if(Jg(e),w&&!d&&e_(e.currentTarget.ownerDocument)===e.currentTarget){F.current=bS(e.key,g,u)?r:i,ee(e);return}bS(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(ne.current=!1,F.current=r):F.current=Ev(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,Ev(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(ne.current=!1,F.current=i):F.current=Ev(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,Ev(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Cv(n.current,F.current)&&(F.current=-1),ee(e)}}),me=O.useMemo(()=>({onFocus(e){ne.current=!0,V(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){_S(e)||(ne.current=!0,re.current=!1,p&&V(e))},onPointerLeave(e){if(!z.current||!L.current||e.pointerType===`touch`)return;ne.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&se.current&&(ie.current?.(),ie.current=null,F.current=-1,ee(e),!d)){let e=j.current,t=e_(Cg(e));e&&Y(e,t)&&e.focus({preventScroll:!0})}}}),[V,z,j,p,n,ee,se,d]),he=O.useMemo(()=>d&&w&&B&&{"aria-activedescendant":`${v}-${r}`},[d,w,B,v,r]),ge=O.useMemo(()=>({...A?{}:he,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=t_(e.nativeEvent);if(t&&!Y(j.current,t))return;Jg(e),C.setOpen(!1,X(z_,e.nativeEvent)),rg(E)&&E.focus();return}pe(e)},onPointerMove(e){_S(e)||(L.current=!0)}}),[he,pe,j,A,C,w,d,E]),_e=O.useMemo(()=>{function e(e){C.setOpen(!0,X(V_,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&Xg(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&Zg(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=C.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=xS(t.key,de(),u),a=yS(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return pe(t);if(n||m||!r){if(o){let e=yS(t.key,de());I.current=l&&e?null:t.key}if(l){i&&(Jg(t),n?(F.current=fe(),ee(t)):e(t));return}a&&(oe.current!=null&&(F.current=oe.current),Jg(t),!n&&m?e(t):pe(t),n&&ee(t))}},onFocus(e){C.select(`open`)&&!d&&(F.current=-1,ee(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[pe,f,fe,l,ee,C,m,g,de,u,oe,d]),ve=O.useMemo(()=>({...he,..._e}),[he,_e]);return O.useMemo(()=>a?{reference:ve,floating:ge,item:me,trigger:_e}:{},[a,ve,ge,_e,me])}function wS(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=Ag(),m=O.useRef(``),h=O.useRef(u??i??-1),g=O.useRef(null),_=J(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!Av(n)||n?.matches(`:disabled`)?!1:o==null||!Ov(Jh,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Jg(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Jg(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=J(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);Y(n,t)||Y(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=O.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return O.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}const TS=.5;function ES(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function DS(e,t,n,r,i,a,o,s,c,l){let u=!1;return ES(e,t,n,r,i,a)&&(u=!u),ES(e,t,i,a,o,s)&&(u=!u),ES(e,t,o,s,c,l)&&(u=!u),ES(e,t,c,l,n,r)&&(u=!u),u}function OS(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function kS(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function AS(e={}){let{blockPointerEvents:t=!1}=e,n=new kg,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*.010000000000000002;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=t_(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ng(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&ty(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=kS(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=kS(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=kS(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=kS(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!OS(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?TS/2:TS*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+TS+1,o=C||T?S.bottom-TS:S.top,s=C?T?S.bottom-TS:S.top:S.bottom-TS;M=DS(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?TS/2:TS*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-TS,o=C||T?S.top+TS:S.bottom,s=C?T?S.top+TS:S.bottom:S.top+TS;M=DS(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?TS/2:TS*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+TS+1,o=w||E?S.right-TS:S.left,s=w?E?S.right-TS:S.left:S.right-TS;M=DS(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?TS/2:TS*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-TS,o=w||E?S.left+TS:S.right,s=w?E?S.left+TS:S.right:S.left+TS;M=DS(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function jS(e,t,n,r,i,a,o,s,c,l=2){let u=Dv(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return Cv(n.current,u)?void 0:u}const MS=/*#__PURE__*/ O.createContext(void 0),NS=/*#__PURE__*/ O.createContext(void 0),PS=/*#__PURE__*/ O.createContext(void 0),FS=/*#__PURE__*/ O.createContext(!1),IS=/*#__PURE__*/ O.createContext(``);function LS(){let e=O.useContext(MS);if(!e)throw Error(oh(22));return e}function RS(){let e=O.useContext(NS);if(!e)throw Error(oh(23));return e}function zS(){let e=O.useContext(PS);if(!e)throw Error(oh(24));return e}function BS(){return O.useContext(IS)}function VS(){return O.useContext(FS)}function HS(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}const US=(e,t)=>Object.is(e,t);function WS(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function GS(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!HS(e,t,(e,t)=>WS(e,t,n)):e!==t}function KS(e,t,n){return e?e.some(e=>e!==void 0&&WS(t,e,n)):!1}function qS(e,t,n){return e?e.findIndex(e=>e!==void 0&&WS(e,t,n)):-1}function JS(e,t){if(t!==US)return n=>KS(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function YS(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(JS(t,n)):qS(e,t,n);return i===-1?null:i}function XS(e,t,n,r,i,a){return KS(r,t,i)?a!=null&&e>a&&KS(r,n[a],i)?a:e:e===a?YS(n,r,i,!0):a}function ZS(e,t,n){return e.filter(e=>!WS(t,e,n))}function QS(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function $S(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function eC(e){return $S(e?.[0])}function tC(e){return eC(e)?e.flatMap(e=>e.items):e}function nC(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(eC(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function rC(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return QS(e)}function iC(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?QS(e.value):QS(e)}const aC={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?nC(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>WS(t,e,n)):WS(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight},oC={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},sC={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},cC={disabled:!1,...sC},lC={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},uC={invalid:void 0,name:void 0,validityData:{state:oC,errors:[],error:``,value:``,initialValue:null},setValidityData:qh,disabled:void 0,setTouched:qh,setDirty:qh,setFilled:qh,setFocused:qh,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:cC,registerFieldControl:qh,validation:{getValidationProps:(e,t=Yh)=>t,inputRef:{current:null},registeredInputs:/* @__PURE__ */ new Map,registerInput:qh,getInputControl:()=>null,commit:async()=>{},change:qh}},dC=/*#__PURE__*/ O.createContext(uC);function fC(e=!0){let t=O.useContext(dC);if(t.setValidityData===qh&&!e)throw Error(oh(28));return t}function pC(e,t,n,r,i=!0,a){let{registerFieldControl:o}=fC(),s=dh(()=>Symbol());q(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}const mC=/*#__PURE__*/ O.createContext({elementRef:{current:null},formRef:{current:{fields:/* @__PURE__ */ new Map}},errors:{},clearErrors:qh,validationMode:`onSubmit`,submitCountRef:{current:0}});function hC(){return O.useContext(mC)}function gC(e){return xy(e,`base-ui`)}const _C=/*#__PURE__*/ O.createContext({controlId:void 0,registerControlId:qh,resetControlId:qh,labelId:void 0,setLabelId:qh,messageIds:[],setMessageIds:qh,getDescriptionProps:e=>e});function vC(){return O.useContext(_C)}function yC(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=vC(),o=gC(),s=dh(()=>Symbol()),c=O.useRef(!1),l=O.useRef(!1),u=J(()=>{c.current&&i!==qh&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===qh){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}function bC(e){return e==null?void 0:`${e}-popup`}function xC(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function SC(e){return Array.isArray(e)?e.map(e=>SC(e)).join(`,`):e==null?``:String(e)}const CC=/* @__PURE__ */ new Map;function wC(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${SC(e.locale)}|${JSON.stringify(t)}`,r=CC.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=rC(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=rC(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=rC(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return CC.set(n,a),a}const TC=wC;function EC(e){let t=O.useRef(``),n=O.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:O.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function DC(e,t){let n=O.useRef(e),r=J(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function OC(e,t){let{onClick:n,onPointerDown:r}=EC(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(zg?`touch`:``))}));return O.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function kC(e){let[t,n]=O.useState(null),r=OC(e,n);return DC(e,t=>{t&&!e&&n(null)}),O.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function AC(e,t=!1){let{overflowY:n}=gg(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}const jC=Symbol(`none`),MC={value:jC,index:-1},NC=/*#__PURE__*/ O.createContext(void 0);function PC(){return O.useContext(NC)?.direction??`ltr`}function FC(e,t,n){let r=e.get(t);if(r!==void 0||n===US)return r;for(let[r,i]of e)if(WS(r,t,n))return i}function IC(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,filterQuery:S,openOnInputClick:C=!0,autoHighlight:w=!1,keepHighlight:T=!1,highlightItemOnHover:E=!0,loopFocus:D=!0,itemToStringLabel:k,itemToStringValue:A,isItemEqualToValue:j=US,virtualized:M=!1,inline:N=!1,fillInputOnItemPress:P=!0,modal:F=!1,limit:I=-1,autoComplete:L=`list`,formAutoComplete:ee,locale:R,submitOnItemClick:te=!1}=e,{clearErrors:ne}=hC(),{setDirty:re,validityData:ie,setFilled:ae,name:z,disabled:oe,setTouched:se,setFocused:ce,validationMode:le,validation:ue}=fC(),B=PC(),V=yC({id:t}),de=TC({locale:R}),fe=Array.isArray(y)?null:y;if(fe&&typeof fe.label!=`function`)throw Error(oh(100));let pe=fe?fe.data:y,me=fe?.value,he=me?void 0:pe,ge=O.useMemo(()=>{if(!b||!me)return;let e=tC(b),t=e.map(me),n;return{values:t,findItem(r,i){if(!n){n=/* @__PURE__ */ new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return FC(n,r,i)}}},[b,me]),_e=O.useMemo(()=>fe?e=>fe.label(e,j,e=>{let t=ge?.findItem(e,j);return t==null?rC(e,k):fe.itemLabel(t)}):k,[fe,k,ge,j]),ve=O.useMemo(()=>fe?Object.assign(e=>fe.itemLabel(e),{selected:e=>rC(e,_e)}):k,[fe,_e,k]);function ye(e){return rC(e,_e)}let[be,xe]=O.useState(!1),[Se,Ce]=O.useState(null),we=O.useRef(Se),Te=O.useRef([]),Ee=O.useRef([]),De=O.useRef(null),Oe=O.useRef(null),ke=O.useRef(null),Ae=O.useRef(null),je=O.useRef(null),Me=O.useRef(!0),Ne=O.useRef(!1),Pe=O.useRef(null),Fe=O.useRef(null),Ie=O.useRef(null),Le=O.useRef(MC),Re=O.useRef(null),ze=O.useRef([]),Be=O.useRef(null),Ve=oe||m,He=z??f,Ue=u===`multiple`,We=u===`single`,Ge=s!==void 0||o!==void 0,Ke=pe!==void 0,qe=b!==void 0,Je;Je=w===`always`?`always`:w?`input-change`:!1;let[Ye,Xe]=sh({controlled:i,default:Ue?r??Jh:r,name:`Combobox`,state:`selectedValue`}),Ze=O.useMemo(()=>x===null?()=>!0:x===void 0?xC(de,ve):x,[x,de,ve]),Qe=dh(()=>Ge?o??``:We?ye(Ye):``).current,[$e,et]=sh({controlled:s,default:Qe,name:`Combobox`,state:`inputValue`}),[tt,nt]=sh({controlled:c,default:l,name:`Combobox`,state:`open`}),rt=eC(pe),it=!tt&&Se!==null?Se:String($e).trim(),at=We?ye(Ye):``,ot=We&&!be&&it!==``&&at.length===it.length&&de.contains(at,it),st=ot?``:S??it,ct=Ke&&qe&&ot&&(!fe||fe.hasValue(Ye,j)),lt=O.useMemo(()=>pe?tC(pe):Jh,[pe]),H=O.useMemo(()=>{if(b&&!ct)return b;if(!pe)return Jh;if(rt){let e=pe,t=[],n=0;for(let r of e){if(I>-1&&n>=I)break;let e=I>-1?I-n:1/0,i=st===``?r.items.slice(0,e):[];if(st!==``)for(let t of r.items){if(i.length>=e)break;Ze(t,st,ve)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(st===``)return I>-1?lt.slice(0,I):lt;let e=[];for(let t of lt){if(I>-1&&e.length>=I)break;Ze(t,st,ve)&&e.push(t)}return e},[b,ct,pe,rt,st,I,Ze,ve,lt]),ut=O.useMemo(()=>{if(ge&&H===b)return ge.values;let e=tC(H);return me?e.map(e=>me(e)):e},[H,b,ge,me]),U=dh(()=>{let e=null;return N&&tt&&Ke&&u!==`none`&&(e=YS(ut,Ye,j,Ue)),new Xh({id:V,labelId:void 0,selectedValue:Ye,open:tt,items:he,selectionMode:u,name:He,form:p,disabled:Ve,readOnly:h,required:g,grid:v,virtualized:M,openOnInputClick:C,itemToStringLabel:_e,isItemEqualToValue:j,modal:F,autoHighlight:Je,submitOnItemClick:te,hasInputValue:Ge,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:N,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:Yh,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:qh,setOpen:qh,setInputValue:qh,setSelectedValue:qh,setIndices:qh,handleSelection:qh,forceMount:qh,requestSubmit:qh,listRef:Te,labelsRef:Ee,popupRef:De,emptyRef:je,inputRef:Oe,startDismissRef:ke,endDismissRef:Ae,keyboardActiveRef:Me,chipsContainerRef:Pe,clearRef:Fe,valuesRef:ze,pointerDownItemRef:Be,selectionEventRef:Ie},aC)}).current,dt=u===`none`?$e:Ye,ft=O.useMemo(()=>u===`none`?dt:Array.isArray(Ye)?Ye.map(e=>iC(e,A)):iC(Ye,A),[dt,A,u,Ye]),pt=J(d),mt=J(n),ht=U.useState(`activeIndex`),gt=U.useState(`selectedIndex`),_t=U.useState(`positionerElement`),vt=U.useState(`listElement`),yt=U.useState(`triggerElement`),bt=U.useState(`inputElement`),xt=U.useState(`inputGroupElement`),St=U.useState(`inline`),Ct=U.useState(`inputInsidePopup`),wt=U.useState(`inputOwnsFormValue`),Tt=We&&!Ct&&$e===at,Et=Sh(yt),{mounted:Dt,setMounted:Ot,transitionStatus:kt}=jx(tt),{openMethod:At,triggerProps:jt}=kC(tt),Mt=J(()=>ft);pC(Ct?Et:Oe,V,dt,Mt,!Ve,f);let Nt=J(()=>{pe?Ee.current=ut.map(ye):U.set(`forceMounted`,!0)}),Pt=J((e,t,n)=>{if(t===-1){if(Le.current===MC)return;Le.current=MC}else Le.current={value:e,index:t};pt(e,q_(n,void 0,{index:t}))}),Ft=J(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),U.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Pt(void 0,-1,r):Pt(ze.current[n],n,r)}),It=J((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Ne.current=n.reason===R_,n.reason===`input-change`){tt&&Se!==null&&Ce(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&xe(!0),Re.current={hasQuery:e};let n=U.state.listElement;if(!U.state.virtualized&&n){let e=De.current;for(let t of bg(n.firstElementChild??n)){if(!rg(t)||(e?!Y(e,t):t.getAttribute(`role`)===`dialog`))break;if(AC(t)){t.scrollTop=0;break}}}e&&Je&&U.state.activeIndex==null&&(tt||St)&&U.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&U.state.inputInsidePopup&&(Re.current={hasQuery:!1,selection:!0});et(t)}}),Lt=J(e=>{let t=!e&&Ct&&!St&&$e!==``&&(String($e).trim()===Se||$e===at);!e&&(t||$e===``||Tt)&&xe(!1),Ce(null),t&&It(``,X(R_))}),Rt=J((t,n)=>{if(tt!==t&&(n.reason===`escape-key`&&Ke&&ut.length===0&&!je.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&Se!==null&&Lt(n.reason===L_),!t&&be&&(We?(St||Ce(it),it===``&&xe(!1)):Ue&&(St||Ce(it),Ct&&Ft({activeIndex:null}),(!Ct||St)&&It(``,X(R_,n.event,void 0,{isItemPress:n.reason===I_})))),nt(t),!t&&Ct&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(se(!0),ce(!1),le===`onBlur`)))){let e=u===`none`?$e:Ye;ue.commit(e)}}),zt=J((e,t)=>{a?.(e,t),!t.isCanceled&&(Xe(e),(u===`none`&&De.current&&P||We&&!U.state.inputInsidePopup)&&It(ye(e),X(t.reason,t.event)))}),Bt=J((e,t)=>{let n=t_(e),r=Ie.current??e;Ie.current=null;let i=X(I_,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Rt(!1,i);return}if(Ue){let e=Array.isArray(Ye)?Ye:[],n=KS(e,t,j),r=n?ZS(e,t,j):[...e,t];if(zt(r,i),i.isCanceled||!(Oe.current&&Oe.current.value.trim()!==``))return;if(U.state.inputInsidePopup){It(``,X(R_,i.event,void 0,{isItemPress:!0}));let e=Re.current;e&&!n&&(e.toggledValue=t)}else Rt(!1,i)}else{if(zt(t,i),i.isCanceled)return;Rt(!1,i)}}),Vt=J(()=>{let e=ue.inputRef.current?.form??U.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Ht=J(()=>{if(Ot(!1),mt?.(!1),xe(!1),Ce(null),Ft(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ue&&Oe.current&&Oe.current.value!==``&&!Ne.current&&It(``,X(R_)),We){if(U.state.inputInsidePopup)Oe.current&&Oe.current.value!==``&&It(``,X(R_));else{let e=ye(Ye);Oe.current&&Oe.current.value!==e&&It(e,X(e===``?R_:M_))}}}),Ut=O.useMemo(()=>St&&_t?{current:_t.closest(`[role="dialog"]`)}:De,[St,_t]);Fx({enabled:!e.actionsRef,open:tt,ref:Ut,onComplete(){tt||Ht()}}),O.useImperativeHandle(e.actionsRef,()=>({unmount:Ht}),[Ht]),q(function(){let e=we.current!==null&&Se===null;if(we.current=Se,tt&&(!e||!Ke)||(tt||(Be.current=null),u===`none`))return;let t=Ke?ut:ze.current;Ft({selectedIndex:YS(t,Ye,j,Ue)})},[tt,Se,Ye,u,Ue,Ke,ut,j,Ft]),q(()=>{pe&&(ze.current=ut,Te.current.length=ut.length)},[pe,ut]),q(()=>{let e=Re.current;if(e){let t=tt||St||U.state.positionerElement?.hidden===!1;if(e.hasQuery)Je&&t&&U.set(`activeIndex`,0),Re.current=null;else if(String($e).trim()===``&&(Re.current=null,t)){let t=e.selection;Je===`always`&&!t&&U.state.selectionMode===`none`&&U.set(`activeIndex`,0),queueMicrotask(()=>{if(!U.state.open&&!U.state.inline||Oe.current&&Oe.current.value.trim()!==``)return;let n=U.state.selectedValue,r=U.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:U.state.selectionMode!==`none`&&n!=null){let t=Ke||qe?ut:ze.current,i=qS(t,e.toggledValue,U.state.isItemEqualToValue);U.set(`activeIndex`,i===-1?YS(t,n,U.state.isItemEqualToValue,r):i)}else t?U.set(`activeIndex`,null):Je===`always`&&U.set(`activeIndex`,0)})}}if(!tt&&!St)return;let t=Ke||qe?ut:ze.current,n=U.state.activeIndex;if(n==null){if(Je===`always`&&t.length>0){U.set(`activeIndex`,0);return}Pt(void 0,-1,M_);return}if(n>=t.length){Pt(void 0,-1,M_),U.set(`activeIndex`,null);return}let r=t[n],i=Le.current.value,a=i!==jC&&WS(r,i,U.state.isItemEqualToValue);(Le.current.index!==n||!a)&&Pt(r,n,M_)},[ht,Je,Pt,qe,Ke,ut,St,tt,U,$e]),q(()=>{if(u===`none`){ae(String($e)!==``);return}ae(Ue?Array.isArray(Ye)&&Ye.length>0:Ye!=null)},[ae,u,$e,Ye,Ue]),O.useEffect(()=>{Ke&&Je&&ut.length===0&&Ft({activeIndex:null})},[Ke,Je,ut.length,Ft]);function Wt(){tt&&it!==``&&it!==String(Qe)&&!Tt&&xe(!0)}function Gt(){tt&&Se!==null&&Lt(!1)}let Kt=!1;function qt(){!Kt&&$e!==at&&(Kt=!0,It(at,X(M_)))}function Jt(){u!==`none`&&(ne(He),re(GS(Ye,ie.initialValue,j)),ue.change(Ye),We&&!Ge&&!Ct&&qt())}function W(){We&&!Ge&&!Ct&&!be&&qt()}function Yt(){u===`none`&&(ne(He),re($e!==ie.initialValue),ue.change($e))}DC(it,Wt),DC(tt,Gt),DC(Ye,Jt),DC(at,W),DC(pe,W),DC($e,Yt);let Xt=iS({open:St?!0:tt,onOpenChange:Rt,elements:{reference:Ct?yt:bt,floating:_t}}),Zt=v?`grid`:`listbox`,Qt=tt||St,$t=Qt?`true`:`false`,en=O.useMemo(()=>{let e=bt?.tagName===`INPUT`,t=bt==null||e,n=t||Qt,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=$t,r[`aria-haspopup`]=Zt,r[`aria-controls`]=Qt?vt?.id:void 0,r[`aria-autocomplete`]=h?`none`:L),{reference:r,floating:{role:`presentation`}}},[bt,Qt,$t,Zt,vt?.id,L,h]),tn=Cb(Xt,{enabled:!Ve&&C,event:`mousedown-only`,toggle:!1,touchOpenDelay:Ct?0:100,reason:`input-press`}),nn=Eb(Xt,{enabled:!Ve&&!St,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:St?!0:void 0,outsidePress(e){let t=t_(e);return!Y(yt,t)&&!Y(Fe.current,t)&&!Y(Pe.current,t)&&!Y(xt,t)}}),rn=CS(Xt,{enabled:!Ve,id:V,listRef:Te,activeIndex:ht,selectedIndex:gt,virtual:!0,loopFocus:D,allowEscape:D&&!Je,focusItemOnOpen:be||u===`none`&&!Je?!1:`auto`,focusItemOnHover:E,resetOnPointerLeave:!T,orientation:v?`horizontal`:void 0,rtl:B===`rtl`,disabledIndices:Jh,grid:v?jS:void 0,onNavigate(e,t){(t||tt)&&kt!==`ending`&&Ft(t?{activeIndex:e,type:Me.current?H_:U_}:{activeIndex:e})}}),an=O.useMemo(()=>Oy(rn.reference,{onKeyDown(e){v&&U.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},nn.reference,tn.reference,en.reference),[rn.reference,nn.reference,tn.reference,en.reference,v,U]),on=O.useMemo(()=>Oy(Ix,nn.floating),[nn.floating]),sn=O.useMemo(()=>Oy(rn.floating,en.floating),[rn.floating,en.floating]),cn=O.useMemo(()=>{let e=rn.item;return e?{...e,onFocus:void 0}:Yh},[rn.item]);U.useContextCallback(`setOpen`,Rt),U.useContextCallback(`setInputValue`,It),U.useContextCallback(`setSelectedValue`,zt),U.useContextCallback(`setIndices`,Ft),U.useContextCallback(`handleSelection`,Bt),U.useContextCallback(`forceMount`,Nt),U.useContextCallback(`requestSubmit`,Vt),U.useContextCallback(`onOpenChangeComplete`,n),ch(()=>{U.update({inline:N,popupProps:on,listProps:sn,inputProps:an,triggerProps:jt,itemProps:cn})});let ln={id:V,selectedValue:Ye,open:tt,mounted:Dt,transitionStatus:kt,items:he,inline:N,popupProps:on,listProps:sn,inputProps:an,triggerProps:jt,itemProps:cn,openMethod:At,selectionMode:u,name:He,form:p,disabled:Ve,readOnly:h,required:g,grid:v,virtualized:M,openOnInputClick:C,itemToStringLabel:_e,modal:F,autoHighlight:Je,isItemEqualToValue:j,submitOnItemClick:te,hasInputValue:Ge};q(()=>{U.update({...ln,inputOwnsFormValue:u===`none`&&(N||!U.state.inputInsidePopup)})},[U,...Object.values(ln)]);let un=gh(_,ue.inputRef),dn=O.useMemo(()=>({query:it,hasItems:Ke,filteredItems:H,flatFilteredValues:ut}),[it,Ke,H,ut]),fn=O.useMemo(()=>Array.isArray(dt)?``:iC(dt,A),[dt,A]),pn=Ue&&Array.isArray(Ye)&&Ye.length>0,mn=Ue||u===`none`&&wt?void 0:He,hn=O.useMemo(()=>!Ue||!Array.isArray(Ye)||!He?null:Ye.map(e=>{let t=iC(e,A);return/*#__PURE__*/ (0,Z.jsx)(`input`,{type:`hidden`,form:p,name:He,value:t,disabled:Ve},t)}),[Ue,Ye,p,He,A,Ve]),gn=/*#__PURE__*/ (0,Z.jsxs)(O.Fragment,{children:[e.children,/*#__PURE__*/ (0,Z.jsx)(`input`,{...ue.getValidationProps(Ve,{onFocus(){if(Ct){yt?.focus();return}(Oe.current||yt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ve||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=X(M_,e.nativeEvent),i=()=>ze.current.findIndex(e=>iC(e,A).toLowerCase()===n||ye(e).toLowerCase()===n);function a(){if(Ue)return;if(u===`none`){It(t,r);return}let e=i();e===-1&&(e=ze.current.findIndex((e,t)=>{let r=Ee.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:ze.current[e];a!=null&&zt?.(a,r)}We&&(Nt(),pe&&i()===-1&&U.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:V&&mn==null?`${V}-hidden-input`:void 0,form:p,name:mn,autoComplete:ee,disabled:Ve,required:g&&!pn,readOnly:h,value:fn,ref:un,style:mn?Eh:Th,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),hn]});return/*#__PURE__*/ (0,Z.jsx)(MS.Provider,{value:U,children:/*#__PURE__*/ (0,Z.jsx)(NS.Provider,{value:Xt,children:/*#__PURE__*/ (0,Z.jsx)(FS.Provider,{value:Ke,children:/*#__PURE__*/ (0,Z.jsx)(PS.Provider,{value:dn,children:/*#__PURE__*/ (0,Z.jsx)(IS.Provider,{value:$e,children:gn})})})})})}function LC(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=(a===`inline`||a===`both`)&&!e.readOnly,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=O.useState(r??``),[p,m]=O.useState(``);O.useEffect(()=>{(u||!c)&&m(``)},[n,u,c]);let h;h=c&&p!==``?p:u?n??``:d;let g=TC({locale:s.locale}),_=String((u?n:d)??``).trim(),v=l||s.filter===null?null:s.filter??g.contains;function y(e,t){m(``),u||f(e),i?.(e,t)}function b(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?rC(t,o):``)}return/*#__PURE__*/ (0,Z.jsx)(IC,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:v,filterQuery:a===`both`?_:void 0,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:y,onItemHighlighted:b})}const RC=/*#__PURE__*/ O.createContext(void 0);function zC(e=!1){let t=O.useContext(RC);if(t===void 0&&!e)throw Error(oh(16));return t}function BC(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:O.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 VC(e,t,{detail:n=0}={}){e.dispatchEvent(new($h(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function HC(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=O.useRef(null),s=zC(!0),c=a??s!==void 0,{props:l}=BC({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=O.useCallback(()=>{let e=o.current;UC(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:O.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Oy({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(zy(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=UC(r),s=!i&&WC(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),VC(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),VC(r,e)))},onKeyUp(e){if(!t){if(zy(e),a?.(e),e.target===e.currentTarget&&i&&c&&UC(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),VC(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:J(e=>{o.current=e,u()})}}function UC(e){return rg(e)&&e.tagName===`BUTTON`}function WC(e){return rg(e)&&e.tagName===`A`&&!!e.href}const GC={...h_,...lC,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null};function KC(e,t){let n=qC(t);return e.clientX>=n.left-5&&e.clientX<=n.right+5&&e.clientY>=n.top-5&&e.clientY<=n.bottom+5}function qC(e){let t=e.getBoundingClientRect(),n=$h(e);if(qg)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function JC(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function YC(){return zS().filteredItems.length===0}function XC(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function ZC(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function QC(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}const $C=/*#__PURE__*/ O.createContext(void 0);function ew(){return O.useContext($C)}const tw=/*#__PURE__*/ O.createContext(void 0);function nw(e){let t=O.useContext(tw);if(t===void 0&&!e)throw Error(oh(21));return t}const rw=/*#__PURE__*/ O.forwardRef(function(e,t){let n=LS(),{buttonRef:r,getButtonProps:i}=HC({native:!1}),a=gh(t,r);function o(e){n.context.setOpen(!1,X(`close-press`,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return/*#__PURE__*/ (0,Z.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:Eh})}),iw=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=fC(),{labelId:m}=vC(),h=ew(),g=!!nw(!0),_=LS(),v=BS(),y=PC(),b=_.useState(`required`),x=_.useState(`disabled`),S=_.useState(`readOnly`),C=_.useState(`name`),w=_.useState(`form`),T=_.useState(`selectionMode`),E=_.useState(`autoHighlight`),D=_.useState(`inputProps`),k=_.useState(`triggerProps`),A=_.useState(`open`),j=_.useState(`mounted`),M=_.useState(`selectedValue`),N=_.useState(`id`),P=_.useState(`inline`),F=_.useState(`modal`),I=!!E,L=JC(_),ee=l||x||i,R=YC(),te=g||P,ne=!te||F,re=gC(a??(te?void 0:N)),ie=g?sC:c,[ae,z]=O.useState(null),oe=O.useRef(!1),se=O.useRef(null),ce=O.useRef(!1),le=T===`none`&&!g,ue=J(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,X(M_)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:le})}),B=g?s:p.getValidationProps(ee,s);function V(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?H_:U_})}function de(){_.context.keyboardActiveRef.current=!1}let fe={...ie,open:A,disabled:ee,readOnly:S,popupSide:L,listEmpty:R};function pe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=XC(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&M.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=ZC(n,M.length),V()),t)}let me=Hy(`input`,e,{state:fe,ref:[t,_.context.inputRef,ue],props:[D,k,{value:ae??v,"aria-readonly":S||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:ee,readOnly:S,required:T===`none`?b:void 0,form:w,...le&&C&&{name:C},id:re,onFocus(){if(d(!0),!P||!ce.current)return;ce.current=!1;let e=se.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(P&&e!==null&&E!==`always`&&(se.current=e,ce.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:M;p.commit(e)}},onCompositionStart(e){Vg||(oe.current=!0,z(e.currentTarget.value))},onCompositionEnd(e){oe.current=!1;let t=e.currentTarget.value;z(null),_.context.setInputValue(t,X(L_,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=oe.current||!r;function a(e){!S&&!ee&&e&&i&&(_.context.setOpen(!0,X(L_,t)),I||V())}if(oe.current){let n=e.currentTarget.value;z(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,X(R_,t));let r=n.trim(),i=I&&r!==``;a(r),A&&_.state.activeIndex!==null&&!i&&V();return}let o=X(L_,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=X(R_,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),A&&_.state.activeIndex!==null&&!I&&V()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,ee||S){S&&e.key===`Enter`&&A&&_.state.activeIndex!==null&&Jg(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){Jg(e);let n=Gg&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){Jg(e);let i=Gg&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!j&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=X(B_,e.nativeEvent),r=T===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:M.length-1,r=M.filter((e,t)=>t!==n);V(),_.context.setSelectedValue(r,X(M_,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=pe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;_.context.setOpen(!1,X(M_,n));return}Jg(e),QC(_,t,n)}},onPointerMove:de,onPointerDown:de},B],stateAttributesMapping:GC}),he=g?/*#__PURE__*/ (0,Z.jsx)(dC.Provider,{value:uC,children:me}):me;return/*#__PURE__*/ (0,Z.jsxs)(O.Fragment,{children:[A&&ne&&/*#__PURE__*/ (0,Z.jsx)(rw,{ref:_.context.startDismissRef}),he]})}),aw=/*#__PURE__*/ O.createContext(null);function ow(){return O.useContext(aw)}function sw(e){let{children:t}=e,{filteredItems:n}=zS(),r=ow(),i=r?r.items:n;return/*#__PURE__*/ (0,Z.jsx)(O.Fragment,{children:i.map(t)})}const cw=/*#__PURE__*/ O.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function lw(){return O.useContext(cw)}function uw(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=O.useState(!1),s=dh(fw).current,c=dh(dw).current,l=O.useRef(0),u=O.useRef(!0),d=O.useRef(null),f=O.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>!e))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),g=J(e=>{let t=/* @__PURE__ */ new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!hw(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&gw(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=/* @__PURE__ */ new Set;for(let t=1;t<e.length;t+=1){let r=mw(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=J(()=>{let[e,t]=pw(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),q(()=>{u.current&&v()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=J(e=>(s.add(e),()=>{s.delete(e)})),b=O.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return/*#__PURE__*/ (0,Z.jsx)(cw.Provider,{value:b,children:t})}function dw(){return/* @__PURE__ */ new Map}function fw(){return/* @__PURE__ */ new Set}function pw(e){let t=/* @__PURE__ */ new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>gw(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function mw(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function hw(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function gw(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const _w=/*#__PURE__*/ O.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=LS(),l=RS(),u=!!nw(!0),{filteredItems:d,hasItems:f}=zS(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=J(e=>{c.set(`positionerElement`,e)}),S=J(e=>{c.set(`listElement`,e)}),C=O.useMemo(()=>typeof o==`function`?n||=/*#__PURE__*/ (0,Z.jsx)(sw,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=Hy(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;Jg(e),QC(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return/*#__PURE__*/ (0,Z.jsx)(uw,{elementsRef:c.context.listRef,labelsRef:D,children:E})});function vw(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function yw(){let e=Ag(),t=O.useRef(null);return O.useEffect(()=>{if(zg)return;let n=t.current;if(n==null)return;let r=vw(n);if(r==null)return;let i=r.data,a=`${i}⁠`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}const bw=/*#__PURE__*/ O.createContext(void 0);function xw(){let e=O.useContext(bw);if(e===void 0)throw Error(oh(20));return e}const Sw=/*#__PURE__*/ O.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=LS(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?/*#__PURE__*/ (0,Z.jsx)(bw.Provider,{value:n,children:/*#__PURE__*/ (0,Z.jsx)(ib,{ref:t,...r})}):null});function Cw(e){return jh(19)?e:e?`true`:void 0}const ww=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`}=nv(e,t)||{};if(l==null)return{};let f=bv(u),p={x:n,y:r},m=cv(i),h=ov(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=tv(k,j,A),N=!c.arrow&&iv(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Tw=(e,t)=>{let{name:n,fn:r}=ww(e);return{name:n,fn:r,options:[e,t]}},Ew={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Dw={sideX:`left`,sideY:`top`},Ow=`--available-width`,kw=`--available-height`;function Aw(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 jw(e,t,n){let{rects:r,placement:i}=e;return{side:Aw(t,rv(i),n),align:iv(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Mw(e){return Nw(e,aS)}function Nw(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=O.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=J(j),N=j?M:n,P=Sh(n),F=Sh(g),I=PC()===`rtl`,L=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],ee=o===`center`?L:`${L}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let te=+(i===`bottom`),ne=+(i===`top`),re=+(i===`right`),ie=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},z=O.useRef(null),oe=Sh(a),se=Sh(s),ce=typeof a==`function`?0:a,le=typeof s==`function`?0:s,ue=[];p&&ue.push(p),ue.push(Cx(e=>{let t=jw(e,i,I),n=typeof oe.current==`function`?oe.current(t):oe.current,r=typeof se.current==`function`?se.current(t):se.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ce,le,I,i]));let B=E===`none`&&T!==`shift`,V=!B&&(u||k||T===`shift`),de=T===`none`?null:Ex({...ae,padding:{top:R.top+1+te,right:R.right+1+ie,bottom:R.bottom+1+ne,left:R.left+1+re},mainAxis:!k&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),fe=B?null:wx({...ae,rootBoundary:A,mainAxis:E!==`none`,crossAxis:V,limiter:u||k?void 0:Tx(e=>{if(!z.current)return{};let{width:t,height:n}=z.current.getBoundingClientRect(),r=sv(rv(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[ae,u,k,A,R,E]);T===`shift`||E===`shift`||o===`center`?ue.push(fe,de):ue.push(de,fe),ue.push(Dx({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(Ow,`${t}px`),i.setProperty(kw,`${n}px`);let a=$h(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Tw(e=>({element:z.current||Cg(e.elements.floating).createElement(`div`),padding:z.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=rv(r),u=iv(r),d=sv(l)===`y`,f=z.current,p=typeof a==`function`?a(jw(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return V&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(`--transform-origin`,d?`${m} ${h}`:`${h} ${m}`),{}}},Ew,b),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let pe=O.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:ue,strategy:r,whileElementsMounted:m?void 0:(...e)=>ux(...e,pe),nodeId:y,externalTree:S}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||Dw,Ee=Se?r:`fixed`,De=O.useMemo(()=>{let e;return e=Se?b?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Ow]=`100vw`,e[kw]=`100vh`,Se||(e.opacity=0),e},[b,Ee,we,ge,Te,_e,Ce,Se]),Oe=O.useRef(null);q(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(Pw(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[g,me,N,P]),O.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&Pw(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[g,me,N,P]),O.useEffect(()=>{if(m&&g&&he.reference&&he.floating)return ux(he.reference,he.floating,ye,pe)},[m,g,he,ye,pe]);let ke=rv(be),Ae=Aw(i,ke,I),je=iv(be)||`center`,Me=!!ve.hide?.referenceHidden;q(()=>{x&&g&&Se&&ke!==L&&w(ke)},[x,g,Se,ke,L]);let Ne=O.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return O.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:z,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,z,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function Pw(e){return e!=null&&`current`in e}const Fw=/*#__PURE__*/ O.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return/*#__PURE__*/ (0,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Iw(e){return e===`starting`?Yy:Yh}function Lw(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Hy(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Iw(r),i],stateAttributesMapping:g_})}let Rw={},zw={},Bw=``;function Vw(e,t){return ag(e)?e:t}function Hw(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Vw(t,n)).overflowY)}function Uw(e){if(typeof document>`u`)return!1;let t=Cg(e);return $h(t).innerWidth-t.documentElement.clientWidth>0}function Ww(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Cg(e),n=t.documentElement,r=t.body,i=Vw(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Gw(e){let t=Cg(e),n=t.documentElement,r=t.body,i=Vw(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Kw(e){let t=Cg(e),n=t.documentElement,r=t.body,i=$h(n),a=0,o=0,s=!1,c=Dg.create();if(Wg&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Rw={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Bw=n.style.scrollBehavior,zw={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Vw(n,r);if(s=Ww(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Rw),Object.assign(r.style,zw),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Bw)}function d(){u(),c.request(l)}l();let f=wg(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}const qw=new class{lockCount=0;restore=null;timeoutLock=kg.create();timeoutUnlock=kg.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Cg(e),n=t.documentElement,r=t.body,i=$h(n);if(Hw(i,n,r)){let t=new i.MutationObserver(()=>{Hw(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=zg||!Uw(e);this.restore=a?Gw(e):Kw(e)}};function Jw(e=!0,t=null){q(()=>{if(e)return qw.acquire(t)},[e,t])}function Yw(e,t,n,r){let[i,a]=O.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=Cg(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-20)},[e,t,n]),Jw(e&&(!t||i),r)}const Xw=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=Xy,style:g,..._}=e,v=LS(),y=RS(),b=xw(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=YC(),M=Mw({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});Yw(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};q(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=J(e=>{v.set(`positionerElement`,e)}),F=Lw(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return/*#__PURE__*/ (0,Z.jsxs)(tw.Provider,{value:M,children:[C&&x&&/*#__PURE__*/ (0,Z.jsx)(Fw,{inert:Cw(!S),cutout:O??D??E}),F]})}),Zw={...g_,...s_},Qw=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=LS(),l=nw(),u=RS(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=YC(),x=s.id??(g?bC(y):void 0);q(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),Fx({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S=Hy(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=t_(e.nativeEvent);p!==`touch`&&(Y(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Iw(h),s],stateAttributesMapping:Zw}),C=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,w;w=o??(g?void 0:!1);let T=!g||v;return/*#__PURE__*/ (0,Z.jsx)(Sb,{context:u,disabled:!d,modal:T,openInteractionType:p,initialFocus:C,returnFocus:w,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:/*#__PURE__*/ (0,Z.jsxs)(O.Fragment,{children:[S,T&&/*#__PURE__*/ (0,Z.jsx)(rw,{ref:c.context.endDismissRef})]})})});function $w(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=lw(),u=O.useRef(-1),[d,f]=O.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=O.useRef(null),h=O.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}const eT=/*#__PURE__*/ O.createContext(void 0),tT=/*#__PURE__*/ O.createContext(!1);function nT(){return O.useContext(tT)}function rT(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=O.useRef(null),m=$w({guess:!0,index:l,textRef:p}),h=LS(),g=nT(),_=VS(),v=h.useState(`selectionMode`),y=h.useState(`disabled`),b=h.useState(`readOnly`),x=h.useState(`isItemEqualToValue`),S=y||u,C=v!==`none`,w=l??i??m.index,T=w!==-1,E=h.useState(`id`),D=h.useState(`isActive`,w),k=h.useState(`isSelected`,c),A=h.useState(`itemProps`),j=O.useRef(null),M=E!=null&&T?`${E}-${w}`:void 0,N=k&&C;q(()=>{if(!T||!r&&l==null)return;let e=h.context.listRef.current;return e[w]=j.current,()=>{delete e[w]}},[T,r,w,l,h]),q(()=>{if(!T||_)return;let e=h.context.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,_,w,c,h]),q(()=>{if(!T||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=XS(w,c,h.context.valuesRef.current,e,x,t):WS(c,e,x)&&(t=w),h.set(`selectedIndex`,t)},[T,_,h,w,c,x]);let{getButtonProps:P,buttonRef:F}=HC({disabled:S,focusableWhenDisabled:!0,native:d,composite:!0}),I={disabled:S,selected:N,highlighted:D};function L(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?($y.flushSync(t),h.context.requestSubmit()):t()}let ee={id:M,role:g?`gridcell`:`option`,"aria-selected":C?N:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||b||L(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(S||b||e.button!==0||t||!D)&&L(e.nativeEvent)}},R=Hy(`div`,t,{ref:[F,n,m.ref,j],state:I,props:[A,ee,f,P]}),te=O.useMemo(()=>({selected:N,textRef:p}),[N,p]);return/*#__PURE__*/ (0,Z.jsx)(eT.Provider,{value:te,children:R})}function iT(e){let{componentProps:t,forwardedRef:n}=e,r=LS().useState(`isItemEqualToValue`),{flatFilteredValues:i}=zS(),a=qS(i,t.value??null,r);return/*#__PURE__*/ (0,Z.jsx)(rT,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}const aT=/* @__PURE__ */ O.memo(/*#__PURE__*/ O.forwardRef(function(e,t){let n=LS().useState(`virtualized`);return n&&e.index==null?/*#__PURE__*/ (0,Z.jsx)(iT,{componentProps:e,forwardedRef:t}):/*#__PURE__*/ (0,Z.jsx)(rT,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),oT=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=zS(),c=LS(),l=yw(),u=s.length===0?a:null;return Hy(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),sT=/*#__PURE__*/ O.createContext(void 0);function cT(e=!0){let t=O.useContext(sT);if(t===void 0&&!e)throw Error(oh(25));return t}const lT=/*#__PURE__*/ O.createContext(void 0);function uT(e){let t=O.useContext(lT);if(t===void 0&&!e)throw Error(oh(33));return t}const dT=/*#__PURE__*/ O.createContext(void 0);function fT(e){let t=O.useContext(dT);if(t===void 0&&!e)throw Error(oh(36));return t}function pT(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=cT(!0),f=d!==void 0;return O.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:I_})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!Hg&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&VC(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}const mT={type:`regular-item`};function hT(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=O.useRef(null),{getButtonProps:d,buttonRef:f}=HC({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=pT({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=O.useCallback(e=>Oy(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=gh(u,f);return O.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}const gT=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=$w({guess:!0,label:a}),f=uT(!0),p=gC(i),{store:m}=fT(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=hT({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:mT});return Hy(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),_T=/*#__PURE__*/ O.createContext(void 0);function vT(e){let t=O.useContext(_T);if(t===void 0&&!e)throw Error(oh(69));return t}const yT=/* @__PURE__ */ new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),bT=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=fT(),{side:c,align:l}=uT(),u=vT(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;Fx({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),O.useEffect(()=>{function e(e){s.setOpen(!1,X(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),mS(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),k=Hy(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:__,props:[p,{onKeyDown(e){u&&yT.has(e.key)&&e.stopPropagation()}},Iw(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),/*#__PURE__*/ (0,Z.jsx)(Sb,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),xT=/*#__PURE__*/ O.createContext(void 0);function ST(){let e=O.useContext(xT);if(e===void 0)throw Error(oh(32));return e}const CT=/*#__PURE__*/ O.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=fT();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return/*#__PURE__*/ (0,Z.jsx)(xT.Provider,{value:n,children:/*#__PURE__*/ (0,Z.jsx)(ib,{ref:t,...r,portalOwnerRole:o})})}),wT=/*#__PURE__*/ O.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Xy,style:g,..._}=e,{store:v}=fT(),y=ST(),b=cT(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),k=v.useState(`activeTriggerElement`),A=v.useState(`transitionStatus`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),N=v.useState(`adaptiveOrigin`),P=v.useState(`lastOpenChangeReason`),F=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),L=S.useState(`domReferenceElement`),ee=O.useRef(null),R=Px(j),te=n,ne=c,re=l,ie=s,ae=h;x.type===`context-menu`&&(te=n??x.context?.anchor,ie??=`start`,!o&&ie!==`center`&&(re=e.alignOffset??2,ne=e.sideOffset??-5));let z=o,oe=ie;x.type===`menu`?(z??=`inline-end`,oe??=`start`,ae=e.collisionAvoidance??Zy):x.type===`menubar`&&(z??=x.context.orientation===`vertical`?`inline-end`:`bottom`,oe??=`start`);let se=x.type===`context-menu`,ce=Mw({anchor:te,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:z,sideOffset:ne,align:oe,alignOffset:re,arrowPadding:se?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ae,shift:se?{crossAxis:!(`side`in ae&&ae.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:N});O.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&v.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,X(G_)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,F]),O.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,X(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let le=Ag();O.useEffect(()=>{T||le.clear()},[T,le]),O.useEffect(()=>{function e(e){if(T&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=v.select(`closeDelay`);e>0?le.isStarted()||le.start(e,()=>{v.setOpen(!1,X(G_))}):v.setOpen(!1,X(G_))}else le.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,k,v,le]),O.useEffect(()=>{let e={open:T,nodeId:F,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,F,I]),q(()=>{let e=L,t=ee.current;if(e&&(ee.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return R(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,R,v]);let ue={open:T,side:ce.side,align:ce.align,anchorHidden:ce.anchorHidden,nested:x.type===`menu`,instant:M},B=x.type===`menubar`&&x.context.modal;Yw(T&&(B||E&&P!==`trigger-hover`),D===`touch`,j,k);let V=Lw(e,ue,{styles:ce.positionerStyles,transitionStatus:A,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),de=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&P!==`trigger-hover`||x.type===`menubar`&&x.context.modal),fe=null;return x.type===`menubar`?fe=x.context.contentElement:x.type===void 0&&(fe=k),/*#__PURE__*/ (0,Z.jsxs)(lT.Provider,{value:ce,children:[de&&/*#__PURE__*/ (0,Z.jsx)(Fw,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:Cw(!T),cutout:fe}),/*#__PURE__*/ (0,Z.jsx)(fb,{id:F,children:/*#__PURE__*/ (0,Z.jsx)(uw,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:V})})]})}),TT=/*#__PURE__*/ O.createContext(null);function ET(e){let t=O.useContext(TT);if(t===null&&!e)throw Error(oh(5));return t}const DT={...nS,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}};var OT=class extends Xh{constructor(e,t,n=!1){let r=new Yx,i=AT(r,t,n,e);super(i,kT(r),DT),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function kT(e){return{positionerRef:/*#__PURE__*/ O.createRef(),popupRef:/*#__PURE__*/ O.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:/*#__PURE__*/ O.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ O.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function AT(e,t,n=!1,r){return{...Xx(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ob,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Yh,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const jT=/*#__PURE__*/ O.createContext(void 0);function MT(){return O.useContext(jT)}const NT=Ih(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=cT(!0),_=fT(!0),v=ET(!0),y=MT(),b=O.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=xy(),S=xy(),C=lb(),w=b.type===`menu`?b.store:void 0,T=(n??a)&&w?.state.transitionStatus===`starting`,E=dh(()=>T?w?.state.instantType:void 0).current,D=PT({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b,disabled:o,highlightItemOnHover:h,modal:b.type===void 0?s:void 0,rootId:x,instantType:E},S,C!=null);D.useControlledProp(`openProp`,n),D.useControlledProp(`triggerIdProp`,p),D.useContextCallback(`onOpenChangeComplete`,i);let k=D.useState(`floatingTreeRoot`),A=db(k),j=D.useState(`open`),M=D.useState(`activeTriggerElement`),N=D.useState(`positionerElement`),P=D.useState(`hoverEnabled`),F=D.useState(`disabled`),I=D.useState(`lastOpenChangeReason`),L=D.useState(`parent`),ee=D.useState(`activeIndex`),R=D.useState(`payload`),te=D.useState(`floatingParentNodeId`),ne=O.useRef(null),re=O.useRef(L.type!==`context-menu`),ie=Ag(),ae=O.useRef(!0),z=Ag(),oe=te!=null,{openMethod:se,triggerProps:ce}=kC(j);D.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:L.type===void 0?s:void 0,openMethod:se,rootId:x}),Gx(D);let{forceUnmount:le,transitionStatus:ue}=Kx(j,D,()=>{D.set(`allowMouseEnter`,!1)},T),B=Px(D.context.popupRef);O.useEffect(()=>{if(E===void 0)return;let e=()=>{D.state.instantType===E&&D.set(`instantType`,void 0)};if(!j){e();return}if(ue!==void 0)return;if(D.context.popupRef.current==null){e();return}let t=new AbortController;return B(e,t.signal),()=>{t.abort()}},[E,j,ue,B,D]),q(()=>{g&&!_?D.update({parent:{type:`context-menu`,context:g},floatingNodeId:A,floatingParentNodeId:C}):_&&D.update({floatingNodeId:A,floatingParentNodeId:C})},[g,_,A,C,D]),O.useEffect(()=>{if(j||(ne.current=null),L.type===`context-menu`){if(!j){ie.clear(),re.current=!1;return}ie.start(500,()=>{re.current=!0})}},[ie,j,L.type]),q(()=>{!j&&!P&&D.set(`hoverEnabled`,!0)},[j,P,D]);let V=J((e,t)=>{let n=t.reason;if(!e&&!D.select(`open`)||j===e&&t.trigger===M&&I===n)return;let i=Ux(t);if(!e&&t.trigger==null&&(t.trigger=M??void 0),r?.(e,t),t.isCanceled)return;D.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!ae.current)return;e&&n===`trigger-focus`?(ae.current=!1,z.start(300,()=>{ae.current=!0})):(ae.current=!0,z.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);ne.current=t.event;let c=Hx(D.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,D.update(c)}),de=Ax({popupStore:D,floatingRootContext:D.state.floatingRootContext,floatingId:S,nested:C!=null,onOpenChange:V}),fe=de.context.events;q(()=>{let e=({open:e,eventDetails:t})=>V(e,t);return fe.on(`setOpen`,e),()=>{fe?.off(`setOpen`,e)}},[fe,V]);let pe=O.useCallback(()=>{D.setOpen(!1,X(K_))},[D]);O.useImperativeHandle(u,()=>({unmount:le,close:pe}),[le,pe]);let me;L.type===`context-menu`&&(me=L.context),O.useImperativeHandle(me?.positionerRef,()=>N,[N]),O.useImperativeHandle(me?.actionsRef,()=>({setOpen:V}),[V]);let he=Eb(de,{enabled:!F,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||ne.current?.type===`contextmenu`||re.current},externalTree:oe?k:void 0}),ge=PC(),_e=O.useCallback(e=>{D.select(`activeIndex`)!==e&&D.set(`activeIndex`,e)},[D]),ve=CS(de,{enabled:!F,listRef:D.context.itemDomElements,activeIndex:ee,nested:L.type!==void 0,loopFocus:c,orientation:l,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:ge===`rtl`,disabledIndices:Jh,onNavigate:_e,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:oe?k:void 0,focusItemOnHover:h}),ye=O.useCallback(e=>{D.context.typingRef.current=e},[D]),be=wS(de,{enabled:!F,listRef:D.context.itemLabels,elementsRef:D.context.itemDomElements,activeIndex:ee,resetMs:500,onMatch:e=>{j&&e!==ee&&D.set(`activeIndex`,e)},onTyping:ye}),xe=O.useMemo(()=>{let e=Oy(be.reference,ve.reference,he.reference,{onMouseMove(){D.set(`allowMouseEnter`,!0)}},ce);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=j,e},[D,be.reference,ve.reference,he.reference,ce,j]),Se=O.useMemo(()=>{let e=Oy(ve.trigger,he.trigger,ce);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ve.trigger,he.trigger,ce]);dh(()=>(D.update({inactiveTriggerProps:Se}),null)),qx(D,{floatingRootContext:de,activeTriggerProps:xe,inactiveTriggerProps:Se,popupProps:O.useMemo(()=>Oy(Ix,{id:S,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":M?.id,onMouseMove(){D.set(`allowMouseEnter`,!0),L.type===`menu`&&D.set(`hoverEnabled`,!1)},onClick(){D.select(`hoverEnabled`)&&D.set(`hoverEnabled`,!1)},onKeyDown(e){let t=D.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},be.floating,ve.floating,he.floating),[M,S,l,L.type,D,be.floating,ve.floating,he.floating]),itemProps:ve.item??Yh});let Ce=O.useMemo(()=>({store:D,parent:b}),[D,b]),we=/*#__PURE__*/ (0,Z.jsxs)(dT.Provider,{value:Ce,children:[f&&/*#__PURE__*/ (0,Z.jsx)(zx,{handle:f,store:D}),typeof t==`function`?t({payload:R}):t]});return L.type===void 0||L.type===`context-menu`?/*#__PURE__*/ (0,Z.jsx)(pb,{externalTree:k,children:we}):we});function PT(e,t,n){return dh(()=>new OT(e,t,n)).current}function FT(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=zC(),{ref:i,index:a}=$w(e),o=n===a,s=O.useRef(null),c=gh(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function IT(e){let{render:t,className:n,style:r,state:i=Yh,props:a=Jh,refs:o=Jh,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=FT({metadata:s});return Hy(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function LT(e){if(rg(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!hg(e))return LT(vg(e))}function RT(e,t){let n=O.useRef(null);function r(t){$y.flushSync(()=>{e.setOpen(!1,X(z_,t.nativeEvent,t.currentTarget))}),Zv(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Qv(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{$y.flushSync(()=>{e.setOpen(!1,X(z_,n.nativeEvent,n.currentTarget))});let i=Xv(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&Y(r,i);){let e=i;if(i=qv(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function zT(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=O.useRef(!1);return O.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Cg(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Yh,[t,n,r])}const BT=Lh(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=fT(!0),h=rS(d)??m?.store;if(!h)throw Error(oh(85));let g=gC(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=O.useRef(null),S=HT(),C=zC(!0),w=ub(),T=O.useMemo(()=>w??new ob,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Wx(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:db(T),floatingParentNodeId:lb(),keyboardEventRelay:C?.relayKeyboardEvent}),k=S.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&S.context.disabled,{getButtonProps:M,buttonRef:N}=HC({disabled:j,native:o});O.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let P=O.useRef(null),F=Ag(),I=J(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Y(P.current,t)||Y(h.select(`positionerElement`),t)||t===P.current||(t==null||LT(t)!==h.select(`rootId`))&&(KC(e,P.current)||T.events.emit(`close`,{domEvent:e,reason:W_}))});O.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Cg(P.current).addEventListener(`mouseup`,I,{once:!0})},[y,I,h]);let L=k&&S.context.hasSubmenuOpen,ee=gS(v,{enabled:(c??L)&&!j&&(!k||L&&!D),handleClose:AS({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=VT(y,h.select(`lastOpenChangeReason`)),te=Cb(v,{enabled:!j,event:y&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),ne=cS(v,{enabled:!j&&L}),re=zT({open:y,enabled:k,mouseDownAction:`open`}),ie=O.useMemo(()=>Oy(ne.reference,te.reference),[ne.reference,te.reference]),ae=h.useState(`triggerProps`,D),{preFocusGuardRef:z,handlePreFocusGuardFocus:oe,handleFocusTargetFocus:se}=RT(h,x),ce={disabled:j,open:y},le=[P,t,N,E,x],ue=[ie,ee??Yh,ae,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Cg(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},re,p,M],B=Hy(`button`,e,{enabled:!k,stateAttributesMapping:h_,state:ce,ref:le,props:ue});return k?/*#__PURE__*/ (0,Z.jsx)(IT,{tag:`button`,render:n,className:r,style:i,state:ce,refs:le,props:ue,stateAttributesMapping:h_}):y?/*#__PURE__*/ (0,Z.jsxs)(O.Fragment,{children:[/*#__PURE__*/ (0,Z.jsx)(J_,{ref:z,onFocus:oe},`${g}-pre-focus-guard`),/*#__PURE__*/ (0,Z.jsx)(O.Fragment,{children:B},g),/*#__PURE__*/ (0,Z.jsx)(J_,{ref:h.context.triggerFocusTargetRef,onFocus:se},`${g}-post-focus-guard`)]}):/*#__PURE__*/ (0,Z.jsx)(O.Fragment,{children:B},g)});function VT(e,t){let n=Ag(),[r,i]=O.useState(!1);return q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function HT(){let e=ET(!0);return O.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}const UT=/*#__PURE__*/ O.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Hy(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function WT(e){let[t,n]=O.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=O.useRef(null),i=O.useRef(null),a=O.useRef(null),o=O.useRef(null),s=O.useRef(!0),c=O.useRef(null),l=xy(),u=O.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return/*#__PURE__*/ (0,Z.jsx)(sT.Provider,{value:u,children:/*#__PURE__*/ (0,Z.jsx)(dT.Provider,{value:void 0,children:/*#__PURE__*/ (0,Z.jsx)(NT,{...e})})})}const GT=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=cT(!1),{store:m}=fT(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=O.useRef(null),v=O.useRef(null),y=Ag(),b=Ag(),x=O.useRef(!1),S=O.useRef(null);function C(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),x.current=!1,s.current?.setOpen(!0,X(N_,n)),b.start(500,()=>{x.current=!0})}function w(e){if(g)return;d.current=!0,Jg(e),C(e.clientX,e.clientY,e.nativeEvent);let t=Cg(_.current);S.current?.abort();let n=new AbortController;S.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!x.current)return;b.clear(),x.current=!1;let t=t_(e);Y(u.current,t)||p&&t&&LT(t)===p||s.current?.setOpen(!1,X(W_,e))},{once:!0,signal:n.signal})}function T(){y.clear(),v.current=null}function E(e){if(g){T();return}if(d.current=!1,e.touches.length!==1){T();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(500,()=>{C(n.x,n.y,e.nativeEvent)})}function D(e){if(e.touches.length!==1){T();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&T()}}return O.useEffect(()=>()=>{S.current?.abort()},[]),O.useEffect(()=>{function e(e){if(g)return;let t=t_(e);(Y(_.current,t)||Y(c.current,t)||Y(l.current,t))&&e.preventDefault()}return wg(Cg(_.current),`contextmenu`,e)},[l,g,c]),Hy(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:w,onTouchStart:E,onTouchMove:D,onTouchEnd:T,onTouchCancel:T,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:h_})}),KT=wT,qT=/*#__PURE__*/ O.createContext(void 0);function JT(e){let t=O.useContext(qT);if(t===void 0&&!e)throw Error(oh(47));return t}const YT={...nS,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};var XT=class extends Xh{constructor(e,t,n){let r=new Yx;super(ZT(e,r,t,n),QT(r),YT)}setOpen=(e,t)=>{let n=t.reason===P_,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Ux(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Hx(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),$y.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function ZT(e,t,n,r=!1){let i={...Xx(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function QT(e){return{popupRef:/*#__PURE__*/ O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:/*#__PURE__*/ O.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ O.createRef(),stickIfOpenTimeout:new kg,triggerElements:e}}const $T=Ih(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=tE(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Jx(u,d),Gx(u);let{forceUnmount:m}=Kx(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),O.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),O.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,X(K_))}),[m,u]);let h=d||f;return/*#__PURE__*/ (0,Z.jsxs)(qT.Provider,{value:u,children:[s&&/*#__PURE__*/ (0,Z.jsx)(zx,{handle:s,store:u}),h&&/*#__PURE__*/ (0,Z.jsx)(nE,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function eE(e){return JT(!0)?/*#__PURE__*/ (0,Z.jsx)($T,{props:e}):/*#__PURE__*/ (0,Z.jsx)(pb,{children:/*#__PURE__*/ (0,Z.jsx)($T,{props:e})})}function tE(e,t){let n=Rx((e,n)=>new XT(t,e,n));return O.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function nE({store:e,modal:t}){let n=Eb(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return qx(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}const rE=Lh(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=JT(!0),h=rS(s)??m;if(!h)throw Error(oh(74));let g=gC(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=O.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=Wx(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),k=gS(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:AS(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=Cb(v,{stickIfOpen:T}),j=OC(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,C),{getButtonProps:N,buttonRef:P}=HC({disabled:a,native:o}),F={open(e){return e&&w===`trigger-press`?h_.open(e):m_.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:ee}=RT(h,x),R=Hy(`button`,e,{state:{disabled:a,open:y},ref:[P,t,S,x],props:[A.reference,k,M,j,{"data-base-ui-click-trigger":``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,N],stateAttributesMapping:F}),te=/*#__PURE__*/ (0,Z.jsx)(O.Fragment,{children:R},g);return C&&!D?/*#__PURE__*/ (0,Z.jsxs)(O.Fragment,{children:[/*#__PURE__*/ (0,Z.jsx)(J_,{ref:I,onFocus:L}),te,/*#__PURE__*/ (0,Z.jsx)(J_,{ref:h.context.triggerFocusTargetRef,onFocus:ee})]}):te}),iE=/*#__PURE__*/ O.createContext(void 0);function aE(){let e=O.useContext(iE);if(e===void 0)throw Error(oh(45));return e}const oE=/*#__PURE__*/ O.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return JT().useState(`mounted`)||n?/*#__PURE__*/ (0,Z.jsx)(iE.Provider,{value:n,children:/*#__PURE__*/ (0,Z.jsx)(ib,{ref:t,...r})}):null}),sE=/*#__PURE__*/ O.createContext(void 0);function cE(){let e=O.useContext(sE);if(!e)throw Error(oh(46));return e}const lE=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Zy,..._}=e,v=JT(),y=aE(),b=db(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),N=O.useRef(null),P=Px(k),F=Mw({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:M}),I=x.useState(`domReferenceElement`);q(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return P(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,v]);let L=E===!0&&w!==`trigger-hover`;Yw(C&&L,D===`touch`,k,T);let ee=v.useStateSetter(`positionerElement`),R=Lw(e,{open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:_,refs:[t,ee],hidden:!S,inert:!C});return/*#__PURE__*/ (0,Z.jsxs)(sE.Provider,{value:F,children:[S&&L&&/*#__PURE__*/ (0,Z.jsx)(Fw,{inert:Cw(!C),cutout:T}),/*#__PURE__*/ (0,Z.jsx)(fb,{id:b,children:R})]})}),uE=/*#__PURE__*/ O.createContext(void 0);function dE(){let[e,t]=O.useState(0),n=J(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:O.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const fE=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=JT(),l=cE(),u=vT(!0)!=null,{context:d,hasClosePart:f}=dE(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Fx({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),mS(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Lx(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Hy(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Ix,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&yT.has(e.key)&&e.stopPropagation()}},Iw(g),s],stateAttributesMapping:__});return/*#__PURE__*/ (0,Z.jsx)(Sb,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:rg(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:/*#__PURE__*/ (0,Z.jsx)(uE.Provider,{value:d,children:M})})}),pE=/*#__PURE__*/ O.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=JT(),s=gC(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Hy(`h2`,e,{ref:t,props:[{id:s},a]})});function mE({children:e}){return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`frame`,children:[e,/* @__PURE__ */ (0,Z.jsx)(`i`,{className:`dots`,"aria-hidden":!0})]})}function hE(e){return/* @__PURE__ */ (0,Z.jsxs)(NT,{...e.onOpenChange?{onOpenChange:e.onOpenChange}:{},children:[/* @__PURE__ */ (0,Z.jsx)(BT,{className:e.className??`tool`,"aria-label":e.title,title:e.title,children:e.trigger}),/* @__PURE__ */ (0,Z.jsx)(CT,{children:/* @__PURE__ */ (0,Z.jsx)(wT,{className:`positioner`,align:`end`,sideOffset:4,children:/* @__PURE__ */ (0,Z.jsx)(mE,{children:/* @__PURE__ */ (0,Z.jsx)(bT,{className:`menu`,children:e.children})})})})]})}function gE(e){return/* @__PURE__ */ (0,Z.jsxs)(WT,{...e.onOpenChange?{onOpenChange:e.onOpenChange}:{},children:[/* @__PURE__ */ (0,Z.jsx)(GT,{render:e.children}),/* @__PURE__ */ (0,Z.jsx)(CT,{children:/* @__PURE__ */ (0,Z.jsx)(KT,{className:`positioner`,children:/* @__PURE__ */ (0,Z.jsx)(mE,{children:/* @__PURE__ */ (0,Z.jsx)(bT,{className:`menu`,children:e.menu})})})})]})}const _E={onContextMenuCapture:e=>e.stopPropagation()};function vE(e){return/* @__PURE__ */ (0,Z.jsxs)(gT,{className:`item${e.danger?` danger`:``}`,onClick:e.onClick,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`grow`,children:e.children}),e.hint&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`hint`,children:e.hint})]})}const yE=()=>/* @__PURE__ */ (0,Z.jsx)(UT,{className:`separator`});function bE({emojis:e,onPick:t}){return/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`emoji-row`,children:e.map(e=>/* @__PURE__ */ (0,Z.jsx)(gT,{className:`item emoji`,title:`:${e}:`,onClick:()=>t(e),children:Oe(e)},e))})}const xE=Object.keys(be);function SE(e){let[t,n]=(0,O.useState)(!1),r=t=>{n(t),e.onOpenChange?.(t)};return/* @__PURE__ */ (0,Z.jsxs)(eE,{open:t,onOpenChange:r,children:[/* @__PURE__ */ (0,Z.jsx)(rE,{className:`tool`,"aria-label":`add a reaction`,title:`add a reaction`,children:e.trigger}),/* @__PURE__ */ (0,Z.jsx)(oE,{children:/* @__PURE__ */ (0,Z.jsx)(lE,{className:`positioner`,align:`end`,sideOffset:4,children:/* @__PURE__ */ (0,Z.jsx)(mE,{children:/* @__PURE__ */ (0,Z.jsx)(fE,{className:`menu emoji-grid`,children:xE.map(t=>/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`emoji`,title:`:${t}:`,onClick:()=>{e.onPick(t),r(!1)},children:Oe(t)},t))})})})})]})}function CE(e){return/* @__PURE__ */ (0,Z.jsxs)(LC,{items:e.items,value:e.value,onValueChange:e.onChange,openOnInputClick:!0,autoHighlight:!1,children:[/* @__PURE__ */ (0,Z.jsxs)(`label`,{className:`suggest ${e.className??``}`,children:[e.prefix&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`prefix`,children:e.prefix}),/* @__PURE__ */ (0,Z.jsx)(iw,{placeholder:e.placeholder,autoFocus:e.autoFocus,spellCheck:!1,onKeyDown:t=>{t.key===`Enter`&&!t.currentTarget.getAttribute(`aria-activedescendant`)&&e.onEnter&&(t.preventDefault(),e.onEnter())}})]}),/* @__PURE__ */ (0,Z.jsx)(Sw,{children:/* @__PURE__ */ (0,Z.jsx)(Xw,{className:`positioner`,align:`start`,sideOffset:4,children:/* @__PURE__ */ (0,Z.jsx)(mE,{children:/* @__PURE__ */ (0,Z.jsxs)(Qw,{className:`menu list`,children:[/* @__PURE__ */ (0,Z.jsx)(oT,{className:`empty-item`,children:`nothing yet: type a new one`}),/* @__PURE__ */ (0,Z.jsx)(_w,{children:t=>/* @__PURE__ */ (0,Z.jsx)(aT,{value:t,className:`item`,children:e.label?e.label(t):t},t)})]})})})})]})}function wE(e){let[t,n]=(0,O.useState)(``),[r,i]=(0,O.useState)(``),a=(0,O.useRef)(null),o=()=>{let a=t.trim();a&&(e.onSet(a,r.trim()),n(``),i(``))},s=Object.entries(e.labels);return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`labels-editor`,children:[s.length===0?/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`hint`,children:`no labels`}):/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`label-rows`,children:s.map(([t,n])=>/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`label-row`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`label-key`,children:t}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`label-value`,children:n||`—`}),/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`remove ${t}`,onClick:()=>e.onUnset(t),children:/* @__PURE__ */ (0,Z.jsx)(ve,{size:13})})]},t))}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`label-add`,children:[/* @__PURE__ */ (0,Z.jsx)(CE,{value:t,onChange:n,items:[...e.known.keys()].filter(t=>!(t in e.labels)),placeholder:`key`,autoFocus:!0,onEnter:()=>a.current?.querySelector(`input`)?.focus()}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faint`,children:`=`}),/* @__PURE__ */ (0,Z.jsx)(`div`,{ref:a,className:`grow`,children:/* @__PURE__ */ (0,Z.jsx)(CE,{value:r,onChange:i,items:[...e.known.get(t.trim())??[]],placeholder:`value`,onEnter:o})}),/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`send small`,disabled:!t.trim(),onClick:o,children:`set`})]})]})}function TE(e){return/* @__PURE__ */ (0,Z.jsxs)(eE,{open:e.open,onOpenChange:e.onOpenChange,children:[e.trigger&&/* @__PURE__ */ (0,Z.jsx)(rE,{className:`tool`,"aria-label":e.triggerTitle??e.title,title:e.triggerTitle??e.title,children:e.trigger}),/* @__PURE__ */ (0,Z.jsx)(oE,{children:/* @__PURE__ */ (0,Z.jsx)(lE,{className:`positioner`,align:`end`,sideOffset:6,...e.anchor?{anchor:e.anchor}:{},children:/* @__PURE__ */ (0,Z.jsx)(mE,{children:/* @__PURE__ */ (0,Z.jsxs)(fE,{className:`menu popover`,children:[/* @__PURE__ */ (0,Z.jsx)(pE,{className:`popover-title`,children:e.title}),e.children]})})})})]})}function EE(e){let[t,n]=(0,O.useState)(!1);return/* @__PURE__ */ (0,Z.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":e.label,tabIndex:0,className:`resize ${e.side}${t?` dragging`:``}`,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),n(!0)},onPointerMove:n=>t&&e.onDrag(n.clientX),onPointerUp:()=>{n(!1),e.onDone()},onPointerCancel:()=>{n(!1),e.onDone()},onKeyDown:t=>{t.key===`ArrowLeft`&&e.onStep(-16),t.key===`ArrowRight`&&e.onStep(16)},children:/* @__PURE__ */ (0,Z.jsx)(`i`,{})})}const DE=e=>`board.draft:${e}`;function OE(e){try{return sessionStorage.getItem(DE(e))??``}catch{return``}}function kE(e,t){try{t?sessionStorage.setItem(DE(e),t):sessionStorage.removeItem(DE(e))}catch{}}function AE(e,t,n,r,i){e.focus(),e.setSelectionRange(t,n),document.execCommand(`insertText`,!1,r)||e.setRangeText(r,t,n,`end`),e.setSelectionRange(i[0],i[1]),e.dispatchEvent(new Event(`input`,{bubbles:!0}))}const jE=/^(\s*)([-*]|\d+\.)\s(.*)$/;function ME(e){let[t,n]=(0,O.useState)(()=>OE(e.scope)),[r,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)({}),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)([]),p=(0,O.useRef)(null),m=(0,O.useRef)(null),h=e=>{let t=e.filter(e=>e.size<=4194304||(Pm(`${e.name} is over ${ke/1024/1024} MB`),!1));f(e=>{let n=[...e,...t];return n.length>10&&Pm(`a message carries at most 10 files`),n.slice(0,10)}),p.current?.focus()};(0,O.useEffect)(()=>{n(OE(e.scope)),!matchMedia(`(max-width: 900px)`).matches&&!e.channels&&p.current?.focus({preventScroll:!0})},[e.scope]),(0,O.useLayoutEffect)(()=>{let e=p.current;e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,160)}px`},[t]);let g=t=>{n(t),kE(e.scope,t)},_=r.trim().replace(/^#/,``),v=(t.trim().length>0||d.length>0)&&(!e.channels||_.length>0),y=()=>{if(t.trim()||d.length!==0){if(e.channels&&!_)return Pm(`pick a channel to post in`);e.onSend({text:t.trim(),noSync:a,channel:_,labels:s,files:d}),g(``),c({}),f([])}},b=(e,t)=>{let{selectionStart:n,selectionEnd:r,value:i}=e;AE(e,n,r,`${t}${i.slice(n,r)}${t}`,[n+t.length,r+t.length])},x=t=>{let n=t.currentTarget,r=t.metaKey||t.ctrlKey;if(t.key===`Escape`)return n.blur();if(r&&!t.shiftKey&&[`b`,`i`,`e`].includes(t.key.toLowerCase()))return t.preventDefault(),b(n,{b:`**`,i:`_`,e:"`"}[t.key.toLowerCase()]);if(t.key===`ArrowUp`&&!n.value&&e.onEditLast)return t.preventDefault(),e.onEditLast();if(t.key!==`Enter`||t.nativeEvent.isComposing)return;if(r)return t.preventDefault(),y();if(t.shiftKey)return;let i=n.selectionStart;if(i===n.selectionEnd){let e=n.value.lastIndexOf(`
381
+ `,i-1)+1,r=n.value.slice(e,i),a=jE.exec(r);if(a){if(t.preventDefault(),!a[3].trim())return AE(n,e,i,``,[e,e]);let r=/^\d+\.$/.test(a[2])?`${Number.parseInt(a[2],10)+1}.`:a[2],o=`\n${a[1]}${r} `;return AE(n,i,i,o,[i+o.length,i+o.length])}}t.preventDefault(),y()},S=Object.entries(s);return/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`composer`,children:/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`composer-box`,onClick:e=>{e.target.closest(`button, input, [role="dialog"]`)||p.current?.focus()},children:[e.channels&&/* @__PURE__ */ (0,Z.jsx)(CE,{className:`composer-channel`,prefix:`#`,value:r,onChange:i,items:e.channels,placeholder:`channel`,label:e=>/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faint`,children:`#`}),e]}),onEnter:()=>p.current?.focus()}),S.length>0&&/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`chips composer-labels`,children:S.map(([e,t])=>/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`label`,children:[e,`=`,t,/* @__PURE__ */ (0,Z.jsx)(`button`,{title:`remove ${e}`,onClick:()=>c(t=>{let n={...t};return delete n[e],n}),children:/* @__PURE__ */ (0,Z.jsx)(ve,{size:11})})]},e))}),/* @__PURE__ */ (0,Z.jsx)(`textarea`,{ref:p,"data-composer":e.role,rows:2,maxLength:1e4,value:t,placeholder:e.placeholder,onChange:e=>g(e.target.value),onKeyDown:x,onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),h(t))}}),d.length>0&&/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`chips composer-files`,children:d.map((e,t)=>/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`file`,children:[/* @__PURE__ */ (0,Z.jsx)(ae,{size:14,strokeWidth:1.75}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`file-name`,children:e.name}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faint`,children:Me(e.size)}),/* @__PURE__ */ (0,Z.jsx)(`button`,{title:`remove ${e.name}`,onClick:()=>f(e=>e.filter((e,n)=>n!==t)),children:/* @__PURE__ */ (0,Z.jsx)(ve,{size:11})})]},t))}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`composer-footer`,children:[/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`attach files (or paste them)`,onClick:()=>m.current?.click(),children:/* @__PURE__ */ (0,Z.jsx)(fe,{size:14})}),/* @__PURE__ */ (0,Z.jsx)(`input`,{ref:m,type:`file`,multiple:!0,hidden:!0,onChange:e=>{h([...e.target.files??[]]),e.target.value=``}}),/* @__PURE__ */ (0,Z.jsx)(TE,{title:`labels`,trigger:/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(ge,{size:14}),S.length>0&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`count`,children:S.length})]}),triggerTitle:`labels for this message`,open:l,onOpenChange:u,children:/* @__PURE__ */ (0,Z.jsx)(wE,{labels:s,known:e.known,onSet:(e,t)=>c(n=>({...n,[e]:t})),onUnset:e=>c(t=>{let n={...t};return delete n[e],n})})}),/* @__PURE__ */ (0,Z.jsxs)(`button`,{className:`tool${a?` on`:``}`,"aria-pressed":a,title:a?`board only: this message stays off Slack and GitHub`:`syncs to Slack and GitHub (click to keep it on the board)`,onClick:()=>o(!a),children:[/* @__PURE__ */ (0,Z.jsx)(ee,{size:14}),a&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`tool-label`,children:`board only`})]}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`hint`,children:`enter to send · shift+enter for a new line`}),/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`send`,disabled:!v,onMouseDown:e=>e.preventDefault(),onClick:y,children:`send`})]})]})})}function NE(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(!0),i=(0,O.useRef)(null),a=(0,O.useRef)(!1),o=(0,O.useRef)(!1),s=(0,O.useRef)(e.first);s.current=e.first;let c=(0,O.useRef)(e.last),[l,u]=(0,O.useState)(!1),d=()=>{let e=t.current;e.scrollTop=e.scrollHeight,r.current=!0,u(!1)};return(0,O.useLayoutEffect)(()=>{d(),c.current=e.last,o.current=!1},[e.scope]),(0,O.useLayoutEffect)(()=>{let n=t.current;i.current?(n.scrollTop=n.scrollHeight-i.current.height+i.current.top,i.current=null):r.current?n.scrollTop=n.scrollHeight:e.last!==c.current&&u(!0),c.current=e.last},[e.first,e.last]),(0,O.useEffect)(()=>{let e=new ResizeObserver(()=>{r.current&&!i.current&&(t.current.scrollTop=t.current.scrollHeight)});return e.observe(n.current),()=>e.disconnect()},[]),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`feed-wrap`,children:[/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`feed`,ref:t,onScroll:()=>{let n=t.current;if(r.current=n.scrollHeight-n.scrollTop-n.clientHeight<48,r.current&&u(!1),n.scrollTop<240&&e.older&&!a.current&&!o.current){a.current=!0;let t=s.current;i.current={height:n.scrollHeight,top:n.scrollTop},e.older().then(e=>requestAnimationFrame(()=>{s.current===t&&(i.current=null),a.current=!1,o.current=!e}))}},children:/* @__PURE__ */ (0,Z.jsx)(`div`,{ref:n,children:e.children})}),l&&/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`jump`,onClick:d,children:`new messages ↓`})]})}function PE(){let e=Fm();return/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`toasts`,role:`status`,children:e.map(e=>/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`toast`,children:e.text},e.id))})}function FE(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const IE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RE={};function zE(e,t){return((t||RE).jsx?LE:IE).test(e)}const BE=/[ \t\n\f\r]/g;function VE(e){return typeof e==`object`?e.type===`text`&&HE(e.value):HE(e)}function HE(e){return e.replace(BE,``)===``}var UE=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};UE.prototype.normal={},UE.prototype.property={},UE.prototype.space=void 0;function WE(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new UE(n,r,t)}function GE(e){return e.toLowerCase()}var KE=class{constructor(e,t){this.attribute=t,this.property=e}};KE.prototype.attribute=``,KE.prototype.booleanish=!1,KE.prototype.boolean=!1,KE.prototype.commaOrSpaceSeparated=!1,KE.prototype.commaSeparated=!1,KE.prototype.defined=!1,KE.prototype.mustUseProperty=!1,KE.prototype.number=!1,KE.prototype.overloadedBoolean=!1,KE.prototype.property=``,KE.prototype.spaceSeparated=!1,KE.prototype.space=void 0;var qE=/* @__PURE__ */ s({boolean:()=>YE,booleanish:()=>XE,commaOrSpaceSeparated:()=>eD,commaSeparated:()=>$E,number:()=>Q,overloadedBoolean:()=>ZE,spaceSeparated:()=>QE});let JE=0;const YE=tD(),XE=tD(),ZE=tD(),Q=tD(),QE=tD(),$E=tD(),eD=tD();function tD(){return 2**++JE}const nD=Object.keys(qE);var rD=class extends KE{constructor(e,t,n,r){let i=-1;if(super(e,t),iD(this,`space`,r),typeof n==`number`)for(;++i<nD.length;){let e=nD[i];iD(this,nD[i],(n&qE[e])===qE[e])}}};rD.prototype.defined=!0;function iD(e,t,n){n&&(e[t]=n)}function aD(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new rD(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[GE(r)]=r,n[GE(a.attribute)]=r}return new UE(t,n,e.space)}const oD=aD({properties:{ariaActiveDescendant:null,ariaAtomic:XE,ariaAutoComplete:null,ariaBusy:XE,ariaChecked:XE,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:QE,ariaCurrent:null,ariaDescribedBy:QE,ariaDetails:null,ariaDisabled:XE,ariaDropEffect:QE,ariaErrorMessage:null,ariaExpanded:XE,ariaFlowTo:QE,ariaGrabbed:XE,ariaHasPopup:null,ariaHidden:XE,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:QE,ariaLevel:Q,ariaLive:null,ariaModal:XE,ariaMultiLine:XE,ariaMultiSelectable:XE,ariaOrientation:null,ariaOwns:QE,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:XE,ariaReadOnly:XE,ariaRelevant:null,ariaRequired:XE,ariaRoleDescription:QE,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:XE,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function sD(e,t){return t in e?e[t]:t}function cD(e,t){return sD(e,t.toLowerCase())}const lD=aD({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:$E,acceptCharset:QE,accessKey:QE,action:null,allow:null,allowFullScreen:YE,allowPaymentRequest:YE,allowUserMedia:YE,alpha:YE,alt:null,as:null,async:YE,autoCapitalize:null,autoComplete:QE,autoFocus:YE,autoPlay:YE,blocking:QE,capture:null,charSet:null,checked:YE,cite:null,className:QE,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:XE,controls:YE,controlsList:QE,coords:Q|$E,crossOrigin:null,data:null,dateTime:null,decoding:null,default:YE,defer:YE,dir:null,dirName:null,disabled:YE,download:ZE,draggable:XE,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:YE,formTarget:null,headers:QE,height:Q,hidden:ZE,high:Q,href:null,hrefLang:null,htmlFor:QE,httpEquiv:QE,id:null,imageSizes:null,imageSrcSet:null,inert:YE,inputMode:null,integrity:null,is:null,isMap:YE,itemId:null,itemProp:QE,itemRef:QE,itemScope:YE,itemType:QE,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:YE,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:YE,muted:YE,name:null,nonce:null,noModule:YE,noValidate:YE,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:YE,optimum:Q,pattern:null,ping:QE,placeholder:null,playsInline:YE,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:YE,referrerPolicy:null,rel:QE,required:YE,reversed:YE,rows:Q,rowSpan:Q,sandbox:QE,scope:null,scoped:YE,seamless:YE,selected:YE,shadowRootClonable:YE,shadowRootCustomElementRegistry:YE,shadowRootDelegatesFocus:YE,shadowRootMode:null,shadowRootSerializable:YE,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:XE,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:YE,useMap:null,value:XE,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:QE,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:YE,declare:YE,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:YE,noHref:YE,noShade:YE,noWrap:YE,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:XE,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:YE,disablePictureInPicture:YE,disableRemotePlayback:YE,exportParts:$E,part:QE,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:cD}),uD=aD({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:eD,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:QE,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:YE,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$E,g2:$E,glyphName:$E,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:eD,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:QE,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:eD,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:eD,rev:eD,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:eD,requiredFeatures:eD,requiredFonts:eD,requiredFormats:eD,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:eD,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:eD,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:eD,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:sD}),dD=aD({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),fD=aD({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:cD}),pD=aD({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),mD={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},hD=/[A-Z]/g,gD=/-[a-z]/g,_D=/^data[-\w.:]+$/i;function vD(e,t){let n=GE(t),r=t,i=KE;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&_D.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(gD,bD);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!gD.test(e)){let n=e.replace(hD,yD);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=rD}return new i(r,t)}function yD(e){return`-`+e.toLowerCase()}function bD(e){return e.charAt(1).toUpperCase()}const xD=WE([oD,lD,dD,fD,pD],`html`),SD=WE([oD,uD,dD,fD,pD],`svg`);function CD(e){return e.join(` `).trim()}var wD=/* @__PURE__ */ o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
382
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=/* @__PURE__ */ Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),TD=/* @__PURE__ */ o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;let n=t(wD());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),ED=/* @__PURE__ */ o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),DD=/* @__PURE__ */ o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(TD()),r=ED();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const OD=AD(`end`),kD=AD(`start`);function AD(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function jD(e){let t=kD(e),n=OD(e);if(t&&n)return{start:t,end:n}}function MD(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?PD(e.position):`start`in e||`end`in e?PD(e):`line`in e||`column`in e?ND(e):``}function ND(e){return FD(e&&e.line)+`:`+FD(e&&e.column)}function PD(e){return ND(e&&e.start)+`-`+ND(e&&e.end)}function FD(e){return e&&typeof e==`number`?e:1}var ID=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=MD(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ID.prototype.file=``,ID.prototype.name=``,ID.prototype.reason=``,ID.prototype.message=``,ID.prototype.stack=``,ID.prototype.column=void 0,ID.prototype.line=void 0,ID.prototype.ancestors=void 0,ID.prototype.cause=void 0,ID.prototype.fatal=void 0,ID.prototype.place=void 0,ID.prototype.ruleId=void 0,ID.prototype.source=void 0;var LD=/* @__PURE__ */ l(DD(),1);const RD={}.hasOwnProperty,zD=/* @__PURE__ */ new Map,BD=/[A-Z]/g,VD=/* @__PURE__ */ new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),HD=/* @__PURE__ */ new Set([`td`,`th`]),UD=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function WD(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=tO(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=eO(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?SD:xD,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=GD(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function GD(e,t,n){if(t.type===`element`)return KD(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qD(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return YD(e,t,n);if(t.type===`mdxjsEsm`)return JD(e,t);if(t.type===`root`)return XD(e,t,n);if(t.type===`text`)return ZD(e,t)}function KD(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=SD,e.schema=i),e.ancestors.push(t);let a=sO(e,t.tagName,!1),o=nO(e,t),s=iO(e,t);return VD.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!VE(e)})),QD(e,o,a,t),$D(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qD(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}cO(e,t.position)}function JD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cO(e,t.position)}function YD(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=SD,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:sO(e,t.name,!0),o=rO(e,t),s=iO(e,t);return QD(e,o,a,t),$D(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function XD(e,t,n){let r={};return $D(r,iO(e,t)),e.create(t,e.Fragment,r,n)}function ZD(e,t){return t.value}function QD(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $D(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eO(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function tO(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=kD(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function nO(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&RD.call(t.properties,i)){let a=aO(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&HD.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function rO(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cO(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else cO(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function iO(e,t){let n=[],r=-1,i=e.passKeys?/* @__PURE__ */ new Map:zD;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=GD(e,a,o);s!==void 0&&n.push(s)}return n}function aO(e,t,n){let r=vD(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?FE(n):CD(n)),r.property===`style`){let t=typeof n==`object`?n:oO(e,String(n));return e.stylePropertyNameCase===`css`&&(t=lO(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?mD[r.property]||r.property:r.attribute,n]}}function oO(e,t){try{return(0,LD.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ID("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=UD+`#cannot-parse-style-attribute`,r}}function sO(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=zE(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=zE(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return RD.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);cO(e)}function cO(e,t){let n=new ID("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=UD+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function lO(e){let t={},n;for(n in e)RD.call(e,n)&&(t[uO(n)]=e[n]);return t}function uO(e){let t=e.replace(BD,dO);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function dO(e){return`-`+e.toLowerCase()}const fO={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},pO={};function mO(e,t){let n=t||pO;return hO(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function hO(e,t,n){if(_O(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return gO(e.children,t,n)}return Array.isArray(e)?gO(e,t,n):``}function gO(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=hO(e[i],t,n);return r.join(``)}function _O(e){return!!(e&&typeof e==`object`)}const vO=document.createElement(`i`);function yO(e){let t=`&`+e+`;`;vO.innerHTML=t;let n=vO.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function bO(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function xO(e,t){return e.length>0?(bO(e,e.length,0,t),e):t}const SO={}.hasOwnProperty;function CO(e){let t={},n=-1;for(;++n<e.length;)wO(t,e[n]);return t}function wO(e,t){let n;for(n in t){let r=(SO.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){SO.call(r,a)||(r[a]=[]);let e=i[a];TO(r[a],Array.isArray(e)?e:e?[e]:[])}}}function TO(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);bO(e,0,0,r)}function EO(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function DO(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const OO=zO(/[A-Za-z]/),kO=zO(/[\dA-Za-z]/),AO=zO(/[#-'*+\--9=?A-Z^-~]/);function jO(e){return e!==null&&(e<32||e===127)}const MO=zO(/\d/),NO=zO(/[\dA-Fa-f]/),PO=zO(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function FO(e){return e!==null&&(e<0||e===32)}function IO(e){return e===-2||e===-1||e===32}const LO=zO(/\p{P}|\p{S}/u),RO=zO(/\s/);function zO(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function BO(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&kO(e.charCodeAt(n+1))&&kO(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function VO(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return IO(r)?(e.enter(n),s(r)):t(r)}function s(r){return IO(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function HO(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&IO(t)?(e.enter(r),c(t)):l(t)}function c(t){return IO(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}const UO={tokenize:WO};function WO(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),VO(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var GO=class{constructor(){this.index=/* @__PURE__ */ new Map,this.map=[]}add(e,t,n){KO(this,e,t,n,!1)}addBefore(e,t,n){KO(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function KO(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}const qO={tokenize:YO},JO={tokenize:XO};function YO(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new GO;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(JO,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(JO,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new GO;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function XO(e,t,n){return VO(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function ZO(e){if(e===null||FO(e)||RO(e))return 1;if(LO(e))return 2}function QO(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const $O={name:`attention`,resolveAll:ek,tokenize:tk};function ek(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};nk(o,-a),nk(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=xO(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=xO(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=xO(r,QO(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=xO(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=xO(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),bO(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function tk(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ZO(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=ZO(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function nk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const rk={name:`autolink`,tokenize:ik};function ik(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return OO(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||kO(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||kO(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||jO(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):AO(t)?(e.consume(t),l):n(t)}function u(e){return kO(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||kO(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const ak={partial:!0,tokenize:ok};function ok(e,t,n){return r;function r(t){return IO(t)?VO(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}const sk={continuation:{tokenize:lk},exit:uk,name:`blockQuote`,tokenize:ck};function ck(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return IO(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function lk(e,t,n){let r=this;return i;function i(t){return IO(t)?VO(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(sk,t,n)(r)}}function uk(e){e.exit(`blockQuote`)}const dk={name:`characterEscape`,tokenize:fk};function fk(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return PO(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const pk={name:`characterReference`,tokenize:mk};function mk(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=kO,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=NO,u):(e.enter(`characterReferenceValue`),a=7,o=MO,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===kO&&!yO(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const hk={partial:!0,tokenize:gk};function gk(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const _k={concrete:!0,name:`codeFenced`,tokenize:vk};function vk(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),IO(t)?VO(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(hk,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):IO(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),VO(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&IO(t)?VO(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(hk,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),IO(t)?VO(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),IO(t)?VO(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}const yk={name:`codeIndented`,tokenize:xk},bk={partial:!0,tokenize:Sk};function xk(e,t,n){return r;function r(t){return e.enter(`codeIndented`),HO(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):$(t)?e.attempt(bk,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Sk(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):HO(e,t,a,`linePrefix`,4,4)(o)}function a(e){return $(e)?i(e):n(e)}}const Ck={name:`codeText`,previous:Tk,resolve:wk,tokenize:Ek};function wk(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Tk(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ek(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Dk=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ok(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ok(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ok(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Ok(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ok(this.left,t.reverse())}}}};function Ok(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kk(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Dk(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ak(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return bO(e,0,1/0,u.slice(0)),!l}function Ak(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const jk={resolve:Nk,tokenize:Pk},Mk={partial:!0,tokenize:Fk};function Nk(e){return kk(e),e}function Pk(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(Mk,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Fk(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),VO(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ik(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||jO(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||FO(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||jO(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Lk(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||
383
383
  /* c8 ignore next 3 */
384
- l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):MO(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||MO(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!PO(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ik(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):MO(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),zO(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||MO(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Lk(e,t){let n;return r;function r(i){return MO(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):PO(i)?zO(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Rk={name:`definition`,tokenize:Bk},zk={partial:!0,tokenize:Vk};function Bk(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Fk.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=wO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return NO(t)?Lk(e,l)(t):l(t)}function l(t){return Pk(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(zk,d,d)(t)}function d(t){return PO(t)?zO(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||MO(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Vk(e,t,n){return r;function r(t){return NO(t)?Lk(e,i)(t):n(t)}function i(t){return Ik(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return PO(t)?zO(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||MO(e)?t(e):n(e)}}const Hk={name:`hardBreakEscape`,tokenize:Uk};function Uk(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return MO(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Wk={name:`headingAtx`,resolve:Gk,tokenize:Kk};function Gk(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};_O(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Kk(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||NO(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||MO(n)?(e.exit(`atxHeading`),t(n)):PO(n)?zO(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||NO(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const qk=/* @__PURE__ */ `address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Jk=[`pre`,`script`,`style`,`textarea`],Yk={concrete:!0,name:`htmlFlow`,resolveTo:Zk,tokenize:Qk},Xk={partial:!0,tokenize:$k};function Zk(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Qk(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):TO(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):TO(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return TO(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||NO(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Jk.includes(l)?(i=1,r.interrupt?t(s):O(s)):qk.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||EO(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return PO(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||TO(t)?(e.consume(t),b):PO(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||EO(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):PO(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):PO(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||MO(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||NO(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||PO(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||MO(t)?O(t):PO(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):MO(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Xk,R,k)(t)):t===null||MO(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(pk,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||MO(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Jk.includes(n)?(e.consume(t),L):O(t)}return TO(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||MO(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function $k(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(rk,t,n)}}const eA={name:`htmlText`,tokenize:tA};function tA(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):TO(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):TO(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):MO(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):MO(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):MO(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):MO(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return TO(t)?(e.consume(t),S):n(t)}function S(t){return t===45||EO(t)?(e.consume(t),S):C(t)}function C(t){return MO(t)?(o=C,N(t)):PO(t)?(e.consume(t),C):M(t)}function w(t){return t===45||EO(t)?(e.consume(t),w):t===47||t===62||NO(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||TO(t)?(e.consume(t),E):MO(t)?(o=T,N(t)):PO(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||EO(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):MO(t)?(o=D,N(t)):PO(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):MO(t)?(o=O,N(t)):PO(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):MO(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||NO(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||NO(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return PO(t)?zO(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}const nA={name:`labelEnd`,resolveAll:oA,resolveTo:sA,tokenize:cA},rA={tokenize:lA},iA={tokenize:uA},aA={tokenize:dA};function oA(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&_O(e,0,e.length,n),e}function sA(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=vO(o,e.slice(i+1,i+r+3)),o=vO(o,[[`enter`,l,t]]),o=vO(o,XO(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=vO(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=vO(o,e.slice(a+1)),o=vO(o,[[`exit`,s,t]]),_O(e,i,e.length,o),e}function cA(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(wO(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(rA,u,o?u:d)(t):t===91?e.attempt(iA,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(aA,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function lA(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return NO(t)?Lk(e,a)(t):a(t)}function a(t){return t===41?u(t):Pk(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return NO(t)?Lk(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ik(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return NO(t)?Lk(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function uA(e,t,n){let r=this;return i;function i(t){return Fk.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(wO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function dA(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const fA={name:`labelStartImage`,resolveAll:nA.resolveAll,tokenize:pA};function pA(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}const mA={name:`labelStartLink`,resolveAll:nA.resolveAll,tokenize:hA};function hA(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}const gA={name:`lineEnding`,tokenize:_A};function _A(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),zO(e,t,`linePrefix`)}}const vA={name:`thematicBreak`,tokenize:yA};function yA(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||MO(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),PO(t)?zO(e,s,`whitespace`)(t):s(t))}}const bA={continuation:{tokenize:wA},exit:EA,name:`list`,tokenize:CA},xA={partial:!0,tokenize:DA},SA={partial:!0,tokenize:TA};function CA(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:kO(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(vA,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return kO(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(rk,r.interrupt?n:u,e.attempt(xA,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return PO(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function wA(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(rk,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zO(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!PO(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(SA,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,zO(e,e.attempt(bA,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function TA(e,t,n){let r=this;return zO(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function EA(e){e.exit(this.containerState.type)}function DA(e,t,n){let r=this;return zO(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!PO(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const OA={name:`setextUnderline`,resolveTo:kA,tokenize:AA};function kA(e,t){let n=new UO,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function AA(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),PO(t)?zO(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||MO(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const jA={tokenize:MA};function MA(e){let t=this,n=e.attempt(rk,r,e.attempt(this.parser.constructs.flowInitial,i,zO(e,e.attempt(this.parser.constructs.flow,i,e.attempt(kk,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const NA={resolveAll:LA()},PA=IA(`string`),FA=IA(`text`);function IA(e){return{resolveAll:LA(e===`text`?RA:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function LA(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function RA(e,t){let n=new UO,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var zA=/* @__PURE__ */ s({attentionMarkers:()=>qA,contentInitial:()=>VA,disable:()=>JA,document:()=>BA,flow:()=>UA,flowInitial:()=>HA,insideSpan:()=>KA,string:()=>WA,text:()=>GA});const BA={42:bA,43:bA,45:bA,48:bA,49:bA,50:bA,51:bA,52:bA,53:bA,54:bA,55:bA,56:bA,57:bA,62:ak},VA={91:Rk},HA={[-2]:_k,[-1]:_k,32:_k},UA={35:Wk,42:vA,45:[OA,vA],60:Yk,61:OA,95:vA,96:hk,126:hk},WA={38:dk,92:lk},GA={[-5]:gA,[-4]:gA,[-3]:gA,33:fA,38:dk,42:ZO,60:[tk,eA],91:mA,92:[Hk,lk],93:nA,95:ZO,96:xk},KA={null:[ZO,NA]},qA={null:[42,95]},JA={null:[]};function YA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=vO(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=XO(a,l.events,l),l.events):[]}function f(e,t){return ZA(p(e),t)}function p(e){return XA(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){MO(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&_O(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function XA(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ZA(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
384
+ l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!IO(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Rk(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),VO(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function zk(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):IO(i)?VO(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Bk={name:`definition`,tokenize:Hk},Vk={partial:!0,tokenize:Uk};function Hk(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Lk.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=DO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return FO(t)?zk(e,l)(t):l(t)}function l(t){return Ik(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Vk,d,d)(t)}function d(t){return IO(t)?VO(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Uk(e,t,n){return r;function r(t){return FO(t)?zk(e,i)(t):n(t)}function i(t){return Rk(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return IO(t)?VO(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}const Wk={name:`hardBreakEscape`,tokenize:Gk};function Gk(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Kk={name:`headingAtx`,resolve:qk,tokenize:Jk};function qk(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};bO(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Jk(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||FO(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):IO(n)?VO(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||FO(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Yk=/* @__PURE__ */ `address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Xk=[`pre`,`script`,`style`,`textarea`],Zk={concrete:!0,name:`htmlFlow`,resolveTo:$k,tokenize:eA},Qk={partial:!0,tokenize:tA};function $k(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function eA(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):OO(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):OO(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return OO(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||FO(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Xk.includes(l)?(i=1,r.interrupt?t(s):O(s)):Yk.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||kO(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return IO(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||OO(t)?(e.consume(t),b):IO(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||kO(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):IO(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):IO(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||FO(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||IO(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):IO(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Qk,ee,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(hk,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Xk.includes(n)?(e.consume(t),L):O(t)}return OO(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||$(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function tA(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ak,t,n)}}const nA={name:`htmlText`,tokenize:rA};function rA(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):OO(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):OO(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return OO(t)?(e.consume(t),S):n(t)}function S(t){return t===45||kO(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):IO(t)?(e.consume(t),C):M(t)}function w(t){return t===45||kO(t)?(e.consume(t),w):t===47||t===62||FO(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||OO(t)?(e.consume(t),E):$(t)?(o=T,N(t)):IO(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||kO(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):IO(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):IO(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||FO(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||FO(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return IO(t)?VO(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}const iA={name:`labelEnd`,resolveAll:cA,resolveTo:lA,tokenize:uA},aA={tokenize:dA},oA={tokenize:fA},sA={tokenize:pA};function cA(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&bO(e,0,e.length,n),e}function lA(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=xO(o,e.slice(i+1,i+r+3)),o=xO(o,[[`enter`,l,t]]),o=xO(o,QO(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=xO(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=xO(o,e.slice(a+1)),o=xO(o,[[`exit`,s,t]]),bO(e,i,e.length,o),e}function uA(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(DO(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(aA,u,o?u:d)(t):t===91?e.attempt(oA,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(sA,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function dA(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return FO(t)?zk(e,a)(t):a(t)}function a(t){return t===41?u(t):Ik(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return FO(t)?zk(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Rk(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return FO(t)?zk(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function fA(e,t,n){let r=this;return i;function i(t){return Lk.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(DO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function pA(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const mA={name:`labelStartImage`,resolveAll:iA.resolveAll,tokenize:hA};function hA(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}const gA={name:`labelStartLink`,resolveAll:iA.resolveAll,tokenize:_A};function _A(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}const vA={name:`lineEnding`,tokenize:yA};function yA(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),VO(e,t,`linePrefix`)}}const bA={name:`thematicBreak`,tokenize:xA};function xA(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),IO(t)?VO(e,s,`whitespace`)(t):s(t))}}const SA={continuation:{tokenize:EA},exit:OA,name:`list`,tokenize:TA},CA={partial:!0,tokenize:kA},wA={partial:!0,tokenize:DA};function TA(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:MO(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(bA,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return MO(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ak,r.interrupt?n:u,e.attempt(CA,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return IO(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function EA(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ak,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,VO(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!IO(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(wA,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,VO(e,e.attempt(SA,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function DA(e,t,n){let r=this;return VO(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function OA(e){e.exit(this.containerState.type)}function kA(e,t,n){let r=this;return VO(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!IO(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const AA={name:`setextUnderline`,resolveTo:jA,tokenize:MA};function jA(e,t){let n=new GO,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function MA(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),IO(t)?VO(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const NA={tokenize:PA};function PA(e){let t=this,n=e.attempt(ak,r,e.attempt(this.parser.constructs.flowInitial,i,VO(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jk,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const FA={resolveAll:zA()},IA=RA(`string`),LA=RA(`text`);function RA(e){return{resolveAll:zA(e===`text`?BA:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function zA(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function BA(e,t){let n=new GO,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var VA=/* @__PURE__ */ s({attentionMarkers:()=>YA,contentInitial:()=>UA,disable:()=>XA,document:()=>HA,flow:()=>GA,flowInitial:()=>WA,insideSpan:()=>JA,string:()=>KA,text:()=>qA});const HA={42:SA,43:SA,45:SA,48:SA,49:SA,50:SA,51:SA,52:SA,53:SA,54:SA,55:SA,56:SA,57:SA,62:sk},UA={91:Bk},WA={[-2]:yk,[-1]:yk,32:yk},GA={35:Kk,42:bA,45:[AA,bA],60:Zk,61:AA,95:bA,96:_k,126:_k},KA={38:pk,92:dk},qA={[-5]:vA,[-4]:vA,[-3]:vA,33:mA,38:pk,42:$O,60:[rk,nA],91:gA,92:[Wk,dk],93:iA,95:$O,96:Ck},JA={null:[$O,FA]},YA={null:[42,95]},XA={null:[]};function ZA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=xO(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=QO(a,l.events,l),l.events):[]}function f(e,t){return $A(p(e),t)}function p(e){return QA(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&bO(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function QA(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function $A(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
385
385
  `;break;case-3:o=`\r
386
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function QA(e){let t={constructs:bO([zA,...(e||{}).extensions||[]]),content:n(VO),defined:[],document:n(GO),flow:n(jA),lazy:{},string:n(PA),text:n(FA)};return t;function n(e){return n;function n(n){return YA(t,e,n)}}}function $A(e){for(;!Dk(e););return e}const ej=/[\0\t\n\r]/g;function tj(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){ej.lastIndex=c;let n=ej.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const nj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rj(e){return e.replace(nj,ij)}function ij(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return CO(n.slice(t?2:1),t?16:10)}return gO(n)||e}const aj={}.hasOwnProperty;function oj(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),sj(n)($A(QA(n).document().write(tj()(e,t,!0))))}function sj(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(fe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(V),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(H),hardBreakTrailing:a(H),htmlFlow:a(ue,o),htmlFlowData:T,htmlText:a(ue,o),htmlTextData:T,image:a(de),label:o,link:a(fe),listItem:a(me),listItemValue:f,listOrdered:a(pe,d),listUnordered:a(pe),paragraph:a(he),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(V),strong:a(ge),thematicBreak:a(ve)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:B,autolinkProtocol:ie,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:re,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ee,resourceDestinationString:I,resourceTitleString:L,resource:R,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};lj(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];aj.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||dj).call(a,void 0,e[0])}for(r.position={start:cj(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:cj(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:cj(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||dj).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+kD({start:e.start,end:e.end})+`): it’s not open`);n.position.end=cj(e.end)}function u(){return dO(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=wO(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=_e(),n.position={start:cj(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=cj(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=cj(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=rj(t),n.identifier=wO(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=wO(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function te(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=CO(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=gO(t);let i=this.stack[this.stack.length-1];i.value+=r}function re(e){let t=this.stack.pop();t.position.end=cj(e.end)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function B(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function V(){return{type:`heading`,depth:0,children:[]}}function H(){return{type:`break`}}function ue(){return{type:`html`,value:``}}function de(){return{type:`image`,title:null,url:``,alt:null}}function fe(){return{type:`link`,title:null,url:``,children:[]}}function pe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function he(){return{type:`paragraph`,children:[]}}function ge(){return{type:`strong`,children:[]}}function _e(){return{type:`text`,value:``}}function ve(){return{type:`thematicBreak`}}}function cj(e){return{line:e.line,column:e.column,offset:e.offset}}function lj(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?lj(e,r):uj(e,r)}}function uj(e,t){let n;for(n in t)if(aj.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function dj(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+kD({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+kD({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+kD({start:t.start,end:t.end})+`) is still open`)}function fj(e){let t=this;t.parser=n;function n(n){return oj(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function pj(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function mj(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
387
- `}]}function hj(e,t){let n=t.value?t.value+`
388
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function gj(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _j(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vj(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=RO(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function yj(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bj(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function xj(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Sj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xj(e,t);let i={src:RO(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Cj(e,t){let n={src:RO(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function wj(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Tj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xj(e,t);let i={href:RO(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ej(e,t){let n={href:RO(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Dj(e,t,n){let r=e.all(t),i=n?Oj(n):kj(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
386
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function ej(e){let t={constructs:CO([VA,...(e||{}).extensions||[]]),content:n(UO),defined:[],document:n(qO),flow:n(NA),lazy:{},string:n(IA),text:n(LA)};return t;function n(e){return n;function n(n){return ZA(t,e,n)}}}function tj(e){for(;!kk(e););return e}const nj=/[\0\t\n\r]/g;function rj(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){nj.lastIndex=c;let n=nj.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const ij=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aj(e){return e.replace(ij,oj)}function oj(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return EO(n.slice(t?2:1),t?16:10)}return yO(n)||e}const sj={}.hasOwnProperty;function cj(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),lj(n)(tj(ej(n).document().write(rj()(e,t,!0))))}function lj(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(B),blockQuote:a(oe),characterEscape:T,characterReference:T,codeFenced:a(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(se,o),codeText:a(ce,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(le),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ue),hardBreakEscape:a(V),hardBreakTrailing:a(V),htmlFlow:a(de,o),htmlFlowData:T,htmlText:a(de,o),htmlTextData:T,image:a(fe),label:o,link:a(pe),listItem:a(he),listItemValue:f,listOrdered:a(me,d),listUnordered:a(me),paragraph:a(ge),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(B),strong:a(_e),thematicBreak:a(ye)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:z,autolinkProtocol:ae,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:re,characterReference:ie,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};dj(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];sj.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||pj).call(a,void 0,e[0])}for(r.position={start:uj(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:uj(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:uj(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||pj).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+MD({start:e.start,end:e.end})+`): it’s not open`);n.position.end=uj(e.end)}function u(){return mO(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=DO(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ve(),n.position={start:uj(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=uj(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=uj(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=aj(t),n.identifier=DO(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function R(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=DO(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ne(e){this.data.characterReferenceType=e.type}function re(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=EO(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=yO(t);let i=this.stack[this.stack.length-1];i.value+=r}function ie(e){let t=this.stack.pop();t.position.end=uj(e.end)}function ae(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function z(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[]}}function se(){return{type:`code`,lang:null,meta:null,value:``}}function ce(){return{type:`inlineCode`,value:``}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ue(){return{type:`emphasis`,children:[]}}function B(){return{type:`heading`,depth:0,children:[]}}function V(){return{type:`break`}}function de(){return{type:`html`,value:``}}function fe(){return{type:`image`,title:null,url:``,alt:null}}function pe(){return{type:`link`,title:null,url:``,children:[]}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function _e(){return{type:`strong`,children:[]}}function ve(){return{type:`text`,value:``}}function ye(){return{type:`thematicBreak`}}}function uj(e){return{line:e.line,column:e.column,offset:e.offset}}function dj(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?dj(e,r):fj(e,r)}}function fj(e,t){let n;for(n in t)if(sj.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function pj(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+MD({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+MD({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+MD({start:t.start,end:t.end})+`) is still open`)}function mj(e){let t=this;t.parser=n;function n(n){return cj(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function hj(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function gj(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
387
+ `}]}function _j(e,t){let n=t.value?t.value+`
388
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function vj(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yj(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bj(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=BO(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function xj(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sj(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Cj(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function wj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cj(e,t);let i={src:BO(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Tj(e,t){let n={src:BO(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Ej(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Dj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cj(e,t);let i={href:BO(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Oj(e,t){let n={href:BO(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function kj(e,t,n){let r=e.all(t),i=n?Aj(n):jj(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
389
389
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
390
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Oj(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=kj(n[r])}return t}function kj(e){return e.spread??e.children.length>1}function Aj(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function jj(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mj(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Nj(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pj(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ED(t.children[1]),o=TD(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Fj(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Ij(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lj(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Rj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Rj(t.slice(i),i>0,!1)),a.join(``)}function Rj(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function zj(e,t){let n={type:`text`,value:Lj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Bj(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Vj={blockquote:pj,break:mj,code:hj,delete:gj,emphasis:_j,footnoteReference:vj,heading:yj,html:bj,imageReference:Sj,image:Cj,inlineCode:wj,linkReference:Tj,link:Ej,listItem:Dj,list:Aj,paragraph:jj,root:Mj,strong:Nj,table:Pj,tableCell:Ij,tableRow:Fj,text:zj,thematicBreak:Bj,toml:Hj,yaml:Hj,definition:Hj,footnoteDefinition:Hj};function Hj(){}const{defineProperty:Uj}=Object,Wj=typeof self==`object`?self:globalThis,Gj=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Wj[e](t)},Kj=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Uj(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(/* @__PURE__ */ new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(/* @__PURE__ */ new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Wj[e]==`function`?Gj(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Gj(a,o),i)};return r},qj=e=>Kj(/* @__PURE__ */ new Map,e)(0),{toString:Jj}={},{keys:Yj,is:Xj}=Object,Zj=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Jj.call(e).slice(8,-1);switch(n){case`Array`:return[1,``];case`Object`:return[2,``];case`Date`:return[3,``];case`RegExp`:return[4,``];case`Map`:return[5,``];case`Set`:return[6,``];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Qj=([e,t])=>e===0&&(t===`function`||t===`symbol`),$j=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Zj(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Xj(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Yj(o))(e||!Qj(Zj(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?``:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Qj(Zj(n))||Qj(Zj(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Qj(Zj(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},eM=(e,{json:t,lossy:n}={})=>{let r=[];return $j(!(t||n),!!t,/* @__PURE__ */ new Map,r)(e),r};var tM=typeof structuredClone==`function`?
390
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Aj(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=jj(n[r])}return t}function jj(e){return e.spread??e.children.length>1}function Mj(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Nj(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pj(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Fj(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ij(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=kD(t.children[1]),o=OD(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Lj(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Rj(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zj(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Bj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Bj(t.slice(i),i>0,!1)),a.join(``)}function Bj(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Vj(e,t){let n={type:`text`,value:zj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Hj(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Uj={blockquote:hj,break:gj,code:_j,delete:vj,emphasis:yj,footnoteReference:bj,heading:xj,html:Sj,imageReference:wj,image:Tj,inlineCode:Ej,linkReference:Dj,link:Oj,listItem:kj,list:Mj,paragraph:Nj,root:Pj,strong:Fj,table:Ij,tableCell:Rj,tableRow:Lj,text:Vj,thematicBreak:Hj,toml:Wj,yaml:Wj,definition:Wj,footnoteDefinition:Wj};function Wj(){}const{defineProperty:Gj}=Object,Kj=typeof self==`object`?self:globalThis,qj=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Kj[e](t)},Jj=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Gj(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(/* @__PURE__ */ new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(/* @__PURE__ */ new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Kj[e]==`function`?qj(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(qj(a,o),i)};return r},Yj=e=>Jj(/* @__PURE__ */ new Map,e)(0),{toString:Xj}={},{keys:Zj,is:Qj}=Object,$j=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Xj.call(e).slice(8,-1);switch(n){case`Array`:return[1,``];case`Object`:return[2,``];case`Date`:return[3,``];case`RegExp`:return[4,``];case`Map`:return[5,``];case`Set`:return[6,``];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},eM=([e,t])=>e===0&&(t===`function`||t===`symbol`),tM=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=$j(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Qj(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Zj(o))(e||!eM($j(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?``:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(eM($j(n))||eM($j(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!eM($j(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},nM=(e,{json:t,lossy:n}={})=>{let r=[];return tM(!(t||n),!!t,/* @__PURE__ */ new Map,r)(e),r};var rM=typeof structuredClone==`function`?
391
391
  /* c8 ignore start */
392
- (e,t)=>t&&(`json`in t||`lossy`in t)?qj(eM(e,t)):structuredClone(e):(e,t)=>qj(eM(e,t));function nM(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function rM(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function iM(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||nM,r=e.options.footnoteBackLabel||rM,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=RO(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...tM(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
392
+ (e,t)=>t&&(`json`in t||`lossy`in t)?Yj(nM(e,t)):structuredClone(e):(e,t)=>Yj(nM(e,t));function iM(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function aM(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function oM(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||iM,r=e.options.footnoteBackLabel||aM,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=BO(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...rM(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
393
393
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
394
- `}]}}const aM=(function(e){if(e==null)return uM;if(typeof e==`function`)return lM(e);if(typeof e==`object`)return Array.isArray(e)?oM(e):sM(e);if(typeof e==`string`)return cM(e);throw Error(`Expected function, string, or object as test`)});function oM(e){let t=[],n=-1;for(;++n<e.length;)t[n]=aM(e[n]);return lM(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function sM(e){let t=e;return lM(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function cM(e){return lM(t);function t(t){return t&&t.type===e}}function lM(e){return t;function t(t,n,r){return!!(dM(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function uM(){return!0}function dM(e){return typeof e==`object`&&!!e&&`type`in e}function fM(e){return e}const pM=[];function mM(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=aM(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+fM(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=pM,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=hM(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function hM(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?pM:[e]}function gM(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),mM(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const _M={}.hasOwnProperty,vM={};function yM(e,t){let n=t||vM,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a={all:s,applyData:xM,definitionById:r,footnoteById:i,footnoteCounts:/* @__PURE__ */ new Map,footnoteOrder:[],handlers:{...Vj,...n.handlers},one:o,options:n,patch:bM,wrap:CM};return gM(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(_M.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=tM(n);return r.children=a.all(e),r}return tM(e)}return(a.options.unknownHandler||SM)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=wM(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=wM(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function bM(e,t){e.position&&(t.position=OD(e))}function xM(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,tM(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function SM(e,t){let n=t.data||{},r=`value`in t&&!(_M.call(n,`hProperties`)||_M.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function CM(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
394
+ `}]}}const sM=(function(e){if(e==null)return fM;if(typeof e==`function`)return dM(e);if(typeof e==`object`)return Array.isArray(e)?cM(e):lM(e);if(typeof e==`string`)return uM(e);throw Error(`Expected function, string, or object as test`)});function cM(e){let t=[],n=-1;for(;++n<e.length;)t[n]=sM(e[n]);return dM(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function lM(e){let t=e;return dM(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function uM(e){return dM(t);function t(t){return t&&t.type===e}}function dM(e){return t;function t(t,n,r){return!!(pM(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function fM(){return!0}function pM(e){return typeof e==`object`&&!!e&&`type`in e}function mM(e){return e}const hM=[];function gM(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=sM(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+mM(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=hM,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=_M(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function _M(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?hM:[e]}function vM(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),gM(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const yM={}.hasOwnProperty,bM={};function xM(e,t){let n=t||bM,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a={all:s,applyData:CM,definitionById:r,footnoteById:i,footnoteCounts:/* @__PURE__ */ new Map,footnoteOrder:[],handlers:{...Uj,...n.handlers},one:o,options:n,patch:SM,wrap:TM};return vM(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(yM.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=rM(n);return r.children=a.all(e),r}return rM(e)}return(a.options.unknownHandler||wM)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=EM(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=EM(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function SM(e,t){e.position&&(t.position=jD(e))}function CM(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,rM(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function wM(e,t){let n=t.data||{},r=`value`in t&&!(yM.call(n,`hProperties`)||yM.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function TM(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
395
395
  `});++r<e.length;)r&&n.push({type:`text`,value:`
396
396
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
397
- `}),n}function wM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function TM(e,t){let n=yM(e,t),r=n.one(e,void 0),i=iM(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
398
- `},i)),a}function EM(e,t){return e&&`run`in e?async function(n,r){let i=TM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return TM(n,{file:r,...e||t})}}function DM(e){if(e)throw e}var OM=/* @__PURE__ */ o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function kM(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function AM(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?jM(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function jM(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const MM={basename:NM,dirname:PM,extname:FM,join:IM,sep:`/`};function NM(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);zM(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function PM(e){if(zM(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function FM(e){zM(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function IM(...e){let t=-1,n;for(;++t<e.length;)zM(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:LM(n)}function LM(e){zM(e);let t=e.codePointAt(0)===47,n=RM(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function RM(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function zM(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const BM={cwd:VM};function VM(){return`/`}function HM(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function UM(e){if(typeof e==`string`)e=new URL(e);else if(!HM(e)){let t=/* @__PURE__ */ TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=/* @__PURE__ */ TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return WM(e)}function WM(e){if(e.hostname!==``){let e=/* @__PURE__ */ TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=/* @__PURE__ */ TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}const GM=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var KM=class{constructor(e){let t;t=e?HM(e)?{path:e}:typeof e==`string`||XM(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:BM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<GM.length;){let e=GM[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)GM.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?MM.basename(this.path):void 0}set basename(e){JM(e,`basename`),qM(e,`basename`),this.path=MM.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?MM.dirname(this.path):void 0}set dirname(e){YM(this.basename,`dirname`),this.path=MM.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?MM.extname(this.path):void 0}set extname(e){if(qM(e,`extname`),YM(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=MM.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){HM(e)&&(e=UM(e)),JM(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?MM.basename(this.path,this.extname):void 0}set stem(e){JM(e,`stem`),qM(e,`stem`),this.path=MM.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new ND(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function qM(e,t){if(e&&e.includes(MM.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+MM.sep+"`")}function JM(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function YM(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function XM(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const ZM=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var QM=/* @__PURE__ */ l(OM(),1);const $M={}.hasOwnProperty,eN=new class e extends ZM{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=AM()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,QM.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(rN(`data`,this.frozen),this.namespace[e]=t,this):$M.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rN(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=oN(e),n=this.parser||this.Parser;return tN(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),tN(`process`,this.parser||this.Parser),nN(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=oN(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);cN(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),tN(`processSync`,this.parser||this.Parser),nN(`processSync`,this.compiler||this.Compiler),this.process(e,r),aN(`processSync`,`process`,t),n;function r(e,r){t=!0,DM(e),n=r}}run(e,t,n){iN(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=oN(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),aN(`runSync`,`run`,n),r;function i(e,t){DM(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=oN(t),r=this.compiler||this.Compiler;return nN(`stringify`,r),iN(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rN(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,QM.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];kM(o)&&kM(r)&&(r=(0,QM.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function tN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function nN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function rN(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iN(e){if(!kM(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function aN(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function oN(e){return sN(e)?e:new KM(e)}function sN(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function cN(e){return typeof e==`string`||lN(e)}function lN(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const uN=[],dN={allowDangerousHtml:!0},fN=/^(https?|ircs?|mailto|xmpp)$/i,pN=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function mN(e){let t=hN(e),n=gN(e);return _N(t.runSync(t.parse(n),n),e)}function hN(e){let t=e.rehypePlugins||uN,n=e.remarkPlugins||uN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dN}:dN;return eN().use(fj).use(n).use(EM,r).use(t)}function gN(e){let t=e.children||``,n=new KM;return typeof t==`string`?n.value=t:``+t,n}function _N(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||vN;for(let e of pN)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return gM(e,l),VD(e,{Fragment:Q.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Q.jsx,jsxs:Q.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in lO)if(Object.hasOwn(lO,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=lO[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function vN(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||fN.test(e.slice(0,t))?e:``}function yN(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function bN(e,t,n){let r=aM((n||{}).ignore||[]),i=xN(t),a=-1;for(;++a<i.length;)mM(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function xN(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([SN(e[0]),CN(e[1])])}return t}function SN(e){return typeof e==`string`?new RegExp(yN(e),`g`):e}function CN(e){return typeof e==`function`?e:function(){return e}}function wN(e){bN(e,[/\r?\n|\r/g,TN])}function TN(){return{type:`break`}}function EN(){return function(e){wN(e)}}function DN(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ON=`phrasing`,kN=[`autolink`,`link`,`image`,`label`];function AN(){return{transforms:[RN],enter:{literalAutolink:MN,literalAutolinkEmail:NN,literalAutolinkHttp:NN,literalAutolinkWww:NN},exit:{literalAutolink:LN,literalAutolinkEmail:IN,literalAutolinkHttp:PN,literalAutolinkWww:FN}}}function jN(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:ON,notInConstruct:kN},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:ON,notInConstruct:kN},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:ON,notInConstruct:kN}]}}function MN(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function NN(e){this.config.enter.autolinkProtocol.call(this,e)}function PN(e){this.config.exit.autolinkProtocol.call(this,e)}function FN(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function IN(e){this.config.exit.autolinkEmail.call(this,e)}function LN(e){this.exit(e)}function RN(e){bN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zN],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,BN]],{ignore:[`link`,`linkReference`]})}function zN(e,t,n,r,i){let a=``;if(!UN(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!VN(n)))return!1;let o=HN(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function BN(e,t,n,r){return!UN(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function VN(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function HN(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=DN(e,`(`),a=DN(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function UN(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||IO(n)||FO(n))&&(!t||n!==47)}$N.peek=QN;function WN(){this.buffer()}function GN(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function KN(){this.buffer()}function qN(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function JN(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function YN(e){this.exit(e)}function XN(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZN(e){this.exit(e)}function QN(){return`[`}function $N(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function eP(){return{enter:{gfmFootnoteCallString:WN,gfmFootnoteCall:GN,gfmFootnoteDefinitionLabelString:KN,gfmFootnoteDefinition:qN},exit:{gfmFootnoteCallString:JN,gfmFootnoteCall:YN,gfmFootnoteDefinitionLabelString:XN,gfmFootnoteDefinition:ZN}}}function tP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$N},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
399
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?rP:nP))),s(),o}}function nP(e,t,n){return t===0?e:rP(e,t,n)}function rP(e,t,n){return(n?``:` `)+e}const iP=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];lP.attention=uP,lP.peek=dP;function aP(){return{canContainEols:[`delete`],enter:{strikethrough:sP},exit:{strikethrough:cP}}}function oP(){return{handlers:{delete:lP},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:iP}]}}function sP(e){this.enter({type:`delete`,children:[],position:void 0},e)}function cP(e){this.exit(e)}function lP(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function uP(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function dP(){return`~`}function fP(e){return e.length}function pP(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fP,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=mP(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=hP(r[d]);else{let e=hP(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
400
- `)}function mP(e){return e==null?``:String(e)}function hP(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const gP=aM([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function _P(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),vP);return i(),o}function vP(e,t,n){return`>`+(n?``:` `)+e}function yP(e,t){return bP(e,t.inConstruct,!0)&&!bP(e,t.notInConstruct,!1)}function bP(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function xP(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
401
- `&&!e.before&&!e.after&&yP(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
402
- `}function SP(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function CP(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function wP(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function TP(e,t,n,r){let i=wP(n),a=e.value||``;if(CP(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,EP);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(SP(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
397
+ `}),n}function EM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function DM(e,t){let n=xM(e,t),r=n.one(e,void 0),i=oM(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
398
+ `},i)),a}function OM(e,t){return e&&`run`in e?async function(n,r){let i=DM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return DM(n,{file:r,...e||t})}}function kM(e){if(e)throw e}var AM=/* @__PURE__ */ o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function jM(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function MM(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?NM(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function NM(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const PM={basename:FM,dirname:IM,extname:LM,join:RM,sep:`/`};function FM(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);VM(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function IM(e){if(VM(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function LM(e){VM(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function RM(...e){let t=-1,n;for(;++t<e.length;)VM(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:zM(n)}function zM(e){VM(e);let t=e.codePointAt(0)===47,n=BM(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function BM(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function VM(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const HM={cwd:UM};function UM(){return`/`}function WM(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function GM(e){if(typeof e==`string`)e=new URL(e);else if(!WM(e)){let t=/* @__PURE__ */ TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=/* @__PURE__ */ TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return KM(e)}function KM(e){if(e.hostname!==``){let e=/* @__PURE__ */ TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=/* @__PURE__ */ TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}const qM=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var JM=class{constructor(e){let t;t=e?WM(e)?{path:e}:typeof e==`string`||QM(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:HM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<qM.length;){let e=qM[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)qM.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?PM.basename(this.path):void 0}set basename(e){XM(e,`basename`),YM(e,`basename`),this.path=PM.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?PM.dirname(this.path):void 0}set dirname(e){ZM(this.basename,`dirname`),this.path=PM.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?PM.extname(this.path):void 0}set extname(e){if(YM(e,`extname`),ZM(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=PM.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){WM(e)&&(e=GM(e)),XM(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?PM.basename(this.path,this.extname):void 0}set stem(e){XM(e,`stem`),YM(e,`stem`),this.path=PM.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new ID(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function YM(e,t){if(e&&e.includes(PM.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+PM.sep+"`")}function XM(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ZM(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function QM(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const $M=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var eN=/* @__PURE__ */ l(AM(),1);const tN={}.hasOwnProperty,nN=new class e extends $M{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=MM()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,eN.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(aN(`data`,this.frozen),this.namespace[e]=t,this):tN.call(this.namespace,e)&&this.namespace[e]||void 0:e?(aN(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=cN(e),n=this.parser||this.Parser;return rN(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rN(`process`,this.parser||this.Parser),iN(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=cN(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);uN(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),rN(`processSync`,this.parser||this.Parser),iN(`processSync`,this.compiler||this.Compiler),this.process(e,r),sN(`processSync`,`process`,t),n;function r(e,r){t=!0,kM(e),n=r}}run(e,t,n){oN(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=cN(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),sN(`runSync`,`run`,n),r;function i(e,t){kM(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=cN(t),r=this.compiler||this.Compiler;return iN(`stringify`,r),oN(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(aN(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,eN.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];jM(o)&&jM(r)&&(r=(0,eN.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function rN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function iN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function aN(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oN(e){if(!jM(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function sN(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function cN(e){return lN(e)?e:new JM(e)}function lN(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function uN(e){return typeof e==`string`||dN(e)}function dN(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const fN=[],pN={allowDangerousHtml:!0},mN=/^(https?|ircs?|mailto|xmpp)$/i,hN=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function gN(e){let t=_N(e),n=vN(e);return yN(t.runSync(t.parse(n),n),e)}function _N(e){let t=e.rehypePlugins||fN,n=e.remarkPlugins||fN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pN}:pN;return nN().use(mj).use(n).use(OM,r).use(t)}function vN(e){let t=e.children||``,n=new JM;return typeof t==`string`?n.value=t:``+t,n}function yN(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||bN;for(let e of hN)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return vM(e,l),WD(e,{Fragment:Z.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Z.jsx,jsxs:Z.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in fO)if(Object.hasOwn(fO,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=fO[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function bN(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||mN.test(e.slice(0,t))?e:``}function xN(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function SN(e,t,n){let r=sM((n||{}).ignore||[]),i=CN(t),a=-1;for(;++a<i.length;)gM(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function CN(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([wN(e[0]),TN(e[1])])}return t}function wN(e){return typeof e==`string`?new RegExp(xN(e),`g`):e}function TN(e){return typeof e==`function`?e:function(){return e}}function EN(e){SN(e,[/\r?\n|\r/g,DN])}function DN(){return{type:`break`}}function ON(){return function(e){EN(e)}}function kN(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const AN=`phrasing`,jN=[`autolink`,`link`,`image`,`label`];function MN(){return{transforms:[BN],enter:{literalAutolink:PN,literalAutolinkEmail:FN,literalAutolinkHttp:FN,literalAutolinkWww:FN},exit:{literalAutolink:zN,literalAutolinkEmail:RN,literalAutolinkHttp:IN,literalAutolinkWww:LN}}}function NN(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:AN,notInConstruct:jN},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:AN,notInConstruct:jN},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:AN,notInConstruct:jN}]}}function PN(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function FN(e){this.config.enter.autolinkProtocol.call(this,e)}function IN(e){this.config.exit.autolinkProtocol.call(this,e)}function LN(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function RN(e){this.config.exit.autolinkEmail.call(this,e)}function zN(e){this.exit(e)}function BN(e){SN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VN],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,HN]],{ignore:[`link`,`linkReference`]})}function VN(e,t,n,r,i){let a=``;if(!GN(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!UN(n)))return!1;let o=WN(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function HN(e,t,n,r){return!GN(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function UN(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function WN(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=kN(e,`(`),a=kN(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function GN(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||RO(n)||LO(n))&&(!t||n!==47)}tP.peek=eP;function KN(){this.buffer()}function qN(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function JN(){this.buffer()}function YN(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function XN(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=DO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZN(e){this.exit(e)}function QN(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=DO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $N(e){this.exit(e)}function eP(){return`[`}function tP(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function nP(){return{enter:{gfmFootnoteCallString:KN,gfmFootnoteCall:qN,gfmFootnoteDefinitionLabelString:JN,gfmFootnoteDefinition:YN},exit:{gfmFootnoteCallString:XN,gfmFootnoteCall:ZN,gfmFootnoteDefinitionLabelString:QN,gfmFootnoteDefinition:$N}}}function rP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tP},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
399
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?aP:iP))),s(),o}}function iP(e,t,n){return t===0?e:aP(e,t,n)}function aP(e,t,n){return(n?``:` `)+e}const oP=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];dP.attention=fP,dP.peek=pP;function sP(){return{canContainEols:[`delete`],enter:{strikethrough:lP},exit:{strikethrough:uP}}}function cP(){return{handlers:{delete:dP},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:oP}]}}function lP(e){this.enter({type:`delete`,children:[],position:void 0},e)}function uP(e){this.exit(e)}function dP(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function fP(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function pP(){return`~`}function mP(e){return e.length}function hP(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||mP,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=gP(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=_P(r[d]);else{let e=_P(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
400
+ `)}function gP(e){return e==null?``:String(e)}function _P(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const vP=sM([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function yP(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),bP);return i(),o}function bP(e,t,n){return`>`+(n?``:` `)+e}function xP(e,t){return SP(e,t.inConstruct,!0)&&!SP(e,t.notInConstruct,!1)}function SP(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function CP(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
401
+ `&&!e.before&&!e.after&&xP(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
402
+ `}function wP(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function TP(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function EP(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function DP(e,t,n,r){let i=EP(n),a=e.value||``;if(TP(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,OP);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(wP(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
403
403
  `,encode:["`"],...o.current()})),t()}return u+=o.move(`
404
404
  `),a&&(u+=o.move(a+`
405
- `)),u+=o.move(s),c(),u}function EP(e,t,n){return(n?``:` `)+e}function DP(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function OP(e,t,n,r){let i=DP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
406
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function kP(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}AP.attention=jP,AP.peek=MP;function AP(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function jP(e,t){return{construct:`emphasis`,markers:kP(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function MP(e,t,n){return n.options.emphasis||`*`}function NP(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function PP(e,t){let n=!1;return gM(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&dO(e)&&(t.options.setext||n))}function FP(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(PP(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
405
+ `)),u+=o.move(s),c(),u}function OP(e,t,n){return(n?``:` `)+e}function kP(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function AP(e,t,n,r){let i=kP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
406
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function jP(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}MP.attention=NP,MP.peek=PP;function MP(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function NP(e,t){return{construct:`emphasis`,markers:jP(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function PP(e,t,n){return n.options.emphasis||`*`}function FP(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function IP(e,t){let n=!1;return vM(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&mO(e)&&(t.options.setext||n))}function LP(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(IP(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
407
407
  `,after:`
408
408
  `});return r(),t(),o+`
409
409
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
410
410
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
411
- `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=NP(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}IP.peek=LP;function IP(e){return e.value||``}function LP(){return`<`}RP.peek=zP;function RP(e,t,n,r){let i=DP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function zP(){return`!`}BP.peek=VP;function BP(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function VP(){return`!`}HP.peek=UP;function HP(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function UP(){return"`"}function WP(e,t){let n=dO(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}GP.peek=KP;function GP(e,t,n,r){let i=DP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(WP(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function KP(e,t,n){return WP(e,n)?`<`:`[`}qP.peek=JP;function qP(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function JP(){return`[`}function YP(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function XP(e){let t=YP(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ZP(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function QP(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function $P(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?ZP(n):YP(n),s=e.ordered?o===`.`?`)`:`.`:XP(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),QP(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function eF(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function tF(e,t,n,r){let i=eF(n),a=n.bulletCurrent||YP(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function nF(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function rF(e,t,n,r){if(!e.children.some(function(e){return gP(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function iF(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aF.attention=oF,aF.peek=sF;function aF(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function oF(e,t){return{construct:`strong`,markers:iF(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function sF(e,t,n){return n.options.strong||`*`}function cF(e,t,n,r){return n.safe(e.value,r)}function lF(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function uF(e,t,n){let r=(QP(n)+(n.options.ruleSpaces?` `:``)).repeat(lF(n));return n.options.ruleSpaces?r.slice(0,-1):r}const dF={blockquote:_P,break:xP,code:TP,definition:OP,emphasis:AP,hardBreak:xP,heading:FP,html:IP,image:RP,imageReference:BP,inlineCode:HP,link:GP,linkReference:qP,list:$P,listItem:tF,paragraph:nF,root:rF,strong:aF,text:cF,thematicBreak:uF};function fF(){return{enter:{table:pF,tableData:_F,tableHeader:_F,tableRow:hF},exit:{codeText:vF,table:mF,tableData:gF,tableHeader:gF,tableRow:gF}}}function pF(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function mF(e){this.exit(e),this.data.inTable=void 0}function hF(e){this.enter({type:`tableRow`,children:[]},e)}function gF(e){this.exit(e)}function _F(e){this.enter({type:`tableCell`,children:[]},e)}function vF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yF));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yF(e,t){return t===`|`?t:e}function bF(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
411
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=FP(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}RP.peek=zP;function RP(e){return e.value||``}function zP(){return`<`}BP.peek=VP;function BP(e,t,n,r){let i=kP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function VP(){return`!`}HP.peek=UP;function HP(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function UP(){return`!`}WP.peek=GP;function WP(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function GP(){return"`"}function KP(e,t){let n=mO(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}qP.peek=JP;function qP(e,t,n,r){let i=kP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(KP(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function JP(e,t,n){return KP(e,n)?`<`:`[`}YP.peek=XP;function YP(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function XP(){return`[`}function ZP(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function QP(e){let t=ZP(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $P(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function eF(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function tF(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?$P(n):ZP(n),s=e.ordered?o===`.`?`)`:`.`:QP(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),eF(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function nF(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function rF(e,t,n,r){let i=nF(n),a=n.bulletCurrent||ZP(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function iF(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function aF(e,t,n,r){if(!e.children.some(function(e){return vP(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function oF(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sF.attention=cF,sF.peek=lF;function sF(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function cF(e,t){return{construct:`strong`,markers:oF(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function lF(e,t,n){return n.options.strong||`*`}function uF(e,t,n,r){return n.safe(e.value,r)}function dF(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function fF(e,t,n){let r=(eF(n)+(n.options.ruleSpaces?` `:``)).repeat(dF(n));return n.options.ruleSpaces?r.slice(0,-1):r}const pF={blockquote:yP,break:CP,code:DP,definition:AP,emphasis:MP,hardBreak:CP,heading:LP,html:RP,image:BP,imageReference:HP,inlineCode:WP,link:qP,linkReference:YP,list:tF,listItem:rF,paragraph:iF,root:aF,strong:sF,text:uF,thematicBreak:fF};function mF(){return{enter:{table:hF,tableData:yF,tableHeader:yF,tableRow:_F},exit:{codeText:bF,table:gF,tableData:vF,tableHeader:vF,tableRow:vF}}}function hF(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function gF(e){this.exit(e),this.data.inTable=void 0}function _F(e){this.enter({type:`tableRow`,children:[]},e)}function vF(e){this.exit(e)}function yF(e){this.enter({type:`tableCell`,children:[]},e)}function bF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,xF));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function xF(e,t){return t===`|`?t:e}function SF(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
412
412
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
413
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return pP(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=dF.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function xF(){return{exit:{taskListCheckValueChecked:CF,taskListCheckValueUnchecked:CF,paragraph:wF}}}function SF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:TF}}}function CF(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function wF(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function TF(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=dF.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function EF(){return[AN(),eP(),aP(),fF(),xF()]}function DF(e){return{extensions:[jN(),tP(e),oP(),bF(e),SF()]}}const OF={tokenize:HF,partial:!0},kF={tokenize:UF,partial:!0},AF={tokenize:WF,partial:!0},jF={tokenize:GF,partial:!0},MF={tokenize:KF,partial:!0},NF={name:`wwwAutolink`,tokenize:BF,previous:qF},PF={name:`protocolAutolink`,tokenize:VF,previous:JF},FF={name:`emailAutolink`,tokenize:zF,previous:YF},IF={};function LF(){return{text:IF}}let RF=48;for(;RF<123;)IF[RF]=FF,RF++,RF===58?RF=65:RF===91&&(RF=97);IF[43]=FF,IF[45]=FF,IF[46]=FF,IF[95]=FF,IF[72]=[FF,PF],IF[104]=[FF,PF],IF[87]=[FF,NF],IF[119]=[FF,NF];function zF(e,t,n){let r=this,i,a;return o;function o(t){return!XF(t)||!YF.call(r,r.previous)||ZF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return XF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(MF,u,l)(t):t===45||t===95||EO(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&TO(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function BF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!qF.call(r,r.previous)||ZF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(OF,e.attempt(kF,e.attempt(AF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function VF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&JF.call(r,r.previous)&&!ZF(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(TO(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||OO(t)||NO(t)||IO(t)||FO(t)?n(t):e.attempt(kF,e.attempt(AF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function HF(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function UF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(jF,c,s)(t):t===null||NO(t)||IO(t)||t!==45&&FO(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function WF(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(jF,t,a)(o):o===null||NO(o)||IO(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function GF(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||NO(o)||IO(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||NO(e)||IO(e)?t(e):r(e)}function a(e){return TO(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):TO(t)?(e.consume(t),o):n(t)}}function KF(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return EO(e)?n(e):t(e)}}function qF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||NO(e)}function JF(e){return!TO(e)}function YF(e){return!(e===47||XF(e))}function XF(e){return e===43||e===45||e===46||e===95||EO(e)}function ZF(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const QF={tokenize:oI,partial:!0};function $F(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:rI,continuation:{tokenize:iI},exit:aI}},text:{91:{name:`gfmFootnoteCall`,tokenize:nI},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:eI,resolveTo:tI}}}}function eI(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=wO(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function tI(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function nI(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||NO(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(wO(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return NO(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function rI(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||NO(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=wO(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return NO(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),zO(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function iI(e,t,n){return e.check(rk,t,e.attempt(QF,t,n))}function aI(e){e.exit(`gfmFootnoteDefinition`)}function oI(e,t,n){let r=this;return zO(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function sI(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&_O(o,o.length,0,XO(s,e.slice(r+1,n),t)),_O(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),_O(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=YO(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=YO(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var cI=class{constructor(){this.map=[],this.index=/* @__PURE__ */ new Map}add(e,t,n){lI(this,e,t,n)}consume(e){
413
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return hP(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=pF.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function CF(){return{exit:{taskListCheckValueChecked:TF,taskListCheckValueUnchecked:TF,paragraph:EF}}}function wF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:DF}}}function TF(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function EF(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function DF(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=pF.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function OF(){return[MN(),nP(),sP(),mF(),CF()]}function kF(e){return{extensions:[NN(),rP(e),cP(),SF(e),wF()]}}const AF={tokenize:WF,partial:!0},jF={tokenize:GF,partial:!0},MF={tokenize:KF,partial:!0},NF={tokenize:qF,partial:!0},PF={tokenize:JF,partial:!0},FF={name:`wwwAutolink`,tokenize:HF,previous:YF},IF={name:`protocolAutolink`,tokenize:UF,previous:XF},LF={name:`emailAutolink`,tokenize:VF,previous:ZF},RF={};function zF(){return{text:RF}}let BF=48;for(;BF<123;)RF[BF]=LF,BF++,BF===58?BF=65:BF===91&&(BF=97);RF[43]=LF,RF[45]=LF,RF[46]=LF,RF[95]=LF,RF[72]=[LF,IF],RF[104]=[LF,IF],RF[87]=[LF,FF],RF[119]=[LF,FF];function VF(e,t,n){let r=this,i,a;return o;function o(t){return!QF(t)||!ZF.call(r,r.previous)||$F(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return QF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(PF,u,l)(t):t===45||t===95||kO(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&OO(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function HF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!YF.call(r,r.previous)||$F(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(AF,e.attempt(jF,e.attempt(MF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function UF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&XF.call(r,r.previous)&&!$F(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(OO(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||jO(t)||FO(t)||RO(t)||LO(t)?n(t):e.attempt(jF,e.attempt(MF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function WF(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function GF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(NF,c,s)(t):t===null||FO(t)||RO(t)||t!==45&&LO(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function KF(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(NF,t,a)(o):o===null||FO(o)||RO(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function qF(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||FO(o)||RO(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||FO(e)||RO(e)?t(e):r(e)}function a(e){return OO(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):OO(t)?(e.consume(t),o):n(t)}}function JF(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return kO(e)?n(e):t(e)}}function YF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||FO(e)}function XF(e){return!OO(e)}function ZF(e){return!(e===47||QF(e))}function QF(e){return e===43||e===45||e===46||e===95||kO(e)}function $F(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const eI={tokenize:cI,partial:!0};function tI(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:aI,continuation:{tokenize:oI},exit:sI}},text:{91:{name:`gfmFootnoteCall`,tokenize:iI},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:nI,resolveTo:rI}}}}function nI(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=DO(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function rI(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function iI(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||FO(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(DO(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return FO(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function aI(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||FO(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=DO(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return FO(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),VO(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function oI(e,t,n){return e.check(ak,t,e.attempt(eI,t,n))}function sI(e){e.exit(`gfmFootnoteDefinition`)}function cI(e,t,n){let r=this;return VO(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function lI(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&bO(o,o.length,0,QO(s,e.slice(r+1,n),t)),bO(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),bO(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=ZO(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=ZO(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var uI=class{constructor(){this.map=[],this.index=/* @__PURE__ */ new Map}add(e,t,n){dI(this,e,t,n)}consume(e){
414
414
  /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
415
- if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function lI(e,t,n,r){
415
+ if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function dI(e,t,n,r){
416
416
  /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
417
- if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function uI(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function dI(){return{flow:{null:{name:`table`,tokenize:fI,resolveAll:pI}}}}function fI(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):MO(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):PO(t)?zO(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||NO(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,PO(t)?zO(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return PO(t)?zO(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||MO(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return PO(t)?zO(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||MO(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||MO(n)?(e.exit(`tableRow`),t(n)):PO(n)?zO(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||NO(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function pI(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new cI;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(hI(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=mI(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=mI(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=mI(f,t,o,i,n,d)):(o[0]=o[1],d=mI(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&hI(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=uI(t.events,n))}return e}function mI(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},gI(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=gI(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=gI(t.events,n[2]),a=gI(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},gI(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function hI(e,t,n,r,i){let a=[],o=gI(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function gI(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const _I={name:`tasklistCheck`,tokenize:yI};function vI(){return{text:{91:_I}}}function yI(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return NO(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return MO(r)?t(r):PO(r)?e.check({tokenize:bI},t,n)(r):n(r)}}function bI(e,t,n){return zO(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function xI(e){return bO([LF(),$F(),sI(e),dI(),vI()])}const SI={};function CI(e){let t=this,n=e||SI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(xI(n)),a.push(EF()),o.push(DF(n))}function wI(e,t=!1){e!==location.pathname+location.search&&(history[t?`replaceState`:`pushState`](null,``,e),dispatchEvent(new PopStateEvent(`popstate`)))}function TI(){let e=()=>{let e=new URLSearchParams(location.search),t=e.get(`thread`);return{path:location.pathname,thread:t||null,filter:{...e.get(`from`)?{from:e.get(`from`)}:{},label:e.getAll(`label`).filter(Boolean),...e.get(`text`)?{text:e.get(`text`)}:{}}}},[t,n]=(0,O.useState)(e);return(0,O.useEffect)(()=>{let t=()=>n(e());return addEventListener(`popstate`,t),()=>removeEventListener(`popstate`,t)},[]),t}function EI(e){let t=new URLSearchParams(location.search);if(e.thread!==void 0&&(e.thread===null?t.delete(`thread`):t.set(`thread`,String(e.thread))),e.filter){for(let e of[`from`,`label`,`text`])t.delete(e);e.filter.from&&t.set(`from`,e.filter.from);for(let n of e.filter.label)t.append(`label`,n);e.filter.text&&t.set(`text`,e.filter.text)}let n=t.toString();return`${location.pathname}${n?`?${n}`:``}`}function DI(e){let t=(0,O.useRef)(0),n=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;return/* @__PURE__ */ (0,Q.jsx)(`a`,{href:e.to,className:e.className,title:e.title,"aria-current":e.current?`page`:void 0,onPointerDown:r=>{r.pointerType===`mouse`&&n(r)&&(t.current=Date.now(),wI(e.to))},onClick:r=>{n(r)&&(r.preventDefault(),Date.now()-t.current>500&&wI(e.to))},children:e.children})}function OI(e=3e4){let[t,n]=(0,O.useState)(Date.now);return(0,O.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function kI(e){(0,O.useEffect)(()=>{let t=t=>{if(t.metaKey||t.ctrlKey||t.altKey||t.key.length!==1)return;let n=t.target;n!==document.body&&n.closest(`input, textarea, select, [contenteditable], [role="menu"], [role="dialog"], [role="listbox"]`)||document.querySelector(`textarea[data-composer="${CSS.escape(e)}"]`)?.focus()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e])}function AI({iso:e,prefix:t=``}){let[,n]=(0,O.useReducer)(e=>e+1,0);(0,O.useEffect)(()=>{let t,r=()=>{let i=Math.max(0,Date.now()-Date.parse(e)),a=i<6e4?1e3:i<36e5?6e4:i<864e5?36e5:864e5;t=setTimeout(()=>{n(),r()},a-i%a+20)};return r(),()=>clearTimeout(t)},[e]);let r=Date.now()-Date.parse(e);return/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`time`,title:new Date(e).toLocaleString(),children:[t,r<5e3?`now`:Ie(e)]})}const jI=[`thumbs_up`,`heart`,`laugh`,`party`,`eyes`,`check`],MI=/((?<![\w@])@[a-z0-9][\w./-]*)/gi,NI=/^@[a-z0-9][\w./-]*$/i;function PI(){let e=t=>{t.children&&t.type!==`link`&&t.type!==`inlineCode`&&t.type!==`code`&&(t.children=t.children.flatMap(t=>t.type===`text`?(t.value??``).split(MI).filter(Boolean).map(e=>NI.test(e)?{type:`mention`,value:e,data:{hName:`span`,hProperties:{className:[`mention`]},hChildren:[{type:`text`,value:e}]}}:{type:`text`,value:e}):(e(t),[t])))};return t=>e(t)}const FI=[CI,EN,PI],II={a:({href:e,children:t})=>/* @__PURE__ */ (0,Q.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t})},LI=(0,O.memo)(function({text:e,edited:t=!1}){return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`text`,...mE,children:[/* @__PURE__ */ (0,Q.jsx)(mN,{remarkPlugins:FI,components:II,skipHtml:!0,children:e}),t&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`edited`,children:` (edited)`})]})});function RI({items:e}){return e?.length?/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`links`,children:e.map(e=>/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`link-embed`,children:[/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`link-meta`,...mE,children:[e.snapshot&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`author`,children:e.snapshot.author}),e.message!==null&&/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`faint`,children:[`#`,e.message]}),/* @__PURE__ */ (0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.snapshot?`open`:e.url}),!e.snapshot&&/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`faint`,children:[`couldn't read it: `,e.unavailable??`unknown`]})]}),e.snapshot?.text&&/* @__PURE__ */ (0,Q.jsx)(LI,{text:e.snapshot.text}),e.snapshot?.files.map((e,t)=>/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`link-file`,children:[/* @__PURE__ */ (0,Q.jsx)(ie,{size:12,strokeWidth:1.75}),e.url?/* @__PURE__ */ (0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.name}):/* @__PURE__ */ (0,Q.jsx)(`span`,{children:e.name})]},t))]},e.url))}):null}const zI=/^image\/(png|jpeg|gif|webp|avif)$/,BI=/^video\/(mp4|webm)$/;function VI({items:e}){return e.length===0?null:/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`attachments`,children:e.map(e=>/* @__PURE__ */ (0,Q.jsx)(HI,{attachment:e},e.id))})}function HI({attachment:e}){let t=zI.test(e.type)?`image`:BI.test(e.type)?`video`:null,[n,r]=(0,O.useState)(null);(0,O.useEffect)(()=>{if(!t)return;let n=!0;return Jm(e.id).then(e=>n&&r(e),()=>{}),()=>{n=!1}},[e.id,t]);let i=`${e.name} · ${je(e.size)}`;return t===`image`?/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`attachment-media`,title:`${i} · click to open`,onClick:()=>n&&window.open(n,`_blank`,`noopener`),children:n&&/* @__PURE__ */ (0,Q.jsx)(`img`,{src:n,alt:e.name})}):t===`video`?/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`attachment-media`,title:i,children:n&&/* @__PURE__ */ (0,Q.jsx)(`video`,{src:n,controls:!0,preload:`metadata`})}):/* @__PURE__ */ (0,Q.jsxs)(`button`,{className:`file`,title:`download ${e.name}`,onClick:()=>void Ym(e),children:[/* @__PURE__ */ (0,Q.jsx)(ie,{size:14,strokeWidth:1.75}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`file-name`,children:e.name}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faint`,children:je(e.size)})]})}const UI=[`#E01E5A`,`#36C5F0`,`#2EB67D`,`#ECB22E`],WI={slack:{name:`Slack`,paths:(Dp.slack.match(/M[^M]+/g)??[]).map((e,t)=>({d:e,fill:UI[Math.floor(t/2)]}))},github:{name:`GitHub`,paths:[{d:Dp.github,fill:`currentColor`}]},whatsapp:{name:`WhatsApp`,paths:[{d:Dp.whatsapp,fill:`#25D366`}]}};function GI({platform:e}){let t=WI[e];return t?/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`source`,title:`from ${t.name}`,children:/* @__PURE__ */ (0,Q.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-label":t.name,children:t.paths.map((e,t)=>/* @__PURE__ */ (0,Q.jsx)(`path`,{d:e.d,fill:e.fill},t))})}):/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`source text`,children:e.slice(0,1)})}function KI({name:e,url:t,size:n=28}){let[r,i]=(0,O.useState)(!1);return/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`avatar`,style:{width:n,height:n,fontSize:n*.43},children:t&&!r?/* @__PURE__ */ (0,Q.jsx)(`img`,{src:t,alt:``,referrerPolicy:`no-referrer`,onError:()=>i(!0)}):e.slice(0,1).toUpperCase()})}const qI=e=>new Date(e).toDateString();function JI(e,t){let n=new Date(e),r=new Date(t);return n.toDateString()===r.toDateString()?`today`:n.toDateString()===(/* @__PURE__ */ new Date(t-864e5)).toDateString()?`yesterday`:n.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function YI({iso:e,now:t}){return/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`divider`,children:JI(e,t)})}function XI(e){let t=[];return e.messages.forEach((n,r)=>{let i=e.messages[r-1],a=i??e.after;(!a||qI(a.createdAt)!==qI(n.createdAt))&&t.push(/* @__PURE__ */ (0,Q.jsx)(YI,{iso:n.createdAt,now:e.now},`d${n.id}`));let o=fm(i,n,i?(e.options.replies?.(i).length??0)>0:!1);t.push(/* @__PURE__ */ (0,Q.jsx)($I,{m:n,options:e.options,continued:o},n.id))}),/* @__PURE__ */ (0,Q.jsx)(Q.Fragment,{children:t})}function ZI({m:e}){let[t,n]=(0,O.useState)(e.text),r=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{let e=r.current;e.focus(),e.setSelectionRange(e.value.length,e.value.length)},[]),(0,O.useLayoutEffect)(()=>{let e=r.current;e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,240)}px`},[t]);let i=()=>{Em(null),t.trim()&&t.trim()!==e.text&&$m(e.id,t.trim())};return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`editor`,...mE,children:[/* @__PURE__ */ (0,Q.jsx)(`textarea`,{ref:r,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),Em(null)),e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),i())}}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`hint`,children:`enter to save · esc to cancel`})]})}const QI=(e,t)=>navigator.clipboard.writeText(e).then(()=>jm(`copied ${t}`),()=>jm(`couldn't copy ${t}`));function $I({m:e,options:t,continued:n=!1}){let[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(!1),l=(0,O.useRef)(null),u=Dm()===e.id,d=Fe(e),f=e.by.actor===t.me,p=n=>(e.reactions[n]??[]).includes(t.me),m=t=>void Qm(e.id,t,p(t)),h=e.re===null?t.replies?.(e)??[]:[],g=e.re??e.id,_=/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(_E,{emojis:jI,onPick:m}),/* @__PURE__ */ (0,Q.jsx)(gE,{}),t.openThread&&/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>t.openThread(g),children:e.re===null?`reply in thread`:`open thread`}),/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>c(!0),children:`labels…`}),e.text&&/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>void QI(e.text,`text`),children:`copy text`}),/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>void QI(String(e.id),`#${e.id}`),hint:`#${e.id}`,children:`copy id`}),f&&/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(gE,{}),/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>Em(e.id),children:`edit message`}),/* @__PURE__ */ (0,Q.jsx)(hE,{danger:!0,onClick:()=>confirm(`Delete #${e.id}? It's removed on Slack and GitHub too.`)&&void eh(e.id),children:`delete message`})]})]}),v=(a||r||s)&&!u,y=/* @__PURE__ */ (0,Q.jsxs)(`div`,{ref:l,id:`m${e.id}`,className:`message${n?` continued`:``}${v?` active`:``}`,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`gutter`,children:n?/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`gutter-time`,...mE,children:new Date(e.createdAt).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}).replace(/\s?[AP]M$/i,``)}):/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`avatar-wrap`,children:[/* @__PURE__ */ (0,Q.jsx)(KI,{name:d,url:e.author?.avatar}),e.from&&/* @__PURE__ */ (0,Q.jsx)(GI,{platform:t.platforms?.[e.from]??e.from})]})}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`body`,children:[!n&&/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`meta-line`,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`author`,...mE,children:d}),t.context?.(e),/* @__PURE__ */ (0,Q.jsx)(AI,{iso:e.createdAt}),e.noSync&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`badge`,children:`board only`})]}),e.deleted?/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`removed`,...mE,children:`message removed`}):u?/* @__PURE__ */ (0,Q.jsx)(ZI,{m:e}):/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[e.text&&/* @__PURE__ */ (0,Q.jsx)(LI,{text:e.text,edited:e.editedAt!==null}),/* @__PURE__ */ (0,Q.jsx)(VI,{items:e.attachments??[]}),/* @__PURE__ */ (0,Q.jsx)(RI,{items:e.links})]}),(Object.keys(e.labels).length>0||Object.keys(e.reactions).length>0)&&/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`chips`,children:[Object.entries(e.labels).map(([e,t])=>/* @__PURE__ */ (0,Q.jsxs)(`button`,{className:`label`,title:`edit labels`,onClick:()=>c(!0),children:[e,`=`,t]},e)),Object.entries(e.reactions).map(([e,t])=>/* @__PURE__ */ (0,Q.jsxs)(`button`,{className:`chip${p(e)?` mine`:``}`,title:`:${e}: ${t.join(`, `)}`,onClick:()=>m(e),children:[De(e),` `,t.length]},e))]}),Object.entries(e.undelivered??{}).map(([e,t])=>/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`undelivered`,children:[`✗ didn't reach `,e,`: `,t]},e)),h.length>0&&t.openThread&&/* @__PURE__ */ (0,Q.jsxs)(`button`,{className:`replies`,onClick:()=>t.openThread(e.id),children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faces`,children:[...new Map(h.map(e=>[e.by.actor,e])).values()].slice(-3).map(e=>/* @__PURE__ */ (0,Q.jsx)(KI,{name:Fe(e),url:e.author?.avatar,size:16},e.by.actor))}),h.length,` `,h.length===1?`reply`:`replies`,/* @__PURE__ */ (0,Q.jsx)(AI,{iso:h.at(-1).createdAt,prefix:` · last `})]})]}),v&&!e.deleted&&/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`actions`,children:[/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`${p(`thumbs_up`)?`remove`:`react`} 👍`,onClick:()=>m(`thumbs_up`),children:`👍`}),/* @__PURE__ */ (0,Q.jsx)(yE,{trigger:/* @__PURE__ */ (0,Q.jsx)(ne,{size:15,strokeWidth:1.75}),onPick:m,onOpenChange:i}),t.openThread&&/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:e.re===null?`reply in thread`:`open thread`,onClick:()=>t.openThread(g),children:/* @__PURE__ */ (0,Q.jsx)(se,{size:15,strokeWidth:1.75})}),/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`labels`,onClick:()=>c(!0),children:/* @__PURE__ */ (0,Q.jsx)(he,{size:15,strokeWidth:1.75})}),/* @__PURE__ */ (0,Q.jsx)(fE,{trigger:/* @__PURE__ */ (0,Q.jsx)(ee,{size:15,strokeWidth:1.75}),title:`more`,onOpenChange:i,children:_})]}),/* @__PURE__ */ (0,Q.jsx)(SE,{title:`labels`,open:s,onOpenChange:c,anchor:l,children:/* @__PURE__ */ (0,Q.jsx)(xE,{labels:e.labels,known:t.known,onSet:(t,n)=>void th(e.id,{[t]:n},[]),onUnset:t=>void th(e.id,{},[t])})})]});return e.deleted?y:/* @__PURE__ */ (0,Q.jsx)(pE,{menu:_,onOpenChange:i,children:y})}function eL(e){let t=t=>({by:{actor:e.me.actor},createdAt:t.createdAt,deleted:!1,channel:t.channel,re:t.re});return/* @__PURE__ */ (0,Q.jsx)(Q.Fragment,{children:e.posts.map((n,r)=>{let i=fm(r===0?e.after:t(e.posts[r-1]),t(n),r===0?e.afterHasReplies??!1:!1);return/* @__PURE__ */ (0,Q.jsx)(tL,{post:n,me:e.me,continued:i},n.key)})})}function tL({post:e,me:t,continued:n=!1}){let r=e.error?`didn't send`:`sending…`;return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`message pending${n?` continued`:``}${e.error?` failed`:``}`,children:[/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`gutter`,children:n?/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`gutter-time shown`,title:r,children:`…`}):/* @__PURE__ */ (0,Q.jsx)(KI,{name:Pe(t),url:t.avatar})}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`body`,children:[!n&&/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`meta-line`,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`author`,children:Pe(t)}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`time`,children:r})]}),e.text&&/* @__PURE__ */ (0,Q.jsx)(LI,{text:e.text}),e.files&&/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`attachments`,children:e.files.map((e,t)=>/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`file`,children:[/* @__PURE__ */ (0,Q.jsx)(ie,{size:14,strokeWidth:1.75}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`file-name`,children:e.name}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faint`,children:je(e.size)})]},t))}),e.error&&/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`undelivered`,children:[`✗ `,e.error,` · `,/* @__PURE__ */ (0,Q.jsx)(`button`,{onClick:()=>void Km(e),children:`retry`}),` · `,/* @__PURE__ */ (0,Q.jsx)(`button`,{onClick:()=>Xm(e.key),children:`discard`})]})]})]})}function nL(e){return e.includes(`=`)?e.replace(`|`,` or `):`has ${e}`}function rL(e){let{filter:t,onChange:n}=e,[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(``),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(t.text??``),d=(0,O.useRef)(null),f=+!!t.from+t.label.length+ +!!t.text;(0,O.useEffect)(()=>u(t.text??``),[t.text]),(0,O.useEffect)(()=>{if(l===(t.text??``))return;let e=setTimeout(()=>n({...t,...l?{text:l}:{text:void 0}}),250);return()=>clearTimeout(e)},[l]);let p=()=>{let e=a.trim();if(!e)return;let r=s.trim()?`${e}=${s.trim()}`:e;t.label.includes(r)||n({...t,label:[...t.label,r]}),o(``),c(``)};return/* @__PURE__ */ (0,Q.jsx)(SE,{title:`filters`,triggerTitle:`filter messages`,trigger:/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(ae,{size:15,strokeWidth:1.75}),f>0&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`count`,children:f})]}),open:r,onOpenChange:i,children:/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`filter-form`,children:[/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`filter-row`,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`filter-name`,children:`from`}),/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`segments`,children:[``,`board`,...e.sources].map(e=>/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`segment${(t.from??``)===e?` on`:``}`,onClick:()=>n({...t,...e?{from:e}:{from:void 0}}),children:e||`any`},e||`any`))})]}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`filter-row`,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`filter-name`,children:`labels`}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`grow`,children:[t.label.length>0&&/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`chips`,children:t.label.map(e=>/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`label`,children:[nL(e),/* @__PURE__ */ (0,Q.jsx)(`button`,{title:`remove`,onClick:()=>n({...t,label:t.label.filter(t=>t!==e)}),children:/* @__PURE__ */ (0,Q.jsx)(_e,{size:11})})]},e))}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`label-add`,children:[/* @__PURE__ */ (0,Q.jsx)(bE,{value:a,onChange:o,items:[...e.known.keys()],placeholder:`key`,onEnter:()=>s?p():d.current?.querySelector(`input`)?.focus()}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faint`,children:`=`}),/* @__PURE__ */ (0,Q.jsx)(`div`,{ref:d,className:`grow`,children:/* @__PURE__ */ (0,Q.jsx)(bE,{value:s,onChange:c,items:[...e.known.get(a.trim())??[]],placeholder:`any (or a|b)`,onEnter:p})}),/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`send small`,disabled:!a.trim(),onClick:p,children:`add`})]})]})]}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`filter-row`,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`filter-name`,children:`text`}),/* @__PURE__ */ (0,Q.jsx)(`label`,{className:`suggest grow`,children:/* @__PURE__ */ (0,Q.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:`contains…`,spellCheck:!1})})]}),f>0&&/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`clear`,onClick:()=>n({label:[]}),children:`clear filters`})]})})}function iL({filter:e,onChange:t}){let n=[...e.from?[{key:`from`,text:`from ${e.from}`,remove:{...e,from:void 0}}]:[],...e.label.map(t=>({key:`label:${t}`,text:nL(t),remove:{...e,label:e.label.filter(e=>e!==t)}})),...e.text?[{key:`text`,text:`“${e.text}”`,remove:{...e,text:void 0}}]:[]];return n.length===0?null:/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`filter-bar`,children:[n.map(e=>/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`label`,children:[e.text,/* @__PURE__ */ (0,Q.jsx)(`button`,{title:`remove`,onClick:()=>t(e.remove),children:/* @__PURE__ */ (0,Q.jsx)(_e,{size:11})})]},e.key)),/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`clear`,onClick:()=>t({label:[]}),children:`clear`})]})}function aL(e){let t;try{t=decodeURIComponent(e)}catch{return{view:`missing`}}return t===`/`?{view:`activity`}:t.startsWith(`/c/`)&&t.length>3?{view:`channel`,channel:t.slice(3)}:t.startsWith(`/inbox/`)&&t.length>7?{view:`inbox`,key:t.slice(7)}:{view:`missing`}}const oL=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function sL(e,t){try{let n=Number(localStorage.getItem(e));return Number.isFinite(n)&&n>0?n:t}catch{return t}}function cL(e,t){try{localStorage.setItem(e,String(t))}catch{}}const lL={min:180,max:400,collapse:150,key:`board.sidebar-width`,collapsedKey:`board.sidebar-collapsed`},uL={min:320,key:`board.pane-width`};function dL(){let[e,t]=(0,O.useState)(()=>Math.min(lL.max,Math.max(lL.min,sL(lL.key,224)))),[n,r]=(0,O.useState)(()=>{try{return localStorage.getItem(lL.collapsedKey)===`1`}catch{return!1}}),[i,a]=(0,O.useState)(null),o=(0,O.useRef)(null),s=e=>{r(e),cL(lL.collapsedKey,e?`1`:`0`)},c=e=>{t(e),cL(lL.key,e)};return{width:i??e,collapsed:n,collapse:s,fade:i!==null&&i<lL.min?Math.max(.25,(i-60)/(lL.min-60)):1,drag:e=>{o.current=Math.min(lL.max,Math.max(60,e)),a(o.current)},done:()=>{let e=o.current;o.current=null,a(null),e!==null&&(e<lL.collapse?s(!0):c(Math.max(lL.min,e)))},step:t=>c(Math.min(lL.max,Math.max(lL.min,e+t)))}}function fL(){let e=e=>Math.min(Math.max(uL.min,innerWidth*.7),Math.max(uL.min,e)),[t,n]=(0,O.useState)(()=>sL(uL.key,440)),[r,i]=(0,O.useState)(null),a=(0,O.useRef)(null),o=e=>{n(e),cL(uL.key,e)};return{width:e(r??t),drag:t=>{a.current=e(innerWidth-t),i(a.current)},done:()=>{let e=a.current;a.current=null,i(null),e!==null&&o(e)},step:n=>o(e(t-n))}}function pL(){let e=_m(),t=TI(),n=OI(),[r,i]=(0,O.useState)(null),a=dL(),o=fL();(0,O.useEffect)(()=>{Im().catch(e=>i(e.message))},[]),(0,O.useEffect)(()=>{let e=/^\/t\/(\d+)$/.exec(t.path);e&&wI(`/?thread=${e[1]}`,!0)},[t.path]),(0,O.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t.thread!==null&&(e.target.closest(`textarea, input, [role="menu"], [role="dialog"]`)||wI(EI({thread:null})))};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},[t]);let s=aL(t.path);(0,O.useEffect)(()=>{document.title=`${s.view===`channel`?`#${s.channel}`:s.view===`inbox`?`inbox · ${s.key}`:`activity`} · board`},[t.path]);let c=(0,O.useMemo)(()=>um(e),[e.messages]);if(r)return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`boot error`,children:[`error: `,r]});if(!e.me)return/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`boot`,children:`connecting…`});let l=Object.fromEntries((e.discovery?.sync??[]).map(e=>[e.key,e.platform])),u={me:e.me.actor,now:n,known:c,platforms:l,openThread:e=>wI(EI({thread:e}))},d={filter:t.filter,setFilter:e=>wI(EI({filter:e}),!0),sources:(e.discovery?.sync??[]).map(e=>e.key),known:c},f=a.collapsed?/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`show the sidebar`,onClick:()=>a.collapse(!1),children:/* @__PURE__ */ (0,Q.jsx)(H,{size:15,strokeWidth:1.75})}):null;return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`shell`,children:[!a.collapsed&&/* @__PURE__ */ (0,Q.jsxs)(`nav`,{className:`sidebar`,style:{width:a.width,opacity:a.fade},children:[/* @__PURE__ */ (0,Q.jsx)(gL,{state:e,current:s,onCollapse:()=>a.collapse(!0)}),/* @__PURE__ */ (0,Q.jsx)(CE,{side:`right`,label:`resize the sidebar`,onDrag:a.drag,onDone:a.done,onStep:a.step})]}),/* @__PURE__ */ (0,Q.jsxs)(`main`,{className:`main`,children:[s.view===`activity`&&/* @__PURE__ */ (0,Q.jsx)(xL,{state:e,options:u,known:c,lead:f,filters:d}),s.view===`channel`&&/* @__PURE__ */ (0,Q.jsx)(SL,{channel:s.channel,state:e,options:u,known:c,lead:f,filters:d},s.channel),s.view===`inbox`&&/* @__PURE__ */ (0,Q.jsx)(wL,{entry:s.key,now:n,lead:f},s.key),s.view===`missing`&&/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(mL,{title:`nothing here`,lead:f}),/* @__PURE__ */ (0,Q.jsx)(`p`,{className:`empty`,children:`no such page`})]})]}),t.thread!==null&&/* @__PURE__ */ (0,Q.jsxs)(`aside`,{className:`pane`,style:{width:o.width},children:[/* @__PURE__ */ (0,Q.jsx)(CE,{side:`left`,label:`resize the thread`,onDrag:o.drag,onDone:o.done,onStep:o.step}),/* @__PURE__ */ (0,Q.jsx)(CL,{id:t.thread,state:e,now:n,known:c},t.thread)]}),/* @__PURE__ */ (0,Q.jsx)(jE,{})]})}function mL(e){return/* @__PURE__ */ (0,Q.jsxs)(`header`,{className:`header`,children:[e.lead,/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`title`,children:e.title}),e.meta&&/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`meta`,children:e.meta}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`spacer`}),e.children,e.live&&/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`live ${e.live}`,title:e.live===`live`?`receiving board events`:`the stream reconnects on its own`,children:[/* @__PURE__ */ (0,Q.jsx)(`i`,{}),e.live===`live`?`live`:e.live]})]})}function hL(e,t){let n=`board.seen:${e.discovery?.url??location.host}`,[r,i]=(0,O.useState)(()=>{try{return JSON.parse(localStorage.getItem(n)??`null`)??{}}catch{return{}}}),a=e=>{i(e);try{localStorage.setItem(n,JSON.stringify(e))}catch{}};return(0,O.useEffect)(()=>{let t=Object.values(e.channels);Object.keys(r).length===0&&t.length>0&&a(Object.fromEntries(t.map(e=>[e.path,e.lastIndex])))},[e.channels]),(0,O.useEffect)(()=>{if(t.view!==`channel`)return;let n=e.channels[t.channel];n&&(r[n.path]??0)<n.lastIndex&&a({...r,[n.path]:n.lastIndex})},[t,e.channels]),r}function gL({state:e,current:t,onCollapse:n}){let r=hL(e,t),i=(0,O.useMemo)(()=>{let t=/* @__PURE__ */ new Map;for(let n of Object.values(e.channels).sort((e,t)=>e.path.localeCompare(t.path))){let e=n.path.lastIndexOf(`/`),r=e===-1?`channels`:n.path.slice(0,e);t.set(r,[...t.get(r)??[],n])}return[...t]},[e.channels]),a=e.discovery?.sync??[],o=e=>void navigator.clipboard.writeText(e).then(()=>jm(`copied ${e}`));return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`sidebar-scroll`,children:[/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`brand`,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{children:`board`}),/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`hide the sidebar`,onClick:n,children:/* @__PURE__ */ (0,Q.jsx)(le,{size:15,strokeWidth:1.75})})]}),/* @__PURE__ */ (0,Q.jsx)(DI,{to:`/`,className:`item`,current:t.view===`activity`,children:/* @__PURE__ */ (0,Q.jsx)(`span`,{children:`activity`})}),i.map(([e,n])=>/* @__PURE__ */ (0,Q.jsxs)(`section`,{children:[/* @__PURE__ */ (0,Q.jsx)(`h2`,{children:e}),n.map(e=>{let n=t.view===`channel`&&t.channel===e.path,i=!n&&e.lastIndex>(r[e.path]??1/0);return/* @__PURE__ */ (0,Q.jsx)(pE,{menu:/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>o(e.path),children:`copy name`}),/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>o(`vb read ${e.path}`),children:`copy vb read command`})]}),children:/* @__PURE__ */ (0,Q.jsxs)(DI,{to:`/c/${e.path}`,className:`item${i?` unread`:``}`,current:n,title:e.path,children:[/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`name`,children:[`#`,e.path.slice(e.path.lastIndexOf(`/`)+1)]}),i?/* @__PURE__ */ (0,Q.jsx)(`i`,{className:`dot`}):/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`count`,children:e.threads})]})},e.path)})]},e)),a.length>0&&/* @__PURE__ */ (0,Q.jsxs)(`section`,{children:[/* @__PURE__ */ (0,Q.jsx)(`h2`,{children:`inbox`}),a.map(e=>/* @__PURE__ */ (0,Q.jsxs)(DI,{to:`/inbox/${e.key}`,className:`item`,current:t.view===`inbox`&&t.key===e.key,children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`name`,children:e.key}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`count`,children:e.platform})]},e.key))]}),/* @__PURE__ */ (0,Q.jsx)(vL,{me:e.me,board:e.discovery?.url??``})]})}const _L=[`claude`,`codex`,`grok`];function vL({me:e,board:t}){let[n,r]=(0,O.useState)(!1),i=e.handle.split(`/`)[0],a=e=>void Cm(e);if(n)return/* @__PURE__ */ (0,Q.jsx)(`form`,{className:`whoami naming`,onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`profile`)?.toString().trim();t&&a(t),r(!1)},children:/* @__PURE__ */ (0,Q.jsx)(`input`,{name:`profile`,autoFocus:!0,placeholder:`profile name, e.g. reviewer`,pattern:`[A-Za-z0-9-]+`,title:`letters, numbers, and hyphens`,onKeyDown:e=>e.key===`Escape`&&r(!1),onBlur:()=>r(!1)})});let o=(t,n)=>/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>a(n),children:/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`choice`,children:[t,e.profile===n&&/* @__PURE__ */ (0,Q.jsx)(P,{size:13})]})});return/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`whoami-wrap`,title:`${e.actor}\n${t}`,children:/* @__PURE__ */ (0,Q.jsxs)(fE,{className:`whoami`,title:`post as`,trigger:/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`grow`,children:[/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`as`,children:[`as `,Pe(e)]}),/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`faint url`,children:t.replace(/^https?:\/\//,``)})]}),/* @__PURE__ */ (0,Q.jsx)(I,{size:13})]}),children:[o(`${i} (you)`,null),_L.map(e=>o(e,e)),e.profile!==null&&!_L.includes(e.profile)&&o(e.profile,e.profile),/* @__PURE__ */ (0,Q.jsx)(gE,{}),/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>r(!0),children:`another profile…`}),xm()!==void 0&&/* @__PURE__ */ (0,Q.jsx)(hE,{onClick:()=>void Cm(void 0),children:`as vb inspect started`})]})})}const yL=(e,t)=>[...e].reverse().find(e=>e.by.actor===t&&!e.deleted);function bL({filters:e}){return/* @__PURE__ */ (0,Q.jsx)(rL,{filter:e.filter,onChange:e.setFilter,sources:e.sources,known:e.known})}function xL(e){let{state:t,options:n,known:r,lead:i}=e,{filter:a}=e.filters;kI(`main`);let o=JSON.stringify(a);(0,O.useEffect)(()=>{sm(a)&&Um(void 0,a)},[o]);let s=(0,O.useMemo)(()=>om(t,200,sm(a)?e=>lm(t,e,a):void 0),[t.messages,t.ops,t.actors,o]),c=sm(a)?[]:t.pending.filter(e=>e.re===null);return/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(mL,{title:`activity`,meta:`the latest across every channel`,live:t.live,lead:i,children:/* @__PURE__ */ (0,Q.jsx)(bL,{filters:e.filters})}),/* @__PURE__ */ (0,Q.jsx)(iL,{filter:a,onChange:e.filters.setFilter}),/* @__PURE__ */ (0,Q.jsxs)(AE,{scope:`activity`,first:s[0]?.id??``,last:`${s.at(-1)?.id??``}+${c.length}`,children:[s.length===0&&c.length===0&&/* @__PURE__ */ (0,Q.jsx)(`p`,{className:`empty`,children:sm(a)?`nothing matches these filters`:`nothing here yet: start a thread below`}),/* @__PURE__ */ (0,Q.jsx)(XI,{messages:s,now:n.now,options:{...n,context:e=>/* @__PURE__ */ (0,Q.jsxs)(`span`,{className:`where`,children:[e.re===null?`in `:`replied in `,/* @__PURE__ */ (0,Q.jsxs)(DI,{to:`/c/${e.channel}${e.re===null?``:`?thread=${e.re}`}`,children:[`#`,e.channel]})]})}}),/* @__PURE__ */ (0,Q.jsx)(eL,{posts:c,me:t.me,after:s.at(-1)})]}),/* @__PURE__ */ (0,Q.jsx)(kE,{scope:`activity`,role:`main`,placeholder:`start a thread…`,known:r,channels:Object.keys(t.channels).sort(),onSend:({text:e,noSync:t,channel:n,labels:r,files:i})=>void Gm({channel:n,re:null,text:e,noSync:t,labels:r,files:i}),onEditLast:()=>{let e=yL(s,t.me.actor);e&&Em(e.id)}})]})}function SL(e){let{channel:t,state:n,options:r}=e,{filter:i}=e.filters;kI(`main`);let[a,o]=(0,O.useState)(!0);(0,O.useEffect)(()=>{zm(t).finally(()=>o(!1))},[t]);let s=JSON.stringify(i);(0,O.useEffect)(()=>{sm(i)&&Um(t,i)},[t,s]);let{threads:c,pending:l}=(0,O.useMemo)(()=>im(n,t),[n.messages,n.ops,n.pending,n.actors,t]),u=sm(i)?c.filter(e=>lm(n,e.root,i)||e.replies.some(e=>lm(n,e,i))):c,d=sm(i)?[]:l,f=u.map(e=>e.root),p=new Map(u.map(e=>[e.root.id,e.replies])),m=n.channels[t],h=[...f,...u.flatMap(e=>e.replies)].sort(rm).at(-1)?.id??``;return/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(mL,{title:`#${t}`,meta:m?`${oL(m.threads,`thread`)} · ${oL(m.messages,`message`)}`:void 0,live:n.live,lead:e.lead,children:/* @__PURE__ */ (0,Q.jsx)(bL,{filters:e.filters})}),/* @__PURE__ */ (0,Q.jsx)(iL,{filter:i,onChange:e.filters.setFilter}),/* @__PURE__ */ (0,Q.jsxs)(AE,{scope:t,first:f[0]?.id??``,last:`${h}+${d.length}`,older:()=>Bm(t),children:[f.length===0&&d.length===0&&/* @__PURE__ */ (0,Q.jsx)(`p`,{className:`empty`,children:a?`loading…`:sm(i)?`nothing matches these filters`:`no messages yet: say something`}),/* @__PURE__ */ (0,Q.jsx)(XI,{messages:f,now:r.now,options:{...r,replies:e=>p.get(e.id)??[]}}),/* @__PURE__ */ (0,Q.jsx)(eL,{posts:d,me:n.me,after:f.at(-1),afterHasReplies:(p.get(f.at(-1)?.id??``)?.length??0)>0})]}),/* @__PURE__ */ (0,Q.jsx)(kE,{scope:`channel:${t}`,role:`main`,placeholder:`message #${t}…`,known:e.known,onSend:({text:e,noSync:n,labels:r,files:i})=>void Gm({channel:t,re:null,text:e,noSync:n,labels:r,files:i}),onEditLast:()=>{let e=yL(f,n.me.actor);e&&Em(e.id)}})]})}function CL(e){let{id:t,state:n}=e,[r,i]=(0,O.useState)(!1);(0,O.useEffect)(()=>{Vm(t).then(()=>i(!vm().messages[t]))},[t]);let a=(0,O.useMemo)(()=>am(n,t),[n.messages,n.ops,n.pending,n.actors,t]),o=Object.fromEntries((n.discovery?.sync??[]).map(e=>[e.key,e.platform])),s={me:n.me.actor,now:e.now,known:e.known,platforms:o};return/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(mL,{title:`thread`,meta:a?`in #${a.root.channel}`:void 0,children:/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`close (esc)`,onClick:()=>wI(EI({thread:null})),children:/* @__PURE__ */ (0,Q.jsx)(_e,{size:15,strokeWidth:1.75})})}),/* @__PURE__ */ (0,Q.jsx)(AE,{scope:`thread:${t}`,first:t,last:`${a?.replies.at(-1)?.id??t}+${a?.pending.length??0}`,children:a?/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(XI,{messages:[a.root],now:e.now,options:s}),/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`divider`,children:a.replies.length===1?`1 reply`:`${a.replies.length} replies`}),/* @__PURE__ */ (0,Q.jsx)(XI,{messages:a.replies,now:e.now,options:s,after:a.root}),/* @__PURE__ */ (0,Q.jsx)(eL,{posts:a.pending,me:n.me,after:a.replies.at(-1)})]}):/* @__PURE__ */ (0,Q.jsx)(`p`,{className:`empty`,children:r?`no such thread`:`loading…`})}),a&&/* @__PURE__ */ (0,Q.jsx)(kE,{scope:`thread:${t}`,role:`thread`,placeholder:`reply to thread…`,known:e.known,onSend:({text:e,noSync:n,labels:r,files:i})=>void Gm({channel:a.root.channel,re:t,text:e,noSync:n,labels:r,files:i}),onEditLast:()=>{let e=yL([a.root,...a.replies],n.me.actor);e&&Em(e.id)}})]})}function wL({entry:e,now:t,lead:n}){let[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(null),s=()=>{o(null),Hm(e).then(i,e=>o(e.message))};return(0,O.useEffect)(s,[e]),/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[/* @__PURE__ */ (0,Q.jsx)(mL,{title:`inbox · ${e}`,meta:`raw platform events, newest first`,lead:n,children:/* @__PURE__ */ (0,Q.jsx)(`button`,{className:`tool`,title:`refresh`,onClick:s,children:/* @__PURE__ */ (0,Q.jsx)(pe,{size:14,strokeWidth:1.75})})}),/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`feed-wrap`,children:/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`feed`,children:/* @__PURE__ */ (0,Q.jsxs)(`div`,{children:[a&&/* @__PURE__ */ (0,Q.jsxs)(`p`,{className:`error`,children:[`error: `,a]}),!a&&r===null&&/* @__PURE__ */ (0,Q.jsx)(`p`,{className:`empty`,children:`loading…`}),r?.length===0&&/* @__PURE__ */ (0,Q.jsx)(`p`,{className:`empty`,children:`no events yet`}),r?.map(e=>{let t=e.event;return/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:`inbox-row`,children:[/* @__PURE__ */ (0,Q.jsx)(AI,{iso:e.createdAt}),/* @__PURE__ */ (0,Q.jsx)(`span`,{children:/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`badge`,children:t.kind})}),/* @__PURE__ */ (0,Q.jsxs)(`div`,{children:[/* @__PURE__ */ (0,Q.jsxs)(`div`,{children:[/* @__PURE__ */ (0,Q.jsx)(`span`,{className:`author`,children:t.author?.handle??`—`}),` `,t.text??t.type??t.emoji??``]}),/* @__PURE__ */ (0,Q.jsxs)(`pre`,{children:[e.channel,` · `,e.event.thread]})]})]},e.id)})]})})})]})}(0,ve.createRoot)(document.getElementById(`root`)).render(/* @__PURE__ */ (0,Q.jsx)(pL,{}));export{rl as C,Ne as D,je as E,Te as O,K as S,ke as T,vl as _,Bd as a,Hl as b,gu as c,vu as d,Yl as f,Zl as g,ql as h,Ld as i,yu as l,ru as m,If as n,Md as o,nu as p,Fd as r,_u as s,Ap as t,bu as u,sl as v,Oe as w,q as x,$c as y};
417
+ if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function fI(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function pI(){return{flow:{null:{name:`table`,tokenize:mI,resolveAll:hI}}}}function mI(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):IO(t)?VO(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||FO(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,IO(t)?VO(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return IO(t)?VO(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return IO(t)?VO(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):IO(n)?VO(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||FO(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function hI(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new uI;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(_I(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=gI(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=gI(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=gI(f,t,o,i,n,d)):(o[0]=o[1],d=gI(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&_I(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=fI(t.events,n))}return e}function gI(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},vI(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=vI(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=vI(t.events,n[2]),a=vI(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},vI(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function _I(e,t,n,r,i){let a=[],o=vI(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function vI(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const yI={name:`tasklistCheck`,tokenize:xI};function bI(){return{text:{91:yI}}}function xI(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return FO(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):IO(r)?e.check({tokenize:SI},t,n)(r):n(r)}}function SI(e,t,n){return VO(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function CI(e){return CO([zF(),tI(),lI(e),pI(),bI()])}const wI={};function TI(e){let t=this,n=e||wI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(CI(n)),a.push(OF()),o.push(kF(n))}function EI(e,t=!1){e!==location.pathname+location.search&&(history[t?`replaceState`:`pushState`](null,``,e),dispatchEvent(new PopStateEvent(`popstate`)))}function DI(){let e=()=>{let e=new URLSearchParams(location.search),t=e.get(`thread`);return{path:location.pathname,thread:t||null,filter:{...e.get(`from`)?{from:e.get(`from`)}:{},label:e.getAll(`label`).filter(Boolean),...e.get(`text`)?{text:e.get(`text`)}:{}}}},[t,n]=(0,O.useState)(e);return(0,O.useEffect)(()=>{let t=()=>n(e());return addEventListener(`popstate`,t),()=>removeEventListener(`popstate`,t)},[]),t}function OI(e){let t=new URLSearchParams(location.search);if(e.thread!==void 0&&(e.thread===null?t.delete(`thread`):t.set(`thread`,String(e.thread))),e.filter){for(let e of[`from`,`label`,`text`])t.delete(e);e.filter.from&&t.set(`from`,e.filter.from);for(let n of e.filter.label)t.append(`label`,n);e.filter.text&&t.set(`text`,e.filter.text)}let n=t.toString();return`${location.pathname}${n?`?${n}`:``}`}function kI(e){let t=(0,O.useRef)(0),n=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;return/* @__PURE__ */ (0,Z.jsx)(`a`,{href:e.to,className:e.className,title:e.title,"aria-current":e.current?`page`:void 0,onPointerDown:r=>{r.pointerType===`mouse`&&n(r)&&(t.current=Date.now(),EI(e.to))},onClick:r=>{n(r)&&(r.preventDefault(),Date.now()-t.current>500&&EI(e.to))},children:e.children})}function AI(e=3e4){let[t,n]=(0,O.useState)(Date.now);return(0,O.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function jI(e){(0,O.useEffect)(()=>{let t=t=>{if(t.metaKey||t.ctrlKey||t.altKey||t.key.length!==1)return;let n=t.target;n!==document.body&&n.closest(`input, textarea, select, [contenteditable], [role="menu"], [role="dialog"], [role="listbox"]`)||document.querySelector(`textarea[data-composer="${CSS.escape(e)}"]`)?.focus()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e])}function MI({iso:e,prefix:t=``}){let[,n]=(0,O.useReducer)(e=>e+1,0);(0,O.useEffect)(()=>{let t,r=()=>{let i=Math.max(0,Date.now()-Date.parse(e)),a=i<6e4?1e3:i<36e5?6e4:i<864e5?36e5:864e5;t=setTimeout(()=>{n(),r()},a-i%a+20)};return r(),()=>clearTimeout(t)},[e]);let r=Date.now()-Date.parse(e);return/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`time`,title:new Date(e).toLocaleString(),children:[t,r<5e3?`now`:Le(e)]})}const NI=[`thumbs_up`,`heart`,`laugh`,`party`,`eyes`,`check`],PI=/((?<![\w@])@[a-z0-9][\w./-]*)/gi,FI=/^@[a-z0-9][\w./-]*$/i;function II(){let e=t=>{t.children&&t.type!==`link`&&t.type!==`inlineCode`&&t.type!==`code`&&(t.children=t.children.flatMap(t=>t.type===`text`?(t.value??``).split(PI).filter(Boolean).map(e=>FI.test(e)?{type:`mention`,value:e,data:{hName:`span`,hProperties:{className:[`mention`]},hChildren:[{type:`text`,value:e}]}}:{type:`text`,value:e}):(e(t),[t])))};return t=>e(t)}const LI=[TI,ON,II],RI={a:({href:e,children:t})=>/* @__PURE__ */ (0,Z.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t})},zI=(0,O.memo)(function({text:e,edited:t=!1}){return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`text`,..._E,children:[/* @__PURE__ */ (0,Z.jsx)(gN,{remarkPlugins:LI,components:RI,skipHtml:!0,children:e}),t&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`edited`,children:` (edited)`})]})});function BI({items:e}){return e?.length?/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`links`,children:e.map(e=>/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`link-embed`,children:[/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`link-meta`,..._E,children:[e.snapshot&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`author`,children:e.snapshot.author}),e.message!==null&&/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`faint`,children:[`#`,e.message]}),/* @__PURE__ */ (0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.snapshot?`open`:e.url}),!e.snapshot&&/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`faint`,children:[`couldn't read it: `,e.unavailable??`unknown`]})]}),e.snapshot?.text&&/* @__PURE__ */ (0,Z.jsx)(zI,{text:e.snapshot.text}),e.snapshot?.files.map((e,t)=>/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`link-file`,children:[/* @__PURE__ */ (0,Z.jsx)(ae,{size:12,strokeWidth:1.75}),e.url?/* @__PURE__ */ (0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.name}):/* @__PURE__ */ (0,Z.jsx)(`span`,{children:e.name})]},t))]},e.url))}):null}const VI=/^image\/(png|jpeg|gif|webp|avif)$/,HI=/^video\/(mp4|webm)$/;function UI({items:e}){return e.length===0?null:/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`attachments`,children:e.map(e=>/* @__PURE__ */ (0,Z.jsx)(WI,{attachment:e},e.id))})}function WI({attachment:e}){let t=VI.test(e.type)?`image`:HI.test(e.type)?`video`:null,[n,r]=(0,O.useState)(null);(0,O.useEffect)(()=>{if(!t)return;let n=!0;return Zm(e.id).then(e=>n&&r(e),()=>{}),()=>{n=!1}},[e.id,t]);let i=`${e.name} · ${Me(e.size)}`;return t===`image`?/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`attachment-media`,title:`${i} · click to open`,onClick:()=>n&&window.open(n,`_blank`,`noopener`),children:n&&/* @__PURE__ */ (0,Z.jsx)(`img`,{src:n,alt:e.name})}):t===`video`?/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`attachment-media`,title:i,children:n&&/* @__PURE__ */ (0,Z.jsx)(`video`,{src:n,controls:!0,preload:`metadata`})}):/* @__PURE__ */ (0,Z.jsxs)(`button`,{className:`file`,title:`download ${e.name}`,onClick:()=>void Qm(e),children:[/* @__PURE__ */ (0,Z.jsx)(ae,{size:14,strokeWidth:1.75}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`file-name`,children:e.name}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faint`,children:Me(e.size)})]})}const GI=[`#E01E5A`,`#36C5F0`,`#2EB67D`,`#ECB22E`],KI={slack:{name:`Slack`,paths:(Ap.slack.match(/M[^M]+/g)??[]).map((e,t)=>({d:e,fill:GI[Math.floor(t/2)]}))},github:{name:`GitHub`,paths:[{d:Ap.github,fill:`currentColor`}]},whatsapp:{name:`WhatsApp`,paths:[{d:Ap.whatsapp,fill:`#25D366`}]}};function qI({platform:e}){let t=KI[e];return t?/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`source`,title:`from ${t.name}`,children:/* @__PURE__ */ (0,Z.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-label":t.name,children:t.paths.map((e,t)=>/* @__PURE__ */ (0,Z.jsx)(`path`,{d:e.d,fill:e.fill},t))})}):/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`source text`,children:e.slice(0,1)})}function JI({name:e,url:t,size:n=28}){let[r,i]=(0,O.useState)(!1);return/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`avatar`,style:{width:n,height:n,fontSize:n*.43},children:t&&!r?/* @__PURE__ */ (0,Z.jsx)(`img`,{src:t,alt:``,referrerPolicy:`no-referrer`,onError:()=>i(!0)}):e.slice(0,1).toUpperCase()})}const YI=e=>new Date(e).toDateString();function XI(e,t){let n=new Date(e),r=new Date(t);return n.toDateString()===r.toDateString()?`today`:n.toDateString()===(/* @__PURE__ */ new Date(t-864e5)).toDateString()?`yesterday`:n.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function ZI({iso:e,now:t}){return/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`divider`,children:XI(e,t)})}function QI(e){let t=[];return e.messages.forEach((n,r)=>{let i=e.messages[r-1],a=i??e.after;(!a||YI(a.createdAt)!==YI(n.createdAt))&&t.push(/* @__PURE__ */ (0,Z.jsx)(ZI,{iso:n.createdAt,now:e.now},`d${n.id}`));let o=hm(i,n,i?(e.options.replies?.(i).length??0)>0:!1);t.push(/* @__PURE__ */ (0,Z.jsx)(tL,{m:n,options:e.options,continued:o},n.id))}),/* @__PURE__ */ (0,Z.jsx)(Z.Fragment,{children:t})}function $I({m:e}){let[t,n]=(0,O.useState)(e.text),r=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{let e=r.current;e.focus(),e.setSelectionRange(e.value.length,e.value.length)},[]),(0,O.useLayoutEffect)(()=>{let e=r.current;e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,240)}px`},[t]);let i=()=>{km(null),t.trim()&&t.trim()!==e.text&&nh(e.id,t.trim())};return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`editor`,..._E,children:[/* @__PURE__ */ (0,Z.jsx)(`textarea`,{ref:r,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),km(null)),e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),i())}}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`hint`,children:`enter to save · esc to cancel`})]})}const eL=(e,t)=>navigator.clipboard.writeText(e).then(()=>Pm(`copied ${t}`),()=>Pm(`couldn't copy ${t}`));function tL({m:e,options:t,continued:n=!1}){let[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(!1),l=(0,O.useRef)(null),u=Am()===e.id,d=Ie(e),f=e.by.actor===t.me,p=n=>(e.reactions[n]??[]).includes(t.me),m=t=>void th(e.id,t,p(t)),h=e.re===null?t.replies?.(e)??[]:[],g=e.re??e.id,_=/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(bE,{emojis:NI,onPick:m}),/* @__PURE__ */ (0,Z.jsx)(yE,{}),t.openThread&&/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>t.openThread(g),children:e.re===null?`reply in thread`:`open thread`}),/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>c(!0),children:`labels…`}),e.text&&/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>void eL(e.text,`text`),children:`copy text`}),/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>void eL(String(e.id),`#${e.id}`),hint:`#${e.id}`,children:`copy id`}),f&&/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(yE,{}),/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>km(e.id),children:`edit message`}),/* @__PURE__ */ (0,Z.jsx)(vE,{danger:!0,onClick:()=>confirm(`Delete #${e.id}? It's removed on Slack and GitHub too.`)&&void rh(e.id),children:`delete message`})]})]}),v=(a||r||s)&&!u,y=/* @__PURE__ */ (0,Z.jsxs)(`div`,{ref:l,id:`m${e.id}`,className:`message${n?` continued`:``}${v?` active`:``}`,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`gutter`,children:n?/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`gutter-time`,..._E,children:new Date(e.createdAt).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}).replace(/\s?[AP]M$/i,``)}):/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`avatar-wrap`,children:[/* @__PURE__ */ (0,Z.jsx)(JI,{name:d,url:e.author?.avatar}),e.from&&/* @__PURE__ */ (0,Z.jsx)(qI,{platform:t.platforms?.[e.from]??e.from})]})}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`body`,children:[!n&&/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`meta-line`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`author`,..._E,children:d}),t.context?.(e),/* @__PURE__ */ (0,Z.jsx)(MI,{iso:e.createdAt}),e.noSync&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`badge`,children:`board only`})]}),e.deleted?/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`removed`,..._E,children:`message removed`}):u?/* @__PURE__ */ (0,Z.jsx)($I,{m:e}):/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[e.text&&/* @__PURE__ */ (0,Z.jsx)(zI,{text:e.text,edited:e.editedAt!==null}),/* @__PURE__ */ (0,Z.jsx)(UI,{items:e.attachments??[]}),/* @__PURE__ */ (0,Z.jsx)(BI,{items:e.links})]}),(Object.keys(e.labels).length>0||Object.keys(e.reactions).length>0)&&/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`chips`,children:[Object.entries(e.labels).map(([e,t])=>/* @__PURE__ */ (0,Z.jsxs)(`button`,{className:`label`,title:`edit labels`,onClick:()=>c(!0),children:[e,`=`,t]},e)),Object.entries(e.reactions).map(([e,t])=>/* @__PURE__ */ (0,Z.jsxs)(`button`,{className:`chip${p(e)?` mine`:``}`,title:`:${e}: ${t.join(`, `)}`,onClick:()=>m(e),children:[Oe(e),` `,t.length]},e))]}),Object.entries(e.undelivered??{}).map(([e,t])=>/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`undelivered`,children:[`✗ didn't reach `,e,`: `,t]},e)),h.length>0&&t.openThread&&/* @__PURE__ */ (0,Z.jsxs)(`button`,{className:`replies`,onClick:()=>t.openThread(e.id),children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faces`,children:[...new Map(h.map(e=>[e.by.actor,e])).values()].slice(-3).map(e=>/* @__PURE__ */ (0,Z.jsx)(JI,{name:Ie(e),url:e.author?.avatar,size:16},e.by.actor))}),h.length,` `,h.length===1?`reply`:`replies`,/* @__PURE__ */ (0,Z.jsx)(MI,{iso:h.at(-1).createdAt,prefix:` · last `})]})]}),v&&!e.deleted&&/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`actions`,children:[/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`${p(`thumbs_up`)?`remove`:`react`} 👍`,onClick:()=>m(`thumbs_up`),children:`👍`}),/* @__PURE__ */ (0,Z.jsx)(SE,{trigger:/* @__PURE__ */ (0,Z.jsx)(re,{size:15,strokeWidth:1.75}),onPick:m,onOpenChange:i}),t.openThread&&/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:e.re===null?`reply in thread`:`open thread`,onClick:()=>t.openThread(g),children:/* @__PURE__ */ (0,Z.jsx)(ce,{size:15,strokeWidth:1.75})}),/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`labels`,onClick:()=>c(!0),children:/* @__PURE__ */ (0,Z.jsx)(ge,{size:15,strokeWidth:1.75})}),/* @__PURE__ */ (0,Z.jsx)(hE,{trigger:/* @__PURE__ */ (0,Z.jsx)(te,{size:15,strokeWidth:1.75}),title:`more`,onOpenChange:i,children:_})]}),/* @__PURE__ */ (0,Z.jsx)(TE,{title:`labels`,open:s,onOpenChange:c,anchor:l,children:/* @__PURE__ */ (0,Z.jsx)(wE,{labels:e.labels,known:t.known,onSet:(t,n)=>void ih(e.id,{[t]:n},[]),onUnset:t=>void ih(e.id,{},[t])})})]});return e.deleted?y:/* @__PURE__ */ (0,Z.jsx)(gE,{menu:_,onOpenChange:i,children:y})}function nL(e){let t=t=>({by:{actor:e.me.actor},createdAt:t.createdAt,deleted:!1,channel:t.channel,re:t.re});return/* @__PURE__ */ (0,Z.jsx)(Z.Fragment,{children:e.posts.map((n,r)=>{let i=hm(r===0?e.after:t(e.posts[r-1]),t(n),r===0?e.afterHasReplies??!1:!1);return/* @__PURE__ */ (0,Z.jsx)(rL,{post:n,me:e.me,continued:i},n.key)})})}function rL({post:e,me:t,continued:n=!1}){let r=e.error?`didn't send`:`sending…`;return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`message pending${n?` continued`:``}${e.error?` failed`:``}`,children:[/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`gutter`,children:n?/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`gutter-time shown`,title:r,children:`…`}):/* @__PURE__ */ (0,Z.jsx)(JI,{name:Fe(t),url:t.avatar})}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`body`,children:[!n&&/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`meta-line`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`author`,children:Fe(t)}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`time`,children:r})]}),e.text&&/* @__PURE__ */ (0,Z.jsx)(zI,{text:e.text}),e.files&&/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`attachments`,children:e.files.map((e,t)=>/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`file`,children:[/* @__PURE__ */ (0,Z.jsx)(ae,{size:14,strokeWidth:1.75}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`file-name`,children:e.name}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faint`,children:Me(e.size)})]},t))}),e.error&&/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`undelivered`,children:[`✗ `,e.error,` · `,/* @__PURE__ */ (0,Z.jsx)(`button`,{onClick:()=>void Ym(e),children:`retry`}),` · `,/* @__PURE__ */ (0,Z.jsx)(`button`,{onClick:()=>$m(e.key),children:`discard`})]})]})]})}function iL(e){return e.includes(`=`)?e.replace(`|`,` or `):`has ${e}`}function aL(e){let{filter:t,onChange:n}=e,[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(``),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(t.text??``),d=(0,O.useRef)(null),f=+!!t.from+t.label.length+ +!!t.text;(0,O.useEffect)(()=>u(t.text??``),[t.text]),(0,O.useEffect)(()=>{if(l===(t.text??``))return;let e=setTimeout(()=>n({...t,...l?{text:l}:{text:void 0}}),250);return()=>clearTimeout(e)},[l]);let p=()=>{let e=a.trim();if(!e)return;let r=s.trim()?`${e}=${s.trim()}`:e;t.label.includes(r)||n({...t,label:[...t.label,r]}),o(``),c(``)};return/* @__PURE__ */ (0,Z.jsx)(TE,{title:`filters`,triggerTitle:`filter messages`,trigger:/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(oe,{size:15,strokeWidth:1.75}),f>0&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`count`,children:f})]}),open:r,onOpenChange:i,children:/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`filter-form`,children:[/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`filter-row`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`filter-name`,children:`from`}),/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`segments`,children:[``,`board`,...e.sources].map(e=>/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`segment${(t.from??``)===e?` on`:``}`,onClick:()=>n({...t,...e?{from:e}:{from:void 0}}),children:e||`any`},e||`any`))})]}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`filter-row`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`filter-name`,children:`labels`}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`grow`,children:[t.label.length>0&&/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`chips`,children:t.label.map(e=>/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`label`,children:[iL(e),/* @__PURE__ */ (0,Z.jsx)(`button`,{title:`remove`,onClick:()=>n({...t,label:t.label.filter(t=>t!==e)}),children:/* @__PURE__ */ (0,Z.jsx)(ve,{size:11})})]},e))}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`label-add`,children:[/* @__PURE__ */ (0,Z.jsx)(CE,{value:a,onChange:o,items:[...e.known.keys()],placeholder:`key`,onEnter:()=>s?p():d.current?.querySelector(`input`)?.focus()}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faint`,children:`=`}),/* @__PURE__ */ (0,Z.jsx)(`div`,{ref:d,className:`grow`,children:/* @__PURE__ */ (0,Z.jsx)(CE,{value:s,onChange:c,items:[...e.known.get(a.trim())??[]],placeholder:`any (or a|b)`,onEnter:p})}),/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`send small`,disabled:!a.trim(),onClick:p,children:`add`})]})]})]}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`filter-row`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`filter-name`,children:`text`}),/* @__PURE__ */ (0,Z.jsx)(`label`,{className:`suggest grow`,children:/* @__PURE__ */ (0,Z.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:`contains…`,spellCheck:!1})})]}),f>0&&/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`clear`,onClick:()=>n({label:[]}),children:`clear filters`})]})})}function oL({filter:e,onChange:t}){let n=[...e.from?[{key:`from`,text:`from ${e.from}`,remove:{...e,from:void 0}}]:[],...e.label.map(t=>({key:`label:${t}`,text:iL(t),remove:{...e,label:e.label.filter(e=>e!==t)}})),...e.text?[{key:`text`,text:`“${e.text}”`,remove:{...e,text:void 0}}]:[]];return n.length===0?null:/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`filter-bar`,children:[n.map(e=>/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`label`,children:[e.text,/* @__PURE__ */ (0,Z.jsx)(`button`,{title:`remove`,onClick:()=>t(e.remove),children:/* @__PURE__ */ (0,Z.jsx)(ve,{size:11})})]},e.key)),/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`clear`,onClick:()=>t({label:[]}),children:`clear`})]})}function sL(e){let t;try{t=decodeURIComponent(e)}catch{return{view:`missing`}}return t===`/`?{view:`activity`}:t.startsWith(`/c/`)&&t.length>3?{view:`channel`,channel:t.slice(3)}:t.startsWith(`/inbox/`)&&t.length>7?{view:`inbox`,key:t.slice(7)}:{view:`missing`}}const cL=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function lL(e,t){try{let n=Number(localStorage.getItem(e));return Number.isFinite(n)&&n>0?n:t}catch{return t}}function uL(e,t){try{localStorage.setItem(e,String(t))}catch{}}const dL={min:180,max:400,collapse:150,key:`board.sidebar-width`,collapsedKey:`board.sidebar-collapsed`},fL={min:320,key:`board.pane-width`};function pL(){let[e,t]=(0,O.useState)(()=>Math.min(dL.max,Math.max(dL.min,lL(dL.key,224)))),[n,r]=(0,O.useState)(()=>{try{return localStorage.getItem(dL.collapsedKey)===`1`}catch{return!1}}),[i,a]=(0,O.useState)(null),o=(0,O.useRef)(null),s=e=>{r(e),uL(dL.collapsedKey,e?`1`:`0`)},c=e=>{t(e),uL(dL.key,e)};return{width:i??e,collapsed:n,collapse:s,fade:i!==null&&i<dL.min?Math.max(.25,(i-60)/(dL.min-60)):1,drag:e=>{o.current=Math.min(dL.max,Math.max(60,e)),a(o.current)},done:()=>{let e=o.current;o.current=null,a(null),e!==null&&(e<dL.collapse?s(!0):c(Math.max(dL.min,e)))},step:t=>c(Math.min(dL.max,Math.max(dL.min,e+t)))}}function mL(){let e=e=>Math.min(Math.max(fL.min,innerWidth*.7),Math.max(fL.min,e)),[t,n]=(0,O.useState)(()=>lL(fL.key,440)),[r,i]=(0,O.useState)(null),a=(0,O.useRef)(null),o=e=>{n(e),uL(fL.key,e)};return{width:e(r??t),drag:t=>{a.current=e(innerWidth-t),i(a.current)},done:()=>{let e=a.current;a.current=null,i(null),e!==null&&o(e)},step:n=>o(e(t-n))}}function hL(){let e=bm(),t=DI(),n=AI(),[r,i]=(0,O.useState)(null),a=pL(),o=mL();(0,O.useEffect)(()=>{zm().catch(e=>i(e.message))},[]),(0,O.useEffect)(()=>{let e=/^\/t\/(\d+)$/.exec(t.path);e&&EI(`/?thread=${e[1]}`,!0)},[t.path]),(0,O.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t.thread!==null&&(e.target.closest(`textarea, input, [role="menu"], [role="dialog"]`)||EI(OI({thread:null})))};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},[t]);let s=sL(t.path);(0,O.useEffect)(()=>{document.title=`${s.view===`channel`?`#${s.channel}`:s.view===`inbox`?`inbox · ${s.key}`:`activity`} · board`},[t.path]);let c=(0,O.useMemo)(()=>pm(e),[e.messages]);if(r)return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`boot error`,children:[`error: `,r]});if(!e.me)return/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`boot`,children:`connecting…`});let l=Object.fromEntries((e.discovery?.sync??[]).map(e=>[e.key,e.platform])),u={me:e.me.actor,now:n,known:c,platforms:l,openThread:e=>EI(OI({thread:e}))},d={filter:t.filter,setFilter:e=>EI(OI({filter:e}),!0),sources:(e.discovery?.sync??[]).map(e=>e.key),known:c},f=a.collapsed?/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`show the sidebar`,onClick:()=>a.collapse(!1),children:/* @__PURE__ */ (0,Z.jsx)(V,{size:15,strokeWidth:1.75})}):null;return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`shell`,children:[!a.collapsed&&/* @__PURE__ */ (0,Z.jsxs)(`nav`,{className:`sidebar`,style:{width:a.width,opacity:a.fade},children:[/* @__PURE__ */ (0,Z.jsx)(vL,{state:e,current:s,onCollapse:()=>a.collapse(!0)}),/* @__PURE__ */ (0,Z.jsx)(EE,{side:`right`,label:`resize the sidebar`,onDrag:a.drag,onDone:a.done,onStep:a.step})]}),/* @__PURE__ */ (0,Z.jsxs)(`main`,{className:`main`,children:[s.view===`activity`&&/* @__PURE__ */ (0,Z.jsx)(CL,{state:e,options:u,known:c,lead:f,filters:d}),s.view===`channel`&&/* @__PURE__ */ (0,Z.jsx)(wL,{channel:s.channel,state:e,options:u,known:c,lead:f,filters:d},s.channel),s.view===`inbox`&&/* @__PURE__ */ (0,Z.jsx)(EL,{entry:s.key,now:n,lead:f},s.key),s.view===`missing`&&/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(gL,{title:`nothing here`,lead:f}),/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`empty`,children:`no such page`})]})]}),t.thread!==null&&/* @__PURE__ */ (0,Z.jsxs)(`aside`,{className:`pane`,style:{width:o.width},children:[/* @__PURE__ */ (0,Z.jsx)(EE,{side:`left`,label:`resize the thread`,onDrag:o.drag,onDone:o.done,onStep:o.step}),/* @__PURE__ */ (0,Z.jsx)(TL,{id:t.thread,state:e,now:n,known:c},t.thread)]}),/* @__PURE__ */ (0,Z.jsx)(PE,{})]})}function gL(e){return/* @__PURE__ */ (0,Z.jsxs)(`header`,{className:`header`,children:[e.lead,/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`title`,children:e.title}),e.meta&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`meta`,children:e.meta}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`spacer`}),e.children,e.live&&/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`live ${e.live}`,title:e.live===`live`?`receiving board events`:`the stream reconnects on its own`,children:[/* @__PURE__ */ (0,Z.jsx)(`i`,{}),e.live===`live`?`live`:e.live]})]})}function _L(e,t){let n=`board.seen:${e.discovery?.url??location.host}`,[r,i]=(0,O.useState)(()=>{try{return JSON.parse(localStorage.getItem(n)??`null`)??{}}catch{return{}}}),a=e=>{i(e);try{localStorage.setItem(n,JSON.stringify(e))}catch{}};return(0,O.useEffect)(()=>{let t=Object.values(e.channels);Object.keys(r).length===0&&t.length>0&&a(Object.fromEntries(t.map(e=>[e.path,e.lastIndex])))},[e.channels]),(0,O.useEffect)(()=>{if(t.view!==`channel`)return;let n=e.channels[t.channel];n&&(r[n.path]??0)<n.lastIndex&&a({...r,[n.path]:n.lastIndex})},[t,e.channels]),r}function vL({state:e,current:t,onCollapse:n}){let r=_L(e,t),i=(0,O.useMemo)(()=>{let t=/* @__PURE__ */ new Map;for(let n of Object.values(e.channels).sort((e,t)=>e.path.localeCompare(t.path))){let e=n.path.lastIndexOf(`/`),r=e===-1?`channels`:n.path.slice(0,e);t.set(r,[...t.get(r)??[],n])}return[...t]},[e.channels]),a=e.discovery?.sync??[],o=e=>void navigator.clipboard.writeText(e).then(()=>Pm(`copied ${e}`));return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`sidebar-scroll`,children:[/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`brand`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{children:`board`}),/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`hide the sidebar`,onClick:n,children:/* @__PURE__ */ (0,Z.jsx)(ue,{size:15,strokeWidth:1.75})})]}),/* @__PURE__ */ (0,Z.jsx)(kI,{to:`/`,className:`item`,current:t.view===`activity`,children:/* @__PURE__ */ (0,Z.jsx)(`span`,{children:`activity`})}),i.map(([e,n])=>/* @__PURE__ */ (0,Z.jsxs)(`section`,{children:[/* @__PURE__ */ (0,Z.jsx)(`h2`,{children:e}),n.map(e=>{let n=t.view===`channel`&&t.channel===e.path,i=!n&&e.lastIndex>(r[e.path]??1/0);return/* @__PURE__ */ (0,Z.jsx)(gE,{menu:/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>o(e.path),children:`copy name`}),/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>o(`vb read ${e.path}`),children:`copy vb read command`})]}),children:/* @__PURE__ */ (0,Z.jsxs)(kI,{to:`/c/${e.path}`,className:`item${i?` unread`:``}`,current:n,title:e.path,children:[/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`name`,children:[`#`,e.path.slice(e.path.lastIndexOf(`/`)+1)]}),i?/* @__PURE__ */ (0,Z.jsx)(`i`,{className:`dot`}):/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`count`,children:e.threads})]})},e.path)})]},e)),a.length>0&&/* @__PURE__ */ (0,Z.jsxs)(`section`,{children:[/* @__PURE__ */ (0,Z.jsx)(`h2`,{children:`inbox`}),a.map(e=>/* @__PURE__ */ (0,Z.jsxs)(kI,{to:`/inbox/${e.key}`,className:`item`,current:t.view===`inbox`&&t.key===e.key,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`name`,children:e.key}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`count`,children:e.platform})]},e.key))]}),/* @__PURE__ */ (0,Z.jsx)(bL,{me:e.me,board:e.discovery?.url??``})]})}const yL=[`claude`,`codex`,`grok`];function bL({me:e,board:t}){let[n,r]=(0,O.useState)(!1),i=e.handle.split(`/`)[0],a=e=>void Em(e);if(n)return/* @__PURE__ */ (0,Z.jsx)(`form`,{className:`whoami naming`,onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`profile`)?.toString().trim();t&&a(t),r(!1)},children:/* @__PURE__ */ (0,Z.jsx)(`input`,{name:`profile`,autoFocus:!0,placeholder:`profile name, e.g. reviewer`,pattern:`[A-Za-z0-9-]+`,title:`letters, numbers, and hyphens`,onKeyDown:e=>e.key===`Escape`&&r(!1),onBlur:()=>r(!1)})});let o=(t,n)=>/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>a(n),children:/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`choice`,children:[t,e.profile===n&&/* @__PURE__ */ (0,Z.jsx)(P,{size:13})]})});return/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`whoami-wrap`,title:`${e.actor}\n${t}`,children:/* @__PURE__ */ (0,Z.jsxs)(hE,{className:`whoami`,title:`post as`,trigger:/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`grow`,children:[/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`as`,children:[`as `,Fe(e)]}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`faint url`,children:t.replace(/^https?:\/\//,``)})]}),/* @__PURE__ */ (0,Z.jsx)(I,{size:13})]}),children:[o(`${i} (you)`,null),yL.map(e=>o(e,e)),e.profile!==null&&!yL.includes(e.profile)&&o(e.profile,e.profile),/* @__PURE__ */ (0,Z.jsx)(yE,{}),/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>r(!0),children:`another profile…`}),wm()!==void 0&&/* @__PURE__ */ (0,Z.jsx)(vE,{onClick:()=>void Em(void 0),children:`as vb inspect started`})]})})}const xL=(e,t)=>[...e].reverse().find(e=>e.by.actor===t&&!e.deleted);function SL({filters:e}){return/* @__PURE__ */ (0,Z.jsx)(aL,{filter:e.filter,onChange:e.setFilter,sources:e.sources,known:e.known})}function CL(e){let{state:t,options:n,known:r,lead:i}=e,{filter:a}=e.filters;jI(`main`);let o=JSON.stringify(a);(0,O.useEffect)(()=>{um(a)&&Km(void 0,a)},[o]);let s=(0,O.useMemo)(()=>lm(t,200,um(a)?e=>fm(t,e,a):void 0),[t.messages,t.ops,t.actors,o]),c=um(a)?[]:t.pending.filter(e=>e.re===null);return/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(gL,{title:`activity`,meta:`the latest across every channel`,live:t.live,lead:i,children:/* @__PURE__ */ (0,Z.jsx)(SL,{filters:e.filters})}),/* @__PURE__ */ (0,Z.jsx)(oL,{filter:a,onChange:e.filters.setFilter}),/* @__PURE__ */ (0,Z.jsxs)(NE,{scope:`activity`,first:s[0]?.id??``,last:`${s.at(-1)?.id??``}+${c.length}`,children:[s.length===0&&c.length===0&&/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`empty`,children:um(a)?`nothing matches these filters`:`nothing here yet: start a thread below`}),/* @__PURE__ */ (0,Z.jsx)(QI,{messages:s,now:n.now,options:{...n,context:e=>/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`where`,children:[e.re===null?`in `:`replied in `,/* @__PURE__ */ (0,Z.jsxs)(kI,{to:`/c/${e.channel}${e.re===null?``:`?thread=${e.re}`}`,children:[`#`,e.channel]})]})}}),/* @__PURE__ */ (0,Z.jsx)(nL,{posts:c,me:t.me,after:s.at(-1)})]}),/* @__PURE__ */ (0,Z.jsx)(ME,{scope:`activity`,role:`main`,placeholder:`start a thread…`,known:r,channels:Object.keys(t.channels).sort(),onSend:({text:e,noSync:t,channel:n,labels:r,files:i})=>void Jm({channel:n,re:null,text:e,noSync:t,labels:r,files:i}),onEditLast:()=>{let e=xL(s,t.me.actor);e&&km(e.id)}})]})}function wL(e){let{channel:t,state:n,options:r}=e,{filter:i}=e.filters;jI(`main`);let[a,o]=(0,O.useState)(!0);(0,O.useEffect)(()=>{Hm(t).finally(()=>o(!1))},[t]);let s=JSON.stringify(i);(0,O.useEffect)(()=>{um(i)&&Km(t,i)},[t,s]);let{threads:c,pending:l}=(0,O.useMemo)(()=>sm(n,t),[n.messages,n.ops,n.pending,n.actors,t]),u=um(i)?c.filter(e=>fm(n,e.root,i)||e.replies.some(e=>fm(n,e,i))):c,d=um(i)?[]:l,f=u.map(e=>e.root),p=new Map(u.map(e=>[e.root.id,e.replies])),m=n.channels[t],h=[...f,...u.flatMap(e=>e.replies)].sort(om).at(-1)?.id??``;return/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(gL,{title:`#${t}`,meta:m?`${cL(m.threads,`thread`)} · ${cL(m.messages,`message`)}`:void 0,live:n.live,lead:e.lead,children:/* @__PURE__ */ (0,Z.jsx)(SL,{filters:e.filters})}),/* @__PURE__ */ (0,Z.jsx)(oL,{filter:i,onChange:e.filters.setFilter}),/* @__PURE__ */ (0,Z.jsxs)(NE,{scope:t,first:f[0]?.id??``,last:`${h}+${d.length}`,older:()=>Um(t),children:[f.length===0&&d.length===0&&/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`empty`,children:a?`loading…`:um(i)?`nothing matches these filters`:`no messages yet: say something`}),/* @__PURE__ */ (0,Z.jsx)(QI,{messages:f,now:r.now,options:{...r,replies:e=>p.get(e.id)??[]}}),/* @__PURE__ */ (0,Z.jsx)(nL,{posts:d,me:n.me,after:f.at(-1),afterHasReplies:(p.get(f.at(-1)?.id??``)?.length??0)>0})]}),/* @__PURE__ */ (0,Z.jsx)(ME,{scope:`channel:${t}`,role:`main`,placeholder:`message #${t}…`,known:e.known,onSend:({text:e,noSync:n,labels:r,files:i})=>void Jm({channel:t,re:null,text:e,noSync:n,labels:r,files:i}),onEditLast:()=>{let e=xL(f,n.me.actor);e&&km(e.id)}})]})}function TL(e){let{id:t,state:n}=e,[r,i]=(0,O.useState)(!1);(0,O.useEffect)(()=>{Wm(t).then(()=>i(!xm().messages[t]))},[t]);let a=(0,O.useMemo)(()=>cm(n,t),[n.messages,n.ops,n.pending,n.actors,t]),o=Object.fromEntries((n.discovery?.sync??[]).map(e=>[e.key,e.platform])),s={me:n.me.actor,now:e.now,known:e.known,platforms:o};return/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(gL,{title:`thread`,meta:a?`in #${a.root.channel}`:void 0,children:/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`close (esc)`,onClick:()=>EI(OI({thread:null})),children:/* @__PURE__ */ (0,Z.jsx)(ve,{size:15,strokeWidth:1.75})})}),/* @__PURE__ */ (0,Z.jsx)(NE,{scope:`thread:${t}`,first:t,last:`${a?.replies.at(-1)?.id??t}+${a?.pending.length??0}`,children:a?/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(QI,{messages:[a.root],now:e.now,options:s}),/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`divider`,children:a.replies.length===1?`1 reply`:`${a.replies.length} replies`}),/* @__PURE__ */ (0,Z.jsx)(QI,{messages:a.replies,now:e.now,options:s,after:a.root}),/* @__PURE__ */ (0,Z.jsx)(nL,{posts:a.pending,me:n.me,after:a.replies.at(-1)})]}):/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`empty`,children:r?`no such thread`:`loading…`})}),a&&/* @__PURE__ */ (0,Z.jsx)(ME,{scope:`thread:${t}`,role:`thread`,placeholder:`reply to thread…`,known:e.known,onSend:({text:e,noSync:n,labels:r,files:i})=>void Jm({channel:a.root.channel,re:t,text:e,noSync:n,labels:r,files:i}),onEditLast:()=>{let e=xL([a.root,...a.replies],n.me.actor);e&&km(e.id)}})]})}function EL({entry:e,now:t,lead:n}){let[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(null),s=()=>{o(null),Gm(e).then(i,e=>o(e.message))};return(0,O.useEffect)(s,[e]),/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(gL,{title:`inbox · ${e}`,meta:`raw platform events, newest first`,lead:n,children:/* @__PURE__ */ (0,Z.jsx)(`button`,{className:`tool`,title:`refresh`,onClick:s,children:/* @__PURE__ */ (0,Z.jsx)(me,{size:14,strokeWidth:1.75})})}),/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`feed-wrap`,children:/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`feed`,children:/* @__PURE__ */ (0,Z.jsxs)(`div`,{children:[a&&/* @__PURE__ */ (0,Z.jsxs)(`p`,{className:`error`,children:[`error: `,a]}),!a&&r===null&&/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`empty`,children:`loading…`}),r?.length===0&&/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`empty`,children:`no events yet`}),r?.map(e=>{let t=e.event;return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`inbox-row`,children:[/* @__PURE__ */ (0,Z.jsx)(MI,{iso:e.createdAt}),/* @__PURE__ */ (0,Z.jsx)(`span`,{children:/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`badge`,children:t.kind})}),/* @__PURE__ */ (0,Z.jsxs)(`div`,{children:[/* @__PURE__ */ (0,Z.jsxs)(`div`,{children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`author`,children:t.author?.handle??`—`}),` `,t.text??t.type??t.emoji??``]}),/* @__PURE__ */ (0,Z.jsxs)(`pre`,{children:[e.channel,` · `,e.event.thread]})]})]},e.id)})]})})})]})}(0,ye.createRoot)(document.getElementById(`root`)).render(/* @__PURE__ */ (0,Z.jsx)(hL,{}));export{il as C,Pe as D,Me as E,Ee as O,G as S,Ae as T,yl as _,Vd as a,Ul as b,_u as c,yu as d,Xl as f,Ql as g,Jl as h,Rd as i,bu as l,iu as m,zf as n,Nd as o,ru as p,Id as r,vu as s,Np as t,xu as u,cl as v,ke as w,K as x,el as y};