foss-design 0.3.6 → 0.4.1

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.
@@ -1,157 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function te(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 ne(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,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=ne(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(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 re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(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 ae=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 M(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,ae)}catch(e){ae(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function oe(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 M(oe.bind(null,e))}var se={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(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=se,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=oe,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:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=M,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`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),ae=Symbol.for(`react.suspense`),M=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),se=Symbol.for(`react.lazy`),ce=Symbol.for(`react.activity`),le=Symbol.for(`react.legacy_hidden`),ue=Symbol.for(`react.memo_cache_sentinel`),de=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function ge(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case ae:return`Suspense`;case M:return`SuspenseList`;case ce:return`Activity`;case de:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case re:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?ge(e.type)||`Memo`:t;case se:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var _e=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function F(e){return{current:e}}function xe(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Se(e,t){be++,ye[be]=e.current,e.current=t}var Ce=F(null),we=F(null),Te=F(null),Ee=F(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mp(t),e=hp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Ce),Se(Ce,e)}function Oe(){xe(Ce),xe(we),xe(Te)}function ke(e){var t=e.memoizedState;t!==null&&(dh._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=hp(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(xe(Ce),xe(we)),Ee.current===e&&(xe(Ee),dh._currentValue=ve)}var je,Me;function I(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+je+e+Me}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?I(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return I(e.type);case 16:return I(`Lazy`);case 13:return e.child!==t&&t!==null?I(`Suspense Fallback`):I(`Suspense`);case 19:return I(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return I(`Activity`);case 30:return I(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Be=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ke=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function $e(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(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 ct(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=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(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 lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(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-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(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 ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(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-et(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&&gt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(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 bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Dh(e.type)):e}function St(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gm(e);e!==null;){if(n=e[wt])return n;e=gm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Le.call(Kt,e)?!0:Le.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var L=!1;function Jt(){var e=L;return L=!1,e}function Yt(e,t,n){if(qt(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 Xt(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 Zt(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 Qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function en(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 tn(e){if(!e._valueTracker){var t=$t(e)?`checked`:`value`;e._valueTracker=en(e,t,``+e[t])}}function nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=$t(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var rn=/[\n"\\]/g;function an(e){return e.replace(rn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function on(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=``+Qt(t)):e.value!==``+Qt(t)&&(e.value=``+Qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):cn(e,Qt(n)):o===`number`&&e.value==t?cn(e,Qt(e.value)):cn(e,Qt(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=``+Qt(s):e.removeAttribute(`name`)}function sn(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)){tn(e);return}n=n==null?``:``+Qt(n),t=t==null?n:``+Qt(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),tn(e)}function cn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function ln(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=``+Qt(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 un(e,t,n){if(t!=null&&(t=``+Qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Qt(n)}function dn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(_e(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),tn(e)}function fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pn=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 mn(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||pn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function hn(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]=``,L=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(mn(e,a,r),L=!0)}else for(var o in t)t.hasOwnProperty(o)&&mn(e,o,t[o])}function gn(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 _n=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`]]),vn=/^[\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 yn(e){return vn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function bn(){}var xn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,wn=null;function Tn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(on(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="`+an(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));on(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&&nn(r)}break a;case`textarea`:un(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&ln(e,!!n.multiple,t,!1)}}}var En=!1;function Dn(e,t,n){if(En)return e(t,n);En=!0;try{return e(t)}finally{if(En=!1,(Cn!==null||wn!==null)&&(Ud(),Cn&&(t=Cn,e=wn,wn=Cn=null,Tn(t),e)))for(t=0;t<e.length;t++)Tn(e[t])}}function On(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||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 kn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,An=!1;if(kn)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){An=!0}}),window.addEventListener(`test`,jn,jn),window.removeEventListener(`test`,jn,jn)}catch{An=!1}var Mn=null,Nn=null,Pn=null;function Fn(){if(Pn)return Pn;var e,t=Nn,n=t.length,r,i=`value`in Mn?Mn.value:Mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Pn=i.slice(e,1<r?1-r:void 0)}function In(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 Ln(){return!0}function Rn(){return!1}function zn(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)?Ln:Rn,this.isPropagationStopped=Rn,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=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vn=zn(Bn),Hn=D({},Bn,{view:0,detail:0}),Un=zn(Hn),Wn,Gn,R,Kn=D({},Hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==R&&(R&&e.type===`mousemove`?(Wn=e.screenX-R.screenX,Gn=e.screenY-R.screenY):Gn=Wn=0,R=e),Wn)},movementY:function(e){return`movementY`in e?e.movementY:Gn}}),qn=zn(Kn),Jn=zn(D({},Kn,{dataTransfer:0})),Yn=zn(D({},Hn,{relatedTarget:0})),Xn=zn(D({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=zn(D({},Bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=zn(D({},Bn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=zn(D({},Hn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=In(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?In(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?In(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=zn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=zn(D({},Bn,{submitter:0})),sr=zn(D({},Hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=zn(D({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=zn(D({},Kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ur=zn(D({},Bn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=kn&&`CompositionEvent`in window,pr=null;kn&&`documentMode`in document&&(pr=document.documentMode);var mr=kn&&`TextEvent`in window&&!pr,hr=kn&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function z(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function xr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Fn(),Pn=Nn=Mn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Sr={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 Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Sr[e.type]:t===`textarea`}function wr(e,t,n,r){Cn?wn?wn.push(r):wn=[r]:Cn=r,t=Zf(t,`onChange`),0<t.length&&(n=new Vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Tr=null,Er=null;function Dr(e){Gf(e,0)}function Or(e){if(nn(It(e)))return e}function kr(e,t){if(e===`change`)return t}var Ar=!1;if(kn){var jr;if(kn){var Mr=`oninput`in document;if(!Mr){var Nr=document.createElement(`div`);Nr.setAttribute(`oninput`,`return;`),Mr=typeof Nr.oninput==`function`}jr=Mr}else jr=!1;Ar=jr&&(!document.documentMode||9<document.documentMode)}function Pr(){Tr&&(Tr.detachEvent(`onpropertychange`,Fr),Er=Tr=null)}function Fr(e){if(e.propertyName===`value`&&Or(Er)){var t=[];wr(t,Er,e,Sn(e)),Dn(Dr,t)}}function Ir(e,t,n){e===`focusin`?(Pr(),Tr=t,Er=n,Tr.attachEvent(`onpropertychange`,Fr)):e===`focusout`&&Pr()}function Lr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Or(Er)}function Rr(e,t){if(e===`click`)return Or(t)}function zr(e,t){if(e===`input`||e===`change`)return Or(t)}function Br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Vr=typeof Object.is==`function`?Object.is:Br;function Hr(e,t){if(Vr(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(!Le.call(t,i)||!Vr(e[i],t[i]))return!1}return!0}function Ur(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 Wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gr(e,t){var n=Wr(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=Wr(n)}}function Kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ur(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=Ur(e.document)}return t}function B(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Jr=kn&&`documentMode`in document&&11>=document.documentMode,Yr=null,Xr=null,Zr=null,Qr=!1;function $r(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qr||Yr==null||Yr!==Ur(r)||(r=Yr,`selectionStart`in r&&B(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zr&&Hr(Zr,r)||(Zr=r,r=Zf(Xr,`onSelect`),0<r.length&&(t=new Vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Yr)))}function ei(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ti={animationend:ei(`Animation`,`AnimationEnd`),animationiteration:ei(`Animation`,`AnimationIteration`),animationstart:ei(`Animation`,`AnimationStart`),transitionrun:ei(`Transition`,`TransitionRun`),transitionstart:ei(`Transition`,`TransitionStart`),transitioncancel:ei(`Transition`,`TransitionCancel`),transitionend:ei(`Transition`,`TransitionEnd`)},ni={},ri={};kn&&(ri=document.createElement(`div`).style,`AnimationEvent`in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),`TransitionEvent`in window||delete ti.transitionend.transition);function ii(e){if(ni[e])return ni[e];if(!ti[e])return e;var t=ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ri)return ni[e]=t[n];return e}var ai=ii(`animationend`),oi=ii(`animationiteration`),si=ii(`animationstart`),ci=ii(`transitionrun`),li=ii(`transitionstart`),ui=ii(`transitioncancel`),di=ii(`transitionend`),fi=new Map,pi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);pi.push(`scrollEnd`);function mi(e,t){fi.set(e,t),Ht(t,[e])}var hi=0;function gi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=hi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function _i(e){if(e==null||typeof e==`string`)return e;var t=null,n=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 vi(e,t){return e=_i(e),t=_i(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var yi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},bi=[],xi=0,Si=0;function Ci(){for(var e=xi,t=Si=xi=0;t<e;){var n=bi[t];bi[t++]=null;var r=bi[t];bi[t++]=null;var i=bi[t];bi[t++]=null;var a=bi[t];if(bi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Di(n,i,a)}}function wi(e,t,n,r){bi[xi++]=e,bi[xi++]=t,bi[xi++]=n,bi[xi++]=r,Si|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ti(e,t,n,r){return wi(e,t,n,r),Oi(e)}function Ei(e,t){return wi(e,null,null,t),Oi(e)}function Di(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Oi(e){if(50<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 ki={};function Ai(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ji(e,t,n,r){return new Ai(e,t,n,r)}function Mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ni(e,t){var n=e.alternate;return n===null?(n=ji(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Pi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Mi(r)&&(s=1);else if(typeof r==`string`)s=Zm(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ce:return e=ji(31,n,t,a),e.elementType=ce,e.lanes=o,e;case j:return Ii(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=ji(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ae:return e=ji(13,n,t,a),e.elementType=ae,e.lanes=o,e;case M:return e=ji(19,n,t,a),e.elementType=M,e.lanes=o,e;case le:case de:return e=a|32,e=ji(30,n,t,e),e.elementType=de,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case re:s=10;break a;case ne:s=9;break a;case ie:s=11;break a;case oe:s=14;break a;case se:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ji(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ii(e,t,n,r){return e=ji(7,e,r,t),e.lanes=n,e}function Li(e,t,n){return e=ji(6,e,null,t),e.lanes=n,e}function Ri(e){var t=ji(18,null,null,0);return t.stateNode=e,t}function zi(e,t,n){return t=ji(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bi=new WeakMap;function Vi(e,t){if(typeof e==`object`&&e){var n=Bi.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Bi.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Hi=[],Ui=0,Wi=null,Gi=0,Ki=[],qi=0,Ji=null,Yi=1,Xi=``;function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Wi,Wi=e,Gi=t}function Qi(e,t,n){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Ji=e;var r=Yi;e=Xi;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yi=1<<32-et(t)+i|n<<i|r,Xi=a+e}else Yi=1<<a|n<<i|r,Xi=e}function $i(e){e.return!==null&&(Zi(e,1),Qi(e,1,0))}function ea(e){for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null;for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Xi=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null}function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Yi=t.id,Xi=t.overflow,Ji=e}var na=null,ra=null,V=!1,ia=null,aa=!1,oa=Error(i(519));function sa(e){throw pa(Vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),oa}function ca(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<Uf.length;n++)J(Uf[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),sn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),dn(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||rp(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||sa(e,!0)}function la(e){for(na=e.return;na;)switch(na.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:na=na.return}}function ua(e){if(e!==na)return!1;if(!V)return la(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&ra&&sa(e),la(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=hm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=hm(e)}else t===27?(t=ra,Ep(e.type)?(e=mm,mm=null,ra=e):ra=t):ra=na?pm(e.stateNode.nextSibling):null;return!0}function da(){ra=na=null,V=!1}function fa(){var e=ia;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),ia=null),e}function pa(e){ia===null?ia=[e]:ia.push(e)}var ma=F(null),ha=null,ga=null;function _a(e,t,n){Se(ma,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ma.current,xe(ma)}function ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ba(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ya(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ya(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ya(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function xa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.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&&ba(t,e,n,r),t.flags|=262144,e!==null}function Sa(e){for(e=e.firstContext;e!==null;){if(!Vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ca(e){ha=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wa(e){return Ea(ha,e)}function Ta(e,t){return ha===null&&Ca(e),Ea(e,t)}function Ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ga===null){if(e===null)throw Error(i(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return n}var Da=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Oa=t.unstable_scheduleCallback,ka=t.unstable_NormalPriority,Aa={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ja(){return{controller:new Da,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Oa(ka,function(){e.controller.abort()})}function Na(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Pa=null;function Fa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ia=null,La=0,Ra=0,za=null;function Ba(e,t){if(Ia===null){var n=Ia=[];La=0,Ra=Rf(),za={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return La++,t.then(Va,Va),t}function Va(){if(--La===0&&(Pa=null,Ia!==null)){za!==null&&(za.status=`fulfilled`);var e=Ia;Ia=null,Ra=0,za=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ua=N.S;N.S=function(e,t){if(yd=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Ba(e,t),Pa!==null)for(var n=wf;n!==null;)Na(n,Pa),n=n.next;if(n=e.types,n!==null){for(var r=wf;r!==null;)Na(r,n),r=r.next;if(Ra!==0){r=Pa,r===null&&(r=Pa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ua!==null&&Ua(e,t)};var Wa=F(null);function Ga(){var e=Wa.current;return e===null?nd.pooledCache:e}function Ka(e,t){t===null?Se(Wa,Wa.current):Se(Wa,t.pool)}function qa(){var e=Ga();return e===null?null:{parent:Aa._currentValue,pool:e}}var Ja=Error(i(460)),Ya=Error(i(474)),Xa=Error(i(542)),Za={then:function(){}};function Qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function $a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(bn,bn);else{if(e=nd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e}throw to=t,Ja}}function eo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(to=e,Ja):e}}var to=null;function no(){if(to===null)throw Error(i(459));var e=to;return to=null,e}function ro(e){if(e===Ja||e===Xa)throw Error(i(483))}var io=null,ao=0;function oo(e){var t=ao;return ao+=1,io===null&&(io=[]),$a(io,e,t)}function so(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function co(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function lo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ni(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),so(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===se&&eo(i)===t.type)?(t=a(t,n.props),so(t,n),t.return=e,t):(t=Fi(n.type,n.key,n.props,null,e.mode,r),so(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=zi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ii(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Fi(t.type,t.key,t.props,null,e.mode,n),so(n,t),n.return=e,n;case A:return t=zi(t,e.mode,n),t.return=e,t;case se:return t=eo(t),f(e,t,n)}if(_e(t)||me(t))return t=Ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,oo(t),n);if(t.$$typeof===re)return f(e,Ta(e,t),n);co(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case se:return n=eo(n),p(e,t,n,r)}if(_e(n)||me(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,oo(n),r);if(n.$$typeof===re)return p(e,t,Ta(e,n),r);co(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case se:return r=eo(r),m(e,t,n,r,i)}if(_e(r)||me(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,oo(r),i);if(r.$$typeof===re)return m(e,t,n,Ta(t,r),i);co(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Zi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return V&&Zi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Zi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),V&&Zi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Zi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),V&&Zi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),so(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===se&&eo(l)===r.type){n(e,r.sibling),c=a(r,o.props),so(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ii(o.props.children,e.mode,c,o.key),so(c,o),c.return=e,e=c):(c=Fi(o.type,o.key,o.props,null,e.mode,c),so(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=zi(o,e.mode,c),c.return=e,e=c}return s(e);case se:return o=eo(o),_(e,r,o,c)}if(_e(o))return h(e,r,o,c);if(me(o)){if(l=me(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,oo(o),c);if(o.$$typeof===re)return _(e,r,Ta(e,o),c);co(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ao=0;var i=_(e,t,n,r);return io=null,i}catch(t){if(t===Ja||t===Xa)throw t;var a=ji(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var uo=lo(!0),fo=lo(!1),po=!1;function mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ho(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _o(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Oi(e),Di(e,null,n),t}return wi(e,r,t,n),Oi(e)}function vo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function yo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var bo=!1;function xo(){if(bo){var e=za;if(e!==null)throw e}}function So(e,t,n,r){bo=!1;var i=e.updateQueue;po=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(K&f)===f:(r&f)===f){f!==0&&f===Ra&&(bo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:po=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ud|=o,e.lanes=o,e.memoizedState=d}}function Co(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function wo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Co(n[e],t)}var To=F(null),Eo=F(0);function Do(e,t){e=cd,Se(Eo,e),Se(To,t),cd=e|t.baseLanes}function Oo(){Se(Eo,cd),Se(To,To.current)}function ko(){cd=Eo.current,xe(To),xe(Eo)}var Ao=F(null),jo=null;function Mo(e){var t=e.alternate;Se(Lo,Lo.current&1),Se(Ao,e),jo===null&&(t===null||To.current!==null||t.memoizedState!==null)&&(jo=e)}function No(e){Se(Lo,Lo.current),Se(Ao,e),jo===null&&(jo=e)}function Po(e){e.tag===22?(Se(Lo,Lo.current),Se(Ao,e),jo===null&&(jo=e)):Fo()}function Fo(){Se(Lo,Lo.current),Se(Ao,Ao.current)}function Io(e){xe(Ao),jo===e&&(jo=null),xe(Lo)}var Lo=F(0);function Ro(e,t){Se(Ao,Ao.current),Se(Lo,t)}function zo(e){xe(Lo),xe(Ao),jo===e&&(jo=null)}function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||um(n)||dm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vo=0,H=null,Ho=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vr(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Vo=a,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){N.H=hc;var t=Ho!==null&&Ho.next!==null;if(Vo=0,Uo=Ho=H=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&Sa(e)&&(Pc=!0))}function ts(e,t,n,r){H=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=Ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=vc,o=t(n,r)}while(Go);return o}function ns(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(Ho===null?null:Ho.memoizedState)!==e&&(H.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Vo=0,Uo=Ho=H=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?H.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(Ho===null){var e=H.alternate;e=e===null?null:e.memoizedState}else e=Ho.next;var t=Uo===null?H.memoizedState:Uo.next;if(t!==null)Uo=t,Ho=e;else{if(e===null)throw H.alternate===null?Error(i(467)):Error(i(310));Ho=e,e={memoizedState:Ho.memoizedState,baseState:Ho.baseState,baseQueue:Ho.baseQueue,queue:Ho.queue,next:null},Uo===null?H.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=$a(Yo,e,t),t=H,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===fe)return;if(e.$$typeof===re)return wa(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=H.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=cs(),H.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ue;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),Ho,e)}function ms(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Vo&f)===f:(K&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ra&&(d=!0);else if((Vo&p)===p){u=u.next,p===Ra&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,H.lanes|=p,ud|=p;f=u.action,Ko&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,H.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Vr(o,e.memoizedState)&&(Pc=!0,d&&(n=za,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function hs(e){var t=ss(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Vr(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=H,a=ss(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Vr((Ho||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Vs(ys.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,nd===null)throw Error(i(349));o||Vo&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=cs(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vr(e,n)}catch{return!0}}function xs(e){var t=Ei(e,2);t!==null&&Rd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,Ho,typeof r==`function`?r:fs)}function ws(e,t,n,r,a){if(fc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};o.types=a===null?null:a.types,N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(V){var n=nd.formState;if(n!==null){a:{var r=H;if(V){if(ra){b:{for(var i=ra,a=aa;i.nodeType!==8;){if(!a){i=null;break b}if(i=pm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ra=pm(i.nextSibling),r=i.data===`F!`;break a}}sa(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,H,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,H,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,H,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),Ho,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Ja?Xa:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(H.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ss(),n=Ho;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=H.updateQueue,t===null&&(t=cs(),H.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ls(){return ss().memoizedState}function Rs(e,t,n,r){var i=os();H.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;Ho!==null&&r!==null&&Qo(r,Ho.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(H.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=cs(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(W&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Vo&1073741824&&!(K&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),H.lanes|=e,ud|=e,n)}function Qs(e,t,n,r){return Vr(n,t)?n:To.current===null?!(Vo&106)||Vo&1073741824&&!(K&261930)?(Pc=!0,e.memoizedState=n):(e=Id(),H.lanes|=e,ud|=e,t):(e=Zs(e,n,r),Vr(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};s.types=o===null?null:o.types,N.T=s,dc(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ha(c,r),Fd(e)):uc(e,t,r,Fd(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,ve,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:ve},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Fd())}function ic(){return wa(dh)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=go(n);var r=_o(t,e,n);r!==null&&(Rd(r,t,n),vo(r,t,n)),t={cache:ja()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Ti(e,t,n,r),n!==null&&(Rd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Fd())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Vr(s,o))return wi(e,t,i,0),nd===null&&Ci(),!1}catch{}if(n=Ti(e,t,i,r),n!==null)return Rd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Rf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=Ti(e,n,r,2),t!==null&&Rd(t,e,2)}function fc(e){var t=e.alternate;return e===H||t!==null&&t===H}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var hc={readContext:wa,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:wa,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=cc.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,H,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,a=os();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),nd===null)throw Error(i(349));K&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=nd.identifierPrefix;if(V){var n=Xi,r=Yi;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,H)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(W&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ss(),Ho.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(ss(),Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ss();return Ho===null?Zs(n,e,t):Qs(n,Ho.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ss();return Ho===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=go(r);i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Rd(t,e,r),vo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=go(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Rd(t,e,r),vo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=go(n);r.tag=2,t!=null&&(r.callback=t),t=_o(e,r,n),t!==null&&(Rd(t,e,n),vo(t,e,n))}};function xc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Hr(n,r)||!Hr(i,a):!0}function Sc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bc.enqueueReplaceState(t,t.state,null)}function Cc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){yi(e)}function Tc(e){console.error(e)}function Ec(e){yi(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){return n=go(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=go(e),e.tag=3,e}function jc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&xa(t,n,a,!0),n=Ao.current,n!==null){switch(n.tag){case 31:case 13:case 19:return jo===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),vf(e,r,a)),!1;case 22:return n.flags|=65536,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),vf(e,r,a)),!1}throw Error(i(435,n.tag))}return vf(e,r,a),Xd(),!1}if(V)return t=Ao.current,t===null?(r!==oa&&(t=Error(i(423),{cause:r}),pa(Vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Vi(r,n),a=kc(e.stateNode,r,a),yo(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==oa&&(e=Error(i(422),{cause:r}),pa(Vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Vi(o,n),hd===null?hd=[o]:hd.push(o),ld!==4&&(ld=2),t===null)return!0;r=Vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),yo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),yo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?fo(t,null,n,r):uo(t,e.child,n,r)}function Ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ca(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(V&&s&&$i(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Hr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Hr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ka(t,a===null?null:a.cachePool),a===null?Oo():Do(t,a),Po(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ka(t,null),Oo(),Fo()):(Ka(t,a.cachePool),Do(t,a),Fo(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Ga();return a=a===null?null:{parent:Aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ka(t,null),Oo(),Po(t),e!==null&&xa(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return uo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Io(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(No(t),(e=ra)?(e=lm(e,aa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(No(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||xa(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(To.current===null){if(r=nd,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ei(e,s),Rd(r,e,s),Nc;Xd()}t=Uc(e,t,n)}else e=o.treeContext,ra=pm(s.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Kc(e,t,n,r,i){return Ca(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(V&&r&&$i(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ca(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(V&&r&&$i(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ca(t),t.stateNode===null){var a=ki,o=n.contextType;typeof o==`object`&&o&&(a=wa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},mo(t),o=n.contextType,a.context=typeof o==`object`&&o?wa(o):ki,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&bc.enqueueReplaceState(a,a.state,null),So(t,r,a,i),xo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ki,typeof u==`object`&&u&&(o=wa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Sc(t,a,r,o),po=!1;var f=t.memoizedState;a.state=f,So(t,r,a,i),xo(),l=t.memoizedState,s||f!==l||po?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=po||xc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ho(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ki,typeof l==`object`&&l&&(c=wa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Sc(t,a,r,c),po=!1,f=t.memoizedState,a.state=f,So(t,r,a,i),xo();var p=t.memoizedState;o!==d||f!==p||po||e!==null&&e.dependencies!==null&&Sa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=po||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Sa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=uo(t,e.child,null,i),t.child=uo(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return da(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:qa()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Lo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(V){if(i?Mo(t):Fo(),(e=ra)?(e=lm(e,aa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=dm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Fo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Ii(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(Mo(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Fo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ni(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ii(i,a,n,null),i.flags|=2):i=Ni(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=qa():(s=Aa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=Ni(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=ji(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return uo(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Mo(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Fo(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=Ii(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,uo(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,a)):(Fo(),t.child=e.child,t.flags|=128,null);if(Mo(t),dm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,pa({value:a,source:null,stack:null})),nl(e,t,c)}if(Pc||xa(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(To.current!==null)return nl(e,t,c);if(r=nd,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ei(e,a),Rd(r,e,a),Nc;return um(o)||Xd(),nl(e,t,c)}return um(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ra=pm(o.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ya(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Bo(n)===null&&(t=e),e=e.sibling}return t}function ol(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Lo.current;if(t.flags&128)return Ro(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ro(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=V?Gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return _a(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(xa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Sa(e)))}function fl(e,t,n){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),_a(t,Aa,e.memoizedState.cache),da();break;case 27:case 5:ke(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Mo(t),t.flags|=128,null;r=xa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Mo(t),e=ul(e,t,n),e===null?null:e.sibling)}Mo(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(xa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ro(t,Lo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:_a(t,Aa,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,V&&t.flags&1048576&&Qi(t,Gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=eo(t.elementType),t.type=e,typeof e==`function`)Mi(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===oe){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===re){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=ge(e)||e,Error(i(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ho(e,t),So(t,r,null,n);var s=t.memoizedState;if(r=s.cache,_a(t,Aa,r),r!==o.cache&&ba(t,[Aa],n,!0),xo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Yc(e,t,r,n);break a}if(r!==a){a=Vi(Error(i(424)),t),pa(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ra=pm(e.firstChild),na=t,V=!0,ia=null,aa=!0,n=fo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(da(),r===a){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(t.stateNode=gp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&V&&(r=t.stateNode=ym(t.type,t.pendingProps,Te.current),na=t,aa=!0,a=ra,Ep(t.type)?(mm=a,ra=pm(r.firstChild)):ra=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=ra)&&(r=sm(r,t.type,t.pendingProps,aa),r===null?a=!1:(t.stateNode=r,na=t,ra=pm(r.firstChild),aa=!1,a=!0)),a||sa(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,_p(a,o)?r=null:s!==null&&_p(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),dh._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=ra)&&(n=cm(n,t.pendingProps,aa),n===null?e=!1:(t.stateNode=n,na=t,ra=null,e=!0)),e||sa(t)),null;case 13:return $c(e,t,n);case 4:return De(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ca(t),a=wa(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ca(t),r=wa(Aa),e===null?(a=Ga(),a===null&&(a=nd,o=ja(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},mo(t),_a(t,Aa,a)):((e.lanes&n)!==0&&(ho(e,t),So(t,null,null,n),xo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,_a(t,Aa,r),r!==a.cache&&ba(t,[Aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),_a(t,Aa,r))),Fc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:V&&$i(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Qm(t,r):Qm(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 to=Za,Ya}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$m(t)){if(qd())e.flags|=8192;else throw to=Za,Ya}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,md|=t)}function vl(e,t){if(!V)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ea(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),va(Aa),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ua(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fa())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(Ae(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=Ce.current,ua(t)?ca(t,e):(e=ym(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,ua(t))ca(t,o);else{var s=pp(Te.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[wt]=t,o[Tt]=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(op(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,ua(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=na,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||sa(t,!0)}else e=pp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ua(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[wt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Io(t),t):(Io(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ua(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[wt]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Io(t),t):(Io(t),null)}return Io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),yl(t),null);case 4:return Oe(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return va(t.type),yl(t),null;case 19:if(zo(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pi(n,e),n=n.sibling;return Ro(t,Lo.current&1|2),V&&Zi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>bd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Bo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!V)return yl(t),null}else 2*He()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=He(),e.sibling=null,o=Lo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||V?Ro(t,o):(n=o,Se(Ao,t),Se(Lo,n),jo===null&&(jo=t)),V&&Zi(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Io(t),ko(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&xe(Wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Aa),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ea(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Aa),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Io(t),t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Oe(),null;case 10:return va(t.type),null;case 22:case 23:return Io(t),ko(),e!==null&&xe(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Aa),null;case 25:return null;default:return null}}function Sl(e,t){switch(ea(t),t.tag){case 3:va(Aa),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Io(t);break;case 13:Io(t);break;case 19:zo(t);break;case 10:va(t.type);break;case 22:case 23:Io(t),ko(),e!==null&&xe(Wa);break;case 24:va(Aa)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){q(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){q(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wo(t,n)}catch(t){q(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){q(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=gi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);m(e.child,!1,nm,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){q(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){q(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){q(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&im(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&am(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){q(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[Tt]=t}catch(t){q(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ep(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bn)),kl(e,r),L=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),L=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[wt]=e,t[Tt]=n}catch(t){q(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Vl=!0,kp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=vi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=gi(r,n),a=vi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Ld(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=vi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=vi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Ld(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode);t=vi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Mp(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&&kp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=gi(n,r),a=vi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,U=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,dp=bh,e=qr(e),B(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(fp={focusedElem:e,selectionRange:r},bh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&eu(e),gu(n))}}Hl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){q(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=gi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=vi(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Cl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){q(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){q(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Lu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{wo(e,t)}catch(e){q(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xf.bind(null,n),fm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||U;t=ou,i=U,ou=r,(U=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),ou=t,U=i}break;case 30:Lu(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(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){q(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,L=!0}catch(t){q(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){q(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(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 Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:U||Ol(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!U&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:U||Ol(n,t),jl(n);var r=Su,i=Cu;Ep(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),bm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:U||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),L=!0}catch(e){q(n,t,e)}else try{Su.removeChild(n.stateNode),L=!0}catch(e){q(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Kh(e)):Dp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),U||wl(4,n,t),wu(e,t,n);break;case 1:U||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:U=(r=U)||n.memoizedState!==null,wu(e,t,n),U=r;break;case 30:Ol(n,t),wu(e,t,n);break;case 7:U||Ol(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kh(e)}catch(e){q(t,t.return,e)}}}function Du(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){q(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Sf.bind(null,e,t);t.then(r,r)}})}function Au(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(Ep(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(i(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(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}Au(t,e,n),Nu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),a&512&&(U||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),a&512&&(U||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=gp(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[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),op(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Ym(`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),op(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Ym(`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),op(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else ou||Xm(o,e.type,e.stateNode)}else e.stateNode=Wm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||U||t.parentNode.removeChild(t)):a.count--,n===null?ou||Xm(o,e.type,e.stateNode):Wm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),a&512&&(U||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),a&512&&(U||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{fn(t,``),L=!0}catch(t){q(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,L=!0}catch(t){q(e,e.return,t)}}break;case 3:if(L=!1,Jm=null,o=ju,ju=wm(t.containerInfo),Au(t,e,n),ju=o,Nu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Kh(t.containerInfo)}catch(t){q(e,e.return,t)}cu&&(cu=!1,Pu(e)),L=!1;break;case 4:a=su,su=ou,r=Jt(),o=ju,ju=wm(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,L&&fu&&(pu=!0),L=r,su=a;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=He()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=U,u=su;ou=c||o,su=u||o,U=l||s,Au(t,e,n),U=l,su=u,ou=c,Nu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||U||(t=s||U,n=ou,r=U,ou=o||ou,U=t,Ru(e,2),ou=n,U=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:a&512&&(U||r===null||Ol(r,r.return)),a=Jt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&vi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&L&&(e.flags|=4),fu=o,L=a;break;case 21:break;case 7:a&512&&(U||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(fn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,bh=!0,t.reset(),bh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else au(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Gl(),Fu(t,e),!du&&!pu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(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`})),mu=!0}Wl=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Zl(e,!1));break;case 30:r=du,i=Gl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=gi(a,o),o=gi(n.memoizedProps,o);var s=vi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),Ru(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),Ru(n,r);break;case 27:r&2&&bm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),Ru(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||U||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Ol(n,n.return),Ru(n,r);break;case 7:Ol(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(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:zu(i,a,n),Cl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Co(l[i],c)}catch(e){q(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Xm(wm(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),Dl(a,a.return);break;case 30:zu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ma(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ma(a)));break;case 12:if(a&2048){Hu(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){q(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(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:Wu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(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:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&th(n,e)):nh(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&th(n,e));break;case 3:case 4:var r=ju;ju=wm(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(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 Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}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];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=wa(Aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return wa(Aa).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,W=0,nd=null,G=null,K=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 W&2&&K!==0?K&-K:N.T===null?xt():Rf()}function Id(){if(pd===0){if(!(K&536870912)||V){var e=at;at<<=1,!(at&3932160)&&(at=262144),pd=e}else pd=536870912}return e=Ao.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=Rp(gi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===nd&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,K,pd,!1)),mt(e,n),(!(W&2)||e!==nd)&&(e===nd&&(!(W&2)&&(dd|=n),ld===4&&Hd(e,K,pd,!1)),Af(e))}function zd(e,t,n){if(W&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(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-He(),10<a)){if(Hd(r,t,pd,!ad),ct(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=bp(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);Af(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:bn},Hl=null,Ju(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=oh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?vd-He():(a&4194048)===a?yd-He():0,m=ih(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(!Vr(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=ut(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-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&gt(e,n,t)}function Ud(){return W&6?!0:(jf(0,!1),!1)}function Wd(){if(G!==null){if(rd===0)var e=G.return;else e=G,ga=ha=null,as(e),io=null,ao=0,e=G;for(;e!==null;)Sl(e.alternate,e),e=e.return;G=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),nd=e,G=n=Ni(e.current,null),K=t,rd=0,id=null,ad=!1,od=lt(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=ut(e,t),Ci(),n}function Kd(e,t){H=null,N.H=hc,t===Ja||t===Xa?(t=no(),rd=3):t===Ya?(t=no(),rd=4):rd=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,G===null&&(ld=1,Dc(e,Vi(t,e.current)))}function qd(){var e=Ao.current;return e===null?!0:(K&4194048)===K?jo===null:(K&62914560)===K||K&536870912?e===jo:!1}function Jd(){var e=N.H;return N.H=hc,e===null?hc:e}function Yd(){var e=N.A;return N.A=ed,e}function Xd(){ld=4,ad||(K&4194048)!==K&&Ao.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||nd===null||Hd(nd,K,pd,!1)}function Zd(e,t,n){var r=W;W|=2;var i=Jd(),a=Yd();(nd!==e||K!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&G!==null){var s=G,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Ao.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++,ga=ha=null,W=r,N.H=i,N.A=a,G===null&&(nd=null,K=0,Ci()),o}function Qd(){for(;G!==null;)tf(G)}function $d(e,t){var n=W;W|=2;var r=Jd(),a=Yd();nd!==e||K!==t?(xd=null,bd=He()+500,Gd(e,t)):od=lt(e,t);a:do try{if(rd!==0&&G!==null){t=G;var o=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,o,1);break;case 2:case 9:if(Qa(o)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||nd!==e||(rd=7),Af(e)},o.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Qa(o)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,o,7));break;case 5:var s=null;switch(G.tag){case 26:s=G.memoizedState;case 5:case 27:var c=G;if(s?$m(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)G=l;else{var u=c.return;u===null?G=null:(G=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 ga=ha=null,N.H=r,N.A=a,W=n,G===null?(nd=null,K=0,Ci(),ld):0}function ef(){for(;G!==null&&!Be();)tf(G)}function tf(e){var t=pl(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):G=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,K);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,K);break;case 5:as(t);var r=t;r===na&&(V?(la(r),r.tag===5&&r.stateNode!=null&&(ra=r.stateNode)):(la(r),V=!0));default:Sl(n,t),t=G=Pi(t,cd),t=pl(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):G=t}function rf(e,t,n,r){ga=ha=null,as(t),io=null,ao=0;var i=t.return;try{if(Mc(e,i,t,n,K)){ld=1,Dc(e,Vi(n,e.current)),G=null;return}}catch(t){if(i!==null)throw G=i,t;ld=1,Dc(e,Vi(n,e.current)),G=null;return}t.flags&32768?(V||r===1?e=!0:od||K&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ao.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=bl(t.alternate,t,cd);if(n!==null){G=n;return}if(t=t.sibling,t!==null){G=t;return}G=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,G=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){G=e;return}G=e=n}while(e!==null);ld=6,G=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if(W&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===nd&&(G=nd=null,K=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|=Si,ht(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Fa(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Cf(Ke,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,a=W,W|=4;try{hu(e,t,n)}finally{W=a,P.p=i,N.T=r}}Cd=1,Vl?Ad=Ip(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,Iu(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=N.T,N.T=null;var i=P.p;P.p=2;var a=W;W|=4;try{fu=pu=!1,Mu(t,e,n),n=fp;var o=qr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Kr(s.ownerDocument.documentElement,s)){if(c!==null&&B(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 _=Gr(s,h),v=Gr(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=!!dp,fp=dp=null}finally{W=a,P.p=i,N.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=N.T,N.T=null;var r=P.p;P.p=2;var i=W;W|=4;try{_u(e,t.alternate,t)}finally{W=i,P.p=r,N.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Ve();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),bt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=N.T,a=P.p,P.p=2,N.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{N.T=n,P.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(),Af(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),jf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(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=bt(Ed),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,W&6)throw Error(i(331));var c=W;if(W|=4,Zu(o.current),Uu(o,o.current,s,n),W=c,jf(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{P.p=a,N.T=r,mf(e,t)}}function _f(e,t,n){t=Vi(n,t),t=kc(e.stateNode,t,2),e=_o(e,t,2),e!==null&&(mt(e,2),Af(e))}function q(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=Vi(n,e),n=Ac(2),r=_o(t,n,2),r!==null&&(jc(n,r,t,e),mt(r,2),Af(r));break}}t=t.return}}function vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(sd=!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,nd===e&&(K&n)===n&&(ld===4||ld===3&&(K&62914560)===K&&300>He()-vd?W&2?fd|=n:Gd(e,0):fd|=n,md===K&&(md=0)),Af(e)}function bf(e,t){t===0&&(t=ft()),e=Ei(e,t),e!==null&&(mt(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 Re(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-et(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=K,a=ct(r,r===nd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(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&&yp()&&(e=kf);for(var t=He(),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}Cd!==0&&Cd!==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-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=nd,n=K,n=ct(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&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),bt(n)){case 2:case 8:n=Ge;break;case 32:n=Ke;break;case 268435456:n=Je;break;default:n=Ke}return r=Ff.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function Ff(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=K;return r=ct(e,e===nd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Pf(e,He()),e.callbackNode!=null&&e.callbackNode===n?Ff.bind(null,e):null)}function If(e,t){if(hf())return null;zd(e,t,!0)}function Lf(){wp(function(){W&6?Re(We,Mf):Nf()})}function Rf(){if(kf===0){var e=Ra;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),kf=e}return kf}function zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:yn(e)}function Bf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=zf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Vn(`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);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Vf=0;Vf<pi.length;Vf++){var Hf=pi[Vf];mi(Hf.toLowerCase(),`on`+(Hf[0].toUpperCase()+Hf.slice(1)))}mi(ai,`onAnimationEnd`),mi(oi,`onAnimationIteration`),mi(si,`onAnimationStart`),mi(`dblclick`,`onDoubleClick`),mi(`focusin`,`onFocus`),mi(`focusout`,`onBlur`),mi(ci,`onTransitionRun`),mi(li,`onTransitionStart`),mi(ui,`onTransitionCancel`),mi(di,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`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){yi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){yi(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Jf(t,e,2,!1),n.add(r))}function Kf(e,t,n){var r=0;t&&(r|=4),Jf(n,e,r,t)}var Y=`_reactListening`+Math.random().toString(36).slice(2);function qf(e){if(!e[Y]){e[Y]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Wf.has(t)||Kf(t,!1,e),Kf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Y]||(t[Y]=!0,Kf(`selectionchange`,!1,t))}}function Jf(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,!An||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 Yf(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=Pt(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}Dn(function(){var r=a,i=Sn(n),s=[];a:{var c=fi.get(e);if(c!==void 0){var l=Vn,u=e;switch(e){case`keypress`:if(In(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case ai:case oi:case si:l=Xn;break;case di:l=cr;break;case`scroll`:case`scrollend`:l=Un;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}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=On(m,p),g!=null&&d.push(Xf(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!==xn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))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?Pt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(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,Qf):null,c!==null&&$f(s,u,c,d,!1),l!==null&&f!==null&&$f(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=kr;else if(Cr(c)){if(Ar)_=zr;else{_=Lr;var v=Ir}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&gn(r.elementType)&&(_=kr):_=Rr;if(_&&=_(e,r)){wr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Cr(v)||v.contentEditable===`true`)&&(Yr=v,Xr=r,Zr=null);break;case`focusout`:Zr=Xr=Yr=null;break;case`mousedown`:Qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Qr=!1,$r(s,n,i);break;case`selectionchange`:if(Jr)break;case`keydown`:case`keyup`:$r(s,n,i)}var y;if(fr)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 br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Fn()):(Mn=i,Nn=`value`in Mn?Mn.value:Mn.textContent,br=!0)),v=Zf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?z(e,n):xr(e,n))&&(b=Zf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Bf(s,e,r,n,i)}Gf(s,t)})}function Xf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zf(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=On(e,n),i!=null&&r.unshift(Xf(e,i,a)),i=On(e,t),i!=null&&r.push(Xf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Qf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(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=On(n,a),l!=null&&o.unshift(Xf(n,l,c))):i||(l=On(n,a),l!=null&&o.push(Xf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(ep,`
9
- `).replace(tp,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&fn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:hn(e,r,o);return;case`data`:if(t!==`object`){Xt(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=yn(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`&&ip(e,t,`name`,a.name,a,null),ip(e,t,`formEncType`,a.formEncType,a,null),ip(e,t,`formMethod`,a.formMethod,a,null),ip(e,t,`formTarget`,a.formTarget,a,null)):(ip(e,t,`encType`,a.encType,a,null),ip(e,t,`method`,a.method,a,null),ip(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=bn);return;case`onScroll`:r!=null&&J(`scroll`,e);return;case`onScrollEnd`:r!=null&&J(`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=yn(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`:J(`beforetoggle`,e),J(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(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=_n.get(n)||n,Yt(e,n,r);else return}L=!0}function ap(e,t,n,r,a,o){switch(n){case`style`:hn(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`)fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)fn(e,``+r);else return;break;case`onScroll`:r!=null&&J(`scroll`,e);return;case`onScrollEnd`:r!=null&&J(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=bn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.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[Tt]||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}L=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}L=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ip(e,t,o,s,n,null)}}a&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:J(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ip(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in J(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ip(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&ln(e,!!r,n,!0):ln(e,!!r,t,!1);return;case`textarea`:for(s in J(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ip(e,t,s,c,n,null)}dn(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:ip(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<Uf.length;r++)J(Uf[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ip(e,t,u,r,n,null)}return;default:if(gn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(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)||ip(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&&(L=!0),o=m;break;case`name`:m!==f&&(L=!0),a=m;break;case`checked`:m!==f&&(L=!0),u=m;break;case`defaultChecked`:m!==f&&(L=!0),d=m;break;case`value`:m!==f&&(L=!0),s=m;break;case`defaultValue`:m!==f&&(L=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}on(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)||ip(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&&(L=!0),p=o;break;case`defaultValue`:o!==l&&(L=!0),c=o;break;case`multiple`:o!==l&&(L=!0),s=o;default:o!==l&&ip(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?ln(e,!!n,n?[]:``,!1):ln(e,!!n,t,!0)):ln(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:ip(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&&(L=!0),p=a;break;case`defaultValue`:a!==o&&(L=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ip(e,t,s,a,r,o)}un(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:ip(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&&(L=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(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)&&ip(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:ip(e,t,u,p,r,m)}return;default:if(gn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(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||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(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||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){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&&lp(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&&lp(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 dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(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 hp(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 gp(e,t,n,r){return n=pp(n).createElement(e),n[wt]=r,n[Tt]=t,op(n,e,t),Rt(n),n}function _p(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 vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(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`)xm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xm(e.ownerDocument.body)}n=i}while(n);Kh(t)}function Op(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 kp(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 Ap(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 jp(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 Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(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`&&(Pp(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+=eh(f),u>rh){s.length=o;break}f=new Promise(Fp.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 Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.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},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.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(Wp(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=Hp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Bp,e,s,r)}this._eventListeners=a}};function Bp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Wp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Hp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Vp,e,n,i),r.splice(t,1),a!==null&&a()}};function Vp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Hp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Up(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Wp(e,t,n,r){if(e.length===0)return-1;r=Up(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Up(a.optionsOrUseCapture)===r)return i}return-1}zp.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,Hp(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,Hp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=b(e),_m(e,t))}zp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Kp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Gp(t[n],e);n--);};function Kp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=pp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,vm(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(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}zp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Kp,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||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=Pt(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 tm(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)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Kp,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),tm(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),tm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=b(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(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,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(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,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(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`:om(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(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[jt])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=pm(e.nextSibling),e===null)break}return null}function cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pm(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pm(e.nextSibling),e===null))return null;return e}function um(e){return e.data===`$?`||e.data===`$~`}function dm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function fm(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 pm(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 mm=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gm(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 _m(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 vm(e){Cp(function(){Cp(function(t){return e(t)})})}function ym(e,t,n){switch(t=pp(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 bm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===bn&&(e.onclick=null),Nt(e)}function xm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Sm=new Map,Cm=new Set;function wm(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 Tm=P.d;P.d={f:Em,r:Dm,D:Am,C:jm,L:Mm,m:Nm,X:Fm,S:Pm,M:Im};function Em(){var e=Tm.f(),t=Ud();return e||t}function Dm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Tm.r(e)}var Om=typeof document>`u`?null:document;function km(e,t,n){var r=Om;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cm.has(i)||(Cm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Am(e){Tm.D(e),km(`dns-prefetch`,e,null)}function jm(e,t){Tm.C(e,t),km(`preconnect`,e,t)}function Mm(e,t,n){Tm.L(e,t,n);var r=Om;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=Rm(e);break;case`script`:a=Hm(e)}if(!(Sm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zm(a))||t===`script`&&r.querySelector(Um(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Nm(e,t){Tm.m(e,t);var n=Om;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hm(e)}if(!Sm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Sm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Um(a)))return}r=n.createElement(`link`),op(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Pm(e,t,n){Tm.S(e,t,n);var r=Om;if(r&&e){var i=Lt(r).hoistableStyles,a=Rm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sm.get(a))&&Km(e,n);var c=o=r.createElement(`link`);Rt(c),op(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,Gm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Fm(e,t){Tm.X(e,t);var n=Om;if(n&&e){var r=Lt(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Rt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t){Tm.M(e,t);var n=Om;if(n&&e){var r=Lt(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Rt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t,n,r){var a=(a=Te.current)?wm(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=Rm(n.href),t=Lt(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=Rm(n.href);var o=Lt(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(zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Sm.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},Sm.set(e,o)),Vm(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=Hm(n),t=Lt(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 Rm(e){return`href="`+an(e)+`"`}function zm(e){return`link[rel="stylesheet"][`+e+`]`}function Bm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Vm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),op(t,`link`,n),Rt(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 Hm(e){return`[src="`+an(e)+`"]`}function Um(e){return`script[async]`+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Rt(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`),Rt(r),op(r,`style`,a),Gm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rm(n.href);var o=e.querySelector(zm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Bm(n),(a=Sm.get(a))&&Km(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),op(o,`link`,r),t.state.loading|=4,Gm(o,n.precedence,e),t.instance=o;case`script`:return o=Hm(n.src),(a=e.querySelector(Um(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Sm.get(o))&&(r=D({},n),qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),op(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,Gm(r,n.precedence,e));return t.instance}function Gm(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 Km(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jm=null;function Ym(e,t,n){if(Jm===null){var r=new Map,i=Jm=new Map;i.set(n,r)}else i=Jm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||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 Xm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zm(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 Qm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function $m(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function eh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function th(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=eh(t),e.suspenseyImages.push(t)),e=sh.bind(e),t.decode().then(e,e))}function nh(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=Rm(r.href),a=t.querySelector(zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=oh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Bm(r),(i=Sm.get(i))&&Km(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=oh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rh=0;function ih(e,t){return e.stylesheets&&e.count===0&&lh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ah(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function oh(){this.count--,ah(this)}function sh(){this.imgCount--,ah(this)}var ch=null;function lh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ch=new Map,t.forEach(uh,e),ch=null,oh.call(e))}function uh(e,t){if(!(t.state.loading&4)){var n=ch.get(e);if(n)var r=n.get(null);else{n=new Map,ch.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=oh.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:re,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function 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=ji(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},mo(a),e}function mh(e){return e?(e=ki,e):ki}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=go(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=_o(e,r,t),n!==null&&(Rd(n,e,t),vo(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=Ei(e,67108864);t!==null&&Rd(t,e,67108864),_h(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=Fd();t=yt(t);var n=Ei(e,t);n!==null&&Rd(n,e,t),_h(e,t)}}var bh=!0;function xh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,Ch(e,t,n,r)}finally{P.p=a,N.T=i}}function Sh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,Ch(e,t,n,r)}finally{P.p=a,N.T=i}}function Ch(e,t,n,r){if(bh){var i=wh(r);if(i===null)Yf(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=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Af(a),!(W&6)&&(bd=He()+500,jf(0,!1))}}break;case 31:case 13:s=Ei(a,2),s!==null&&Rd(s,a,2),Ud(),_h(a,2)}if(a=wh(r),a===null&&Yf(e,t,r,Th,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Yf(e,t,r,null,n)}}function wh(e){return e=Sn(e),Eh(e)}var Th=null;function Eh(e){if(Th=null,e=Pt(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(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Oh=!1,kh=null,Ah=null,jh=null,Mh=new Map,Nh=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=Ft(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=Pt(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,St(e.priority,function(){yh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(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);xn=r,n.target.dispatchEvent(r),xn=null}else return t=Ft(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=Ft(n);a!==null&&(e.splice(t,3),t-=3,tc(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[Tt]||null;if(typeof a==`function`)o||Gh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||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,Fd(),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),Ud(),t[Et]=null}};function Yh(e){this._internalRoot=e}Yh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();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`));P.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:N,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{Ze=Qh.inject(Zh),Qe=Qh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ph(e,1,!1,null,null,n,r,null,o,s,c,qh),e[Et]=t.current,qf(e),new Jh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_();function b(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var x=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),S=o(((e,t)=>{t.exports=x()}))(),C=v.useInsertionEffect,w=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?v.useLayoutEffect:v.useEffect,T=C||w,E=e=>{let t=v.useRef([e,(...e)=>t[0](...e)]).current;return T(()=>{t[0]=e}),t[1]},D=[`popstate`,`pushState`,`replaceState`,`hashchange`],O=[],k=()=>O.forEach(e=>e()),A=e=>(O.push(e)===1&&D.forEach(e=>addEventListener(e,k)),()=>{O=O.filter(t=>t!==e),O.length||D.forEach(e=>removeEventListener(e,k))}),j=(e,t)=>(0,S.useSyncExternalStore)(A,e,t),ee=()=>location.search,te=({ssrSearch:e}={})=>j(ee,e==null?ee:()=>e),ne=()=>location.pathname,re=({ssrPath:e}={})=>j(ne,e==null?ne:()=>e),ie=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),ae=e=>[re(e),ie],M=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[M]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,M,{value:!0})}var oe=(e=``)=>e===`/`?``:e,se=(e,t)=>e[0]===`~`?e.slice(1):oe(t)+e,ce=(e,t)=>(e=le(oe(e)),t=le(t),!e||!t.toLowerCase().indexOf(e.toLowerCase())?t.slice(e.length)||`/`:`~`+t),le=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},ue={hook:ae,searchHook:te,parser:b,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},de=(0,v.createContext)(ue),fe=()=>(0,v.useContext)(de),pe={},me=(0,v.createContext)(pe),he=()=>(0,v.useContext)(me),ge=(e,t=e.base)=>ce(t,e.hook(e)[0]),_e=e=>{let[t,n]=e.hook(e);return[ce(e.base,t),E((t,r)=>e.aroundNav(n,se(t,e.base),r))]},N=()=>_e(fe()),P=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{pattern:t}:e(t||`*`,r),o=i.exec(n);if(!o)return[!1,null];let s={};for(let e=1;e<o.length;e++)s[e-1]=o[e];if(a)for(let e=0;e<a.length;e++)s[a[e]]=o[e+1];else Object.assign(s,o.groups);return r?[!0,s,o[0]]:[!0,s]},ve=({children:e,...t})=>{let n=fe(),r=t.hook?ue:n,i=r;if(t.ssrPath){let[e,n=t.ssrSearch??``]=t.ssrPath.split(`?`);e&&(t.ssrSearch=n,t.ssrPath=e)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let a=(0,v.useRef)(r),o=a.current,s=o;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];n!==s[e]&&(o===s&&(a.current=s={...s}),s[e]=n),(n!==r[e]||n!==i[e])&&(i=s)}return(0,v.createElement)(de.Provider,{value:i},e)},ye=({children:e,component:t},n)=>t?(0,v.createElement)(t,{params:n}):typeof e==`function`?e(n):e,be=e=>{let t=(0,v.useRef)(pe),n=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(n).length||r.some(t=>e[t]!==n[t])?e:n},F=({path:e,nest:t,match:n,...r})=>{let i=fe(),a=ge(i),[o,s,c]=n??P(i.parser,e,a,t),l=be({...he(),...s});if(!o)return null;let u=ye(r,l);return(0,v.createElement)(me.Provider,{value:l},c?(0,v.createElement)(ve,{base:c},u):u)},xe=(0,v.forwardRef)((e,t)=>{let n=fe(),[r,i]=_e(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=E(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,v.isValidElement)(l)?(0,v.cloneElement)(l,m):(0,v.createElement)(`a`,m,l)}),Se=(e,t=[])=>{if(Array.isArray(e))for(let n of e)Se(n&&n.type===v.Fragment?n.props.children:n,t);else t.push(e);return t},Ce=({children:e,location:t})=>{let n=fe(),r=ge(n);for(let i of Se(e)){let e=0;if((0,v.isValidElement)(i)&&(e=P(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,v.cloneElement)(i,{match:e})}return null},we=e=>{let{to:t,href:n=t}=e,r=fe(),[,i]=_e(r),a=E(()=>i(t||n,e)),{ssrContext:o}=r;return w(()=>{a()},[]),o&&(o.redirectTo=t),null},Te=[],Ee=()=>Te.forEach(e=>e()),De=e=>(Te.push(e)===1&&addEventListener(`hashchange`,Ee),()=>{Te=Te.filter(t=>t!==e),Te.length||removeEventListener(`hashchange`,Ee)}),Oe=/^#?\/?/,ke=()=>`/`+location.hash.replace(Oe,``),Ae=(e,{state:t=null,replace:n=!1}={})=>{let r=location.href,[i,a]=e.replace(Oe,``).split(`?`),o=new URL(r);o.hash=`/${i}`,a!==void 0&&(o.search=a);let s=o.href;history[n?`replaceState`:`pushState`](t,``,s);let c=typeof HashChangeEvent<`u`?new HashChangeEvent(`hashchange`,{oldURL:r,newURL:s}):new Event(`hashchange`,{detail:{oldURL:r,newURL:s}});dispatchEvent(c)},je=({ssrPath:e=`/`}={})=>[(0,S.useSyncExternalStore)(De,ke,()=>e),Ae];je.hrefs=e=>`#`+e;var Me=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})),I=o(((e,t)=>{t.exports=Me()}))(),Ne=v.createContext(void 0),Pe=e=>{let t=v.useContext(Ne);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Fe=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(Ne.Provider,{value:e,children:t})),Ie={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Le=new class{#e=Ie;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Re(e){setTimeout(e,0)}var ze=typeof window>`u`||`Deno`in globalThis;function Be(){}function Ve(e,t){return typeof e==`function`?e(t):e}function He(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ue(e,t){return Math.max(e+(t||0)-Date.now(),0)}function We(e,t){return typeof e==`function`?e(t):e}function Ge(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==qe(o,t.options))return!1}else if(!Ye(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ke(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Je(t.options.mutationKey)!==Je(a))return!1}else if(!Ye(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function qe(e,t){return(t?.queryKeyHashFn||Je)(e)}function Je(e){return JSON.stringify(e,(e,t)=>et(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ye(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Ye(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Ye(e[r],t[r]))return!1;return!0}return!1}var Xe=Object.prototype.hasOwnProperty;function Ze(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=$e(e)&&$e(t);if(!r&&!(et(e)&&et(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Xe.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Ze(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Qe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function $e(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function et(e){if(!tt(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!tt(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function tt(e){return Object.prototype.toString.call(e)===`[object Object]`}function nt(e){return new Promise(t=>{Le.setTimeout(t,e)})}function rt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ze(e,t)}function it(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function at(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ot=Symbol();function st(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ot?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ct(e,t){return typeof e==`function`?e(...t):!!e}function lt(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ut=()=>ze,dt=()=>ut(),ft=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pt=new class extends ft{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},mt=Re;function ht(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=mt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var gt=ht(),_t=new class extends ft{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function vt(e){return Math.min(1e3*2**e,3e4)}function yt(e){return(e??`online`)!==`online`||_t.isOnline()}var bt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xt(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Be);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new bt(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>pt.isFocused()&&(e.networkMode===`always`||_t.isOnline())&&e.canRun(),p=()=>yt(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(dt()?0:3),a=e.retryDelay??vt,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),nt(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var St=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),He(this.gcTime)&&(this.#e=Le.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dt()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Le.clearTimeout(this.#e),this.#e=void 0)}};function Ct(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{lt(e,()=>t.signal,()=>n=!0)},u=st(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?at:it;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Tt:wt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:wt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function wt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Tt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Et=class extends St{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=kt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=kt(this.options);e.data!==void 0&&(this.setState(Ot(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=rt(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Be).catch(Be):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>We(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ot||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>We(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ue(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=st(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ct(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=xt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof bt&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof bt){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Dt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ot(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),gt.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Dt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ot(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function kt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var At=class extends ft{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Mt(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof We(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Qe(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||We(this.options.enabled,this.#t)!==We(t.enabled,this.#t)||We(this.options.staleTime,this.#t)!==We(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||We(this.options.enabled,this.#t)!==We(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Qe(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Be)),t}#h(e){return!dt()&&We(this.options.enabled,this.#t)!==!1&&He(e)}#g(){this.#b();let e=We(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Ue(this.#r.dataUpdatedAt,e)+1;this.#u=Le.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return We(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Le.setInterval(()=>{(this.options.refetchIntervalInBackground||pt.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Le.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Le.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Mt(e,t),o=i&&Pt(e,n,t,r);(a||o)&&(l={...l,...Dt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=rt(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=rt(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ft(e,t),refetch:this.refetch,isEnabled:We(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Qe(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();gt.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function jt(e,t){return We(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||We(t.retryOnMount,e)!==!1)}function Mt(e,t){return jt(e,t)||e.state.data!==void 0&&Nt(e,t,t.refetchOnMount)}function Nt(e,t,n){if(We(t.enabled,e)!==!1&&We(t.staleTime,e)!==`static`){let r=We(n,e);return r===`always`||r!==!1&&Ft(e,t)}return!1}function Pt(e,t,n,r){return(e!==t||We(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ft(e,n)}function Ft(e,t){return We(t.enabled,e)!==!1&&e.isStaleByTime(We(t.staleTime,e))}var It=class extends St{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Lt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=xt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),gt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Lt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Rt=class extends ft{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new It({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=zt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=zt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=zt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=zt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){gt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ke(t,e))}findAll(e={}){return this.getAll().filter(t=>Ke(e,t))}notify(e){gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return gt.batch(()=>Promise.all(e.map(e=>e.continue().catch(Be))))}};function zt(e){return e.options.scope?.id}var Bt=class extends ft{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??qe(r,t),a=this.get(i);return a||(a=new Et({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){gt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ge(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ge(e,t)):t}notify(e){gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){gt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){gt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Bt,this.#t=e.mutationCache||new Rt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=pt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=_t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(We(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ve(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return gt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;gt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return gt.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=gt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Be).catch(Be)}invalidateQueries(e,t={}){return gt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=gt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Be)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Be)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(We(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(We(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Be).catch(Be)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Be).catch(Be)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return _t.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Je(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ye(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Je(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ye(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=qe(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ot&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ht=v.createContext(!1),Ut=()=>v.useContext(Ht);Ht.Provider;function Wt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Gt=v.createContext(Wt()),Kt=()=>v.useContext(Gt),qt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ct(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},L=e=>{v.useEffect(()=>{e.clearReset()},[e])},Jt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ct(n,[e.error,r])),Yt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Xt=(e,t)=>e?.suspense&&t.isPending,Zt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Qt(e,t,n){let r=Ut(),i=Kt(),a=Pe(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Yt(o),qt(o,i,s),L(i);let[l]=v.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=d?l.subscribe(gt.batchCalls(e)):Be;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),Xt(o,u))throw Zt(o,l,i);if(Jt({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function $t(e,t){return Qt(e,At,t)}var en=(0,v.createContext)({});function tn(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var nn=typeof window<`u`?v.useLayoutEffect:v.useEffect,rn=(0,v.createContext)(null);function an(e,t){e.indexOf(t)===-1&&e.push(t)}function on(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var sn=(e,t,n)=>n>t?t:n<e?e:n,cn={},ln=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),un=e=>typeof e==`object`&&!!e,dn=e=>/^0[^.\s]+$/u.test(e);function fn(e){let t;return()=>(t===void 0&&(t=e()),t)}var pn=e=>e,mn=(...e)=>e.reduce((e,t)=>n=>t(e(n))),hn=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},gn=class{constructor(){this.subscriptions=[]}add(e){return an(this.subscriptions,e),()=>this.remove(e)}remove(e){on(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},_n=e=>e*1e3,vn=e=>e/1e3,yn=(e,t)=>t?1e3/t*e:0,bn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,xn=1e-7,Sn=12;function Cn(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=bn(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>xn&&++s<Sn);return o}function wn(e,t,n,r){if(e===t&&n===r)return pn;let i=t=>Cn(t,0,1,e,n);return e=>e===0||e===1?e:bn(i(e),t,r)}var Tn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,En=e=>t=>1-e(1-t),Dn=wn(.33,1.53,.69,.99),On=En(Dn),kn=Tn(On),An=e=>e>=1?1:(e*=2)<1?.5*On(e):.5*(2-2**(-10*(e-1))),jn=e=>1-Math.sin(Math.acos(e)),Mn=En(jn),Nn=Tn(jn),Pn=wn(.42,0,1,1),Fn=wn(0,0,.58,1),In=wn(.42,0,.58,1),Ln=e=>Array.isArray(e)&&typeof e[0]!=`number`,Rn=e=>Array.isArray(e)&&typeof e[0]==`number`,zn={linear:pn,easeIn:Pn,easeInOut:In,easeOut:Fn,circIn:jn,circInOut:Nn,circOut:Mn,backIn:On,backInOut:kn,backOut:Dn,anticipate:An},Bn=e=>typeof e==`string`,Vn=e=>{if(Rn(e)){e.length;let[t,n,r,i]=e;return wn(t,n,r,i)}return Bn(e)?(zn[e],`${e}`,zn[e]):e},Hn=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Un(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Wn=40;function Gn(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Hn.reduce((e,t)=>(e[t]=Un(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=cn.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Wn),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Hn.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Hn.length;t++)o[Hn[t]].cancel(e)},state:i,steps:o}}var{schedule:R,cancel:Kn,state:qn,steps:Jn}=Gn(typeof requestAnimationFrame<`u`?requestAnimationFrame:pn,!0),Yn;function Xn(){Yn=void 0}var Zn={now:()=>(Yn===void 0&&Zn.set(qn.isProcessing||cn.useManualTiming?qn.timestamp:performance.now()),Yn),set:e=>{Yn=e,queueMicrotask(Xn)}},Qn=e=>Math.round(e*1e5)/1e5,$n=e=>t=>typeof t==`string`&&t.startsWith(e),er=$n(`--`),tr=$n(`var(--`),nr=e=>tr(e)?rr.test(e.split(`/*`)[0].trim()):!1,rr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ir(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var ar={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},or={...ar,transform:e=>sn(0,1,e)},sr={...ar,default:1},cr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lr(e){return e==null}var ur=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dr=(e,t)=>n=>!!(typeof n==`string`&&ur.test(n)&&n.startsWith(e)||t&&!lr(n)&&Object.prototype.hasOwnProperty.call(n,t)),fr=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(cr);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},pr=e=>sn(0,255,e),mr={...ar,transform:e=>Math.round(pr(e))},hr={test:dr(`rgb`,`red`),parse:fr(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+mr.transform(e)+`, `+mr.transform(t)+`, `+mr.transform(n)+`, `+Qn(or.transform(r))+`)`};function gr(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var _r={test:dr(`#`),parse:gr,transform:hr.transform},vr=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),yr=vr(`deg`),br=vr(`%`),z=vr(`px`),xr=vr(`vh`),Sr=vr(`vw`),Cr={...br,parse:e=>br.parse(e)/100,transform:e=>br.transform(e*100)},wr={test:dr(`hsl`,`hue`),parse:fr(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+br.transform(Qn(t))+`, `+br.transform(Qn(n))+`, `+Qn(or.transform(r))+`)`},Tr={test:e=>hr.test(e)||_r.test(e)||wr.test(e),parse:e=>hr.test(e)?hr.parse(e):wr.test(e)?wr.parse(e):_r.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?hr.transform(e):wr.transform(e),getAnimatableNone:e=>{let t=Tr.parse(e);return t.alpha=0,Tr.transform(t)}},Er=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Dr=new RegExp(cr.source),Or=new RegExp(Er.source,`i`);function kr(e){return isNaN(e)&&typeof e==`string`&&(Dr.test(e)||Or.test(e))}var Ar=`number`,jr=`color`,Mr=`var`,Nr=`var(`,Pr="${}",Fr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ir(e){let t=e.toString();return Dr.test(t)||Or.test(t)}function Lr(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Fr,e=>(Tr.test(e)?(r.color.push(a),i.push(jr),n.push(Tr.parse(e))):e.startsWith(Nr)?(r.var.push(a),i.push(Mr),n.push(e)):(r.number.push(a),i.push(Ar),n.push(parseFloat(e))),++a,Pr)).split(Pr),indexes:r,types:i}}function Rr(e){return Lr(e).values}function zr({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Ar?Qn(r[a]):e===jr?Tr.transform(r[a]):r[a]}return i}}function Br(e){return zr(Lr(e))}var Vr=e=>typeof e==`number`?0:Tr.test(e)?Tr.getAnimatableNone(e):e,Hr=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Vr(e);function Ur(e){let t=Lr(e);return zr(t)(t.values.map((e,n)=>Hr(e,t.split[n])))}var Wr={test:kr,parse:Rr,createTransformer:Br,getAnimatableNone:Ur};function Gr(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Kr({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Gr(s,r,e+1/3),a=Gr(s,r,e),o=Gr(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function qr(e,t){return n=>n>0?t:e}var B=(e,t,n)=>e+(t-e)*n,Jr=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Yr=[_r,hr,wr],Xr=e=>Yr.find(t=>t.test(e));function Zr(e){let t=Xr(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===wr&&(n=Kr(n)),n}var Qr=(e,t)=>{let n=Zr(e),r=Zr(t);if(!n||!r)return qr(e,t);let i={...n};return e=>(i.red=Jr(n.red,r.red,e),i.green=Jr(n.green,r.green,e),i.blue=Jr(n.blue,r.blue,e),i.alpha=B(n.alpha,r.alpha,e),hr.transform(i))},$r=new Set([`none`,`hidden`]);function ei(e,t){return $r.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ti(e,t){return n=>B(e,t,n)}function ni(e){return typeof e==`number`?ti:typeof e==`string`?nr(e)?qr:Tr.test(e)?Qr:oi:Array.isArray(e)?ri:typeof e==`object`?Tr.test(e)?Qr:ii:qr}function ri(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ni(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ii(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ni(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ai(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var oi=(e,t)=>{let n=Wr.createTransformer(t),r=Lr(e),i=Lr(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?$r.has(e)&&!i.values.length||$r.has(t)&&!r.values.length?ei(e,t):mn(ri(ai(r,i),i.values),n):(`${e}${t}`,qr(e,t))},si=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ci(e,t){let n=si.exec(e);if(!n)return;let r=si.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Qn(B(a,o,e))+i}function li(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return B(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=ci(e,t);if(n)return n}return ni(e)(e,t)}var ui=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>R.update(t,e),stop:()=>Kn(t),now:()=>qn.isProcessing?qn.timestamp:Zn.now()}},di=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},fi=2e4;function pi(e,t=50,n=fi,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function mi(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(pi(r),fi);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:vn(i)}}var hi={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function gi(e,t){return e*Math.sqrt(1-t*t)}var _i=12;function vi(e,t,n){let r=n;for(let n=1;n<_i;n++)r-=e(r)/t(r);return r}var yi=.001;function bi({duration:e=hi.duration,bounce:t=hi.bounce,velocity:n=hi.velocity,mass:r=hi.mass}){let i,a;hi.maxDuration;let o=1-t;o=sn(hi.minDamping,hi.maxDamping,o),e=sn(hi.minDuration,hi.maxDuration,vn(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=gi(t,o),c=Math.exp(-i);return yi-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=gi(t*t,o);return(-i(t)+yi>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=vi(i,a,s);if(e=_n(e),isNaN(c))return{stiffness:hi.stiffness,damping:hi.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var xi=[`duration`,`bounce`];function Si(e,t){return t.some(t=>e[t]!==void 0)}var Ci=(e,t)=>(t?e>=0:e>0)&&e<1/0;function wi(e,t){if(Ci(e,t))return e}function Ti(e){let t=wi(e.stiffness),n=wi(e.damping,!0),r=wi(e.mass),i={...e,stiffness:t??hi.stiffness,damping:n??hi.damping,mass:r??hi.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&Si(e,xi)};if(i.isTimeDefined){if(i.velocity=0,e.visualDuration){let t=e.visualDuration,n=2*Math.PI/(t*1.2),r=n*n,a=2*sn(.05,1,1-(e.bounce||0))*Math.sqrt(r);i={...i,mass:hi.mass,stiffness:r,damping:a}}else{let e=bi(i);i={...i,...e,mass:hi.mass},i.isResolvedFromDuration=!0}(!Ci(i.stiffness)||!Ci(i.damping,!0))&&(i.stiffness=hi.stiffness,i.damping=hi.damping)}return i}function Ei(e=hi.visualDuration,t=hi.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,velocity:u,isResolvedFromDuration:d,isTimeDefined:f}=Ti({...n,velocity:-vn(n.velocity||0)}),p=s/(2*Math.sqrt(o*c)),m=vn(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:u||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?hi.restSpeed.granular:hi.restSpeed.default),g.restDelta=n.restDelta||(e?hi.restDelta.granular:hi.restDelta.default)};_();let v,y,b;if(p<1){let e=gi(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1);v=t=>{let n=Math.exp(-h*t),r=Math.min(e*t,300);return g.target-n*((g.velocity+h*g.delta)*Math.sinh(r)+e*g.delta*Math.cosh(r))/e};let t={P:0,sinh:0,cosh:0};b=()=>{t.P=(g.velocity+h*g.delta)/e,t.sinh=h*t.P-g.delta*e,t.cosh=h*g.delta-t.P*e},y=n=>{let r=Math.exp(-h*n),i=Math.min(e*n,300);return r*(t.sinh*Math.sinh(i)+t.cosh*Math.cosh(i))}}b();let x=d&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f?0:-vn(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>_n(y(e)),next:e=>{let t=v(e);if(d)a.done=e>=l;else{let n=_n(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(pi(S),fi),t=di(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Ei.applyToOptions=e=>{let t=mi(e,100,Ei);return e.ease=t.ease,e.duration=_n(t.duration),e.type=`keyframes`,e};function Di({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Ei({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Oi(e,t,n){let r=[],i=n||cn.mix||li,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=mn(Array.isArray(t)?t[n]||pn:t,a)),r.push(a)}return r}function ki(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Oi(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=hn(e[r],e[r+1],n);return s[r](i)};return n?t=>l(sn(e[0],e[a-1],t)):l}function Ai(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=hn(0,t,r);e.push(B(n,1,i))}}function ji(e){let t=[0];return Ai(t,e.length-1),t}function Mi(e,t){return e.map(e=>e*t)}function Ni(e,t){return e.map(()=>t||In).splice(0,e.length-1)}function Pi({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ln(r)?r.map(Vn):Vn(r)||In,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(cn.mix||li)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?sn(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=ki(Mi(n&&n.length===t.length?n:ji(t),e),t,{ease:Array.isArray(i)?i:Ni(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Fi=5;function Ii(e,t,n){let r=Math.max(t-Fi,0);return yn(n-e(r),t-r)}function Li(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Ii(t=>e.next(t).value,t,e.next(t).value)}var Ri=e=>e!==null;function zi(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Ri),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Bi={decay:Di,inertia:Di,tween:Pi,keyframes:Pi,spring:Ei};function Vi(e){typeof e.type==`string`&&(e.type=Bi[e.type])}function Hi(e,t){return{kind:e,animation:t,timestamp:Zn.now(),frameTimestamp:qn.timestamp,frameIsProcessing:qn.isProcessing}}function Ui(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Hi(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Wi(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Hi(`layout-animation-start`,e),node:t})}catch{}}var Gi=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Ki=e=>e/100,qi=class extends Gi{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Zn.now()&&this.tick(Zn.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Ui(this,this.options)}initAnimation(){let{options:e}=this;Vi(e);let{type:t=Pi,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Pi;s!==Pi&&typeof o[0]!=`number`&&(this.mixKeyframes=mn(Ki,li(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=pi(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=sn(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Di&&(b.value=zi(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return vn(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+vn(e)}get time(){return vn(this.currentTime)}set time(e){e=_n(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Li(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Zn.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=vn(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=ui,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Zn.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Ji=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Yi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(cr)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Ji.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Xi=/\b([a-z-]*)\(.*?\)/gu,Zi={...Wr,getAnimatableNone:e=>{let t=e.match(Xi);return t?t.map(Yi).join(` `):e}},Qi={...Wr,getAnimatableNone:e=>{let t=Wr.parse(e);return Wr.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},$i={...ar,transform:Math.round},ea={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,inset:z,insetBlock:z,insetBlockStart:z,insetBlockEnd:z,insetInline:z,insetInlineStart:z,insetInlineEnd:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,paddingBlock:z,paddingBlockStart:z,paddingBlockEnd:z,paddingInline:z,paddingInlineStart:z,paddingInlineEnd:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,marginBlock:z,marginBlockStart:z,marginBlockEnd:z,marginInline:z,marginInlineStart:z,marginInlineEnd:z,fontSize:z,backgroundPositionX:z,backgroundPositionY:z,rotate:yr,pathRotation:yr,rotateX:yr,rotateY:yr,rotateZ:yr,scale:sr,scaleX:sr,scaleY:sr,scaleZ:sr,skew:yr,skewX:yr,skewY:yr,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:or,originX:Cr,originY:Cr,originZ:z,zIndex:$i,fillOpacity:or,strokeOpacity:or,numOctaves:$i},ta={...ea,color:Tr,backgroundColor:Tr,outlineColor:Tr,fill:Tr,stroke:Tr,borderColor:Tr,borderTopColor:Tr,borderRightColor:Tr,borderBottomColor:Tr,borderLeftColor:Tr,filter:Zi,WebkitFilter:Zi,mask:Qi,WebkitMask:Qi},na=e=>ta[e],ra=new Set([Zi,Qi]);function V(e,t){let n=na(e);return ra.has(n)||(n=Wr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function ia(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var aa=e=>e*180/Math.PI,oa=e=>ca(aa(Math.atan2(e[1],e[0]))),sa={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:oa,rotateZ:oa,skewX:e=>aa(Math.atan(e[1])),skewY:e=>aa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ca=e=>(e%=360,e<0&&(e+=360),e),la=oa,ua=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),da=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),fa={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ua,scaleY:da,scale:e=>(ua(e)+da(e))/2,rotateX:e=>ca(aa(Math.atan2(e[6],e[5]))),rotateY:e=>ca(aa(Math.atan2(-e[2],e[0]))),rotateZ:la,rotate:la,skewX:e=>aa(Math.atan(e[4])),skewY:e=>aa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function pa(e){return+!!e.includes(`scale`)}function ma(e,t){if(!e||e===`none`)return pa(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=fa,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sa,i=t}if(!i)return pa(t);let a=r[t],o=i[1].split(`,`).map(ga);return typeof a==`function`?a(o):o[a]}var ha=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return ma(n,t)};function ga(e){return parseFloat(e.trim())}var _a=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],va=new Set([..._a,`pathRotation`]),ya=e=>e===ar||e===z,ba=new Set([`x`,`y`,`z`]),xa=_a.filter(e=>!ba.has(e));function Sa(e){let t=[];return xa.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Ca=new Set([`bottom`,`right`]);function wa(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Ta={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>wa(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>wa(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>ma(e,`x`),y:({transform:e})=>ma(e,`y`)};Ta.translateX=Ta.x,Ta.translateY=Ta.y;var Ea=new Set,Da=!1,Oa=!1,ka=!1;function Aa(){if(Oa){let e=[],t=new Set,n=new Set;Ea.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Ca.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Sa(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Oa=!1,Da=!1,Ea.forEach(e=>e.complete(ka)),Ea.clear()}function ja(){Ea.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Oa=!0)})}function Ma(){ka=!0,ja(),Aa(),ka=!1}function Na(e,t,n){if(typeof e==`string`){if(ln(e)||dn(e))return parseFloat(e);if(!Wr.test(e)&&Wr.test(n))return V(t,n)}return e??void 0}var Pa=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Ea.add(this),Da||(Da=!0,R.read(ja),R.resolveKeyframes(Aa))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Na(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}ia(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ea.delete(this)}cancel(){this.state===`scheduled`&&(Ea.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Fa=e=>e.startsWith(`--`);function Ia(e,t,n){Fa(t)?e.style.setProperty(t,n):e.style[t]=n}var La={};function Ra(e,t){let n=fn(e);return()=>La[t]??n()}var za=Ra(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Ba=Ra(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Va=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ha={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Va([0,.65,.55,1]),circOut:Va([.55,0,1,.45]),backIn:Va([.31,.01,.66,-.59]),backOut:Va([.33,1.53,.69,.99])};function Ua(e,t){if(e)return typeof e==`function`?Ba()?di(e,t):`ease-out`:Rn(e)?Va(e):Array.isArray(e)?e.map(e=>Ua(e,t)||Ha.easeOut):Ha[e]}function Wa(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Ua(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Ga(e){return typeof e==`function`&&`applyToOptions`in e}function Ka({type:e,...t}){return Ga(e)&&Ba()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var qa=class extends Gi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Ka(e);this.animation=Wa(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=zi(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Ia(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Ui(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return vn(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+vn(e)}get time(){return vn(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_n(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&za()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),pn):r(this)}},Ja={anticipate:An,backInOut:kn,circInOut:Nn};function Ya(e){return e in Ja}function Xa(e){typeof e.ease==`string`&&Ya(e.ease)&&(e.ease=Ja[e.ease])}var Za=10,Qa=class extends qa{constructor(e){Xa(e),Vi(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new qi({...a,autoplay:!1}),s=Math.max(Za,Zn.now()-this.startTime),c=sn(0,Za,s-Za),l=o.sample(s).value,{name:u}=this.options;i&&u&&Ia(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},$a=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Wr.test(e)||e===`0`)&&!e.startsWith(`url(`));function eo(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function to(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=$a(i,t),s=$a(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):eo(e)||(n===`spring`||Ga(n))&&r}function no(e){e.duration=0,e.type=`keyframes`}var ro=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),io=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ao(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&io.test(e[t]))return!0;return!1}var oo=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),so=fn(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function co(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(ro.has(n)||oo.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return so()&&(ro.has(n)||oo.has(n)&&ao(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var lo=40,uo=class extends Gi{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Zn.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Pa;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Zn.now();let u=!0;to(e,i,a,o)||(u=!1,(cn.instantAnimations||!s)&&l?.(zi(e,n,t)),e[0]=e[e.length-1],no(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>lo?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&co(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new Qa(n)}catch{m=new qi(n)}}else m=new qi(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ma()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function fo(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var po=30,mo=e=>!isNaN(parseFloat(e)),ho={current:void 0},go=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Zn.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Zn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=mo(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new gn)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new gn,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){R.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ho.current&&ho.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Zn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>po)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,po);return yn(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function _o(e,t){return new go(e,t)}function vo(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function yo(e,t){let n=e?.[t]??e?.default??e;return n===e?n:vo(n,e)}var bo={type:`spring`,stiffness:500,damping:25,restSpeed:10},xo=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),So={type:`keyframes`,duration:.8},Co={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},wo=(e,{keyframes:t})=>t.length>2?So:va.has(e)?e.startsWith(`scale`)?xo(t[1]):bo:Co,To=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Eo(e){for(let t in e)if(!To.has(t))return!0;return!1}var Do=(e,t,n,r={},i,a)=>o=>{let s=yo(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=_n(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Eo(s)||Object.assign(u,wo(e,u)),u.duration&&=_n(u.duration),u.repeatDelay&&=_n(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(no(u),u.delay===0&&(d=!0)),(cn.instantAnimations||cn.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,no(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=zi(u.keyframes,s);if(e!==void 0){R.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new qi(u):new uo(u)},Oo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ko(e){let t=Oo.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ao(e,t,n=1){`${e}`;let[r,i]=ko(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ln(e)?parseFloat(e):e}return nr(i)?Ao(i,t,n+1):i}function jo(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Mo(e,t,n,r){if(typeof t==`function`){let[i,a]=jo(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=jo(r);t=t(n===void 0?e.custom:n,i,a)}return t}function No(e,t,n){let r=e.getProps();return Mo(r,t,n===void 0?r.custom:n,e)}var Po=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,..._a]),Fo=e=>Array.isArray(e);function Io(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_o(n))}function Lo(e){return Fo(e)?e[e.length-1]||0:e}function Ro(e,t){let{transitionEnd:n={},transition:r={},...i}=No(e,t)||{};i={...i,...n};for(let t in i)Io(e,t,Lo(i[t]))}var zo=e=>!!(e&&e.getVelocity);function Bo(e){return!!(zo(e)&&e.add)}function Vo(e,t){let n=e.getValue(`willChange`);if(Bo(n))return n.add(t);if(!n&&cn.WillChange){let n=new cn.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function H(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ho=`data-`+H(`framerAppearId`);function Uo(e){return e.props[Ho]}var Wo=typeof window<`u`;function Go({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ko(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?vo(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Go(f,t))continue;let o={delay:n,...yo(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){R.update(()=>r.set(i));continue}let p=!1;if(Wo&&window.MotionHandoffAnimation){let n=Uo(e);if(n){let e=window.MotionHandoffAnimation(n,t,R);e!==null&&(o.startTime=e,p=!0)}}Vo(e,t);let m=l??e.shouldReduceMotion;r.start(Do(t,r,i,m&&Po.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>R.update(()=>{o&&Ro(e,o)});d.length?Promise.all(d).then(t):t()}return d}function qo(e,t,n={}){let r=No(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Ko(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Jo(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Jo(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(qo(c,t,{...o,delay:n+(typeof r==`function`?0:r)+fo(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Yo(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>qo(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=qo(e,t,n);else{let i=typeof t==`function`?No(e,t,n.custom):t;r=Promise.all(Ko(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Xo={test:e=>e===`auto`,parse:e=>e},Zo=e=>t=>t.test(e),Qo=[ar,z,br,yr,Sr,xr,Xo],$o=e=>Qo.find(Zo(e));function es(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||dn(e)}var ts=new Set([`auto`,`none`,`0`]);function ns(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ts.has(t)&&Ir(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=V(n,i))}var rs=class extends Pa{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),nr(r))){let i=Ao(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Po.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=$o(r),o=$o(i);if(ir(r)!==ir(i)&&Ta[n]){this.needsMeasurement=!0;return}if(a!==o){if(ya(a)&&ya(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ta[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||es(e[t]))&&n.push(t);n.length&&ns(e,n,t)}measure(){let{element:e,name:t}=this;return Ta[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},is=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function as(e){return un(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function os(e){return un(e)&&`ownerSVGElement`in e}var ss=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function cs(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var ls={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},us=_a.length;function ds(e,t,n){let r=``,i=!0;for(let a=0;a<us;a++){let o=_a[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ss(s,ea[o]);if(!c){i=!1;let t=ls[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ss(a,ea.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function fs(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(va.has(e)){o=!0;continue}if(er(e)){i[e]=n;continue}{let t=ss(n,ea[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ds(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ps={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ms={offset:`strokeDashoffset`,array:`strokeDasharray`};function hs(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ps:ms;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var gs=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function _s(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(fs(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of gs)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&hs(d,i,a,o,!1)}function vs({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ys({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bs(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function xs(e){return e===void 0||e===1}function Ss({scale:e,scaleX:t,scaleY:n}){return!xs(e)||!xs(t)||!xs(n)}function Cs(e){return Ss(e)||ws(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ws(e){return Ts(e.x)||Ts(e.y)}function Ts(e){return e&&e!==`0%`}function Es(e,t,n){return n+t*(e-n)}function Ds(e,t,n,r,i){return i!==void 0&&(e=Es(e,i,r)),Es(e,n,r)+t}function Os(e,t=0,n=1,r,i){e.min=Ds(e.min,t,n,r,i),e.max=Ds(e.max,t,n,r,i)}function ks(e,{x:t,y:n}){Os(e.x,t.translate,t.scale,t.originPoint),Os(e.y,n.translate,n.scale,n.originPoint)}var As=.999999999999,js=1.0000000000001;function Ms(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Ns(e.x,-a.scroll.offset.x),Ns(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ks(e,o)),r&&Cs(a.latestValues)&&Is(e,a.latestValues,a.layout?.layoutBox))}t.x<js&&t.x>As&&(t.x=1),t.y<js&&t.y>As&&(t.y=1)}function Ns(e,t){e.min+=t,e.max+=t}function Ps(e,t,n,r,i=.5){Os(e,t,n,B(e.min,e.max,i),r)}function Fs(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Is(e,t,n){let r=n??e;Ps(e.x,Fs(t.x,r.x),t.scaleX,t.scale,t.originX),Ps(e.y,Fs(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ls(e,t){return vs(bs(e.getBoundingClientRect(),t))}function Rs(e,t,n){let r=Ls(e,n),{scroll:i}=t;return i&&(Ns(r.x,i.offset.x),Ns(r.y,i.offset.y)),r}var{schedule:zs,cancel:Bs}=Gn(queueMicrotask,!1),Vs={x:!1,y:!1};function Hs(){return Vs.x||Vs.y}function Us(e){return e===`x`||e===`y`?Vs[e]?null:(Vs[e]=!0,()=>{Vs[e]=!1}):Vs.x||Vs.y?null:(Vs.x=Vs.y=!0,()=>{Vs.x=Vs.y=!1})}function Ws(e,t){let n=cs(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Gs(e){return!(e.pointerType===`touch`||Hs())}function Ks(e,t,n={}){let[r,i,a]=Ws(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Gs(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var qs=(e,t)=>t?e===t||qs(e,t.parentElement):!1,Js=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ys=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Xs(e){return Ys.has(e.tagName)||e.isContentEditable===!0}var Zs=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Qs(e){return Zs.has(e.tagName)||e.isContentEditable===!0}var $s=new WeakSet;function ec(e){return t=>{t.key===`Enter`&&e(t)}}function tc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var nc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ec(()=>{if($s.has(n))return;tc(n,`down`);let e=ec(()=>{tc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>tc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function rc(e){return Js(e)&&!Hs()}var ic=new WeakSet;function ac(e,t,n={}){let[r,i,a]=Ws(e,n),o=e=>{let r=e.currentTarget;if(!rc(e)||ic.has(e))return;$s.add(r),n.stopPropagation&&ic.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),$s.has(r)&&$s.delete(r),rc(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||qs(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),as(e)&&(e.addEventListener(`focus`,e=>nc(e,i)),!Xs(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var oc=new WeakMap,sc,cc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:os(r)&&`getBBox`in r?r.getBBox()[t]:r[n],lc=cc(`inline`,`width`,`offsetWidth`),uc=cc(`block`,`height`,`offsetHeight`);function dc({target:e,borderBoxSize:t}){oc.get(e)?.forEach(n=>{n(e,{get width(){return lc(e,t)},get height(){return uc(e,t)}})})}function fc(e){e.forEach(dc)}function pc(){typeof ResizeObserver<`u`&&(sc=new ResizeObserver(fc))}function mc(e,t){sc||pc();let n=cs(e);return n.forEach(e=>{let n=oc.get(e);n||(n=new Set,oc.set(e,n)),n.add(t),sc?.observe(e)}),()=>{n.forEach(e=>{let n=oc.get(e);n?.delete(t),n?.size||sc?.unobserve(e)})}}var hc=new Set,gc;function _c(){gc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};hc.forEach(t=>t(e))},window.addEventListener(`resize`,gc)}function vc(e){return hc.add(e),gc||_c(),()=>{hc.delete(e),!hc.size&&typeof gc==`function`&&(window.removeEventListener(`resize`,gc),gc=void 0)}}function yc(e,t){return typeof e==`function`?vc(e):mc(e,t)}var bc={value:null,addProjectionMetrics:null};function xc(e){return os(e)&&e.tagName===`svg`}var Sc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cc=()=>({x:Sc(),y:Sc()}),wc=()=>({min:0,max:0}),Tc=()=>({x:wc(),y:wc()}),Ec=new WeakMap;function Dc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Oc(e){return typeof e==`string`||Array.isArray(e)}var kc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ac=[`initial`,...kc];function jc(e){if(Dc(e.animate))return!0;for(let t=0;t<Ac.length;t++)if(Oc(e[Ac[t]]))return!0;return!1}function Mc(e){return!!(jc(e)||e.variants)}function Nc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(zo(i))e.addValue(r,i);else if(zo(a))e.addValue(r,_o(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,_o(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Pc={current:null},Fc={current:!1},Ic=typeof window<`u`;function Lc(){if(Fc.current=!0,Ic){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Pc.current=e.matches;e.addEventListener(`change`,t),t()}else Pc.current=!1}}var Rc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],zc={};function Bc(e){zc=e}function Vc(){return zc}var Hc=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Pa,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Zn.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,R.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=jc(t),this.isVariantNode=Mc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&zo(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Ec.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Fc.current||Lc(),this.shouldReduceMotion=Pc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Kn(this.notifyUpdate),Kn(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ro.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new qa({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:_n(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=va.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&R.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in zc){let t=zc[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Tc()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Rc.length;t++){let n=Rc[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Nc(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=_o(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ln(n)||dn(n))?n=parseFloat(n):typeof n!=`number`&&!Wr.test(n)&&Wr.test(t)&&(n=V(e,t)),this.setBaseTarget(e,zo(n)?n.get():n)),zo(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Mo(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!zo(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new gn),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){zs.render(this.render)}},Uc=class extends Hc{constructor(){super(...arguments),this.KeyframeResolver=rs}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;zo(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Wc=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Gc(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Kc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var qc={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(z.test(e))e=parseFloat(e);else return e}return`${Kc(e,t.target.x)}% ${Kc(e,t.target.y)}%`}},Jc={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Wr.parse(e);if(i.length>5)return r;let a=Wr.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=B(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Yc={borderRadius:{...qc,applyTo:[...is]},borderTopLeftRadius:qc,borderTopRightRadius:qc,borderBottomLeftRadius:qc,borderBottomRightRadius:qc,boxShadow:Jc};function Xc(e,{layout:t,layoutId:n}){return va.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Yc[e]||e===`opacity`)}function Zc(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(zo(r[t])||i&&zo(i[t])||Xc(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Qc(e){return window.getComputedStyle(e)}var $c=class extends Uc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Gc}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(va.has(t))return this.projection?.isProjecting?pa(t):ha(e,t);{let n=Qc(e),r=(er(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ls(e,t)}build(e,t,n){fs(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Zc(e,t,n)}},el=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),tl=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function nl(e,t,n,r){Gc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(el.has(n)?n:H(n),t.attrs[n])}function rl(e,t,n){let r=Zc(e,t,n);for(let n in e)if(zo(e[n])||zo(t[n])){let t=_a.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var il=class extends Uc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Tc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(va.has(t)){let e=na(t);return e&&e.default||0}if(gs.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=el.has(t)?t:H(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return rl(e,t,n)}build(e,t,n){_s(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){nl(e,t,n,r)}mount(e){this.isSVGTag=tl(e.tagName),super.mount(e)}},al=Ac.length;function ol(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ol(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<al;n++){let r=Ac[n],i=e.props[r];(Oc(i)||i===!1)&&(t[r]=i)}return t}function sl(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var cl=[...kc].reverse(),ll=kc.length;function ul(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Yo(e,t,n)))}function dl(e){let t=ul(e),n=ml(),r=!0,i=!1,a=t=>(n,r)=>{let i=No(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=ol(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<ll;t++){let p=cl[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Oc(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Dc(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=fl(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Fo(t)&&Fo(n)?!sl(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=No(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=fo(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=No(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ml(),i=!0}}}function fl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!sl(t,e):!1}function pl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ml(){return{animate:pl(!0),whileInView:pl(),whileHover:pl(),whileTap:pl(),whileDrag:pl(),whileFocus:pl(),exit:pl()}}function hl(e,t){e.min=t.min,e.max=t.max}function gl(e,t){hl(e.x,t.x),hl(e.y,t.y)}function _l(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var vl=.9999,yl=1.0001,bl=-.01,xl=.01;function Sl(e){return e.max-e.min}function Cl(e,t,n){return Math.abs(e-t)<=n}function wl(e,t,n,r=.5){e.origin=r,e.originPoint=B(t.min,t.max,e.origin),e.scale=Sl(n)/Sl(t),e.translate=B(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vl&&e.scale<=yl||isNaN(e.scale))&&(e.scale=1),(e.translate>=bl&&e.translate<=xl||isNaN(e.translate))&&(e.translate=0)}function Tl(e,t,n,r){wl(e.x,t.x,n.x,r?r.originX:void 0),wl(e.y,t.y,n.y,r?r.originY:void 0)}function El(e,t,n,r=0){e.min=(r?B(n.min,n.max,r):n.min)+t.min,e.max=e.min+Sl(t)}function Dl(e,t,n,r){El(e.x,t.x,n.x,r?.x),El(e.y,t.y,n.y,r?.y)}function Ol(e,t,n,r=0){let i=r?B(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Sl(t)}function kl(e,t,n,r){Ol(e.x,t.x,n.x,r?.x),Ol(e.y,t.y,n.y,r?.y)}function Al(e,t,n,r,i){return e-=t,e=Es(e,1/n,r),i!==void 0&&(e=Es(e,1/i,r)),e}function jl(e,t=0,n=1,r=.5,i,a=e,o=e){if(br.test(t)&&(t=parseFloat(t),t=B(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=B(a.min,a.max,r);e===a&&(s-=t),e.min=Al(e.min,t,n,s,i),e.max=Al(e.max,t,n,s,i)}function Ml(e,t,[n,r,i],a,o){jl(e,t[n],t[r],t[i],t.scale,a,o)}var Nl=[`x`,`scaleX`,`originX`],Pl=[`y`,`scaleY`,`originY`];function Fl(e,t,n,r){Ml(e.x,t,Nl,n?n.x:void 0,r?r.x:void 0),Ml(e.y,t,Pl,n?n.y:void 0,r?r.y:void 0)}function Il(e){return e.translate===0&&e.scale===1}function Ll(e){return Il(e.x)&&Il(e.y)}function Rl(e,t){return e.min===t.min&&e.max===t.max}function zl(e,t){return Rl(e.x,t.x)&&Rl(e.y,t.y)}function Bl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Vl(e,t){return Bl(e.x,t.x)&&Bl(e.y,t.y)}function Hl(e){return Sl(e.x)/Sl(e.y)}function Ul(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Wl(e){return[e(`x`),e(`y`)]}function Gl(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Kl=is.length,ql=e=>typeof e==`string`?parseFloat(e):e,Jl=e=>typeof e==`number`||z.test(e);function Yl(e,t,n,r,i,a){i?(e.opacity=B(0,n.opacity??1,Zl(r)),e.opacityExit=B(t.opacity??1,0,Ql(r))):a&&(e.opacity=B(t.opacity??1,n.opacity??1,r));for(let i=0;i<Kl;i++){let a=is[i],o=Xl(t,a),s=Xl(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Jl(o)===Jl(s)?(e[a]=Math.max(B(ql(o),ql(s),r),0),(br.test(s)||br.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=B(t.rotate||0,n.rotate||0,r))}function Xl(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Zl=$l(0,.5,Mn),Ql=$l(.5,.95,pn);function $l(e,t,n){return r=>r<e?0:r>t?1:n(hn(e,t,r))}function eu(e,t,n){let r=zo(e)?e:_o(e);return r.start(Do(``,r,t,n)),r.animation}function tu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var nu=(e,t)=>e.depth-t.depth,ru=class{constructor(){this.children=[],this.isDirty=!1}add(e){an(this.children,e),this.isDirty=!0}remove(e){on(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nu),this.isDirty=!1,this.children.forEach(e)}};function iu(e,t){let n=Zn.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Kn(r),e(a-t))};return R.setup(r,!0),()=>Kn(r)}function au(e){return zo(e)?e.get():e}var ou=class{constructor(){this.members=[]}add(e){an(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(on(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(on(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},U={hasAnimatedSinceResize:!0,hasEverUpdated:!1},su={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cu=[``,`X`,`Y`,`Z`],lu=1e3,uu=0;function du(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function fu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Uo(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,R,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&fu(r)}function pu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=uu++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,bc.value&&(su.nodes=su.calculatedTargetDeltas=su.calculatedProjections=0),this.nodes.forEach(gu),this.nodes.forEach(Tu),this.nodes.forEach(Eu),this.nodes.forEach(_u),bc.addProjectionMetrics&&bc.addProjectionMetrics(su)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new ru)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new gn),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=os(t)&&!xc(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;R.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=iu(i,250),U.hasAnimatedSinceResize&&(U.hasAnimatedSinceResize=!1,this.nodes.forEach(wu)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Nu,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Vl(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...yo(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||wu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Kn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Du),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(bu),this.nodes.forEach(yu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Su),this.nodes.forEach(Cu),this.nodes.forEach(mu),this.nodes.forEach(hu)):this.nodes.forEach(xu),this.clearAllSnapshots();let e=Zn.now();qn.delta=sn(0,1e3/60,e-qn.timestamp),qn.timestamp=e,qn.isProcessing=!0,Jn.update.process(qn),Jn.preRender.process(qn),Jn.render.process(qn),qn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vu),this.sharedNodes.forEach(Ou)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,R.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){R.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Sl(this.snapshot.measuredBox.x)&&!Sl(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Tc(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ll(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Cs(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Lu(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Tc();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zu))){let{scroll:e}=this.root;e&&(Ns(t.x,e.offset.x),Ns(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Tc();if(gl(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&gl(t,e),Ns(t.x,i.offset.x),Ns(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Tc();gl(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Ns(r.x,-n.scroll.offset.x),Ns(r.y,-n.scroll.offset.y)),Cs(n.latestValues)&&Is(r,n.latestValues,n.layout?.layoutBox)}return Cs(this.latestValues)&&Is(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Tc();gl(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Cs(n.latestValues))continue;let r;n.instance&&(Ss(n.latestValues)&&n.updateSnapshot(),r=Tc(),gl(r,n.measurePageBox())),Fl(t,n.latestValues,n.snapshot?.layoutBox,r)}return Cs(this.latestValues)&&Fl(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=qn.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Tc(),this.targetWithTransforms=Tc()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Dl(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gl(this.target,this.layout.layoutBox),ks(this.target,this.targetDelta)):gl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),bc.value&&su.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Ss(this.parent.latestValues)||ws(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tc(),this.relativeTargetOrigin=Tc(),kl(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),gl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===qn.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;gl(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ms(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Tc());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_l(this.prevProjectionDelta.x,this.projectionDelta.x),_l(this.prevProjectionDelta.y,this.projectionDelta.y)),Tl(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Ul(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ul(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),bc.value&&su.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cc(),this.projectionDelta=Cc(),this.projectionDeltaWithTransform=Cc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Cc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Tc(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Mu));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=B(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=B(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ku(o.x,e.x,n),ku(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kl(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ju(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&zl(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Tc(),gl(f,this.relativeTarget)),c&&(this.animationValues=a,Yl(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Kn(this.pendingAnimation),void 0),this.pendingAnimation=R.update(()=>{U.hasAnimatedSinceResize=!0,this.motionValue||=_o(0),this.motionValue.jump(0,!1),this.currentAnimation=eu(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Wi(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Ru(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Tc();let t=Sl(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Sl(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}gl(t,i),Is(t,r),Tl(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ou),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&du(`z`,e,r,this.animationValues);for(let t=0;t<cu.length;t++)du(`rotate${cu[t]}`,e,r,this.animationValues),du(`skew${cu[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=au(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=au(t?.pointerEvents)||``),this.hasProjected&&!Cs(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Gl(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Yc){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Yc[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?au(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(yu),this.root.sharedNodes.clear()}}}function mu(e){e.updateLayout()}function hu(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Wl(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Sl(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;hl(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Ru(i,t.layoutBox,n)&&Wl(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Sl(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Cc();Tl(o,n,t.layoutBox);let s=Cc();a?Tl(s,e.applyTransform(r,!0),t.measuredBox):Tl(s,n,t.layoutBox);let c=!Ll(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Tc();kl(s,t.layoutBox,i.layoutBox,o);let c=Tc();kl(c,n,a.layoutBox,o),Vl(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function gu(e){bc.value&&su.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function _u(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vu(e){e.clearSnapshot()}function yu(e){e.clearMeasurements()}function bu(e){e.isLayoutDirty=!0,e.updateLayout()}function xu(e){e.isLayoutDirty=!1}function Su(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Cu(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function wu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Tu(e){e.resolveTargetDelta()}function Eu(e){e.calcProjection()}function Du(e){e.resetSkewAndRotation()}function Ou(e){e.removeLeadSnapshot()}function ku(e,t,n){e.translate=B(t.translate,0,n),e.scale=B(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Au(e,t,n,r){e.min=B(t.min,n.min,r),e.max=B(t.max,n.max,r)}function ju(e,t,n,r){Au(e.x,t.x,n.x,r),Au(e.y,t.y,n.y,r)}function Mu(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Nu={duration:.45,ease:[.4,0,.1,1]},Pu=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Fu=Pu(`applewebkit/`)&&!Pu(`chrome/`)?Math.round:pn;function Iu(e){e.min=Fu(e.min),e.max=Fu(e.max)}function Lu(e){Iu(e.x),Iu(e.y)}function Ru(e,t,n){return e===`position`||e===`preserve-aspect`&&!Cl(Hl(t),Hl(n),.2)}function zu(e){return e!==e.root&&e.scroll?.wasRoot}var Bu=pu({attachResizeListener:(e,t)=>tu(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Vu={current:void 0},Hu=pu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Vu.current){let e=new Bu({});e.mount(window),e.setOptions({layoutScroll:!0}),Vu.current=e}return Vu.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Uu=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Wu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Gu(...e){return t=>{let n=!1,r=e.map(e=>{let r=Wu(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Wu(e[t],null)}}}}function Ku(...e){return v.useCallback(Gu(...e),e)}var qu=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(as(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=as(e)&&e.offsetWidth||0,r=as(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function Ju({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,v.useId)(),s=(0,v.useRef)(null),c=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,v.useContext)(Uu),u=Ku(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,v.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
10
- [data-motion-pop-id="${o}"] {
11
- position: absolute !important;
12
- width: ${e}px !important;
13
- height: ${u}px !important;
14
- ${_}px !important;
15
- ${v}px !important;
16
- }
17
- `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,I.jsx)(qu,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:v.cloneElement(e,{ref:u})})}var Yu=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=tn(Xu),d=(0,v.useId)(),f=(0,v.useRef)(n),p=(0,v.useRef)(r);nn(()=>{f.current=n,p.current=r});let m=!0,h=(0,v.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,I.jsx)(Ju,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,I.jsx)(rn.Provider,{value:h,children:e})};function Xu(){return new Map}function Zu(e=!0){let t=(0,v.useContext)(rn);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Qu=e=>e.key||``;function $u(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var ed=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Zu(o),f=(0,v.useMemo)(()=>$u(e),[e]),p=o&&!u?[]:f.map(Qu),m=(0,v.useRef)(!0),h=(0,v.useRef)(f),g=tn(()=>new Map),_=(0,v.useRef)(new Set),[y,b]=(0,v.useState)(f),[x,S]=(0,v.useState)(f);nn(()=>{o&&!u&&!x.length&&d?.()},[u,o,x.length,d]),nn(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=Qu(x[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[x,p.length,p.join(`-`)]);let C=[];if(f!==y){let e=[...f],t=0;for(let n of x){let r=p.indexOf(Qu(n));r===-1?(e.splice(t++,0,n),C.push(n)):t=r+C.length+1}return a===`wait`&&C.length&&(e=C),S($u(e)),b(f),null}let{forceRender:w}=(0,v.useContext)(en);return(0,I.jsx)(I.Fragment,{children:x.map(e=>{let v=Qu(e),y=o&&!u?!1:f===x||p.includes(v);return(0,I.jsx)(Yu,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(w?.(),S(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},td=(0,v.createContext)({strict:!1}),W={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},nd=!1;function G(){if(nd)return;let e={};for(let t in W)e[t]={isEnabled:e=>W[t].some(t=>!!e[t])};Bc(e),nd=!0}function K(){return G(),Vc()}function rd(e){let t=K();for(let n in e)t[n]={...t[n],...e[n]};Bc(t)}function id({children:e,...t}){let n=(0,v.useContext)(Uu);t={...n,...t},t.transition=vo(t.transition,n.transition),t.isStatic=tn(()=>t.isStatic);let r=(0,v.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,I.jsx)(Uu.Provider,{value:r,children:e})}var ad=(0,v.createContext)({});function od(e,t){if(jc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Oc(t)?t:void 0,animate:Oc(n)?n:void 0}}return e.inherit===!1?{}:t}function sd(e){let{initial:t,animate:n}=od(e,(0,v.useContext)(ad));return(0,v.useMemo)(()=>({initial:t,animate:n}),[cd(t),cd(n)])}function cd(e){return Array.isArray(e)?e.join(` `):e}var ld=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ud(e,t,n){for(let r in t)!zo(t[r])&&!Xc(r,n)&&(e[r]=t[r])}function dd({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=ld();return fs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function fd(e,t){let n=e.style||{},r={};return ud(r,n,e),Object.assign(r,dd(e,t)),r}function pd(e,t){let n={},r=fd(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var md=()=>({...ld(),attrs:{}});function hd(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=md();return _s(n,t,tl(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};ud(t,e.style,e),i.style={...t,...i.style}}return i}var gd=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function _d(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||gd.has(e)}function vd(e,t){return e.startsWith(`on`)?!_d(e):t?.(e)??!_d(e)}function yd(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(zo(e[a])||(vd(a,r)||n===!0&&_d(a)||!t&&!_d(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var bd=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function xd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(bd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sd(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??xd(e)?hd:pd)(t,r,i,e),l=yd(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>zo(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function Cd({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:wd(n,r,i,e),renderState:t()}}function wd(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=au(a[e]);let{initial:o,animate:s}=e,c=jc(e),l=Mc(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Dc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Mo(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Td=e=>(t,n)=>{let r=(0,v.useContext)(ad),i=(0,v.useContext)(rn),a=()=>Cd(e,t,r,i);return n?a():tn(a)},Ed=Td({scrapeMotionValuesFromProps:Zc,createRenderState:ld}),Dd=Td({scrapeMotionValuesFromProps:rl,createRenderState:md}),Od=Symbol.for(`motionComponentSymbol`);function kd(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Ad=(0,v.createContext)({});function jd(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Md(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(ad),s=(0,v.useContext)(td),c=(0,v.useContext)(rn),l=(0,v.useContext)(Uu),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,v.useContext)(Ad);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Nd(f.current,n,i,h);let g=(0,v.useRef)(!1);(0,v.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Ho],y=(0,v.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return nn(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),nn(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Nd(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Pd(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&jd(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Pd(e){if(e)return e.options.allowProjection===!1?Pd(e.parent):e.projection}function Fd(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&rd(r);let a=n?n===`svg`:xd(e),o=a?Dd:Ed;function s(n,s){let c,l={...(0,v.useContext)(Uu),...n,layoutId:Id(n)},{isStatic:u,isValidProp:d}=l,f=sd(n),p=o(n,u);if(!u&&typeof window<`u`){Ld(l,r);let t=Rd(l);c=t.MeasureLayout,f.visualElement=Md(e,p,l,i,t.ProjectionNode,a)}return(0,I.jsxs)(ad.Provider,{value:f,children:[c&&f.visualElement?(0,I.jsx)(c,{visualElement:f.visualElement,...l}):null,Sd(e,n,kd(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[Od]=e,c}function Id({layoutId:e}){let t=(0,v.useContext)(en).id;return t&&e!==void 0?t+`-`+e:e}function Ld(e,t){(0,v.useContext)(td).strict}function Rd(e){let{drag:t,layout:n}=K();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function zd(e,t){if(typeof Proxy>`u`)return Fd;let n=new Map,r=(n,r)=>Fd(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Fd(a,void 0,e,t)),n.get(a))})}var Bd=(e,t)=>t.isSVG??xd(e)?new il(t):new $c(t,{allowProjection:e!==v.Fragment}),Vd=class extends Wc{constructor(e){super(e),e.animationState||=dl(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Dc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Hd=0,Ud={animation:{Feature:Vd},exit:{Feature:class extends Wc{constructor(){super(...arguments),this.id=Hd++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=No(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}let r=this.exitAnimation=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.exitAnimation===r&&(this.isExitComplete=!0,t(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Wd(e){return{point:{x:e.pageX,y:e.pageY}}}var Gd=e=>t=>Js(t)&&e(t,Wd(t));function Kd(e,t,n,r){return tu(e,t,Gd(n),r)}var qd=({current:e})=>e?e.ownerDocument.defaultView:null,Jd=(e,t)=>Math.abs(e-t);function Yd(e,t){let n=Jd(e.x,t.x),r=Jd(e.y,t.y);return Math.sqrt(n**2+r**2)}var Xd=new Set([`auto`,`scroll`]),Zd=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Qd(this.lastRawMoveEventInfo,this.transformPagePoint));let e=ef(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Yd(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Zn.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Qd(t,this.transformPagePoint),this.hasPendingMove=!0,R.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=ef(e.type===`pointercancel`?this.lastMoveEventInfo:Qd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Js(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Qd(Wd(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=qn;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,ef(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=mn(Kd(this.contextWindow,`pointermove`,this.handlePointerMove,d),Kd(this.contextWindow,`pointerup`,this.handlePointerUp,d),Kd(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Xd.has(e.overflowX)||Xd.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),R.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Kn(this.updatePoint)}};function Qd(e,t){return t?{point:t(e.point)}:e}function $d(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ef({point:e},t){return{point:e,delta:$d(e,nf(t)),offset:$d(e,tf(t)),velocity:rf(t,.1)}}function tf(e){return e[0]}function nf(e){return e[e.length-1]}function rf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=nf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>_n(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>_n(t)*2&&(r=e[1]);let a=vn(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function af(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?B(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?B(n,e,r.max):Math.min(e,n)),e}function of(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function sf(e,{top:t,left:n,bottom:r,right:i}){return{x:of(e.x,n,i),y:of(e.y,t,r)}}function cf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function lf(e,t){return{x:cf(e.x,t.x),y:cf(e.y,t.y)}}function uf(e,t){let n=.5,r=Sl(e),i=Sl(t);return i>r?n=hn(t.min,t.max-r,e.min):r>i&&(n=hn(e.min,e.max-i,t.min)),sn(0,1,n)}function df(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var ff=.35;function pf(e=ff){return e===!1?e=0:e===!0&&(e=ff),{x:mf(e,`left`,`right`),y:mf(e,`top`,`bottom`)}}function mf(e,t,n){return{min:hf(e,t),max:hf(e,n)}}function hf(e,t){return typeof e==`number`?e:e[t]||0}var gf=new WeakMap,_f=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tc(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Us(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Wl(e=>{let t=this.getAxisMotionValue(e).get()||0;if(br.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Sl(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&R.update(()=>i(e,t),!1,!0),Vo(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=bf(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&R.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Zd(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:qd(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&R.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!yf(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=af(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&jd(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?sf(n.layoutBox,e):!1,this.elastic=pf(t),r!==this.constraints&&!jd(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Wl(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=df(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!jd(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Rs(n,r.root,this.visualElement.getTransformPagePoint()),a=lf(r.layout.layoutBox,i);if(t){let e=t(ys(a));this.hasMutatedConstraints=!!e,e&&(a=vs(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Wl(o=>{if(!yf(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Vo(this.visualElement,e),n.start(Do(e,n,0,t,this.visualElement,!1))}stopAnimation(){Wl(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Wl(e=>{if(!yf(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-B(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!jd(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Wl(e=>{let t=this.getAxisMotionValue(e).get();i[e]=uf({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Wl(t=>{let n=this.getAxisMotionValue(t);if(!yf(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(B(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gf.set(this.visualElement,this);let e=this.visualElement.current,t=Kd(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Qs(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();jd(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=vf(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),R.read(r);let o=tu(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Wl(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=ff,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function q(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function vf(e,t,n){let r=yc(e,q(n)),i=yc(t,q(n));return()=>{r(),i()}}function yf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bf(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var xf=class extends Wc{constructor(e){super(e),this.removeGroupControls=pn,this.removeListeners=pn,this.controls=new _f(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pn}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Sf=e=>(t,n)=>{e&&R.update(()=>e(t,n),!1,!0)},Cf=class extends Wc{constructor(){super(...arguments),this.removePointerDownListener=pn}onPointerDown(e){this.session=new Zd(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qd(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Sf(e),onStart:Sf(t),onMove:Sf(n),onEnd:(e,t)=>{delete this.session,r&&R.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Kd(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},wf=!1,Tf=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),wf&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),U.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),wf=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||R.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),zs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;wf=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ef(e){let[t,n]=Zu(),r=(0,v.useContext)(en);return(0,I.jsx)(Tf,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(Ad),isPresent:t,safeToRemove:n})}var Df={pan:{Feature:Cf},drag:{Feature:xf,ProjectionNode:Hu,MeasureLayout:Ef}};function Of(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&R.postRender(()=>i(t,Wd(t)))}var kf=class extends Wc{mount(){let{current:e}=this.node;e&&(this.unmount=Ks(e,(e,t)=>(Of(this.node,t,`Start`),e=>Of(this.node,e,`End`))))}unmount(){}},Af=class extends Wc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=mn(tu(this.node.current,`focus`,()=>this.onFocus()),tu(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function jf(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&R.postRender(()=>i(t,Wd(t)))}var Mf=class extends Wc{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=ac(e,(e,t)=>(jf(this.node,t,`Start`),(e,{success:t})=>jf(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Nf=new WeakMap,Pf=new WeakMap,Ff=e=>{let t=Nf.get(e.target);t&&t(e)},If=e=>{e.forEach(Ff)};function Lf({root:e,...t}){let n=e||document;Pf.has(n)||Pf.set(n,{});let r=Pf.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(If,{root:e,...t})),r[i]}function Rf(e,t,n){let r=Lf(t);return Nf.set(e,n),r.observe(e),()=>{Nf.delete(e),r.unobserve(e)}}var zf={some:0,all:1},Bf=class extends Wc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:zf[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Rf(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Vf(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Vf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Hf={inView:{Feature:Bf},tap:{Feature:Mf},focus:{Feature:Af},hover:{Feature:kf}},Uf={layout:{ProjectionNode:Hu,MeasureLayout:Ef}},Wf=zd({...Ud,...Hf,...Df,...Uf},Bd),Gf=Object.defineProperty,J=(e,t)=>Gf(e,`name`,{value:t,configurable:!0}),Kf=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return J(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}J(Y,`composeEventHandlers`);function qf(e){if(!Kf)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}J(qf,`getOwnerWindow`);function Jf(e){if(!Kf)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}J(Jf,`getOwnerDocument`);function Yf(e,t=!1){let{activeElement:n}=Jf(e);if(!n?.nodeName)return null;if(Xf(n)&&n.contentDocument)return Yf(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Jf(n).getElementById(e);if(t)return t}}return n}J(Yf,`getActiveElement`);function Xf(e){return e.tagName===`IFRAME`}J(Xf,`isFrame`);var Zf=Object.defineProperty,Qf=(e,t)=>Zf(e,`name`,{value:t,configurable:!0});function $f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qf($f,`setRef`);function ep(...e){return t=>{let n=!1,r=e.map(e=>{let r=$f(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():$f(e[t],null)}}}}Qf(ep,`composeRefs`);function tp(...e){return v.useCallback(ep(...e),e)}Qf(tp,`useComposedRefs`);var np=Object.defineProperty,rp=(e,t)=>np(e,`name`,{value:t,configurable:!0});function ip(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=rp(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,I.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return rp(i,`useContext`),[r,i]}rp(ip,`createContext`);function ap(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=rp(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return rp(s,`useContext`),[o,s]}rp(r,`createContext`);let i=rp(()=>{let t=n.map(e=>v.createContext(e));return rp(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,op(i,...t)]}rp(ap,`createContextScope`);function op(...e){let t=e[0];if(e.length===1)return t;let n=rp(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return rp(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}rp(op,`composeContextScopes`);var sp=globalThis?.document?v.useLayoutEffect:()=>{},cp=Object.defineProperty,lp=(e,t)=>cp(e,`name`,{value:t,configurable:!0}),up=v.useId||(()=>void 0),dp=0;function fp(e){let[t,n]=v.useState(up());return sp(()=>{e||n(e=>e??String(dp++))},[e]),e||(t?`radix-${t}`:``)}lp(fp,`useId`);var pp=Object.defineProperty,mp=(e,t)=>pp(e,`name`,{value:t,configurable:!0}),hp=v.useEffectEvent,gp=v.useInsertionEffect;function _p(e){if(typeof hp==`function`)return hp(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof gp==`function`?gp(()=>{t.current=e}):sp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}mp(_p,`useEffectEvent`);var vp=Object.defineProperty,yp=(e,t)=>vp(e,`name`,{value:t,configurable:!0}),bp=v.useInsertionEffect||sp;function xp({prop:e,defaultProp:t,onChange:n=yp(()=>{},`onChange`),caller:r}){let[i,a,o]=Sp({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Cp(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}yp(xp,`useControllableState`);function Sp({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return bp(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}yp(Sp,`useUncontrolledState`);function Cp(e){return typeof e==`function`}yp(Cp,`isFunction`);var wp=Symbol(`RADIX:SYNC_STATE`);function Tp(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=_p(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===wp)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:wp,state:i})},[i,d.state,c]),[h,f]}yp(Tp,`useControllableStateReducer`);var Ep=l(h(),1),Dp=Object.defineProperty,Op=(e,t)=>Dp(e,`name`,{value:t,configurable:!0});function kp(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Lp(r)&&typeof Vp==`function`&&(r=Vp(r._payload)),v.Children.forEach(r,e=>{if(Fp(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Lp(n)&&typeof Vp==`function`&&(n=Vp(n._payload)),a=Mp(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?Pp(a):void 0,l=tp(n,c);if(!a){if(r||r===0)throw Error(o?Bp(e):zp(e));return r}let u=Np(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Op(kp,`createSlot`);var Ap=Symbol.for(`radix.slottable`);function jp(e){let t=Op(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ap,t}Op(jp,`createSlottable`);var Mp=Op((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Np(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Op(Np,`mergeProps`);function Pp(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Op(Pp,`getElementRef`);function Fp(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ap}Op(Fp,`isSlottable`);var Ip=Symbol.for(`react.lazy`);function Lp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ip&&`_payload`in e&&Rp(e._payload)}Op(Lp,`isLazyComponent`);function Rp(e){return typeof e==`object`&&!!e&&`then`in e}Op(Rp,`isPromiseLike`);var zp=Op(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Bp=Op(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Vp=v.use,Hp=Object.defineProperty,Up=(e,t)=>Hp(e,`name`,{value:t,configurable:!0}),Wp=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=kp(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gp(e,t){e&&Ep.flushSync(()=>e.dispatchEvent(t))}Up(Gp,`dispatchDiscreteCustomEvent`);var Kp=Object.defineProperty,qp=(e,t)=>Kp(e,`name`,{value:t,configurable:!0});function Jp(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}qp(Jp,`useCallbackRef`);var Yp=Object.defineProperty,Xp=(e,t)=>Yp(e,`name`,{value:t,configurable:!0}),Zp=`dismissableLayer.update`,Qp=`dismissableLayer.pointerDownOutside`,$p=`dismissableLayer.focusOutside`,em,tm=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nm=v.forwardRef(Xp(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(tm),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=tp(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=am(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=om(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Jp(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(em=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),sm(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=em))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),sm())},[d,u]),v.useEffect(()=>{let e=Xp(()=>m({}),`handleUpdate`);return document.addEventListener(Zp,e),()=>document.removeEventListener(Zp,e)},[]),(0,I.jsx)(Wp.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function rm(){let e=v.useContext(tm),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Xp(rm,`useDismissableLayerSurface`);var im=Xp(()=>!0,`IS_TRUE`);function am(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=im}=t,s=Jp(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Xp(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Xp(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Xp(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Xp(p,`handleInteractionBubble`);let m=Xp(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||cm(Qp,s,p,{discrete:!0})};if(Xp(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Xp(()=>c.current=!0,`onPointerDownCapture`)}}Xp(am,`usePointerDownOutside`);function om(e,t=globalThis?.document){let n=Jp(e),r=v.useRef(!1);return v.useEffect(()=>{let e=Xp(e=>{e.target&&!r.current&&cm($p,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Xp(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Xp(()=>r.current=!1,`onBlurCapture`)}}Xp(om,`useFocusOutside`);function sm(){let e=new CustomEvent(Zp);document.dispatchEvent(e)}Xp(sm,`dispatchUpdate`);function cm(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Gp(i,a):i.dispatchEvent(a)}Xp(cm,`handleAndDispatchCustomEvent`);var lm=Object.defineProperty,um=(e,t)=>lm(e,`name`,{value:t,configurable:!0}),dm=`focusScope.autoFocusOnMount`,fm=`focusScope.autoFocusOnUnmount`,pm={bubbles:!1,cancelable:!0},mm=v.forwardRef(um(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=Jp(i),u=Jp(a),d=v.useRef(null),f=tp(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xm(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xm(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xm(s)};um(e,`handleFocusIn`),um(t,`handleFocusOut`),um(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){Sm.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dm,pm);s.addEventListener(dm,l),s.dispatchEvent(t),t.defaultPrevented||(hm(Tm(_m(s)),{select:!0}),document.activeElement===e&&xm(s))}return()=>{s.removeEventListener(dm,l),setTimeout(()=>{let t=new CustomEvent(fm,pm);s.addEventListener(fm,u),s.dispatchEvent(t),t.defaultPrevented||xm(e??document.body,{select:!0}),s.removeEventListener(fm,u),Sm.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=gm(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xm(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xm(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(Wp.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function hm(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xm(r,{select:t}),document.activeElement!==n)return}um(hm,`focusFirst`);function gm(e){let t=_m(e);return[vm(t,e),vm(t.reverse(),e)]}um(gm,`getTabbableEdges`);function _m(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:um(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}um(_m,`getTabbableCandidates`);function vm(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ym(r,{upTo:t})))return r}um(vm,`findVisible`);function ym(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}um(ym,`isHidden`);function bm(e){return e instanceof HTMLInputElement&&`select`in e}um(bm,`isSelectableInput`);function xm(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bm(e)&&t&&e.select()}}um(xm,`focus`);var Sm=Cm();function Cm(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wm(e,t),e.unshift(t)},remove(t){e=wm(e,t),e[0]?.resume()}}}um(Cm,`createFocusScopesStack`);function wm(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}um(wm,`arrayRemove`);function Tm(e){return e.filter(e=>e.tagName!==`A`)}um(Tm,`removeLinks`);var Em=Object.defineProperty,Dm=v.forwardRef(((e,t)=>Em(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);sp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ep.createPortal((0,I.jsx)(Wp.div,{...r,ref:t}),o):null},`Portal`)),Om=Object.defineProperty,km=(e,t)=>Om(e,`name`,{value:t,configurable:!0});function Am(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}km(Am,`useStateMachine`);var jm=km(e=>{let{present:t,children:n}=e,r=Mm(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=Pm(r.ref,Im(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function Mm(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=Am(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??Fm(r.current),o.current=void 0):a.current=`none`},[s]),sp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Fm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),sp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=km(a=>{let o=Fm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=km(e=>{e.target===t&&(a.current=Fm(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Fm(t)}else r.current=null;n(e)},[])}}km(Mm,`usePresence`);function Nm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}km(Nm,`setRef`);function Pm(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Nm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Nm(n[e],null)}}},[])}km(Pm,`useStableComposedRefs`);function Fm(e){return e?.animationName||`none`}km(Fm,`getAnimationName`);function Im(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}km(Im,`getElementRef`);var Lm=Object.defineProperty,Rm=(e,t)=>Lm(e,`name`,{value:t,configurable:!0}),zm=0,Bm=null;function Vm(e){return Hm(),e.children}Rm(Vm,`FocusGuards`);function Hm(){v.useEffect(()=>{Bm||={start:Um(),end:Um()};let{start:e,end:t}=Bm;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),zm++,()=>{zm===1&&(Bm?.start.remove(),Bm?.end.remove(),Bm=null),zm=Math.max(0,zm-1)}},[])}Rm(Hm,`useFocusGuards`);function Um(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Rm(Um,`createFocusGuard`);var Wm=function(){return Wm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wm.apply(this,arguments)};function Gm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Km(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var qm=`right-scroll-bar-position`,Jm=`width-before-scroll-bar`,Ym=`with-scroll-bars-hidden`,Xm=`--removed-body-scroll-bar-size`;function Zm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Qm(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var $m=typeof window<`u`?v.useLayoutEffect:v.useEffect,eh=new WeakMap;function th(e,t){var n=Qm(t||null,function(t){return e.forEach(function(e){return Zm(e,t)})});return $m(function(){var t=eh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Zm(e,null)}),i.forEach(function(e){r.has(e)||Zm(e,a)})}eh.set(n,e)},[e]),n}function nh(e){return e}function rh(e,t){t===void 0&&(t=nh);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ih(e){e===void 0&&(e={});var t=rh(null);return t.options=Wm({async:!0,ssr:!1},e),t}var ah=function(e){var t=e.sideCar,n=Gm(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,Wm({},n))};ah.isSideCarExport=!0;function oh(e,t){return e.useMedium(t),ah}var sh=ih(),ch=function(){},lh=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ch,onWheelCapture:ch,onTouchMoveCapture:ch}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=Gm(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=th([n,t]),w=Wm(Wm({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:sh,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Wm(Wm({},w),{ref:C})):v.createElement(y,Wm({},w,{className:c,ref:C}),s))});lh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lh.classNames={fullWidth:Jm,zeroRight:qm};var uh=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function dh(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=uh();return t&&e.setAttribute(`nonce`,t),e}function fh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ph(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var mh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dh())&&(fh(t,n),ph(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hh=function(){var e=mh();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gh=function(){var e=hh();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},_h={left:0,top:0,right:0,gap:0},vh=function(e){return parseInt(e||``,10)||0},yh=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[vh(n),vh(r),vh(i)]},bh=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return _h;var t=yh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xh=gh(),Sh=`data-scroll-locked`,Ch=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
18
- .${Ym} {
19
- overflow: hidden ${r};
20
- padding-right: ${s}px ${r};
21
- }
22
- body[${Sh}] {
23
- overflow: hidden ${r};
24
- overscroll-behavior: contain;
25
- ${[t&&`position: relative ${r};`,n===`margin`&&`
26
- padding-left: ${i}px;
27
- padding-top: ${a}px;
28
- padding-right: ${o}px;
29
- margin-left:0;
30
- margin-top:0;
31
- margin-right: ${s}px ${r};
32
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
33
- }
34
-
35
- .${qm} {
36
- right: ${s}px ${r};
37
- }
38
-
39
- .${Jm} {
40
- margin-right: ${s}px ${r};
41
- }
42
-
43
- .${qm} .${qm} {
44
- right: 0 ${r};
45
- }
46
-
47
- .${Jm} .${Jm} {
48
- margin-right: 0 ${r};
49
- }
50
-
51
- body[${Sh}] {
52
- ${Xm}: ${s}px;
53
- }
54
- `},wh=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Th=function(){v.useEffect(function(){return document.body.setAttribute(Sh,(wh()+1).toString()),function(){var e=wh()-1;e<=0?document.body.removeAttribute(Sh):document.body.setAttribute(Sh,e.toString())}},[])},Eh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Th();var a=v.useMemo(function(){return bh(i)},[i]);return v.createElement(xh,{styles:Ch(a,!t,i,n?``:`!important`)})},Dh=!1;if(typeof window<`u`)try{var Oh=Object.defineProperty({},"passive",{get:function(){return Dh=!0,!0}});window.addEventListener(`test`,Oh,Oh),window.removeEventListener(`test`,Oh,Oh)}catch{Dh=!1}var kh=Dh?{passive:!1}:!1,Ah=function(e){return e.tagName===`TEXTAREA`},jh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ah(e)&&n[t]===`visible`)},Mh=function(e){return jh(e,`overflowY`)},Nh=function(e){return jh(e,`overflowX`)},Ph=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Lh(e,r)){var i=Rh(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fh=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ih=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Lh=function(e,t){return e===`v`?Mh(t):Nh(t)},Rh=function(e,t){return e===`v`?Fh(t):Ih(t)},zh=function(e,t){return e===`h`&&t===`rtl`?-1:1},Bh=function(e,t,n,r,i){var a=zh(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Rh(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Lh(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Vh=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hh=function(e){return[e.deltaX,e.deltaY]},Uh=function(e){return e&&`current`in e?e.current:e},Wh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gh=function(e){return`
55
- .block-interactivity-${e} {pointer-events: none;}
56
- .allow-interactivity-${e} {pointer-events: all;}
57
- `},Kh=0,qh=[];function Jh(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Kh++)[0],a=v.useState(gh)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Km([e.lockRef.current],(e.shards||[]).map(Uh),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Vh(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ph(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ph(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Bh(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(qh.length&&qh[qh.length-1]===a){var r=`deltaY`in n?Hh(n):Vh(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Wh(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Uh).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Yh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Vh(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Hh(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Vh(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return qh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,kh),document.addEventListener(`touchmove`,c,kh),document.addEventListener(`touchstart`,u,kh),function(){qh=qh.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,kh),document.removeEventListener(`touchmove`,c,kh),document.removeEventListener(`touchstart`,u,kh)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:Gh(i)}):null,p?v.createElement(Eh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Xh=oh(sh,Jh),Zh=v.forwardRef(function(e,t){return v.createElement(lh,Wm({},e,{ref:t,sideCar:Xh}))});Zh.classNames=lh.classNames;var Qh=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},$h=new WeakMap,eg=new WeakMap,tg={},ng=0,rg=function(e){return e&&(e.host||rg(e.parentNode))},ig=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=rg(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ag=function(e,t,n,r){var i=ig(t,Array.isArray(e)?e:[e]);tg[n]||(tg[n]=new WeakMap);var a=tg[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=($h.get(e)||0)+1,l=(a.get(e)||0)+1;$h.set(e,c),a.set(e,l),o.push(e),c===1&&i&&eg.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ng++,function(){o.forEach(function(e){var t=$h.get(e)-1,i=a.get(e)-1;$h.set(e,t),a.set(e,i),t||(eg.has(e)||e.removeAttribute(r),eg.delete(e)),i||e.removeAttribute(n)}),ng--,ng||($h=new WeakMap,$h=new WeakMap,eg=new WeakMap,tg={})}},og=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Qh(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ag(r,i,n,`aria-hidden`)):function(){return null}},sg=Object.defineProperty,cg=(e,t)=>sg(e,`name`,{value:t,configurable:!0}),lg=`Dialog`,[ug,dg]=ap(lg),[fg,pg]=ug(lg),mg=cg(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=xp({prop:r,defaultProp:i??!1,onChange:a,caller:lg}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,I.jsx)(fg,{scope:t,triggerRef:s,contentRef:c,contentId:fp(),titleId:fp(),descriptionId:fp(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),hg=`DialogPortal`,[gg,_g]=ug(hg,{forceMount:void 0}),vg=cg(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=pg(hg,t);return(0,I.jsx)(gg,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,I.jsx)(jm,{present:n||a.open,children:(0,I.jsx)(Dm,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),yg=`DialogOverlay`,bg=v.forwardRef(cg(function(e,t){let n=_g(yg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pg(yg,e.__scopeDialog);return a.modal?(0,I.jsx)(jm,{present:r||a.open,children:(0,I.jsx)(Sg,{...i,ref:t})}):null},`DialogOverlay`)),xg=kp(`DialogOverlay.RemoveScroll`),Sg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(yg,n),a=tp(t,rm());return(0,I.jsx)(Zh,{as:xg,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(Wp.div,{"data-state":Ag(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Cg=`DialogContent`,wg=v.forwardRef(cg(function(e,t){let n=_g(Cg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pg(Cg,e.__scopeDialog);return(0,I.jsx)(jm,{present:r||a.open,children:a.modal?(0,I.jsx)(Tg,{...i,ref:t}):(0,I.jsx)(Eg,{...i,ref:t})})},`DialogContent`)),Tg=v.forwardRef(cg(function(e,t){let n=pg(Cg,e.__scopeDialog),r=v.useRef(null),i=tp(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,I.jsx)(Dg,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Eg=v.forwardRef(cg(function(e,t){let n=pg(Cg,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,I.jsx)(Dg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Dg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=pg(Cg,n);return Hm(),(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(mm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(nm,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ag(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Og=`DialogTitle`,kg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(Og,n),{setTitleCount:a}=i;return sp(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,I.jsx)(Wp.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`));function Ag(e){return e?`open`:`closed`}cg(Ag,`getState`);var jg=window.__DESIGN_STATIC__===!0,Mg=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function Ng(e,t){let n=await fetch(e,{cache:t});if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();t.error&&(e=t.error)}catch{}throw new Mg(n.status,e)}return await n.json()}async function Pg(e){try{return await e}catch(e){if(e instanceof Mg&&e.status===404)return null;throw e}}var Fg=``;function Ig(e){return Fg!==e.version&&(Fg=e.version,console.info(`foss-design ${e.version}${jg?` (static build)`:``}`)),e}var Lg={live:!0,project:()=>Ng(`/api/project`,`no-store`).then(Ig),canvas:async e=>({doc:await Ng(`/api/canvas/${encodeURIComponent(e)}`,`no-store`),base:``}),system:async()=>{let e=await Pg(Ng(`/api/system`,`no-store`));return e?{doc:e,base:``}:null},async source(e){let t=await fetch(`/api/source?path=${encodeURIComponent(e)}`,{cache:`no-store`});if(!t.ok)throw new Mg(t.status,`Could not read ${e}`);return t.text()}},Rg=null,zg={live:!1,project:()=>Ng(`api/project.json`,`default`).then(Ig),canvas:async e=>({doc:await Ng(`api/canvas/${encodeURIComponent(e)}.json`,`default`),base:``}),system:async()=>{let e=await Pg(Ng(`api/system.json`,`default`));return e?{doc:e,base:``}:null},async source(e){Rg??=Ng(`api/sources.json`,`default`).catch(()=>({}));let t=(await Rg)[e];if(t===void 0)throw new Mg(404,`${e} is not in this build`);return t}};function Bg(e,t){if(!t)return e;try{let n=new URL(t.endsWith(`/`)?t:`${t}/`,document.baseURI);return new URL(e,n).href}catch{return e}}function Vg(e,t){if(!t)return e;let n=e=>Bg(e,t);return{...e,pages:e.pages.map(e=>({...e,sections:e.sections.map(e=>({...e,items:e.items.map(e=>{if(e.kind===`screen`){let t=e=>e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t&&n(t)])):void 0;return{...e,url:n(e.url),snapshots:t(e.snapshots),thumbs:t(e.thumbs)}}return e.kind===`image`?{...e,url:n(e.url)}:e})}))}))}}function Hg(e,t){if(!t)return e;let n=e=>Bg(e,t);return{...e,components:e.components.map(e=>({...e,url:n(e.url)})),assets:e.assets.map(e=>({...e,url:n(e.url)})),typographyUrl:e.typographyUrl&&n(e.typographyUrl)}}function Ug(e){return{all:[`design`,e],project:[`design`,e,`project`],canvas:t=>[`design`,e,`canvas`,t],system:[`design`,e,`system`],sources:[`design`,e,`source`],source:(t,n)=>[`design`,e,`source`,t,n]}}var Wg=new WeakMap,Gg=0;function Kg(e){let t=Wg.get(e);return t||(Gg+=1,t=String(Gg),Wg.set(e,t)),t}var qg=(0,v.createContext)(null);function Jg(){let e=(0,v.useContext)(qg);if(!e)throw Error(`foss-design: this component renders inside <DesignViewer>`);return e}function Yg(e,t){if(e===t)return!0;try{return decodeURIComponent(e)===t}catch{return!1}}function Xg(e){return new Vt({defaultOptions:{queries:{staleTime:e?0:1/0,retry:1,refetchOnWindowFocus:!1}}})}function Zg(){let{source:e,keys:t,scope:n}=Jg();return $t({queryKey:t.project,queryFn:()=>e.project(),enabled:!n})}function Qg(e,t=!0){let{source:n,keys:r}=Jg();return $t({queryKey:r.canvas(e),queryFn:async()=>{let{doc:t,base:r}=await n.canvas(e);return Vg(t,r)},placeholderData:e=>e,enabled:t})}function $g(e=!0){let{source:t,keys:n}=Jg();return $t({queryKey:n.system,queryFn:async()=>{let e=await t.system();return e?Hg(e.doc,e.base):null},enabled:e})}function e_(e,t=`system`){let{source:n,keys:r}=Jg();return $t({queryKey:r.source(t,e??``),queryFn:()=>n.source(e,t),enabled:!!e})}function t_(e,t){let n=null,r=!1;return n=new EventSource(`/api/events`),n.onopen=()=>{r&&(r=!1,e.invalidateQueries({queryKey:t.all}))},n.onerror=()=>{r=!0},n.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}if(r.type===`project`)e.invalidateQueries({queryKey:t.project});else if(r.type===`system`)e.invalidateQueries({queryKey:t.system}),e.invalidateQueries({queryKey:t.sources});else if(r.type===`canvas`||r.type===`snapshot`){let n=r.type===`canvas`?r.id:r.canvas;e.invalidateQueries({queryKey:t.canvas(n)}),r.type===`snapshot`&&e.invalidateQueries({queryKey:t.project})}},()=>n?.close()}function X(...e){return e.filter(Boolean).join(` `)}var n_=null;function r_(e,t){n_={canvas:e,item:t},window.dispatchEvent(new CustomEvent(`design:focus`,{detail:n_}))}function i_(e){if(!n_||n_.canvas!==e)return null;let t=n_.item;return n_=null,t}var a_=class{value;listeners=new Set;constructor(e){this.value=e}get=()=>this.value;set=e=>{let t=typeof e==`function`?e(this.value):e;if(!Object.is(t,this.value)){this.value=t;for(let e of this.listeners)e()}};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})};function o_(e,t=e=>e){return(0,v.useSyncExternalStore)(e.subscribe,()=>t(e.get()),()=>t(e.get()))}var s_=`foss-design.theme`;function c_(){try{let e=localStorage.getItem(s_);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}var l_=new a_(c_()),u_=window.matchMedia(`(prefers-color-scheme: dark)`);function d_(e){return e===`system`?u_.matches?`dark`:`light`:e}function f_(){document.documentElement.dataset.theme=d_(l_.get())}u_.addEventListener(`change`,f_),l_.subscribe(f_),f_();function p_(e){try{localStorage.setItem(s_,e)}catch{}l_.set(e)}function m_(){return o_(l_)}function h_(){let e=o_(l_),t=(0,v.useSyncExternalStore)(e=>(u_.addEventListener(`change`,e),()=>u_.removeEventListener(`change`,e)),()=>u_.matches);return e===`system`?t?`dark`:`light`:e}var g_={plus:`<path d="M5 12h14"/><path d="M12 5v14"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,"chevron-down":`<path d="m6 9 6 6 6-6"/>`,"chevron-up":`<path d="m18 15-6-6-6 6"/>`,"chevron-right":`<path d="m9 18 6-6-6-6"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,chevrons:`<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>`,copy:`<rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`,search:`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>`,bell:`<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>`,refresh:`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`,"up-right":`<path d="M7 7h10v10"/><path d="M7 17 17 7"/>`,"down-left":`<path d="M17 7 7 17"/><path d="M17 17H7V7"/>`,external:`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,"user-plus":`<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M19 8v6"/><path d="M22 11h-6"/>`,user:`<circle cx="12" cy="8" r="5"/><path d="M20 21a8 8 0 0 0-16 0"/>`,trash:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`,more:`<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>`,alert:`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`,upload:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m17 8-5-5-5 5"/><path d="M12 3v12"/>`,download:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/><path d="M12 15V3"/>`,shield:`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/>`,logout:`<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><path d="m16 17 5-5-5-5"/><path d="M21 12H9"/>`,loader:`<path d="M21 12a9 9 0 1 1-6.219-8.56"/>`,"circle-check":`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`,"circle-dashed":`<circle cx="12" cy="12" r="9" stroke-dasharray="3 3"/>`,clock:`<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>`,mail:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>`,send:`<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>`,chat:`<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>`,wallet:`<path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"/><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"/>`,"file-code":`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m10 13-2 2 2 2"/><path d="m14 17 2-2-2-2"/>`,ban:`<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>`,code:`<path d="m16 18 6-6-6-6"/><path d="m8 6-6 6 6 6"/>`,"chevron-left":`<path d="m15 18-6-6 6-6"/>`,bluetooth:`<path d="m7 7 10 10-5 5V2l5 5L7 17"/>`,face:`<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>`,eye:`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>`,clipboard:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>`,grip:`<circle cx="9" cy="5" r="1"/><circle cx="9" cy="12" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="19" r="1"/>`,list:`<path d="M3 12h.01"/><path d="M3 18h.01"/><path d="M3 6h.01"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M8 6h13"/>`,lock:`<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`,hw:`<rect width="20" height="10" x="2" y="7" rx="2"/><path d="M15 7v10"/><circle cx="8" cy="12" r="1.5"/>`,link:`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`,signal:`<path d="M2 20h.01"/><path d="M7 20v-4"/><path d="M12 20v-8"/><path d="M17 20V8"/>`,grid:`<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>`,coins:`<circle cx="8" cy="8" r="6"/><path d="M18.09 10.37A6 6 0 1 1 10.34 18"/><path d="M7 6h1v4"/><path d="m16.71 13.88.7.71-2.82 2.82"/>`,arrows:`<path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/>`,key:`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>`,blocks:`<rect width="7" height="7" x="14" y="3" rx="1"/><path d="M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3"/>`,settings:`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,qr:`<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>`,edit:`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/>`,star:`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>`,home:`<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>`,moon:`<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>`,sun:`<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>`,languages:`<path d="m5 8 6 6"/><path d="m4 14 6-6 2-3"/><path d="M2 5h12"/><path d="M7 2h1"/><path d="m22 22-5-10-5 10"/><path d="M14 18h6"/>`,"arrow-left":`<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>`,play:`<polygon points="6 3 20 12 6 21 6 3"/>`,"zoom-in":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M11 8v6"/><path d="M8 11h6"/>`,"zoom-out":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M8 11h6"/>`,fit:`<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>`,"panel-left":`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>`,layers:`<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>`,file:`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/>`,palette:`<circle cx="13.5" cy="6.5" r="1"/><circle cx="17.5" cy="10.5" r="1"/><circle cx="8.5" cy="7.5" r="1"/><circle cx="6.5" cy="12.5" r="1"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.65-.75 1.65-1.69 0-.44-.18-.84-.44-1.13-.29-.29-.44-.65-.44-1.13a1.64 1.64 0 0 1 1.67-1.67h2c3.05 0 5.55-2.5 5.55-5.55C21.96 6.01 17.46 2 12 2z"/>`,type:`<path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/>`,shape:`<path d="M5 3a2 2 0 0 0-2 2"/><path d="M19 3a2 2 0 0 1 2 2"/><path d="M21 19a2 2 0 0 1-2 2"/><path d="M5 21a2 2 0 0 1-2-2"/><path d="M9 3h1"/><path d="M9 21h1"/><path d="M14 3h1"/><path d="M14 21h1"/><path d="M3 9v1"/><path d="M21 9v1"/><path d="M3 14v1"/><path d="M21 14v1"/>`,motion:`<path d="M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 6c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>`,book:`<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>`,image:`<rect width="18" height="18" x="3" y="3" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.09-3.09a2 2 0 0 0-2.82 0L6 21"/>`,monitor:`<rect width="20" height="14" x="2" y="3" rx="2"/><path d="M8 21h8"/><path d="M12 17v4"/>`,smartphone:`<rect width="14" height="20" x="5" y="2" rx="2"/><path d="M12 18h.01"/>`,tablet:`<rect width="16" height="20" x="4" y="2" rx="2"/><path d="M12 18h.01"/>`,note:`<path d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z"/><path d="M15 3v4a2 2 0 0 0 2 2h4"/>`,globe:`<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>`,pointer:`<path d="M4.04 4.69a.5.5 0 0 1 .65-.65l16 6.5a.5.5 0 0 1-.06.95l-6.12 1.58a2 2 0 0 0-1.44 1.44l-1.58 6.12a.5.5 0 0 1-.95.06z"/>`,component:`<path d="M5.5 8.5 9 12l-3.5 3.5L2 12l3.5-3.5Z"/><path d="m12 2 3.5 3.5L12 9 8.5 5.5 12 2Z"/><path d="M18.5 8.5 22 12l-3.5 3.5L15 12l3.5-3.5Z"/><path d="m12 15 3.5 3.5L12 22l-3.5-3.5L12 15Z"/>`,keyboard:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="M6 8h.01"/><path d="M10 8h.01"/><path d="M14 8h.01"/><path d="M18 8h.01"/><path d="M8 12h.01"/><path d="M12 12h.01"/><path d="M16 12h.01"/><path d="M7 16h10"/>`,folder:`<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>`,canvas:`<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>`};function Z({name:e,size:t=16,strokeWidth:n=1.75,className:r}){return(0,I.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`shrink-0 ${e===`loader`?`animate-spin`:``} ${r??``}`,dangerouslySetInnerHTML:{__html:g_[e]}})}function Q({children:e,size:t=12.5,className:n,title:r,wrap:i}){return(0,I.jsx)(`span`,{title:r,className:X(i?`break-all`:`whitespace-nowrap`,`font-mono`,n),style:{fontSize:t},children:e})}function __({children:e}){return(0,I.jsx)(`kbd`,{className:`rounded-[4px] border border-rule bg-surface px-[5px] py-px font-mono text-[11px] text-ink2`,children:e})}function v_({top:e,bottom:t,weight:n=500}){return(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-px`,children:[(0,I.jsx)(`span`,{className:`truncate leading-[1.35]`,style:{fontWeight:n},children:e}),t?(0,I.jsx)(`span`,{className:`flex min-w-0 items-center gap-2.5 overflow-hidden whitespace-nowrap text-[12.5px] leading-[1.35] text-muted`,children:t}):null]})}var y_={canvas:`This canvas`,canvases:`Canvases`,system:`Design system`,actions:`Actions`};function b_(e){let t=/^\/c\/([^/]+)/.exec(e);return t?decodeURIComponent(t[1]):null}function x_({onClose:e}){let[t,n]=N(),r=Jg().scope,i=Zg().data,a=r?.canvas??b_(t),o=Qg(a??``,!!a).data,s=$g(!!i?.system).data,[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(0),f=t=>()=>{e(),t()},p=[];if(o)for(let e of o.pages){p.push({id:`page:${e.id}`,group:`canvas`,label:e.title,icon:`file`,hint:`Page`,run:f(()=>n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`))});for(let t of e.sections)for(let r of t.items)(r.kind===`screen`||r.kind===`url`)&&p.push({id:`item:${e.id}:${r.id}`,group:`canvas`,label:r.title,icon:r.kind===`url`?`globe`:`monitor`,hint:t.title?`${e.title} · ${t.title}`:e.title,keywords:`${r.id} ${t.title??``}`,searchOnly:!0,run:f(()=>{n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`),r_(o.id,r.id)})})}for(let e of i?.canvases??[])e.id!==a&&p.push({id:`canvas:${e.id}`,group:`canvases`,label:e.title,icon:`canvas`,hint:`${e.screens} screens`,keywords:e.id,run:f(()=>n(`/c/${encodeURIComponent(e.id)}`))});if(i?.system){for(let[e,t,r]of[[`Overview`,`/system`,`book`],[`Colors`,`/system/colors`,`palette`],[`Typography`,`/system/typography`,`type`],[`Spacing & shape`,`/system/shape`,`shape`]])p.push({id:`sys:${t}`,group:`system`,label:e,icon:r,run:f(()=>n(t))});for(let e of s?.components??[])p.push({id:`component:${e.id}`,group:`system`,label:e.title,icon:`component`,hint:e.group,searchOnly:!0,run:f(()=>n(`/system/components/${encodeURIComponent(e.id)}`))});for(let e of s?.guidelines??[])p.push({id:`guide:${e.slug}`,group:`system`,label:e.title,icon:`book`,hint:`Guideline`,searchOnly:!0,run:f(()=>n(`/system/guidelines/${encodeURIComponent(e.slug)}`))})}r||p.push({id:`home`,group:`actions`,label:`All canvases`,icon:`home`,run:f(()=>n(`/`))}),p.push({id:`light`,group:`actions`,label:`Light appearance`,icon:`sun`,searchOnly:!0,run:f(()=>p_(`light`))},{id:`dark`,group:`actions`,label:`Dark appearance`,icon:`moon`,searchOnly:!0,run:f(()=>p_(`dark`))},{id:`system-theme`,group:`actions`,label:`System appearance`,icon:`monitor`,searchOnly:!0,run:f(()=>p_(`system`))});let m=c.trim().toLowerCase(),h=p.filter(e=>m?`${e.label} ${e.keywords??``} ${typeof e.hint==`string`?e.hint:``}`.toLowerCase().includes(m):!e.searchOnly),g=[`canvas`,`canvases`,`system`,`actions`].map(e=>({group:e,items:h.filter(t=>t.group===e)})).filter(e=>e.items.length),_=g.flatMap(e=>e.items),y=Math.min(u,Math.max(_.length-1,0)),b=-1;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(kg,{className:`sr-only`,children:`Search and jump`}),(0,I.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2.5 border-b border-rule px-4`,children:[(0,I.jsx)(Z,{name:`search`,size:16,className:`text-muted`}),(0,I.jsx)(`input`,{value:c,onChange:e=>{l(e.target.value),d(0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),d((y+1)%Math.max(_.length,1))):e.key===`ArrowUp`?(e.preventDefault(),d((y-1+_.length)%Math.max(_.length,1))):e.key===`Enter`&&(e.preventDefault(),_[y]?.run())},placeholder:`Canvases, screens, components…`,"aria-label":`Search and jump`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`palette-list`,autoComplete:`off`,spellCheck:!1,className:`h-full min-w-0 grow border-0 bg-transparent text-[15px] text-ink outline-none placeholder:text-muted`}),(0,I.jsx)(__,{children:`esc`})]}),(0,I.jsx)(`div`,{id:`palette-list`,role:`listbox`,className:`min-h-0 grow overflow-y-auto py-1.5`,children:g.length?g.map(({group:e,items:t})=>(0,I.jsxs)(`div`,{role:`presentation`,children:[(0,I.jsx)(`div`,{className:`px-4 pt-2.5 pb-1 text-[12px] text-muted`,children:y_[e]}),t.map(e=>{b+=1;let t=b,n=t===y;return(0,I.jsxs)(`button`,{type:`button`,role:`option`,tabIndex:-1,"aria-selected":n,ref:n?e=>e?.scrollIntoView({block:`nearest`}):void 0,onMouseMove:()=>n?void 0:d(t),onClick:e.run,className:X(`flex h-10 w-full cursor-pointer items-center gap-3 border-0 px-4 text-left text-[13.5px] text-ink`,n?`bg-soft`:`bg-transparent`),children:[(0,I.jsx)(`span`,{className:`flex w-5 shrink-0 justify-center text-ink2`,children:(0,I.jsx)(Z,{name:e.icon,size:16})}),(0,I.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.label}),e.hint?(0,I.jsx)(`span`,{className:`flex shrink-0 items-center text-[12.5px] text-muted`,children:e.hint}):null]},e.id)})]},e)):(0,I.jsx)(`div`,{className:`px-6 py-10 text-center text-[13px] text-muted`,children:`Nothing matches.`})}),(0,I.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-4 border-t border-rule bg-soft px-4 text-[12px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(__,{children:`↑`}),(0,I.jsx)(__,{children:`↓`}),`move`]}),(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(__,{children:`↵`}),`open`]})]})]})}function S_(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=()=>t(e=>!e),n=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e())};return window.addEventListener(`keydown`,n),window.addEventListener(`design:palette`,e),()=>{window.removeEventListener(`keydown`,n),window.removeEventListener(`design:palette`,e)}},[]),(0,I.jsx)(mg,{open:e,onOpenChange:t,children:(0,I.jsx)(ed,{children:e?(0,I.jsx)(vg,{forceMount:!0,children:(0,I.jsx)(bg,{asChild:!0,forceMount:!0,children:(0,I.jsx)(Wf.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:`fixed inset-0 z-50 flex items-start justify-center bg-overlay p-6 pt-[12vh]`,children:(0,I.jsx)(wg,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,I.jsx)(Wf.div,{initial:{opacity:0,scale:.98,y:-6},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,transition:{duration:.1}},transition:{type:`spring`,stiffness:560,damping:40},className:`flex max-h-[min(560px,76vh)] w-[560px] max-w-full flex-col overflow-hidden rounded-[12px] border border-rule bg-surface shadow-pop outline-none`,children:(0,I.jsx)(x_,{onClose:()=>t(!1)})})})})})}):null})})}var C_=/Mac|iPhone|iPad/.test(navigator.platform)?`⌘`:`Ctrl`;function w_(){window.dispatchEvent(new CustomEvent(`design:palette`))}function T_({width:e=240,label:t=`Search and jump`}){return(0,I.jsxs)(`button`,{type:`button`,onClick:w_,style:{width:e},className:`flex h-ctrl min-w-0 shrink cursor-pointer items-center gap-2 rounded-[6px] border border-rule bg-soft pr-1.5 pl-3 text-ctrl text-muted transition-colors hover:border-rule-strong max-lg:w-auto!`,children:[(0,I.jsx)(Z,{name:`search`,size:15}),(0,I.jsx)(`span`,{className:`min-w-0 grow truncate text-left max-lg:hidden`,children:t}),(0,I.jsx)(__,{children:C_===`⌘`?`⌘K`:`Ctrl K`})]})}var E_={primary:`border border-primary bg-primary text-primary-ink hover:opacity-90`,secondary:`border border-rule-strong bg-surface text-ink hover:bg-soft`,ghost:`border border-transparent bg-transparent text-ink2 hover:bg-soft2`,dashed:`border border-dashed border-rule-strong bg-transparent text-ink2 hover:bg-soft`,danger:`border border-danger bg-danger text-on-danger hover:opacity-90`},D_=(e=`secondary`,t)=>X(`inline-flex h-ctrl shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-[6px] px-ctrl text-ctrl font-medium leading-none no-underline transition-[background-color,opacity] duration-100`,`disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45`,E_[e],t),O_=(0,v.forwardRef)(function({kind:e=`secondary`,icon:t,loading:n,disabled:r,className:i,children:a,type:o=`button`,...s},c){return(0,I.jsxs)(`button`,{ref:c,type:o,disabled:r||n,"aria-busy":n||void 0,className:D_(e,i),...s,children:[n?(0,I.jsx)(Z,{name:`loader`,size:15,className:`animate-spin`}):t?(0,I.jsx)(Z,{name:t,size:15}):null,a]})}),k_={ghost:`border border-transparent bg-transparent text-muted hover:bg-soft2 hover:text-ink2`,secondary:`border border-rule-strong bg-surface text-ink2 hover:bg-soft`},A_=(e=`ghost`,t)=>X(`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] p-0 transition-colors duration-100 disabled:cursor-not-allowed disabled:opacity-45`,k_[e],t),j_=(0,v.forwardRef)(function({icon:e,label:t,kind:n=`ghost`,size:r=16,className:i,type:a=`button`,...o},s){return(0,I.jsx)(`button`,{ref:s,type:a,"aria-label":t,title:t,className:A_(n,i),...o,children:(0,I.jsx)(Z,{name:e,size:r})})});function M_({to:e,kind:t=`secondary`,icon:n,className:r,children:i}){return(0,I.jsxs)(xe,{href:e,className:D_(t,r),children:[n?(0,I.jsx)(Z,{name:n,size:15}):null,i]})}function N_({kind:e=`secondary`,icon:t,className:n,children:r,...i}){return(0,I.jsxs)(`a`,{className:D_(e,n),...i,children:[t?(0,I.jsx)(Z,{name:t,size:15}):null,r]})}var P_=Object.defineProperty,F_=(e,t)=>P_(e,`name`,{value:t,configurable:!0});function I_(e){let t=e+`CollectionProvider`,[n,r]=ap(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=F_(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=kp(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=tp(t,a(s,n).collectionRef);return(0,I.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=kp(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=tp(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return F_(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}F_(I_,`createCollection`);var L_=new WeakMap,R_=class e extends Map{static{F_(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],L_.set(this,!0)}set(e,t){return L_.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=V_(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=z_(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=z_(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return z_(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function z_(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=B_(e,t);return n===-1?void 0:e[n]}F_(z_,`at`);function B_(e,t){let n=e.length,r=V_(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}F_(B_,`toSafeIndex`);function V_(e){return e!==e||e===0?0:Math.trunc(e)}F_(V_,`toSafeInteger`);function H_(e){let t=e+`CollectionProvider`,[n,r]=ap(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new R_,setItemMap:F_(()=>void 0,`setItemMap`)}),o=F_(({state:e,...t})=>e?(0,I.jsx)(c,{...t,state:e}):(0,I.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=F_(e=>{let t=h();return(0,I.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=F_(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[o,s]=v.useState(null),c=tp(a,s),[l,u]=r;return v.useEffect(()=>{if(!o)return;let e=K_(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,I.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=kp(l),d=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=tp(t,a(l,n).collectionRef);return(0,I.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=kp(f),m=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),[s,c]=v.useState(null),l=tp(t,o,c),{setItemMap:u}=a(f,n),d=v.useRef(i);U_(d.current,i)||(d.current=i);let m=d.current;return v.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(G_):(t.set(s,{...e,element:s}),t.toSorted(G_)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new R_(e)))}},[s,m,u]),(0,I.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return v.useState(new R_)}F_(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return F_(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}F_(H_,`createCollection`);function U_(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}F_(U_,`shallowEqual`);function W_(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}F_(W_,`isElementPreceding`);function G_(e,t){return!e[1].element||!t[1].element?0:W_(e[1].element,t[1].element)?-1:1}F_(G_,`sortByDocumentPosition`);function K_(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}F_(K_,`getChildListObserver`);var q_=Object.defineProperty,J_=(e,t)=>q_(e,`name`,{value:t,configurable:!0}),Y_=v.createContext(void 0);function X_(e){let t=v.useContext(Y_);return e||t||`ltr`}J_(X_,`useDirection`);var Z_=[`top`,`right`,`bottom`,`left`],Q_=Math.min,$_=Math.max,ev=Math.round,tv=Math.floor,nv=e=>({x:e,y:e}),rv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function iv(e,t,n){return $_(e,Q_(t,n))}function av(e,t){return typeof e==`function`?e(t):e}function ov(e){return e.split(`-`)[0]}function sv(e){return e.split(`-`)[1]}function cv(e){return e===`x`?`y`:`x`}function lv(e){return e===`y`?`height`:`width`}function uv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function dv(e){return cv(uv(e))}function fv(e,t,n){n===void 0&&(n=!1);let r=sv(e),i=dv(e),a=lv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xv(o)),[o,xv(o)]}function pv(e){let t=xv(e);return[mv(e),t,mv(t)]}function mv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var hv=[`left`,`right`],gv=[`right`,`left`],_v=[`top`,`bottom`],vv=[`bottom`,`top`];function yv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gv:hv:t?hv:gv;case`left`:case`right`:return t?_v:vv;default:return[]}}function bv(e,t,n,r){let i=sv(e),a=yv(ov(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mv)))),a}function xv(e){let t=ov(e);return rv[t]+e.slice(t.length)}function Sv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Cv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sv(e)}function wv(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 Tv(e,t,n){let{reference:r,floating:i}=e,a=uv(t),o=dv(t),s=lv(o),c=ov(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=sv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ev(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}=av(t,e),p=Cv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wv(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=wv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Dv=50,Ov=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ev},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Tv(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<Dv&&(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}=Tv(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},kv=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}=av(e,t)||{};if(l==null)return{};let d=Cv(u),f={x:n,y:r},p=dv(i),m=lv(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Q_(d[_],T),D=Q_(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=iv(E,k,O),j=!c.arrow&&sv(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,ee=j?k<E?k-E:k-O:0;return{[p]:f[p]+ee,data:{[p]:A,centerOffset:k-A-ee,...j&&{alignmentOffset:ee}},reset:j}}}),Av=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}=av(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ov(r),_=uv(o),v=ov(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xv(o)]:pv(o)),x=p!==`none`;!d&&x&&b.push(...bv(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=fv(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`||_===uv(t)||T.every(e=>uv(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=uv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function jv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mv(e){return Z_.some(t=>e[t]>=0)}var Nv=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=av(e,t);switch(i){case`referenceHidden`:{let e=jv(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Mv(e)}}}case`escaped`:{let e=jv(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Mv(e)}}}default:return{}}}}},Pv=new Set([`left`,`top`]);async function Fv(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ov(n),s=sv(n),c=uv(n)===`y`,l=Pv.has(o)?-1:1,u=a&&c?-1:1,d=av(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Iv=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 Fv(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}}}}},Lv=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}=av(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=uv(i),p=cv(f),m=u[p],h=u[f],g=(e,t)=>iv(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}}}}}},Rv=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}=av(e,t),u={x:n,y:r},d=uv(i),f=cv(d),p=u[f],m=u[d],h=av(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=Pv.has(ov(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}}}},zv=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}=av(e,t),c=await i.detectOverflow(t,s),l=ov(n),u=sv(n),d=uv(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=Q_(p-c[m],g),y=Q_(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*$_(c.left,c.right):S=p-2*$_(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 Bv(){return typeof window<`u`}function Vv(e){return Wv(e)?(e.nodeName||``).toLowerCase():`#document`}function Hv(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Uv(e){return((Wv(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Wv(e){return Bv()?e instanceof Node||e instanceof Hv(e).Node:!1}function Gv(e){return Bv()?e instanceof Element||e instanceof Hv(e).Element:!1}function Kv(e){return Bv()?e instanceof HTMLElement||e instanceof Hv(e).HTMLElement:!1}function qv(e){return!Bv()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Hv(e).ShadowRoot}function Jv(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ay(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Yv(e){return/^(table|td|th)$/.test(Vv(e))}function Xv(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Zv=/transform|translate|scale|rotate|perspective|filter/,Qv=/paint|layout|strict|content/,$v=e=>!!e&&e!==`none`,ey;function ty(e){let t=Gv(e)?ay(e):e;return $v(t.transform)||$v(t.translate)||$v(t.scale)||$v(t.rotate)||$v(t.perspective)||!ry()&&($v(t.backdropFilter)||$v(t.filter))||Zv.test(t.willChange||``)||Qv.test(t.contain||``)}function ny(e){let t=sy(e);for(;Kv(t)&&!iy(t);){if(ty(t))return t;if(Xv(t))return null;t=sy(t)}return null}function ry(){return ey??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ey}function iy(e){return/^(html|body|#document)$/.test(Vv(e))}function ay(e){return Hv(e).getComputedStyle(e)}function oy(e){return Gv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sy(e){if(Vv(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||qv(e)&&e.host||Uv(e);return qv(t)?t.host:t}function cy(e){let t=sy(e);return iy(t)?(e.ownerDocument||e).body:Kv(t)&&Jv(t)?t:cy(t)}function ly(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cy(e),i=r===e.ownerDocument?.body,a=Hv(r);if(i){let e=uy(a);return t.concat(a,a.visualViewport||[],Jv(r)?r:[],e&&n?ly(e):[])}return t.concat(r,ly(r,[],n))}function uy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dy(e){let t=ay(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Kv(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ev(n)!==a||ev(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function fy(e){return Gv(e)?e:e.contextElement}function py(e){let t=fy(e);if(!Kv(t))return nv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=dy(t),o=(a?ev(n.width):n.width)/r,s=(a?ev(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var my=nv(0);function hy(e){let t=Hv(e);return!ry()||!t.visualViewport?my:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gy(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Hv(e)}function _y(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=fy(e),o=nv(1);t&&(r?Gv(r)&&(o=py(r)):o=py(e));let s=gy(a,n,r)?hy(a):nv(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=Hv(a),t=Gv(r)?Hv(r):r,n=e,i=uy(n);for(;i&&t!==n;){let e=py(i),t=i.getBoundingClientRect(),r=ay(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=Hv(i),i=uy(n)}}return wv({width:u,height:d,x:c,y:l})}function vy(e,t){let n=oy(e).scrollLeft;return t?t.left+n:_y(Uv(e)).left+n}function yy(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vy(e,n),y:n.top+t.scrollTop}}function by(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Uv(r),s=t?Xv(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=nv(1),u=nv(0),d=Kv(r);if((d||!a)&&((Vv(r)!==`body`||Jv(o))&&(c=oy(r)),d)){let e=_y(r);l=py(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?yy(o,c):nv(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 xy(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Sy(e){let t=oy(e),n=e.ownerDocument.body,r=$_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=$_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+vy(e),o=-t.scrollTop;return ay(n).direction===`rtl`&&(a+=$_(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Cy=25;function wy(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Hv(e),a=Uv(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ry()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(vy(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<=Cy&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ty(e,t){let n=_y(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=py(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ey(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=wy(e,n,t);else if(t===`document`)r=Sy(Uv(e));else if(Gv(t))r=Ty(t,n);else{let n=hy(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wv(r)}function Dy(e,t){let n=t.get(e);if(n)return n;let r=ly(e,[],!1).filter(e=>Gv(e)&&Vv(e)!==`body`),i=null,a=ay(e).position===`fixed`,o=a?sy(e):e;for(;Gv(o)&&!iy(o);){let e=ay(o),t=ty(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=sy(o)}return t.set(e,r),r}function Oy(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Xv(t)?[]:Dy(t,this._c):[].concat(n),r],o=Ey(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=Ey(t,a[e],i);s=$_(n.top,s),c=Q_(n.right,c),l=Q_(n.bottom,l),u=$_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ky(e){let{width:t,height:n}=dy(e);return{width:t,height:n}}function Ay(e,t,n){let r=Kv(t),i=Uv(t),a=n===`fixed`,o=_y(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=nv(0);if((r||!a)&&((Vv(t)!==`body`||Jv(i))&&(s=oy(t)),r)){let e=_y(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=vy(i));let l=i&&!r&&!a?yy(i,s):nv(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 jy(e){return ay(e).position===`static`}function My(e,t){if(!Kv(e)||ay(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Uv(e)===n&&(n=n.ownerDocument.body),n}function Ny(e,t){let n=Hv(e);if(Xv(e))return n;if(!Kv(e)){let t=sy(e);for(;t&&!iy(t);){if(Gv(t)&&!jy(t))return t;t=sy(t)}return n}let r=My(e,t);for(;r&&Yv(r)&&jy(r);)r=My(r,t);return r&&iy(r)&&jy(r)&&!ty(r)?n:r||ny(e)||n}var Py=async function(e){let t=this.getOffsetParent||Ny,n=this.getDimensions,r=await n(e.floating);return{reference:Ay(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fy(e){return ay(e).direction===`rtl`}var Iy={convertOffsetParentRelativeRectToViewportRelativeRect:by,getDocumentElement:Uv,getClippingRect:Oy,getOffsetParent:Ny,getElementRects:Py,getClientRects:xy,getDimensions:ky,getScale:py,isElement:Gv,isRTL:Fy};function Ly(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ry(e,t,n){let r=null,i,a=Uv(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=tv(d),h=tv(a.clientWidth-(u+f)),g=tv(a.clientHeight-(d+p)),_=tv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:$_(0,Q_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ly(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=Hv(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function zy(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=fy(e),u=i||a?[...l?ly(l):[],...t?ly(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ry(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?_y(e):null;c&&g();function g(){let t=_y(e);h&&!Ly(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var By=Iv,Vy=Lv,Hy=Av,Uy=zv,Wy=Nv,Gy=kv,Ky=Rv,qy=(e,t,n)=>{let r=new Map,i=n??{},a={...Iy,...i.platform,_c:r};return Ov(e,t,{...i,platform:a})},Jy=typeof document<`u`?v.useLayoutEffect:function(){};function Yy(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(!Yy(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)&&!Yy(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Xy(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zy(e,t){let n=Xy(e);return Math.round(t*n)/n}function Qy(e){let t=v.useRef(e);return Jy(()=>{t.current=e}),t}function $y(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Yy(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Qy(c),O=Qy(i),k=Qy(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),qy(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Yy(T.current,t)&&(T.current=t,Ep.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Jy(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Jy(()=>(j.current=!0,()=>{j.current=!1}),[]),Jy(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let ee=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),te=v.useMemo(()=>({reference:x,floating:S}),[x,S]),ne=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=Zy(te.floating,u.x),r=Zy(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Xy(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:ee,elements:te,floatingStyles:ne}),[u,A,ee,te,ne])}var eb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Gy({element:r.current,padding:i}).fn(n):r?Gy({element:r,padding:i}).fn(n):{}}}},tb=(e,t)=>{let n=By(e);return{name:n.name,fn:n.fn,options:[e,t]}},nb=(e,t)=>{let n=Vy(e);return{name:n.name,fn:n.fn,options:[e,t]}},rb=(e,t)=>({fn:Ky(e).fn,options:[e,t]}),ib=(e,t)=>{let n=Hy(e);return{name:n.name,fn:n.fn,options:[e,t]}},ab=(e,t)=>{let n=Uy(e);return{name:n.name,fn:n.fn,options:[e,t]}},ob=(e,t)=>{let n=Wy(e);return{name:n.name,fn:n.fn,options:[e,t]}},sb=(e,t)=>{let n=eb(e);return{name:n.name,fn:n.fn,options:[e,t]}},cb=Object.defineProperty,lb=(e,t)=>cb(e,`name`,{value:t,configurable:!0});function ub(e){let[t,n]=v.useState(void 0);return sp(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}lb(ub,`useSize`);var db=Object.defineProperty,fb=(e,t)=>db(e,`name`,{value:t,configurable:!0}),pb=`Popper`,[mb,hb]=ap(pb),[gb,_b]=mb(pb),vb=fb(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,I.jsx)(gb,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),yb=`PopperAnchor`,bb=v.forwardRef(fb(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=_b(yb,n),o=v.useRef(null),s=a.onAnchorChange,c=tp(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Db(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,I.jsx)(Wp.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),xb=`PopperContent`,[Sb,Cb]=mb(xb),wb=v.forwardRef(fb(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=_b(xb,n),[_,y]=v.useState(null),b=tp(t,y),[x,S]=v.useState(null),C=ub(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Tb),altBoundary:k},{refs:j,floatingStyles:ee,placement:te,isPositioned:ne,middlewareData:re}=$y({strategy:`fixed`,placement:E,whileElementsMounted:fb((...e)=>zy(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[tb({mainAxis:i+T,alignmentAxis:o}),c&&nb({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?rb():void 0,...A}),c&&ib({...A}),ab({...A,apply:fb(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&sb({element:x,padding:s}),Eb({arrowWidth:w,arrowHeight:T}),f&&ob({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),ie=g.setPlacementState;sp(()=>(ie(te),()=>{ie(void 0)}),[te,ie]);let[ae,M]=Db(te),oe=Jp(m);sp(()=>{ne&&oe?.()},[ne,oe]);let se=re.arrow?.x,ce=re.arrow?.y,le=re.arrow?.centerOffset!==0,[ue,de]=v.useState();return sp(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),(0,I.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:ne?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(` `),...re.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(Sb,{scope:n,placedSide:ae,placedAlign:M,onArrowChange:S,arrowX:se,arrowY:ce,shouldHideArrow:le,children:(0,I.jsx)(Wp.div,{"data-side":ae,"data-align":M,...h,ref:b,style:{...h.style,animation:ne?h.style?.animation:`none`}})})})},`PopperContent`));function Tb(e){return e!==null}fb(Tb,`isNotNull`);var Eb=fb(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Db(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Db(e){let[t,n=`center`]=e.split(`-`);return[t,n]}fb(Db,`getSideAndAlignFromPlacement`);var Ob=vb,kb=bb,Ab=wb,jb=Object.defineProperty,Mb=(e,t)=>jb(e,`name`,{value:t,configurable:!0}),Nb=!1;function Pb(){let[e,t]=v.useState(Nb);return v.useEffect(()=>{Nb||(Nb=!0,t(!0))},[]),e}Mb(Pb,`useIsHydrated`);var Fb=v.useSyncExternalStore;function Ib(){return()=>{}}Mb(Ib,`subscribe`);function Lb(){return Fb(Ib,()=>!0,()=>!1)}Mb(Lb,`useIsHydratedModern`);var Rb=typeof Fb==`function`?Lb:Pb,zb=Object.defineProperty,Bb=(e,t)=>zb(e,`name`,{value:t,configurable:!0}),Vb=`rovingFocusGroup.onEntryFocus`,Hb={bubbles:!1,cancelable:!0},Ub=`RovingFocusGroup`,[Wb,Gb,Kb]=I_(Ub),[qb,Jb]=ap(Ub,[Kb]),[Yb,Xb]=qb(Ub),Zb=v.forwardRef(Bb(function(e,t){return(0,I.jsx)(Wb.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Wb.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Qb,{...e,ref:t})})})},`RovingFocusGroup`)),Qb=v.forwardRef(Bb(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),p=tp(t,f),m=X_(a),[h,g]=xp({prop:o,defaultProp:s??null,onChange:c,caller:Ub}),[_,y]=v.useState(!1),b=Jp(l),x=Gb(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Vb,b),()=>e.removeEventListener(Vb,b)},[b]),(0,I.jsx)(Yb,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,I.jsx)(Wp.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{S.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Vb,Hb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);ix([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Y(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),$b=`RovingFocusGroupItem`,ex=v.forwardRef(Bb(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=fp(),l=a||c,u=Xb($b,n),d=u.currentTabStopId===l,f=Gb(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Rb();return sp(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,I.jsx)(Wb.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(Wp.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=rx(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?ax(n,r+1):n.slice(r+1)}setTimeout(()=>ix(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),tx={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function nx(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Bb(nx,`getDirectionAwareKey`);function rx(e,t,n){let r=nx(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return tx[r]}Bb(rx,`getFocusIntent`);function ix(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Bb(ix,`focusFirst`);function ax(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Bb(ax,`wrapArray`);var ox=Zb,sx=ex,cx=Object.defineProperty,lx=(e,t)=>cx(e,`name`,{value:t,configurable:!0}),ux=[`Enter`,` `],dx=[`ArrowDown`,`PageUp`,`Home`],fx=[`ArrowUp`,`PageDown`,`End`],px=[...dx,...fx];[...ux],[...ux];var mx=`Menu`,[hx,gx,_x]=I_(mx),[vx,yx]=ap(mx,[_x,hb,Jb]),bx=hb(),xx=Jb(),[Sx,Cx]=vx(mx),[wx,Tx]=vx(mx),Ex=lx(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=bx(t),[c,l]=v.useState(null),u=v.useRef(!1),d=Jp(a),f=X_(i);return v.useEffect(()=>{let e=lx(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=lx(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),v.useEffect(()=>{if(!n)return;let e=lx(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,I.jsx)(Ob,{...s,children:(0,I.jsx)(Sx,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)(wx,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Dx=v.forwardRef(lx(function(e,t){let{__scopeMenu:n,...r}=e,i=bx(n);return(0,I.jsx)(kb,{...i,...r,ref:t})},`MenuAnchor`)),Ox=`MenuPortal`,[kx,Ax]=vx(Ox,{forceMount:void 0}),jx=lx(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Cx(Ox,t);return(0,I.jsx)(kx,{scope:t,forceMount:n,children:(0,I.jsx)(jm,{present:n||a.open,children:(0,I.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Mx=`MenuContent`,[Nx,Px]=vx(Mx),Fx=v.forwardRef(lx(function(e,t){let n=Ax(Mx,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Cx(Mx,e.__scopeMenu),o=Tx(Mx,e.__scopeMenu);return(0,I.jsx)(hx.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(jm,{present:r||a.open,children:(0,I.jsx)(hx.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(Ix,{...i,ref:t}):(0,I.jsx)(Lx,{...i,ref:t})})})})},`MenuContent`)),Ix=v.forwardRef(lx(function(e,t){let n=Cx(Mx,e.__scopeMenu),r=v.useRef(null),i=tp(t,r);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,I.jsx)(zx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Lx=v.forwardRef(lx(function(e,t){let n=Cx(Mx,e.__scopeMenu);return(0,I.jsx)(zx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Rx=kp(`MenuContent.ScrollLock`),zx=v.forwardRef(lx(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Cx(Mx,n),_=Tx(Mx,n),y=bx(n),b=xx(n),x=gx(n),[S,C]=v.useState(null),w=v.useRef(null),T=tp(t,w,g.onContentChange),E=v.useRef(0),D=v.useRef(``),O=v.useRef(0),k=v.useRef(null),A=v.useRef(`right`),j=v.useRef(0),ee=m?Zh:v.Fragment,te=m?{as:Rx,allowPinchZoom:!0}:void 0,ne=lx(e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=rS(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;lx((function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);v.useEffect(()=>()=>window.clearTimeout(E.current),[]),Hm();let re=v.useCallback(e=>A.current===k.current?.side&&aS(e,k.current?.area),[]);return(0,I.jsx)(Nx,{scope:n,searchRef:D,onItemEnter:v.useCallback(e=>{re(e)&&e.preventDefault()},[re]),onItemLeave:v.useCallback(e=>{re(e)||(w.current?.focus(),C(null))},[re]),onTriggerLeave:v.useCallback(e=>{re(e)&&e.preventDefault()},[re]),pointerGraceTimerRef:O,onPointerGraceIntentChange:v.useCallback(e=>{k.current=e},[]),children:(0,I.jsx)(ee,{...te,children:(0,I.jsx)(mm,{asChild:!0,trapped:i,onMountAutoFocus:Y(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,I.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,I.jsx)(ox,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Y(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,I.jsx)(Ab,{role:`menu`,"aria-orientation":`vertical`,"data-state":Qx(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:Y(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ne(e.key));let i=w.current;if(e.target!==i||!px.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);fx.includes(e.key)&&a.reverse(),tS(a)}),onBlur:Y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:Y(e.onPointerMove,oS(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),Bx=v.forwardRef(lx(function(e,t){let{__scopeMenu:n,...r}=e;return(0,I.jsx)(Wp.div,{...r,ref:t})},`MenuLabel`)),Vx=`MenuItem`,Hx=`menu.itemSelect`,Ux=v.forwardRef(lx(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=Tx(Vx,e.__scopeMenu),s=Px(Vx,e.__scopeMenu),c=tp(t,a),l=v.useRef(!1),u=lx(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Hx,{bubbles:!0,cancelable:!0});e.addEventListener(Hx,e=>r?.(e),{once:!0}),Gp(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,I.jsx)(Wx,{...i,ref:c,disabled:n,onClick:Y(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Y(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Y(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&ux.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Wx=v.forwardRef(lx(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Px(Vx,n),s=xx(n),c=v.useRef(null),l=tp(t,c),[u,d]=v.useState(!1),[f,p]=v.useState(``);return v.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,I.jsx)(hx.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)(sx,{asChild:!0,...s,focusable:!r,children:(0,I.jsx)(Wp.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Y(e.onPointerMove,oS(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,oS(e=>o.onItemLeave(e))),onFocus:Y(e.onFocus,()=>d(!0)),onBlur:Y(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Gx,Kx]=vx(`MenuRadioGroup`,{value:void 0,onValueChange:lx(()=>{},`onValueChange`)}),[qx,Jx]=vx(`MenuItemIndicator`,{checked:!1}),Yx=v.forwardRef(lx(function(e,t){let{__scopeMenu:n,...r}=e;return(0,I.jsx)(Wp.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[Xx,Zx]=vx(`MenuSub`);function Qx(e){return e?`open`:`closed`}lx(Qx,`getOpenState`);function $x(e){return e===`indeterminate`}lx($x,`isIndeterminate`);function eS(e){return $x(e)?`indeterminate`:e?`checked`:`unchecked`}lx(eS,`getCheckedState`);function tS(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}lx(tS,`focusFirst`);function nS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}lx(nS,`wrapArray`);function rS(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=nS(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}lx(rS,`getNextMatch`);function iS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}lx(iS,`isPointInPolygon`);function aS(e,t){return t?iS({x:e.clientX,y:e.clientY},t):!1}lx(aS,`isPointerInGraceArea`);function oS(e){return t=>t.pointerType===`mouse`?e(t):void 0}lx(oS,`whenMouse`);var sS=Ex,cS=Dx,lS=jx,uS=Fx,dS=Bx,fS=Ux,pS=Yx,mS=Object.defineProperty,hS=(e,t)=>mS(e,`name`,{value:t,configurable:!0}),gS=`DropdownMenu`,[_S,vS]=ap(gS,[yx]),yS=yx(),[bS,xS]=_S(gS),SS=hS(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=yS(t),l=v.useRef(null),[u,d]=xp({prop:i,defaultProp:a??!1,onChange:o,caller:gS});return(0,I.jsx)(bS,{scope:t,triggerId:fp(),triggerRef:l,contentId:fp(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(sS,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),CS=`DropdownMenuTrigger`,wS=v.forwardRef(hS(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=xS(CS,n),o=yS(n),s=tp(t,a.triggerRef);return(0,I.jsx)(cS,{asChild:!0,...o,children:(0,I.jsx)(Wp.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:Y(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Y(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),TS=hS(e=>{let{__scopeDropdownMenu:t,...n}=e,r=yS(t);return(0,I.jsx)(lS,{...r,...n})},`DropdownMenuPortal`),ES=`DropdownMenuContent`,DS=v.forwardRef(hS(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=xS(ES,n),a=yS(n),o=v.useRef(!1);return(0,I.jsx)(uS,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),OS=v.forwardRef(hS(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=yS(n);return(0,I.jsx)(dS,{...i,...r,ref:t})},`DropdownMenuLabel`)),kS=v.forwardRef(hS(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=yS(n);return(0,I.jsx)(fS,{...i,...r,ref:t})},`DropdownMenuItem`)),AS=v.forwardRef(hS(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=yS(n);return(0,I.jsx)(pS,{...i,...r,ref:t})},`DropdownMenuSeparator`)),jS=SS,MS=wS,NS=TS,PS=DS,FS=OS,IS=kS,LS=AS,RS=`z-50 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-pop outline-none py-1 data-[state=open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`;function zS({trigger:e,children:t,width:n=220,align:r=`start`,side:i=`bottom`,sideOffset:a=6,open:o,onOpenChange:s}){return(0,I.jsxs)(jS,{open:o,onOpenChange:s,modal:!1,children:[(0,I.jsx)(MS,{asChild:!0,children:e}),(0,I.jsx)(NS,{children:(0,I.jsx)(PS,{align:r,side:i,sideOffset:a,collisionPadding:12,className:RS,style:{width:n},children:t})})]})}var BS=(e,t)=>X(`flex min-h-9 w-full cursor-pointer items-center gap-2.5 border-0 px-3 py-1.5 text-left text-[13.5px] outline-none select-none`,`data-[highlighted]:bg-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,t?`bg-soft`:`bg-transparent`,e?`text-danger-text`:`text-ink`);function VS({children:e,onSelect:t,danger:n,active:r,disabled:i,hint:a,className:o}){return(0,I.jsxs)(IS,{disabled:i,onSelect:t,className:X(BS(n,r),o),children:[e,a?(0,I.jsx)(`span`,{className:`ml-auto pl-3 text-[12px] text-muted`,children:a}):null]})}function HS(){return(0,I.jsx)(LS,{className:`my-1 h-px bg-rule`})}function US({children:e}){return(0,I.jsx)(FS,{className:`px-3 pt-1.5 pb-1 text-[12px] text-muted`,children:e})}var WS=[{value:`system`,label:`System`,icon:`monitor`},{value:`light`,label:`Light`,icon:`sun`},{value:`dark`,label:`Dark`,icon:`moon`}];function GS(){let e=m_(),t=h_();return(0,I.jsxs)(zS,{align:`end`,width:180,trigger:(0,I.jsx)(j_,{icon:t===`dark`?`moon`:`sun`,label:`Appearance`}),children:[(0,I.jsx)(US,{children:`Appearance`}),WS.map(t=>(0,I.jsxs)(VS,{active:e===t.value,onSelect:()=>p_(t.value),children:[(0,I.jsx)(Z,{name:t.icon,size:15,className:`text-ink2`}),t.label,e===t.value?(0,I.jsx)(Z,{name:`check`,size:15,className:`ml-auto text-ink2`}):null]},t.value))]})}function KS({size:e=24}){return(0,I.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 32 32`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,I.jsx)(`rect`,{width:`32`,height:`32`,rx:`7`,className:`fill-primary`}),(0,I.jsx)(`rect`,{x:`7`,y:`7`,width:`8`,height:`11`,rx:`1.5`,className:`fill-primary-ink`}),(0,I.jsx)(`rect`,{x:`17`,y:`7`,width:`8`,height:`6`,rx:`1.5`,fill:`#f0a040`}),(0,I.jsx)(`rect`,{x:`17`,y:`15`,width:`8`,height:`10`,rx:`1.5`,className:`fill-primary-ink`}),(0,I.jsx)(`rect`,{x:`7`,y:`20`,width:`8`,height:`5`,rx:`1.5`,className:`fill-primary-ink`})]})}function qS({name:e,version:t}){return(0,I.jsxs)(xe,{href:`/`,title:t?`foss-design ${t}`:void 0,className:`flex min-w-0 items-center gap-2 text-[14px] font-semibold text-ink no-underline`,children:[(0,I.jsx)(KS,{}),(0,I.jsx)(`span`,{className:`truncate`,children:e??`Design`})]})}function JS({children:e,className:t}){return(0,I.jsx)(`header`,{className:X(`sticky top-0 z-30 flex h-[52px] shrink-0 items-center gap-3 border-b border-rule bg-surface px-4`,t),children:e})}var YS=[{to:`/`,label:`Canvases`,match:e=>e===`/`||e.startsWith(`/c/`)},{to:`/system`,label:`Design system`,match:e=>e.startsWith(`/system`)}];function XS({location:e}){let t=(0,v.useRef)(null),n=YS.findIndex(t=>t.match(e)),[r,i]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let r=()=>{let t=e.children[n];if(!t?.offsetWidth){i(null);return}let r=t.offsetLeft+10,a=t.offsetWidth-20;i(e=>e?.tab===n&&e.x===r&&e.width===a?e:{tab:n,x:r,width:a,slide:e!==null&&e.tab!==n})};r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[n]),(0,I.jsxs)(`nav`,{ref:t,className:`relative flex h-[52px] items-stretch gap-0.5 max-md:hidden`,children:[YS.map((e,t)=>(0,I.jsx)(xe,{href:e.to,"aria-current":t===n?`page`:void 0,className:X(`flex items-center px-2.5 text-[14px] no-underline transition-colors`,t===n?`font-medium text-ink`:`text-ink2 hover:text-ink`),children:e.label},e.to)),r?(0,I.jsx)(Wf.span,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 h-[2px] bg-action`,initial:!1,animate:{x:r.x,width:r.width},transition:r.slide?{type:`spring`,stiffness:520,damping:42}:{duration:0}}):null]})}function ZS(){let e=Zg().data,{slots:t}=Jg(),[n]=N();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(JS,{children:[t.barStart,(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-6`,children:[t.brand??(0,I.jsx)(qS,{name:e?.name,version:e?.version}),(0,I.jsx)(XS,{location:n})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,I.jsx)(T_,{}),(0,I.jsx)(GS,{}),t.barEnd]})]}),t.belowBar]})}var QS=Object.defineProperty,$S=(e,t)=>QS(e,`name`,{value:t,configurable:!0}),eC=`Popover`,[tC,nC]=ap(eC,[hb]),rC=hb(),[iC,aC]=tC(eC),oC=$S(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=rC(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=xp({prop:r,defaultProp:i??!1,onChange:a,caller:eC});return(0,I.jsx)(Ob,{...s,children:(0,I.jsx)(iC,{scope:t,contentId:fp(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),sC=`PopoverTrigger`,cC=v.forwardRef($S(function(e,t){let{__scopePopover:n,...r}=e,i=aC(sC,n),a=rC(n),o=tp(t,i.triggerRef),s=(0,I.jsx)(Wp.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":yC(i.open),...r,ref:o,onClick:Y(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(kb,{asChild:!0,...a,children:s})},`PopoverTrigger`)),lC=`PopoverPortal`,[uC,dC]=tC(lC,{forceMount:void 0}),fC=$S(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=aC(lC,t);return(0,I.jsx)(uC,{scope:t,forceMount:n,children:(0,I.jsx)(jm,{present:n||a.open,children:(0,I.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),pC=`PopoverContent`,mC=v.forwardRef($S(function(e,t){let n=dC(pC,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=aC(pC,e.__scopePopover);return(0,I.jsx)(jm,{present:r||a.open,children:a.modal?(0,I.jsx)(gC,{...i,ref:t}):(0,I.jsx)(_C,{...i,ref:t})})},`PopoverContent`)),hC=kp(`PopoverContent.RemoveScroll`),gC=v.forwardRef($S(function(e,t){let n=aC(pC,e.__scopePopover),r=v.useRef(null),i=tp(t,r),a=v.useRef(!1);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,I.jsx)(Zh,{as:hC,allowPinchZoom:!0,children:(0,I.jsx)(vC,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),_C=v.forwardRef($S(function(e,t){let n=aC(pC,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,I.jsx)(vC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),vC=v.forwardRef($S(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=aC(pC,n),p=rC(n);return Hm(),(0,I.jsx)(mm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,I.jsx)(Ab,{"data-state":yC(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function yC(e){return e?`open`:`closed`}$S(yC,`getState`);var bC=oC,xC=cC,SC=fC,CC=mC,wC=new a_([]),TC=1;function EC(e,t,n=`ok`){let r=TC++;wC.set(i=>[...i.slice(-2),{id:r,title:e,text:t,tone:n}]),setTimeout(()=>wC.set(e=>e.filter(e=>e.id!==r)),n===`error`?4200:2200)}var DC=new a_([]),OC=1;function kC(){let[e]=(0,v.useState)(()=>OC++);(0,v.useEffect)(()=>(DC.set(t=>[...t,e]),()=>DC.set(t=>t.filter(t=>t!==e))),[e]);let t=o_(DC,t=>t[0]===e),n=o_(wC);return t?(0,I.jsx)(`div`,{className:`pointer-events-none fixed bottom-5 left-1/2 z-[60] flex -translate-x-1/2 flex-col items-center gap-2`,children:(0,I.jsx)(ed,{mode:`popLayout`,children:n.map(e=>(0,I.jsxs)(Wf.div,{layout:!0,initial:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,transition:{duration:.12}},transition:{type:`spring`,stiffness:520,damping:40},className:`flex max-w-[min(420px,calc(100vw-32px))] min-w-0 items-center gap-2.5 rounded-[8px] border border-rule bg-surface px-3 py-2 text-[13px] text-ink shadow-pop`,children:[e.tone===`error`?(0,I.jsx)(Z,{name:`alert`,size:15,className:`text-danger-text`}):e.tone===`info`?(0,I.jsx)(Z,{name:`info`,size:15,className:`text-muted`}):(0,I.jsx)(Z,{name:`check`,size:15,className:`text-ok-text`}),(0,I.jsx)(`span`,{className:`shrink-0 font-medium whitespace-nowrap`,children:e.title}),e.text?(0,I.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px] text-muted`,children:e.text}):null]},e.id))})}):null}async function AC(e,t=`Copied`){try{await navigator.clipboard.writeText(e),EC(t,e.length>64?void 0:e)}catch{EC(`Could not copy`,`The browser blocked clipboard access`,`error`)}}var jC=new Map;window.addEventListener(`message`,e=>{let t=e.data;if(t?.source===`design-runtime`&&e.source)for(let n of jC.get(e.source)??[])n(t)});function MC(e,t){let n=null,r=()=>{if(!n)return;let e=jC.get(n);e?.delete(t),e?.size||jC.delete(n),n=null},i=()=>{if(r(),n=e.contentWindow,!n)return;let i=jC.get(n)??new Set;i.add(t),jC.set(n,i)};return i(),e.addEventListener(`load`,i),()=>{e.removeEventListener(`load`,i),r()}}function NC(e,t){e?.contentWindow?.postMessage({source:`design-viewer`,...t},`*`)}function PC(e){NC(e,{type:`canvas`})}function FC(e,t){NC(e,{type:`theme`,theme:t})}function IC(e){e&&(e.src=e.src)}var LC=(()=>{if(jg)return``;let{protocol:e,hostname:t,port:n}=window.location,r=t===`localhost`?`127.0.0.1`:t===`127.0.0.1`?`localhost`:null;return r?`${e}//${r}${n?`:${n}`:``}`:``})();function RC(e,t,n){let[r=``,i=``]=e.split(`?`),a=new URLSearchParams(i);a.set(`theme`,t);for(let[e,t]of Object.entries(n??{}))a.set(e,t);return`${r.startsWith(`/`)?LC:``}${r}?${a.toString()}`}function zC(e){return new URL(e,document.baseURI).toString()}function BC(e,t,n){if(e.form){EC(`Forms are not sent from a screen`,void 0,`info`);return}if(e.path===null){let t=window.open(e.href,`_blank`);t?t.opener=null:EC(`Link to another site`,e.href,`info`);return}let r=e.path.split(/[?#]/)[0].replace(/\/+$/,``),i=r.slice(r.lastIndexOf(`/`)+1).replace(/\.html?$/,``);try{i=decodeURIComponent(i)}catch{}let a=new Set(t.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`).map(e=>e.id))));i&&a.has(i)?n(i):EC(`Not a screen on this canvas`,e.path,`info`)}function VC(e,t,n){let r=Zg().data,i=$g(!!r?.system).data?.tokens,[a,o]=(0,v.useState)(null),s=(0,v.useRef)({enabled:t,tokens:i});s.current={enabled:t,tokens:i};let c=(0,v.useRef)(n.onEscape);c.current=n.onEscape;let l=(0,v.useRef)(e);l.current=e;let u=(0,v.useRef)(new Map),d=(e,t=!1)=>{let{enabled:n,tokens:r}=s.current,i=u.current.get(e);(t||i?.on!==n||i.tokens!==r)&&(u.current.set(e,{on:n,tokens:r}),NC(e,{type:`inspect`,on:n,tokens:n?r??[]:void 0}))};(0,v.useEffect)(()=>{for(let t of e)d(t);for(let t of u.current.keys())e.includes(t)||u.current.delete(t)},[e,t,i]),(0,v.useEffect)(()=>{let t=e.map(e=>MC(e,t=>{if(t.type===`ready`)s.current.enabled?d(e,!0):u.current.set(e,{on:!1});else if(t.type===`inspect`){if(t.info){for(let t of l.current)t!==e&&NC(t,{type:`inspect-select`,ref:null});o({info:t.info,frame:e})}else o(t=>t?.frame===e?null:t)}else t.type===`inspect-escape`&&c.current()}));return()=>{for(let e of t)e()}},[e]);let f=a&&e.includes(a.frame)?a.frame:null;return{info:f?a.info:null,frame:f,select(e){if(e===null){for(let e of l.current)NC(e,{type:`inspect-select`,ref:null});o(null)}else a&&NC(a.frame,{type:`inspect-select`,ref:e})}}}function HC(e){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=e=>e===`Meta`||e===`Control`,r=!1,i=!1,a,o=()=>{r=!1,clearTimeout(a),n(!1)},s=e=>{if(t(e)){if(r)return;r=!0,i=!1,a=setTimeout(()=>{r&&!i&&n(!0)},150)}else r&&(i=!0,clearTimeout(a),n(!1))},c=e=>s(e.key),l=e=>{t(e.key)&&o()};window.addEventListener(`keydown`,c,!0),window.addEventListener(`keyup`,l,!0),window.addEventListener(`blur`,o);let u=e.map(e=>MC(e,e=>{e.type===`key`?e.down?s(e.name):t(e.name)&&o():e.type===`blur`&&o()}));return()=>{window.removeEventListener(`keydown`,c,!0),window.removeEventListener(`keyup`,l,!0),window.removeEventListener(`blur`,o);for(let e of u)e();clearTimeout(a)}},[e]),t}function UC({title:e,children:t,right:n}){return(0,I.jsxs)(`section`,{className:`border-t border-rule pb-2 first:border-t-0`,children:[(0,I.jsxs)(`div`,{className:`flex h-9 items-center justify-between px-4 text-[12px] font-medium text-muted`,children:[e,n]}),t]})}function WC({label:e,children:t}){return(0,I.jsxs)(`div`,{className:`grid min-h-7 grid-cols-[92px_minmax(0,1fr)] items-center gap-x-3 px-4 py-0.5 text-[12.5px]`,children:[(0,I.jsx)(`span`,{className:`text-muted`,children:e}),(0,I.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-ink`,children:t})]})}function GC({name:e}){return e?(0,I.jsx)(`button`,{type:`button`,onClick:()=>void AC(`var(${e})`,`Token copied`),title:`Copy var()`,className:`shrink-0 cursor-pointer truncate rounded-[4px] border-0 bg-action-soft px-1.5 py-px font-mono text-[11px] text-action`,children:e}):null}function KC({children:e,title:t}){return(0,I.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px]`,title:t,children:e})}function qC({label:e,color:t}){return(0,I.jsxs)(WC,{label:e,children:[(0,I.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:t.css}}),(0,I.jsx)(KC,{title:t.css,children:t.value}),(0,I.jsx)(GC,{name:t.token})]})}var JC=e=>e?String(e):`–`;function YC({label:e,values:t,className:n,children:r}){let[i,a,o,s]=t;return(0,I.jsxs)(`div`,{className:X(`relative grid grid-cols-[28px_minmax(0,1fr)_28px] grid-rows-[20px_auto_20px] rounded-[4px]`,n),children:[(0,I.jsx)(`span`,{className:`absolute top-1 left-1.5 text-[9.5px] tracking-wide text-muted uppercase`,children:e}),(0,I.jsx)(`span`,{className:`col-start-2 self-center text-center`,children:JC(i)}),(0,I.jsx)(`span`,{className:`row-start-2 self-center text-center`,children:JC(s)}),(0,I.jsx)(`div`,{className:`row-start-2 col-start-2`,children:r}),(0,I.jsx)(`span`,{className:`row-start-2 col-start-3 self-center text-center`,children:JC(a)}),(0,I.jsx)(`span`,{className:`row-start-3 col-start-2 self-center text-center`,children:JC(o)})]})}function XC({info:e}){let t={w:Math.max(0,e.rect.w-e.border[1]-e.border[3]-e.padding[1]-e.padding[3]),h:Math.max(0,e.rect.h-e.border[0]-e.border[2]-e.padding[0]-e.padding[2])};return(0,I.jsx)(`div`,{className:`px-4 pt-1 pb-2 font-mono text-[11px] text-ink2`,children:(0,I.jsx)(YC,{label:`margin`,values:e.margin,className:`border border-dashed border-rule-strong bg-[#f6b26b]/15`,children:(0,I.jsx)(YC,{label:`border`,values:e.border,className:`border border-rule-strong bg-[#f9e27d]/15`,children:(0,I.jsx)(YC,{label:`padding`,values:e.padding,className:`border border-rule-strong bg-[#93c47d]/20`,children:(0,I.jsxs)(`div`,{className:`flex h-8 items-center justify-center rounded-[3px] border border-rule-strong bg-[#6fa8dc]/25 text-ink`,children:[Math.round(t.w*100)/100,` × `,Math.round(t.h*100)/100]})})})})})}function ZC({info:e,onSelect:t}){return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-4 pb-2`,children:[e.path.slice(-4).map((e,n)=>(0,I.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`cursor-pointer rounded-[4px] border-0 bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2 hover:text-ink`,children:e.label}),(0,I.jsx)(Z,{name:`chevron-right`,size:11,className:`text-muted`})]},n)),(0,I.jsx)(`span`,{className:`rounded-[4px] bg-action-soft px-1.5 py-0.5 font-mono text-[11px] text-action`,children:e.label})]})}function QC({info:e,onSelect:t,onClose:n,active:r}){return(0,I.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[320px] shrink-0 flex-col overflow-hidden border-l border-rule bg-surface`,children:[(0,I.jsxs)(`div`,{className:`flex h-[46px] shrink-0 items-center justify-between border-b border-rule pr-2 pl-4`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-[14px] font-semibold`,children:[(0,I.jsx)(Z,{name:`pointer`,size:15,className:`text-action`}),` Inspect`]}),(0,I.jsx)(j_,{icon:`x`,label:`Close inspector (I)`,onClick:n})]}),e?(0,I.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto`,children:[(0,I.jsxs)(UC,{title:`Element`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2`,children:[(0,I.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:e.component?.owners[0]?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:[`<`,e.component.owners[0],`>`]}),(0,I.jsx)(`span`,{className:`truncate font-mono text-[12px] text-muted`,children:e.tag})]}):(0,I.jsx)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:e.label})}),e.component&&e.component.owners.length>1?(0,I.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[`in `,e.component.owners.slice(1).join(` ← `)]}):null,e.component?.file?(0,I.jsx)(`button`,{type:`button`,onClick:()=>void AC(e.component.file,`Path copied`),className:`w-fit max-w-full cursor-pointer truncate border-0 bg-transparent p-0 text-left font-mono text-[11.5px] text-muted hover:text-ink2`,title:`Copy path`,children:e.component.file}):null,e.text?(0,I.jsxs)(`span`,{className:`line-clamp-2 text-[12.5px] text-ink2`,children:[`“`,e.text,`”`]}):null]}),(0,I.jsx)(ZC,{info:e,onSelect:t})]}),(0,I.jsxs)(UC,{title:`Box`,children:[(0,I.jsx)(XC,{info:e}),(0,I.jsx)(WC,{label:`Size`,children:(0,I.jsxs)(KC,{children:[e.rect.w,` × `,e.rect.h]})}),(0,I.jsx)(WC,{label:`Position`,children:(0,I.jsxs)(KC,{children:[`x `,e.rect.x,` · y `,e.rect.y]})})]}),e.layout.length?(0,I.jsx)(UC,{title:`Layout`,children:e.layout.map(([e,t])=>(0,I.jsx)(WC,{label:e,children:(0,I.jsx)(KC,{title:t,children:t})},e))}):null,e.typography?(0,I.jsxs)(UC,{title:`Typography`,children:[(0,I.jsxs)(WC,{label:`Font`,children:[(0,I.jsx)(KC,{title:e.typography.family,children:e.typography.family.split(`,`)[0]?.replace(/["']/g,``)}),(0,I.jsx)(GC,{name:e.typography.familyToken})]}),(0,I.jsxs)(WC,{label:`Size`,children:[(0,I.jsxs)(KC,{children:[e.typography.size,` / `,e.typography.lineHeight]}),(0,I.jsx)(GC,{name:e.typography.sizeToken})]}),(0,I.jsx)(WC,{label:`Weight`,children:(0,I.jsx)(KC,{children:e.typography.weight})}),e.typography.letterSpacing===`normal`?null:(0,I.jsx)(WC,{label:`Tracking`,children:(0,I.jsx)(KC,{children:e.typography.letterSpacing})}),(0,I.jsx)(qC,{label:`Color`,color:e.typography.color}),e.typography.align===`start`?null:(0,I.jsx)(WC,{label:`Align`,children:(0,I.jsx)(KC,{children:e.typography.align})}),e.typography.transform?(0,I.jsx)(WC,{label:`Transform`,children:(0,I.jsx)(KC,{children:e.typography.transform})}):null]}):null,Object.values(e.appearance).some(Boolean)?(0,I.jsxs)(UC,{title:`Appearance`,children:[e.appearance.background?(0,I.jsx)(qC,{label:`Background`,color:e.appearance.background}):null,e.appearance.backgroundImage?(0,I.jsx)(WC,{label:`Image`,children:(0,I.jsx)(KC,{title:e.appearance.backgroundImage,children:e.appearance.backgroundImage})}):null,e.appearance.border?(0,I.jsxs)(WC,{label:`Border`,children:[(0,I.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:e.appearance.border.color.css}}),(0,I.jsxs)(KC,{children:[e.appearance.border.width,` `,e.appearance.border.style,` `,e.appearance.border.color.value]}),(0,I.jsx)(GC,{name:e.appearance.border.color.token})]}):null,e.appearance.radius?(0,I.jsxs)(WC,{label:`Radius`,children:[(0,I.jsx)(KC,{children:e.appearance.radius.value}),(0,I.jsx)(GC,{name:e.appearance.radius.token})]}):null,e.appearance.shadow?(0,I.jsxs)(WC,{label:`Shadow`,children:[(0,I.jsx)(KC,{title:e.appearance.shadow.value,children:e.appearance.shadow.value}),(0,I.jsx)(GC,{name:e.appearance.shadow.token})]}):null,e.appearance.opacity?(0,I.jsx)(WC,{label:`Opacity`,children:(0,I.jsx)(KC,{children:e.appearance.opacity})}):null]}):null,e.classes.length?(0,I.jsx)(UC,{title:`Classes`,right:(0,I.jsx)(`button`,{type:`button`,onClick:()=>void AC(e.classes.join(` `),`Classes copied`),className:`cursor-pointer border-0 bg-transparent text-[12px] text-muted hover:text-ink2`,children:`Copy`}),children:(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1 px-4 pb-1`,children:e.classes.map(e=>(0,I.jsx)(`span`,{className:`rounded-[4px] bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2`,children:e},e))})}):null,e.attributes.length?(0,I.jsx)(UC,{title:`Attributes`,children:e.attributes.map(([e,t])=>(0,I.jsx)(WC,{label:e,children:(0,I.jsx)(KC,{title:t,children:t})},e))}):null,e.children.length?(0,I.jsx)(UC,{title:`Children · ${e.children.length}`,children:(0,I.jsx)(`div`,{className:`flex flex-col px-2 pb-1`,children:e.children.map((e,n)=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`flex h-7 cursor-pointer items-center gap-2 rounded-[6px] border-0 bg-transparent px-2 text-left font-mono text-[12px] text-ink2 hover:bg-soft2`,children:[(0,I.jsx)(Z,{name:`chevron-right`,size:12,className:`text-muted`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.label})]},n))})}):null]}):(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-6 py-10 text-center`,children:[(0,I.jsx)(Z,{name:`pointer`,size:22,className:`text-muted`}),(0,I.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:r?`Click an element in any screen.`:`Hold ${C_} to highlight, click to inspect.`}),(0,I.jsx)(`span`,{className:`text-[12.5px] leading-[1.5] text-muted`,children:`Hover shows margin, padding and content. Clicks go to the inspector, not the screen.`}),(0,I.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-[12px] text-muted`,children:[(0,I.jsx)(__,{children:`I`}),` toggle · hold `,(0,I.jsx)(__,{children:C_}),` · `,(0,I.jsx)(__,{children:`esc`}),` clear`]})]}),e?(0,I.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-rule bg-soft px-4 py-2.5`,children:(0,I.jsx)(O_,{icon:`copy`,onClick:()=>void AC(e.css,`CSS copied`),className:`grow`,children:`Copy CSS`})}):null]})}var $C={neutral:`bg-soft2 text-ink2`,action:`bg-action-soft text-action`,ok:`bg-ok-soft text-ok-text`,danger:`bg-danger-soft text-danger-text`};function ew({tone:e=`neutral`,children:t,className:n}){return(0,I.jsx)(`span`,{className:X(`inline-flex h-[22px] shrink-0 items-center gap-1 whitespace-nowrap rounded-[6px] px-2 text-[12px] font-medium`,$C[e],n),children:t})}function tw({value:e,tone:t=`neutral`}){return(0,I.jsx)(`span`,{className:X(`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-[4px] px-[5px] text-[11.5px] font-semibold tabular`,t===`action`?`bg-action-soft text-action`:t===`danger`?`bg-danger-soft text-danger-text`:`bg-soft2 text-ink2`),children:e})}function nw({children:e,className:t,style:n}){return(0,I.jsx)(`section`,{className:X(`min-w-0 shrink-0 overflow-hidden rounded-[10px] border border-rule bg-surface`,t),style:n,children:e})}function rw({title:e,count:t,sub:n,right:r,as:i=`h2`}){return(0,I.jsxs)(`div`,{className:`flex min-h-[46px] items-center justify-between gap-3 px-4`,children:[(0,I.jsxs)(i,{className:`m-0 flex min-w-0 items-center gap-2 whitespace-nowrap text-[14px] font-semibold`,children:[e,t===void 0?null:(0,I.jsx)(tw,{value:t}),n?(0,I.jsx)(`span`,{className:`truncate text-[12.5px] font-normal text-muted`,children:n}):null]}),r?(0,I.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function iw({items:e,value:t,onChange:n,right:r}){let i=(0,v.useId)();return(0,I.jsxs)(`div`,{className:`flex h-[46px] items-center justify-between gap-3 px-4`,children:[(0,I.jsx)(`div`,{role:`tablist`,className:`flex gap-5`,children:e.map(e=>{let r=e.value===t;return(0,I.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.value),className:X(`relative flex h-[46px] cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0.5 text-[14px] transition-colors`,r?`font-semibold text-ink`:`font-medium text-ink2 hover:text-ink`),children:[e.label,e.count===void 0?null:(0,I.jsx)(tw,{value:e.count}),r?(0,I.jsx)(Wf.span,{layoutId:i,className:`absolute inset-x-0 bottom-0 h-[2px] bg-ink`,transition:{type:`spring`,stiffness:520,damping:42}}):null]},e.value)})}),r?(0,I.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function aw({align:e,children:t}){return(0,I.jsx)(`div`,{className:X(`flex min-w-0 items-center gap-2`,e===`r`&&`justify-end text-right`,e===`c`&&`justify-center`),children:t})}function ow(e,t){return v.Children.toArray(e).map((e,n)=>(0,I.jsx)(aw,{align:t?.[n]??`l`,children:e},n))}function sw({cols:e,align:t,labels:n}){return(0,I.jsx)(`div`,{className:`grid h-8 items-center gap-x-4 border-t border-rule bg-soft px-4 text-[12.5px] text-muted`,style:{gridTemplateColumns:e},children:n.map((e,n)=>(0,I.jsx)(aw,{align:t?.[n]??`l`,children:(0,I.jsx)(`span`,{className:`whitespace-nowrap`,children:e})},n))})}var cw=(e,t,n)=>X(`grid items-center gap-x-4 border-rule`,!e&&`border-t`,t&&`cursor-pointer transition-colors hover:bg-soft`,n);function lw({cols:e,align:t,minH:n=44,pad:r=`10px 16px`,children:i,first:a,className:o,onClick:s,title:c}){return(0,I.jsx)(`div`,{className:cw(a,!!s,o),style:{gridTemplateColumns:e,minHeight:n,padding:r},onClick:s,title:c,children:ow(i,t)})}function uw({to:e,cols:t,align:n,minH:r=44,pad:i=`10px 16px`,first:a,className:o,children:s}){return(0,I.jsx)(xe,{href:e,className:X(cw(a,!0,o),`text-inherit no-underline`),style:{gridTemplateColumns:t,minHeight:r,padding:i},children:ow(s,n)})}function dw({label:e,children:t,labelWidth:n=180,minH:r=40,end:i=!1}){return(0,I.jsxs)(`div`,{className:`grid content-center items-baseline gap-x-4 border-t border-rule px-4 py-2`,style:{gridTemplateColumns:`${n}px minmax(0, 1fr)`,minHeight:r},children:[(0,I.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,I.jsx)(`div`,{className:X(`flex min-w-0 flex-wrap items-center gap-2`,i&&`justify-end`),children:t})]})}function fw({children:e,pad:t=`16px`,gap:n=16,top:r=!0,className:i}){return(0,I.jsx)(`div`,{className:X(`flex flex-col`,r&&`border-t border-rule`,i),style:{padding:t,gap:n},children:e})}function pw({issues:e,className:t}){return(0,I.jsx)(`div`,{className:X(`flex flex-col`,t),children:e.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5 border-t border-rule px-4 py-2.5 text-[13px] first:border-t-0`,children:[(0,I.jsx)(Z,{name:e.severity===`error`?`alert`:`info`,size:15,className:X(`mt-0.5`,e.severity===`error`?`text-danger-text`:`text-action`)}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`text-ink`,children:e.message}),(0,I.jsxs)(`span`,{className:`font-mono text-[12px] break-all text-muted`,children:[e.file,e.at?` · ${e.at}`:``]})]})]},t))})}function mw({issues:e,title:t=`Problems`}){if(!e.length)return null;let n=e.filter(e=>e.severity===`error`).length;return(0,I.jsxs)(nw,{className:n?`border-danger/40`:void 0,children:[(0,I.jsx)(rw,{title:t,count:e.length,sub:n?`${n} blocking`:`warnings`}),(0,I.jsx)(`div`,{className:`border-t border-rule`,children:(0,I.jsx)(pw,{issues:e})})]})}var hw=[.2,.7,.2,1];function gw({open:e,side:t,width:n,children:r}){return(0,I.jsx)(ed,{initial:!1,children:e?(0,I.jsx)(Wf.div,{initial:{width:0,opacity:.6},animate:{width:n,opacity:1},exit:{width:0,opacity:.6},transition:{duration:.22,ease:hw},className:X(`flex min-h-0 shrink-0 overflow-hidden`,t===`right`?`justify-start`:`justify-end`),children:(0,I.jsx)(`div`,{className:`flex min-h-0 shrink-0`,style:{width:n},children:r})},`panel`):null})}function _w({children:e,className:t,gap:n=20,wide:r=!1}){return(0,I.jsx)(`main`,{className:X(`mx-auto flex w-full min-h-0 grow flex-col px-8 pt-6 pb-7 animate-[q-fade-in_160ms_ease-out] max-md:px-4 max-md:pt-4`,r?`max-w-[1440px]`:`max-w-[1200px]`,t),style:{gap:n},children:e})}function vw({title:e,sub:t,right:n,badge:r,crumbs:i}){return(0,I.jsxs)(`div`,{className:`flex shrink-0 items-end justify-between gap-6 max-md:flex-col max-md:items-stretch max-md:gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[i?(0,I.jsx)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted`,children:i}):null,(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`h1`,{className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:e}),r]}),t?(0,I.jsx)(`div`,{className:`text-[13px] text-muted`,children:t}):null]}),n?(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n}):null]})}function yw({items:e,label:t}){return(0,I.jsx)(`nav`,{"aria-label":t,className:`flex flex-col gap-0.5`,children:e.map(e=>(0,I.jsxs)(xe,{href:e.to,className:e=>X(`flex h-8 items-center gap-2 whitespace-nowrap rounded-[6px] px-3 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,e?`bg-soft2 font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),e.hint?(0,I.jsx)(`span`,{className:`ml-auto text-[12px] font-normal text-muted`,children:e.hint}):null]},e.to))})}function bw({children:e}){return(0,I.jsx)(`div`,{className:`px-3 pt-4 pb-1 text-[12px] text-muted`,children:e})}function xw({title:e,text:t,action:n}){return(0,I.jsxs)(nw,{className:`flex w-[480px] max-w-full flex-col items-center gap-2 px-6 py-8 text-center`,children:[(0,I.jsx)(`h1`,{className:`m-0 text-[16px] font-semibold`,children:e}),t?(0,I.jsx)(`div`,{className:`m-0 max-w-[400px] text-[14px] text-ink2`,children:t}):null,n?(0,I.jsx)(`div`,{className:`mt-3 flex flex-wrap justify-center gap-2`,children:n}):null]})}function Sw(e){return(0,I.jsx)(`div`,{className:`flex min-h-[50vh] grow items-center justify-center p-6 max-md:px-4`,children:(0,I.jsx)(xw,{...e})})}function Cw({title:e=`Nothing here`,text:t}){let n=!!Jg().scope;return(0,I.jsx)(Sw,{title:e,text:t??`This address does not match a canvas or a page of the design system.`,action:n?void 0:(0,I.jsx)(M_,{to:`/`,children:`All canvases`})})}var ww=.1,Tw=(e,t=ww)=>Math.min(8,Math.max(t,e)),Ew=class{camera={x:0,y:0,z:1};minZoom=ww;listeners=new Set;animation=0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}set(e){this.camera={x:e.x,y:e.y,z:Tw(e.z,this.minZoom)};for(let e of this.listeners)e(this.camera)}interrupt(){cancelAnimationFrame(this.animation),this.animation=0}panBy(e,t){this.interrupt();let{x:n,y:r,z:i}=this.camera;this.set({x:n+e,y:r+t,z:i})}zoomAt(e,t,n){this.interrupt();let{x:r,y:i,z:a}=this.camera,o=Tw(a*n,this.minZoom),s=(e-r)/a,c=(t-i)/a;this.set({x:e-s*o,y:t-c*o,z:o})}animateTo(e,t=320){this.interrupt();let n={...this.camera},r={...e,z:Tw(e.z,this.minZoom)};if(t<=0||matchMedia(`(prefers-reduced-motion: reduce)`).matches){this.set(r);return}let i=performance.now(),a=e=>{let o=Math.min(1,(e-i)/t),s=1-(1-o)**3,c=n.z*(r.z/n.z)**s,l=n.z===r.z?s:(c-n.z)/(r.z-n.z);this.set({x:n.x+(r.x-n.x)*l,y:n.y+(r.y-n.y)*l,z:c}),this.animation=o<1?requestAnimationFrame(a):0};this.animation=requestAnimationFrame(a)}toWorld(e,t){let{x:n,y:r,z:i}=this.camera;return{x:(e-n)/i,y:(t-r)/i}}};function Dw(e,t,n,r=72,i=1,a=ww){let o=Tw(Math.min((t-r*2)/Math.max(e.w,1),(n-r*2)/Math.max(e.h,1),i),a),s=(e,t,n)=>t*o<=n-r*2?n/2-(e+t/2)*o:r-e*o;return{z:o,x:s(e.x,e.w,t),y:s(e.y,e.h,n)}}function Ow(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function kw({items:e,value:t,onChange:n,label:r,stretch:i,size:a=`ctrl`}){let o=(0,v.useId)();return(0,I.jsx)(`div`,{role:`group`,"aria-label":r,className:X(`shrink-0 items-center gap-0.5 rounded-[6px] bg-track p-[3px]`,a===`ctrl`?`h-ctrl`:`h-7`,i?`flex`:`inline-flex`),children:e.map(e=>{let r=e.value===t;return(0,I.jsxs)(`button`,{type:`button`,"aria-pressed":r,title:e.title,onClick:()=>n(e.value),className:X(`relative flex h-full cursor-pointer items-center justify-center whitespace-nowrap rounded-[4px] border-0 bg-transparent font-medium transition-colors`,a===`ctrl`?`px-2.5 text-ctrl`:`px-2 text-[12.5px]`,i&&`flex-1`,r?`text-ink`:`text-muted hover:text-ink2`),children:[r?(0,I.jsx)(Wf.span,{layoutId:o,className:`absolute inset-0 rounded-[4px] bg-surface shadow-[0_1px_2px_rgba(0,0,0,0.10)]`,transition:{type:`spring`,stiffness:520,damping:42}}):null,(0,I.jsx)(`span`,{className:`relative flex items-center gap-1.5`,children:e.label})]},e.value)})})}var Aw=Object.defineProperty,jw=(e,t)=>Aw(e,`name`,{value:t,configurable:!0}),Mw=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Nw=v.forwardRef(jw(function(e,t){return(0,I.jsx)(Wp.span,{...e,ref:t,style:{...Mw,...e.style}})},`VisuallyHidden`)),Pw=Object.defineProperty,Fw=(e,t)=>Pw(e,`name`,{value:t,configurable:!0}),[Iw,Lw]=ap(`Tooltip`,[hb]),Rw=hb(),zw=`TooltipProvider`,Bw=700,Vw=`tooltip.open`,[Hw,Uw]=Iw(zw),Ww=Fw(e=>{let{__scopeTooltip:t,delayDuration:n=Bw,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Hw,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Gw=`Tooltip`,[Kw,qw]=Iw(Gw),Jw=Fw(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Uw(Gw,e.__scopeTooltip),l=Rw(t),[u,d]=v.useState(null),[f,p]=v.useState(void 0),m=fp(),h=v.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,y=v.useRef(!1),[b,x]=xp({prop:r,defaultProp:i??!1,onChange:Fw(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Vw))):c.onClose(),a?.(e)},`onChange`),caller:Gw}),S=v.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},_)},[_,x]);v.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,I.jsx)(Ob,{...l,children:(0,I.jsx)(Kw,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:v.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Yw=`TooltipTrigger`,Xw=v.forwardRef(Fw(function(e,t){let{__scopeTooltip:n,...r}=e,i=qw(Yw,n),a=Uw(Yw,n),o=Rw(n),s=tp(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(kb,{asChild:!0,...o,children:(0,I.jsx)(Wp.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Y(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Y(e.onBlur,i.onClose),onClick:Y(e.onClick,i.onClose)})})},`TooltipTrigger`)),Zw=`TooltipPortal`,[Qw,$w]=Iw(Zw,{forceMount:void 0}),eT=Fw(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=qw(Zw,t);return(0,I.jsx)(Qw,{scope:t,forceMount:n,children:(0,I.jsx)(jm,{present:n||a.open,children:(0,I.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),tT=`TooltipContent`,nT=v.forwardRef(Fw(function(e,t){let n=$w(tT,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=qw(tT,e.__scopeTooltip);return(0,I.jsx)(jm,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(aT,{side:i,...a,ref:t}):(0,I.jsx)(rT,{side:i,...a,ref:t})})},`TooltipContent`)),rT=v.forwardRef(Fw(function(e,t){let n=qw(tT,e.__scopeTooltip),r=Uw(tT,e.__scopeTooltip),i=v.useRef(null),a=tp(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=sT(r,oT(r,n.getBoundingClientRect())),a=cT(t.getBoundingClientRect()),o=uT([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=Fw(e=>p(e,u),`handleTriggerLeave`),t=Fw(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=Fw(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!lT(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(aT,{...e,ref:a})},`TooltipContentHoverable`)),iT=jp(`TooltipContent`),aT=v.forwardRef(Fw(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=qw(tT,n),u=Rw(n),{onClose:d}=l;v.useEffect(()=>(document.addEventListener(Vw,d),()=>document.removeEventListener(Vw,d)),[d]),v.useEffect(()=>{if(l.trigger){let e=Fw(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return sp(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,I.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,I.jsxs)(Ab,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,I.jsx)(iT,{children:r}),i?(0,I.jsx)(Nw,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function oT(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Fw(oT,`getExitSideFromRect`);function sT(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Fw(sT,`getPaddedExitPoints`);function cT(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Fw(cT,`getPointsFromRect`);function lT(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Fw(lT,`isPointInPolygon`);function uT(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),dT(t)}Fw(uT,`getHull`);function dT(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Fw(dT,`getHullPresorted`);var fT=Ww,pT=Jw,mT=Xw,hT=eT,gT=nT;function _T({children:e}){return(0,I.jsx)(fT,{delayDuration:250,children:e})}var vT=`z-50 max-w-[280px] rounded-[8px] border border-rule bg-surface px-[10px] py-[7px] text-[12.5px] leading-[1.35] text-ink shadow-pop outline-none data-[state=delayed-open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`;function yT({content:e,children:t,side:n=`top`,align:r=`center`,className:i}){return(0,I.jsxs)(pT,{children:[(0,I.jsx)(mT,{asChild:!0,children:t}),(0,I.jsx)(hT,{children:(0,I.jsx)(gT,{side:n,align:r,sideOffset:6,collisionPadding:12,className:X(vT,i),children:e})})]})}var bT=(e,t,n)=>`/c/${encodeURIComponent(e)}/full/${encodeURIComponent(t)}?theme=${n}`;function xT(e,t,n){let{frameSandbox:r}=Jg(),{base:i}=fe();return t?t.kind===`url`?t.url:zC(r?`${i}${bT(e,t.id,t.theme??n)}`:RC(t.url,t.theme??n)):null}function ST({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=Qg(e),[,a]=N(),{frameSandbox:o}=Jg(),s=h_(),c=(0,v.useRef)(null),l=new URLSearchParams(window.location.search).get(`theme`),u=n?n.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`))):[],d=u.find(e=>e.id===t),f=(d?.kind===`screen`?d.theme:void 0)??(l===`light`||l===`dark`?l:n?.theme??s),p=d?d.kind===`screen`?RC(d.url,f):d.url:``,m=`/c/${encodeURIComponent(e)}`;return(0,v.useEffect)(()=>{d&&(document.title=`${d.title} · ${n?.title??``}`)},[d,n?.title]),(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a(m)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a,m]),(0,v.useEffect)(()=>{let t=c.current;if(t&&d?.kind===`screen`)return MC(t,t=>{if(t.type===`keydown`&&t.code===`Escape`)a(m);else if(t.type===`go`){let n=t.target.includes(`/`)?t.target.split(`/`)[1]:t.target;u.some(e=>e.id===n)&&a(bT(e,n,f),{replace:!0})}else t.type===`link`&&n&&BC(t,n,t=>a(bT(e,t,f),{replace:!0}))})},[p,d?.kind]),r?(0,I.jsx)(Cw,{title:`Canvas not found`,text:r.message}):i||!n?(0,I.jsx)(`div`,{className:`h-dvh bg-surface`}):d?(0,I.jsxs)(`div`,{className:`group fixed inset-0 bg-surface`,children:[(0,I.jsx)(`iframe`,{ref:c,src:p,title:d.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:o,className:`block h-full w-full border-0`,style:{colorScheme:f},onLoad:()=>d.kind===`screen`&&FC(c.current,f)},`${d.id}:${d.kind===`screen`?d.rev:d.url}`),(0,I.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 flex justify-end p-3 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100`,children:(0,I.jsxs)(xe,{href:m,className:`pointer-events-auto flex h-8 items-center gap-2 rounded-[8px] border border-rule bg-surface px-3 text-[12.5px] text-ink2 no-underline shadow-pop hover:text-ink`,children:[(0,I.jsx)(Z,{name:`x`,size:14}),`Back to `,n.title,(0,I.jsx)(__,{children:`esc`})]})})]}):(0,I.jsx)(Cw,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`})}function CT(e){return e.kind===`note`?`note`:e.kind===`image`?`image`:e.kind===`url`?`globe`:e.frame.width<600?`smartphone`:e.frame.width<1100?`tablet`:`monitor`}function wT(e,t){return`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(t.id)}`}function TT({canvas:e,page:t,store:n,onPick:r}){let i=o_(n,e=>e.selected),a=o_(n,e=>e.frames);return(0,I.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[264px] shrink-0 flex-col overflow-hidden border-r border-rule bg-surface`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-rule px-4 py-3.5`,children:[(0,I.jsx)(`div`,{className:`truncate text-[14px] font-semibold`,children:e.title}),e.description?(0,I.jsx)(`div`,{className:`line-clamp-3 text-[12.5px] leading-[1.45] text-muted`,children:e.description}):null]}),(0,I.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto pb-4`,children:[e.pages.length>1?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:`Pages`}),(0,I.jsx)(`nav`,{className:`flex flex-col gap-0.5 px-2`,children:e.pages.map(n=>{let r=n.sections.reduce((e,t)=>e+t.items.filter(e=>e.kind===`screen`||e.kind===`url`).length,0);return(0,I.jsxs)(xe,{href:wT(e,n),className:X(`flex h-8 items-center gap-2 rounded-[6px] px-2.5 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,n.id===t.id?`bg-soft2 font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[(0,I.jsx)(Z,{name:`file`,size:15,className:`text-muted`}),(0,I.jsx)(`span`,{className:`min-w-0 grow truncate`,children:n.title}),(0,I.jsx)(`span`,{className:`text-[12px] text-muted tabular`,children:r})]},n.id)})})]}):null,(0,I.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.pages.length>1?t.title:`Layers`}),(0,I.jsx)(`div`,{className:`flex flex-col px-2`,children:t.sections.map(e=>(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[e.title?(0,I.jsxs)(`div`,{className:`flex h-7 items-center gap-2 px-2.5 pt-1 text-[12px] font-medium text-ink2`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.title}),(0,I.jsx)(tw,{value:e.items.length})]}):null,e.items.map(t=>{let n=(a[t.id]?.errors.length??0)>0||t.kind===`screen`&&t.missing;return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(t.id),className:X(`flex h-8 w-full cursor-pointer items-center gap-2 rounded-[6px] border-0 px-2.5 text-left text-[13px] transition-colors focus-visible:outline-offset-[-2px]`,e.title&&`pl-4`,i===t.id?`bg-action-soft text-ink`:`bg-transparent text-ink2 hover:bg-soft2`),children:[(0,I.jsx)(Z,{name:CT(t),size:15,className:`text-muted`}),(0,I.jsx)(`span`,{className:`min-w-0 grow truncate`,children:t.title||(t.kind===`note`?`Note`:t.id)}),n?(0,I.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`}):null]},t.id)})]},e.id))})]})]})}function ET({canvas:e,page:t,theme:n,onTheme:r,sidebar:i,onSidebar:a,onPlay:o,canPlay:s,inspect:c,onInspect:l}){let[,u]=N(),{slots:d,scope:f}=Jg();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(JS,{children:[d.barStart,d.brand?d.brand:f?(0,I.jsx)(KS,{}):(0,I.jsx)(yT,{content:`All canvases`,children:(0,I.jsx)(xe,{href:`/`,className:`flex items-center`,"aria-label":`All canvases`,children:(0,I.jsx)(KS,{})})}),(0,I.jsx)(j_,{icon:`panel-left`,label:i?`Hide sidebar (⌘\\)`:`Show sidebar (⌘\\)`,onClick:()=>a(!i)}),(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-[14px]`,children:[(0,I.jsx)(`span`,{className:`truncate font-semibold`,children:e.title}),t&&e.pages.length>1?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Z,{name:`chevron-right`,size:14,className:`shrink-0 text-muted`}),(0,I.jsxs)(zS,{width:240,trigger:(0,I.jsxs)(`button`,{type:`button`,className:`flex h-ctrl cursor-pointer items-center gap-1 rounded-[6px] border-0 bg-transparent px-2 text-[14px] text-ink2 hover:bg-soft2`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:t.title}),(0,I.jsx)(Z,{name:`chevron-down`,size:14,className:`text-muted`})]}),children:[(0,I.jsx)(US,{children:`Pages`}),e.pages.map(n=>(0,I.jsxs)(VS,{active:n.id===t.id,onSelect:()=>u(wT(e,n)),children:[(0,I.jsx)(Z,{name:`file`,size:15,className:`text-muted`}),n.title]},n.id))]})]}):null]}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,I.jsx)(kw,{label:`Screen theme`,value:n,onChange:r,items:[{value:`light`,label:(0,I.jsx)(Z,{name:`sun`,size:15}),title:`Light screens`},{value:`dark`,label:(0,I.jsx)(Z,{name:`moon`,size:15}),title:`Dark screens`}]}),(0,I.jsx)(OT,{on:c,onChange:l}),(0,I.jsx)(O_,{kind:`secondary`,icon:`play`,onClick:o,disabled:!s,children:`Play`}),(0,I.jsx)(T_,{width:200,label:`Search`}),(0,I.jsx)(GS,{}),d.barEnd]})]}),d.belowBar]})}function DT({canvas:e,store:t,layoutItems:n,theme:r,onPlay:i,inspect:a}){let o=o_(t,e=>e.selected),s=o_(t,e=>e.active),c=o_(t,e=>o?e.frames[o]:void 0),l=n.find(e=>e.id===o),u=xT(e.id,l?.kind===`screen`||l?.kind===`url`?l:void 0,r);if(!l)return null;let d=l.kind===`screen`||l.kind===`url`,f=()=>IC(document.querySelector(`[data-item="${CSS.escape(l.id)}"] iframe`)),p=c?.errors??[];return(0,I.jsx)(`div`,{"data-ui":!0,className:`pointer-events-none absolute inset-x-0 bottom-5 z-20 flex justify-center px-4`,children:(0,I.jsxs)(`div`,{className:`pointer-events-auto flex max-w-full flex-col overflow-hidden rounded-[10px] border border-rule bg-surface shadow-pop animate-[q-pop_120ms_ease-out]`,children:[p.length?(0,I.jsxs)(`div`,{className:`flex max-h-40 items-start gap-2 overflow-y-auto border-b border-rule bg-danger-soft px-3.5 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,I.jsx)(Z,{name:`alert`,size:14,className:`mt-px`}),(0,I.jsx)(`span`,{className:`min-w-0`,children:p.join(`
58
- `)})]}):null,(0,I.jsxs)(`div`,{className:`flex h-[44px] items-center gap-1 pr-1.5 pl-3.5`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pr-2`,children:[(0,I.jsx)(`span`,{className:`truncate text-[13.5px] font-medium`,children:l.title||l.id}),d&&s===l.id?(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[12px] text-muted`,children:[(0,I.jsx)(Z,{name:`pointer`,size:13}),` `,a?`Inspecting`:`Interacting`,` `,(0,I.jsx)(__,{children:`esc`})]}):d?(0,I.jsx)(`span`,{className:`shrink-0 text-[12px] text-muted`,children:a?`Click an element to inspect it`:`Click the screen to interact`}):null]}),d?(0,I.jsx)(yT,{content:(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Play `,(0,I.jsx)(__,{children:`↵`})]}),children:(0,I.jsx)(j_,{icon:`play`,label:`Play`,onClick:()=>i(l.id)})}):null,u?(0,I.jsx)(yT,{content:`Open in a new tab`,children:(0,I.jsx)(`a`,{href:u,target:`_blank`,rel:`noreferrer`,"aria-label":`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,I.jsx)(Z,{name:`external`,size:16})})}):null,d?(0,I.jsx)(yT,{content:`Reload`,children:(0,I.jsx)(j_,{icon:`refresh`,label:`Reload`,onClick:f})}):null,l.kind===`screen`?(0,I.jsx)(yT,{content:`Copy source path`,children:(0,I.jsx)(j_,{icon:`copy`,label:`Copy source path`,onClick:()=>void AC(l.file,`Path copied`)})}):null,(0,I.jsx)(yT,{content:(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Zoom to `,(0,I.jsx)(__,{children:`⇧2`})]}),children:(0,I.jsx)(j_,{icon:`fit`,label:`Zoom to`,onClick:()=>window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:l.id}}))})})]})]})})}function OT({on:e,onChange:t}){return(0,I.jsx)(yT,{content:(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Inspect elements `,(0,I.jsx)(__,{children:`I`})]}),children:(0,I.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:()=>t(!e),className:e?`inline-flex h-ctrl cursor-pointer items-center gap-1.5 rounded-[6px] border border-action-line bg-action-soft px-ctrl text-ctrl font-medium text-action`:`inline-flex h-ctrl cursor-pointer items-center gap-1.5 rounded-[6px] border border-rule-strong bg-surface px-ctrl text-ctrl font-medium text-ink hover:bg-soft`,children:[(0,I.jsx)(Z,{name:`pointer`,size:15}),`Inspect`]})})}var kT=280,AT=96,jT=150,MT=110,NT=720,PT=e=>e.kind===`screen`||e.kind===`url`;function FT(e,t){let n=t[e.id];if(e.kind===`screen`||e.kind===`url`){let t=e.frame.width;if(e.frame.height!==`auto`)return{w:t,h:e.frame.height};let r=e.kind===`screen`?e.measuredHeight:void 0;return{w:t,h:n?.h??r??900}}if(e.kind===`note`)return{w:e.width,h:n?.h??Math.max(80,Math.ceil(e.text.length/38)*26+40)};let r=e.width??n?.w??480;return{w:r,h:n?.w?n.h/n.w*r:n?.h??r*.62}}function IT(e,t){return!e.title&&!e.description?0:t[`section:${e.id}`]?.h??(e.title?56:0)+(e.description?60:0)}function LT(e,t){let n=[],r=[];if(e.layout===`free`){let r=0;for(let i of e.sections)for(let e of i.items){let{w:a,h:o}=FT(e,t),s=e.x??r,c=e.y??0;r=Math.max(r,s+a+AT),n.push({item:e,section:i,x:s,y:c,w:a,h:o})}}else{let i=0;for(let a of e.sections){let e=IT(a,t),o=i,s=i+(e?e+MT:0),c=0,l=0,u=0,d=0;for(let e of a.items){a.columns&&d===a.columns&&(s+=l+jT,c=0,l=0,d=0);let{w:r,h:i}=FT(e,t);n.push({item:e,section:a,x:c,y:s,w:r,h:i}),c+=r+AT,u=Math.max(u,c-AT),l=Math.max(l,i),d++}let f=s+l;r.push({section:a,x:0,y:o,w:Math.max(u,e?NT:0),h:f-o,header:e}),i=f+kT}}let i=0,a=0,o=0,s=0,c=[...n,...r];return c.length&&(i=Math.min(...c.map(e=>e.x)),a=Math.min(...c.map(e=>e.y)),o=Math.max(...c.map(e=>e.x+e.w)),s=Math.max(...c.map(e=>e.y+e.h))),{items:n,sections:r,bounds:{x:i,y:a,w:o-i,h:s-a}}}function RT(e){return e.items.filter(e=>PT(e.item))}function zT(){return new a_({selected:null,active:null,hovered:null,sizes:{},frames:{},live:[],panning:!1,zoomTiny:!1,frameEls:{},inspecting:!1})}function BT(e,t,n){e.set(e=>{let r=e.sizes[t];return r&&Math.abs(r.h-n.h)<1&&r.w===n.w?e:{...e,sizes:{...e.sizes,[t]:n}}})}function VT(e,t,n){e.set(e=>{let r=e.frames[t]??{ready:!1,errors:[]};return{...e,frames:{...e.frames,[t]:{...r,...n}}}})}function HT(e,t,n){e.set(e=>e.frameEls[t]===n?e:{...e,frameEls:{...e.frameEls,[t]:n}})}function UT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var WT=UT();function GT(e){WT=e}var KT={exec:()=>null};function qT(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function $(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(YT.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var JT=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),YT={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:qT(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:qT(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:qT(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:qT(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:qT(e=>RegExp(`^ {0,${e}}(?:</?(?:${uE})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:qT(e=>RegExp(`^ {0,${e}}>`))},XT=/^(?:[ \t]*(?:\n|$))+/,ZT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,QT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$T=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tE=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,nE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rE=$(nE).replace(/bull/g,tE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),iE=$(nE).replace(/bull/g,tE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),aE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,oE=/^[^\n]+/,sE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,cE=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,sE).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lE=$(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,tE).getRegex(),uE=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,dE=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fE=$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,dE).replace(`tag`,uE).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pE=e=>$(aE).replace(`hr`,$T).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,uE).getRegex(),mE=pE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),hE=pE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),gE={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,hE).getRegex(),code:ZT,def:cE,fences:QT,heading:eE,hr:$T,html:fE,lheading:rE,list:lE,newline:XT,paragraph:mE,table:KT,text:oE},_E=$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,$T).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,uE).getRegex(),vE={...gE,lheading:iE,table:_E,paragraph:$(aE).replace(`hr`,$T).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,_E).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,uE).getRegex()},yE={...gE,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,dE).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:KT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(aE).replace(`hr`,$T).replace(`heading`,` *#{1,6} *[^
59
- ]`).replace(`lheading`,rE).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},bE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,SE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,CE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wE=/[\p{P}\p{S}]/u,TE=/[\s\p{P}\p{S}]/u,EE=/[^\s\p{P}\p{S}]/u,DE=$(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,TE).getRegex(),OE=/[\p{Pi}\p{Ps}"']/u,kE=/(?!~)[\p{P}\p{S}]/u,AE=/(?!~)[\s\p{P}\p{S}]/u,jE=/(?:[^\s\p{P}\p{S}]|~)/u,ME=$(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,JT?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),NE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,PE=$(NE,`u`).replace(/punct/g,wE).getRegex(),FE=$(NE,`u`).replace(/punct/g,kE).getRegex(),IE=$(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,OE).replace(/punct/g,wE).getRegex(),LE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,RE=$(LE,`gu`).replace(/notPunctSpace/g,EE).replace(/punctSpace/g,TE).replace(/punct/g,wE).getRegex(),zE=$(LE,`gu`).replace(/notPunctSpace/g,jE).replace(/punctSpace/g,AE).replace(/punct/g,kE).getRegex(),BE=$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,EE).replace(/punctSpace/g,TE).replace(/punct/g,wE).getRegex(),VE=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,EE).replace(/punctSpace/g,TE).replace(/punct/g,wE).getRegex(),HE=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,EE).replace(/punctSpace/g,TE).replace(/punct/g,wE).getRegex(),UE=$(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,wE).getRegex(),WE=$(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,EE).replace(/punctSpace/g,TE).replace(/punct/g,wE).getRegex(),GE=$(/\\(punct)/,`gu`).replace(/punct/g,wE).getRegex(),KE=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),qE=$(dE).replace(`(?:-->|$)`,`-->`).getRegex(),JE=$(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,qE).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),YE=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,XE=$(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,YE).getRegex(),ZE=$(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,XE).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),QE=$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,XE).replace(`ref`,sE).getRegex(),$E=$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,sE).getRegex(),eD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,tD=$(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,YE).getRegex(),nD=$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,tD).replace(`ref`,eD).getRegex()).replace(`nolink`,$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,eD).getRegex()).getRegex(),rD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,iD=$(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),aD={_backpedal:KT,anyPunctuation:GE,autolink:KE,blockSkip:ME,br:SE,code:xE,del:KT,delLDelim:KT,delRDelim:KT,emStrongLDelim:PE,emStrongRDelimAst:RE,emStrongRDelimUnd:VE,escape:bE,link:ZE,nolink:$E,punctuation:DE,reflink:QE,reflinkSearch:nD,tag:JE,text:CE,url:KT},oD={...aD,emStrongLDelim:IE,emStrongRDelimAst:BE,emStrongRDelimUnd:HE,link:$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,XE).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,XE).getRegex()},sD={...aD,emStrongRDelimAst:zE,emStrongLDelim:FE,delLDelim:UE,delRDelim:WE,url:$(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,iD).replace(`protocol`,rD).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,rD).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},cD={...sD,br:$(SE).replace(`{2,}`,`*`).getRegex(),text:$(sD.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},lD={normal:gE,gfm:vE,pedantic:yE},uD={normal:aD,gfm:sD,breaks:cD,pedantic:oD},dD={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},fD=e=>dD[e];function pD(e,t){if(t){if(YT.escapeTest.test(e))return e.replace(YT.escapeReplace,fD)}else if(YT.escapeTestNoEncode.test(e))return e.replace(YT.escapeReplaceNoEncode,fD);return e}function mD(e){return e.replace(YT.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function hD(e){try{e=encodeURI(e).replace(YT.percentDecode,`%`)}catch{return null}return e}function gD(e,t){let n=e.replace(YT.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(YT.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(YT.slashPipe,`|`);return n}function _D(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function vD(e){let t=e.split(`
60
- `),n=t.length-1;for(;n>=0&&YT.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
61
- `)}function yD(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function bD(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function xD(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function SD(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function CD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
62
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
63
- `)}function wD(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var TD=class{options;rules;lexer;constructor(e){this.options=e||WT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:vD(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=CD(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=_D(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:_D(t[0],`
64
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:_D(t[0],`
65
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=_D(t[0],`
66
- `).split(`
67
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
68
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
69
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
70
- ${s}`:s,r=r?`${r}
71
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
72
- `),o=t.raw+`
73
- `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
74
- `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
75
- ${d.join(`
76
- `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
77
- `+e.join(`
78
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
79
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
80
- `,1)[0],l=t[1].length,u=this.options.pedantic?xD(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>xD(e,l)),d=e.split(`
81
- `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
82
- `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
83
- `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
84
- `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
85
- `+d}f=!d.trim(),r+=l+`
86
- `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=vD(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=yD(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:_D(t[0],`
87
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=gD(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
88
- `):[],a={type:`table`,raw:_D(t[0],`
89
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(gD(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:_D(t[0],`
90
- `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
91
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&wD(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=_D(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=bD(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),SD(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&wD(e,n[1],r,this.rules))return;let i=t[yD((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return SD(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:mD(t[0]),escaped:e}}}},ED=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||WT,this.options.tokenizer=this.options.tokenizer||new TD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:YT,block:lD.normal,inline:uD.normal};this.options.pedantic?(t.block=lD.pedantic,t.inline=uD.pedantic):this.options.gfm&&(t.block=lD.gfm,t.inline=this.options.breaks?uD.breaks:uD.gfm),this.tokenizer.rules=t}static get rules(){return{block:lD,inline:uD}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(YT.carriageReturn,`
92
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(YT.tabCharGlobal,` `).replace(YT.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
93
- `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
94
- `)?``:`
95
- `)+i.raw,n.text+=`
96
- `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
97
- `)?``:`
98
- `)+i.raw,n.text+=`
99
- `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
100
- `)?``:`
101
- `)+i.raw,r.text+=`
102
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
103
- `)?``:`
104
- `)+i.raw,n.text+=`
105
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,yD(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,yD(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},DD=class{options;parser;constructor(e){this.options=e||WT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(YT.notSpaceStart)?.[0],i=e?e.replace(YT.endingNewline,``)+`
106
- `:``;return r?`<pre><code class="language-`+pD(r)+`">`+(n?i:pD(i,!0))+`</code></pre>
107
- `:`<pre><code>`+(n?i:pD(i,!0))+`</code></pre>
108
- `}blockquote({tokens:e}){return`<blockquote>
109
- ${this.parser.parse(e)}</blockquote>
110
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
111
- `}hr(e){return`<hr>
112
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
113
- `+r+`</`+i+`>
114
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
115
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
116
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
117
- <thead>
118
- `+t+`</thead>
119
- `+r+`</table>
120
- `}tablerow({text:e}){return`<tr>
121
- ${e}</tr>
122
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
123
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${pD(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?pD(n,!0):this.parser.parseInline(r),o=hD(e);if(o===null)return a;e=pD(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+pD(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=hD(e);if(i===null)return pD(n);e=i;let a=`<img src="${pD(e)}" alt="${pD(n)}"`;return t&&(a+=` title="${pD(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:pD(e.text)}},OD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},kD=class e{options;renderer;textRenderer;constructor(e){this.options=e||WT,this.options.renderer=this.options.renderer||new DD,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new OD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},AD=class{options;block;constructor(e){this.options=e||WT}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ED.lex:ED.lexInline}provideParser(e=this.block){return e?kD.parse:kD.parseInline}},jD=class{defaults=UT();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=kD;Renderer=DD;TextRenderer=OD;Lexer=ED;Tokenizer=TD;Hooks=AD;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new DD(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new TD(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new AD;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=AD.passThroughHooks.has(n)?e=>{if(this.defaults.async&&AD.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ED.lex(e,t??this.defaults)}parser(e,t){return kD.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?ED.lex:ED.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?kD.parse:kD.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?ED.lex:ED.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?kD.parse:kD.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
124
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+pD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},MD=new jD;function ND(e,t){return MD.parse(e,t)}ND.options=ND.setOptions=function(e){return MD.setOptions(e),ND.defaults=MD.defaults,GT(ND.defaults),ND},ND.getDefaults=UT,ND.defaults=WT;function PD(...e){return MD.use(...e),ND.defaults=MD.defaults,GT(ND.defaults),ND}ND.use=PD,ND.walkTokens=function(e,t){return MD.walkTokens(e,t)},ND.parseInline=MD.parseInline,ND.Parser=kD,ND.parser=kD.parse,ND.Renderer=DD,ND.TextRenderer=OD,ND.Lexer=ED,ND.lexer=ED.lex,ND.Tokenizer=TD,ND.Hooks=AD,ND.parse=ND,ND.options,ND.setOptions,ND.walkTokens,ND.parseInline,kD.parse,ED.lex;var FD=new Set([`http:`,`https:`,`mailto:`]);function ID(e){let t=e.replace(/[\u0000- \u007f]/g,``),n=/^([a-z][a-z0-9+.-]*):/i.exec(t)?.[1];return!n||FD.has(`${n.toLowerCase()}:`)}function LD(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var RD=new jD({gfm:!0,breaks:!1},{renderer:{html:({text:e})=>LD(e),link(e){return!ID(e.href)&&this.parser.parseInline(e.tokens)},image(e){return!ID(e.href)&&LD(e.text)}}});function zD(e){return RD.parse(e,{async:!1}).replace(/<a href=/g,`<a target="_blank" rel="noreferrer" href=`)}function BD({text:e,className:t}){let n=(0,v.useMemo)(()=>zD(e),[e]);return(0,I.jsx)(`div`,{className:X(`prose`,t),dangerouslySetInnerHTML:{__html:n}})}function VD(e,t,n=!0){let r=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let i=r.current;if(!i||!n)return;let a=new ResizeObserver(()=>BT(e,t,{h:i.offsetHeight}));return a.observe(i),()=>a.disconnect()},[e,t,n]),r}function HD(e){return e<600?`smartphone`:e<1100?`tablet`:`monitor`}var UD=(0,v.memo)(function({placed:e,mode:t,thumb:n,theme:r,store:i,events:a,capture:o}){let{item:s,x:c,y:l,w:u,h:d}=e,f=(0,v.useRef)(null),{frameSandbox:p}=Jg(),m=(0,v.useCallback)(e=>{f.current=e,HT(i,s.id,e)},[i,s.id]),h=o_(i,e=>e.frames[s.id]),g=o_(i,e=>e.active===s.id),_=o_(i,e=>e.inspecting&&s.kind===`screen`),y=s.frame.height===`auto`,b=s.kind===`screen`?s.theme??r:r,x=s.kind===`screen`?s.rev:s.url,[S]=(0,v.useState)(b),C=s.kind===`screen`?RC(s.url,S,o?{capture:`1`}:void 0):s.url,w=!!h?.ready,T=t===`off`,E=!T&&!(s.kind===`screen`&&s.missing);(0,v.useEffect)(()=>{T&&VT(i,s.id,{ready:!1})},[T,i,s.id]),(0,v.useEffect)(()=>{let e=f.current;if(e&&!T&&s.kind===`screen`)return MC(e,t=>{switch(t.type){case`ready`:VT(i,s.id,{ready:!0}),PC(e);break;case`size`:y&&BT(i,s.id,{h:Math.max(200,t.height)});break;case`error`:{let e=i.get().frames[s.id]?.errors??[];e.includes(t.message)||VT(i,s.id,{errors:[...e,t.message]});break}case`updated`:VT(i,s.id,{errors:[]});break;case`go`:a.onGo(s.id,t.target);break;case`link`:a.onLink(s.id,t);break;case`wheel`:a.onWheel(e,t);break;case`keydown`:t.code===`Escape`&&a.onEscape()}})},[T,s.id,s.kind,y,i,a,C,x]),(0,v.useEffect)(()=>{s.kind===`screen`&&FC(f.current,b)},[b,s.kind]);let D=b===`dark`?`light`:`dark`,O=e=>e?.[b]??e?.[D],k=s.kind===`screen`?O(s.snapshots):void 0,A=n&&s.kind===`screen`?O(s.thumbs)??k:k,j=t===`asleep`&&w&&!!A;return(0,I.jsxs)(`div`,{"data-item":s.id,className:`absolute overflow-hidden bg-surface`,style:{left:c,top:l,width:u,height:d,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:[(!w||j)&&A?(0,I.jsx)(`img`,{src:A,alt:``,draggable:!1,loading:`lazy`,decoding:`async`,className:`absolute inset-0 h-full w-full object-cover object-top select-none`}):null,!w&&!A?(0,I.jsx)(WD,{item:s,loading:E}):null,E?(0,I.jsx)(`div`,{className:`absolute inset-0`,style:{contentVisibility:j?`hidden`:`visible`},children:(0,I.jsx)(`iframe`,{ref:m,src:C,title:s.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:p,className:X(`absolute top-0 left-0 block border-0 transition-opacity duration-200`,w?`opacity-100`:`opacity-0`),style:{width:u,height:d,colorScheme:b},onLoad:()=>{s.kind===`url`?VT(i,s.id,{ready:!0}):(FC(f.current,b),PC(f.current))}},x)}):null,g||_?null:(0,I.jsx)(`div`,{"data-shield":s.id,className:`absolute inset-0`})]})});function WD({item:e,loading:t}){let n=e.kind===`screen`&&e.missing;return(0,I.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-soft text-muted`,children:[(0,I.jsx)(Z,{name:n?`alert`:e.kind===`url`?`globe`:HD(e.frame.width),size:Math.max(24,Math.min(96,e.frame.width/12)),strokeWidth:1.25,className:n?`text-danger-text`:void 0}),(0,I.jsx)(`div`,{className:`max-w-[80%] truncate text-center`,style:{fontSize:Math.max(14,e.frame.width/40)},children:n?`Missing file: ${e.kind===`screen`?e.src:``}`:t?`Loading…`:e.title})]})}var GD=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a}=e,o=VD(t,n.id),s=n.tone===`plain`;return(0,I.jsxs)(`div`,{ref:o,"data-item":n.id,className:X(`absolute`,s?``:`rounded-[10px] border border-note-line bg-note px-6 py-5 shadow-frame`),style:{left:r,top:i,width:a},children:[n.title?(0,I.jsx)(`div`,{className:`mb-2 font-semibold text-ink`,style:{fontSize:s?26:19},children:n.title}):null,(0,I.jsx)(BD,{text:n.text,className:s?`prose-plain`:`prose-note`})]})}),KD=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a,h:o}=e;return(0,I.jsx)(`div`,{"data-item":n.id,className:`absolute overflow-hidden rounded-[6px] bg-surface`,style:{left:r,top:i,width:a,height:o,boxShadow:`0 0 0 1px var(--rule)`},children:n.missing?(0,I.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-danger-text`,children:[(0,I.jsx)(Z,{name:`alert`,size:20}),` Missing image`]}):(0,I.jsx)(`img`,{src:n.url,alt:n.title,draggable:!1,className:`block h-full w-full object-contain select-none`,onLoad:e=>{let r=e.currentTarget;BT(t,n.id,{w:r.naturalWidth,h:r.naturalHeight})}})})}),qD=(0,v.memo)(function({section:e,x:t,y:n,w:r,store:i}){let a=VD(i,`section:${e.id}`);return!e.title&&!e.description?null:(0,I.jsxs)(`div`,{ref:a,className:`canvas-section absolute`,style:{left:t,top:n,width:Math.min(Math.max(r,720),1400)},children:[e.title?(0,I.jsx)(`div`,{className:`text-[40px] leading-[1.15] font-semibold tracking-[-0.015em] text-ink`,children:e.title}):null,e.description?(0,I.jsx)(`div`,{className:`mt-3 max-w-[1100px]`,children:(0,I.jsx)(BD,{text:e.description,className:`prose-plain`})}):null]})}),JD={phone:{width:390,height:844,label:`Phone`},"phone-sm":{width:375,height:667,label:`Phone S`},"phone-lg":{width:430,height:932,label:`Phone L`},tablet:{width:834,height:1194,label:`Tablet`},"tablet-landscape":{width:1194,height:834,label:`Tablet landscape`},laptop:{width:1280,height:800,label:`Laptop`},desktop:{width:1440,height:900,label:`Desktop`},wide:{width:1920,height:1080,label:`Wide`}};Object.keys(JD);var YD=e=>({"--x":e.x,"--y":e.y,"--w":e.w,"--h":e.h});function XD(e){let t=e.item;if(t.kind!==`screen`&&t.kind!==`url`)return``;let n=t.frame.device?JD[t.frame.device]?.label:void 0,r=`${t.frame.width} × ${t.frame.height===`auto`?`auto`:t.frame.height}`;return n?`${n} · ${r}`:r}var ZD=(0,v.memo)(function({placed:e,store:t}){let n=e.item.id,r=o_(t,e=>e.selected===n),i=o_(t,e=>e.frames[n]?.errors.length??0);return(0,I.jsxs)(`div`,{"data-at":``,"data-label":n,style:YD(e),className:X(`frame-label pointer-events-auto flex cursor-default items-center gap-1.5 overflow-hidden pb-1.5 text-[12.5px] leading-none whitespace-nowrap select-none`,r?`text-ink`:`text-muted hover:text-ink2`),children:[i?(0,I.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`,title:`${i} errors`}):null,(0,I.jsx)(`span`,{className:X(`min-w-[3ch] truncate`,r?`font-semibold`:`font-medium`),children:e.item.title}),(0,I.jsx)(`span`,{className:`frame-device min-w-0 shrink-[20] truncate text-[11.5px] text-muted opacity-80`,children:XD(e)})]})});function QD({placed:e,kind:t}){return(0,I.jsx)(`div`,{"data-at":``,style:YD(e),className:X(`frame-outline rounded-[1px]`,t===`hover`?`outline outline-[1.5px] outline-action/60`:`outline-2 outline-action outline`)})}function $D({layout:e,view:t,store:n,overlayRef:r}){let i=o_(n,e=>e.selected),a=o_(n,e=>e.active),o=o_(n,e=>e.hovered),s=o_(n,e=>e.zoomTiny),c=(0,v.useMemo)(()=>e.items.filter(e=>PT(e.item)),[e]),l=(0,v.useMemo)(()=>{if(!t||s)return[];let{x:e,y:n,z:r,w:i,h:a}=t,o={x:-e/r-i/r,y:-n/r-a/r,w:i/r*3,h:a/r*3};return c.filter(e=>Ow(e,o))},[c,t,s]),u=t=>t?e.items.find(e=>e.item.id===t):void 0,d=u(i),f=o&&o!==i?u(o):void 0;return(0,I.jsxs)(`div`,{ref:r,className:`canvas-overlay`,"data-tiny":s,children:[l.map(e=>(0,I.jsx)(ZD,{placed:e,store:n},e.item.id)),f?(0,I.jsx)(QD,{placed:f,kind:`hover`}):null,d?(0,I.jsx)(QD,{placed:d,kind:a===i?`active`:`selected`}):null]})}var eO=12,tO=20,nO=110,rO=.2,iO=400,aO=.2,oO=3,sO=8e3,cO=14,lO=96;function uO({layout:e,theme:t,store:n,camera:r,events:i,capture:a,apiRef:o,onPlay:s,onSelect:c}){let l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null),[p,m]=(0,v.useState)(null),h=o_(n,e=>e.panning),g=o_(n,e=>e.selected),_=o_(n,e=>e.active),y=(0,v.useMemo)(()=>e.items.filter(e=>PT(e.item)),[e]);(0,v.useLayoutEffect)(()=>{let e=l.current,t=u.current,i=d.current,a,o,s=!1,c=0,p=()=>m({...r.camera,w:e.clientWidth,h:e.clientHeight,moving:s}),h=e=>{t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0) scale(${e.z})`,s||(s=!0,t.classList.add(`moving`)),clearTimeout(a),a=setTimeout(()=>{s=!1,t.classList.remove(`moving`),p()},160);let r=f.current;r&&(r.style.setProperty(`--tx`,String(e.x)),r.style.setProperty(`--ty`,String(e.y)),r.style.setProperty(`--z`,String(e.z)));let l=24*e.z;for(;l<cO;)l*=4;for(;l>lO;)l/=4;l!==c&&(c=l,i.style.backgroundSize=`${l}px ${l}px`);let u=e=>((e+lO)%l+l)%l-l;i.style.transform=`translate3d(${u(e.x)}px, ${u(e.y)}px, 0)`;let d=e.z<.09;n.get().zoomTiny!==d&&n.set(e=>({...e,zoomTiny:d})),t.classList.toggle(`far`,e.z<.15),o??=setTimeout(()=>{o=void 0,p()},90)};h(r.camera),p();let g=r.subscribe(h),_=e.getBoundingClientRect().left,v=new ResizeObserver(()=>{let t=e.getBoundingClientRect().left;if(t!==_){let e=r.camera;r.set({...e,x:e.x-(t-_)}),_=t}p()});return v.observe(e),()=>{g(),v.disconnect(),clearTimeout(a),clearTimeout(o)}},[r,n]),(0,v.useEffect)(()=>{let t=l.current,n=()=>{let{w:n,h:i}={w:t.clientWidth,h:t.clientHeight},o=e.bounds,s=o.w&&n?Math.min((n-160)/o.w,(i-160)/Math.max(o.h,1)):1;r.minZoom=a?.01:Math.min(.25,Math.max(ww,s*.5))};n();let i=new ResizeObserver(n);return i.observe(t),()=>i.disconnect()},[r,e.bounds,a]),(0,v.useEffect)(()=>{let t=l.current,n=()=>({w:t.clientWidth,h:t.clientHeight});o.current={size:n,openView(){let{w:t,h:i}=n(),a=e.bounds;if(!a.w)return;if(Math.min((t-160)/a.w,(i-160)/Math.max(a.h,1))>=aO)return this.fitAll(!1);let o=e.sections[0]??a,s=Math.min(.5,Math.max(.25,(t-160)/Math.max(o.w,1)));r.set({z:s,x:80-a.x*s,y:80-a.y*s})},fitAll(t=!0){let{w:i,h:a}=n();if(!e.bounds.w)return;let o=Dw(e.bounds,i,a,80,1,r.minZoom);t?r.animateTo(o):r.set(o)},fitItem(t,i=!0){let a=e.items.find(e=>e.item.id===t);if(!a)return;let{w:o,h:s}=n(),c=Dw(a,o,s,64,1,r.minZoom);i?r.animateTo(c):r.set(c)},zoomBy(e){let{w:t,h:i}=n(),a=r.camera,o=a.z*e,s=(t/2-a.x)/a.z,c=(i/2-a.y)/a.z;r.animateTo({z:o,x:t/2-s*o,y:i/2-c*o},180)},zoomTo(e){let{w:t,h:i}=n(),a=r.camera,o=(t/2-a.x)/a.z,s=(i/2-a.y)/a.z;r.animateTo({z:e,x:t/2-o*e,y:i/2-s*e},220)}}},[o,r,e]);let b=(0,v.useRef)([]),x=(0,v.useRef)(new Map),[S,C]=(0,v.useState)(0),w=o_(n,e=>dO(e.frames)),T=(0,v.useMemo)(()=>{let e=new Map;if(a){for(let t of y)e.set(t.item.id,`live`);return e}if(!p)return e;let{x:t,y:n,z:r,w:i,h:o}=p,s={x:-t/r,y:-n/r,w:i/r,h:o/r},c={x:s.x-s.w*.25,y:s.y-s.h*.25,w:s.w*1.5,h:s.h*1.5},l=s.x+s.w/2,u=s.y+s.h/2,d=e=>Math.max(0,Math.min(e.x+e.w,s.x+s.w)-Math.max(e.x,s.x))*Math.max(0,Math.min(e.y+e.h,s.y+s.h)-Math.max(e.y,s.y)),f=e=>Math.hypot(e.x+e.w/2-l,e.y+e.h/2-u),m=y.filter(e=>r>=rO&&Ow(e,c)&&e.w*r>=nO).sort((e,t)=>d(t)-d(e)||f(e)-f(t)).slice(0,eO).map(e=>e.item.id),h=[_,g].filter(e=>!!e),v=new Set(y.map(e=>e.item.id)),S=new Set(w.split(`
125
- `)),C=new Set(b.current),T=performance.now(),E=e=>!S.has(e)&&T-(x.current.get(e)??0)<sO,D=oO-[...C].filter(E).length,O=[];for(let e of new Set([...h,...m]))v.has(e)&&(C.has(e)?O.push(e):(h.includes(e)||!p.moving&&D>0)&&(O.push(e),x.current.set(e,T),D--));let k=[...new Set([...O,...b.current])].filter(e=>v.has(e)).slice(0,tO);b.current=k;for(let e of x.current.keys())k.includes(e)||x.current.delete(e);for(let t of k)e.set(t,O.includes(t)?`live`:`asleep`);return e},[p,y,_,g,a,w,S]);(0,v.useEffect)(()=>{let e=performance.now(),t=new Set(w.split(`
126
- `)),n=[...x.current].filter(([e])=>!t.has(e)).map(([,t])=>t+sO-e).filter(e=>e>0);if(!n.length)return;let r=setTimeout(()=>C(e=>e+1),Math.min(...n)+20);return()=>clearTimeout(r)},[T,w]);let E=(0,v.useRef)(null),D=(0,v.useRef)(new Map),O=(0,v.useRef)(null),k=(0,v.useRef)(!1),A=e=>{n.get().panning!==e&&n.set(t=>({...t,panning:e}))};(0,v.useEffect)(()=>{let e=e=>{e.code===`Space`&&!fO(e.target)&&(k.current=!0,l.current?.classList.add(`cursor-grab`),e.preventDefault())},t=e=>{e.code===`Space`&&(k.current=!1,l.current?.classList.remove(`cursor-grab`))};return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,t)}},[]);let j=e=>{let t=e;return(t?.closest(`[data-shield]`))?.dataset.shield??(t?.closest(`[data-label]`))?.dataset.label??(t?.closest(`[data-item]`))?.dataset.item??null},ee=e=>{if(e.target.closest(`[data-ui]`)||e.button!==0&&e.button!==1)return;if(l.current.setPointerCapture(e.pointerId),D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),r.interrupt(),D.current.size===2){let[e,t]=[...D.current.values()];O.current={dist:Math.hypot(e.x-t.x,e.y-t.y),midX:(e.x+t.x)/2,midY:(e.y+t.y)/2},E.current=null,A(!0);return}let t=e.button===1||k.current;E.current={id:t?null:j(e.target),startX:e.clientX,startY:e.clientY,lastX:e.clientX,lastY:e.clientY,moved:t},t&&A(!0)},te=e=>{if(D.current.has(e.pointerId)&&D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),O.current&&D.current.size===2){let[e,t]=[...D.current.values()],n=Math.hypot(e.x-t.x,e.y-t.y),i=(e.x+t.x)/2,a=(e.y+t.y)/2,o=l.current.getBoundingClientRect();r.panBy(i-O.current.midX,a-O.current.midY),r.zoomAt(i-o.left,a-o.top,n/Math.max(O.current.dist,1)),O.current={dist:n,midX:i,midY:a};return}let t=E.current;if(!t){if(!n.get().panning){let t=j(e.target);n.get().hovered!==t&&n.set(e=>({...e,hovered:t}))}return}!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>3&&(t.moved=!0,A(!0)),t.moved&&r.panBy(e.clientX-t.lastX,e.clientY-t.lastY),t.lastX=e.clientX,t.lastY=e.clientY},ne=e=>{D.current.delete(e.pointerId),D.current.size<2&&(O.current=null);let t=E.current;E.current=null,t&&!t.moved&&c(t.id,{x:e.clientX,y:e.clientY}),D.current.size||A(!1)};(0,v.useEffect)(()=>{let e=l.current,t=t=>{if(t.target.closest(`[data-ui]`))return;t.preventDefault();let n=e.getBoundingClientRect(),i=t.deltaMode===1?16:t.deltaMode===2?n.height:1;if(t.ctrlKey||t.metaKey){let e=t.deltaY*i,a=Math.abs(e)<40?.012:.0025;r.zoomAt(t.clientX-n.left,t.clientY-n.top,Math.exp(-e*a))}else r.panBy(-t.deltaX*i,-t.deltaY*i)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[r]);let re=e.sections;return(0,I.jsxs)(`div`,{ref:l,className:X(`canvas-root relative h-full w-full touch-none overflow-hidden select-none`,h&&`canvas-panning cursor-grabbing`),onPointerDown:ee,onPointerMove:te,onPointerUp:ne,onPointerCancel:ne,onPointerLeave:()=>n.get().hovered&&n.set(e=>({...e,hovered:null})),onDoubleClick:t=>{let n=j(t.target),r=n?e.items.find(e=>e.item.id===n):void 0;r&&PT(r.item)&&s(r.item.id)},children:[(0,I.jsx)(`div`,{ref:d,className:`canvas-grid`}),(0,I.jsxs)(`div`,{ref:u,className:`canvas-world`,children:[re.map(e=>(0,I.jsx)(qD,{section:e.section,x:e.x,y:e.y,w:e.w,store:n},`section:${e.section.id}`)),e.items.map(e=>{let{item:r}=e;return r.kind===`screen`||r.kind===`url`?(0,I.jsx)(UD,{placed:e,mode:T.get(r.id)??`off`,thumb:!a&&!!p&&e.w*p.z*devicePixelRatio<=iO,theme:t,store:n,events:i,capture:a},r.id):r.kind===`note`?(0,I.jsx)(GD,{placed:e,store:n},r.id):(0,I.jsx)(KD,{placed:e,store:n},r.id)})]}),(0,I.jsx)($D,{layout:e,view:p,store:n,overlayRef:f})]})}function dO(e){return Object.keys(e).filter(t=>e[t].ready).sort().join(`
127
- `)}function fO(e){let t=e;return!!t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.tagName))}var pO=new URLSearchParams(window.location.search),mO=pO.has(`capture`),hO=(e,t)=>`foss-design.camera.${e}.${t}`;function gO(e){try{let t=JSON.parse(sessionStorage.getItem(e)??`null`);if(t&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z))return t}catch{}return null}function _O(e){let t=h_(),n=pO.get(`theme`),[r,i]=(0,v.useState)(n===`dark`||n===`light`?n:null);return[r??e?.theme??t,i]}function vO({canvasId:e,pageId:t}){let{data:n,error:r,isLoading:i}=Qg(e);if(r)return(0,I.jsx)(Cw,{title:`Canvas not found`,text:r.message});if(i||!n)return(0,I.jsx)(`div`,{className:`canvas-dots grow`});let a=t??pO.get(`page`)??void 0,o=n.pages.find(e=>e.id===a)??n.pages[0];return(0,I.jsx)(yO,{canvas:n,page:o},`${n.id}/${o?.id??``}`)}function yO({canvas:e,page:t}){let[,n]=N(),r=(0,v.useMemo)(()=>zT(),[]),i=(0,v.useMemo)(()=>new Ew,[]),a=(0,v.useRef)(null),[o,s]=_O(e),[c,l]=(0,v.useState)(()=>!mO&&window.innerWidth>900),[u,d]=(0,v.useState)(!1),f=o_(r,e=>e.sizes),p=(0,v.useMemo)(()=>t?LT(t,f):{items:[],sections:[],bounds:{x:0,y:0,w:0,h:0}},[t,f]),m=CO(o_(r,e=>e.frameEls),p),h=HC(m),g=u||h;(0,v.useEffect)(()=>{r.set(e=>e.inspecting===g?e:{...e,inspecting:g,active:null})},[g,r]);let _=VC(m,g,{onEscape:()=>d(!1)}),y=!!_.info;(0,v.useEffect)(()=>{y&&d(!0)},[y]),(0,v.useEffect)(()=>{let e=_.frame;if(!e)return;let t=Object.entries(r.get().frameEls).find(([,t])=>t===e)?.[0];t&&r.get().selected!==t&&r.set(e=>({...e,selected:t}))},[_.frame,r]);let b=(0,v.useMemo)(()=>RT(p),[p]),x=hO(e.id,t?.id??``),S=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(S.current||!p.bounds.w)return;S.current=!0;let t=i_(e.id),n=mO?null:gO(x);t?(r.set(e=>({...e,selected:t})),requestAnimationFrame(()=>a.current?.fitItem(t,!1))):n&&n.z>=i.minZoom?i.set(n):requestAnimationFrame(()=>mO?a.current?.fitAll(!1):a.current?.openView())},[p,i,x,e.id,r]),(0,v.useEffect)(()=>{if(mO)return;let e,t=i.subscribe(t=>{clearTimeout(e),e=setTimeout(()=>sessionStorage.setItem(x,JSON.stringify(t)),250)});return()=>{t(),clearTimeout(e)}},[i,x]);let C=(0,v.useCallback)(e=>{let t=e?p.items.find(t=>t.item.id===e)?.item:void 0;r.set(e=>({...e,selected:t?t.id:null,active:t&&PT(t)?t.id:null,hovered:null}))},[p,r]),w=(0,v.useCallback)(e=>{C(e),a.current?.fitItem(e)},[C]),T=(0,v.useCallback)(r=>n(`/c/${encodeURIComponent(e.id)}/play/${encodeURIComponent(r)}${t?`?page=${encodeURIComponent(t.id)}`:``}`),[e.id,t,n]);(0,v.useEffect)(()=>{let t=t=>{let n=t.detail;n.canvas===e.id&&p.items.some(e=>e.item.id===n.item)&&(i_(e.id),w(n.item))};return window.addEventListener(`design:focus`,t),()=>window.removeEventListener(`design:focus`,t)},[e.id,p,w]);let E=(0,v.useMemo)(()=>({onGo(r,i){let[a,o]=i.includes(`/`)?i.split(`/`):[null,i],s=a?e.pages.filter(e=>e.id===a):[t,...e.pages.filter(e=>e!==t)];for(let r of s)if(r&&r.sections.some(e=>e.items.some(e=>e.id===o))){r===t?w(o):(n(wT(e,r)),window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:o}})));return}console.warn(`[design] go("${i}"): no such screen`)},onLink(t,n){BC(n,e,e=>this.onGo(t,e))},onWheel(e,t){let n=e.closest(`.canvas-root`);if(!n)return;let r=n.getBoundingClientRect(),a=e.getBoundingClientRect(),o=i.camera.z;if(t.zoom){let e=Math.abs(t.deltaY)<40?.012:.0025;i.zoomAt(a.left-r.left+t.x*o,a.top-r.top+t.y*o,Math.exp(-t.deltaY*e))}else i.panBy(-t.deltaX,-t.deltaY)},onEscape(){r.set(e=>({...e,active:null}))}}),[e,t,i,r,w,n]);return(0,v.useEffect)(()=>{if(!mO)return;let e=Date.now(),t=setInterval(()=>{let n=r.get().frames;(b.every(e=>n[e.item.id]?.ready||e.item.kind===`screen`&&e.item.missing)||Date.now()-e>6e4)&&(clearInterval(t),a.current?.fitAll(!1),requestAnimationFrame(()=>requestAnimationFrame(()=>window.__DESIGN_CANVAS_READY__=!0)))},250);return()=>clearInterval(t)},[b,r]),(0,v.useEffect)(()=>{let i=i=>{if(fO(i.target)||document.querySelector(`[role="dialog"]`))return;let o=a.current,s=r.get(),c=i.metaKey||i.ctrlKey;if(i.key===`Escape`)_.info?_.select(null):u?d(!1):s.active?r.set(e=>({...e,active:null})):s.selected&&r.set(e=>({...e,selected:null}));else if(i.key===`i`&&!c&&!i.altKey)d(e=>!e);else if(i.shiftKey&&i.code===`Digit1`)o?.fitAll();else if(i.shiftKey&&i.code===`Digit2`&&s.selected)o?.fitItem(s.selected);else if(i.shiftKey&&i.code===`Digit0`)o?.zoomTo(1);else if((i.key===`=`||i.key===`+`)&&!i.altKey)i.preventDefault(),o?.zoomBy(1.4);else if(i.key===`-`&&!i.altKey)i.preventDefault(),o?.zoomBy(1/1.4);else if(c&&i.key===`0`)i.preventDefault(),o?.zoomTo(1);else if(c&&i.key===`\\`)i.preventDefault(),l(e=>!e);else if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(i.key)&&b.length){i.preventDefault();let e=b.findIndex(e=>e.item.id===s.selected),t=i.key===`ArrowRight`||i.key===`ArrowDown`?1:-1,n=b[e===-1?0:(e+t+b.length)%b.length];r.set(e=>({...e,selected:n.item.id,active:null})),o?.fitItem(n.item.id)}else if(i.key===`Enter`&&s.selected){let e=p.items.find(e=>e.item.id===s.selected)?.item;e&&PT(e)&&T(e.id)}else if(i.key===`]`||i.key===`[`){let r=t?e.pages.indexOf(t):-1,a=e.pages[r+(i.key===`]`?1:-1)];a&&n(wT(e,a))}};return window.addEventListener(`keydown`,i),()=>window.removeEventListener(`keydown`,i)},[r,b,p,T,e,t,n,u,_]),mO?(0,I.jsx)(`div`,{className:`flex h-dvh`,children:(0,I.jsx)(uO,{layout:p,theme:o,store:r,camera:i,events:E,capture:!0,apiRef:a,onPlay:()=>{},onSelect:()=>{}})}):(0,I.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,I.jsx)(ET,{canvas:e,page:t,theme:o,onTheme:s,sidebar:c,onSidebar:l,inspect:u,onInspect:d,onPlay:()=>{let e=r.get().selected,t=e&&b.find(t=>t.item.id===e)||b[0];t&&T(t.item.id)},canPlay:b.length>0}),(0,I.jsxs)(`div`,{className:`flex min-h-0 grow`,children:[(0,I.jsx)(gw,{open:c&&!!t,side:`left`,width:264,children:t?(0,I.jsx)(TT,{canvas:e,page:t,store:r,onPick:w}):null}),(0,I.jsxs)(`div`,{className:`relative min-w-0 grow`,children:[t&&p.items.length?(0,I.jsx)(uO,{layout:p,theme:o,store:r,camera:i,events:E,capture:!1,apiRef:a,onPlay:T,onSelect:C}):(0,I.jsx)(`div`,{className:`canvas-dots flex h-full`,children:(0,I.jsx)(Sw,{title:t?`This page is empty`:`This canvas has no pages`,text:(0,I.jsxs)(I.Fragment,{children:[`Add sections and screens to`,` `,(0,I.jsxs)(`code`,{className:`font-mono text-[13px]`,children:[`.design/canvas/`,e.id,`/canvas.json`]}),`.`]})})}),(0,I.jsx)(DT,{canvas:e,store:r,layoutItems:p.items.map(e=>e.item),theme:o,onPlay:T,inspect:g}),(0,I.jsx)(xO,{camera:i,apiRef:a}),e.issues.length?(0,I.jsx)(SO,{canvas:e}):null]}),(0,I.jsx)(gw,{open:u,side:`right`,width:320,children:(0,I.jsx)(QC,{info:_.info,active:!0,onSelect:e=>_.select(e),onClose:()=>{d(!1),_.select(null)}})})]})]})}function bO({camera:e}){let[t,n]=(0,v.useState)(e.camera.z);return(0,v.useEffect)(()=>{let t=0;return e.subscribe(e=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>n(e.z))})},[e]),(0,I.jsxs)(I.Fragment,{children:[Math.round(t*100),`%`]})}function xO({camera:e,apiRef:t}){return(0,I.jsxs)(`div`,{"data-ui":!0,className:`absolute right-4 bottom-5 z-20 flex h-[46px] items-center gap-0.5 rounded-[10px] border border-rule bg-surface px-1.5 shadow-pop`,children:[(0,I.jsx)(j_,{icon:`zoom-out`,label:`Zoom out (−)`,onClick:()=>t.current?.zoomBy(1/1.4)}),(0,I.jsxs)(zS,{side:`top`,align:`end`,width:210,trigger:(0,I.jsx)(`button`,{type:`button`,className:`h-ctrl min-w-[56px] cursor-pointer rounded-[6px] border-0 bg-transparent px-1.5 text-[12.5px] font-medium text-ink2 tabular hover:bg-soft2`,children:(0,I.jsx)(bO,{camera:e})}),children:[(0,I.jsx)(VS,{onSelect:()=>t.current?.fitAll(),hint:`⇧1`,children:`Zoom to fit`}),(0,I.jsx)(VS,{onSelect:()=>t.current?.zoomTo(1),hint:`⇧0`,children:`100%`}),(0,I.jsx)(HS,{}),[.25,.5,2].map(e=>(0,I.jsxs)(VS,{onSelect:()=>t.current?.zoomTo(e),children:[e*100,`%`]},e))]}),(0,I.jsx)(j_,{icon:`zoom-in`,label:`Zoom in (+)`,onClick:()=>t.current?.zoomBy(1.4)}),(0,I.jsx)(`div`,{className:`mx-0.5 h-5 w-px bg-rule`}),(0,I.jsx)(j_,{icon:`fit`,label:`Zoom to fit (⇧1)`,onClick:()=>t.current?.fitAll()})]})}function SO({canvas:e}){let t=e.issues.filter(e=>e.severity===`error`).length;return(0,I.jsxs)(bC,{children:[(0,I.jsx)(xC,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,"data-ui":!0,className:`absolute bottom-5 left-4 z-20 flex h-[46px] cursor-pointer items-center gap-2 rounded-[10px] border border-rule bg-surface px-3.5 text-[13px] font-medium shadow-pop hover:bg-soft`,children:[(0,I.jsx)(Z,{name:`alert`,size:15,className:t?`text-danger-text`:`text-action`}),e.issues.length,` `,e.issues.length===1?`problem`:`problems`,` in canvas.json`]})}),(0,I.jsx)(SC,{children:(0,I.jsx)(CC,{side:`top`,align:`start`,sideOffset:8,collisionPadding:12,className:`z-50 max-h-[50vh] w-[460px] max-w-[calc(100vw-24px)] overflow-y-auto rounded-[10px] border border-rule bg-surface shadow-pop outline-none data-[state=open]:animate-[q-pop_120ms_ease-out]`,children:(0,I.jsx)(pw,{issues:e.issues})})})]})}function CO(e,t){let n=(0,v.useRef)([]);return(0,v.useMemo)(()=>{let r=new Set(t.items.filter(e=>e.item.kind===`screen`).map(e=>e.item.id)),i=Object.entries(e).filter(e=>!!e[1]&&r.has(e[0])).map(([,e])=>e);return i.length===n.current.length&&i.every((e,t)=>e===n.current[t])||(n.current=i),n.current},[e,t])}function wO(e,t){return(t?e.pages.filter(e=>e.id===t):e.pages).flatMap(t=>t.sections.flatMap(n=>n.items.filter(e=>e.kind===`screen`||e.kind===`url`).map(r=>({item:r,pageId:t.id,where:[e.pages.length>1?t.title:null,n.title].filter(Boolean).join(` · `)}))))}var TO=(e,t,n)=>`/c/${encodeURIComponent(e)}/play/${encodeURIComponent(t)}?page=${encodeURIComponent(n)}`;function EO({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=Qg(e);return r?(0,I.jsx)(Cw,{title:`Canvas not found`,text:r.message}):i||!n?null:(0,I.jsx)(DO,{canvas:n,itemId:t})}function DO({canvas:e,itemId:t}){let[,n]=N(),{frameSandbox:r,slots:i}=Jg(),a=new URLSearchParams(window.location.search).get(`page`)??(window.location.hash.split(`?`)[1]?new URLSearchParams(window.location.hash.split(`?`)[1]).get(`page`):null),o=(0,v.useMemo)(()=>wO(e,null),[e]),s=o.find(e=>e.item.id===t),c=a??s?.pageId??null,l=(0,v.useMemo)(()=>c?wO(e,c):o,[e,c,o]),u=l.findIndex(e=>e.item.id===t),d=h_(),[f,p]=(0,v.useState)(e.theme??d),[m,h]=(0,v.useState)(`fit`),g=(0,v.useRef)(null),_=(0,v.useRef)(null),[y,b]=(0,v.useState)(null),x=(0,v.useCallback)(e=>{_.current=e,b(e)},[]),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)({w:0,h:0}),[E,D]=(0,v.useState)([]),O=c?`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(c)}`:`/c/${encodeURIComponent(e.id)}`,k=t=>{if(!l.length)return;let r=l[(u+t+l.length)%l.length];n(TO(e.id,r.item.id,r.pageId),{replace:!0})};(0,v.useLayoutEffect)(()=>{let e=g.current;if(!e)return;let t=new ResizeObserver(()=>T({w:e.clientWidth,h:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{let e=e=>{fO(e.target)||document.querySelector(`[role="dialog"]`)||(e.key===`ArrowRight`?k(1):e.key===`ArrowLeft`?k(-1):e.key===`i`&&!e.metaKey&&!e.ctrlKey&&!e.altKey?C(e=>!e):e.key===`Escape`&&(M.info?M.select(null):S?C(!1):n(O)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let A=l[u],j=A?.item,ee=j?.kind===`screen`?j.theme??f:f,te=xT(e.id,j,ee),[ne]=(0,v.useState)(ee),re=j?j.kind===`screen`?RC(j.url,ne):j.url:``,ie=(0,v.useMemo)(()=>y&&j?.kind===`screen`?[y]:[],[y,j?.kind]),ae=HC(ie),M=VC(ie,S||ae,{onEscape:()=>C(!1)}),oe=!!M.info;if((0,v.useEffect)(()=>{oe&&C(!0)},[oe]),(0,v.useEffect)(()=>{let t=_.current;if(t&&j?.kind===`screen`)return D([]),MC(t,t=>{if(t.type===`error`)D(e=>e.includes(t.message)?e:[...e,t.message]);else if(t.type===`updated`)D([]);else if(t.type===`keydown`&&t.code===`Escape`)n(O);else if(t.type===`go`){let[r,i]=t.target.includes(`/`)?t.target.split(`/`):[null,t.target],a=o.find(e=>e.item.id===i&&(!r||e.pageId===r));a&&n(TO(e.id,a.item.id,a.pageId))}else t.type===`link`&&BC(t,e,t=>{let r=o.find(e=>e.item.id===t);r&&n(TO(e.id,r.item.id,r.pageId))})})},[j,re,o,e.id,n,O]),(0,v.useEffect)(()=>{j?.kind===`screen`&&FC(_.current,ee)},[ee,j]),!j)return(0,I.jsx)(Cw,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`});let se=j.frame.width,ce=j.frame.height===`auto`?Math.max(w.h-48,400):j.frame.height,le=m===`fit`?Math.min(1,(w.w-48)/se,(w.h-48)/ce):1,ue=se<=w.w-48&&ce<=w.h-48;return(0,I.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,I.jsxs)(JS,{children:[i.barStart,(0,I.jsx)(yT,{content:(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Back to canvas `,(0,I.jsx)(__,{children:`esc`})]}),children:(0,I.jsx)(xe,{href:O,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,"aria-label":`Back to canvas`,children:(0,I.jsx)(Z,{name:`arrow-left`,size:16})})}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:[(0,I.jsx)(`span`,{className:`truncate text-[14px] font-semibold`,children:j.title}),(0,I.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:[e.title,A.where].filter(Boolean).join(` · `)})]}),(0,I.jsxs)(`div`,{className:`mx-auto flex items-center gap-1`,children:[(0,I.jsx)(j_,{icon:`chevron-left`,label:`Previous screen (←)`,onClick:()=>k(-1),disabled:l.length<2}),(0,I.jsxs)(`span`,{className:`min-w-[52px] text-center text-[12.5px] text-muted tabular`,children:[u+1,` / `,l.length]}),(0,I.jsx)(j_,{icon:`chevron-right`,label:`Next screen (→)`,onClick:()=>k(1),disabled:l.length<2})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ue?null:(0,I.jsx)(kw,{label:`Scale`,value:m,onChange:h,items:[{value:`fit`,label:`Fit`},{value:`actual`,label:`100%`}]}),j.kind===`screen`&&!j.theme?(0,I.jsx)(kw,{label:`Screen theme`,value:f,onChange:p,items:[{value:`light`,label:(0,I.jsx)(Z,{name:`sun`,size:15}),title:`Light`},{value:`dark`,label:(0,I.jsx)(Z,{name:`moon`,size:15}),title:`Dark`}]}):null,j.kind===`screen`?(0,I.jsx)(OT,{on:S,onChange:C}):null,(0,I.jsx)(j_,{icon:`refresh`,label:`Reload`,onClick:()=>IC(_.current)}),te?(0,I.jsx)(`a`,{href:te,target:`_blank`,rel:`noreferrer`,title:`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,I.jsx)(Z,{name:`external`,size:16})}):null,(0,I.jsx)(GS,{}),i.barEnd]})]}),i.belowBar,(0,I.jsxs)(`div`,{className:`flex min-h-0 grow`,children:[(0,I.jsxs)(`div`,{ref:g,className:`canvas-dots relative min-w-0 grow ${m===`actual`?`overflow-auto`:`overflow-hidden`}`,children:[E.length?(0,I.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-10 flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,I.jsx)(Z,{name:`alert`,size:14,className:`mt-px`}),E.join(`
128
- `)]}):null,(0,I.jsx)(`div`,{className:`flex min-h-full min-w-full items-center justify-center p-6`,style:{width:m===`actual`?se+48:void 0},children:(0,I.jsx)(`div`,{className:`shrink-0 overflow-hidden bg-surface`,style:{width:se*le,height:ce*le,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:(0,I.jsx)(`iframe`,{ref:x,src:re,title:j.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:r,className:`block border-0`,style:{width:se,height:ce,transform:`scale(${le})`,transformOrigin:`0 0`,colorScheme:ee},onLoad:()=>j.kind===`screen`&&FC(_.current,ee)},`${j.id}:${j.kind===`screen`?j.rev:j.url}`)})})]}),(0,I.jsx)(gw,{open:S,side:`right`,width:320,children:(0,I.jsx)(QC,{info:M.info,active:!0,onSelect:e=>M.select(e),onClose:()=>{C(!1),M.select(null)}})})]})]})}var OO=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]],kO=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});function AO(e){if(!e)return``;let t=(e-Date.now())/1e3;for(let[e,n]of OO)if(Math.abs(t)>=n)return kO.format(Math.round(t/n),e);return`just now`}function jO(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KB`:`${(e/1024/1024).toFixed(1)} MB`}function MO(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function NO({className:e,style:t}){return(0,I.jsx)(`span`,{"aria-hidden":`true`,className:X(`block animate-pulse rounded-[6px] bg-soft2`,e),style:t})}function PO({rows:e=3,lead:t=28,minH:n=56}){return(0,I.jsx)(`div`,{role:`status`,"aria-label":`Loading`,children:Array.from({length:e},(e,r)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-rule px-4`,style:{minHeight:n,opacity:1-r*.18},children:[t?(0,I.jsx)(NO,{style:{width:t,height:Math.min(t,n-20)}}):null,(0,I.jsxs)(`span`,{className:`flex min-w-0 grow flex-col gap-1.5`,children:[(0,I.jsx)(NO,{className:`h-3 w-[38%]`}),(0,I.jsx)(NO,{className:`h-2.5 w-[62%]`})]}),(0,I.jsx)(NO,{className:`h-3 w-14`})]},r))})}function FO({canvas:e}){return(0,I.jsx)(`div`,{className:`flex h-[54px] w-[86px] shrink-0 items-center justify-center overflow-hidden rounded-[6px] border border-rule bg-soft`,children:e.cover?(0,I.jsx)(`img`,{src:e.cover,alt:``,className:`h-full w-full object-cover object-top`}):(0,I.jsx)(Z,{name:`canvas`,size:18,className:`text-muted`})})}function IO({actions:e,children:t}){return e?(0,I.jsxs)(`div`,{className:`grid items-center border-t border-rule transition-colors hover:bg-soft`,style:{gridTemplateColumns:`minmax(0,1fr) auto`},children:[t,(0,I.jsx)(`div`,{className:`flex items-center gap-2 pr-4`,children:e})]}):t}function LO({children:e}){return e?(0,I.jsx)(`div`,{className:`flex items-center gap-2.5 border-t border-rule bg-soft px-4 py-3 text-[12.5px] text-muted`,children:e}):null}function RO({project:e}){let{canvasRowActions:t,canvasesFoot:n}=Jg().slots;return e.canvases.length?(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Canvases`,count:e.canvases.length}),e.canvases.map(e=>{let n=t?.(e.id);return(0,I.jsx)(IO,{actions:n,children:(0,I.jsxs)(uw,{to:`/c/${encodeURIComponent(e.id)}`,cols:`86px minmax(0,1fr) auto auto`,align:`llrr`,pad:`10px 16px`,minH:74,first:!!n,children:[(0,I.jsx)(FO,{canvas:e}),(0,I.jsx)(v_,{top:e.title,bottom:(0,I.jsx)(`span`,{className:`truncate`,children:e.description??e.id})}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-[12.5px] whitespace-nowrap text-muted`,children:[e.issues?(0,I.jsx)(ew,{tone:`danger`,children:MO(e.issues,`problem`)}):null,MO(e.screens,`screen`),` · `,MO(e.pages,`page`)]}),(0,I.jsx)(`span`,{className:`w-[92px] text-[12.5px] whitespace-nowrap text-muted`,children:AO(e.updatedAt)})]})},e.id)}),(0,I.jsx)(LO,{children:n})]}):(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Canvases`,count:0}),(0,I.jsx)(fw,{children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 py-6 text-center`,children:[(0,I.jsx)(`span`,{className:`text-[14px] text-ink2`,children:`No canvases yet.`}),(0,I.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Ask your agent to design something, or run `,(0,I.jsx)(Q,{children:`design new <name>`}),` in the project.`]})]})}),(0,I.jsx)(LO,{children:n})]})}function zO({project:e}){let t=e.system;return t?(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Design system`,right:(0,I.jsx)(M_,{to:`/system`,children:`Open`})}),(0,I.jsxs)(fw,{gap:6,children:[(0,I.jsx)(`span`,{className:`text-[15px] font-semibold`,children:t.name}),t.description?(0,I.jsx)(`span`,{className:`text-[13px] text-ink2`,children:t.description}):null]}),(0,I.jsx)(dw,{label:`Tokens`,labelWidth:120,end:!0,children:(0,I.jsx)(tw,{value:t.tokens})}),(0,I.jsx)(dw,{label:`Components`,labelWidth:120,end:!0,children:(0,I.jsx)(tw,{value:t.components})}),(0,I.jsx)(dw,{label:`Guidelines`,labelWidth:120,end:!0,children:(0,I.jsx)(tw,{value:t.guidelines})}),t.issues?(0,I.jsx)(dw,{label:`Problems`,labelWidth:120,end:!0,children:(0,I.jsx)(ew,{tone:`danger`,children:t.issues})}):null]}):(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Design system`}),(0,I.jsx)(fw,{children:(0,I.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`No design system yet. Ask your agent to build one from the codebase, or run `,(0,I.jsx)(Q,{children:`design system init`}),`.`]})})]})}function BO(){return(0,I.jsxs)(_w,{children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1 pb-1`,children:[(0,I.jsx)(NO,{className:`h-6 w-[220px]`}),(0,I.jsx)(NO,{className:`h-3.5 w-[300px]`})]}),(0,I.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Canvases`}),(0,I.jsx)(PO,{rows:3,lead:86,minH:74})]}),(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Design system`}),(0,I.jsx)(PO,{rows:3,lead:0,minH:40})]})]})]})}function VO(){let{data:e,error:t,isLoading:n}=Zg(),{slots:r}=Jg();return t?(0,I.jsx)(Sw,{title:`Could not load the project`,text:t.message}):n||!e?(0,I.jsx)(BO,{}):(0,I.jsxs)(_w,{children:[(0,I.jsx)(vw,{title:e.name,right:r.homeActions,sub:r.homeSub?r.homeSub:e.static?`Snapshot built with foss-design ${e.version}`:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(Q,{size:12.5,children:[e.root,`/.design`]}),` · foss-design `,e.version]})}),(0,I.jsx)(mw,{issues:e.issues,title:`Problems in design.json`}),(0,I.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,I.jsx)(RO,{project:e}),(0,I.jsx)(zO,{project:e})]}),r.homeAfter]})}function HO(e){let t=e.utility;if(t===void 0)return[];let n=t?`-${t}`:``;switch(e.kind){case`color`:return[`bg${n}`,`text${n}`,`border${n}`];case`font`:return[`font${n}`];case`text`:return[`text${n}`];case`weight`:return[`font${n}`];case`leading`:return[`leading${n}`];case`tracking`:return[`tracking${n}`];case`spacing`:return t?[`p${n}`,`gap${n}`]:[`p-1`,`gap-4`,`m-2`];case`radius`:return[`rounded${n}`];case`shadow`:return e.name.startsWith(`--inset-shadow-`)?[`inset-shadow${n}`]:e.name.startsWith(`--drop-shadow-`)?[`drop-shadow${n}`]:e.name.startsWith(`--text-shadow-`)?[`text-shadow${n}`]:[`shadow${n}`];case`blur`:return[`blur${n}`,`backdrop-blur${n}`];case`ease`:return[`ease${n}`];case`animation`:return[`animate${n}`];case`breakpoint`:return e.name.startsWith(`--container-`)?[`@${t}:`,`max-w${n}`]:[`${t}:`];default:return[]}}function UO(e,...t){return e.filter(e=>t.includes(e.kind))}function WO(e){let t=new Map;for(let n of e){let e=t.get(n.group)??[];e.push(n),t.set(n.group,e)}return[...t].map(([e,t])=>({group:e,tokens:t}))}function GO(e){let t=/^(-?[\d.]+)(px|rem|em)?$/.exec(e.trim());if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?t[2]===`rem`||t[2]===`em`?n*16:n:null}function KO(e,t){return(t===`dark`?e.dark?.value:void 0)??e.light?.value}function qO(){let e=h_(),[t,n]=(0,v.useState)(null);return[t??e,n]}function JO({value:e,onChange:t}){return(0,I.jsx)(kw,{label:`Theme`,size:`sm`,value:e,onChange:t,items:[{value:`light`,label:(0,I.jsx)(Z,{name:`sun`,size:14}),title:`Light`},{value:`dark`,label:(0,I.jsx)(Z,{name:`moon`,size:14}),title:`Dark`}]})}function YO({items:e}){return e.length?(0,I.jsx)(`span`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-0.5`,children:e.map(e=>(0,I.jsx)(Q,{size:12,className:`text-muted`,children:e},e))}):null}function XO({title:e,children:t}){return(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:e}),(0,I.jsx)(fw,{children:(0,I.jsx)(`div`,{className:`py-4 text-[13px] text-muted`,children:t})})]})}var ZO=`.design/system/tokens.css`;function QO({children:e,className:t}){return(0,I.jsx)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere] ${t??``}`,children:e})}function $O({asset:e,index:t}){if(e.kind===`image`)return(0,I.jsx)(`span`,{className:`checker flex h-[132px] items-center justify-center overflow-hidden border-b border-rule`,children:(0,I.jsx)(`img`,{src:e.url,alt:``,className:`max-h-[96px] max-w-[80%] object-contain`})});if(e.kind===`font`){let n=`design-asset-font-${t}`;return(0,I.jsxs)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft`,children:[(0,I.jsx)(`style`,{children:`@font-face{font-family:"${n}";src:url("${e.url.replace(/"/g,`%22`)}")}`}),(0,I.jsx)(`span`,{className:`text-[52px] leading-none text-ink`,style:{fontFamily:`"${n}", var(--font-sans)`},children:`Aa`})]})}return(0,I.jsx)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft text-muted`,children:(0,I.jsx)(Z,{name:`file`,size:28})})}function ek({system:e}){return e.assets.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:`Assets`,sub:`Click an asset to copy its import path.`}),(0,I.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(210px, 1fr))`},children:e.assets.map((e,t)=>(0,I.jsx)(`button`,{type:`button`,title:`Copy the import path`,onClick:()=>AC(`@system/${e.path}`),className:`block cursor-pointer border-0 bg-transparent p-0 text-left`,children:(0,I.jsxs)(nw,{className:`transition-colors hover:border-rule-strong`,children:[(0,I.jsx)($O,{asset:e,index:t}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-3.5 py-2.5`,children:[(0,I.jsx)(`span`,{className:`truncate text-[13.5px] font-medium text-ink`,children:e.name}),(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[12.5px] text-muted`,children:[(0,I.jsx)(`span`,{className:`shrink-0`,children:jO(e.size)}),(0,I.jsx)(Q,{size:12,className:`truncate`,children:e.path})]})]})]})},e.path))})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:`Assets`}),(0,I.jsxs)(XO,{title:`No assets`,children:[`Put logos, icons, images and font files in `,(0,I.jsx)(Q,{children:`.design/system/assets`}),`; screens import them as`,` `,(0,I.jsx)(Q,{children:`@system/assets/…`}),`.`]})]})}function tk({color:e,label:t,className:n}){return e?(0,I.jsx)(`span`,{title:`${t}: ${e}`,className:X(`checker relative h-[30px] w-[44px] shrink-0 overflow-hidden rounded-[6px]`,n),children:(0,I.jsx)(`span`,{className:`absolute inset-0 rounded-[6px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.12)]`,style:{background:e}})}):(0,I.jsx)(`span`,{className:X(`h-[30px] w-[44px] shrink-0`,n)})}function nk({tokens:e}){let t=e.some(e=>e.dark),n=t=>(0,I.jsxs)(`div`,{className:`relative flex h-9 min-w-0 grow overflow-hidden rounded-[6px]`,children:[(0,I.jsx)(`span`,{className:`pointer-events-none absolute inset-0 z-10 rounded-[6px] shadow-[inset_0_0_0_1px_var(--rule-strong)] opacity-60`}),e.map(e=>{let n=t===`dark`?e.dark?.value??e.light?.value:e.light?.value;return(0,I.jsx)(`button`,{type:`button`,title:`${e.name}: ${n}`,onClick:()=>AC(`var(${e.name})`),className:`h-full min-w-0 flex-1 cursor-pointer border-0 p-0 transition-[flex-grow] duration-150 hover:grow-[1.6]`,style:{background:n}},e.name)})]});return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-rule px-4 py-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t?(0,I.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Light`}):null,n(`light`)]}),t?(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Dark`}),n(`dark`)]}):null]})}function rk({token:e}){return(0,I.jsxs)(lw,{cols:`100px minmax(170px, 0.9fr) minmax(0, 1.4fr)`,minH:56,title:`Copy the variable`,onClick:()=>AC(`var(${e.name})`),children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(tk,{color:e.light?.value,label:`Light`}),e.dark?(0,I.jsx)(tk,{color:e.dark.value,label:`Dark`}):null]}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,I.jsx)(YO,{items:HO(e).slice(0,2)})]}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-wrap gap-x-3`,children:[(0,I.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),e.dark?(0,I.jsxs)(Q,{size:12,className:`text-muted`,children:[`dark `,e.dark.value]}):null]}),e.description?(0,I.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description}):null]})]})}function ik({system:e}){let t=UO(e.tokens,`color`),n=WO(t);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:`Colors`,sub:t.length?`${t.length} tokens · click a color to copy its variable`:void 0}),n.length?n.map(({group:e,tokens:t})=>(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:e,count:t.length}),(0,I.jsx)(nk,{tokens:t}),t.map(e=>(0,I.jsx)(rk,{token:e},e.name))]},e)):(0,I.jsxs)(XO,{title:`No color tokens`,children:[`Add them to `,(0,I.jsx)(Q,{children:ZO}),`: light values in `,(0,I.jsx)(Q,{children:`:root`}),`, dark ones in`,` `,(0,I.jsx)(Q,{children:`:root[data-theme="dark"]`}),`, and map them to Tailwind with `,(0,I.jsx)(Q,{children:`--color-*`}),` in`,` `,(0,I.jsx)(Q,{children:`@theme inline`}),`.`]})]})}function ak({src:e,theme:t,title:n,minHeight:r=120,width:i,className:a}){let o=(0,v.useRef)(null),{frameSandbox:s}=Jg(),[c]=(0,v.useState)(()=>({src:e,theme:t})),l=RC(e,c.src===e?c.theme:t),[u,d]=(0,v.useState)(r),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let e=o.current;if(e)return p(!1),h([]),MC(e,e=>{e.type===`size`?d(Math.max(r,e.height)):e.type===`ready`?p(!0):e.type===`error`?h(t=>t.includes(e.message)?t:[...t,e.message]):e.type===`updated`&&h([])})},[r,l]),(0,v.useEffect)(()=>{FC(o.current,t)},[t]),(0,I.jsxs)(`div`,{className:X(`relative`,a),style:{width:i},children:[m.length?(0,I.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2.5 text-[12.5px] text-danger-text`,children:[(0,I.jsx)(Z,{name:`alert`,size:15,className:`mt-px`}),(0,I.jsx)(`div`,{className:`min-w-0 font-mono break-words`,children:m.join(`
129
- `)})]}):null,(0,I.jsx)(`iframe`,{ref:o,src:l,title:n,sandbox:s,className:X(`block w-full border-0 transition-opacity duration-150`,f?`opacity-100`:`opacity-0`),style:{height:u,colorScheme:t},onLoad:()=>FC(o.current,t)},l),f?null:(0,I.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-muted`,children:(0,I.jsx)(Z,{name:`loader`,size:18})})]})}var ok=`identifier keyword string class property entity jsxliterals sign comment break space`.split(` `),[sk,ck,lk,uk,dk,fk,pk,mk,hk,gk,_k]=ok.map((e,t)=>t);new Map(ok.map((e,t)=>[e,t]));function vk(e,t){let n=[],r=0,i=[],a=!1;function o(e){n.push({index:r++,value:e.map(([,e])=>e).join(``),tokens:e.map(([e,t])=>({type:ok[e],value:t})),annotations:[]})}for(let e=0;e<t.length;e++){let n=t[e],[r,s]=n;if(r!==gk){if(s.includes(`
130
- `)){let e=s.split(`
131
- `);for(let t=0;t<e.length;t++)i.push([r,e[t]]),t<e.length-1&&(o(i),i.length=0)}else i.push(n);a=!1}else a?o([]):(o(i),i.length=0),e===t.length-1&&o([]),a=!0}return i.length&&o(i),{value:e,lines:n}}function yk(e,t){let n={index:e.index,value:e.value,tokens:e.tokens,annotations:e.annotations,className:`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,style:{},properties:{}};return t?.(n),n}function bk({type:e,value:t},n,r){let i=n?.[e],a={type:e,value:t,className:`sh__token--${e}${i?` ${i}`:``}`,style:{color:`var(--sh-${e})`},properties:{}};return r?.(a),a}function xk(e,t){let n=t?.cx,r=t?.mark,i=t?.markLine;return!n&&!r&&!i?e.lines.map(e=>{let t=`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,n=e.tokens.map(({type:e,value:t})=>`<span class="sh__token--${e}" style="color:var(--sh-${e})">${Ck(t)}</span>`).join(``);return`<span class="${Ck(t)}">${n}</span>`}).join(`
132
- `):e.lines.map(e=>{let t=yk(e,i),a=e.tokens.map(e=>{let t=bk(e,n,r);return`<span ${wk({...t.properties,className:t.className,style:t.style})}>${Ck(t.value)}</span>`}).join(``);return`<span ${wk({...t.properties,className:t.className,style:t.style})}>${a}</span>`}).join(`
133
- `)}var Sk={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#039;`},Ck=e=>e.replace(/[&<>"']/g,e=>Sk[e]);function wk(e){let t=Object.entries(e.style||{}).map(([e,t])=>`${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${t}`).join(`;`),n=Object.entries(e).filter(([e,t])=>/^[\w:-]+$/.test(e)&&e!==`className`&&e!==`style`&&t!==!1&&t!=null).map(([e,t])=>t===!0?e:`${e}="${Ck(String(t))}"`).join(` `);return`class="${Ck(e.className||``)}"${t?` style="${Ck(t)}"`:``}${n?` ${n}`:``}`}var Tk=new Set(`+-*/%=!&|^~?:.,;()[]{}<>#@\\`.split(``)),Ek=()=>0,Dk=e=>e===`_`||e===`$`||/[\p{L}\p{N}]/u.test(e);function Ok(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return e[t]===`:`}function kk(e,t){if(typeof t?.tokenize==`function`)return t.tokenize(e,t);let n=t?.keywords||new Set,r=t?.typeKeywords||new Set,i=t?.onCommentStart||Ek,a=t?.onCommentEnd||Ek,o=t?.caseInsensitive?e=>e.toLowerCase():e=>e,s=[],c=``;function l(e,t){t&&(s.push([e,t]),e!==_k&&e!==gk&&(c=t))}for(let s=0;s<e.length;){let u=e[s],d=e[s+1],f=i(u,d,s,e);if(f){let t=s++;for(;s<e.length;){if(a(e[s-1],e[s],s,e,t)==f){s++;break}s++}l(hk,e.slice(t,s));continue}let p=t?.onLiteral?.(u,s,e);if(p){l(lk,e.slice(s,s+p)),s+=p;continue}if(typeof t?.onQuote==`function`&&u===`'`){let n=t.onQuote(u,s,e);if(typeof n==`number`&&n>=1){l(sk,e.slice(s,s+n)),s+=n;continue}}if(u===`"`||u===`'`||t?.templateStrings&&u==="`"){let n=u,r=s++;for(;s<e.length;){if(e[s]===`\\`)s++;else if(e[s]===n){s++;break}s++}let i=e.slice(r,s);l(t?.quotedKeys&&Ok(e,s)?dk:lk,i);continue}if(u===`
134
- `){l(gk,u),s++;continue}if(/[^\S\r\n]/.test(u)){let t=s++;for(;s<e.length&&/[^\S\r\n]/.test(e[s]);)s++;l(_k,e.slice(t,s));continue}if(Dk(u)){let t=s++;for(;s<e.length&&Dk(e[s]);)s++;if(/^\d/.test(u)&&e[s]===`.`&&/\d/.test(e[s+1]||``))for(s++;s<e.length&&Dk(e[s]);)s++;let i=e.slice(t,s),a=o(i);l(r.has(a)?uk:n.has(a)?ck:c===`.`?dk:/^\d/.test(i)||i===`null`||/^\p{Lu}/u.test(i)?uk:sk,i);continue}if(Tk.has(u)){l(mk,u),s++;continue}l(lk,u),s++}return s}function Ak(e,t){let n=vk(e,kk(e,t));if(t?.annotateLine)for(let e of n.lines)t.annotateLine(e);return n}var jk=(e,t)=>{let n=e+t;return n===`//`?1:n===`/*`?2:0},Mk=(e,t)=>t===`
135
- `?1:e+t===`*/`?2:0,Nk=s({keywords:()=>Fk,onCommentEnd:()=>Mk,onCommentStart:()=>jk,typeKeywords:()=>Pk}),Pk=new Set([`void`,`char`,`short`,`int`,`long`,`float`,`double`,`signed`,`unsigned`,`_Bool`,`_Complex`,`_Imaginary`]),Fk=new Set(`auto.break.case.const.continue.default.do.else.enum.extern.for.goto.if.inline.register.restrict.return.sizeof.static.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local`.split(`.`)),Ik=s({keywords:()=>Lk,onCommentEnd:()=>Mk,onCommentStart:()=>jk,typeKeywords:()=>Rk}),Lk=new Set(`alignas.alignof.and.and_eq.asm.auto.bitand.bitor.break.case.catch.class.compl.concept.const.consteval.constexpr.constinit.const_cast.continue.co_await.co_return.co_yield.decltype.default.delete.do.dynamic_cast.else.enum.explicit.export.extern.false.for.friend.goto.if.inline.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.private.protected.public.register.reinterpret_cast.requires.return.sizeof.static.static_assert.static_cast.struct.switch.template.this.thread_local.throw.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`)),Rk=new Set([`bool`,`char`,`char8_t`,`char16_t`,`char32_t`,`double`,`float`,`int`,`long`,`short`,`signed`,`unsigned`,`void`,`wchar_t`]),zk=s({keywords:()=>Bk,onCommentEnd:()=>Mk,onCommentStart:()=>jk,typeKeywords:()=>Vk}),Bk=new Set(`abstract.as.async.await.base.break.case.catch.checked.class.const.continue.default.delegate.do.else.enum.event.explicit.extern.false.finally.fixed.for.foreach.from.get.global.goto.if.implicit.in.init.interface.internal.into.is.join.let.lock.namespace.new.null.on.operator.orderby.out.override.params.partial.private.protected.public.readonly.record.ref.remove.required.return.sealed.select.set.sizeof.stackalloc.static.struct.switch.this.throw.true.try.typeof.unchecked.unsafe.using.value.virtual.volatile.when.where.while.with.yield`.split(`.`)),Vk=new Set([`bool`,`byte`,`char`,`decimal`,`double`,`dynamic`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`uint`,`ulong`,`ushort`,`void`]),Hk=s({keywords:()=>Uk,onCommentEnd:()=>Gk,onCommentStart:()=>Wk,onLiteral:()=>Kk,tokenize:()=>eA}),Uk=new Set([`@media`,`@import`,`@keyframes`,`@font-face`,`@supports`,`@page`,`@counter-style`,`@font-feature-values`,`@viewport`,`@counter-style`,`@font-feature-values`,`@document`]),Wk=(e,t)=>+(e+t===`/*`),Gk=(e,t)=>+(e+t===`*/`),Kk=(e,t,n)=>e===`#`&&n.slice(t).match(/^#(?:[\da-f]{8}|[\da-f]{6}|[\da-f]{4}|[\da-f]{3})(?![\w-])/i)?.[0].length||0,qk=e=>e===_k||e===gk||e===hk,Jk=([e,t])=>e===sk||e===uk||e===mk&&t===`-`,Yk=([e])=>e===sk||e===uk||e===dk,Xk=e=>Yk(e)&&!/^\d/.test(e[1]),Zk=([e,t])=>e===mk&&t===`-`,Qk=e=>{for(let t=0;t<e.length;t++){let n=t,r=t;if(Zk(e[r])){for(;e[r]&&Zk(e[r]);)r++;if(!e[r]||!Xk(e[r]))continue;n=r++}else if(Xk(e[r]))r++;else continue;let i=n>t;for(;e[r]&&Zk(e[r]);){let t=r;for(;e[r]&&Zk(e[r]);)r++;if(!e[r]||!Yk(e[r])){r=t;break}i=!0,r++}if(!i)continue;let a=e.slice(t,r).map(([,e])=>e).join(``);e.splice(t,r-t,[e[n][0],a])}},$k=(e,t)=>{let n=0,r=0;for(let i=t;i<e.length;i++){let[t,a]=e[i];if(t===mk){if(a===`(`)n++;else if(a===`)`)n--;else if(a===`[`)r++;else if(a===`]`)r--;else if(!n&&!r&&a===`{`)return!0;else if(!n&&!r&&(a===`;`||a===`}`))return!1}}return!1},eA=(e,t)=>{let n=kk(e,{...t,tokenize:void 0});Qk(n);let r=0,i=!1;for(let e=0;e<n.length;e++){let[t,a]=n[e];if(t===mk&&a===`{`){r++,i=!0;continue}if(t===mk&&a===`}`){r--,i=!1;continue}if(t===mk&&a===`;`){i=r>0;continue}if(!i||qk(t))continue;let o=e,s=e;for(;s<n.length&&Jk(n[s]);)s++;let c=s;for(;c<n.length&&qk(n[c][0]);)c++;if(s>o&&n[c]?.[0]===mk&&n[c][1]===`:`&&!$k(n,c+1)){let e=n.slice(o,s).map(([,e])=>e).join(``);n.splice(o,s-o,[dk,e])}i=!1}return n},tA=s({annotateLine:()=>rA,keywords:()=>nA}),nA=new Set([]),rA=e=>{let t=``;if(e.value.startsWith(`+`)&&!e.value.startsWith(`+++`))t=`diff-add`;else if(e.value.startsWith(`-`)&&!e.value.startsWith(`---`))t=`diff-remove`;else if(e.value.startsWith(`@@`))t=`diff-hunk`;else if(/^(diff --git|index |--- |\+\+\+ )/.test(e.value)){t=`diff-meta`;for(let t of e.tokens)t.type===`property`&&(t.type=`identifier`)}t&&e.annotations.push(t)},iA=e=>+(e===`#`),aA=(e,t)=>+(t===`
136
- `),oA=s({caseInsensitive:()=>!0,keywords:()=>sA,onCommentEnd:()=>aA,onCommentStart:()=>iA}),sA=new Set([`add`,`arg`,`cmd`,`copy`,`entrypoint`,`env`,`expose`,`from`,`healthcheck`,`label`,`maintainer`,`onbuild`,`run`,`shell`,`stopsignal`,`user`,`volume`,`workdir`]),cA=s({keywords:()=>uA,onCommentEnd:()=>Mk,onCommentStart:()=>jk,typeKeywords:()=>lA}),lA=new Set([`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int`,`int8`,`int16`,`int32`,`int64`,`rune`,`string`,`uint`,`uint8`,`uint16`,`uint32`,`uint64`,`uintptr`]),uA=new Set([`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`]),dA=s({keywords:()=>fA,onCommentEnd:()=>aA,onCommentStart:()=>iA,typeKeywords:()=>pA}),fA=new Set([`directive`,`enum`,`extend`,`fragment`,`implements`,`input`,`interface`,`mutation`,`on`,`query`,`repeatable`,`scalar`,`schema`,`subscription`,`type`,`union`]),pA=new Set([`Boolean`,`Float`,`ID`,`Int`,`String`]),mA=s({keywords:()=>hA,onCommentEnd:()=>_A,onCommentStart:()=>gA}),hA=new Set([`false`,`for`,`if`,`in`,`null`,`true`]),gA=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,_A=(e,t)=>t===`
137
- `?1:e+t===`*/`?2:0,vA=new Set([`<`,`>`,`{`,`}`,`[`,`]`]),yA=new Set(`for.do.while.if.else.return.function.var.let.const.true.false.undefined.this.new.delete.typeof.in.instanceof.void.break.continue.switch.case.default.throw.try.catch.finally.debugger.with.yield.async.await.class.extends.super.import.export.from.static`.split(`.`)),bA=new Set([...yA,`type`,`interface`,`enum`,`implements`,`readonly`,`abstract`,`declare`,`namespace`,`module`,`private`,`protected`,`public`,`override`,`keyof`,`infer`,`is`,`asserts`,`satisfies`,`as`,`unknown`,`never`,`any`,`number`,`string`,`boolean`,`bigint`,`symbol`,`object`]),xA=new Set([`+`,`-`,`*`,`/`,`%`,`=`,`!`,`&`,`|`,`^`,`~`,`!`,`?`,`:`,`.`,`,`,`;`,`'`,`"`,`.`,`(`,`)`,`[`,`]`,`#`,`@`,`\\`,...vA]),SA={keywords:yA,onCommentStart:FA,onCommentEnd:IA,jsx:!0,regex:!0,templateStrings:!0};function CA(e){return{...SA,...e}}function wA(e){let t=0;return/\binterface\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\btype\s+[A-Za-z_$][\w$]*\s*=/.test(e)&&(t+=2),/\benum\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test(e)&&(t+=2),/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test(e)&&(t+=1),/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test(e)&&(t+=1),/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test(e)&&(t+=1),t>=2}function TA(e,t){if(e[t]!==`<`)return!1;let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t===`<`){n++;continue}if(t===`>`){if(n--,n===0){let t=i+1;for(;t<e.length&&/\s/.test(e[t]);)t++;if(!(r&&e[t]===`(`))return!1;let n=e.slice(t,t+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(n)}continue}if(n!==0){if(/[$A-Za-z_]/.test(t)){r=!0;continue}if(!/[\s,\.\=\?\:\|\&\[\]]/.test(t))return!1}}return!1}function EA(e){return/^[^\S\r\n]+$/g.test(e)}function DA(e){return xA.has(e)}function OA(e){return/^[\w$\u0080-\uffff]+$/.test(e||``)}function kA(e){return/^[0-9A-Z\p{Lu}]/u.test(e)||e===`null`}function AA(e){return/^[a-zA-Z]$/.test(e)}function jA(e){return/^[$_A-Za-z\u0080-\uffff]$/.test(e||``)}function MA(e){return jA(e[0])&&OA(e)}function NA(e){return e==="`"}function PA(e){return e===`"`||e===`'`}function FA(e,t){let n=e+t;return n===`/*`?2:+(n===`//`)}function IA(e,t){return e+t===`*/`?2:+(t===`
138
- `)}function LA(e){return e[0]===`/`&&!FA(e[0],e[1])}function RA(e,t){let n=t+1;for(;n<e.length&&/\s/.test(e[n]);)n++;return e[n]===`:`}function zA(e,t){let n=CA(t),r=n.keywords!==SA.keywords,i=typeof n.typescript==`boolean`?n.typescript:wA(e),a=r?n.keywords:i?bA:yA,{onCommentStart:o,onCommentEnd:s}=n,c=n.typeKeywords instanceof Set?n.typeKeywords:null,l=n.jsx!==!1,u=n.regex!==!1,d=n.templateStrings!==!1,f=n.caseInsensitive?e=>e.toLowerCase():e=>e,p=e=>d&&NA(e),m=``,h=-1,g=[-1,``],_=[-2,``],v=[],y=!1,b=0,x=0,S=0,C=0,w=()=>y&&!x&&!b,T=()=>b,E=()=>w()&&C,D=null,O=0,k=!1,A=0,j=0,ee=()=>D!==null,te=()=>k,ne=()=>j>A,re=()=>j>0&&j===A,ie=()=>ee()||ne();function ae(e){let t=e===`
139
- `;if(T()){if(ee())return lk;let[,t]=g;if(MA(e)){if(t===`<`||t===`</`)return fk;if(!S&&/^\s+$/.test(v[v.length-1]?.[1]||``))return dk}}if(E())return pk;if(ee()||ne())return lk;if(c&&c.has(f(e)))return g[1]===`.`?sk:uk;if(a.has(f(e)))return g[1]===`.`?sk:ck;if(t)return gk;if(EA(e))return _k;if(e.split(``).every(DA))return mk;if(kA(e))return T()&&!S?sk:uk;if(MA(e)){let e=g[1]===`.`&&MA(_[1]);if(!ie()&&!e)return sk;if(e)return dk}return lk}let M=(e,t)=>{if(t&&(m=t),m){h=typeof e==`number`?e:ae(m);let t=[h,m];h!==_k&&h!==gk&&(_=g,g=t),T()&&h===mk&&(m===`{`&&S++,m===`}`&&S--),v.push(t)}m=``};for(let t=0;t<e.length;t++){let r=e[t],i=e[t-1],c=e[t+1],d=i+r,f=r+c;if(typeof n.onQuote==`function`&&r===`'`&&!ee()&&!E()&&!ne()){let i=n.onQuote(r,t,e);if(typeof i==`number`&&i>=1&&!Number.isNaN(i)){let n=Math.min(i,e.length-t),r=t+n;M(),m=e.slice(t,r),M(sk),t=r-1;continue}}if(PA(r)&&!E()&&!ne()){M();let i=!1;if(D&&r===D?(D=null,i=!0):D||(D=r,O=v.length),M(lk,r),n.quotedKeys&&i&&RA(e,t))for(let e=O;e<v.length;e++)v[e][0]=dk;continue}if(p(r)){M(),j+=ne()?-1:1,M(lk,r);continue}if(ne()&&f==="${"){A++,M(lk),M(mk,f),t++;continue}if(re()&&r===`}`){M(),A--,M(mk,r);continue}if(w()&&r===`{`){M(),M(mk,r),x=1;continue}if(y){if(!b&&r===`<`){M(),c===`/`?(b=2,m=f,t++):(b=1,m=r),M(mk);continue}if(b){if(r===`>`&&!`/=`.includes(i)){M(),b===1?(b=0,C++):(b=0,y=!1),M(mk,r);continue}if(f===`/>`||f===`</`){m!==`<`&&m!==`/`&&M(),f===`/>`?b=0:C--,C||(y=!1),m=f,t++,M(mk);continue}if(r===`<`){M(),m=r,M(mk);continue}if(r===`-`&&m&&!ie()&&!E()){let n=t+1;for(;n<e.length&&/[$\w-]/.test(e[n]);)n++;M(dk,m+e.slice(t,n)),t=n-1;continue}if(c===`=`&&!ie()&&!EA(r)){EA(m)&&M();let e=m+r;if(MA(e)){M(dk,e);continue}}}}if(l&&!b&&(r===`<`&&jA(c)||f===`</`)){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;let i=n>=0?e[n]:``,[o,s]=g,l=!1,u=!1;if(m&&!EA(m)){let e=m;kA(e)||e===`true`||e===`false`?l=!0:a.has(e)&&MA(e)?u=!0:MA(e)&&(l=!0)}let d=r===`<`&&/[$\w\]\)]/.test(i)&&(l||!u&&(o===sk||o===uk||o===mk&&(s===`)`||s===`]`))),f=r===`<`&&TA(e,t);!d&&!f&&(b=c===`/`?2:1),r===`<`&&(c===`/`||AA(c))&&!d&&!f&&!ie()&&!E()&&!te()&&(y=!0)}let h=PA(r)||p(r),_=ne(),S=u&&!y&&LA(f),T=E();if(h||_||PA(D))m+=r,r===`\\`&&(m+=e[++t]||``);else if(S){M();let[n,i]=g;if(S&&n!==-1&&!(n===mk&&i!==`)`||n===hk)){m=r,M();continue}k=!0;let a=t++,o=!1,s=!1;for(;t<e.length&&e[t]!==`
140
- `;t++){let n=e[t];if(n===`\\`){if(e[t+1]===`
141
- `)break;t++;continue}if(n===`[`&&(s=!0),n===`]`&&(s=!1),n===`/`&&!s){for(o=!0;/^[a-z]$/.test(e[t+1]);)t++;break}}k=!1,a!==t&&o?(m=e.slice(a,t+1),M(lk)):(m=r,M(),t=a)}else if(o(r,c,t,e)){M();let n=t,i=o(r,c,t,e);if(i)for(;t<e.length&&s(e[t-1],e[t],t,e)!=i;t++);m=e.slice(n,t+1),M(hk)}else if(r===` `||r===`
142
- `){if(r===` `&&(EA(m)||!m||T)){let n=t+1;for(;e[n]===` `;)n++;m+=e.slice(t,n),t=n-1,e[n]===`<`&&M()}else M(),m=r,M()}else x&&r===`}`?(M(),m=r,M(),x--):T&&!vA.has(r)||ne()||(OA(r)===OA(m[m.length-1])||w())&&!xA.has(r)?m+=r:(d===`</`&&(m=d),M(),d!==`</`&&(m=r),f===`</`||f===`/>`?(m=f,M(),t++):vA.has(r)&&M()),x&&r===`{`&&x++}return M(),v}var BA=s({tokenize:()=>VA}),VA=zA,HA={keywords:new Set,jsx:!0,regex:!1,templateStrings:!1,onCommentStart:(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,onCommentEnd:(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0},UA=e=>VA(e,HA),WA=/^<\s*(script|style)\b/i,GA=e=>RegExp(`</\\s*${e}\\s*>`,`ig`);function KA(e,t){let n=``;for(let r=t;r<e.length;r++){let t=e[r];if(n)t===n&&(n=``);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return-1}function qA(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith(`<!--`,n)){let t=e.indexOf(`-->`,n+4);n=t===-1?e.length:t+3;continue}if(e[n]!==`<`){n++;continue}let r=KA(e,n);if(r===-1)break;let i=e.slice(n,r).match(WA);if(!i){n=r;continue}let a=i[1].toLowerCase(),o=GA(a);o.lastIndex=r;let s=o.exec(e);if(!s){n=r;continue}t.push({start:n,openEnd:r,closeStart:s.index,end:o.lastIndex,tag:a}),n=o.lastIndex}return t}function JA(e){let t=[],n=0;for(let r of qA(e)){let{start:i,openEnd:a,closeStart:o,end:s,tag:c}=r;t.push(...UA(e.slice(n,i))),t.push(...UA(e.slice(i,a))),t.push(...c===`style`?eA(e.slice(a,o)):VA(e.slice(a,o),{jsx:!1})),t.push(...UA(e.slice(o,s))),n=s}return t.push(...UA(e.slice(n))),t}var YA=s({jsx:()=>!0,keywords:()=>XA,onCommentEnd:()=>$A,onCommentStart:()=>QA,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>ZA}),XA=new Set([]),ZA=JA,QA=(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,$A=(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0,ej=s({keywords:()=>nj,onCommentEnd:()=>Mk,onCommentStart:()=>jk,typeKeywords:()=>tj}),tj=new Set([`boolean`,`byte`,`char`,`double`,`float`,`int`,`long`,`short`,`void`]),nj=new Set(`abstract.assert.break.case.catch.class.const.continue.default.do.else.enum.extends.final.finally.for.goto.if.implements.import.instanceof.interface.native.new.package.private.protected.public.return.static.strictfp.super.switch.synchronized.this.throw.throws.transient.try.volatile.while`.split(`.`)),rj=s({keywords:()=>ij,onCommentEnd:()=>Mk,onCommentStart:()=>jk,quotedKeys:()=>!0}),ij=new Set([`true`,`false`,`null`]),aj=s({keywords:()=>oj,onCommentEnd:()=>Mk,onCommentStart:()=>jk,typeKeywords:()=>sj}),oj=new Set(`as.break.by.catch.class.companion.const.constructor.continue.data.do.else.enum.false.finally.for.fun.get.if.import.in.infix.init.interface.internal.is.lateinit.noinline.null.object.open.operator.out.override.package.private.protected.public.reified.return.sealed.set.suspend.tailrec.this.throw.true.try.typealias.val.var.vararg.when.where.while`.split(`.`)),sj=new Set([`Any`,`Boolean`,`Byte`,`Char`,`Double`,`Float`,`Int`,`Long`,`Nothing`,`Short`,`String`,`Unit`]),cj=s({keywords:()=>lj,onCommentEnd:()=>dj,onCommentStart:()=>uj,onLiteral:()=>fj}),lj=new Set([`and`,`break`,`do`,`else`,`elseif`,`end`,`false`,`for`,`function`,`goto`,`if`,`in`,`local`,`nil`,`not`,`or`,`repeat`,`return`,`then`,`true`,`until`,`while`]);function uj(e,t,n,r){return e===`#`&&n===0&&t===`!`?1:e+t===`--`?/^--\[=*\[/.test(r.slice(n))?2:1:0}function dj(e,t,n,r,i){if(t===`
143
- `)return 1;if(t!==`]`)return 0;let a=r.slice(i).match(/^--\[(=*)\[/);if(!a)return 0;let o=`]${a[1]}]`;return r.slice(n-o.length+1,n+1)===o?2:0}function fj(e,t,n){if(e!==`[`)return 0;let r=n.slice(t).match(/^\[(=*)\[/);if(!r)return 0;let i=`]${r[1]}]`,a=n.indexOf(i,t+r[0].length);return a===-1?n.length-t:a+i.length-t}var pj=()=>0,mj=()=>0,hj=s({annotateLine:()=>vj,keywords:()=>gj,onCommentEnd:()=>mj,onCommentStart:()=>pj,tokenize:()=>_j}),gj=new Set([]),_j=e=>{let t=[],n=``,r=!1,i=(e,n)=>{if(!n)return;let r=t[t.length-1];r?.[0]===e?r[1]+=n:t.push([e,n])};for(let t of e.match(/[^\n]*(?:\n|$)/g)||[]){if(!t)continue;let e=t.endsWith(`
144
- `)?`
145
- `:``,a=e?t.slice(0,-1):t,o=[],s=a.match(/^(?: {0,3}>[ \t]?)*/)?.[0]||``;if(!n||r)for(let e of s.matchAll(/>/g))o.push([e.index,e.index+1]);let c=s.length,l=0;for(;l<3&&a[c]===` `;)c++,l++;let u=a.slice(c).match(/^(`{3,}|~{3,})/)?.[1];if(n)u?.[0]===n[0]&&u.length>=n.length&&/^\s*$/.test(a.slice(c+u.length))&&(o.push([c,c+u.length]),n=``,r=!1);else if(u)o.push([c,c+u.length]),n=u,r=s.includes(`>`);else{let e=a.slice(c).match(/^(#{1,6}(?=\s)|(?:[-+*]|\d+[.)])(?=\s)|(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$)/)?.[1];e&&o.push([c,c+e.length]);for(let e of a.matchAll(/(`+)(.*?)\1|(\*{1,3}|_{1,3}|~{2})(?=\S)(.*?\S)\3/g)){let t=e[1]||e[3];a[e.index-1]===`\\`||t[0]===`_`&&/\w/.test(a[e.index-1]||``)||o.push([e.index,e.index+t.length],[e.index+e[0].length-t.length,e.index+e[0].length])}}let d=0;for(let[e,t]of o.sort((e,t)=>e[0]-t[0]))e<d||(i(sk,a.slice(d,e)),i(mk,a.slice(e,t)),d=t);i(sk,a.slice(d)+e)}return t},vj=e=>{let t=``;/^#{1,6}\s/.test(e.value)?t=`markdown-heading`:/^\s*>/.test(e.value)?t=`markdown-quote`:/^\s*(?:[-*+] |\d+[.)] )/.test(e.value)?t=`markdown-list`:/^\s*```/.test(e.value)&&(t=`markdown-fence`),t&&e.annotations.push(t)},yj=s({keywords:()=>bj,onCommentEnd:()=>Cj,onCommentStart:()=>Sj,typeKeywords:()=>xj}),bj=new Set(`abstract.and.array.as.break.callable.case.catch.class.clone.const.continue.declare.default.do.echo.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.exit.extends.false.final.finally.fn.for.foreach.from.function.global.goto.if.implements.include.include_once.instanceof.insteadof.interface.isset.list.match.namespace.new.null.or.print.private.protected.public.readonly.require.require_once.return.static.switch.throw.trait.true.try.unset.use.var.while.xor.yield`.split(`.`)),xj=new Set([`bool`,`float`,`int`,`iterable`,`mixed`,`never`,`object`,`string`,`void`]),Sj=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,Cj=(e,t)=>t===`
146
- `?1:e+t===`*/`?2:0,wj=s({tokenize:()=>Tj}),Tj=e=>[[sk,e]],Ej=s({caseInsensitive:()=>!0,keywords:()=>Dj,onCommentEnd:()=>kj,onCommentStart:()=>Oj}),Dj=new Set(`begin.break.catch.class.continue.data.define.do.dynamicparam.else.elseif.end.enum.exit.filter.finally.for.foreach.from.function.if.in.param.process.return.switch.throw.trap.try.until.using.while`.split(`.`)),Oj=(e,t)=>e===`#`?1:e+t===`<#`?2:0,kj=(e,t)=>t===`
147
- `?1:e+t===`#>`?2:0,Aj=s({keywords:()=>jj,onCommentEnd:()=>Nj,onCommentStart:()=>Mj}),jj=new Set(`and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield`.split(`.`)),Mj=(e,t)=>+(e===`#`),Nj=(e,t)=>+(t===`
148
- `),Pj=s({keywords:()=>Fj,onCommentEnd:()=>Rj,onCommentStart:()=>Lj}),Fj=new Set(`BEGIN.END.__ENCODING__.__FILE__.__LINE__.alias.and.begin.break.case.class.def.defined.do.else.elsif.end.ensure.false.for.if.in.module.next.nil.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield`.split(`.`));function Ij(e,t){return e>0&&t[e-1]!==`
149
- `?!1:/^=begin(?:\s|$)/.test(t.slice(e))}function Lj(e,t,n,r){return e===`#`?1:e===`=`&&Ij(n,r)?2:0}function Rj(e,t,n,r){if(t!==`
150
- `)return 0;let i=r.lastIndexOf(`
151
- `,n-1)+1,a=r.slice(i,n);return/^=end(?:\s|$)/.test(a)?2:1}var zj=s({keywords:()=>Bj,onQuote:()=>Vj}),Bj=new Set(`as.break.const.continue.crate.else.enum.extern.false.fn.for.if.impl.in.let.loop.match.mod.move.mut.pub.ref.return.self.Self.static.struct.super.trait.true.type.unsafe.use.where.while.async.await.dyn.abstract.become.box.do.final.macro.override.priv.typeof.unsized.virtual.yield.try`.split(`.`));function Vj(e,t,n){if(e!==`'`||t+1>=n.length)return 1;let r=n[t+1];if(r===`\\`){let e=t+2;for(;e<n.length;){if(n[e]===`\\`){e+=2;continue}if(n[e]===`'`)return e-t+1;e++}return n.length-t}if(r===`_`)return 2;if(/[a-zA-Z]/.test(r)){let e=t+2;for(;e<n.length&&/[a-zA-Z0-9_]/.test(n[e]);)e++;return e<n.length&&n[e]===`'`?e-t+1:e-t}return 1}var Hj=s({keywords:()=>Uj,onCommentEnd:()=>aA,onCommentStart:()=>iA}),Uj=new Set([`case`,`coproc`,`do`,`done`,`elif`,`else`,`esac`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`readonly`,`return`,`select`,`then`,`time`,`until`,`while`]),Wj=s({caseInsensitive:()=>!0,keywords:()=>Gj,onCommentEnd:()=>Jj,onCommentStart:()=>qj,typeKeywords:()=>Kj}),Gj=new Set(`add.all.alter.and.as.asc.between.by.case.check.column.constraint.create.cross.database.default.delete.desc.distinct.drop.else.end.exists.foreign.from.full.group.having.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.primary.references.right.select.set.table.then.union.unique.update.values.view.when.where.with`.split(`.`)),Kj=new Set([`bigint`,`binary`,`bit`,`blob`,`boolean`,`char`,`date`,`datetime`,`decimal`,`double`,`float`,`int`,`integer`,`interval`,`json`,`numeric`,`real`,`smallint`,`text`,`time`,`timestamp`,`uuid`,`varchar`]),qj=(e,t)=>{let n=e+t;return n===`--`?1:n===`/*`?2:0},Jj=(e,t)=>t===`
152
- `?1:e+t===`*/`?2:0,Yj=s({keywords:()=>Xj,onCommentEnd:()=>Mk,onCommentStart:()=>jk,typeKeywords:()=>Zj}),Xj=new Set(`as.associatedtype.break.case.catch.class.continue.convenience.default.defer.deinit.didSet.do.dynamic.else.enum.extension.fallthrough.false.fileprivate.final.for.func.get.guard.if.import.in.indirect.infix.init.inout.internal.is.lazy.let.mutating.nil.nonmutating.open.operator.override.precedencegroup.private.protocol.public.repeat.required.rethrows.return.self.set.some.static.struct.subscript.super.switch.throw.throws.true.try.typealias.unowned.var.weak.where.while.willSet`.split(`.`)),Zj=new Set([`Any`,`Bool`,`Character`,`Double`,`Float`,`Int`,`Never`,`String`,`UInt`,`Void`]),Qj=s({keywords:()=>$j,onCommentEnd:()=>aA,onCommentStart:()=>iA,quotedKeys:()=>!0}),$j=new Set([`false`,`true`]),eM=s({tokenize:()=>tM}),tM=(e,t)=>zA(e,{...t,typescript:!0}),nM=s({jsx:()=>!0,keywords:()=>XA,onCommentEnd:()=>$A,onCommentStart:()=>QA,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>JA}),rM=s({jsx:()=>!0,keywords:()=>XA,onCommentEnd:()=>$A,onCommentStart:()=>QA,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>JA}),iM=s({keywords:()=>aM,onCommentEnd:()=>aA,onCommentStart:()=>iA,quotedKeys:()=>!0}),aM=new Set([`false`,`False`,`FALSE`,`no`,`No`,`NO`,`null`,`Null`,`NULL`,`off`,`Off`,`OFF`,`on`,`On`,`ON`,`true`,`True`,`TRUE`,`yes`,`Yes`,`YES`]),oM=s({keywords:()=>sM,onCommentEnd:()=>uM,onCommentStart:()=>lM,onLiteral:()=>dM,typeKeywords:()=>cM}),sM=new Set(`addrspace.align.allowzero.and.anyframe.anytype.asm.async.await.break.callconv.catch.comptime.const.continue.defer.else.enum.errdefer.error.export.extern.false.fn.for.if.inline.linksection.noalias.noinline.nosuspend.null.opaque.or.orelse.packed.pub.resume.return.struct.suspend.switch.test.threadlocal.true.try.undefined.union.unreachable.usingnamespace.var.volatile.while`.split(`.`)),cM=new Set(`anyerror.anyopaque.bool.c_char.c_int.c_long.c_longdouble.c_longlong.c_short.c_uint.c_ulong.c_ulonglong.c_ushort.comptime_float.comptime_int.f16.f32.f64.f80.f128.i8.i16.i32.i64.i128.isize.noreturn.type.u8.u16.u32.u64.u128.usize.void`.split(`.`)),lM=(e,t)=>+(e+t===`//`),uM=(e,t)=>+(t===`
153
- `);function dM(e,t,n){if(e!==`\\`||n[t+1]!==`\\`)return 0;let r=n.lastIndexOf(`
154
- `,t-1)+1;if(n.slice(r,t).trim())return 0;let i=n.indexOf(`
155
- `,t+2);return(i===-1?n.length:i)-t}function fM(e){return{...e,jsx:!1,regex:!1,templateStrings:!1}}function pM(){return{javascript:BA,typescript:eM,css:fM(Hk),python:fM(Aj),c:fM(Nk),go:fM(cA),java:fM(ej),rust:fM(zj),json:fM(rj),diff:fM(tA),shell:fM(Hj),cpp:fM(Ik),csharp:fM(zk),sql:fM(Wj),html:YA,vue:rM,svelte:nM,yaml:fM(iM),markdown:fM(hj),plaintext:fM(wj),ruby:fM(Pj),kotlin:fM(aj),swift:fM(Yj),php:fM(yj),toml:fM(Qj),powershell:fM(Ej),dockerfile:fM(oA),graphql:fM(dA),hcl:fM(mA),zig:fM(oM),lua:fM(cj)}}var mM=pM();function hM(e){return mM[e||`javascript`]}function gM(e,t){let{lang:n,cx:r,mark:i,markLine:a}=t||{};return xk(Ak(e,hM(n)),{cx:r,mark:i,markLine:a})}function _M({code:e,path:t,className:n}){let r=e.replace(/\n$/,``),i=(0,v.useMemo)(()=>gM(r),[r]),a=r.split(`
156
- `).length;return(0,I.jsxs)(`div`,{className:X(`flex min-w-0 flex-col`,n),children:[t?(0,I.jsxs)(`div`,{className:`flex h-10 items-center justify-between gap-3 border-b border-rule bg-soft pr-1.5 pl-4`,children:[(0,I.jsx)(Q,{size:12,className:`truncate text-muted`,title:t,children:t}),(0,I.jsx)(j_,{icon:`copy`,label:`Copy file`,size:15,onClick:()=>AC(e,`Copied the file`)})]}):null,(0,I.jsxs)(`div`,{className:`flex max-h-[640px] min-w-0 overflow-auto font-mono text-[12.5px] leading-[1.6]`,children:[(0,I.jsx)(`pre`,{"aria-hidden":`true`,className:`sticky left-0 m-0 shrink-0 select-none border-r border-rule bg-surface py-3 pr-3 pl-4 text-right text-muted`,children:Array.from({length:a},(e,t)=>t+1).join(`
157
- `)}),(0,I.jsx)(`pre`,{className:`m-0 min-w-0 grow py-3 pr-6 pl-4 text-ink`,children:(0,I.jsx)(`code`,{dangerouslySetInnerHTML:{__html:i}})})]})]})}var vM={beta:`action`,experimental:`action`,draft:`action`,deprecated:`danger`,stable:`ok`},yM=`.design/system/components/`;function bM(e){return e.startsWith(yM)?`@system/components/${e.slice(26).replace(/\.(tsx|jsx|ts|js)$/,``).replace(/\/index$/,``)}`:null}function xM(e){let t=new Set;for(let n of e.matchAll(/export\s+(?:async\s+)?(?:function|const|class|let)\s+([A-Za-z_$][\w$]*)/g))t.add(n[1]);for(let n of e.matchAll(/export\s*\{([^}]+)\}/g))for(let e of n[1].split(`,`)){let n=e.trim().split(/\s+as\s+/).pop()?.trim();n&&n!=="default"&&t.add(n)}return[...t].filter(e=>/^[A-Z]/.test(e))}function SM({path:e}){let t=bM(e),n=e_(t?e:null).data;if(!t)return null;let r=n?xM(n):[],i=`import { ${r.length?r.join(`, `):`…`} } from '${t}'`;return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule py-1.5 pr-1.5 pl-4`,children:[(0,I.jsx)(Q,{size:12.5,className:`min-w-0 truncate text-ink2`,title:i,children:i}),(0,I.jsx)(j_,{icon:`copy`,label:`Copy the import`,size:14,className:`ml-auto`,onClick:()=>AC(i)})]})}function CM({component:e,theme:t,width:n}){return n===`fill`?(0,I.jsx)(ak,{src:e.url,theme:t,title:e.title,minHeight:160}):(0,I.jsx)(`div`,{className:`flex justify-center overflow-x-auto bg-soft p-6`,children:(0,I.jsx)(`div`,{className:`shrink-0 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-frame`,children:(0,I.jsx)(ak,{src:e.url,theme:t,title:e.title,minHeight:160,width:Number(n)})})})}function wM({component:e}){let t=[...e.sources,e.specimen],[n,r]=(0,v.useState)(t[0]),i=t.includes(n)?n:t[0],{data:a,error:o,isLoading:s}=e_(i);return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[t.length>1?(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-rule px-4 py-2.5`,children:(0,I.jsx)(kw,{label:`File`,size:`sm`,value:i,onChange:r,items:t.map(t=>({value:t,label:t===e.specimen?`${TM(t)} · specimen`:TM(t),title:t}))})}):null,bM(i)?(0,I.jsx)(SM,{path:i}):null,o?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-6 text-[13px] text-danger-text`,children:[(0,I.jsx)(Z,{name:`alert`,size:15}),o.message]}):s||a===void 0?(0,I.jsx)(`div`,{className:`flex items-center justify-center py-10 text-muted`,children:(0,I.jsx)(Z,{name:`loader`,size:18})}):(0,I.jsx)(_M,{code:a,path:i})]})}function TM(e){return e.split(`/`).pop()??e}function EM({system:e,id:t}){let n=e.components.find(e=>e.id===t),[r,i]=(0,v.useState)(`preview`),[a,o]=qO(),[s,c]=(0,v.useState)(`fill`),l=!Jg().frameSandbox;if(!n)return(0,I.jsx)(Cw,{title:`No such component`,text:`There is no specimen "${t}" in .design/system/specimens.`});let u=n.status?.toLowerCase();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:n.title,badge:(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(ew,{children:n.group}),u?(0,I.jsx)(ew,{tone:vM[u]??`neutral`,children:n.status}):null]}),sub:n.description}),(0,I.jsxs)(nw,{children:[(0,I.jsx)(iw,{value:r,onChange:i,items:[{value:`preview`,label:`Preview`},{value:`code`,label:`Code`,count:n.sources.length+1}],right:r===`preview`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(kw,{label:`Width`,size:`sm`,value:s,onChange:c,items:[{value:`fill`,label:`Fill`},{value:`768`,label:`768`},{value:`390`,label:`390`}]}),(0,I.jsx)(JO,{value:a,onChange:o}),l?(0,I.jsx)(N_,{icon:`external`,href:zC(RC(n.url,a)),target:`_blank`,rel:`noreferrer`,children:`Open`}):null]}):null}),(0,I.jsx)(`div`,{className:`border-t border-rule`,children:r===`preview`?(0,I.jsx)(CM,{component:n,theme:a,width:s}):(0,I.jsx)(wM,{component:n})})]})]})}function DM(e,t){let n=/^\s*#\s+(.+)\r?\n/.exec(e);return n&&n[1].trim()===t?e.slice(n[0].length):e}function OM({system:e,slug:t}){let n=e.guidelines.find(e=>e.slug===t);if(!n)return(0,I.jsx)(Cw,{title:`No such guideline`,text:`There is no guideline "${t}" in .design/system/guidelines.`});let r=DM(n.markdown,n.title).trim();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:n.title,sub:`Guideline`}),(0,I.jsx)(nw,{children:(0,I.jsx)(`div`,{className:`px-6 py-5`,children:r?(0,I.jsx)(BD,{text:r,className:`max-w-[760px]`}):(0,I.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`This guideline is empty. Write it in `,(0,I.jsx)(Q,{children:`.design/system/guidelines`}),`.`]})})})]})}var kM={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};function AM(e){let t=e.trim();if(kM[t])return kM[t];let n=/^cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)$/.exec(t);if(!n)return null;let r=n.slice(1).map(Number);return r.every(Number.isFinite)?r:null}function jM(e){let t=/^(-?[\d.]+)(ms|s)$/.exec(e.trim());return t?Number(t[1])*(t[2]===`s`?1e3:1):null}var MM=132,NM=22;function PM({bezier:e}){let[t,n,r,i]=e,a=Math.min(0,n,i),o=Math.max(1,n,i),s=88/(o-a),c=e=>NM+e*88,l=e=>NM+(o-e)*s;return(0,I.jsxs)(`svg`,{width:MM,height:MM,viewBox:`0 0 ${MM} ${MM}`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,I.jsx)(`rect`,{x:c(0),y:l(1),width:88,height:l(0)-l(1),className:`fill-none stroke-rule`}),(0,I.jsx)(`line`,{x1:c(0),y1:l(0),x2:c(t),y2:l(n),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,I.jsx)(`line`,{x1:c(1),y1:l(1),x2:c(r),y2:l(i),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,I.jsx)(`path`,{d:`M ${c(0)} ${l(0)} C ${c(t)} ${l(n)}, ${c(r)} ${l(i)}, ${c(1)} ${l(1)}`,className:`fill-none stroke-ink`,strokeWidth:2,strokeLinecap:`round`}),(0,I.jsx)(`circle`,{cx:c(t),cy:l(n),r:3,className:`fill-action`}),(0,I.jsx)(`circle`,{cx:c(r),cy:l(i),r:3,className:`fill-action`})]})}function FM({token:e,duration:t}){let[n,r]=(0,v.useState)(!1),i=e.light?.value??``,a=AM(i);return(0,I.jsxs)(`button`,{type:`button`,title:`Hover to play; click to copy the variable`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),onClick:()=>AC(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col gap-3 rounded-[8px] border border-transparent bg-transparent p-3 text-left transition-colors hover:border-rule hover:bg-soft`,children:[(0,I.jsx)(`span`,{className:`flex h-[132px] items-center justify-center rounded-[6px] bg-soft`,children:a?(0,I.jsx)(PM,{bezier:a}):(0,I.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No curve to draw`})}),(0,I.jsx)(`span`,{className:`relative mx-1 h-2 rounded-full bg-soft2`,children:(0,I.jsx)(`span`,{className:`absolute top-1/2 size-3.5 -translate-y-1/2 rounded-full bg-ink`,style:{left:n?`calc(100% - 14px)`:`0px`,transition:`left ${t}ms ${i||`ease`}`}})}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,I.jsx)(YO,{items:HO(e)}),(0,I.jsx)(QO,{children:i}),e.description?(0,I.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function IM({system:e}){let t=UO(e.tokens,`ease`),n=UO(e.tokens,`duration`),r=UO(e.tokens,`animation`),i=`minmax(170px,1fr) 100px minmax(0,2fr)`,a=`minmax(170px,1fr) minmax(140px,0.7fr) minmax(0,2fr)`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:`Motion`,sub:`Hover an easing to see it move.`}),!t.length&&!n.length&&!r.length?(0,I.jsxs)(XO,{title:`No motion tokens`,children:[`Add `,(0,I.jsx)(Q,{children:`--ease-*`}),` and `,(0,I.jsx)(Q,{children:`--animate-*`}),` to the `,(0,I.jsx)(Q,{children:`@theme`}),` block, and durations as`,` `,(0,I.jsx)(Q,{children:`--duration-*`}),`, in `,(0,I.jsx)(Q,{children:ZO}),`.`]}):null,t.length?(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Easing`,count:t.length}),(0,I.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(190px, 1fr))`},children:t.map(e=>(0,I.jsx)(FM,{token:e,duration:900},e.name))})]}):null,n.length?(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Durations`,count:n.length}),(0,I.jsx)(sw,{cols:i,labels:[`Token`,`Value`,``]}),n.map(e=>{let t=e.light?jM(e.light.value):null;return(0,I.jsxs)(lw,{cols:i,minH:40,onClick:()=>AC(`var(${e.name})`),children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,I.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,I.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),t===null?(0,I.jsx)(`span`,{}):(0,I.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(t/2,480))}})]},e.name)})]}):null,r.length?(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Animations`,count:r.length,sub:`keyframes live in the system stylesheet`}),(0,I.jsx)(sw,{cols:a,labels:[`Token`,`Class`,`Value`]}),r.map(e=>(0,I.jsxs)(lw,{cols:a,minH:40,onClick:()=>AC(`var(${e.name})`),children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,I.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,I.jsx)(YO,{items:HO(e)}),(0,I.jsx)(QO,{children:e.light?.value})]},e.name))]}):null]})}function LM({system:e}){let t=new Set(e.tokens.map(e=>e.kind)),n=[{to:`/system/colors`,label:`Colors`,hint:RM(e,`color`)},{to:`/system/typography`,label:`Typography`},{to:`/system/shape`,label:`Spacing & shape`}];(t.has(`ease`)||t.has(`duration`)||t.has(`animation`))&&n.push({to:`/system/motion`,label:`Motion`}),t.has(`other`)&&n.push({to:`/system/tokens`,label:`Other tokens`,hint:RM(e,`other`)}),e.assets.length&&n.push({to:`/system/assets`,label:`Assets`,hint:e.assets.length});let r=new Map;for(let t of e.components){let e=r.get(t.group)??[];e.push({to:`/system/components/${encodeURIComponent(t.id)}`,label:t.title,hint:t.status}),r.set(t.group,e)}let i=e.guidelines.filter(e=>e.slug!==`overview`);return(0,I.jsxs)(`div`,{className:`flex flex-col max-lg:gap-1 max-lg:[&_nav]:flex-row max-lg:[&_nav]:flex-wrap`,children:[(0,I.jsx)(yw,{label:`Overview`,items:[{to:`/system`,label:`Overview`}]}),(0,I.jsx)(bw,{children:`Foundations`}),(0,I.jsx)(yw,{label:`Foundations`,items:n}),i.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(bw,{children:`Guidelines`}),(0,I.jsx)(yw,{label:`Guidelines`,items:i.map(e=>({to:`/system/guidelines/${encodeURIComponent(e.slug)}`,label:e.title}))})]}):null,[...r].map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(bw,{children:e}),(0,I.jsx)(yw,{label:e,items:t})]},e))]})}function RM(e,t){return e.tokens.filter(e=>e.kind===t).length||void 0}function zM({system:e}){let t=UO(e.tokens,`other`),n=`minmax(170px,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr)`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:`Other tokens`,sub:`Variables that are not colors, type, spacing, shape or motion.`}),t.length?WO(t).map(({group:e,tokens:t})=>(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:e,count:t.length}),(0,I.jsx)(sw,{cols:n,labels:[`Token`,`Light`,`Dark`,`Description`]}),t.map(e=>(0,I.jsxs)(lw,{cols:n,minH:40,title:`Copy the variable`,onClick:()=>AC(`var(${e.name})`),children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,I.jsx)(QO,{children:e.light?.value}),(0,I.jsx)(QO,{children:e.dark?.value??`—`}),(0,I.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description})]},e.name))]},e)):(0,I.jsxs)(XO,{title:`No other tokens`,children:[`Variables in `,(0,I.jsx)(Q,{children:`:root`}),` of `,(0,I.jsx)(Q,{children:ZO}),` that are not colors or lengths show here.`]})]})}function BM(e,...t){return e.tokens.filter(e=>t.includes(e.kind)).length}function VM(e){let t=[{to:`/system/colors`,icon:`palette`,title:`Colors`,text:MO(BM(e,`color`),`token`)},{to:`/system/typography`,icon:`type`,title:`Typography`,text:`${MO(BM(e,`font`),`family`,`families`)} · ${MO(BM(e,`text`),`size`)}`},{to:`/system/shape`,icon:`shape`,title:`Spacing & shape`,text:MO(BM(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),`token`)}],n=BM(e,`ease`,`duration`,`animation`);n&&t.push({to:`/system/motion`,icon:`motion`,title:`Motion`,text:MO(n,`token`)}),e.assets.length&&t.push({to:`/system/assets`,icon:`image`,title:`Assets`,text:MO(e.assets.length,`file`)});let r=e.components[0];return r&&t.push({to:`/system/components/${encodeURIComponent(r.id)}`,icon:`component`,title:`Components`,text:MO(e.components.length,`component`)}),t}function HM({system:e}){return(0,I.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`},children:VM(e).map(e=>(0,I.jsxs)(xe,{href:e.to,className:`flex items-center gap-3 rounded-[10px] border border-rule bg-surface px-4 py-3.5 text-inherit no-underline transition-colors hover:border-rule-strong hover:bg-soft`,children:[(0,I.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[8px] bg-soft2 text-ink2`,children:(0,I.jsx)(Z,{name:e.icon,size:17})}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,I.jsx)(`span`,{className:`text-[14px] font-medium text-ink`,children:e.title}),(0,I.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.text})]})]},e.to))})}function UM({system:e}){let[,t]=N(),n=[{label:`Color tokens`,value:BM(e,`color`),to:`/system/colors`},{label:`Type tokens`,value:BM(e,`font`,`text`,`weight`,`leading`,`tracking`),to:`/system/typography`},{label:`Spacing & shape tokens`,value:BM(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),to:`/system/shape`},{label:`Motion tokens`,value:BM(e,`ease`,`duration`,`animation`),to:`/system/motion`},{label:`Other tokens`,value:BM(e,`other`),to:`/system/tokens`},{label:`Components`,value:e.components.length},{label:`Guidelines`,value:e.guidelines.length}];return(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`At a glance`}),n.filter(e=>e.value||!e.to||e.to===`/system/colors`).map(e=>(0,I.jsxs)(lw,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,onClick:e.to&&e.value?()=>t(e.to):void 0,children:[(0,I.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:e.label}),(0,I.jsx)(tw,{value:e.value})]},e.label)),e.fonts.length?(0,I.jsxs)(lw,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,children:[(0,I.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:`Web fonts`}),(0,I.jsx)(`span`,{className:`flex min-w-0 flex-col items-end gap-0.5`,children:e.fonts.map(e=>(0,I.jsx)(Q,{size:12,className:`max-w-[260px] truncate text-muted`,title:e,children:WM(e)},e))})]}):null]})}function WM(e){try{let t=new URL(e),n=t.searchParams.getAll(`family`).map(e=>e.split(`:`)[0].replace(/\+/g,` `));return n.length?n.join(`, `):t.host}catch{return e}}function GM({system:e}){let t=e.guidelines.find(e=>e.slug===`overview`);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:e.name,sub:e.description}),(0,I.jsx)(mw,{issues:e.issues,title:`Problems in the design system`}),(0,I.jsx)(HM,{system:e}),(0,I.jsxs)(`div`,{className:`grid items-start gap-5 max-xl:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 320px`},children:[t?(0,I.jsx)(nw,{children:(0,I.jsx)(`div`,{className:`px-6 py-5`,children:(0,I.jsx)(BD,{text:t.markdown})})}):(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Overview`}),(0,I.jsxs)(`div`,{className:`border-t border-rule px-4 py-5 text-[13px] text-muted`,children:[`Write the principles every screen follows in `,(0,I.jsx)(Q,{children:`.design/system/guidelines/01-overview.md`}),`; it shows here.`]})]}),(0,I.jsx)(UM,{system:e})]})]})}var KM=[1,2,3,4,6,8,12,16],qM=480;function JM({px:e}){return e===null?(0,I.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`not a plain length`}):(0,I.jsxs)(`span`,{className:`flex h-3 items-center`,children:[(0,I.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(e,qM))},title:`${e}px`}),e>qM?(0,I.jsx)(`span`,{className:`ml-1.5 text-[12px] text-muted`,children:`…`}):null]})}function YM({tokens:e}){let t=e.find(e=>e.name===`--spacing`),n=e.filter(e=>e!==t),r=t?.light?GO(t.light.value):null,i=`minmax(150px,0.8fr) 110px minmax(0,2fr)`;return(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Spacing`,count:e.length,sub:t?`base ${t.light?.value}`:void 0}),(0,I.jsx)(sw,{cols:i,labels:[`Class or token`,`Value`,``]}),t&&r!==null?KM.map(e=>(0,I.jsxs)(lw,{cols:i,minH:36,pad:`6px 16px`,children:[(0,I.jsxs)(Q,{size:12.5,className:`text-ink`,children:[`p-`,e,` · gap-`,e]}),(0,I.jsxs)(Q,{size:12,className:`text-muted`,children:[r*e,`px`]}),(0,I.jsx)(JM,{px:r*e})]},e)):null,n.map(e=>(0,I.jsxs)(lw,{cols:i,minH:40,pad:`6px 16px`,title:`Copy the variable`,onClick:()=>AC(`var(${e.name})`),children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,I.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,I.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),(0,I.jsx)(JM,{px:e.light?GO(e.light.value):null})]},e.name))]})}function XM({token:e,children:t}){return(0,I.jsxs)(`button`,{type:`button`,title:`Copy the variable`,onClick:()=>AC(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col items-stretch gap-2.5 rounded-[8px] border border-transparent bg-transparent p-2 text-left transition-colors hover:border-rule hover:bg-soft`,children:[t,(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,I.jsx)(YO,{items:HO(e)}),(0,I.jsx)(QO,{children:e.light?.value}),e.description?(0,I.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function ZM({title:e,tokens:t,min:n=170,children:r}){return(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:e,count:t.length}),(0,I.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr))`},children:t.map(e=>(0,I.jsx)(XM,{token:e,children:r(e)},e.name))})]})}function QM({tokens:e}){let t=`minmax(170px,1fr) minmax(90px,0.6fr) 110px 90px`;return(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Breakpoints`,count:e.length}),(0,I.jsx)(sw,{cols:t,labels:[`Token`,`Variant`,`Value`,`Pixels`],align:`lllr`}),e.map(e=>{let n=e.light?GO(e.light.value):null;return(0,I.jsxs)(lw,{cols:t,align:`lllr`,minH:40,onClick:()=>AC(`var(${e.name})`),children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,I.jsx)(YO,{items:HO(e)}),(0,I.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),(0,I.jsx)(Q,{size:12,className:`text-muted`,children:n===null?``:`${n}px`})]},e.name)})]})}function $M({system:e}){let t=h_(),n=UO(e.tokens,`spacing`),r=UO(e.tokens,`radius`),i=UO(e.tokens,`shadow`),a=UO(e.tokens,`blur`),o=UO(e.tokens,`breakpoint`),s=!n.length&&!r.length&&!i.length&&!a.length&&!o.length;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:`Spacing & shape`,sub:`Click a token to copy its variable.`}),s?(0,I.jsxs)(XO,{title:`No spacing or shape tokens`,children:[`Add `,(0,I.jsx)(Q,{children:`--spacing`}),` (the base step), `,(0,I.jsx)(Q,{children:`--spacing-*`}),`, `,(0,I.jsx)(Q,{children:`--radius-*`}),`,`,` `,(0,I.jsx)(Q,{children:`--shadow-*`}),` and `,(0,I.jsx)(Q,{children:`--breakpoint-*`}),` to the `,(0,I.jsx)(Q,{children:`@theme`}),` block in`,` `,(0,I.jsx)(Q,{children:ZO}),`.`]}):null,n.length?(0,I.jsx)(YM,{tokens:n}):null,r.length?(0,I.jsx)(ZM,{title:`Radii`,tokens:r,children:e=>(0,I.jsx)(`span`,{className:`flex h-[88px] items-center justify-center rounded-[6px] bg-soft`,children:(0,I.jsx)(`span`,{className:`size-14 border border-rule-strong bg-surface`,style:{borderRadius:e.light?.value}})})}):null,i.length?(0,I.jsx)(ZM,{title:`Shadows`,tokens:i,min:200,children:e=>(0,I.jsx)(`span`,{className:`flex h-[112px] items-center justify-center rounded-[6px] bg-soft`,children:(0,I.jsx)(`span`,{className:`h-[60px] w-[108px] rounded-[8px] bg-surface`,style:{boxShadow:KO(e,t)}})})}):null,a.length?(0,I.jsx)(ZM,{title:`Blur`,tokens:a,children:e=>(0,I.jsxs)(`span`,{className:`relative flex h-[88px] items-center justify-center overflow-hidden rounded-[6px] bg-soft`,children:[(0,I.jsx)(`span`,{className:`absolute left-5 top-4 size-10 rounded-full bg-action`}),(0,I.jsx)(`span`,{className:`absolute right-6 bottom-3 size-12 rounded-[6px] bg-ink2`}),(0,I.jsx)(`span`,{className:`absolute inset-x-6 inset-y-5 rounded-[6px] bg-surface/40`,style:{backdropFilter:`blur(${e.light?.value})`}})]})}):null,o.length?(0,I.jsx)(QM,{tokens:o}):null]})}var eN={font:`Family`,text:`Size`,weight:`Weight`,leading:`Line height`,tracking:`Letter spacing`};function tN(e){return e.kind===`text`?[e.light?.value,e.lineHeight].filter(Boolean).join(` / `):e.light?.value??``}function nN({system:e}){let[t,n]=qO(),r=UO(e.tokens,`font`,`text`,`weight`,`leading`,`tracking`);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vw,{title:`Typography`,sub:`Set in the design system's own stylesheet, with its fonts.`}),e.typographyUrl?(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Specimen`,right:(0,I.jsx)(JO,{value:t,onChange:n})}),(0,I.jsx)(`div`,{className:`border-t border-rule`,children:(0,I.jsx)(ak,{src:e.typographyUrl,theme:t,title:`Typography specimen`,minHeight:200})})]}):null,r.length?(0,I.jsxs)(nw,{children:[(0,I.jsx)(rw,{title:`Tokens`,count:r.length}),(0,I.jsx)(sw,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,labels:[`Token`,`Kind`,`Class`,`Value`]}),r.map(e=>(0,I.jsxs)(lw,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,minH:42,title:`Copy the variable`,onClick:()=>AC(`var(${e.name})`),children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,I.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,I.jsx)(`span`,{className:`text-[13px] text-ink2`,children:eN[e.kind]}),(0,I.jsx)(YO,{items:HO(e)}),(0,I.jsx)(QO,{children:tN(e)})]},e.name))]}):(0,I.jsxs)(XO,{title:`No type tokens`,children:[`Add font families (`,(0,I.jsx)(Q,{children:`--font-*`}),`), sizes (`,(0,I.jsx)(Q,{children:`--text-*`}),` with`,` `,(0,I.jsx)(Q,{children:`--text-*--line-height`}),`) and weights (`,(0,I.jsx)(Q,{children:`--font-weight-*`}),`) to the `,(0,I.jsx)(Q,{children:`@theme`}),` `,`block in `,(0,I.jsx)(Q,{children:ZO}),`. Web fonts go in `,(0,I.jsx)(Q,{children:`system.json`}),` `,(0,I.jsx)(Q,{children:`fonts`}),`.`]})]})}function rN({system:e}){return(0,I.jsx)(`main`,{className:`mx-auto flex w-full max-w-[1440px] grow animate-[q-fade-in_160ms_ease-out] px-8 max-md:px-4`,children:(0,I.jsxs)(`div`,{className:`grid w-full items-start gap-6 max-lg:grid-cols-1! max-lg:gap-0`,style:{gridTemplateColumns:`232px minmax(0, 1fr)`},children:[(0,I.jsx)(`aside`,{className:`sticky top-[52px] flex max-h-[calc(100dvh-52px)] flex-col overflow-y-auto pt-6 pb-4 max-lg:static max-lg:max-h-none max-lg:overflow-visible max-lg:pb-0 max-md:pt-4`,children:(0,I.jsx)(LM,{system:e})}),(0,I.jsx)(`div`,{className:`flex min-w-0 flex-col gap-5 pt-6 pb-7`,children:(0,I.jsxs)(Ce,{children:[(0,I.jsx)(F,{path:`/system`,children:(0,I.jsx)(GM,{system:e})}),(0,I.jsx)(F,{path:`/system/colors`,children:(0,I.jsx)(ik,{system:e})}),(0,I.jsx)(F,{path:`/system/typography`,children:(0,I.jsx)(nN,{system:e})}),(0,I.jsx)(F,{path:`/system/shape`,children:(0,I.jsx)($M,{system:e})}),(0,I.jsx)(F,{path:`/system/motion`,children:(0,I.jsx)(IM,{system:e})}),(0,I.jsx)(F,{path:`/system/tokens`,children:(0,I.jsx)(zM,{system:e})}),(0,I.jsx)(F,{path:`/system/assets`,children:(0,I.jsx)(ek,{system:e})}),(0,I.jsx)(F,{path:`/system/guidelines/:slug`,children:t=>(0,I.jsx)(OM,{system:e,slug:decodeURIComponent(t.slug)})}),(0,I.jsx)(F,{path:`/system/components/:id`,children:t=>(0,I.jsx)(EM,{system:e,id:decodeURIComponent(t.id)})}),(0,I.jsx)(F,{children:(0,I.jsx)(Cw,{title:`No such page`,text:`This page is not part of the design system.`})})]})})]})})}function iN(){return(0,I.jsx)(Sw,{title:`No design system yet`,text:(0,I.jsxs)(I.Fragment,{children:[`Ask your agent to build one from the codebase, or run `,(0,I.jsx)(Q,{children:`design system init`}),` to start from a template in `,(0,I.jsx)(Q,{children:`.design/system`}),`.`]})})}function aN(){let e=Zg().data,t=e?e.system!==null:void 0,{data:n,error:r,isLoading:i}=$g(t===!0);return t===!1||n===null||r instanceof Mg&&r.status===404?(0,I.jsx)(iN,{}):r?(0,I.jsx)(Sw,{title:`Could not load the design system`,text:r.message}):i||!n?null:(0,I.jsx)(rN,{system:n})}function oN(){let e=Zg().data?.name;return(0,v.useEffect)(()=>{e&&(document.title=`${e} · Design`)},[e]),null}function sN(){return(0,I.jsxs)(Ce,{children:[(0,I.jsx)(F,{path:`/c/:canvas/full/:item`,children:e=>(0,I.jsx)(ST,{canvasId:e.canvas,itemId:e.item})}),(0,I.jsx)(F,{path:`/c/:canvas/play/:item`,children:e=>(0,I.jsx)(EO,{canvasId:e.canvas,itemId:e.item})}),(0,I.jsx)(F,{path:`/c/:canvas/p/:page`,children:e=>(0,I.jsx)(vO,{canvasId:e.canvas,pageId:e.page})}),(0,I.jsx)(F,{path:`/c/:canvas`,children:e=>(0,I.jsx)(vO,{canvasId:e.canvas})}),(0,I.jsxs)(F,{path:`/system/*?`,children:[(0,I.jsx)(ZS,{}),(0,I.jsx)(aN,{})]}),(0,I.jsxs)(F,{path:`/`,children:[(0,I.jsx)(ZS,{}),(0,I.jsx)(VO,{})]}),(0,I.jsxs)(F,{children:[(0,I.jsx)(ZS,{}),(0,I.jsx)(Cw,{})]})]})}function cN({canvas:e}){let t=`/c/${encodeURIComponent(e)}`,n=(n,r)=>Yg(n,e)?r:(0,I.jsx)(we,{to:t,replace:!0});return(0,I.jsxs)(Ce,{children:[(0,I.jsx)(F,{path:`/c/:canvas/full/:item`,children:t=>n(t.canvas,(0,I.jsx)(ST,{canvasId:e,itemId:t.item}))}),(0,I.jsx)(F,{path:`/c/:canvas/play/:item`,children:t=>n(t.canvas,(0,I.jsx)(EO,{canvasId:e,itemId:t.item}))}),(0,I.jsx)(F,{path:`/c/:canvas/p/:page`,children:t=>n(t.canvas,(0,I.jsx)(vO,{canvasId:e,pageId:t.page}))}),(0,I.jsx)(F,{path:`/c/:canvas`,children:t=>n(t.canvas,(0,I.jsx)(vO,{canvasId:e}))}),(0,I.jsx)(F,{children:(0,I.jsx)(we,{to:t,replace:!0})})]})}function lN({source:e,base:t=``,frameSandbox:n,slots:r,scope:i,queryClient:a}){let[o]=(0,v.useState)(()=>a??Xg(e.live)),s=a??o,c=(0,v.useMemo)(()=>Ug(Kg(e)),[e]),l=i?.canvas,u=(0,v.useMemo)(()=>({source:e,keys:c,frameSandbox:n,slots:r??{},scope:l===void 0?null:{canvas:l}}),[e,c,n,r,l]);return(0,v.useEffect)(()=>e.live?t_(s,c):void 0,[e,s,c]),(0,I.jsx)(Fe,{client:s,children:(0,I.jsx)(qg.Provider,{value:u,children:(0,I.jsx)(id,{reducedMotion:`user`,children:(0,I.jsxs)(_T,{children:[(0,I.jsx)(oN,{}),(0,I.jsxs)(ve,{base:t,children:[u.scope?(0,I.jsx)(cN,{canvas:u.scope.canvas}):(0,I.jsx)(sN,{}),(0,I.jsx)(S_,{})]}),(0,I.jsx)(kC,{})]})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(v.StrictMode,{children:jg?(0,I.jsx)(ve,{hook:je,hrefs:e=>`#${e}`,children:(0,I.jsx)(lN,{source:zg})}):(0,I.jsx)(lN,{source:Lg})}));