frameboard 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,112 @@
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,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),B=Symbol.for(`react.lazy`),V=Symbol.for(`react.activity`),ee=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.for(`react.view_transition`),re=Symbol.for(`react.recoverable`),H=Symbol.iterator;function U(e){return typeof e!=`object`||!e?null:(e=H&&e[H]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case V:return`Activity`;case ne:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,W=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fp(t),e=pp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function G(e){var t=e.memoizedState;t!==null&&(lh._currentValue=t.memoizedState,pe(_e,e)),t=me.current;var n=pp(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function be(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),lh._currentValue=ce)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!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{we=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ce(n):``}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce(`Lazy`);case 13:return e.child!==t&&t!==null?Ce(`Suspense Fallback`):Ce(`Suspense`);case 19:return Ce(`SuspenseList`);case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return Ce(`Activity`);case 30:return Ce(`ViewTransition`);default:return``}}function De(e){try{var t=``,n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Oe=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Ae=t.unstable_cancelCallback,je=t.unstable_shouldYield,Me=t.unstable_requestPaint,Ne=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,K=null,He=null;function Ue(e){if(typeof Be==`function`&&Ve(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(K,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(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 Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(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-We(n),i=1<<r;t|=e[r],n&=~i}return t}function tt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function it(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function at(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ot(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ot(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function st(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ct(e,t){var n=t&-t;return n=n&42?1:lt(n),(n&(e.suspendedLanes|t))===0?n:0}function lt(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 ut(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function dt(){var e=se.p;return e===0?(e=window.event,e===void 0?32:Th(e.type)):e}function ft(e,t){var n=se.p;try{return se.p=e,t()}finally{se.p=n}}var pt=Math.random().toString(36).slice(2),mt=`__reactFiber$`+pt,ht=`__reactProps$`+pt,gt=`__reactContainer$`+pt,_t=`__reactEvents$`+pt,vt=`__reactListeners$`+pt,yt=`__reactHandles$`+pt,bt=`__reactResources$`+pt,xt=`__reactMarker$`+pt,St=`__reactLoad$`+pt;function Ct(e){delete e[mt],delete e[ht],delete e[vt],delete e[yt]}function wt(e){var t;if(t=e[mt])return t;for(var n=e.parentNode;n;){if(t=n[gt]||n[mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mm(e);e!==null;){if(n=e[mt])return n;e=mm(e)}return t}e=n,n=e.parentNode}return null}function Tt(e){if(e=e[mt]||e[gt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Et(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Dt(e){var t=e[bt];return t||=e[bt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ot(e){e[xt]=!0}function kt(e){e[St]=void 0}var At=new Set,jt={};function Mt(e,t){Nt(e,t),Nt(e+`Capture`,t)}function Nt(e,t){for(jt[e]=t,e=0;e<t.length;e++)At.add(t[e])}var Pt=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]*$`),Ft={},It={};function Lt(e){return Oe.call(It,e)?!0:Oe.call(Ft,e)?!1:Pt.test(e)?It[e]=!0:(Ft[e]=!0,!1)}var Rt=!1;function zt(){var e=Rt;return Rt=!1,e}function Bt(e,t,n){if(Lt(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 Vt(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 Ht(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 Ut(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Wt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Gt(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 Kt(e){if(!e._valueTracker){var t=Wt(e)?`checked`:`value`;e._valueTracker=Gt(e,t,``+e[t])}}function qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Wt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(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=``+Ut(t)):e.value!==``+Ut(t)&&(e.value=``+Ut(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,Ut(n)):o===`number`&&e.value==t?Qt(e,Ut(e.value)):Qt(e,Ut(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=``+Ut(s):e.removeAttribute(`name`)}function Zt(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)){Kt(e);return}n=n==null?``:``+Ut(n),t=t==null?n:``+Ut(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),Kt(e)}function Qt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function $t(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=``+Ut(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 en(e,t,n){t!=null&&(t=``+Ut(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Ut(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ut(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Kt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=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 an(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||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(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]=``,Rt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(an(e,a,r),Rt=!0)}else for(var o in t)t.hasOwnProperty(o)&&an(e,o,t[o])}function sn(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 cn=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`]]),ln=/^[\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 un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Tt(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(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="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ht]||null;if(!a)throw Error(i(90));Xt(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&&qt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(Rd(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ht]||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 bn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.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 Tn=i.slice(e,1<r?1-r:void 0)}function Dn(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 On(){return!0}function kn(){return!1}function An(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)?On:kn,this.isPropagationStopped=kn,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=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=An(jn),Nn=D({},jn,{view:0,detail:0}),Pn=An(Nn),Fn,In,Ln,Rn=D({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yn,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!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=An(Rn),Bn=An(D({},Rn,{dataTransfer:0})),Vn=An(D({},Nn,{relatedTarget:0})),Hn=An(D({},jn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=An(D({},jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=An(D({},jn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Kn={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`},qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qn[e])?!!t[e]:!1}function Yn(){return Jn}var Xn=An(D({},Nn,{key:function(e){if(e.key){var t=Gn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Zn=An(D({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Qn=An(D({},jn,{submitter:0})),$n=An(D({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yn})),er=An(D({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),tr=An(D({},Rn,{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})),nr=An(D({},jn,{newState:0,oldState:0,source:0})),rr=[9,13,27,32],ir=bn&&`CompositionEvent`in window,ar=null;bn&&`documentMode`in document&&(ar=document.documentMode);var or=bn&&`TextEvent`in window&&!ar,sr=bn&&(!ir||ar&&8<ar&&11>=ar),cr=` `,lr=!1;function ur(e,t){switch(e){case`keyup`:return rr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function dr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var fr=!1;function pr(e,t){switch(e){case`compositionend`:return dr(t);case`keypress`:return t.which===32?(lr=!0,cr):null;case`textInput`:return e=t.data,e===cr&&lr?null:e;default:return null}}function mr(e,t){if(fr)return e===`compositionend`||!ir&&ur(e,t)?(e=En(),Tn=wn=Cn=null,fr=!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 sr&&t.locale!==`ko`?null:t.data;default:return null}}var hr={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 gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!hr[e.type]:t===`textarea`}function _r(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=Yf(t,`onChange`),0<t.length&&(n=new Mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var vr=null,yr=null;function br(e){Vf(e,0)}function xr(e){if(qt(Et(e)))return e}function Sr(e,t){if(e===`change`)return t}var Cr=!1;if(bn){var wr;if(bn){var Tr=`oninput`in document;if(!Tr){var Er=document.createElement(`div`);Er.setAttribute(`oninput`,`return;`),Tr=typeof Er.oninput==`function`}wr=Tr}else wr=!1;Cr=wr&&(!document.documentMode||9<document.documentMode)}function Dr(){vr&&(vr.detachEvent(`onpropertychange`,Or),yr=vr=null)}function Or(e){if(e.propertyName===`value`&&xr(yr)){var t=[];_r(t,yr,e,pn(e)),vn(br,t)}}function kr(e,t,n){e===`focusin`?(Dr(),vr=t,yr=n,vr.attachEvent(`onpropertychange`,Or)):e===`focusout`&&Dr()}function Ar(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return xr(yr)}function jr(e,t){if(e===`click`)return xr(t)}function Mr(e,t){if(e===`input`||e===`change`)return xr(t)}function Nr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Pr=typeof Object.is==`function`?Object.is:Nr;function Fr(e,t){if(Pr(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(!Oe.call(t,i)||!Pr(e[i],t[i]))return!1}return!0}function Ir(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 Lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rr(e,t){var n=Lr(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=Lr(n)}}function zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ir(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=Ir(e.document)}return t}function Vr(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 Hr=bn&&`documentMode`in document&&11>=document.documentMode,Ur=null,Wr=null,Gr=null,Kr=!1;function qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kr||Ur==null||Ur!==Ir(r)||(r=Ur,`selectionStart`in r&&Vr(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}),Gr&&Fr(Gr,r)||(Gr=r,r=Yf(Wr,`onSelect`),0<r.length&&(t=new Mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ur)))}function Jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yr={animationend:Jr(`Animation`,`AnimationEnd`),animationiteration:Jr(`Animation`,`AnimationIteration`),animationstart:Jr(`Animation`,`AnimationStart`),transitionrun:Jr(`Transition`,`TransitionRun`),transitionstart:Jr(`Transition`,`TransitionStart`),transitioncancel:Jr(`Transition`,`TransitionCancel`),transitionend:Jr(`Transition`,`TransitionEnd`)},Xr={},Zr={};bn&&(Zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),`TransitionEvent`in window||delete Yr.transitionend.transition);function Qr(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t=Yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zr)return Xr[e]=t[n];return e}var $r=Qr(`animationend`),ei=Qr(`animationiteration`),ti=Qr(`animationstart`),ni=Qr(`transitionrun`),ri=Qr(`transitionstart`),ii=Qr(`transitioncancel`),ai=Qr(`transitionend`),oi=new Map,si=`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(` `);si.push(`scrollEnd`);function ci(e,t){oi.set(e,t),Mt(t,[e])}var li=0;function ui(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=li++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;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 fi(e,t){return e=di(e),t=di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var pi=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)},mi=[],hi=0,gi=0;function _i(){for(var e=hi,t=gi=hi=0;t<e;){var n=mi[t];mi[t++]=null;var r=mi[t];mi[t++]=null;var i=mi[t];mi[t++]=null;var a=mi[t];if(mi[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&&xi(n,i,a)}}function vi(e,t,n,r){mi[hi++]=e,mi[hi++]=t,mi[hi++]=n,mi[hi++]=r,gi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function yi(e,t,n,r){return vi(e,t,n,r),Si(e)}function bi(e,t){return vi(e,null,null,t),Si(e)}function xi(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-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Si(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ci={};function wi(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 Ti(e,t,n,r){return new wi(e,t,n,r)}function Ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Di(e,t){var n=e.alternate;return n===null?(n=Ti(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 Oi(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 ki(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ei(r)&&(s=1);else if(typeof r==`string`)s=Ym(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case V:return e=Ti(31,n,t,a),e.elementType=V,e.lanes=o,e;case j:return Ai(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ti(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Ti(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Ti(19,n,t,a),e.elementType=R,e.lanes=o,e;case ee:case ne:return e=a|32,e=Ti(30,n,t,e),e.elementType=ne,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case B:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ai(e,t,n,r){return e=Ti(7,e,r,t),e.lanes=n,e}function ji(e,t,n){return e=Ti(6,e,null,t),e.lanes=n,e}function Mi(e){var t=Ti(18,null,null,0);return t.stateNode=e,t}function Ni(e,t,n){return t=Ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pi=new WeakMap;function Fi(e,t){if(typeof e==`object`&&e){var n=Pi.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},Pi.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var Ii=[],Li=0,Ri=null,zi=0,Bi=[],Vi=0,Hi=null,Ui=1,Wi=``;function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Ri,Ri=e,zi=t}function Ki(e,t,n){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Hi=e;var r=Ui;e=Wi;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ui=1<<32-We(t)+i|n<<i|r,Wi=a+e}else Ui=1<<a|n<<i|r,Wi=e}function qi(e){e.return!==null&&(Gi(e,1),Ki(e,1,0))}function Ji(e){for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null;for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Wi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null}function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Ui=t.id,Wi=t.overflow,Hi=e}var Xi=null,Zi=null,Qi=!1,$i=null,ea=!1,ta=Error(i(519));function na(e){throw ca(Fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ta}function ra(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[mt]=e,t[ht]=r,n){case`dialog`:Hf(`cancel`,t),Hf(`close`,t);break;case`iframe`:case`object`:case`embed`:Hf(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Hf(zf[n],t);break;case`source`:Hf(`error`,t);break;case`img`:case`image`:case`link`:Hf(`error`,t),Hf(`load`,t);break;case`details`:Hf(`toggle`,t);break;case`input`:Hf(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Hf(`invalid`,t);break;case`textarea`:Hf(`invalid`,t),tn(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||tp(t.textContent,n)?(r.popover!=null&&(Hf(`beforetoggle`,t),Hf(`toggle`,t)),r.onScroll!=null&&Hf(`scroll`,t),r.onScrollEnd!=null&&Hf(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||na(e,!0)}function ia(e){for(Xi=e.return;Xi;)switch(Xi.tag){case 5:case 31:case 13:ea=!1;return;case 27:case 3:ea=!0;return;default:Xi=Xi.return}}function aa(e){if(e!==Xi)return!1;if(!Qi)return ia(e),Qi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||hp(e.type,e.memoizedProps)),n=!n),n&&Zi&&na(e),ia(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Zi=pm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Zi=pm(e)}else t===27?(t=Zi,wp(e.type)?(e=fm,fm=null,Zi=e):Zi=t):Zi=Xi?dm(e.stateNode.nextSibling):null;return!0}function oa(){Zi=Xi=null,Qi=!1}function sa(){var e=$i;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),$i=null),e}function ca(e){$i===null?$i=[e]:$i.push(e)}var la=de(null),ua=null,da=null;function fa(e,t,n){pe(la,t._currentValue),t._currentValue=n}function pa(e){e._currentValue=la.current,fe(la)}function ma(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 ha(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),ma(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),ma(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),ma(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 ga(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;Pr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===_e.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lh]:e.push(lh))}a=a.return}return e!==null&&ha(t,e,n,r),t.flags|=262144,e!==null}function _a(e){for(e=e.firstContext;e!==null;){if(!Pr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ua=e,da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ya(e){return xa(ua,e)}function ba(e,t){return ua===null&&va(e),xa(e,t)}function xa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},da===null){if(e===null)throw Error(i(308));da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else da=da.next=t;return n}var Sa=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()})}},Ca=t.unstable_scheduleCallback,wa=t.unstable_NormalPriority,Ta={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ea(){return{controller:new Sa,data:new Map,refCount:0}}function Da(e){e.refCount--,e.refCount===0&&Ca(wa,function(){e.controller.abort()})}function Oa(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 ka=null;function Aa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ja=null,Ma=0,Na=0,Pa=null;function Fa(e,t){if(ja===null){var n=ja=[];Ma=0,Na=Pf(),Pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ma++,t.then(Ia,Ia),t}function Ia(){if(--Ma===0&&(ka=null,ja!==null)){Pa!==null&&(Pa.status=`fulfilled`);var e=ja;ja=null,Na=0,Pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function La(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 Ra=W.S;W.S=function(e,t){if(md=Ne(),typeof t==`object`&&t&&typeof t.then==`function`&&Fa(e,t),ka!==null)for(var n=bf;n!==null;)Oa(n,ka),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Oa(r,n),r=r.next;if(Na!==0){r=ka,r===null&&(r=ka=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ra!==null&&Ra(e,t)};var za=de(null);function Ba(){var e=za.current;return e===null?Yu.pooledCache:e}function Va(e,t){t===null?pe(za,za.current):pe(za,t.pool)}function Ha(){var e=Ba();return e===null?null:{parent:Ta._currentValue,pool:e}}var Ua=Error(i(460)),Wa=Error(i(474)),Ga=Error(i(542)),Ka={then:function(){}};function qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ja(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=Yu,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,Za(e),e}throw q=t,Ua}}function Ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(q=e,Ua):e}}var q=null;function Xa(){if(q===null)throw Error(i(459));var e=q;return q=null,e}function Za(e){if(e===Ua||e===Ga)throw Error(i(483))}var Qa=null,$a=0;function eo(e){var t=$a;return $a+=1,Qa===null&&(Qa=[]),Ja(Qa,e,t)}function to(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function no(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 ro(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=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=ji(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),to(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Ya(i)===t.type)?(t=a(t,n.props),to(t,n),t.return=e,t):(t=ki(n.type,n.key,n.props,null,e.mode,r),to(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=Ni(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=Ai(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=ji(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ki(t.type,t.key,t.props,null,e.mode,n),to(n,t),n.return=e,n;case A:return t=Ni(t,e.mode,n),t.return=e,t;case B:return t=Ya(t),f(e,t,n)}if(oe(t)||U(t))return t=Ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,eo(t),n);if(t.$$typeof===F)return f(e,ba(e,t),n);no(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case B:return n=Ya(n),p(e,t,n,r)}if(oe(n)||U(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,eo(n),r);if(n.$$typeof===F)return p(e,t,ba(e,n),r);no(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case B:return r=Ya(r),m(e,t,n,r,i)}if(oe(r)||U(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,eo(r),i);if(r.$$typeof===F)return m(e,t,n,ba(t,r),i);no(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),Qi&&Gi(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 Qi&&Gi(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)}),Qi&&Gi(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),Qi&&Gi(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 Qi&&Gi(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)}),Qi&&Gi(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),to(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),to(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ai(o.props.children,e.mode,c,o.key),to(c,o),c.return=e,e=c):(c=ki(o.type,o.key,o.props,null,e.mode,c),to(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=Ni(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Ya(o),_(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(U(o)){if(l=U(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,eo(o),c);if(o.$$typeof===F)return _(e,r,ba(e,o),c);no(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=ji(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{$a=0;var i=_(e,t,n,r);return Qa=null,i}catch(t){if(t===Ua||t===Ga)throw t;var a=Ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var io=ro(!0),ao=ro(!1),oo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function co(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 lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ju&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Si(e),xi(e,null,n),t}return vi(e,r,t,n),Si(e)}function fo(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,st(e,n)}}function po(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var mo=!1;function ho(){if(mo){var e=Pa;if(e!==null)throw e}}function go(e,t,n,r){mo=!1;var i=e.updateQueue;oo=!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?(Zu&f)===f:(r&f)===f){f!==0&&f===Na&&(mo=!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:oo=!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),ad|=o,e.lanes=o,e.memoizedState=d}}function _o(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function vo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)_o(n[e],t)}var yo=de(null),bo=de(0);function xo(e,t){e=rd,pe(bo,e),pe(yo,t),rd=e|t.baseLanes}function J(){pe(bo,rd),pe(yo,yo.current)}function So(){rd=bo.current,fe(yo),fe(bo)}var Co=de(null),wo=null;function To(e){var t=e.alternate;pe(Ao,Ao.current&1),pe(Co,e),wo===null&&(t===null||yo.current!==null||t.memoizedState!==null)&&(wo=e)}function Eo(e){pe(Ao,Ao.current),pe(Co,e),wo===null&&(wo=e)}function Do(e){e.tag===22?(pe(Ao,Ao.current),pe(Co,e),wo===null&&(wo=e)):Oo()}function Oo(){pe(Ao,Ao.current),pe(Co,Co.current)}function ko(e){fe(Co),wo===e&&(wo=null),fe(Ao)}var Ao=de(0);function jo(e,t){pe(Co,Co.current),pe(Ao,t)}function Mo(e){fe(Ao),fe(Co),wo===e&&(wo=null)}function No(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cm(n)||lm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Po=0,Fo=null,Io=null,Lo=null,Ro=!1,zo=!1,Bo=!1,Vo=0,Ho=0,Uo=null,Wo=0;function Go(){throw Error(i(321))}function Ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function qo(e,t,n,r,i,a){return Po=a,Fo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?lc:uc,Bo=!1,a=n(r,i),Bo=!1,zo&&(a=Yo(t,n,r,i)),Jo(e),a}function Jo(e){W.H=cc;var t=Io!==null&&Io.next!==null;if(Po=0,Lo=Io=Fo=null,Ro=!1,Ho=0,Uo=null,t)throw Error(i(300));e===null||Dc||(e=e.dependencies,e!==null&&_a(e)&&(Dc=!0))}function Yo(e,t,n,r){Fo=e;var a=0;do{if(zo&&(Uo=null),Ho=0,zo=!1,25<=a)throw Error(i(301));if(a+=1,Lo=Io=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}W.H=dc,o=t(n,r)}while(zo);return o}function Xo(){var e=W.H,t=e.useState()[0];return t=typeof t.then==`function`?rs(t):t,e=e.useState()[0],(Io===null?null:Io.memoizedState)!==e&&(Fo.flags|=1024),t}function Zo(){var e=Vo!==0;return Vo=0,e}function Qo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $o(e){if(Ro){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ro=!1}Po=0,Lo=Io=Fo=null,zo=!1,Ho=Vo=0,Uo=null}function es(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lo===null?Fo.memoizedState=Lo=e:Lo=Lo.next=e,Lo}function ts(){if(Io===null){var e=Fo.alternate;e=e===null?null:e.memoizedState}else e=Io.next;var t=Lo===null?Fo.memoizedState:Lo.next;if(t!==null)Lo=t,Io=e;else{if(e===null)throw Fo.alternate===null?Error(i(467)):Error(i(310));Io=e,e={memoizedState:Io.memoizedState,baseState:Io.baseState,baseQueue:Io.baseQueue,queue:Io.queue,next:null},Lo===null?Fo.memoizedState=Lo=e:Lo=Lo.next=e}return Lo}function ns(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=Ho;return Ho+=1,Uo===null&&(Uo=[]),e=Ja(Uo,e,t),t=Fo,(Lo===null?t.memoizedState:Lo.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?lc:uc),e}function is(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return rs(e);if(e.$$typeof===re)return;if(e.$$typeof===F)return ya(e)}throw Error(i(438,String(e)))}function as(e){var t=null,n=Fo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Fo.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=ns(),Fo.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]=te;return t.index++,n}function os(e,t){return typeof t==`function`?t(e):t}function ss(e){return cs(ts(),Io,e)}function cs(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?(Po&f)===f:(Zu&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===Na&&(d=!0);else if((Po&p)===p){u=u.next,p===Na&&(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,Fo.lanes|=p,ad|=p;f=u.action,Bo&&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,Fo.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Pr(o,e.memoizedState)&&(Dc=!0,d&&(n=Pa,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 ls(e){var t=ts(),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);Pr(o,t.memoizedState)||(Dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function us(e,t,n){var r=Fo,a=ts(),o=Qi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Pr((Io||a).memoizedState,n);if(s&&(a.memoizedState=n,Dc=!0),a=a.queue,Ps(ps.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Lo!==null&&!!(Lo.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},fs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Yu===null)throw Error(i(349));o||Po&127||ds(r,t,n)}return n}function ds(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Fo.updateQueue,t===null?(t=ns(),Fo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fs(e,t,n,r){t.value=n,t.getSnapshot=r,ms(t)&&hs(e)}function ps(e,t,n){return n(function(){ms(t)&&hs(e)})}function ms(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function hs(e){var t=bi(e,2);t!==null&&Nd(t,e,2)}function gs(e){var t=es();if(typeof e==`function`){var n=e;if(e=n(),Bo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:e},t}function _s(e,t,n,r){return e.baseState=n,cs(e,Io,typeof r==`function`?r:os)}function vs(e,t,n,r,a){if(ac(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};W.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ys(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ys(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=W.T,o={};o.types=a===null?null:a.types,W.T=o;try{var s=n(i,r),c=W.S;c!==null&&c(o,s),bs(e,t,s)}catch(n){Ss(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),W.T=a}}else try{a=n(i,r),bs(e,t,a)}catch(n){Ss(e,t,n)}}function bs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){xs(e,t,n)},function(n){return Ss(e,t,n)}):xs(e,t,n)}function xs(e,t,n){t.status=`fulfilled`,t.value=n,Cs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ys(e,n)))}function Ss(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Cs(t),t=t.next;while(t!==r)}e.action=null}function Cs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ws(e,t){return t}function Ts(e,t){if(Qi){var n=Yu.formState;if(n!==null){a:{var r=Fo;if(Qi){if(Zi){b:{for(var i=Zi,a=ea;i.nodeType!==8;)if(!a||(i=dm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Zi=dm(i.nextSibling),r=i.data===`F!`;break a}}na(r)}r=!1}r&&(t=n[0])}}return n=es(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:t},n.queue=r,n=nc.bind(null,Fo,r),r.dispatch=n,r=gs(!1),a=ic.bind(null,Fo,!1,r.queue),r=es(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=vs.bind(null,Fo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Es(e){return Ds(ts(),Io,e)}function Ds(e,t,n){if(t=cs(e,t,ws)[0],e=ss(os)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=rs(t)}catch(e){throw e===Ua?Ga:e}else r=t;t=ts();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Fo.flags|=2048,ks(9,{destroy:void 0},Y.bind(null,i,n),null)),[r,a,e]}function Y(e,t){e.action=t}function Os(e){var t=ts(),n=Io;if(n!==null)return Ds(t,n,e);ts(),t=t.memoizedState,n=ts();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Fo.updateQueue,t===null&&(t=ns(),Fo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function As(){return ts().memoizedState}function js(e,t,n,r){var i=es();Fo.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=ts();r=r===void 0?null:r;var a=i.memoizedState.inst;Io!==null&&r!==null&&Ko(r,Io.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Fo.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){Fo.flags|=4;var t=Fo.updateQueue;if(t===null)t=ns(),Fo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=ts().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(Ju&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(4,4,e,t)}function zs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Us(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ko(t,r[1]))return r[0];if(r=e(),Bo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Ws(e,t,n){return n===void 0||Po&1073741824&&!(Zu&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),Fo.lanes|=e,ad|=e,n)}function Gs(e,t,n,r){return Pr(n,t)?n:yo.current===null?!(Po&106)||Po&1073741824&&!(Zu&261930)?(Dc=!0,e.memoizedState=n):(e=jd(),Fo.lanes|=e,ad|=e,t):(e=Ws(e,n,r),Pr(e,t)||(Dc=!0),e)}function Ks(e,t,n,r,i){var a=se.p;se.p=a!==0&&8>a?a:8;var o=W.T,s={};s.types=o===null?null:o.types,W.T=s,ic(e,!1,t,n);try{var c=i(),l=W.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?rc(e,t,La(c,r),Ad(e)):rc(e,t,r,Ad(e))}catch(n){rc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{se.p=a,o!==null&&s.types!==null&&(o.types=s.types),W.T=o}}function qs(){}function Js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ys(e).queue;Ks(e,a,t,ce,n===null?qs:function(){return Xs(e),n(r)})}function Ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xs(e){var t=Ys(e);t.next===null&&(t=e.alternate.memoizedState),rc(e,t.next.queue,{},Ad())}function Zs(){return ya(lh)}function Qs(){return ts().memoizedState}function $s(){return ts().memoizedState}function ec(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=lo(n);var r=uo(t,e,n);r!==null&&(Nd(r,t,n),fo(r,t,n)),t={cache:Ea()},e.payload=t;return}t=t.return}}function tc(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ac(e)?oc(t,n):(n=yi(e,t,n,r),n!==null&&(Nd(n,e,r),sc(n,t,r)))}function nc(e,t,n){rc(e,t,n,Ad())}function rc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ac(e))oc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Pr(s,o))return vi(e,t,i,0),Yu===null&&_i(),!1}catch{}if(n=yi(e,t,i,r),n!==null)return Nd(n,e,r),sc(n,t,r),!0}return!1}function ic(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(i(479))}else t=yi(e,n,r,2),t!==null&&Nd(t,e,2)}function ac(e){var t=e.alternate;return e===Fo||t!==null&&t===Fo}function oc(e,t){zo=Ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}var cc={readContext:ya,use:is,useCallback:Go,useContext:Go,useEffect:Go,useImperativeHandle:Go,useLayoutEffect:Go,useInsertionEffect:Go,useMemo:Go,useReducer:Go,useRef:Go,useState:Go,useDebugValue:Go,useDeferredValue:Go,useTransition:Go,useSyncExternalStore:Go,useId:Go,useHostTransitionStatus:Go,useFormState:Go,useActionState:Go,useOptimistic:Go,useMemoCache:Go,useCacheRefresh:Go,useEffectEvent:Go},lc={readContext:ya,use:is,useCallback:function(e,t){return es().memoizedState=[e,t===void 0?null:t],e},useContext:ya,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=es();t=t===void 0?null:t;var r=e();if(Bo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=es();if(n!==void 0){var i=n(t);if(Bo){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=tc.bind(null,Fo,e),[r.memoizedState,e]},useRef:function(e){var t=es();return e={current:e},t.memoizedState=e},useState:function(e){e=gs(e);var t=e.queue,n=nc.bind(null,Fo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws(es(),e,t)},useTransition:function(){var e=gs(!1);return e=Ks.bind(null,Fo,e.queue,!0,!1),es().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Fo,a=es();if(Qi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Yu===null)throw Error(i(349));Zu&127||ds(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(ps.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},fs.bind(null,r,o,n,t),null),n},useId:function(){var e=es(),t=Yu.identifierPrefix;if(Qi){var n=Wi,r=Ui;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e){var t=es();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ic.bind(null,Fo,!0,n),n.dispatch=t,[e,t]},useMemoCache:as,useCacheRefresh:function(){return es().memoizedState=ec.bind(null,Fo)},useEffectEvent:function(e){var t=es(),n={impl:e};return t.memoizedState=n,function(){if(Ju&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},uc={readContext:ya,use:is,useCallback:Hs,useContext:ya,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:ss,useRef:As,useState:function(){return ss(os)},useDebugValue:Vs,useDeferredValue:function(e,t){return Gs(ts(),Io.memoizedState,e,t)},useTransition:function(){var e=ss(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:Qs,useHostTransitionStatus:Zs,useFormState:Es,useActionState:Es,useOptimistic:function(e,t){return _s(ts(),Io,e,t)},useMemoCache:as,useCacheRefresh:$s,useEffectEvent:Is},dc={readContext:ya,use:is,useCallback:Hs,useContext:ya,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:ls,useRef:As,useState:function(){return ls(os)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=ts();return Io===null?Ws(n,e,t):Gs(n,Io.memoizedState,e,t)},useTransition:function(){var e=ls(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:Qs,useHostTransitionStatus:Zs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=ts();return Io===null?(n.baseState=e,[e,n.queue.dispatch]):_s(n,Io,e,t)},useMemoCache:as,useCacheRefresh:$s,useEffectEvent:Is};function fc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=lo(r);i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Nd(t,e,r),fo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=lo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Nd(t,e,r),fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Nd(t,e,n),fo(t,e,n))}};function mc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Fr(n,r)||!Fr(i,a):!0}function hc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&pc.enqueueReplaceState(t,t.state,null)}function gc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function _c(e){pi(e)}function vc(e){console.error(e)}function yc(e){pi(e)}function bc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Sc(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){bc(e,t)},n}function Cc(e){return e=lo(e),e.tag=3,e}function wc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){xc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){xc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ga(t,n,a,!0),n=Co.current,n!==null){switch(n.tag){case 31:case 13:case 19:return wo===null?Gd():n.alternate===null&&id===0&&(id=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ka?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ka?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)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Gd(),!1}if(Qi)return t=Co.current,t===null?(r!==ta&&(t=Error(i(423),{cause:r}),ca(Fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Fi(r,n),a=Sc(e.stateNode,r,a),po(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ta&&(e=Error(i(422),{cause:r}),ca(Fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Fi(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=Fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Sc(n.stateNode,r,e),po(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`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Cc(a),wc(a,e,n,r),po(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ec=Error(i(461)),Dc=!1;function Oc(e,t,n,r){t.child=e===null?ao(t,null,n,r):io(t,e.child,n,r)}function kc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return va(t),r=qo(e,t,n,o,a,i),s=Zo(),e!==null&&!Dc?(Qo(e,t,i),rl(e,t,i)):(Qi&&s&&qi(t),t.flags|=1,Oc(e,t,r,i),t.child)}function Ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,jc(e,t,a,r,i)):(e=ki(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!il(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Fr:n,n(o,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=Di(a,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Fr(a,r)&&e.ref===t.ref){if(Dc=!1,t.pendingProps=r=a,il(e,i))e.flags&131072&&(Dc=!0);else return t.lanes=e.lanes,rl(e,t,i)}}return zc(e,t,n,r,i)}function Mc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Va(t,a===null?null:a.cachePool),a===null?J():xo(t,a),Do(t);else return r=t.lanes=536870912,Pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Va(t,null),J(),Oo()):(Va(t,a.cachePool),xo(t,a),Oo(),t.memoizedState=null);return Oc(e,t,i,n),t.child}function Nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pc(e,t,n,r,i){var a=Ba();return a=a===null?null:{parent:Ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Va(t,null),J(),Do(t),e!==null&&ga(e,t,r,!0),t.childLanes=i,null}function Fc(e,t){return t=Jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ic(e,t,n){return io(t,e.child,null,n),e=Fc(t,t.pendingProps),e.flags|=2,ko(t),t.memoizedState=null,e}function Lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Qi){if(r.mode===`hidden`)return e=Fc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nc(null,e);if(Eo(t),(e=Zi)?(e=sm(e,ea),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw na(t);return t.lanes=536870912,null}return Fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Eo(t),a){if(t.flags&256)t.flags&=-257,t=Ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Dc||ga(e,t,n,!1),a=(n&e.childLanes)!==0,Dc||a){if(yo.current===null){if(r=Yu,r!==null&&(s=ct(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,bi(e,s),Nd(r,e,s),Ec;Gd()}t=Ic(e,t,n)}else e=o.treeContext,Zi=dm(s.nextSibling),Xi=t,Qi=!0,$i=null,ea=!1,e!==null&&Yi(t,e),t=Fc(t,r),t.flags|=134221824;return t}return e=Di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Rc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function zc(e,t,n,r,i){return va(t),n=qo(e,t,n,r,void 0,i),r=Zo(),e!==null&&!Dc?(Qo(e,t,i),rl(e,t,i)):(Qi&&r&&qi(t),t.flags|=1,Oc(e,t,n,i),t.child)}function Bc(e,t,n,r,i,a){return va(t),t.updateQueue=null,n=Yo(t,r,n,i),Jo(e),r=Zo(),e!==null&&!Dc?(Qo(e,t,a),rl(e,t,a)):(Qi&&r&&qi(t),t.flags|=1,Oc(e,t,n,a),t.child)}function Vc(e,t,n,r,i){if(va(t),t.stateNode===null){var a=Ci,o=n.contextType;typeof o==`object`&&o&&(a=ya(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},so(t),o=n.contextType,a.context=typeof o==`object`&&o?ya(o):Ci,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(fc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&pc.enqueueReplaceState(a,a.state,null),go(t,r,a,i),ho(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=gc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ci,typeof u==`object`&&u&&(o=ya(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&hc(t,a,r,o),oo=!1;var f=t.memoizedState;a.state=f,go(t,r,a,i),ho(),l=t.memoizedState,s||f!==l||oo?(typeof d==`function`&&(fc(t,n,d,r),l=t.memoizedState),(c=oo||mc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,co(e,t),o=t.memoizedProps,u=gc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ci,typeof l==`object`&&l&&(c=ya(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&hc(t,a,r,c),oo=!1,f=t.memoizedState,a.state=f,go(t,r,a,i),ho();var p=t.memoizedState;o!==d||f!==p||oo||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof s==`function`&&(fc(t,n,s,r),p=t.memoizedState),(u=oo||mc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&_a(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Rc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=io(t,e.child,null,i),t.child=io(t,null,n,i)):Oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=rl(e,t,i),e}function Hc(e,t,n,r){return oa(),t.flags|=256,Oc(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:Ha()}}function Gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function Kc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ao.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Qi){if(i?To(t):Oo(),(e=Zi)?(e=sm(e,ea),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw na(t);return t.lanes=lm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Oo(),i=t.mode,a=Jc({mode:`hidden`,children:a},i),r=Ai(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Wc(n),r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(null,r)):(To(t),qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Xc(e,t,a,o,r,c,s,n)}return i?(Oo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Di(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ai(i,a,n,null),i.flags|=2):i=Di(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Nc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Wc(n):(a=i.cachePool,a===null?a=Ha():(s=Ta._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(e.child,r)):(To(t),n=e.child,e=n.sibling,n=Di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function qc(e,t){return t=Jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Jc(e,t){return e=Ti(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return io(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(To(t),t.flags&=-257,Yc(e,t,c)):t.memoizedState===null?(Oo(),o=a.fallback,s=t.mode,a=Jc({mode:`visible`,children:a.children},s),o=Ai(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,io(t,e.child,null,c),a=t.child,a.memoizedState=Wc(c),a.childLanes=Gc(e,r,c),t.memoizedState=Uc,Nc(null,a)):(Oo(),t.child=e.child,t.flags|=128,null);if(To(t),lm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ca({value:a,source:null,stack:null})),Yc(e,t,c)}if(Dc||ga(e,t,c,!1),r=(c&e.childLanes)!==0,Dc||r){if(yo.current!==null)return Yc(e,t,c);if(r=Yu,r!==null&&(a=ct(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,bi(e,a),Nd(r,e,a),Ec;return cm(o)||Gd(),Yc(e,t,c)}return cm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Zi=dm(o.nextSibling),Xi=t,Qi=!0,$i=null,ea=!1,e!==null&&Yi(t,e),t=qc(t,a.children),t.flags|=134221824,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ma(e.return,t,n)}function Qc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&No(n)===null&&(t=e),e=e.sibling}return t}function $c(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function el(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function tl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ao.current;if(t.flags&128)return jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,jo(t,o),i===`backwards`&&e!==null?(el(e),Oc(e,t,r,n),el(e)):Oc(e,t,r,n),r=Qi?zi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,el(t)),$c(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&No(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$c(t,!0,n,null,a,r);break;case`together`:$c(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$c(t,!1,i,n,a,r)}return t.child}function nl(e,t,n){var r=t.pendingProps;return fa(t,t.type,r.value),Oc(e,t,r.children,n),t.child}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ga(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function il(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&_a(e)))}function al(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),fa(t,Ta,e.memoizedState.cache),oa();break;case 27:case 5:G(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return To(t),t.flags|=128,null;r=ga(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Kc(e,t,n):(To(t),e=rl(e,t,n),e===null?null:e.sibling)}To(t);break;case 19:if(t.flags&128)return tl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ga(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return tl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jo(t,Ao.current),r)break;return null;case 22:return t.lanes=0,Mc(e,t,n,t.pendingProps);case 24:fa(t,Ta,e.memoizedState.cache)}return rl(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Dc=!0;else{if(!il(e,n)&&!(t.flags&128))return Dc=!1,al(e,t,n);Dc=!!(e.flags&131072)}}else Dc=!1,Qi&&t.flags&1048576&&Ki(t,zi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ya(t.elementType),t.type=e,typeof e==`function`)Ei(e)?(r=gc(e,r),t.tag=1,t=Vc(null,t,e,r,n)):(t.tag=0,t=zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=kc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Ac(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=nl(null,t,n);break a}}throw t=ae(e)||e,Error(i(306,t,``))}}return t;case 0:return zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=gc(r,t.pendingProps),Vc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,co(e,t),go(t,r,null,n);var s=t.memoizedState;if(r=s.cache,fa(t,Ta,r),r!==o.cache&&ha(t,[Ta],n,!0),ho(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Hc(e,t,r,n);break a}if(r!==a){a=Fi(Error(i(424)),t),ca(a),t=Hc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Zi=dm(e.firstChild),Xi=t,Qi=!0,$i=null,ea=!0,n=ao(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(oa(),r===a){t=rl(e,t,n);break a}Oc(e,t,r,n)}t=t.child}return t;case 26:return Rc(e,t),e===null?(n=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Qi||(t.stateNode=mp(t.type,t.pendingProps,ge.current,t)):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return G(t),e===null&&Qi&&(r=t.stateNode=_m(t.type,t.pendingProps,ge.current),Xi=t,ea=!0,a=Zi,wp(t.type)?(fm=a,Zi=dm(r.firstChild)):Zi=a),Oc(e,t,t.pendingProps.children,n),Rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Qi&&((a=r=Zi)&&(r=am(r,t.type,t.pendingProps,ea),r===null?a=!1:(t.stateNode=r,Xi=t,Zi=dm(r.firstChild),ea=!1,a=!0)),a||na(t)),G(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,hp(a,o)?r=null:s!==null&&hp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=qo(e,t,Xo,null,null,n),lh._currentValue=a),Rc(e,t),Oc(e,t,r,n),t.child;case 6:return e===null&&Qi&&((e=n=Zi)&&(n=om(n,t.pendingProps,ea),n===null?e=!1:(t.stateNode=n,Xi=t,Zi=null,e=!0)),e||na(t)),null;case 13:return Kc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):Oc(e,t,r,n),t.child;case 11:return kc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Rc(e,t),Oc(e,t,r,n),t.child;case 8:return Oc(e,t,t.pendingProps.children,n),t.child;case 12:return Oc(e,t,t.pendingProps.children,n),t.child;case 10:return nl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,va(t),a=ya(a),r=r(a),t.flags|=1,Oc(e,t,r,n),t.child;case 14:return Ac(e,t,t.type,t.pendingProps,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 19:return tl(e,t,n);case 31:return Lc(e,t,n);case 22:return Mc(e,t,n,t.pendingProps);case 24:return va(t),r=ya(Ta),e===null?(a=Ba(),a===null&&(a=Yu,o=Ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},so(t),fa(t,Ta,a)):((e.lanes&n)!==0&&(co(e,t),go(t,null,null,n),ho()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,fa(t,Ta,r),r!==a.cache&&ha(t,[Ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),fa(t,Ta,r))),Oc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:Qi&&qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Rc(e,t),Oc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Xm(t,r):Xm(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(Hd())e.flags|=8192;else throw q=Ka,Wa}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zm(t)){if(Hd())e.flags|=8192;else throw q=Ka,Wa}}function ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:nt(),e.lanes|=t,ld|=t)}function dl(e,t){if(!Qi)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function fl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pl(e,t,n){var r=t.pendingProps;switch(Ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fl(t),null;case 1:return fl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),pa(Ta),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(aa(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,sa())),fl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(sl(t),o===null?(fl(t),cl(t,a,null,r,n)):(fl(t),ll(t,o))):o?o===e.memoizedState?(fl(t),t.flags&=-16777217):(sl(t),fl(t),ll(t,o)):(e=e.memoizedProps,e!==r&&sl(t),fl(t),cl(t,a,e,r,n)),null;case 27:if(be(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}e=me.current,aa(t)?ra(t,e):(e=_m(a,r,n),t.stateNode=e,sl(t))}return fl(t),t.subtreeFlags&=-33554433,null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}if(o=me.current,aa(t))ra(t,o);else{var s=dp(ge.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[mt]=t,o[ht]=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(ip(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&sl(t)}}return fl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,aa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Xi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[mt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||tp(e.nodeValue,n)),e||na(t,!0)}else e=dp(e).createTextNode(r),e[mt]=t,t.stateNode=e}return fl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=aa(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[mt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),e=!1}else n=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ko(t),t):(ko(t),null);if(t.flags&128)throw Error(i(558))}return fl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=aa(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[mt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),a=!1}else a=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ko(t),t):(ko(t),null)}return ko(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),fl(t),null);case 4:return ye(),e===null&&Gf(t.stateNode.containerInfo),t.flags|=67108864,fl(t),null;case 10:return pa(t.type),fl(t),null;case 19:if(Mo(t),r=t.memoizedState,r===null)return fl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)dl(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=No(e),o!==null){for(t.flags|=128,dl(r,!1),e=o.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Oi(n,e),n=n.sibling;return jo(t,Ao.current&1|2),Qi&&Gi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ne()>hd&&(t.flags|=128,a=!0,dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=No(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Qi)return fl(t),null}else 2*Ne()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,dl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ne(),e.sibling=null,o=Ao.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Qi?jo(t,o):(n=o,pe(Co,t),pe(Ao,n),wo===null&&(wo=t)),Qi&&Gi(t,r.treeForkCount),e}return fl(t),null;case 22:case 23:return ko(t),So(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(fl(t),t.subtreeFlags&6&&(t.flags|=8192)):fl(t),n=t.updateQueue,n!==null&&ul(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&fe(za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),pa(Ta),fl(t),null;case 25:return null;case 30:return t.flags|=33554432,fl(t),null}throw Error(i(156,t.tag))}function ml(e,t){switch(Ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pa(Ta),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(ko(t),t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mo(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 ye(),null;case 10:return pa(t.type),null;case 22:case 23:return ko(t),So(),e!==null&&fe(za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pa(Ta),null;case 25:return null;default:return null}}function hl(e,t){switch(Ji(t),t.tag){case 3:pa(Ta),ye();break;case 26:case 27:case 5:be(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&ko(t);break;case 13:ko(t);break;case 19:Mo(t);break;case 10:pa(t.type);break;case 22:case 23:ko(t),So(),e!==null&&fe(za);break;case 24:pa(Ta)}}function gl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){pf(t,t.return,e)}}function _l(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){pf(t,t.return,e)}}function vl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{vo(t,n)}catch(t){pf(e,e.return,t)}}}function yl(e,t,n){n.props=gc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){pf(e,t,n)}}function bl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=ui(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Ip(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Lp(e);h(e.child,!1,em,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){pf(e,t,n)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){pf(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){pf(e,t,n)}else n.current=null}}function Sl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)nm(e.stateNode,t[n])}function Cl(e){for(var t=e.return;t!==null&&(X(t)&&nm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function wl(e){for(var t=e.return;t!==null&&(X(t)&&rm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function Tl(e){return e.tag===5||e.tag===3||e.tag===27}function X(e){return e&&e.tag===7&&e.stateNode!==null}function El(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){pf(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;op(r,e.type,n,t),r[ht]=t}catch(t){pf(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Al(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=dn)),Sl(e,r),Rt=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,wp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Sl(e,r),Rt=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,wp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ip(t,r,n),t[mt]=e,t[ht]=n}catch(t){pf(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ap(o);r.push(s),s.view&&(a=!0)}else a||Ap(o).view&&(a=!0);Nl=!0,Dp(o,Rl===0?t:t+`_`+Rl,n),Rl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Op(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Vl(e.child,t),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(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=fi(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=ui(r,n),a=fi(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||Md(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function Wl(e){if(Pl!==null&&Pl.size!==0){var t=Pl;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=fi(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=fi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),Md(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Pl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode);t=fi(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Vl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],u=Ap(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Dp(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=ui(n,r),a=fi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(jp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,Z=null,ru=!1,iu=!1,au=!1,ou=!1;function su(e,t,n){if(e=e.containerInfo,lp=vh,e=Br(e),Vr(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(up={focusedElem:e,selectionRange:r},vh=!1,n=(n&335544064)===n,Z=t,t=n?9270:1024;Z!==null;){if(e=Z,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),cu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),cu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),cu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,Z=r):(n&&Kl(e),cu(n))}}Pl=null}function cu(e){for(;Z!==null;){var t=Z,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=gc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){pf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)im(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:im(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=ui(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=fi(a.default,a.update),a!==`none`&&zl(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,Z=r;break}Z=t.return}}function lu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ku(e,n),r&4&&gl(5,n);break;case 1:if(ku(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){pf(n,n.return,e)}else{var i=gc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){pf(n,n.return,e)}}}r&64&&vl(n),r&512&&bl(n,n.return);break;case 3:if(ku(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{vo(e,t)}catch(e){pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:ku(e,n),t===null&&r&4&&El(n),r&512&&bl(n,n.return);break;case 12:ku(e,n);break;case 31:ku(e,n),r&4&&vu(e,n);break;case 13:ku(e,n),r&4&&yu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),um(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ju(e,n,r)):ku(e,n),Ql=t,$l=i}break;case 30:ku(e,n),r&512&&bl(n,n.return);break;case 7:r&512&&bl(n,n.return);default:ku(e,n)}}function uu(e,t){for(e=e.child;e!==null;)du(e,t),e=e.sibling}function du(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){pf(e,e.return,t)}fu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Rt=!0}catch(t){pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ep(s,!0):Ep(e.stateNode,!1)}catch(t){pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&uu(e,t);break;default:uu(e,t)}}function fu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:du(n,r);break a;case 22:n.memoizedState===null&&fu(n,r);break a;default:fu(n,r)}}e=e.sibling}}function pu(e){var t=e.alternate;t!==null&&(e.alternate=null,pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ct(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 mu=null,hu=!1;function gu(e,t,n){for(n=n.child;n!==null;)_u(e,t,n),n=n.sibling}function _u(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(K,n)}catch{}switch(n.tag){case 26:$l||xl(n,t),gu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||xl(n,t),wl(n);var r=mu,i=hu;wp(n.type)&&(mu=n.stateNode,hu=!1),gu(e,t,n),vm(n.stateNode,n.type,n.memoizedProps),mu=r,hu=i;break;case 5:$l||xl(n,t),wl(n);case 6:if(n.tag===6&&wl(n),r=mu,i=hu,mu=null,gu(e,t,n),mu=r,hu=i,mu!==null){if(hu)try{(mu.nodeType===9?mu.body:mu.nodeName===`HTML`?mu.ownerDocument.body:mu).removeChild(n.stateNode),Rt=!0}catch(e){pf(n,t,e)}else try{mu.removeChild(n.stateNode),Rt=!0}catch(e){pf(n,t,e)}}break;case 18:mu!==null&&(hu?(e=mu,Tp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wh(e)):Tp(mu,n.stateNode));break;case 4:r=mu,i=hu,mu=n.stateNode.containerInfo,hu=!0,gu(e,t,n),mu=r,hu=i;break;case 0:case 11:case 14:case 15:_l(2,n,t),$l||_l(4,n,t),gu(e,t,n);break;case 1:$l||(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&yl(n,t,r)),gu(e,t,n);break;case 21:gu(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,gu(e,t,n),$l=r;break;case 30:xl(n,t),gu(e,t,n);break;case 7:$l||xl(n,t),gu(e,t,n);break;default:gu(e,t,n)}}function vu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wh(e)}catch(e){pf(t,t.return,e)}}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wh(e)}catch(e){pf(t,t.return,e)}}function bu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function xu(e,t){var n=bu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Su(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(wp(l.type)){mu=l.stateNode,hu=!1;break a}break;case 5:mu=l.stateNode,hu=!1;break a;case 3:case 4:mu=l.stateNode.containerInfo,hu=!0;break a}l=l.return}if(mu===null)throw Error(i(160));_u(s,c,o),mu=null,hu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e,n),t=t.sibling}var Cu=null;function wu(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}Su(t,e,n),Tu(e),a&4&&(_l(3,e,e.return),gl(3,e),_l(5,e,e.return));break;case 1:Su(t,e,n),Tu(e),a&512&&($l||r===null||xl(r,r.return)),a&64&&Ql&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Cu,Su(t,e,n),Tu(e),a&512&&($l||r===null||xl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Ql)e.stateNode=mp(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[xt]||r[mt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),ip(r,t,n),r[mt]=e,Ot(r),t=r;break a;case`link`:if(o=qm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),ip(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=qm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),ip(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[mt]=e,Ot(r),t=r}e.stateNode=t}}else Ql||Jm(o,e.type,e.stateNode)}else e.stateNode=Hm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||Jm(o,e.type,e.stateNode):Hm(o,n,e.memoizedProps))}break;case 27:Su(t,e,n),Tu(e),a&512&&($l||r===null||xl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Su(t,e,n),eu=o,Tu(e),a&512&&($l||r===null||xl(r,r.return)),e.flags&32){t=e.stateNode;try{nn(t,``),Rt=!0}catch(t){pf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Su(t,e,n),Tu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Rt=!0}catch(t){pf(e,e.return,t)}}break;case 3:if(Rt=!1,Km=null,o=Cu,Cu=Sm(t.containerInfo),Su(t,e,n),Cu=o,Tu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Wh(t.containerInfo)}catch(t){pf(e,e.return,t)}tu&&(tu=!1,Eu(e)),Rt=!1;break;case 4:a=eu,eu=Ql,r=zt(),o=Cu,Cu=Sm(e.stateNode.containerInfo),Su(t,e,n),Tu(e),Cu=o,Rt&&iu&&(au=!0),Rt=r,eu=a;break;case 12:Su(t,e,n),Tu(e);break;case 31:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 13:Su(t,e,n),Tu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=Ne()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Su(t,e,n),$l=l,eu=u,Ql=c,Tu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,Au(e,2),Ql=n,$l=r),!o&&eu||uu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,xu(e,n))));break;case 19:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 30:a&512&&($l||r===null||xl(r,r.return)),a=zt(),o=iu,s=(n&335544064)===n,c=e.memoizedProps,iu=s&&fi(c.default,c.update)!==`none`,Su(t,e,n),Tu(e),s&&r!==null&&Rt&&(e.flags|=4),iu=o,Rt=a;break;case 21:break;case 7:a&512&&($l||r===null||xl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Su(t,e,n),Tu(e)}}function Tu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(X(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Tl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(nn(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Eu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Eu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,vh=!0,t.reset(),vh=!1),e=e.sibling}}function Du(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ou(t,e),t=t.sibling;else Zl(t,!1)}function Ou(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(ou=ru=!1,Ll(),Du(t,e),!ru&&!au){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Op(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),ou=!0}Il=null;break;case 5:Du(t,e);break;case 4:r=ru,ru=!1,Du(t,e),ru&&(au=!0),ru=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Du(t,e):Ul(e,!1));break;case 30:r=ru,i=Ll(),ru=!1,Du(t,e),ru&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=ui(a,o),o=ui(n.memoizedProps,o);var s=fi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Xl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),ru=e.flags&32?!0:r;break;default:Du(t,e)}}function ku(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lu(e,t.alternate,t),t=t.sibling}function Au(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:_l(4,n,n.return),Au(n,r);break;case 1:xl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&yl(n,n.return,i),Au(n,r);break;case 27:r&2&&vm(n.stateNode,n.type,n.memoizedProps);case 5:xl(n,n.return),n.tag!==5&&n.tag!==27||wl(n),Au(n,r);break;case 6:wl(n);break;case 26:xl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),Au(n,r);break;case 22:n.memoizedState===null&&Au(n,r);break;case 30:xl(n,n.return),Au(n,r);break;case 7:xl(n,n.return);default:Au(n,r)}e=e.sibling}}function ju(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:ju(i,a,n),gl(4,a);break;case 1:if(ju(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){pf(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++)_o(l[i],c)}catch(e){pf(r,r.return,e)}}s&&o&64&&vl(a),bl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Cl(a),ju(i,a,n),s&&r===null&&o&4&&El(a),bl(a,a.return);break;case 6:Cl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||Jm(Sm(c.ownerDocument),a.type,c),ju(i,a,n),s&&r===null&&o&4&&El(a),bl(a,a.return);break;case 12:ju(i,a,n);break;case 31:ju(i,a,n),s&&o&4&&vu(i,a);break;case 13:ju(i,a,n),s&&o&4&&yu(i,a);break;case 22:a.memoizedState===null&&ju(i,a,n),bl(a,a.return);break;case 30:ju(i,a,n),bl(a,a.return);break;case 7:bl(a,a.return);default:ju(i,a,n)}t=t.sibling}}function Mu(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&&Da(n))}function Nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Da(e))}function Pu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Fu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Fu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Pu(e,t,n,r),a&2048&&gl(9,t);break;case 1:Pu(e,t,n,r);break;case 3:Pu(e,t,n,r),i&&ou&&(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&&Da(a)));break;case 12:if(a&2048){Pu(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){pf(t,t.return,e)}}else Pu(e,t,n,r);break;case 31:Pu(e,t,n,r);break;case 13:Pu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Jl(t),o._visibility&2?Pu(e,t,n,r):(o._visibility|=2,Iu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Pu(e,t,n,r):Lu(e,t)),a&2048&&Mu(s,t);break;case 24:Pu(e,t,n,r),a&2048&&Nu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Pu(e,t,n,r);break;default:Pu(e,t,n,r)}}function Iu(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:Iu(a,o,s,c,i),gl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Iu(a,o,s,c,i)):u._visibility&2?Iu(a,o,s,c,i):Lu(a,o),i&&l&2048&&Mu(o.alternate,o);break;case 24:Iu(a,o,s,c,i),i&&l&2048&&Nu(o.alternate,o);break;default:Iu(a,o,s,c,i)}t=t.sibling}}function Lu(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:Lu(n,r),i&2048&&Mu(r.alternate,r);break;case 24:Lu(n,r),i&2048&&Nu(r.alternate,r);break;default:Lu(n,r)}t=t.sibling}}var Ru=8192;function zu(e,t,n){if(e.subtreeFlags&Ru)for(e=e.child;e!==null;)Bu(e,t,n),e=e.sibling}function Bu(e,t,n){switch(e.tag){case 26:zu(e,t,n),e.flags&Ru&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&$m(n,e)):eh(n,Cu,e.memoizedState,e.memoizedProps));break;case 5:zu(e,t,n),e.flags&Ru&&(e=e.stateNode,(t&335544128)===t&&$m(n,e));break;case 3:case 4:var r=Cu;Cu=Sm(e.stateNode.containerInfo),zu(e,t,n),Cu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ru,Ru=16777216,zu(e,t,n),Ru=r):zu(e,t,n));break;case 30:if((e.flags&Ru)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}zu(e,t,n);break;default:zu(e,t,n)}}function Vu(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 Hu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Z=r,Gu(r,e)}Vu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Uu(e),e=e.sibling}function Uu(e){switch(e.tag){case 0:case 11:case 15:Hu(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Hu(e);break;case 12:Hu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wu(e)):Hu(e);break;default:Hu(e)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Z=r,Gu(r,e)}Vu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),Wu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wu(t));break;default:Wu(t)}e=e.sibling}}function Gu(e,t){for(;Z!==null;){var n=Z;switch(n.tag){case 0:case 11:case 15:_l(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Z=r;else a:for(n=e;Z!==null;){r=Z;var i=r.sibling,a=r.return;if(pu(r),r===n){Z=null;break a}if(i!==null){i.return=a,Z=i;break a}Z=a}}}var Ku={getCacheForType:function(e){var t=ya(Ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ya(Ta).controller.signal}},qu=typeof WeakMap==`function`?WeakMap:Map,Ju=0,Yu=null,Xu=null,Zu=0,Qu=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return Ju&2&&Zu!==0?Zu&-Zu:W.T===null?dt():Pf()}function jd(){if(cd===0){if(!(Zu&536870912)||Qi){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),cd=e}else cd=536870912}return e=Co.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Ip(ui(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Yu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Zu,cd,!1)),it(e,n),Ju&2&&e===Yu||(e===Yu&&(!(Ju&2)&&(od|=n),id===4&&Ld(e,Zu,cd,!1)),Ef(e))}function Pd(e,t,n){if(Ju&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||$e(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Kd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(e,0),Ld(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:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-Ne(),10<a)){if(Ld(r,t,cd,!ed),Qe(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=vp(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}}while(1);Ef(e)}function Fd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},Pl=null,Bu(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=ih.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-Ne():(a&4194048)===a?md-Ne():0,m=nh(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(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(!Pr(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 Ld(e,t,n,r){t=et(e,t),t&=~sd,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ot(e,n,t)}function Rd(){return Ju&6?!0:(Df(0,!1),!1)}function zd(){if(Xu!==null){if(Qu===0)var e=Xu.return;else e=Xu,da=ua=null,$o(e),Qa=null,$a=0,e=Xu;for(;e!==null;)hl(e.alternate,e),e=e.return;Xu=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,yp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Yu=e,Xu=n=Di(e.current,null),Zu=t,Qu=0,$u=null,ed=!1,td=$e(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=et(e,t),_i(),n}function Vd(e,t){Fo=null,W.H=cc,t===Ua||t===Ga?(t=Xa(),Qu=3):t===Wa?(t=Xa(),Qu=4):Qu=t===Ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,Xu===null&&(id=1,bc(e,Fi(t,e.current)))}function Hd(){var e=Co.current;return e===null?!0:(Zu&4194048)===Zu?wo===null:(Zu&62914560)===Zu||Zu&536870912?e===wo:!1}function Ud(){var e=W.H;return W.H=cc,e===null?cc:e}function Wd(){var e=W.A;return W.A=Ku,e}function Gd(){id=4,ed||(Zu&4194048)!==Zu&&Co.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Yu===null||Ld(Yu,Zu,cd,!1)}function Kd(e,t,n){var r=Ju;Ju|=2;var i=Ud(),a=Wd();(Yu!==e||Zu!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Qu!==0&&Xu!==null){var s=Xu,c=$u;switch(Qu){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:Co.current===null&&(t=!0);var l=Qu;if(Qu=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Qu,Qu=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,da=ua=null,Ju=r,W.H=i,W.A=a,Xu===null&&(Yu=null,Zu=0,_i()),o}function qd(){for(;Xu!==null;)Xd(Xu)}function Jd(e,t){var n=Ju;Ju|=2;var r=Ud(),a=Wd();Yu!==e||Zu!==t?(gd=null,hd=Ne()+500,Bd(e,t)):td=$e(e,t);a:do try{if(Qu!==0&&Xu!==null){t=Xu;var o=$u;b:switch(Qu){case 1:Qu=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(qa(o)){Qu=0,$u=null,Zd(t);break}t=function(){Qu!==2&&Qu!==9||Yu!==e||(Qu=7),Ef(e)},o.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:qa(o)?(Qu=0,$u=null,Zd(t)):(Qu=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(Xu.tag){case 26:s=Xu.memoizedState;case 5:case 27:var c=Xu;if(s?Zm(s):c.stateNode.complete){Qu=0,$u=null;var l=c.sibling;if(l!==null)Xu=l;else{var u=c.return;u===null?Xu=null:(Xu=u,$d(u))}break b}}Qu=0,$u=null,Qd(e,t,o,5);break;case 6:Qu=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return da=ua=null,W.H=r,W.A=a,Ju=n,Xu===null?(Yu=null,Zu=0,_i(),id):0}function Yd(){for(;Xu!==null&&!je();)Xd(Xu)}function Xd(e){var t=ol(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?$d(e):Xu=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bc(n,t,t.pendingProps,t.type,void 0,Zu);break;case 11:t=Bc(n,t,t.pendingProps,t.type.render,t.ref,Zu);break;case 5:$o(t);var r=t;r===Xi&&(Qi?(ia(r),r.tag===5&&r.stateNode!=null&&(Zi=r.stateNode)):(ia(r),Qi=!0));default:hl(n,t),t=Xu=Oi(t,rd),t=ol(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?$d(e):Xu=t}function Qd(e,t,n,r){da=ua=null,$o(t),Qa=null,$a=0;var i=t.return;try{if(Tc(e,i,t,n,Zu)){id=1,bc(e,Fi(n,e.current)),Xu=null;return}}catch(t){if(i!==null)throw Xu=i,t;id=1,bc(e,Fi(n,e.current)),Xu=null;return}t.flags&32768?(Qi||r===1?e=!0:td||Zu&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=Co.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,ed);return}e=t.return;var n=pl(t.alternate,t,rd);if(n!==null){Xu=n;return}if(t=t.sibling,t!==null){Xu=t;return}Xu=t=e}while(t!==null);id===0&&(id=5)}function ef(e,t){do{var n=ml(e.alternate,e);if(n!==null){n.flags&=32767,Xu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Xu=e;return}Xu=e=n}while(e!==null);id=6,Xu=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(Ju&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Yu&&(Xu=Yu=null,Zu=0),bd=t,yd=e,xd=n,Cd=a,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=gi,at(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Aa(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Le,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=W.T,W.T=null,i=se.p,se.p=2,a=Ju,Ju|=4;try{su(e,t,n)}finally{Ju=a,se.p=i,W.T=r}}vd=1,Nl?Td=Pp(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,Ou(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=W.T,W.T=null;var i=se.p;se.p=2;var a=Ju;Ju|=4;try{iu=au=!1,wu(t,e,n),n=up;var o=Br(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&zr(s.ownerDocument.documentElement,s)){if(c!==null&&Vr(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 _=Rr(s,h),v=Rr(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}}vh=!!lp,up=lp=null}finally{Ju=a,se.p=i,W.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=W.T,W.T=null;var r=se.p;se.p=2;var i=Ju;Ju|=4;try{lu(e,t.alternate,t)}finally{Ju=i,se.p=r,W.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Me();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),ut(r),n=n.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(K,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=W.T,a=se.p,se.p=2,W.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{W.T=n,se.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=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);xd&3&&uf(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Df(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Da(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=ut(xd),r=W.T,a=se.p;try{se.p=32>n?32:n,W.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,Ju&6)throw Error(i(331));var c=Ju;if(Ju|=4,Uu(o.current),Fu(o,o.current,s,n),Ju=c,Df(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(K,o)}catch{}return!0}finally{se.p=a,W.T=r,lf(e,t)}}function ff(e,t,n){t=Fi(n,t),t=Sc(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(it(e,2),Ef(e))}function pf(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Fi(n,e),n=Cc(2),r=uo(t,n,2),r!==null&&(wc(n,r,t,e),it(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new qu;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)||(nd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Yu===e&&(Zu&n)===n&&(id===4||id===3&&(Zu&62914560)===Zu&&300>Ne()-pd?Ju&2?sd|=n:Bd(e,0):sd|=n,ld===Zu&&(ld=0)),Ef(e)}function gf(e,t){t===0&&(t=nt()),e=bi(e,t),e!==null&&(it(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(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),gf(e,n)}function yf(e,t){return ke(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Zu,a=Qe(r,r===Yu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&_p()&&(e=Tf);for(var t=Ne(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}vd!==0&&vd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=tt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Yu,n=Zu,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ae(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ae(r),ut(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=jf.bind(null,e),n=ke(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ae(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=Zu;return r=Qe(e,e===Yu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),Af(e,Ne()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(uf())return null;Pd(e,t,!0)}function Nf(){Sp(function(){Ju&6?ke(Fe,Of):kf()})}function Pf(){if(Tf===0){var e=Na;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[ht]||null).action),o=r.submitter;o&&(t=(t=o[ht]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);Js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<si.length;Lf++){var Rf=si[Lf];ci(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}ci($r,`onAnimationEnd`),ci(ei,`onAnimationIteration`),ci(ti,`onAnimationStart`),ci(`dblclick`,`onDoubleClick`),ci(`focusin`,`onFocus`),ci(`focusout`,`onBlur`),ci(ni,`onTransitionRun`),ci(ri,`onTransitionStart`),ci(ii,`onTransitionCancel`),ci(ai,`onTransitionEnd`),Nt(`onMouseEnter`,[`mouseout`,`mouseover`]),Nt(`onMouseLeave`,[`mouseout`,`mouseover`]),Nt(`onPointerEnter`,[`pointerout`,`pointerover`]),Nt(`onPointerLeave`,[`pointerout`,`pointerover`]),Mt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Mt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Mt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Mt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){pi(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){pi(e)}i.currentTarget=null,a=c}}}}function Hf(e,t){var n=t[_t];n===void 0&&(n=t[_t]=new Set);var r=e+`__bubble`;n.has(r)||(Kf(t,e,2,!1),n.add(r))}function Uf(e,t,n){var r=0;t&&(r|=4),Kf(n,e,r,t)}var Wf=`_reactListening`+Math.random().toString(36).slice(2);function Gf(e){if(!e[Wf]){e[Wf]=!0,At.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Uf(t,!1,e),Uf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wf]||(t[Wf]=!0,Uf(`selectionchange`,!1,t))}}function Kf(e,t,n,r){switch(Th(t)){case 2:var i=yh;break;case 8:i=bh;break;default:i=xh}n=i.bind(null,t,n,e),i=void 0,!xn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function qf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=wt(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}vn(function(){var r=a,i=pn(n),s=[];a:{var c=oi.get(e);if(c!==void 0){var l=Mn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Xn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;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=zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=$n;break;case $r:case ei:case ti:l=Hn;break;case ai:l=er;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=tr;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Zn;break;case`submit`:l=Qn;break;case`toggle`:case`beforetoggle`:l=nr}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=yn(m,p),g!=null&&d.push(Jf(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!==fn&&(u=n.relatedTarget||n.fromElement)&&(wt(u)||u[gt]))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?wt(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=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Et(c),h=l==null?u:Et(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,wt(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,Xf):null,c!==null&&Zf(s,u,c,d,!1),l!==null&&f!==null&&Zf(s,f,l,d,!0)))}a:{if(c=r?Et(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Sr;else if(gr(c)){if(Cr)_=Mr;else{_=Ar;var v=kr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&sn(r.elementType)&&(_=Sr):_=jr;if(_&&=_(e,r)){_r(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Et(r):window,e){case`focusin`:(gr(v)||v.contentEditable===`true`)&&(Ur=v,Wr=r,Gr=null);break;case`focusout`:Gr=Wr=Ur=null;break;case`mousedown`:Kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Kr=!1,qr(s,n,i);break;case`selectionchange`:if(Hr)break;case`keydown`:case`keyup`:qr(s,n,i)}var y;if(ir)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 fr?ur(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(sr&&n.locale!==`ko`&&(fr||b!==`onCompositionStart`?b===`onCompositionEnd`&&fr&&(y=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,fr=!0)),v=Yf(r,b),0<v.length&&(b=new Wn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=dr(n),y!==null&&(b.data=y)))),(y=or?pr(e,n):mr(e,n))&&(b=Yf(r,`onBeforeInput`),0<b.length&&(v=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function Jf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yf(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=yn(e,n),i!=null&&r.unshift(Jf(e,i,a)),i=yn(e,t),i!=null&&r.push(Jf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Xf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zf(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=yn(n,a),l!=null&&o.unshift(Jf(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Jf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Qf=/\r\n?/g,$f=/\u0000|\uFFFD/g;function ep(e){return(typeof e==`string`?e:``+e).replace(Qf,`
9
+ `).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function np(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||nn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&nn(e,``+r);else return;break;case`className`:Vt(e,`class`,r);break;case`tabIndex`:Vt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Vt(e,n,r);break;case`style`:on(e,r,o);return;case`data`:if(t!==`object`){Vt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(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`&&np(e,t,`name`,a.name,a,null),np(e,t,`formEncType`,a.formEncType,a,null),np(e,t,`formMethod`,a.formMethod,a,null),np(e,t,`formTarget`,a.formTarget,a,null)):(np(e,t,`encType`,a.encType,a,null),np(e,t,`method`,a.method,a,null),np(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);return;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`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=un(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`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Bt(e,`popover`,r);break;case`xlinkActuate`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ht(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ht(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ht(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Bt(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=cn.get(n)||n,Bt(e,n,r);else return}Rt=!0}function rp(e,t,n,r,a,o){switch(n){case`style`:on(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`)nn(e,r);else if(typeof r==`number`||typeof r==`bigint`)nn(e,``+r);else return;break;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=dn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!jt.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[ht]||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}Rt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Bt(e,n,r)}return}Rt=!0}function ip(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Hf(`error`,e),Hf(`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:np(e,t,o,s,n,null)}}a&&np(e,t,`srcSet`,n.srcSet,n,null),r&&np(e,t,`src`,n.src,n,null);return;case`input`:Hf(`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:np(e,t,r,d,n,null)}}Zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Hf(`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:np(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in Hf(`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:np(e,t,s,c,n,null)}tn(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:np(e,t,l,r,n,null)}return;case`dialog`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Hf(`cancel`,e),Hf(`close`,e);break;case`iframe`:case`object`:Hf(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Hf(zf[r],e);break;case`image`:Hf(`error`,e),Hf(`load`,e);break;case`details`:Hf(`toggle`,e);break;case`embed`:case`source`:case`link`:Hf(`error`,e),Hf(`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:np(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&rp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&np(e,t,c,r,n,null))}var ap={};function op(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)||np(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&&(Rt=!0),o=m;break;case`name`:m!==f&&(Rt=!0),a=m;break;case`checked`:m!==f&&(Rt=!0),u=m;break;case`defaultChecked`:m!==f&&(Rt=!0),d=m;break;case`value`:m!==f&&(Rt=!0),s=m;break;case`defaultValue`:m!==f&&(Rt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&np(e,t,p,m,r,f)}}Xt(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)||np(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&&(Rt=!0),p=o;break;case`defaultValue`:o!==l&&(Rt=!0),c=o;break;case`multiple`:o!==l&&(Rt=!0),s=o;default:o!==l&&np(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(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:np(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&&(Rt=!0),p=a;break;case`defaultValue`:a!==o&&(Rt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&np(e,t,s,a,r,o)}en(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:np(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&&(Rt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:np(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)&&np(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:np(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&rp(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||rp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&np(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||np(e,t,f,p,r,m)}function sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function cp(){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&&sp(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&&sp(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 lp=null,up=null;function dp(e){return e.nodeType===9?e:e.ownerDocument}function fp(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 pp(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 mp(e,t,n,r){return n=dp(n).createElement(e),n[mt]=r,n[ht]=t,ip(n,e,t),Ot(n),n}function hp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Wh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ym(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ym(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[xt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ym(e.ownerDocument.body)}n=i}while(n);Wh(t)}function Ep(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Dp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Op(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function kp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Mp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Qm(f),u>th){s.length=o;break}f=new Promise(Np.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Hp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),hm(e,t))}Lp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=dp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,gm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Wp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=wt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function $p(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Wp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),$p(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),$p(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function em(e,t){return e=b(e),tm(e,t),!1}function tm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),tm(e,t))}function rm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function im(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:im(n),Ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function am(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[xt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=dm(e.nextSibling),e===null)break}return null}function om(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=dm(e.nextSibling),e===null))return null;return e}function sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=dm(e.nextSibling),e===null))return null;return e}function cm(e){return e.data===`$?`||e.data===`$~`}function lm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function um(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function dm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var fm=null;function pm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function gm(e){xp(function(){xp(function(t){return e(t)})})}function _m(e,t,n){switch(t=dp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&np(e,t,r,null,ap,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===dn&&(e.onclick=null),Ct(e)}function ym(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ct(e)}var bm=new Map,xm=new Set;function Sm(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 Cm=se.d;se.d={f:wm,r:Tm,D:Om,C:km,L:Am,m:jm,X:Nm,S:Mm,M:Pm};function wm(){var e=Cm.f(),t=Rd();return e||t}function Tm(e){var t=Tt(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):Cm.r(e)}var Em=typeof document>`u`?null:document;function Dm(e,t,n){var r=Em;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xm.has(i)||(xm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ip(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Om(e){Cm.D(e),Dm(`dns-prefetch`,e,null)}function km(e,t){Cm.C(e,t),Dm(`preconnect`,e,t)}function Am(e,t,n){Cm.L(e,t,n);var r=Em;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Im(e);break;case`script`:a=Bm(e)}if(!(bm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lm(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);ip(o,`link`,e),t===`style`&&(o[St]=!0,o.onload=o.onerror=function(){kt(o)}),Ot(o),r.head.appendChild(o)}}}function jm(e,t){Cm.m(e,t);var n=Em;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!bm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),ip(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Mm(e,t,n){Cm.S(e,t,n);var r=Em;if(r&&e){var i=Dt(r).hoistableStyles,a=Im(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);Ot(c),ip(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,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nm(e,t){Cm.X(e,t);var n=Em;if(n&&e){var r=Dt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Ot(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t){Cm.M(e,t);var n=Em;if(n&&e){var r=Dt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Ot(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t,n,r){var a=(a=ge.current)?Sm(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=Im(n.href),t=Dt(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=Im(n.href);var o=Dt(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(Lm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=bm.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},bm.set(e,o)),zm(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=Bm(n),t=Dt(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 Im(e){return`href="`+Yt(e)+`"`}function Lm(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[St]){r.loading=1;return}}else t=e.createElement(`link`),t[St]=!0,t.onload=t.onerror=kt.bind(null,t),ip(t,`link`,n),Ot(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 Bm(e){return`[src="`+Yt(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,Ot(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`),Ot(r),ip(r,`style`,a),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Im(n.href);var o=e.querySelector(Lm(a));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Rm(n),(a=bm.get(a))&&Wm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ip(o,`link`,r),t.state.loading|=4,Um(o,n.precedence,e),t.instance=o;case`script`:return o=Bm(n.src),(a=e.querySelector(Vm(o)))?(t.instance=a,Ot(a),a):(r=n,(a=bm.get(o))&&(r=D({},n),Gm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ot(a),ip(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,Um(r,n.precedence,e));return t.instance}function Um(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 Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,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[xt]||a[mt]||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 Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(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 Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(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=Im(r.href),a=t.querySelector(Lm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Rm(r),(i=bm.get(i))&&Wm(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ip(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=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.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=ih.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 lh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function uh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ti(3,null,null,t),e.current=a,a.stateNode=e,t=Ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},so(a),e}function fh(e){return e?(e=Ci,e):Ci}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Nd(n,e,t),fo(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=bi(e,67108864);t!==null&&Nd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=Ad();t=lt(t);var n=bi(e,t);n!==null&&Nd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=W.T;W.T=null;var a=se.p;try{se.p=2,xh(e,t,n,r)}finally{se.p=a,W.T=i}}function bh(e,t,n,r){var i=W.T;W.T=null;var a=se.p;try{se.p=8,xh(e,t,n,r)}finally{se.p=a,W.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)qf(e,t,r,Ch,n),Ph(e,r);else if(Ih(i,e,t,n,r))r.stopPropagation();else if(Ph(e,r),t&4&&-1<Nh.indexOf(e)){for(;i!==null;){var a=Tt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Ju&6)&&(hd=Ne()+500,Df(0,!1))}}break;case 31:case 13:s=bi(a,2),s!==null&&Nd(s,a,2),Rd(),hh(a,2)}if(a=Sh(r),a===null&&qf(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else qf(e,t,r,null,n)}}function Sh(e){return e=pn(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=wt(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 Ch=e,null}function Th(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(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,jh=new Map,Mh=[],Nh=`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 Ph(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jh.delete(t.pointerId)}}function Fh(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=Tt(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ih(e,t,n,r,i){switch(t){case`focusin`:return Dh=Fh(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Fh(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Fh(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Fh(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jh.set(a,Fh(jh.get(a)||null,e,t,n,r,i)),!0}return!1}function Lh(e){var t=wt(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,ft(e.priority,function(){_h(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ft(e.priority,function(){_h(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 Rh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Tt(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function zh(e,t,n){Rh(e)&&n.delete(t)}function Bh(){Eh=!1,Dh!==null&&Rh(Dh)&&(Dh=null),Oh!==null&&Rh(Oh)&&(Oh=null),kh!==null&&Rh(kh)&&(kh=null),Ah.forEach(zh),jh.forEach(zh)}function Vh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bh)))}var Hh=null;function Uh(e){Hh!==e&&(Hh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hh===e&&(Hh=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(wh(r||n)===null)continue;break}var a=Tt(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wh(e){function t(t){return Vh(t,e)}Dh!==null&&Vh(Dh,e),Oh!==null&&Vh(Oh,e),kh!==null&&Vh(kh,e),Ah.forEach(t),jh.forEach(t);for(var n=0;n<Mh.length;n++){var r=Mh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mh.length&&(n=Mh[0],n.blockedOn===null);)Lh(n),n.blockedOn===null&&Mh.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[ht]||null;if(typeof a==`function`)o||Uh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ht]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Uh(n)}}}function Gh(){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 Kh(e){this._internalRoot=e}qh.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ph(n,Ad(),e,t,null,null)},qh.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),Rd(),t[gt]=null}};function qh(e){this._internalRoot=e}qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mh.length&&t!==0&&t<Mh[n].priority;n++);Mh.splice(n,0,e),n===0&&Lh(e)}};var Jh=n.version;if(Jh!==`19.3.1`)throw Error(i(527,Jh,`19.3.1`));se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Yh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{K=Xh.inject(Yh),He=Xh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dh(e,1,!1,null,null,n,r,null,o,s,c,Gh),e[gt]=t.current,Gf(e),new Kh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g(),y=[`Shift`,`Meta`,`Alt`,`Control`],b=1e3,x=`keydown`,S=typeof navigator==`object`?navigator.platform:``,C=/Mac|iPod|iPhone|iPad/.test(S)?`Meta`:`Control`,w=S===`Win32`?[`Control`,`Alt`]:[`Alt`];function T(e){return!!(e.key&&e.code&&e.getModifierState)}function E(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function D(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||w.includes(t)&&e.getModifierState(`AltGraph`):!1}function O(e){return e.trim().split(` `).map(e=>{let t=e.split(/(?<=\w|\])\+/),n=t.pop(),r=n.match(/^\((.+)\)$/),i=r?RegExp(`^(?:${r[1]})$`,`iv`):n,a=[],o=[];for(let e of t){let t=e.match(/^\[(.*)\]$/),n=t?.[1]??e;n=n===`$mod`?C:n,t?o.push(n):a.push(n)}return[a,o,i]})}function k(e,[t,n,r]){let i=t.includes(`AltGraph`);return!((r instanceof RegExp?!(r.test(e.key)||r.test(e.code)):r.toUpperCase()!==e.key.toUpperCase()&&r!==e.code)||t.find(t=>!D(e,t))||y.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&D(e,a)&&!(i&&w.includes(a))))}function A(e,t={}){let n=t.timeout??b,r=t.ignore??E,i=Object.keys(e).map(t=>[t,O(t),e[t]]),a=new Map,o=null;return e=>{if(!T(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!k(e,i))D(e,e.key)||a.delete(n);else if(s.length>0)a.set(n,s),t.push(n);else if(a.delete(n),t.length)console.warn(`tinykeys: Conflict found, "${n}" did not fire, waiting for:`,t);else{o(e);break}}o&&clearTimeout(o),o=setTimeout(()=>a.clear(),n)}}function j(e,t,n={}){let r=n.event??x,i=A(t,n);return e.addEventListener(r,i,n.capture),()=>{e.removeEventListener(r,i,n.capture)}}var M=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},N=(e=>e?M(e):M),P=e=>e;function F(e,t=P){let n=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return _.useDebugValue(n),n}var I=e=>Symbol.iterator in e,L=e=>`entries`in e,R=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},z=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function B(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:I(e)&&I(t)?L(e)&&L(t)?R(e,t):z(e,t):R({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function V(e){let t=_.useRef(void 0);return n=>{let r=e(n);return B(t.current,r)?t.current:t.current=r}}var ee={$mod:`⌘`,Meta:`⌘`,Control:`⌃`,Alt:`⌥`,Shift:`⇧`},te=[`Control`,`Alt`,`Shift`,`$mod`,`Meta`],ne={$mod:`Ctrl`,Meta:`Win`,Control:`Ctrl`,Alt:`Alt`,Shift:`Shift`},re={Backslash:`\\`,BracketLeft:`[`,BracketRight:`]`,Equal:`=`,Minus:`-`,Escape:`Esc`,Enter:`↵`,Backspace:`⌫`,Tab:`Tab`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`},H=/Mac|iPod|iPhone|iPad/.test(navigator.platform);function U(e,t=H){return ie(e,t).join(t?``:`+`)}function ie(e,t=H){let n=e.split(`+`),r=n.pop()??``,i=t?ee:ne,a=t?[...n].sort((e,t)=>te.indexOf(e)-te.indexOf(t)):n;return[...(ae(r)?a.filter(e=>e!==`Shift`):a).map(e=>i[e]??e),oe(r)]}function ae(e){return e.length===1&&!/[a-z0-9]/i.test(e)}function oe(e){return re[e]||(/^(?:Key|Digit)(.)$/.exec(e)?.[1]??e).toUpperCase()}var W=new Set([`Backquote`,`Backslash`,`BracketLeft`,`BracketRight`,`Comma`,`Equal`,`Minus`,`Period`,`Quote`,`Semicolon`,`Slash`]);function se(e){let t=e.split(`+`),n=t.pop()??``;return t.some(e=>e!==`Shift`)?!1:n.length===1||/^(?:Key|Digit).$/.test(n)||W.has(n)}var ce=`frameboard.characterKeys`;function le(e){let t=N()(()=>({on:me(e)}));return t.subscribe((t,n)=>{t.on!==n.on&&he(e,t.on)}),t}function ue(e,t=_e){t.setState({on:e})}function de(e=_e){return e.getState().on}function fe(e=_e){return F(e,e=>e.on)}function pe(e,t=de()){return e?.find(e=>t||!se(e))}function me(e){try{return e?.getItem(ce)!==`off`}catch{return!0}}function he(e,t){try{e?.setItem(ce,t?`on`:`off`)}catch{}}function ge(){try{return window.localStorage}catch{return null}}var _e=le(ge()),ve=N()(()=>({actions:[],version:0}));function ye(e){return ve.setState(t=>({actions:[...t.actions,...e]})),()=>ve.setState(t=>({actions:t.actions.filter(t=>!e.includes(t))}))}function G(){ve.setState(e=>({version:e.version+1}))}function be(e){return e.enabled?.()??!0}function xe(e){return F(ve,V(t=>[t.version,...e.map(e=>t.actions.find(t=>t.id===e))])).slice(1)}function Se(e){return ve.getState().actions.find(t=>t.id===e)}function Ce(){return F(ve,V(e=>{let t=new Set,n=e.actions.filter(e=>!e.command||t.has(e.id)?!1:(t.add(e.id),be(e)));return[e.version,...n]})).slice(1)}function we(e){return F(ve,V(t=>[t.version,...t.actions.filter(t=>t.group===e)])).slice(1)}function Te(e,t){let n=n=>{let r=new Set(n.flatMap(e=>e.keys??[]).filter(e=>!t||t.includes(e)));return j(e,Object.fromEntries([...r].map(e=>[e,t=>Ee(e,t)])),{ignore:De})},r=n(ve.getState().actions),i=ve.subscribe((e,t)=>{e.actions!==t.actions&&(r(),r=n(e.actions))});return()=>{i(),r()}}function Ee(e,t){if(se(e)&&!de())return;let n=ve.getState().actions.find(t=>t.keys?.includes(e)&&be(t));n&&(t.preventDefault(),n.run())}function De(e){let t=e.target;return typeof t?.matches==`function`?E(e)||t.isContentEditable?!0:t.closest?.(`[data-slot="toast"]`)==null?t.closest?.(`[role="dialog"]`)!=null:e.key===`Enter`:!1}var Oe=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function ke(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Oe(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Ae=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},je=e=>{let t=Ae(e);return t.charAt(0).toUpperCase()+t.slice(1)},Me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ne={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Pe(e){return e!=null}function Fe(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ne.width,a=e.size??e.height??Ne.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Me(...c):Me(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ne[`stroke-width`])*Number(e.size??e.width??Ne.width)/Number(t.size??t.width??Ne.width):t.strokeWidth??Ne[`stroke-width`];return[`svg`,{...Object.entries(Ne).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Pe(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Pe(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Pe(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Ie(e,t={}){return Fe(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Le=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Re=(0,_.createContext)({});function ze({children:e,size:t,color:n,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:a,className:o}){let s=(0,_.useMemo)(()=>({size:t,color:n,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:a,className:o}),[t,n,r,i,a,o]);return(0,_.createElement)(Re.Provider,{value:s},e)}var Be=()=>(0,_.useContext)(Re),Ve=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=Be()??{},b=!!c||Le(d),[x,S,C=[]]=Ie(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Me(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function K(e,t=[],n=[]){let r=typeof e==`string`?ke(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(Ve,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=je(r.name)),i}var He={name:`align-center-horizontal`,size:24,node:[[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4`,key:`11f1s0`}],[`path`,{d:`M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4`,key:`t14dx9`}],[`path`,{d:`M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1`,key:`1w07xs`}],[`path`,{d:`M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1`,key:`1apec2`}]]};He.node;var Ue=K(He),We={name:`align-center-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4`,key:`14d6g8`}],[`path`,{d:`M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4`,key:`1e2lrw`}],[`path`,{d:`M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1`,key:`1fkdwx`}],[`path`,{d:`M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1`,key:`1euafb`}]]};We.node;var Ge=K(We),Ke={name:`align-end-horizontal`,size:24,node:[[`rect`,{width:`6`,height:`16`,x:`4`,y:`2`,rx:`2`,key:`z5wdxg`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`9`,rx:`2`,key:`um7a8w`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}]]};Ke.node;var qe=K(Ke),Je={name:`align-end-vertical`,size:24,node:[[`rect`,{width:`16`,height:`6`,x:`2`,y:`4`,rx:`2`,key:`10wcwx`}],[`rect`,{width:`9`,height:`6`,x:`9`,y:`14`,rx:`2`,key:`4p5bwg`}],[`path`,{d:`M22 22V2`,key:`12ipfv`}]]};Je.node;var Ye=K(Je),Xe={name:`align-horizontal-distribute-center`,size:24,node:[[`rect`,{width:`6`,height:`14`,x:`4`,y:`5`,rx:`2`,key:`1wwnby`}],[`rect`,{width:`6`,height:`10`,x:`14`,y:`7`,rx:`2`,key:`1fe6j6`}],[`path`,{d:`M17 22v-5`,key:`4b6g73`}],[`path`,{d:`M17 7V2`,key:`hnrr36`}],[`path`,{d:`M7 22v-3`,key:`1r4jpn`}],[`path`,{d:`M7 5V2`,key:`liy1u9`}]]};Xe.node;var Ze=K(Xe),Qe={name:`align-horizontal-space-between`,size:24,node:[[`rect`,{width:`6`,height:`14`,x:`3`,y:`5`,rx:`2`,key:`j77dae`}],[`rect`,{width:`6`,height:`10`,x:`15`,y:`7`,rx:`2`,key:`bq30hj`}],[`path`,{d:`M3 2v20`,key:`1d2pfg`}],[`path`,{d:`M21 2v20`,key:`p059bm`}]]};Qe.node;var $e=K(Qe),et={name:`align-start-vertical`,size:24,node:[[`rect`,{width:`9`,height:`6`,x:`6`,y:`14`,rx:`2`,key:`lpm2y7`}],[`rect`,{width:`16`,height:`6`,x:`6`,y:`4`,rx:`2`,key:`rdj6ps`}],[`path`,{d:`M2 2v20`,key:`1ivd8o`}]]};et.node;var tt=K(et),nt={name:`align-start-horizontal`,size:24,node:[[`rect`,{width:`6`,height:`16`,x:`4`,y:`6`,rx:`2`,key:`1n4dg1`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`6`,rx:`2`,key:`17khns`}],[`path`,{d:`M22 2H2`,key:`fhrpnj`}]]};nt.node;var rt=K(nt),it={name:`align-vertical-distribute-center`,size:24,node:[[`path`,{d:`M22 17h-3`,key:`1lwga1`}],[`path`,{d:`M22 7h-5`,key:`o2endc`}],[`path`,{d:`M5 17H2`,key:`1gx9xc`}],[`path`,{d:`M7 7H2`,key:`6bq26l`}],[`rect`,{x:`5`,y:`14`,width:`14`,height:`6`,rx:`2`,key:`1qrzuf`}],[`rect`,{x:`7`,y:`4`,width:`10`,height:`6`,rx:`2`,key:`we8e9z`}]]};it.node;var at=K(it),ot={name:`arrow-down-up`,size:24,node:[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`m21 8-4-4-4 4`,key:`1c9v7m`}],[`path`,{d:`M17 4v16`,key:`7dpous`}]]};ot.node;var st=K(ot),ct={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};ct.node;var lt=K(ct),ut={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};ut.node;var dt=K(ut),ft={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};ft.node;var pt=K(ft),mt={name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]};mt.node;var ht=K(mt),gt={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};gt.node;var _t=K(gt),vt={name:`bring-to-front`,size:24,node:[[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`2`,key:`yj20xf`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2`,key:`1ltk23`}],[`path`,{d:`M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2`,key:`1q24h9`}]]};vt.node;var yt=K(vt),bt={name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]};bt.node;var xt=K(bt),St={name:`case-lower`,size:24,node:[[`path`,{d:`M10 9v7`,key:`ylp826`}],[`path`,{d:`M14 6v10`,key:`1jy4vg`}],[`circle`,{cx:`17.5`,cy:`12.5`,r:`3.5`,key:`1a9481`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`3.5`,key:`2jlv1r`}]]};St.node;var Ct=K(St),wt={name:`case-sensitive`,size:24,node:[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]};wt.node;var Tt=K(wt),Et={name:`case-upper`,size:24,node:[[`path`,{d:`M15 11h4.5a1 1 0 0 1 0 5h-4a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h3a1 1 0 0 1 0 5`,key:`nxs35`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]};Et.node;var Dt=K(Et),Ot={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ot.node;var kt=K(Ot),At={name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]};At.node;var jt=K(At),Mt={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Mt.node;var Nt=K(Mt),Pt={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Pt.node;var Ft=K(Pt),It={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};It.node;var Lt=K(It),Rt={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Rt.node;var zt=K(Rt),Bt={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Bt.node;var Vt=K(Bt),Ht={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Ht.node;var Ut=K(Ht),Wt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Wt.node;var Gt=K(Wt),Kt={name:`clipboard-paste`,size:24,node:[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]};Kt.node;var qt=K(Kt),Jt={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Jt.node;var Yt=K(Jt),Xt={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Xt.node;var Zt=K(Xt),Qt={name:`command`,size:24,node:[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]};Qt.node;var $t=K(Qt),en={name:`copy-plus`,size:24,node:[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};en.node;var tn=K(en),nn={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};nn.node;var rn=K(nn),an={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};an.node;var on=K(an),sn={name:`eighth-notes`,size:24,node:[[`path`,{d:`M21 16V3a1 1 0 0 0-1.28-.96l-10 2.917a1 1 0 0 0-.72.96V19`,key:`uy6ho8`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}],[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}]],aliases:[`music`]};sn.node;var cn=K(sn),ln={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};ln.node;var un=K(ln),dn={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};dn.node;var fn=K(dn),pn={name:`eye`,size:24,node:[[`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`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};pn.node;var mn=K(pn),hn={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};hn.node;var gn=K(hn),_n={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};_n.node;var vn=K(_n),yn={name:`fold-vertical`,size:24,node:[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]};yn.node;var bn=K(yn),xn={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`,key:`1kt360`}]]};xn.node;var Sn=K(xn),Cn={name:`folder`,size:24,node:[[`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`,key:`1kt360`}]]};Cn.node;var wn=K(Cn),Tn={name:`frame`,size:24,node:[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`,key:`15w7dq`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`,key:`1ip48p`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`,key:`a2lnyx`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`,key:`8vb6jd`}]]};Tn.node;var En=K(Tn),Dn={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};Dn.node;var On=K(Dn),kn={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};kn.node;var An=K(kn),jn={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};jn.node;var Mn=K(jn),Nn={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Nn.node;var Pn=K(Nn),Fn={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Fn.node;var In=K(Fn),Ln={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Ln.node;var Rn=K(Ln),zn={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};zn.node;var Bn=K(zn),Vn={name:`letter-spacing`,size:24,node:[[`path`,{d:`M15 14H9`,key:`u4f7rb`}],[`path`,{d:`M21 3v18`,key:`fnf4zc`}],[`path`,{d:`M3 3v18`,key:`k760nc`}],[`path`,{d:`m8 16 3.453-7.648a.6.6 0 011.094.001L16 16`,key:`16ilm2`}]]};Vn.node;var Hn=K(Vn),Un={name:`line-height`,size:24,node:[[`path`,{d:`M15 14H9`,key:`u4f7rb`}],[`path`,{d:`M21 21H3`,key:`oafrgs`}],[`path`,{d:`M21 3H3`,key:`e9iw4c`}],[`path`,{d:`m8 16 3.453-7.648a.6.6 0 011.094.001L16 16`,key:`16ilm2`}]]};Un.node;var Wn=K(Un),Gn={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Gn.node;var Kn=K(Gn),qn={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]};qn.node;var Jn=K(qn),Yn={name:`list-chevrons-up-down`,size:24,node:[[`path`,{d:`M3 5h8`,key:`18g2rq`}],[`path`,{d:`M3 12h8`,key:`1xfjp6`}],[`path`,{d:`M3 19h8`,key:`fpbke4`}],[`path`,{d:`m15 8 3-3 3 3`,key:`bc4io6`}],[`path`,{d:`m15 16 3 3 3-3`,key:`9wmg1l`}]]};Yn.node;var Xn=K(Yn),Zn={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};Zn.node;var Qn=K(Zn),$n={name:`locate-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M18.89 13.24a7 7 0 0 0-8.13-8.13`,key:`1v9jrh`}],[`path`,{d:`M19 12h3`,key:`osuazr`}],[`path`,{d:`M2 12h3`,key:`1wrr53`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.05 7.05a7 7 0 0 0 9.9 9.9`,key:`rc5l2e`}]]};$n.node;var er=K($n),tr={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};tr.node;var nr=K(tr),rr={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};rr.node;var ir=K(rr),ar={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};ar.node;var or=K(ar),sr={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};sr.node;var cr=K(sr),lr={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};lr.node;var ur=K(lr),dr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};dr.node;var fr=K(dr),pr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};pr.node;var mr=K(pr),hr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};hr.node;var gr=K(hr),_r={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};_r.node;var vr=K(_r),yr={name:`move-horizontal`,size:24,node:[[`path`,{d:`m18 8 4 4-4 4`,key:`1ak13k`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}]]};yr.node;var br=K(yr),xr={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};xr.node;var Sr=K(xr),Cr={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};Cr.node;var wr=K(Cr),Tr={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Tr.node;var Er=K(Tr),Dr={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`,key:`1a8usu`}]]};Dr.node;var Or=K(Dr),kr={name:`pencil`,size:24,node:[[`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`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};kr.node;var Ar=K(kr),jr={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};jr.node;var Mr=K(jr),Nr={name:`pipette`,size:24,node:[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]};Nr.node;var Pr=K(Nr),Fr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Fr.node;var Ir=K(Fr),Lr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Lr.node;var Rr=K(Lr),zr={name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]};zr.node;var Br=K(zr),Vr={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]};Vr.node;var Hr=K(Vr),Ur={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Ur.node;var Wr=K(Ur),Gr={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Gr.node;var Kr=K(Gr),qr={name:`scaling`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M14 15H9v-5`,key:`pi4jk9`}],[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M21 3 9 15`,key:`15kdhq`}]]};qr.node;var Jr=K(qr),Yr={name:`scan-eye`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`,key:`11ak4c`}]]};Yr.node;var Xr=K(Yr),Zr={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};Zr.node;var Qr=K(Zr),$r={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};$r.node;var ei=K($r),ti={name:`scissors`,size:24,node:[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]};ti.node;var ni=K(ti),ri={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};ri.node;var ii=K(ri),ai={name:`send-to-back`,size:24,node:[[`rect`,{x:`14`,y:`14`,width:`8`,height:`8`,rx:`2`,key:`1b0bso`}],[`rect`,{x:`2`,y:`2`,width:`8`,height:`8`,rx:`2`,key:`1x09vl`}],[`path`,{d:`M7 14v1a2 2 0 0 0 2 2h1`,key:`pao6x6`}],[`path`,{d:`M14 7h1a2 2 0 0 1 2 2v1`,key:`19tdru`}]]};ai.node;var oi=K(ai),si={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};si.node;var ci=K(si),li={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};li.node;var ui=K(li),di={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};di.node;var fi=K(di),pi={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};pi.node;var mi=K(pi),hi={name:`strikethrough`,size:24,node:[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]};hi.node;var gi=K(hi),_i={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};_i.node;var vi=K(_i),yi={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};yi.node;var bi=K(yi),xi={name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]};xi.node;var Si=K(xi),Ci={name:`text-align-center`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]],aliases:[`align-center`]};Ci.node;var wi=K(Ci),Ti={name:`text-align-end`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]],aliases:[`align-right`]};Ti.node;var Ei=K(Ti),Di={name:`text-align-justify`,size:24,node:[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]],aliases:[`align-justify`]};Di.node;var Oi=K(Di),ki={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]};ki.node;var Ai=K(ki),ji={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};ji.node;var Mi=K(ji),Ni={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ni.node;var Pi=K(Ni),Fi={name:`triangle-alert`,size:24,node:[[`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`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Fi.node;var Ii=K(Fi),Li={name:`triangles-centerline-dashed-horizontal`,size:24,node:[[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M7.298 20.288A1 1 0 008 22h8a1 1 0 00.703-1.712l-3.991-3.99a1 1 0 00-1.424-.001z`,key:`15ue1v`}],[`path`,{d:`M7.298 3.712A1 1 0 018 2h8a1 1 0 01.703 1.712l-3.991 3.99a1 1 0 01-1.424.001z`,key:`lzh03e`}]],aliases:[`flip-horizontal-2`]};Li.node;var Ri=K(Li),zi={name:`triangles-centerline-dashed-vertical`,size:24,node:[[`path`,{d:`M12 14v2`,key:`8jcxud`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 8v2`,key:`1woqiv`}],[`path`,{d:`M20.288 16.703A1 1 0 0022 16V8a1 1 0 00-1.712-.703l-3.99 3.991a1 1 0 00-.001 1.424z`,key:`1ewq2t`}],[`path`,{d:`M3.712 16.703A1 1 0 012 16V8a1 1 0 011.712-.703l3.99 3.991a1 1 0 01.001 1.424z`,key:`1c1klx`}]],aliases:[`flip-vertical-2`]};zi.node;var Bi=K(zi),Vi={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Vi.node;var Hi=K(Vi),Ui={name:`underline`,size:24,node:[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]};Ui.node;var Wi=K(Ui),Gi={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Gi.node;var Ki=K(Gi),qi={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};qi.node;var Ji=K(qi),Yi={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Yi.node;var Xi=K(Yi),Zi={name:`zoom-in`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};Zi.node;var Qi=K(Zi),$i={name:`zoom-out`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};$i.node;var ea=K($i);function ta(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 na=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ra=o(((e,t)=>{t.exports=na()})),ia=ra(),aa=_.useInsertionEffect,oa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?_.useLayoutEffect:_.useEffect,sa=aa||oa,ca=e=>{let t=_.useRef([e,(...e)=>t[0](...e)]).current;return sa(()=>{t[0]=e}),t[1]},la=[`popstate`,`pushState`,`replaceState`,`hashchange`],ua=[],da=()=>ua.forEach(e=>e()),fa=e=>(ua.push(e)===1&&la.forEach(e=>addEventListener(e,da)),()=>{ua=ua.filter(t=>t!==e),ua.length||la.forEach(e=>removeEventListener(e,da))}),pa=(e,t)=>(0,ia.useSyncExternalStore)(fa,e,t),ma=()=>location.search,ha=({ssrSearch:e}={})=>pa(ma,e==null?ma:()=>e),ga=()=>location.pathname,_a=({ssrPath:e}={})=>pa(ga,e==null?ga:()=>e),va=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),ya=e=>[_a(e),va],ba=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[ba]===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,ba,{value:!0})}var xa=(e=``)=>e===`/`?``:e,Sa=(e,t)=>e[0]===`~`?e.slice(1):xa(t)+e,Ca=(e,t)=>(e=wa(xa(e)),t=wa(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),wa=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},Ta={hook:ya,searchHook:ha,parser:ta,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},Ea=(0,_.createContext)(Ta),Da=()=>(0,_.useContext)(Ea),Oa={},ka=(0,_.createContext)(Oa),Aa=()=>(0,_.useContext)(ka),ja=(e,t=e.base)=>Ca(t,e.hook(e)[0]),Ma=e=>{let[t,n]=e.hook(e);return[Ca(e.base,t),ca((t,r)=>e.aroundNav(n,Sa(t,e.base),r))]},Na=()=>Ma(Da()),Pa=(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]},Fa=e=>{let t=Da(),n=/^~\//.test(e);return Pa(t.parser,n?e.slice(1):e,ja(t,n?``:t.base))},Ia=({children:e,...t})=>{let n=Da(),r=t.hook?Ta: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,_.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,_.createElement)(Ea.Provider,{value:i},e)},La=({children:e,component:t},n)=>t?(0,_.createElement)(t,{params:n}):typeof e==`function`?e(n):e,Ra=e=>{let t=(0,_.useRef)(Oa),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},za=({path:e,nest:t,match:n,...r})=>{let i=Da(),a=ja(i),[o,s,c]=n??Pa(i.parser,e,a,t),l=Ra({...Aa(),...s});if(!o)return null;let u=La(r,l);return(0,_.createElement)(ka.Provider,{value:l},c?(0,_.createElement)(Ia,{base:c},u):u)},Ba=(0,_.forwardRef)((e,t)=>{let n=Da(),[r,i]=Ma(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=ca(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,_.isValidElement)(l)?(0,_.cloneElement)(l,m):(0,_.createElement)(`a`,m,l)}),Va=(e,t=[])=>{if(Array.isArray(e))for(let n of e)Va(n&&n.type===_.Fragment?n.props.children:n,t);else t.push(e);return t},Ha=({children:e,location:t})=>{let n=Da(),r=ja(n);for(let i of Va(e)){let e=0;if((0,_.isValidElement)(i)&&(e=Pa(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,_.cloneElement)(i,{match:e})}return null},Ua=e=>{let{to:t,href:n=t}=e,r=Da(),[,i]=Ma(r),a=ca(()=>i(t||n,e)),{ssrContext:o}=r;return oa(()=>{a()},[]),o&&(o.redirectTo=t),null};function Wa(){}var Ga=Object.freeze([]),Ka=Object.freeze({});function qa(e){_.useEffect(e,Ga)}var Ja={};function Ya(e,t){let n=_.useRef(Ja);return n.current===Ja&&(n.current=e(t)),n}var q=typeof document<`u`?_.useLayoutEffect:()=>{};function Xa(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Za=Xa(`https://base-ui.com/production-error`,`Base UI`),Qa=_.createContext(void 0);function $a(){let e=_.useContext(Qa);if(!e)throw Error(Za(73));return e}var eo=o((e=>{var t=u(),n=ra();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),to=o(((e,t)=>{t.exports=eo()})),no=19;function ro(e){return no>=e}var io=[],ao=void 0;function oo(){return ao}function so(e){io.push(e)}function co(e){let t=(t,n)=>{let r=Ya(uo).current,i;try{ao=r;for(let e of io)e.before(r);i=e(t,n);for(let e of io)e.after(r);r.didInitialize=!0}finally{ao=void 0}return i};return t.displayName=e.displayName||e.name,t}function lo(e){return _.forwardRef(co(e))}function uo(){return{didInitialize:!1}}var fo=to(),po=ro(19)?go:_o;function mo(e,t,n,r,i){return po(e,t,n,r,i)}function ho(e,t,n,r,i){let a=_.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ia.useSyncExternalStore)(e.subscribe,a,a)}so({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ia.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function go(e,t,n,r,i){let a=oo();if(!a)return ho(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function _o(e,t,n,r,i){return(0,fo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var vo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return mo(this,e,t,n,r)}},yo={..._},bo=yo.useInsertionEffect,xo=bo&&bo!==yo.useLayoutEffect?bo:e=>e();function J(e){let t=Ya(So).current;return t.next=e,xo(t.effect),t.trampoline}function So(){let e={next:void 0,callback:Co,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Co(){}var wo=class extends vo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){_.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){_.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return _.useDebugValue(e),mo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){_.useDebugValue(e);let n=J(t??Wa);this.context[e]=n}useStateSetter(e){let t=_.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function To(){return typeof window<`u`}function Eo(e){return ko(e)?(e.nodeName||``).toLowerCase():`#document`}function Do(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Oo(e){return((ko(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ko(e){return To()?e instanceof Node||e instanceof Do(e).Node:!1}function Ao(e){return To()?e instanceof Element||e instanceof Do(e).Element:!1}function jo(e){return To()?e instanceof HTMLElement||e instanceof Do(e).HTMLElement:!1}function Mo(e){return!To()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Do(e).ShadowRoot}function No(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Po(e){return/^(table|td|th)$/.test(Eo(e))}function Fo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Io=/transform|translate|scale|rotate|perspective|filter/,Lo=/paint|layout|strict|content/,Ro=e=>!!e&&e!==`none`,zo;function Bo(e){let t=Ao(e)?Wo(e):e;return Ro(t.transform)||Ro(t.translate)||Ro(t.scale)||Ro(t.rotate)||Ro(t.perspective)||!Ho()&&(Ro(t.backdropFilter)||Ro(t.filter))||Io.test(t.willChange||``)||Lo.test(t.contain||``)}function Vo(e){let t=Ko(e);for(;jo(t)&&!Uo(t);){if(Bo(t))return t;if(Fo(t))return null;t=Ko(t)}return null}function Ho(){return zo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zo}function Uo(e){return/^(html|body|#document)$/.test(Eo(e))}function Wo(e){return Do(e).getComputedStyle(e)}function Go(e){return Ao(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ko(e){if(Eo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Mo(e)&&e.host||Oo(e);return Mo(t)?t.host:t}function qo(e){let t=Ko(e);return Uo(t)?(e.ownerDocument||e).body:jo(t)&&No(t)?t:qo(t)}function Jo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qo(e),i=r===e.ownerDocument?.body,a=Do(r);if(i){let e=Yo(a);return t.concat(a,a.visualViewport||[],No(r)?r:[],e&&n?Jo(e):[])}return t.concat(r,Jo(r,[],n))}function Yo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xo(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Zo(e){return e?.ownerDocument||document}function Qo(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function $o(){let[,e]=_.useState({});return _.useCallback(()=>{e({})},[])}var es=null;globalThis.requestAnimationFrame;var ts=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},ns=class e{static create(){return new e}static request(e){return ts.request(e)}static cancel(e){return ts.cancel(e)}currentId=es;request(e){this.cancel(),this.currentId=ts.request(()=>{this.currentId=es,e()})}cancel=()=>{this.currentId!==es&&(ts.cancel(this.currentId),this.currentId=es)};disposeEffect=()=>this.cancel};function rs(){let e=Ya(ns.create).current;return qa(e.disposeEffect),e}var is=0,as=class e{static create(){return new e}currentId=is;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=is,t()},e)}isStarted(){return this.currentId!==is}clear=()=>{this.currentId!==is&&(clearTimeout(this.currentId),this.currentId=is)};disposeEffect=()=>this.clear};function os(){let e=Ya(as.create).current;return qa(e.disposeEffect),e}var ss=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})),cs=o(((e,t)=>{t.exports=ss()})),ls=0;function us(e){return ls+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ls}`}function ds(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function fs(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ps,platform:ms,maxTouchPoints:hs}=fs(),gs=ps.toLowerCase(),_s=ms.toLowerCase(),vs=/^i(os$|p)/.test(_s)||_s===`macintel`&&hs>1,ys=`android`,bs=_s===ys||gs.includes(ys),xs=!vs&&_s.startsWith(`mac`);_s.startsWith(`win`),!bs&&/^(linux|chrome os)/.test(_s);var Ss=xs||vs,Cs=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),ws=!Cs&&gs.includes(`firefox`);!Cs&&gs.includes(`chrom`);var Ts=Ss,Es=/jsdom|happydom/.test(gs);function Ds(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Mo(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Os(e,t){let n=e;for(;n;){if(Ao(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Mo(n)?n.host:null)}return null}function ks(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var As=`data-base-ui-focusable`,js=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ms=`ArrowLeft`,Ns=`ArrowRight`,Ps=`ArrowUp`,Fs=`ArrowDown`,Is=`data-starting-style`,Ls=`data-ending-style`,Rs={[Is]:``},zs={[Ls]:``},Bs={transitionStatus(e){return e===`starting`?Rs:e===`ending`?zs:null}},Vs=`data-open`,Hs=`data-closed`,Us=`data-anchor-hidden`,Ws=`data-popup-open`,Gs=`data-pressed`,Ks={[Ws]:``},qs={[Ws]:``,[Gs]:``},Js={[Vs]:``},Ys={[Hs]:``},Xs={[Us]:``},Zs={open(e){return e?Ks:null}},Qs={open(e){return e?qs:null}},$s={open(e){return e?Js:Ys},anchorHidden(e){return e?Xs:null}},ec={...$s,...Bs},tc=`data-trigger-disabled`;function nc(e,t){if(!Ao(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(tc);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(tc);return!1}function rc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function ic(e){return e.matches(`html,body`)}function ac(e){return jo(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function oc(e){return Os(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${js}`)!=null}function sc(e){return e?e.getAttribute(`role`)===`combobox`&&ac(e):!1}function cc(e){if(!e||Es)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function lc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function uc(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...uc(e,t.id,n)])}function dc(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function fc(e){e.preventDefault(),e.stopPropagation()}function pc(e){return`nativeEvent`in e}function mc(e){return e.pointerType===``&&e.isTrusted?!0:bs&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function hc(e){return Es?!1:!bs&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(bs||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function gc(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function _c(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var vc=Math.min,yc=Math.max,bc=Math.round,xc=Math.floor,Sc=e=>({x:e,y:e}),Cc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function wc(e,t,n){return yc(e,vc(t,n))}function Tc(e,t){return typeof e==`function`?e(t):e}function Ec(e){return e.split(`-`)[0]}function Dc(e){return e.split(`-`)[1]}function Oc(e){return e===`x`?`y`:`x`}function kc(e){return e===`y`?`height`:`width`}function Ac(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function jc(e){return Oc(Ac(e))}function Mc(e,t,n){n===void 0&&(n=!1);let r=Dc(e),i=jc(e),a=kc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vc(o)),[o,Vc(o)]}function Nc(e){let t=Vc(e);return[Pc(e),t,Pc(t)]}function Pc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Fc=[`left`,`right`],Ic=[`right`,`left`],Lc=[`top`,`bottom`],Rc=[`bottom`,`top`];function zc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ic:Fc:t?Fc:Ic;case`left`:case`right`:return t?Lc:Rc;default:return[]}}function Bc(e,t,n,r){let i=Dc(e),a=zc(Ec(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Pc)))),a}function Vc(e){let t=Ec(e);return Cc[t]+e.slice(t.length)}function Hc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Uc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hc(e)}function Wc(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 Gc(e,t){return t<0||t>=e.length}function Kc(e,t){return Yc(e.current,{disabledIndices:t})}function qc(e,t){return Yc(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Jc(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Yc(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Gc(e,u)?-1:u,wrapped:d}}function Yc(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Xc(e,a,r));return a}function Xc(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Qc(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Zc(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Qc(e,t=e?Wo(e):null){return!e||!e.isConnected||!t||Zc(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var $c=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function el(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Mo(n)?n.host:null}function tl(e){for(let t of Array.from(e.children))if(Eo(t)===`summary`)return t;return null}function nl(e,t){let n=tl(t);return!!n&&(e===n||Y(n,e))}function rl(e){let t=e?Eo(e):``;return e!=null&&e.matches($c)&&(t!==`summary`||e.parentElement!=null&&Eo(e.parentElement)===`details`&&tl(e.parentElement)===e)&&(t!==`details`||tl(e)==null)&&(t!==`input`||e.type!==`hidden`)}function il(e){if(!rl(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=el(t)){let n=t!==e,r=Eo(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Eo(t)===`details`&&!t.open&&!nl(e,t)||t.hasAttribute(`hidden`)||!r&&!al(t,n))return!1}return!0}function al(e,t){let n=Wo(e);return t?n.display!==`none`:Qc(e,n)}function ol(e){let t=e.tabIndex;if(t<0){let t=Eo(e);if(t===`details`||t===`audio`||t===`video`||jo(e)&&e.isContentEditable)return 0}return t}function sl(e){if(Eo(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function cl(e,t){let n=sl(e);if(!n)return!0;let r=t.find(e=>{let t=sl(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=sl(e);return t?.name===n.name&&t.form===n.form})===n}function ll(e){if(jo(e)&&Eo(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return jo(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ul(e,t){ll(e).forEach(e=>{rl(e)&&t.push(e),ul(e,t)})}function dl(e,t,n){ll(e).forEach(e=>{jo(e)&&e.matches(t)&&n.push(e),dl(e,t,n)})}function fl(e){return il(e)&&ol(e)>=0}function pl(e){let t=[];return ul(e,t),t.filter(il)}function ml(e){let t=pl(e);return t.filter(e=>ol(e)>=0&&cl(e,t))}function hl(e,t){let n=ml(e),r=n.length;if(r===0)return;let i=Ds(Zo(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function gl(e){return hl(Zo(e).body,1)||e}function _l(e){return hl(Zo(e).body,-1)||e}function vl(e,t,n){if(!e)return null;let r=[];ul(Zo(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(il);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Y(n,o)&&fl(o)&&cl(o,a))return o}return r[i]}function yl(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function bl(e){ml(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function xl(e){let t=[];dl(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Sl(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function Cl(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var wl={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},Tl=class extends wo{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Sl(e.toasts)},{},wl)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=Cl(this.state.toasts,t);r.toasts=e,r.toastMetadata=Sl(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=wl.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||us(`toast`);if(e.id){let t=wl.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(Cl(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),wl.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=wl.toast(this.state,e);n&&n.transitionStatus!==`ending`&&this.updateToastInternal(e,typeof t==`function`?t(n):t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=wl.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;!d&&f?this.clearTimer(e):d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),wl.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=wl.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=Cl(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=ds(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=ds(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=ds(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=as.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=ks(e);Y(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=wl.expandedOrOutOfFocus(this.state)?void 0:as.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:Sl(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=Ds(Zo(this.state.viewport));if(!this.state.viewport||!Y(this.state.viewport,t)||!cc(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=wl.toasts(this.state),r=wl.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},X=cs(),El=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=Ya(()=>new Tl({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return qa(a.disposeEffect),_.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t.updates):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,X.jsxs)(Qa.Provider,{value:a,children:[(0,X.jsx)(Dl,{store:a,timeout:n,limit:r}),t]})};function Dl(e){let{store:t,timeout:n,limit:r}=e;return q(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var Ol={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},kl={...Ol,position:`fixed`,margin:0,top:0,left:0},Al={...Ol,position:`absolute`},jl=_.forwardRef(function(e,t){let[n,r]=_.useState();q(()=>{Ts&&Cs&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,{...e,ref:t,style:kl,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Ml(e,t,n,r){let i=Ya(Pl).current;return Fl(i,e,t,n,r)&&Ll(i,[e,t,n,r]),i.callback}function Nl(e){let t=Ya(Pl).current;return Il(t,e)&&Ll(t,e),t.callback}function Pl(){return{callback:null,cleanup:null,refs:[]}}function Fl(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Il(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Ll(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Rl(e){if(!_.isValidElement(e))return null;let t=e,n=t.props;return(ro(19)?n?.ref:t.ref)??null}function zl(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Bl(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Vl(e,t){return typeof e==`function`?e(t):e}function Hl(e,t){return typeof e==`function`?e(t):e}var Ul={};function Wl(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Kl(t);let a=Kl(e);return t&&(a=ql(a,t)),n&&(a=ql(a,n)),r&&(a=ql(a,r)),i&&(a=ql(a,i)),a}function Gl(e){if(e.length===0)return Ul;if(e.length===1)return Kl(e[0]);let t=Kl(e[0]);for(let n=1;n<e.length;n+=1)t=ql(t,e[n]);return t}function Kl(e){return Zl(e)?{...e(Ul)}:Jl(e)}function ql(e,t){return Zl(t)?t(e):Yl(e,t)}function Jl(e){let t={...e};for(let e in t){let n=t[e];Xl(e,n)&&(t[e]=$l(n))}return t}function Yl(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=zl(e.style,r);break;case`className`:e[n]=tu(e.className,r);break;default:e[n]=Xl(n,r)?Ql(e[n],r):r}}return e}function Xl(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Zl(e){return typeof e==`function`}function Ql(e,t){return t?e?(...n)=>{let r=n[0];if(nu(r)){let i=r;eu(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:$l(t):e}function $l(e){return e&&((...t)=>{let n=t[0];return nu(n)&&eu(n),e(...t)})}function eu(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function tu(e,t){return t?e?t+` `+e:t:e}function nu(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Z(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=ou(r));let i=ru(t,n,r);if(n.enabled===!1)return null;let a=n.state??Ka;return su(e,r,i,a)}function ru(e,t,n){let{className:r,style:i}=e,{state:a=Ka,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Vl(r,a):void 0,d=l?Hl(i,a):void 0,f=l?Bl(a,c):Ka,p=l&&s?iu(s):void 0,m=l?zl(f,p)??{}:Ka;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Nl([m.ref,Rl(n),...o]):Ml(m.ref,Rl(n),o):Ml(null,null)),l?(u!==void 0&&(m.className=tu(m.className,u)),d!==void 0&&(m.style=zl(m.style,d)),m):Ka}function iu(e){return Array.isArray(e)?Gl(e):Wl(void 0,e)}var au=Symbol.for(`react.lazy`);function ou(e){if(e?.$$typeof!==au)return e;let t=_.Children.toArray(e)[0];return _.isValidElement(t)?t:e}function su(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Wl(n,t.props);return e.ref=n.ref,_.cloneElement(t,e)}return cu(e,n)}function cu(e,t){return e===`button`?(0,_.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,_.createElement)(`img`,{alt:``,...t,key:t.key}):_.createElement(e,t)}var lu=`--toast-frontmost-height`,uu=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=$a(),c=os(),l=_.useRef(!1),u=_.useRef(!1),d=_.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),v=p[0]?.height,y=p.some(e=>e.transitionStatus===`ending`),b=p.filter(e=>e.priority===`high`);_.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=Do(e),n=Zo(e);function r(t){t.key===`F6`&&ks(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,Ds(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){ks(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=ks(n),i=Ds(Zo(e));r!==t&&Y(e,r)&&cc(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return Xo(Qo(t,`keydown`,r),Qo(t,`blur`,i,!0),Qo(t,`focus`,a,!0),Qo(n,`pointerdown`,s.handleDocumentPointerDown,!0))},[s,c,f]);function x(e){l.current=!0;let t=e.relatedTarget===s.state.viewport?p.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():s.restoreFocusToPrevElement()}function S(e){e.key===`Tab`&&e.shiftKey&&ks(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement())}function C(){s.state.toasts.some(e=>e.transitionStatus===`ending`)||d.current||!u.current||(s.set(`hovering`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers(),u.current=!1)}_.useEffect(C,[y,s]);function w(){s.pauseTimers(),s.set(`hovering`,!0),u.current=!1}function T(){u.current=!0,C()}function E(e){e.pointerType===`touch`&&(d.current=!0)}function D(e){e.pointerType===`touch`&&(d.current=!1,C())}function O(){l.current?l.current=!1:m||cc(Ds(Zo(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function k(e){m&&!Y(s.state.viewport,e.relatedTarget)&&(s.set(`focused`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers())}let A={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:w,onMouseMove:w,onMouseLeave:T,onFocus:O,onBlur:k,onKeyDown:S,onClick:O,onPointerDown:E,onPointerUp:D,onPointerCancel:D,style:{[lu]:v?`${v}px`:void 0}},j={expanded:h},M=!f&&g&&(0,X.jsx)(jl,{onFocus:x}),N=Z(`div`,e,{ref:[t,s.setViewport],state:j,props:[A,o,{children:(0,X.jsxs)(_.Fragment,{children:[M,a,M]})}]});return(0,X.jsxs)(_.Fragment,{children:[M,N,!m&&b.length>0&&(0,X.jsx)(`div`,{style:kl,children:b.map(e=>(0,X.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,X.jsx)(`div`,{children:e.title}),(0,X.jsx)(`div`,{children:e.description})]},e.id))})]})});function du(e){return ro(19)?e:e?`true`:void 0}var fu=_.createContext(void 0);function pu(){let e=_.useContext(fu);if(!e)throw Error(Za(66));return e}function mu(e){return e==null?e:`current`in e?e.current:e}function hu(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var gu=c(m(),1),_u=null;function vu(e){if(!_u){let e=[];_u=e,queueMicrotask(()=>{_u=null,gu.flushSync(()=>{for(let t of e)t()})})}_u.push(e)}function yu(e,t=!1,n=!1){let r=rs();return J((i,a=null)=>{r.cancel();let o=mu(e);if(o==null)return;let s=o,c=()=>{n?vu(()=>{a?.aborted||i()}):gu.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(hu(s).map(e=>e.finished.then(Wa))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(hu(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Is;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function bu(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=J(a),s=yu(r,n,i);_.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var xu={style:{transition:`none`}},Su=`data-base-ui-click-trigger`,Cu=`data-base-ui-swipe-ignore`,wu=`data-swipe-ignore`,Tu=`[${Cu}]`,Eu=`[${wu}]`,Du={fallbackAxisSide:`none`},Ou={fallbackAxisSide:`end`},ku={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function Au(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function ju(e,t){let n=(t??Do(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}function Mu(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}var Nu=`--toast-index`,Pu=`--toast-offset-y`,Fu=`--toast-height`,Iu=`--toast-swipe-movement-x`,Lu=`--toast-swipe-movement-y`,Ru=`data-swipe-direction`,zu={...Bs,swipeDirection(e){return e?{[Ru]:e}:null}},Bu=40,Vu=10,Hu=.5,Uu=1,Wu=`${Tu},${Eu}`,Gu=_.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=$a(),[f,p]=_.useState(void 0),[m,h]=_.useState(!1),[g,v]=_.useState(!1),[y,b]=_.useState({x:0,y:0}),[x,S]=_.useState({x:0,y:0,scale:1}),[C,w]=_.useState(),[T,E]=_.useState(),[D,O]=_.useState(null),k=_.useRef(null),A=_.useRef(void 0),j=_.useRef({x:0,y:0}),M=_.useRef({x:0,y:0,scale:1}),N=_.useRef(void 0),P=_.useRef(0),F=_.useRef(!1),I=_.useRef({x:0,y:0}),L=_.useRef(!1),R=_.useRef({x:0,y:0}),z=_.useRef(null),B=_.useRef(null),V=d.useState(`toastIndex`,n.id),ee=d.useState(`toastVisibleIndex`,n.id),te=d.useState(`toastOffsetY`,n.id),ne=d.useState(`focused`),re=d.useState(`expanded`);bu({open:n.transitionStatus!==`ending`,ref:k,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let H=J((e=!1)=>{let t=k.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:k,height:i,transitionStatus:void 0})}e?gu.flushSync(a):a()});q(()=>{let e=A.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),S({x:0,y:0,scale:1}),U({x:0,y:0})),A.current=n.id,H())},[H,n.id,n.transitionStatus]);function U(e){R.current=e,b(e)}q(()=>()=>{B.current?.abort()},[]);function ie(e,t){let n=e=>e>0?e**Hu:-(Math.abs(e)**Hu),r=e>0&&!l.includes(`right`)||e<0&&!l.includes(`left`),i=t>0&&!l.includes(`down`)||t<0&&!l.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let ae=J(e=>{if(e.pointerId!==z.current)return;z.current=null,B.current?.abort(),B.current=null,h(!1),v(!1),O(null);let t=M.current;if(e.type===`pointercancel`||F.current){U({x:t.x,y:t.y}),p(void 0);return}let r=R.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(Mu(e,i,a)>Bu){o=e;break}o?(p(o),d.closeToast(n.id)):(U({x:t.x,y:t.y}),p(void 0))});function oe(e){if(e.button!==0||(e.pointerType===`touch`&&d.pauseTimers(),Os(ks(e.nativeEvent),`button,a,input,textarea,[role="button"],${Wu}`)))return;F.current=!1,N.current=void 0,P.current=0,z.current=e.pointerId,j.current={x:e.clientX,y:e.clientY},I.current=j.current;let t=e.currentTarget,n=ju(t);M.current=n,S(n),U({x:n.x,y:n.y}),d.set(`hovering`,!0),h(!0),v(!1),O(null),L.current=!0,B.current?.abort();let r=new AbortController;B.current=r;let i=Zo(t);i.addEventListener(`pointerup`,ae,{signal:r.signal}),i.addEventListener(`pointercancel`,ae,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function W(e){if(e.pointerId!==z.current)return;e.preventDefault(),L.current&&=(j.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-j.current.x,o=t-j.current.y,s=t-I.current.y,c=n-I.current.x,u=D;if(!g&&Math.sqrt(a*a+o*o)>=Uu){v(!0);let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&(u=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,O(u))}let d;if(!N.current)u===`vertical`?o>0?d=`down`:o<0&&(d=`up`):u===`horizontal`?a>0?d=`right`:a<0&&(d=`left`):d=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,d&&l.includes(d)&&(N.current=d,P.current=Mu(d,a,o),p(d));else{let e=N.current,t=Mu(e,c,s);t>Bu?(F.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&P.current-t>=Vu&&(F.current=!0)}let f=ie(a,o),m=M.current.x,h=M.current.y,_=l.includes(`left`)||l.includes(`right`),y=l.includes(`up`)||l.includes(`down`);u!==`vertical`&&_&&(m+=f.x),u!==`horizontal`&&y&&(h+=f.y),U({x:m,y:h})}function se(e){if(e.key===`Escape`){if(!k.current||!Y(k.current,Ds(Zo(k.current))))return;d.closeToast(n.id)}}_.useEffect(()=>{let e=k.current;if(!u||!e)return;function t(t){z.current!==null&&Y(e,ks(t))&&t.preventDefault()}return Qo(e,`touchmove`,t,{passive:!1})},[u]);function ce(){let e=y.x-x.x,t=y.y-x.y;return{transition:m?`none`:void 0,transform:m?`translateX(${y.x}px) translateY(${y.y}px) scale(${x.scale})`:void 0,[Iu]:`${e}px`,[Lu]:`${t}px`}}let le=n.priority===`high`,ue={role:le?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":T,"aria-hidden":le&&!ne?!0:void 0,onPointerDown:u?oe:void 0,onPointerMove:u?W:void 0,onPointerUp:u?ae:void 0,onPointerCancel:u?ae:void 0,onKeyDown:se,inert:du(n.limited),style:{...ce(),[Nu]:n.transitionStatus===`ending`?V:ee,[Pu]:`${te}px`,[Fu]:n.height?`${n.height}px`:void 0}},de=_.useMemo(()=>({toast:n,setTitleId:w,setDescriptionId:E,recalculateHeight:H,visibleIndex:ee,expanded:re}),[n,w,E,H,ee,re]),fe={transitionStatus:n.transitionStatus,expanded:re,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},pe=Z(`div`,e,{ref:[t,k],state:fe,stateAttributesMapping:zu,props:[ue,s]});return(0,X.jsx)(fu.Provider,{value:de,children:pe})}),Ku=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=pu(),l=_.useRef(null);return q(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),Z(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),qu=0;function Ju(e,t=`mui`){let n=_.useRef(void 0),r=$o(),i=e??n.current;return _.useEffect(()=>{n.current??(qu+=1,n.current=`${t}-${qu}`,e??r())},[e,t,r]),i}var Yu=yo.useId;function Xu(e,t){if(Yu!==void 0){let n=Yu();return e??(t?`${t}-${n}`:n)}return Ju(e,t)}function Zu(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(Zu)}function Qu(e){return _.isValidElement(e)&&Zu(e.props.children)}function $u(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=pu(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:Xu(e),children:s,type:r.type,setId:o}}function ed(e,t,n){let r=Qu(e);return q(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var td=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=$u(a,o,`description`);return ed(Z(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),nd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=$u(a,o,`title`);return ed(Z(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),rd=_.createContext(void 0);function id(e=!1){let t=_.useContext(rd);if(t===void 0&&!e)throw Error(Za(16));return t}function ad(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:_.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function od(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Do(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function sd(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=_.useRef(null),s=id(!0),c=a??s!==void 0,{props:l}=ad({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=_.useCallback(()=>{let e=o.current;cd(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:_.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Wl({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(eu(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=cd(r),s=!i&&ld(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),od(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),od(r,e)))},onKeyUp(e){t||(eu(e),a?.(e),e.target===e.currentTarget&&i&&c&&cd(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),od(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:J(e=>{o.current=e,u()})}}function cd(e){return jo(e)&&e.tagName===`BUTTON`}function ld(e){return jo(e)&&e.tagName===`A`&&!!e.href}var ud=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=$a(),{toast:l,expanded:u}=pu(),[d,f]=_.useState(!1),{getButtonProps:p,buttonRef:m}=sd({disabled:a,native:o}),h={type:l.type};return Z(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),dd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=pu(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=sd({disabled:a,native:o}),f={type:c.type},p=Z(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return Qu(p)?p:null});function fd(e,t,n,r){let i=!1,a=!1,o=r??Ka;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function pd(e,t,n){let r=n??Ka;return{reason:e,event:t??new Event(`base-ui`),...r}}var md=`none`,hd=`trigger-press`,gd=`trigger-hover`,_d=`trigger-focus`,vd=`outside-press`,yd=`item-press`,bd=`close-press`,xd=`track-press`,Sd=`input-change`,Cd=`input-clear`,wd=`input-blur`,Td=`input-paste`,Ed=`focus-out`,Dd=`escape-key`,Od=`list-navigation`,kd=`keyboard`,Ad=`pointer`,jd=`drag`,Md=`wheel`,Nd=`scrub`,Pd=`cancel-open`,Fd=`sibling-open`,Id=`disabled`,Ld=`missing`,Rd=`initial`,zd=`imperative-action`;function Bd(e){return`data-base-ui-${e}`}var Vd=_.createContext(null),Hd=()=>_.useContext(Vd),Ud=Bd(`portal`);function Wd(e={}){let{ref:t,container:n,componentProps:r=Ka,elementProps:i}=e,a=Xu(),o=Hd()?.portalNode,[s,c]=_.useState(null),[l,u]=_.useState(null),d=J(e=>{e!==null&&u(e)}),f=_.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ko(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Z(`div`,r,{ref:[t,d],props:[{id:a,[Ud]:``},i]}),m=s&&p?gu.createPortal(p,s):null;return{node:l,nodeId:_.isValidElement(p)?p.props.id:void 0,subtree:m}}var Gd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Wd({container:o,ref:t,componentProps:e,elementProps:c}),f=_.useRef(null),p=_.useRef(null),m=_.useRef(null),h=_.useRef(null),[g,v]=_.useState(null),y=_.useRef(!1),b=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!l;_.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&yl(e)&&(e.type===`focusin`?y.current&&=(xl(l),!1):(bl(l),y.current=!0))}return Xo(Qo(l,`focusin`,e,!0),Qo(l,`focusout`,e,!0))},[l,b]),q(()=>{l&&x===!0&&y.current&&(xl(l),y.current=!1)},[x,l]);let C=_.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:v}),[l]);return(0,X.jsxs)(_.Fragment,{children:[d,(0,X.jsxs)(Vd.Provider,{value:C,children:[S&&l&&(0,X.jsx)(jl,{"data-type":`outside`,ref:f,onFocus:e=>{yl(e,l)?m.current?.focus():_l(g?g.domReference:null)?.focus()}}),S&&l&&(0,X.jsx)(`span`,{role:s,"aria-owns":u,style:ku}),l&&gu.createPortal(a,l),S&&l&&(0,X.jsx)(jl,{"data-type":`outside`,ref:p,onFocus:e=>{yl(e,l)?h.current?.focus():(gl(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,fd(`focus-out`,e.nativeEvent)))}})]})]})}),Kd=_.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Wd({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,X.jsxs)(_.Fragment,{children:[l,c&&gu.createPortal(n,c)]})}),qd=_.forwardRef(function(e,t){return(0,X.jsx)(Kd,{ref:t,...e})});function Jd(e){let t=Ya(Yd,e).current;return t.next=e,q(t.effect),t}function Yd(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Xd(e,t){return t!=null&&!gc(t)?0:typeof e==`function`?e():e}function Zd(e,t,n){let r=Xd(e,n);return typeof r==`number`?r:r?.[t]}function Qd(e){return typeof e==`function`?e():e}function $d(e,t){return t||e===`click`||e===`mousedown`}function ef(e){return e?.includes(`mouse`)&&e!==`mousedown`}var tf=_.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new as,currentIdRef:{current:null},currentContextRef:{current:null}});function nf(e,t){e.current=t.current}function rf(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=_.useRef(n),a=_.useRef(n),o=_.useRef(null),s=_.useRef(null),c=os();return q(()=>{a.current=n,o.current?i.current={open:Zd(i.current,`open`),close:Zd(n,`close`)}:i.current=n},[n,o,i,a]),(0,X.jsx)(tf.Provider,{value:_.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function af(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=_.useContext(tf),[d,f]=_.useState(!1),p=_.useRef(n);return q(()=>{p.current=n},[n]),q(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),q(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Zd(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,fd(md))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),q(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,nf(a,s),u.clear()}},[c,i,a,r,s,u]),_.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}var of=0;function sf(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(of);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Wa;let o=requestAnimationFrame(a);return of=o,()=>{of===o&&(cancelAnimationFrame(o),of=0)}}var cf=`data-base-ui-inert`,lf=new WeakMap,uf=new WeakSet,df=new WeakMap,ff=0;function pf(e){return e?Mo(e)?e.host:pf(e.parentNode):null}var mf=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=pf(t);return e.contains(n)?n:null}).filter(e=>e!=null),hf=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},gf=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Eo(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function _f(e,t,n,{mark:r=!0}){let i=mf(t,e),a=r?gf(t,hf(i),new Set(i)):[],o=[],s=[];if(n){let e=mf(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);gf(t,hf(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(lf.get(e)||0)+1;lf.set(e,r),o.push(e),r===1&&n&&uf.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(df.get(e)||0)+1;df.set(e,t),s.push(e),t===1&&e.setAttribute(cf,``)}),ff+=1,()=>{o.forEach(e=>{let t=(lf.get(e)||0)-1;lf.set(e,t),t||(uf.has(e)||e.removeAttribute(`aria-hidden`),uf.delete(e))}),r&&s.forEach(e=>{let t=(df.get(e)||0)-1;df.set(e,t),t||e.removeAttribute(cf)}),--ff,ff||(lf=new WeakMap,uf=new WeakSet,df=new WeakMap)}}function vf(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Zo(e[0]).body;return _f(e,i,n,{mark:r})}function yf(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var bf=class{nodesRef={current:[]};events=yf();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},xf=_.createContext(null),Sf=_.createContext(null),Cf=()=>_.useContext(xf)?.id||null,wf=e=>{let t=_.useContext(Sf);return e??t};function Tf(e){let t=Xu(),n=wf(e),r=Cf();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Ef(e){let{children:t,id:n}=e,r=Cf();return(0,X.jsx)(xf.Provider,{value:_.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Df(e){let{children:t,externalTree:n}=e,r=Ya(()=>n??new bf).current;return(0,X.jsx)(Sf.Provider,{value:r,children:t})}function Of(e,t){let n=Do(ks(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(mc(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var kf=20,Af=[];function jf(){Af=Af.filter(e=>e.deref()?.isConnected)}function Mf(e){jf(),e&&Eo(e)!==`body`&&(Af.push(new WeakRef(e)),Af.length>kf&&(Af=Af.slice(-20)))}function Nf(){return jf(),Af[Af.length-1]?.deref()}function Pf(e){return e?fl(e)?e:ml(e)[0]||e:null}function Ff(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=pl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return fl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function If(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=J(()=>x.current.floatingContext?.nodeId),C=i===!1,w=sc(v)&&C,T=Jd(i),E=Jd(a),D=Jd(o),O=Jd(u),k=Jd(g),A=wf(m),j=Hd(),M=_.useRef(!1),N=_.useRef(!1),P=_.useRef(!1),F=_.useRef(null),I=_.useRef(``),L=_.useRef(``),R=_.useRef(null),z=_.useRef(null),B=Ml(R,p,j?.beforeInsideRef),V=Ml(z,j?.afterInsideRef),ee=os(),te=os(),ne=rs(),re=j!=null,H=lc(y),U=J((e=H)=>e?ml(e):[]),ie=J(()=>h?.().filter(e=>e!=null)??[]);_.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Y(H,Ds(Zo(H)))&&U().length===0&&!w&&fc(e)}return Qo(Zo(H),`keydown`,e)},[r,H,c,w,U]),_.useEffect(()=>{if(r||!g)return;let e=Zo(H);function t(){P.current=!1}function n(e){let t=ks(e),n=ie(),r=Y(y,t)||Y(v,t)||Y(j?.portalNode,t)||n.some(e=>e===t||Y(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,Os(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,te.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return Xo(Qo(e,`pointerdown`,n,!0),Qo(e,`pointerup`,t,!0),Qo(e,`pointercancel`,t,!0),Qo(e,`keydown`,i,!0),t)},[r,y,v,H,g,j,te,ie]),_.useEffect(()=>{if(r||!l)return;let e=Zo(H);function n(){N.current=!0,te.start(0,()=>{N.current=!1})}function i(e){let t=ks(e);fl(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=ks(n);c&&r==null&&a!=null&&Y(y,a)&&Mf(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=ie(),p=r?.hasAttribute(Bd(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,mu(f),mu(d)].includes(r),m=!(Y(v,r)||Y(y,r)||Y(r,y)||Y(j?.portalNode,r)||u.some(e=>e===r||Y(e,r))||l.hasMatchingElement(e=>Y(e,r))||p||A&&(uc(A.nodesRef.current,o).find(e=>Y(e.context?.elements.floating,r)||Y(e.context?.elements.domReference,r))||dc(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,lc(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&H&&Ff(H),s&&i!==v&&!Qc(a)&&Ds(e)===e.body){if(jo(H)&&(H.focus(),s===`popup`)){ne.request(()=>{H.focus()});return}let e=U(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;jo(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&m&&!N.current&&(w||r!==Nf())&&(M.current=!0,t.setOpen(!1,fd(Ed,n)))})}function o(){P.current||(x.current.insideReactTree=!0,ee.start(0,()=>{x.current.insideReactTree=!1}))}let u=jo(v)?v:null;if(y||u)return Xo(u&&Qo(u,`focusout`,a),u&&Qo(u,`pointerdown`,n),y&&Qo(y,`focusin`,i),y&&Qo(y,`focusout`,a),y&&j&&Qo(y,`focusout`,o,!0))},[r,v,y,H,c,A,j,t,l,s,U,w,S,x,ee,te,ne,d,f,ie]),_.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${Bd(`portal`)}]`)||[]),t=(A?dc(A.nodesRef.current,S()):[]).find(e=>sc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=vf([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...ie(),t,mu(f),mu(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=vf([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,v,y,c,j,w,A,S,d,f,ie]),q(()=>{if(!g||r||!jo(H))return;I.current=``,L.current=``;let e=Zo(H),t=Ds(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||Y(H,t))return;let i=null,a=()=>(i??=U(H),i[0]||H),o;o=r===!0||r===null?a():mu(r),o||=a();let s=Y(H,Ds(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&mc(c);sf(o,{sync:l,preventScroll:o===H,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=Ds(e);return!(t!==o&&Y(H,t))}})})},[r,g,H,U,T,O,k,x]);let ae=_.useRef(null);q(()=>{if(r||!H){ae.current=null;return}ae.current&&=(ae.current.cancelled=!0,null);let e=Zo(H),t=Ds(e),n=O.current==null;Mf(t);function i(e){if(e.open||(I.current=Of(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Bd(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(mc(e.nativeEvent)||hc(e.nativeEvent))M.current=!1;else{let e=!1;Zo(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&Eo(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Nf()||null,typeof i==`boolean`?s:mu(i)||s||null}return()=>{b.off(`openchange`,i);let t=Ds(e),n=ie(),r=Y(y,t)||n.some(e=>e===t||Y(e,t))||A&&uc(A.nodesRef.current,S(),!1).some(e=>Y(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};ae.current=l,queueMicrotask(()=>{ae.current===l&&(ae.current=null);let n=Pf(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&jo(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,H,E,D,O,b,A,v,S,ie]),q(()=>{if(!Cs||g||!y)return;let e=Ds(Zo(y));jo(e)&&ac(e)&&Y(y,e)&&e.blur()},[g,y]),q(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,g,t,l,v]),q(()=>{if(!r&&H)return Ff(H),()=>{queueMicrotask(jf)}},[r,H]);let oe=!r&&(!c||!w)&&(re||c);return(0,X.jsxs)(_.Fragment,{children:[oe&&(0,X.jsx)(jl,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=U();sf(e[e.length-1])}else j?.portalNode&&(M.current=!1,yl(e,j.portalNode)?gl(v)?.focus():mu(f??j.beforeOutsideRef)?.focus())}}),n,oe&&(0,X.jsx)(jl,{"data-type":`inside`,ref:V,onFocus:e=>{c?sf(U()[0]):j?.portalNode&&(l&&(M.current=!0),yl(e,j.portalNode)?_l(v)?.focus():mu(d??j.afterOutsideRef)?.focus())}})]})}function Lf(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=hd}=t,l=e.context.dataRef,u=_.useRef(void 0),d=rs(),f=os(),p=_.useMemo(()=>{function t(t,n,r,i){let a=fd(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=gc(e.pointerType,!0)&&hc(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||gc(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=ks(s),p=ac(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:gc(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return _.useMemo(()=>n?{reference:p}:Ka,[n,p])}function Rf(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function zf(e){return e!=null&&e.clientX!=null}function Bf(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=_.useRef(!1),l=_.useRef(null),[u,d]=_.useState(),[f,p]=_.useState([]),m=J(t=>{e.set(`positionReference`,t)}),h=J((t,n,i)=>{c.current||(!s.current.openEvent||zf(s.current.openEvent))&&e.set(`positionReference`,Rf(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=J(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),v=gc(u)?a:i;_.useEffect(()=>{if(!n){m(o);return}if(!v)return;function e(){l.current?.(),l.current=null}let t=Do(a);function r(t){let n=ks(t);Y(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||zf(s.current.openEvent)?l.current=Qo(t,`mousemove`,r):m(o),e},[v,n,a,s,o,e,h,m,f]),_.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),_.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),_.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=_.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return _.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Vf(){return!1}function Hf(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Uf(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Vf,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=wf(c),m=J(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,v=J(()=>a),{escapeKey:y,outsidePress:b}=Hf(s),x=_.useRef(!1),S=_.useRef(!1),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(!1),E=_.useRef(``),D=_.useRef(null),O=os(),k=os(),A=os(),j=J(()=>{k.clear(),d.current.insideReactTree=!1}),M=J(e=>{let t=d.current.floatingContext?.nodeId;return(p?uc(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=J(t=>rc(t,e.select(`floatingElement`))||rc(t,e.select(`domReferenceElement`))),P=J(t=>{o()&&e.setOpen(!1,fd(hd,t.nativeEvent))}),F=J(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=pc(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=fd(Dd,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=J(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=J(t=>{if(!l||!n||t.button!==0)return;let r=ks(t.nativeEvent);Y(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=J(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});_.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),_.useEffect(()=>j,[j]),_.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new as,i=Zo(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(Cs?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function _(e){let t=d.current.floatingContext?.nodeId,n=p&&uc(p.nodesRef.current,t).some(t=>rc(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=ks(n),i=`[${Bd(`inert`)}]`,a=Ao(r)?r.getRootNode():null,o=Array.from((Mo(a)?a:Zo(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Y(e,r))))return;let c=Ao(r)?r:null;for(;c&&!Uo(c);){let e=Ko(c);if(Uo(e)||!Ao(e))break;c=e}if(!(o.length&&Ao(r)&&!ic(r)&&!Y(r,e.select(`floatingElement`))&&o.every(e=>!Y(c,e)))){if(jo(r)&&!(`touches`in n)){let e=Uo(r),t=Wo(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!_(n)){if(f()===`intentional`){if(n.detail!==0&&!mc(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,fd(vd,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=ks(e);if(!n)return;let r=Qo(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():_(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function V(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function ee(e){L(e,V)}function te(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}let re=Xo(r&&Xo(Qo(i,`keydown`,F),Qo(i,`compositionstart`,a),Qo(i,`compositionend`,o)),g&&Xo(Qo(i,`click`,z,!0),Qo(i,`pointerdown`,z,!0),Qo(i,`pointerup`,B,!0),Qo(i,`pointercancel`,B,!0),Qo(i,`mousedown`,z,!0),Qo(i,`mouseup`,B,!0),Qo(i,`touchstart`,R,{capture:!0,passive:!0}),Qo(i,`touchmove`,ee,{capture:!0,passive:!0}),Qo(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{re(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,y,b,F,j,v,M,N,p,e,O,A]);let z=_.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=_.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return _.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function Wf(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Ao(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Gf(e,t=!1,n=!1,r=!1){let[i,a]=_.useState(e&&t?`idle`:void 0),[o,s]=_.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=ns.request(()=>{a(`ending`)});return()=>{ns.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t||i===void 0)return;let n=ns.request(()=>{a(void 0)});return()=>{ns.cancel(n)}},[t,e,i]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=ns.request(()=>{a(`idle`)});return()=>{ns.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Kf(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=J(i),{mounted:c,setMounted:l,transitionStatus:u}=Gf(t,!1,!1,o),d=!t&&r;q(()=>{t&&s(!1)},[t,s]);let f=_.useRef(c),p=_.useRef(!1),m=$o(),h=()=>{f.current=!1,l(!1),a()};q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=J(()=>{f.current&&(t?(p.current=!0,m()):h())});return bu({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var qf={tabIndex:-1,[As]:``};function Jf(e){return t=>t!==`touch`||e.current}function Yf(e,t=!1){let n=Xu(),r=Cf()!=null,i=Ya(()=>e(n,r)).current;return Wf({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Xf({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Zf(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Qf(e,t){let n=_.useRef(null);return J(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Zf(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Zf(t))})}function $f(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function ep(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function tp(e,t,n,r={}){let i=n.reason,a=i===gd,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ep(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=$f(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?gu.flushSync(l):l()}function np(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Qf(e,n),o=J(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=J(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function rp(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=_.useRef(null),i=e.useState(`open`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=fd(md);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function ip(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Kf({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Ya(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function ap(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:Ka,inactiveTriggerProps:Ka,popupProps:Ka})},[e])}function op(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var sp=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},cp={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},lp=class extends wo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:yf(),nested:n,triggerElements:i},cp),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&_c(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function up(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new lp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ka,inactiveTriggerProps:Ka,popupProps:Ka}}var dp=e=>e.triggerIdProp??e.activeTriggerId,fp=e=>e.openProp??e.open,pp=e=>(e.popupElement?.id??e.floatingId)||void 0;function mp(e,t){return t!==void 0&&fp(e)&&dp(e)===t}function hp(e,t){return mp(e,t)?!0:t!==void 0&&fp(e)&&dp(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var gp={open:fp,mounted:e=>e.mounted,transitionStatus:e=>fp(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:dp,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:pp,isTriggerActive:(e,t)=>t!==void 0&&dp(e)===t,isOpenedByTrigger:(e,t)=>mp(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&dp(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>hp(e,t)?pp(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function _p(e){let t=_.useCallback(t=>e===void 0?Wa:e.subscribeStore(t),[e]),n=_.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,ia.useSyncExternalStore)(t,n,()=>e?.serverStore)}var vp=xs&&Cs;function yp(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=_.useRef(!1),s=_.useRef(null),c=_.useRef(!0),l=os();_.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Do(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&jo(t)&&t===Ds(Zo(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Xo(Qo(r,`blur`,i),vp&&Qo(r,`keydown`,a,!0),vp&&Qo(r,`pointerdown`,l,!0))},[e,n]),_.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Ao(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=_.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=ks(n.nativeEvent);if(Ao(a)){if(vp&&!n.relatedTarget){if(!c.current&&!ac(a))return}else if(!cc(a))return}let u=nc(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,fd(_d,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,fd(_d,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=Ao(r)&&r.hasAttribute(Bd(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Ds(Zo(t));!r&&n===t||Y(a.current.floatingContext?.refs.floating.current,n)||Y(t,n)||o||nc(r??n,e.context.triggerElements)||e.setOpen(!1,fd(_d,i))})}}},[a,r,e,l]);return _.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var bp=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new as;restTimeout=new as;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},xp=new WeakMap;function Sp(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&xp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),xp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Cp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=xp.get(n);a&&a!==e&&Sp(a),Sp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,xp.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function wp(e){let t=e.context.dataRef.current,n=Ya(()=>t.hoverInteractionState??bp.create()).current;return t.hoverInteractionState||=n,qa(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Tp(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=wf(),u=Cf(),d=wp(e),f=os(),p=J(()=>$d(c.current.openEvent?.type,d.interactedInside)),m=J(()=>ef(c.current.openEvent?.type)),h=J(()=>{Sp(d)});q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),_.useEffect(()=>h,[h]),q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&Ao(s)&&o){let e=s,t=o,n=Zo(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Os(e,`[data-rootownerid]`)??n.body;return Cp(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),_.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&uc(l.nodesRef.current,u).length>0)}function a(t){let n=Zd(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,fd(gd,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=ks(e);oc(t)?d.interactedInside=Os(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(nc(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&Ao(o)&&uc(l.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,fd(gd,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Xo(y&&Qo(y,`mouseenter`,g),y&&Qo(y,`mouseleave`,_),y&&Qo(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Ep={current:null};function Dp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Ep,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,v=wf(l),y=wp(e),b=_.useRef(!1),x=Jd(i),S=Jd(r),C=Jd(o),w=Jd(n),T=Jd(p),E=Jd(f),D=J(()=>$d(h.current.openEvent?.type,y.interactedInside)),O=J(()=>T.current?.()!==!1),k=J((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Y(t,n);if(!Ao(r))return!1;let a=r;return i.hasMatchingElement(e=>Y(e,a))&&(!t||!Y(t,a))}),A=J(()=>{y.handler&&=(Zo(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=J(()=>{Sp(y)});return u&&(y.handleCloseOptions=i?.__options),_.useEffect(()=>A,[A]),_.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===gd,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,y,A]),_.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Zd(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,fd(gd,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,fd(gd,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Ao(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!gc(y.pointerType))return;let n=Qd(C.current),r=Zd(S.current,`open`,y.pointerType),i=ks(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Ao(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Y(t,i)){c=t;break}}Ao(o)&&Ao(s)&&!e.context.triggerElements.hasElement(o)&&Y(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&Ao(c)&&Ao(s)&&Y(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,fd(gd,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,fd(gd,t,c))}):g&&O()&&e.setOpen(!0,fd(gd,t,c)))}function o(n){if(D()){j();return}A();let r=Zo(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!nc(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else y.pointerType===`touch`&&Y(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Y(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=m?Qo(r,`mouseout`,l):void 0;return s?Xo(Qo(r,`mousemove`,i,{once:!0}),Qo(r,`mouseenter`,i),Qo(r,`mouseleave`,o),f):Xo(Qo(r,`mouseenter`,i),Qo(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),_.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!gc(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Cp(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Qd(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,fd(gd,n,r))}y.pointerType===`touch`?gu.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function Op(e){return Cs&&e.movementX===0&&e.movementY===0}function kp(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Ap(e,t){return kp(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function jp(e,t,n){return kp(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Mp(e,t,n){return kp(t,n?e===Ms:e===Ns,e===Fs)}function Np(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:kp(t,n?e===Ns:e===Ms,e===Ps)}function Pp(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:v=g,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=lc(D),j=sc(O),M=Jd(A),N=Cf(),P=wf(S),F=_.useRef(f),I=_.useRef(o??-1),L=_.useRef(null),R=_.useRef(!0),z=J(e=>{i(I.current===-1?null:I.current,e)}),B=_.useRef(!!D),V=_.useRef(E),ee=_.useRef(!1),te=_.useRef(!1),ne=_.useRef(null),re=Jd(h),H=Jd(E),U=Jd(o),ie=Jd(x),ae=rs(),oe=rs(),W=J(()=>{ae.cancel();function e(e){d||(ne.current=sf(e,{sync:ee.current,preventScroll:!0}))}let t=n.current[I.current],r=te.current;t&&e(t),(ee.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),fe&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{k.current.orientation=g},[k,g]),q(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),q(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(te.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),q(()=>{if(a){if(!E)ee.current=!1;else if(D){if(r==null){if(ee.current=!1,U.current!=null)return;if(B.current&&(I.current=-1,W()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||jp(L.current,v,u)||l?Kc(n):qc(n),L.current=null,z())};t()}}else Gc(n.current,r)||(I.current=r,W(),te.current=!1)}}},[a,E,D,r,U,l,n,v,u,z,W,oe]),q(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=Ds(Zo(O??t??null)),r=e.some(e=>e.context&&Y(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),q(()=>{V.current=E,B.current=!!D});let se=r!=null,ce=J(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),le=J(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),ue=J(()=>Kc(n,re.current)),de=J(t=>{if(R.current=!1,ee.current=!0,t.which===229||!H.current&&t.currentTarget===M.current)return;if(l&&Np(t.key,g,u,T)){Ap(t.key,le())||fc(t),e.setOpen(!1,fd(Od,t.nativeEvent));let n=C?.current??O;jo(n)&&n.focus();return}r!=null&&r!==I.current&&!Gc(n.current,r)&&(I.current=r);let i=I.current,a=Kc(n,h),o=qc(n,h);if(j||(t.key===`Home`&&(fc(t),I.current=a,z(t)),t.key===`End`&&(fc(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),g===`both`)return}if(Ap(t.key,g)){fc(t);let e=Ds(t.currentTarget.ownerDocument);if(E&&!d&&Y(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Y(t,e))){I.current=jp(t.key,g,u)?a:o,z(t),r===I.current&&W();return}let{index:l,wrapped:f}=Jc(n.current,i,{decrement:!jp(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ee.current=!1),I.current=l,z(t)}}),fe=_.useMemo(()=>({onFocus(e){ee.current=!0,ce(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Op(e)||(ee.current=!0,te.current=!1,p&&ce(e))},onPointerLeave(e){if(!H.current||!R.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ie.current&&(ne.current?.(),ne.current=null,I.current=-1,z(e),!d)){let e=M.current,t=Ds(Zo(e));e&&Y(e,t)&&e.focus({preventScroll:!0})}}}),[ce,H,M,p,n,z,ie,d]),pe=_.useMemo(()=>d&&E&&se&&{"aria-activedescendant":`${b}-${r}`},[d,E,se,b,r]),me=_.useMemo(()=>({...j?{}:pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=ks(t.nativeEvent);if(n&&!Y(M.current,n))return;fc(t);let r=fd(Ed,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&jo(i)&&i.focus()}else de(t)},onPointerMove(e){Op(e)||(R.current=!0)}}),[pe,de,M,j,e,E,d,O,C]),he=_.useMemo(()=>{function t(t){e.setOpen(!0,fd(Od,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&mc(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&hc(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Mp(n.key,le(),u),o=Ap(n.key,r?g:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||ac(n.currentTarget)))return de(n);if(r||m||!i){if(s){let e=Ap(n.key,le());L.current=l&&e?null:n.key}l?a&&(fc(n),r?(I.current=ue(),z(n),d&&M.current?.focus()):t(n)):o&&(U.current!=null&&(I.current=U.current),fc(n),!r&&m?t(n):de(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,f,ue,l,z,e,m,g,v,le,u,U,d,M]),ge=_.useMemo(()=>({...pe,...he}),[pe,he]);return _.useMemo(()=>a?{reference:ge,floating:me,item:fe,trigger:he}:{},[a,ge,me,he,fe])}function Fp(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=J(s),f=e.useState(`open`),p=os(),m=_.useRef(``),h=_.useRef(u??i??-1),g=_.useRef(null),v=J(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Qc(n)||n?.matches(`:disabled`)?!1:o==null||!Xc(Ga,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(fc(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(fc(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),y=J(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Y(r,n)||Y(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let b=_.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return _.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Ip=.1,Lp=Ip*Ip,Rp=.5;function zp(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Bp(e,t,n,r,i,a,o,s,c,l){let u=!1;return zp(e,t,n,r,i,a)&&(u=!u),zp(e,t,i,a,o,s)&&(u=!u),zp(e,t,o,s,c,l)&&(u=!u),zp(e,t,c,l,n,r)&&(u=!u),u}function Vp(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Hp(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Up(e={}){let{blockPointerEvents:t=!1}=e,n=new as,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Lp;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ks(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Ao(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&uc(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Hp(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Hp(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Hp(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Hp(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Vp(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Rp/2:Rp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Rp+1,o=C||T?S.bottom-Rp:S.top,s=C?T?S.bottom-Rp:S.top:S.bottom-Rp;M=Bp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Rp/2:Rp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Rp,o=C||T?S.top+Rp:S.bottom,s=C?T?S.top+Rp:S.bottom:S.top+Rp;M=Bp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Rp/2:Rp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Rp+1,o=w||E?S.right-Rp:S.left,s=w?E?S.right-Rp:S.left:S.right-Rp;M=Bp(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Rp/2:Rp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Rp,o=w||E?S.left+Rp:S.right,s=w?E?S.left+Rp:S.right:S.left+Rp;M=Bp(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Wp(e,t,n){let{reference:r,floating:i}=e,a=Ac(t),o=jc(t),s=kc(o),c=Ec(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=Dc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Gp(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}=Tc(t,e),p=Uc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wc(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=Wc(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 Kp=50,qp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Gp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Wp(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<Kp&&(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}=Wp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Jp=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}=Tc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ec(r),_=Ac(o),v=Ec(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vc(o)]:Nc(o)),x=p!==`none`;!d&&x&&b.push(...Bc(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=Mc(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`||_===Ac(t)||T.every(e=>Ac(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=Ac(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{}}}},Yp=new Set([`left`,`top`]);async function Xp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ec(n),s=Dc(n),c=Ac(n)===`y`,l=Yp.has(o)?-1:1,u=a&&c?-1:1,d=Tc(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 Zp=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 Xp(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}}}}},Qp=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}=Tc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ac(i),p=Oc(f),m=u[p],h=u[f],g=(e,t)=>wc(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}}}}}},$p=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}=Tc(e,t),u={x:n,y:r},d=Ac(i),f=Oc(d),p=u[f],m=u[d],h=Tc(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=Yp.has(Ec(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}}}},em=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}=Tc(e,t),c=await i.detectOverflow(t,s),l=Ec(n),u=Dc(n),d=Ac(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=vc(p-c[m],g),y=vc(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*yc(c.left,c.right):S=p-2*yc(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 tm(e){let t=Wo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=jo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=bc(n)!==a||bc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function nm(e){return Ao(e)?e:e.contextElement}function rm(e){let t=nm(e);if(!jo(t))return Sc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=tm(t),o=(a?bc(n.width):n.width)/r,s=(a?bc(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var im=Sc(0);function am(e){let t=Do(e);return!Ho()||!t.visualViewport?im:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function om(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Do(e)}function sm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=nm(e),o=Sc(1);t&&(r?Ao(r)&&(o=rm(r)):o=rm(e));let s=om(a,n,r)?am(a):Sc(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=Do(a),t=Ao(r)?Do(r):r,n=e,i=Yo(n);for(;i&&t!==n;){let e=rm(i),t=i.getBoundingClientRect(),r=Wo(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=Do(i),i=Yo(n)}}return Wc({width:u,height:d,x:c,y:l})}function cm(e,t){let n=Go(e).scrollLeft;return t?t.left+n:sm(Oo(e)).left+n}function lm(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-cm(e,n),y:n.top+t.scrollTop}}function um(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Oo(r),s=t?Fo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Sc(1),u=Sc(0),d=jo(r);if((d||!a)&&((Eo(r)!==`body`||No(o))&&(c=Go(r)),d)){let e=sm(r);l=rm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?lm(o,c):Sc(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 dm(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function fm(e){let t=Go(e),n=e.ownerDocument.body,r=yc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=yc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+cm(e),o=-t.scrollTop;return Wo(n).direction===`rtl`&&(a+=yc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var pm=25;function mm(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Do(e),a=Oo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ho()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(cm(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<=pm&&(s-=o)}return{width:s,height:c,x:l,y:u}}function hm(e,t){let n=sm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rm(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gm(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=mm(e,n,t);else if(t===`document`)r=fm(Oo(e));else if(Ao(t))r=hm(t,n);else{let n=am(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wc(r)}function _m(e,t){let n=t.get(e);if(n)return n;let r=Jo(e,[],!1).filter(e=>Ao(e)&&Eo(e)!==`body`),i=null,a=Wo(e).position===`fixed`,o=a?Ko(e):e;for(;Ao(o)&&!Uo(o);){let e=Wo(o),t=Bo(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ko(o)}return t.set(e,r),r}function vm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Fo(t)?[]:_m(t,this._c):[].concat(n),r],o=gm(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=gm(t,a[e],i);s=yc(n.top,s),c=vc(n.right,c),l=vc(n.bottom,l),u=yc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ym(e){let{width:t,height:n}=tm(e);return{width:t,height:n}}function bm(e,t,n){let r=jo(t),i=Oo(t),a=n===`fixed`,o=sm(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Sc(0);if((r||!a)&&((Eo(t)!==`body`||No(i))&&(s=Go(t)),r)){let e=sm(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=cm(i));let l=i&&!r&&!a?lm(i,s):Sc(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 xm(e){return Wo(e).position===`static`}function Sm(e,t){if(!jo(e)||Wo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Oo(e)===n&&(n=n.ownerDocument.body),n}function Cm(e,t){let n=Do(e);if(Fo(e))return n;if(!jo(e)){let t=Ko(e);for(;t&&!Uo(t);){if(Ao(t)&&!xm(t))return t;t=Ko(t)}return n}let r=Sm(e,t);for(;r&&Po(r)&&xm(r);)r=Sm(r,t);return r&&Uo(r)&&xm(r)&&!Bo(r)?n:r||Vo(e)||n}var wm=async function(e){let t=this.getOffsetParent||Cm,n=this.getDimensions,r=await n(e.floating);return{reference:bm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tm(e){return Wo(e).direction===`rtl`}var Em={convertOffsetParentRelativeRectToViewportRelativeRect:um,getDocumentElement:Oo,getClippingRect:vm,getOffsetParent:Cm,getElementRects:wm,getClientRects:dm,getDimensions:ym,getScale:rm,isElement:Ao,isRTL:Tm};function Dm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Om(e,t,n){let r=null,i,a=Oo(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=xc(d),h=xc(a.clientWidth-(u+f)),g=xc(a.clientHeight-(d+p)),_=xc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:yc(0,vc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Dm(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=Do(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function km(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=nm(e),u=i||a?[...l?Jo(l):[],...t?Jo(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Om(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?sm(e):null;c&&g();function g(){let t=sm(e);h&&!Dm(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 Am=Zp,jm=Qp,Mm=Jp,Nm=em,Pm=$p,Fm=(e,t,n)=>{let r=new Map,i=n??{},a={...Em,...i.platform,_c:r};return qp(e,t,{...i,platform:a})},Im=typeof document<`u`?_.useLayoutEffect:function(){};function Lm(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(!Lm(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)&&!Lm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zm(e,t){let n=Rm(e);return Math.round(t*n)/n}function Bm(e){let t=_.useRef(e);return Im(()=>{t.current=e}),t}function Vm(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]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Lm(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Bm(c),O=Bm(i),k=Bm(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Fm(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Lm(T.current,t)&&(T.current=t,gu.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Im(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);Im(()=>(j.current=!0,()=>{j.current=!1}),[]),Im(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=zm(N.floating,u.x),r=zm(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rm(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Hm=(e,t)=>{let n=Am(e);return{name:n.name,fn:n.fn,options:[e,t]}},Um=(e,t)=>{let n=jm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wm=(e,t)=>({fn:Pm(e).fn,options:[e,t]}),Gm=(e,t)=>{let n=Mm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Km=(e,t)=>{let n=Nm(e);return{name:n.name,fn:n.fn,options:[e,t]}};function qm(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=_.useState(null),d=_.useRef(null),f=wf(n),p=_.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Vm({...e,elements:{...p,...l&&{reference:l}}}),h=_.useCallback(e=>{let t=Ao(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=_.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),v=_.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=_.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:v,nodeId:t,rootStore:r}),[m,g,v,t,r,s,c]);return q(()=>{o&&(d.current=o)},[o]),q(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),_.useMemo(()=>({...m,context:y,refs:g,elements:v,rootStore:r}),[m,g,v,y,r])}var Jm=_.createContext(void 0);function Ym(){return _.useContext(Jm)?.direction??`ltr`}var Xm=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}=Tc(e,t)||{};if(l==null)return{};let d=Uc(u),f={x:n,y:r},p=jc(i),m=kc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=wc(D,k,O),j=!c.arrow&&Dc(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Zm=(e,t)=>{let{name:n,fn:r}=Xm(e);return{name:n,fn:r,options:[e,t]}},Qm={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},$m={sideX:`left`,sideY:`top`},eh=`--available-width`,th=`--available-height`,nh=`--anchor-width`,rh=`--anchor-height`,ih=`--transform-origin`,ah=eh,oh=th;function sh(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function ch(e,t,n){let{rects:r,placement:i}=e;return{side:sh(t,Ec(i),n),align:Dc(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function lh(e){return uh(e,qm)}function uh(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=J(k),j=k?A:n,M=Jd(n),N=Jd(g),P=Ym()===`rtl`,[F,I]=_.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?Ec(F):null,z=F&&L?Dc(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,ee=V===`center`?B:`${B}-${V}`,te=l;typeof te==`number`?te={top:te,right:te,bottom:te,left:te}:te&&={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0};let ne=+(i===`bottom`),re=+(i===`top`),H=+(i===`right`),U=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:te},ae=_.useRef(null),oe=Jd(a),W=Jd(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(Hm(e=>{let t=ch(e,i,P),n=typeof oe.current==`function`?oe.current(t):oe.current,r=typeof W.current==`function`?W.current(t):W.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,P,i]));let ue=T===`none`&&w!==`shift`,de=!ue&&(u||D||w===`shift`),fe=w===`none`?null:Gm({...ie,padding:{top:te.top+1+ne,right:te.right+1+U,bottom:te.bottom+1+re,left:te.left+1+H},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),pe=ue?null:Um({...ie,rootBoundary:O,mainAxis:T!==`none`,crossAxis:de,limiter:u||D?void 0:Wm(e=>{if(!ae.current)return{};let{width:t,height:n}=ae.current.getBoundingClientRect(),r=Ac(Ec(e.placement)),i=r===`y`?t:n,a=r===`y`?te.left+te.right:te.top+te.bottom;return{offset:i/2+a/2}})},[ie,u,D,O,te,T]);w===`shift`||T===`shift`||V===`center`?le.push(pe,fe):le.push(fe,pe),le.push(Km({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(ah,`${t}px`),i.setProperty(oh,`${n}px`);let a=Do(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(nh,`${u}px`),i.setProperty(rh,`${d}px`)}}),Zm(e=>({element:ae.current||Zo(e.elements.floating).createElement(`div`),padding:ae.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Ec(r),u=Dc(r),d=Ac(l)===`y`,f=ae.current,p=typeof a==`function`?a(ch(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(ih,d?`${m} ${h}`:`${h} ${m}`),{}}},Qm,x),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=_.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:ge,x:_e,y:ve,middlewareData:ye,update:G,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>km(...e,me),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ye.adaptiveOrigin||$m,Ee=Se?r:`fixed`,De=_.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:_e,[Te]:ve}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[ah]=`100vw`,e[oh]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,_e,Te,ve,Ce,Se]),Oe=_.useRef(null);q(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(dh(t)?t.current:t)||null;n!==Oe.current&&(he.setPositionReference(n),Oe.current=n)},[g,he,j,M]),_.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&dh(e)&&e.current!==Oe.current&&(he.setPositionReference(e.current),Oe.current=e.current)},[g,he,j,M]),_.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return km(ge.reference,ge.floating,G,me)},[m,g,ge,G,me]);let ke=Ec(be),Ae=sh(i,ke,P),je=Dc(be)||`center`,Me=!!ye.hide?.referenceHidden;q(()=>{S&&g&&Se&&(ke!==B||L&&je!==V)&&I(be)},[S,L,g,Se,be,ke,je,B,V]);let Ne=_.useMemo(()=>({position:`absolute`,top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Pe=ye.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ae,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:he,context:xe,isPositioned:Se,update:G}),[De,Ne,ae,Pe,Ae,je,ke,Me,he,xe,Se,G])}function dh(e){return e!=null&&`current`in e}function fh(e){return e===`starting`?xu:Ka}function ph(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Z(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},fh(r),i],stateAttributesMapping:$s})}function mh(){let e=$a(),t=e.useState(`toasts`);return _.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function hh(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||us(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{id:e,updates:n}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var gh=48,_h=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-gh-t;return n},vh=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},yh=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-gh;n+=i>>>1^-(i&1),t[r]=n}return t},bh=384,xh=[],Sh=vh(_h(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Ch=vh(_h(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),wh=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Th=(()=>{let e=Sh.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Sh[n];i<Sh[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Sh[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Sh[i];a<Sh[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Eh=_h(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Dh=vh(_h(`123333359346463635126536711576`)),Oh=_h(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),kh=_h(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Ah=yh(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),jh=(()=>{let e=new Int32Array(319).fill(-1),t=yh(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=yh(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Mh=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Nh=yh(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Ph=yh(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),Fh=yh(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),Ih=new Int32Array(995),Lh=new Int32Array(995),Rh=new Int32Array(995),zh=``,Bh=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Nh.length;r++)for(let i of Mh[Fh[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Bh[a*2]=zh.length,Bh[a*2+1]=i.length,zh+=i),Ih[n]=Nh[r],Lh[n]=Ph[r],Rh[n]=a,n++}}var Vh=yh(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Hh=vh(_h(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Uh=yh(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Wh=_h(`ij`),Gh=_h(`—`),Kh=_h(`1`),qh={GROUP_COUNT:bh,customValidatorNames:xh,edgeStart:Sh,labelStart:Ch,labelText:wh,edgeTarget:Th,nodeGroup:Eh,nodeVlist:jh,vlistPat:Dh,vlistOps:Oh,vlistRef:kh,vlistGroup:Ah,litAnchor:Ih,litGroup:Lh,litPool:Rh,poolOffsets:Bh,poolText:zh,adjGid:Vh,adjStart:Hh,adjTgt:Uh,patGid:Wh,patTgt:Gh,postfixLookupGroups:Kh,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Jh=`line`in Error(),Yh=-1,Xh=-1,Zh=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Qh=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},$h=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Zh(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Zh(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,ee=V.length,te=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ne=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,re=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,H=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=0,ae=-1,oe=-1,W=-1,se=-1,ce=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,le=e=>/\s/.test(String.fromCharCode(e)),ue=(e,t,n)=>{if(ie=0,ae=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ie=1;else if(r===40&&i===41)ie=2;else return;W=t+1,se=n-1;let a=t+1;if(ce(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ce(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ae=t+1,oe=a,W=a+1)}},de=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},fe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,me=e=>!!e&&!Number.isNaN(Number(e)),he=(e,t,n)=>{if(n-t<11||!de(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&de(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&de(e,t+10,t+18,`-normal/`)},ge=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],_e=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ve=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ye=(e,t,n,r)=>{if(e>=10){if(e>=25)return te[e-25](t.slice(n,r));let i=e-10;if(ie!==ge[i])return!1;if(ae>=0){for(let e of _e[i])if(de(t,ae,oe,e))return!0;return!1}switch(ve[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(W,se);return ne.test(e)&&!re.test(e)}case 3:return me(t.slice(W,se));case 4:return U.test(t.slice(W,se));default:return H.test(t.slice(W,se))}}switch(e){case 0:return!0;case 1:return ie===0;case 2:return ie===1;case 3:return ie===2;case 4:return fe.test(t.slice(n,r));case 5:return me(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&me(t.slice(n,r-1));case 8:return pe.test(t.slice(n,r));default:return he(t,n,r)}},G=new Set(typeof E==`string`?E.split(` `):E),be=(e,t,n,r,i,a)=>{let o=Zh(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},xe=new Map,Se=new Map,Ce=2,we=4096,Te=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||G.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Se.get(s);return c===void 0&&Se.set(s,c=Ce++),c},Ee=new Map,De=r,Oe=r+4096,ke=()=>De++,Ae=2097152,je=8192,Me=new Int32Array(je),Ne=Array(je).fill(null),Pe=new Int32Array(je),Fe=new Int32Array(je),Ie=new Uint8Array(je),Le=0,Re=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ne[e]!==null){if(Ne[e|1]===null)c=e|1;else if(!(Le++&3))c=e|Le>>2&1;else return}Ne[c]=t.slice(n,r),Me[c]=i,Pe[c]=a,Fe[c]=o,Ie[c]=s},ze=()=>Ne.fill(null),Be=256,Ve=[new Int32Array(Be),new Int32Array(Be),new Int32Array(Be),new Int32Array(Be)],[K,He,Ue,We]=Ve,Ge=new Uint8Array(Be),Ke=new Uint8Array(Be),qe=()=>{Be*=2,Ve=Ve.map(e=>{let t=new Int32Array(Be);return t.set(e),t}),[K,He,Ue,We]=Ve;let e=new Uint8Array(Be);e.set(Ge),Ge=e,Ke=new Uint8Array(Be)},Je=64,Ye=new Int32Array(Je),Xe=new Int32Array(Je),Ze=new Int32Array(r),Qe=2048,$e=21,et=new Float64Array(Qe),tt=new Int32Array(Qe),nt=0,rt=(e,t)=>{if(e===0&&t<r)return Ze[t]===nt?1:(Ze[t]=nt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>$e;for(;tt[i]===nt;){if(et[i]===n)return 1;i=i+1&Qe-1}return et[i]=n,tt[i]=nt,0},it=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Yh:be(Ee,e,t+1,r,0,ke)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Xe[t];if(r>n)continue;let i=Ye[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ue(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ye(d[t],e,r,n))return p[h+t]}return Yh},at=e=>{let t=e.length,n=0,c=0,u=!1;(Ce>we||xe.size>we)&&(xe=new Map,Se=new Map,Ce=2,ze()),De>Oe&&(Ee=new Map,De=r,ze());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&le(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&le(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Be&&qe();let _=n++;K[_]=p,He[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Me[y]===v&&Ne[y]!==null&&Ne[y].length===g?t=y:Me[y|1]===v&&Ne[y|1]!==null&&Ne[y|1].length===g&&(t=y|1),t>=0){let n=Ne[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ue[_]=Pe[t],We[_]=Fe[t],Ge[_]=Ie[t];continue}}}let b=p;if(ee!==0){if(h-p<=ee||!e.startsWith(V,p)){Ue[_]=Yh,Re(y,e,p,h,v,Yh,0,0);continue}b=p+ee}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Ye[0]=0,Xe[0]=M,R=1);let z=Xh,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Xh:P,B=R),P!==Xh){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Xh;else{let e=i[P],t=i[P+1],c=Xh;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Je){Je*=2;let e=new Int32Array(Je);e.set(Ye),Ye=e;let t=new Int32Array(Je);t.set(Xe),Xe=t}Ye[R]=r,Xe[R]=t+2,R++}}A===D&&(z=F<I?Xh:P,B=R);let te=F<I?Xh:P,ne,re=!1;if(A>=0){if(re=!0,ne=it(e,E,A,z,B),ne!==Yh&&ne<r&&j[ne]){let t=it(e,E,D,te,R);t!==Yh&&t!==ne&&(ne=t,re=!1)}else ne===Yh&&(ne=it(e,E,D,te,R),re=!1)}else ne=it(e,E,D,te,R);let H=0,U=0;ne===Yh?Ue[_]=Yh:(U=+!!re,H=b>=C?+!!O:be(xe,e,b,C,+!!O,e=>Te(e,O)),Ue[_]=ne,Ge[_]=U,We[_]=H),Re(y,e,p,h,v,ne,H,U)}if(n===0)return``;if(n===1)return K[0]===0&&He[0]===t?e:e.slice(K[0],He[0]);if(n*k>Qe){for(;n*k>Qe;)Qe<<=1,$e--;et=new Float64Array(Qe),tt=new Int32Array(Qe)}if(Ce>=Ae||De>=Ae)throw Error(`cn: too many distinct classes in one merge`);nt=nt+1|0,nt===0&&(Ze.fill(0),tt.fill(0),nt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ue[e];if(t===Yh){Ke[e]=1;continue}let n=We[e];if(rt(n,t)===1)Ke[e]=0,f=!0;else if(Ke[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)rt(n,x[e]);if(Ge[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&rt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ke[m]){m++;continue}let t=K[m],r=He[m],i=m+1;for(;i<n&&Ke[i]&&K[i]===r+1&&e.charCodeAt(r)===32;)r=He[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ot=16384,st=new Int32Array(ot*2),ct=0,lt=1,ut=Object.create(null),dt=Object.create(null),ft=new Map,pt=new Map,mt=0,ht=0,gt=()=>{ct^=ot,lt=lt+1|0,ht=0},_t=e=>{let t=ut[e];if(t!==void 0)return t;let n=Qh(e,0,e.length),r=(n&16383)+ct,i=st[r]===(n^lt)||st[r^ot]===(n^lt-1);return i&&(t=dt[e],t!==void 0)?(ut[e]=t,t):(t=at(e),i?(ut[e]=t,++mt>z&&(mt=0,dt=ut,ut=Object.create(null),gt())):(st[r]=n^lt,++ht>ot&&gt()),t)},vt=e=>{let t=ft.get(e);if(t!==void 0)return t;let n=Qh(e,0,e.length),r=(n&16383)+ct,i=st[r]===(n^lt)||st[r^ot]===(n^lt-1);return i&&(t=pt.get(e),t!==void 0)?(ft.set(e,t),t):(t=at(e),i?(ft.set(e,t),++mt>z&&(mt=0,pt=ft,ft=new Map,gt())):(st[r]=n^lt,++ht>ot&&gt()),t)},yt=e=>{let t=Qh(e,0,e.length),n=(t&16383)+ct;return st[n]===(t^lt)||st[n^ot]===(t^lt-1)||(st[n]=t^lt,++ht>ot&&gt(),!1)},bt=z===0?at:Jh?e=>{let t=ft.get(e);return t===void 0?vt(e):t}:_t;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?bt(arguments[0]):bt(ng.apply(null,arguments))},mergeString:bt,seenBefore:z===0?()=>!1:yt,mergeUncached:at}},eg=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:eg(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},tg=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:eg(i,t);a&&(n&&(n+=` `),n+=a)}return n},ng=function(){return tg(arguments,!1)},rg=256,ig=16,ag=1024,og=4096,sg=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(og).fill(``),l=Array(og).fill(``),u=Array(og).fill(``));let i=Qh(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=eg(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>ig&&(_.miss=ig,_.skip=ag,_.e.length=0,_.at=0);let u=_.e;u.length<rg?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(eg(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},cg=$h(qh),Q=sg(cg.mergeString,cg);cg.merge;var lg=_.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=sd({disabled:i,focusableWhenDisabled:a,native:o});return Z(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function ug(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ug(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function dg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ug(e))&&(r&&(r+=` `),r+=t);return r}var fg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,pg=dg,mg=(e,t)=>n=>{if(t?.variants==null)return pg(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=fg(t)||fg(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return pg(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},hg=mg(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function gg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,X.jsx)(lg,{"data-slot":`button`,className:Q(hg({variant:t,size:n,className:e})),...r})}var _g=hh();function vg({...e}){return(0,X.jsx)(El,{...e})}function yg({...e}){return(0,X.jsx)(qd,{"data-slot":`toast-portal`,...e})}function bg({className:e,...t}){return(0,X.jsx)(uu,{"data-slot":`toast-viewport`,className:Q(`pointer-events-none fixed right-4 bottom-4 z-50 w-[340px] max-w-[calc(100vw-2rem)] outline-none`,e),...t})}function xg({className:e,...t}){return(0,X.jsx)(Gu,{"data-slot":`toast`,className:Q(`group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-[10px] border border-border bg-card text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)] will-change-transform outline-none select-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,`[--gap:0.25rem] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]`,`h-(--toast-height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms] motion-reduce:transition-none`,`after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']`,`data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]`,`[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]`,`data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e),...t})}function Sg({className:e,...t}){return(0,X.jsx)(Ku,{"data-slot":`toast-content`,className:Q(`flex h-full items-start gap-2.5 overflow-hidden px-3.5 py-3 text-xs`,e),...t})}function Cg({className:e,...t}){return(0,X.jsx)(nd,{"data-slot":`toast-title`,className:Q(`mb-0.5 text-xs font-semibold`,e),...t})}function wg({className:e,...t}){return(0,X.jsx)(td,{"data-slot":`toast-description`,className:Q(`text-xs leading-[1.45] text-muted-foreground`,e),...t})}function Tg({className:e,render:t=(0,X.jsx)(gg,{variant:`outline`,size:`sm`}),...n}){return(0,X.jsx)(dd,{"data-slot":`toast-action`,render:t,className:Q(`shrink-0`,e),...n})}function Eg({className:e,children:t,render:n=(0,X.jsx)(gg,{variant:`ghost`,size:`icon-xs`}),...r}){return(0,X.jsx)(ud,{"data-slot":`toast-close`,"aria-label":`Close`,render:n,className:Q(`absolute top-1.5 right-1.5 text-muted-foreground opacity-0 group-hover/toast:opacity-100 hover:text-foreground focus-visible:opacity-100`,e),...r,children:t??(0,X.jsx)(Xi,{"aria-hidden":`true`})})}function Dg({type:e}){let t=null;return e===`success`&&(t=(0,X.jsx)(Vt,{className:`text-success`,"aria-hidden":`true`})),e===`info`&&(t=(0,X.jsx)(In,{"aria-hidden":`true`})),e===`warning`&&(t=(0,X.jsx)(zt,{className:`text-note`,"aria-hidden":`true`})),e===`error`&&(t=(0,X.jsx)(Sr,{className:`text-destructive`,"aria-hidden":`true`})),t?(0,X.jsx)(`span`,{"data-slot":`toast-icon`,className:`mt-px shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,children:t}):null}function Og({bodies:e}){let{toasts:t}=mh();return t.map(t=>{let n=t.type?e?.[t.type]:void 0;return n?(0,X.jsx)(n,{toast:t},t.id):(0,X.jsx)(kg,{toastItem:t},t.id)})}function kg({toastItem:e}){return(0,X.jsx)(xg,{toast:e,children:(0,X.jsxs)(Sg,{children:[(0,X.jsx)(Dg,{type:e.type}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pr-4`,children:[(0,X.jsx)(Cg,{}),(0,X.jsx)(wg,{}),(0,X.jsx)(Tg,{className:`mt-2 self-start`})]}),(0,X.jsx)(Eg,{})]})})}function Ag({children:e,toastManager:t=_g,bodies:n,...r}){return(0,X.jsxs)(vg,{toastManager:t,...r,children:[e,(0,X.jsx)(yg,{children:(0,X.jsx)(bg,{children:(0,X.jsx)(Og,{bodies:n})})})]})}function jg(){return N()(()=>({board:null,reloads:{},connected:!1,canWrite:!1,dispatch:!1,accessKnown:!1,focus:null,findings:{},notes:{},listeners:[],history:{undo:0,redo:0},claims:{},thumbnails:{light:{},dark:{}},aliases:{}}))}function Mg(e,t){let n=t.split(`/`);for(let t=n.length;t>0;t--){let r=e[n.slice(0,t).join(`/`)];if(r!==void 0)return[r,...n.slice(t)].join(`/`)}return t}function Ng(e,t,n){let r=e.getState(),{board:i}=r;if(!i||!Pg(e,t,n))return;let a=e=>Ig(e,t,n),o=t.split(`/`).length===3?r.aliases:{...a(r.aliases),[n]:Mg(r.aliases,t)},s=eee(i,t,n);e.setState({board:s,reloads:a(r.reloads),findings:a(r.findings),notes:a(r.notes),claims:a(r.claims),thumbnails:{light:a(r.thumbnails.light),dark:a(r.thumbnails.dark)},aliases:Rg(o,s)})}function Pg(e,t,n){let{board:r}=e.getState();return!!r&&Bg(r,t)&&!Bg(r,n)}function Fg(e,t,n){return Lg(e,t)?`${n}${e.slice(t.length)}`:e}function Ig(e,t,n){return Object.fromEntries(Object.entries(e).filter(([e])=>!Lg(e,n)).map(([e,r])=>[Fg(e,t,n),r]))}function Lg(e,t){return e===t||e.startsWith(`${t}/`)}function Rg(e,t){let n=Object.entries(e).filter(([e,n])=>e!==n&&!Bg(t,n));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function zg(e,t,n){if(t.aliases===e.aliases||!e.board||!t.board||!Bg(e.board,n)||Bg(t.board,n))return null;let r=Mg(e.aliases,n);return t.board.projects.flatMap(e=>e.pages).find(e=>Mg(t.aliases,e.ref)===r)?.ref??null}function Bg(e,t){return e.projects.some(e=>e.name===t||e.pages.some(e=>e.ref===t||e.frames.some(e=>e.ref===t)))}function eee(e,t,n){let[r=``,i,a]=t.split(`/`),o=n.split(`/`).at(-1)??n,s=(e,t)=>n=>n===e||n.startsWith(`${e}/`)?`${t}${n.slice(e.length)}`:n;return{...e,projects:e.projects.map(e=>{if(e.name!==r)return e;if(a!==void 0)return{...e,pages:e.pages.map(e=>e.name===i?{...e,frames:e.frames.map(e=>e.ref===t?{...e,ref:n,name:o,path:Vg(e.path,`${o}.html`)}:e)}:e)};if(i===void 0){let t=s(e.path,Vg(e.path,o));return{...e,name:o,path:t(e.path),pages:e.pages.map(e=>({...e,ref:`${o}/${e.name}`,project:o,path:t(e.path),frames:e.frames.map(n=>({...n,ref:`${o}/${e.name}/${n.name}`,project:o,path:t(n.path)}))}))}}return{...e,pages:e.pages.map(e=>{if(e.name!==i)return e;let t=s(e.path,Vg(e.path,o));return{...e,ref:n,name:o,path:t(e.path),frames:e.frames.map(e=>({...e,ref:`${n}/${e.name}`,page:o,path:t(e.path)}))}})}})}}function Vg(e,t){return`${e.slice(0,e.lastIndexOf(`/`)+1)}${t}`}function Hg(e,t){let n=t.projects.flatMap(e=>e.pages),r=new Set(n.flatMap(e=>e.frames.map(e=>e.ref))),i=new Set(n.map(e=>e.ref)),a=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e))),{reloads:o,findings:s,notes:c,claims:l,aliases:u}=e.getState();e.setState({board:t,reloads:a(o,r),findings:a(s,r),notes:a(c,i),claims:a(l,r),aliases:Rg(u,t)})}function Ug(e,t,n){e.setState({notes:{...e.getState().notes,[t]:n}})}function Wg(e,t){e.setState({listeners:t})}function Gg(e,t){e.setState({history:t})}function Kg(e,t){e.setState({claims:Object.fromEntries(t.map(e=>[e.frame,e]))})}function qg(e,t,n){let{thumbnails:r}=e.getState(),i={...r[t]};for(let[e,t]of Object.entries(n))t===null?delete i[e]:i[e]=t;e.setState({thumbnails:{...r,[t]:i}})}function Jg(e){e.setState({connected:!1,canWrite:!1,dispatch:!1,accessKnown:!1,notes:{},listeners:[],history:{undo:0,redo:0},claims:{},thumbnails:{light:{},dark:{}}})}function Yg(e,t){e.setState({findings:{...e.getState().findings,...t}})}function Xg(e,t,n=!1){e.setState({canWrite:t,dispatch:n,accessKnown:!0})}function Zg(e,t){let n={...e.getState().reloads};for(let e of t)n[e]=(n[e]??0)+1;e.setState({reloads:n})}var Qg=jg();function $g(e){return F(Qg,e)}var e_=`link`,t_=`expired`;function n_(e=Qg,t=r_){if(new URLSearchParams(location.search).get(e_)!==t_)return()=>{};let n=()=>{let{accessKnown:n,canWrite:r}=e.getState();if(!n)return!1;let i=new URL(location.href);return i.searchParams.delete(e_),history.replaceState(history.state,``,i),r||t(),!0};if(n())return()=>{};let r=e.subscribe(()=>{n()&&r()});return r}function r_(){_g.add({title:`This edit link has expired`,description:`A link works once, for two minutes. Run frameboard open for a new one.`,type:`warning`,timeout:0})}var i_=1024;function a_(e){return N()(()=>({mode:`edit`,tool:`move`,hideUi:e<i_,spacePan:!1}))}function o_(e,t=c_){let n=e=>{e.code!==`Space`||s_(e.target)||(e.preventDefault(),t.getState().spacePan||t.setState({spacePan:!0}))},r=()=>{t.getState().spacePan&&t.setState({spacePan:!1})},i=e=>{e.code===`Space`&&r()};return e.addEventListener(`keydown`,n),e.addEventListener(`keyup`,i),e.addEventListener(`blur`,r),()=>{e.removeEventListener(`keydown`,n),e.removeEventListener(`keyup`,i),e.removeEventListener(`blur`,r),r()}}function s_(e){return e instanceof Element&&e.closest(`input, textarea, select, button, a[href], [contenteditable=""], [contenteditable="true"], [role="menu"], [role="menuitem"], [role="dialog"], [role="option"], [role="switch"], [role="tab"], [role="checkbox"], [role="radio"], [role="button"]`)!=null}var c_=a_(window.innerWidth);function l_(e){return F(c_,e)}function u_(){return $g(e=>e.connected&&e.accessKnown&&!e.canWrite)}function d_(){let e=u_(),[t]=Fa(`/p/*`),n=l_(e=>e.mode===`play`);return!e||t&&n?null:(0,X.jsx)(`p`,{role:`status`,"data-view-only-notice":!0,className:`absolute top-3 left-1/2 -translate-x-1/2 rounded-xl border border-border bg-card px-3 py-1 text-body text-muted-foreground`,children:`View only. Run frameboard open to edit`})}function f_(e){let[t=``,n=``,r=``]=e.split(`/`);return`/frames/${encodeURIComponent(t)}/${encodeURIComponent(n)}/${encodeURIComponent(r)}.html`}function p_(e,t){return`/p/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}var m_=null,h_=null,g_=1,__=new Set,v_=new Set,y_=new Set,b_={zoom:()=>g_,attached:()=>m_!==null,page:()=>h_,onZoom:e=>T_(__,e),onAttach:e=>T_(v_,e),onHandMove:e=>T_(y_,e),zoomBy:e=>m_?.zoomBy(e),zoomTo:e=>m_?.zoomTo(e),fit:()=>m_?.fit(),fitTo:e=>m_?.fitTo(e),panBy:(e,t)=>m_?.panBy(e,t),centerOn:(e,t)=>m_?.centerOn(e,t),reveal:e=>{m_&&!x_(m_.visible(),e)&&(C_(),m_.centerOn(e))}};function x_(e,t){return t.x>=e.x&&t.y>=e.y&&t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height}function S_(e,t){return m_=e,h_=t,E_(v_),()=>{m_===e&&(m_=null,h_=null,E_(v_))}}function C_(){E_(y_)}function w_(e){e!==g_&&(g_=e,E_(__))}function T_(e,t){return e.add(t),()=>{e.delete(t)}}function E_(e){for(let t of e)t()}var D_=[`dropdown-menu-content`,`context-menu-content`,`popover-content`,`dialog-content`].map(e=>`[data-slot="${e}"][data-open]`).join(`,`),O_=`input:not([type=button],[type=checkbox],[type=radio],[type=submit]),textarea,select,[contenteditable=""],[contenteditable="true"]`;function k_(e=document){let t=e.defaultView??window,n=new Set,r=!1,i,a=()=>r||(e.activeElement?.matches(O_)??!1)||e.querySelector(D_)!==null,o=()=>{clearTimeout(i),i=setTimeout(()=>{if(!a())for(let e of[...n])n.delete(e),e()})},s=()=>{r=!0},c=()=>{r=!1,o()},l=[[e,`pointerdown`,s],[e,`pointerup`,c],[e,`pointercancel`,c],[t,`blur`,c],[e,`focusout`,o]];for(let[e,t,n]of l)e.addEventListener(t,n,!0);let u=new MutationObserver(o);return u.observe(e.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-open`]}),{busy:a,whenIdle:e=>(n.add(e),o(),()=>n.delete(e)),dispose:()=>{clearTimeout(i),u.disconnect();for(let[e,t,n]of l)e.removeEventListener(t,n,!0);n.clear()}}}var A_=`frameboard.seen`;function j_(e){let t=N()(()=>({unseen:{},seen:W_(e),cursor:null,base:{},lastCleared:null,clears:0}));return Object.assign(t,{storage:e})}function tee(e,t){let{unseen:n,seen:r,base:i}=e.getState(),a={...n},o={...i};for(let e of t)a[e.frame]||(e.before?o[e.frame]=e.before:delete o[e.frame]),r[e.frame]===e.hash?delete a[e.frame]:a[e.frame]=e;e.setState({unseen:a,base:o})}function M_(e,t){let{unseen:n,seen:r}=e.getState(),i=n[t];if(!i)return;let{[t]:a,...o}=n,s={...r,[t]:i.hash};e.setState({unseen:o,seen:s}),G_(e.storage,s)}function N_(e){let{unseen:t,seen:n,clears:r}=e.getState(),i=Object.values(t);if(i.length===0)return;let a=Object.fromEntries(i.map(e=>[e.frame,{change:e,seenBefore:n[e.frame]}])),o={...n,...Object.fromEntries(i.map(e=>[e.frame,e.hash]))};e.setState({unseen:{},seen:o,lastCleared:a,clears:r+1}),G_(e.storage,o)}function P_(e){let{unseen:t,seen:n,lastCleared:r}=e.getState();if(!r)return;let i={...t},a={...n};for(let[e,{change:o,seenBefore:s}]of Object.entries(r))e in t||n[e]!==o.hash||(i[e]=o,s===void 0?delete a[e]:a[e]=s);e.setState({unseen:i,seen:a,lastCleared:null}),G_(e.storage,a)}function F_(e,t){let n=new Set(t.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.map(e=>e.ref)))),{unseen:r,base:i,lastCleared:a}=e.getState(),o=R_(r,n),s=R_(i,n),c=a&&R_(a,n);(o!==r||s!==i||c!==a)&&e.setState({unseen:o,base:s,lastCleared:c})}function I_(e,t,n){let{unseen:r,seen:i,base:a,cursor:o,lastCleared:s}=e.getState(),c=Object.fromEntries(Object.entries(Ig(r,t,n)).map(([e,t])=>[e,{...t,frame:e}])),l=Ig(i,t,n);e.setState({unseen:c,seen:l,base:Ig(a,t,n),lastCleared:s&&Object.fromEntries(Object.entries(Ig(s,t,n)).map(([e,t])=>[e,{...t,change:{...t.change,frame:e}}])),cursor:o===null?null:Fg(o,t,n)}),G_(e.storage,l)}function L_(e,t){let{base:n}=e.getState();if(!(t in n))return;let{[t]:r,...i}=n;e.setState({base:i})}function R_(e,t){let n=Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)));return Object.keys(n).length===Object.keys(e).length?e:n}function z_(e,t){e.setState({cursor:t})}function B_(e,t){let n=`${t}/`;return Object.keys(e).filter(e=>e.startsWith(n)).length}function V_(e){return Object.values(e).sort((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id))}function H_(e,t){let n=V_(e);return n[(n.findIndex(e=>e.frame===t)+1)%n.length]??null}function U_(e,t){let n=V_(e),r=n.findIndex(e=>e.frame===t);return n[(r<0?n.length-1:r-1+n.length)%n.length]??null}function W_(e){try{let t=JSON.parse(e?.getItem(`frameboard.seen`)??`{}`);return typeof t!=`object`||!t?{}:Object.fromEntries(Object.entries(t).filter(e=>typeof e[1]==`string`))}catch{return{}}}function G_(e,t){try{e?.setItem(A_,JSON.stringify(t))}catch{}}function K_(){try{return window.localStorage}catch{return null}}var q_=j_(K_());function J_(e){return F(q_,e)}var Y_=N()(()=>({session:null})),X_=null;function Z_(e,{live:t=Qg,unseen:n=q_,go:r=va}={}){Q_();let i=b_.page(),a=null,o,s=()=>{if(a===null)return;let[e=``,n=``]=a.split(`/`),s=ev(a);if(b_.page()!==s){i!==s&&(i=s,o=b_.zoom(),r(p_(e,n)));return}let c=tv(t.getState().board,a);c&&(a=null,b_.centerOn(c,o),o=void 0)},c=e=>{e!==null&&(a=e,s())},l=n.subscribe((t,n)=>{let r=V_(t.unseen).filter(t=>t.author?.session===e&&n.unseen[t.frame]?.id!==t.id);c(r.at(-1)?.frame??null)}),u=t.subscribe((t,n)=>{if(!t.listeners.some(t=>t.session===e)){Q_();return}let r=Object.values(t.claims).filter(t=>t.session===e&&n.claims[t.frame]?.session!==e);r.length>0?c(r.at(-1)?.frame??null):t.board!==n.board&&s()}),d=b_.onHandMove(Q_),f=b_.onAttach(()=>{let e=b_.page();if(e===null)return;let n=t.getState().focus;n!==null&&e===ev(n)&&(i=e),e===i?s():Q_()}),p=ye([{id:`follow.stop`,label:`Stop following`,group:`changes`,run:Q_,command:{label:`Stop following the agent`,icon:er}}]);X_=()=>{p(),f(),d(),u(),l()},Y_.setState({session:e})}function Q_(){if(!X_)return;let e=X_;X_=null,e(),Y_.setState({session:null})}function $_(e=Qg){(0,_.useEffect)(()=>{let t=()=>{let{listeners:t}=e.getState();return t.length===1?t[0]:void 0},n=ye([{id:`follow.start`,label:`Follow the agent`,group:`changes`,run:()=>{let n=t();n&&Z_(n.session,{live:e})},enabled:()=>t()!==void 0&&Y_.getState().session===null,command:{label:`Follow the agent`,icon:nr,hint:()=>t()?.tag??``}}]),r=e.subscribe((e,t)=>{e.listeners!==t.listeners&&G()}),i=Y_.subscribe(G);return()=>{i(),r(),n()}},[e])}function ev(e){let[t=``,n=``]=e.split(`/`);return`${t}/${n}`}function tv(e,t){for(let n of e?.projects??[])for(let e of n.pages){let n=e.frames.find(e=>e.ref===t);if(n)return n.box}return null}var nv=`show-offer`,rv={live:Qg,busy:pv,toasts:_g,go:va,following:()=>Y_.getState().session!==null,project:()=>/^\/p\/([^/]+)/.exec(location.pathname)?.[1]??null},iv=null,av=null;function ov(e,t=rv){hv(),uv(e,t)}function sv(e,{go:t,live:n}=rv){let[r=``,i=``]=e.split(`/`);t(p_(r,i)),n.setState({focus:e})}function cv(e,t=rv){sv(e,t),av?.()}function lv(e){let[t=``,n=``,r=``]=e.split(`/`);return{ref:e,title:`An agent showed ${r}`,detail:`${n} in ${t}`}}function uv(e,t){let[n=``]=e.split(`/`),r=t.following();if(n!==t.project()&&!r)return dv(e,t);if(!t.busy().busy())return sv(e,t);if(!r)return dv(e,t);iv=t.busy().whenIdle(()=>{iv=null,uv(e,t)})}function dv(e,t){let[n=``,r=``]=e.split(`/`),i=t.toasts.add({type:nv,timeout:0,data:lv(e),onClose:()=>{o(),av===a&&(av=null)}}),a=()=>t.toasts.close(i),o=b_.onAttach(()=>{b_.page()===`${n}/${r}`&&a()});av=a}var fv=null;function pv(){return fv??=k_()}function mv(){iv?.(),iv=null}function hv(){mv(),av?.()}var gv=N()(()=>({glowing:{},replays:{}})),_v=new Set;function vv(e){gv.setState(t=>({replays:{...t.replays,[e]:!0}}))}function yv(e=q_){let{unseen:t,cursor:n}=e.getState();return(n===null?void 0:t[n])??V_(t)[0]??null}function bv(e,t=va){let[n=``,r=``]=e.split(`/`),i=p_(n,r);decodeURIComponent(location.pathname)!==decodeURIComponent(i)&&t(i),Qg.setState({focus:e}),vv(e)}function xv(e=q_,t=va){(0,_.useEffect)(()=>{let n=()=>Object.keys(e.getState().unseen).length>0,r=n=>()=>{let r=n(e.getState().unseen,yv(e)?.frame??null);r&&(z_(e,r.frame),bv(r.frame,t))},i=ye([{id:`changes.markAllSeen`,label:`Mark all seen`,group:`changes`,keys:[`Shift+BracketRight`],run:()=>N_(e),enabled:n,command:{label:`Mark all agent changes seen`,icon:jt}},{id:`changes.show`,label:`Show change`,group:`changes`,keys:[`Backslash`],run:()=>{let n=yv(e);n&&(z_(e,n.frame),bv(n.frame,t))},enabled:n,command:{label:`Show the agent change`,icon:Xr}},{id:`changes.next`,label:`Next change`,group:`changes`,keys:[`BracketRight`],run:r(H_),enabled:n,command:{label:`Next agent change`,icon:pt}},{id:`changes.previous`,label:`Previous change`,group:`changes`,keys:[`BracketLeft`],run:r(U_),enabled:n,command:{label:`Previous agent change`,icon:dt}},{id:`changes.undoMarkAll`,label:`Undo mark all seen`,group:`changes`,run:()=>P_(e),enabled:()=>e.getState().lastCleared!==null,command:{label:`Undo marking agent changes seen`,icon:Ki}}]),a=e.subscribe(G);return()=>{a(),i()}},[e,t])}function Sv(e,t,n){let r=V_(e),i=r.length;if(i<=1){let e=t.author?.agent??null,r=t.frame.split(`/`).at(-1)??t.frame,i=t.whole?1:Math.max(t.elements.length,1),a=`${i} ${i===1?`change`:`changes`}`;return{initial:Tv(e),title:e?`${wv(e)} updated ${r}`:`${r} changed`,detail:n?`${a}, glowing on the frame`:a,show:!n,next:!1,markAll:!1,undo:!1,width:n?300:340}}let a=new Set(r.map(e=>e.author?.agent??null)),[o]=a,s=a.size===1&&o?o:null,c=new Set(r.map(e=>e.frame.split(`/`).slice(0,2).join(`/`))).size,l=r.findIndex(e=>e.id===t.id)+1;return{initial:Tv(s),title:s?`${wv(s)} changed ${i} frames`:`${i} frames changed`,detail:`on ${c} ${c===1?`page`:`pages`} · ${l} of ${i}`,show:!0,next:!0,markAll:!0,undo:!1,width:600}}function Cv(e){return{initial:null,title:`${e} ${e===1?`change`:`changes`} marked seen`,detail:`Every page is clear`,show:!1,next:!1,markAll:!1,undo:!0,width:300}}function wv(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Tv(e){return e?e.charAt(0).toUpperCase():null}var Ev=5e3,Dv=`change`;function Ov({store:e=q_,toasts:t=_g}){return(0,X.jsx)(kv,{store:e,toasts:t})}function kv({store:e,toasts:t}){return(0,_.useEffect)(()=>{let n=null,r,i=!1,a=null,o=()=>{a!==null&&t.close(a),a=null},s=(e,r=0)=>{if(n===null){let i=t.add({type:Dv,timeout:r,data:e,onClose:()=>{n===i&&(n=null),a===i&&(a=null)}});n=i}else t.update(n,{data:e,timeout:r})},c=()=>{let o=yv(e);if(o)n!==null&&i&&(a=n,n=null),i=!1,clearTimeout(r),r=void 0,s(Sv(e.getState().unseen,o,o.frame in gv.getState().glowing));else if(n!==null&&!i&&r===void 0){let e=n;r=setTimeout(()=>{r=void 0,n===e&&t.close(e)},Ev)}},l=e=>{o(),clearTimeout(r),r=void 0,s(Cv(e),Ev),i=!0},u=(e,t)=>{e.clears!==t.clears&&e.lastCleared?l(Object.keys(e.lastCleared).length):(t.lastCleared&&!e.lastCleared&&(a===null?i=!1:o()),c())};c();let d=e.subscribe(u),f=gv.subscribe(c);return()=>{d(),f(),clearTimeout(r),o(),n!==null&&t.close(n)}},[e,t]),null}function Av({toast:e}){let[t,n,r,i,a]=xe([`changes.show`,`changes.previous`,`changes.next`,`changes.markAllSeen`,`changes.undoMarkAll`]),o=(0,_.useRef)(null),s=(0,_.useRef)(!1),c=e.data,l=c?.undo??!1;if((0,_.useEffect)(()=>{if(!s.current)return;s.current=!1;let e=o.current;(e?.querySelector(`button`)??e?.closest(`[data-slot="toast"]`))?.focus()},[l]),!c)return null;let u=e=>t=>{s.current=t.currentTarget===document.activeElement,e?.run()};return(0,X.jsx)(xg,{toast:e,"data-change-toast":!0,style:{width:c.width},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&c.show&&(e.preventDefault(),t?.run())},children:(0,X.jsxs)(Sg,{ref:o,className:`items-center`,children:[c.initial?(0,X.jsx)(`span`,{"aria-hidden":!0,className:`font-bold text-claim`,children:c.initial}):null,(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsx)(Cg,{children:c.title}),(0,X.jsx)(wg,{children:c.detail})]}),c.show?(0,X.jsx)(jv,{action:t,label:`Show`,keys:Mv,className:`bg-[color-mix(in_srgb,var(--claim)_22%,transparent)] text-claim`}):null,c.next?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(jv,{action:n,label:`Previous`,keys:Nv}),(0,X.jsx)(jv,{action:r,label:`Next`,keys:Pv})]}):null,c.markAll?(0,X.jsx)(jv,{action:i,label:`Mark all seen`,keys:Fv,onClick:u(i)}):null,c.undo?(0,X.jsx)(`button`,{type:`button`,onClick:u(a),className:Q(Iv,`bg-secondary text-foreground`),children:`Undo`}):null]})})}function jv({action:e,label:t,keys:n,className:r=`bg-secondary text-foreground`,onClick:i}){let a=pe(e?.keys??n,fe());return(0,X.jsx)(`button`,{type:`button`,"aria-keyshortcuts":a?U(a):void 0,onClick:i??(()=>e?.run()),className:Q(Iv,r),children:a?`${t} ${U(a)}`:t})}var Mv=[`Backslash`],Nv=[`BracketLeft`],Pv=[`BracketRight`],Fv=[`Shift+BracketRight`],Iv=`ml-2 shrink-0 rounded-md px-2 py-[3px] font-medium whitespace-nowrap outline-none hover:brightness-95 focus-visible:ring-2 focus-visible:ring-ring/50`;function Lv({toast:e}){let t=e.data;return t?(0,X.jsxs)(xg,{toast:e,"data-show-offer":!0,style:{width:340},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&(e.preventDefault(),cv(t.ref))},children:[(0,X.jsxs)(Sg,{className:`items-center`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsx)(Cg,{children:t.title}),(0,X.jsx)(wg,{children:t.detail})]}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>cv(t.ref),className:Q(Iv,`bg-[color-mix(in_srgb,var(--claim)_22%,transparent)] text-claim`),children:`Go`})]}),(0,X.jsx)(Eg,{})]}):null}function Rv(e){return(typeof e==`number`||typeof e==`string`)&&e!==``}function zv(e){let t=(0,_.useId)();return Rv(e)?`${e}`:t}var Bv=typeof window<`u`?_.useLayoutEffect:_.useEffect;function Vv(e){let t=(0,_.useRef)(e);return Bv(()=>{t.current=e},[e]),(0,_.useCallback)((...e)=>t.current?.(...e),[t])}function Hv(...e){return Vv(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function Uv(e,t){let n=e?.[`data-testid`];return Rv(n)?`${n}`:Rv(t)?`${t}`:void 0}function Wv(e,t=`Assertion error`){if(!e)throw Error(t)}(0,_.createContext)(null);var Gv;function Kv(){return Gv===void 0&&(Gv=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),Gv}function qv({expandHitTargets:e,axis:t,rect:n}){let r=e?Kv()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine:0;if(n.width<r){let e=r-n.width;n=new DOMRect(n.x-e/2,n.y,n.width+e,n.height)}if(n.height<r){let e=r-n.height;n=new DOMRect(n.x,n.y-e/2,n.width,n.height+e)}return n}function Jv(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}var Yv=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1){n[0].call(null,t);return}let e,r=Array.from(n);for(let n=0;n<r.length;n++){let i=r[n];try{i.call(null,t)}catch(t){e??={error:t}}}if(e)throw e.error}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Xv={cursorFlags:0,state:`inactive`},Zv=new Yv;function Qv(){return Xv}function $v(e){return Zv.addListener(`change`,e)}function ey(e,t=[],n,r=!1){let i=Xv,a={...Xv};a.cursorFlags=e,a.state===`active`&&(a.didPointerMove||=r,a.previews=t,n&&(a.previewLayoutMap=n)),Xv=a,Zv.emit(`change`,{prev:i,next:a})}function ty(e){let t=Xv;Xv=e,t.state===`active`&&e.state!==`active`&&t.didPointerMove&&t.hitRegions.forEach(({separator:e})=>{e&&e.element.ownerDocument.activeElement===e.element&&e.element.blur()}),Zv.emit(`change`,{prev:t,next:e})}function ny(e){Xv.state!==`active`||!Xv.previews.some(t=>t.separator===e)||ty({...Xv,previews:Xv.previews.map(t=>t.separator===e?{...t}:t)})}function ry(e){if(Xv.state===`inactive`)return;let t=Xv.hitRegions.filter(t=>t.axis!==e),n=Xv.state===`active`&&Xv.previews.some(t=>t.axis===e);if(t.length!==Xv.hitRegions.length||n){if(t.length===0)ty({cursorFlags:0,state:`inactive`});else if(Xv.state===`active`){let n=new Map(Xv.initialLayoutMap),r=new Map(Xv.previewLayoutMap);n.delete(e),r.delete(e),ty({...Xv,cursorFlags:0,hitRegions:t,initialLayoutMap:n,previewLayoutMap:r,previews:Xv.previews.filter(t=>t.axis!==e)})}else ty({...Xv,hitRegions:t})}}var iy=e=>e,ay=()=>{},oy=1,sy=2,cy=4,ly=8,uy=3,dy=12,fy;function py(){return fy===void 0&&(fy=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(fy=!0)),fy}function my({cursorFlags:e,axes:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&py()){let t=(e&oy)!==0,n=(e&sy)!==0,r=(e&cy)!==0,i=(e&ly)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return py()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var hy=new WeakMap;function gy(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=hy.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=Qv();switch(r.state!==`inactive`&&r.ownerDocument!==e&&(r={cursorFlags:0,state:`inactive`}),r.state){case`active`:case`hover`:{let e=my({cursorFlags:r.cursorFlags,axes:r.hitRegions.map(e=>e.axis),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}hy.set(e,{prevStyle:t,styleSheet:n})}function _y(e){return e.state===`inactive`?void 0:e.ownerDocument}function vy({next:e,prev:t}){let n=_y(t),r=_y(e);n&&n!==r&&gy(n),r&&gy(r)}function yy({axis:e}){let{layoutStrategy:t,orientation:n,items:r}=e;return t?t.calculateAvailableSize():r.reduce((e,t)=>(e+=n===`horizontal`?t.element.offsetWidth:t.element.offsetHeight,e),0)}function by(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_DISCONNECTED?0:n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function xy(e,t){return Array.from(t).sort((t,n)=>{let r=e===`horizontal`?Sy(t,n):Cy(t,n);return r===0?by(t.element,n.element):r})}function Sy(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Cy(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function wy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Ty(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Ey({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Ty(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Wv(i,`No rect found`),i}function Dy({expandHitTargets:e=!0,axis:t,includeDisabled:n=!1}){if(t.layoutStrategy)return t.layoutStrategy.calculateHitRegions({expandHitTargets:e,axis:t,includeDisabled:n});let{element:r,orientation:i,items:a,separators:o}=t,s=xy(i,Array.from(r.children).filter(wy).filter(e=>!e.hasAttribute(`data-resize-preview`)).map(e=>({element:e}))).map(({element:e})=>e),c=[],l=!1,u=!1,d=-1,f,p=-1,m=0,h,g=[];{let e=-1;for(let t of s)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(m++,d===-1&&(d=e),p=e))}if(n||m>1){let r=-1;for(let m of s)if(m.hasAttribute(`data-panel`)){r++;let o=a.find(e=>e.element===m);if(o){if(h){let a=h.element.getBoundingClientRect(),s=m.getBoundingClientRect(),_;if(u){let e=i===`horizontal`?new DOMRect(a.right,a.top,0,a.height):new DOMRect(a.left,a.bottom,a.width,0),t=i===`horizontal`?new DOMRect(s.left,s.top,0,s.height):new DOMRect(s.left,s.top,s.width,0);switch(g.length){case 0:_=[e,t];break;case 1:{let n=g[0];_=[n,Ey({orientation:i,rects:[a,s],targetRect:n.element.getBoundingClientRect()})===a?t:e];break}default:_=g}}else _=g.length?g:[i===`horizontal`?new DOMRect(a.right,s.top,s.left-a.right,s.height):new DOMRect(s.left,a.bottom,s.width,s.top-a.bottom)];for(let i of _){let a=qv({expandHitTargets:e,axis:t,rect:`width`in i?i:i.element.getBoundingClientRect()});(n||!l&&!(r<=d||r>p))&&(f??=yy({axis:t}),c.push({axis:t,axisSize:f,items:[h,o],separator:`width`in i?void 0:i,rect:a})),l=!1}}u=!1,h=o,g=[]}}else if(m.hasAttribute(`data-separator`)){m.ariaDisabled!==null&&(l=!0);let e=o.find(e=>e.element===m);e?g.push(e):(h=void 0,g=[])}else u=!0}return c}function Oy(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function ky(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function Ay(e){return e/100*window.innerHeight}function jy(e){return e/100*window.innerWidth}function My({axisSize:e,itemElement:t,styleProp:n}){let r,[i,a]=Jv(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=ky(t,i);break;case`em`:r=Oy(t,i);break;case`vh`:r=Ay(i);break;case`vw`:r=jy(i)}return r}function Ny(e){return parseFloat(e.toFixed(3))}function Py(e,t=yy({axis:e})){let{items:n}=e;return t===0?n.map(e=>({groupResizeBehavior:e.constraintProps.groupResizeBehavior,collapsedSize:0,collapsible:e.constraintProps.collapsible===!0,defaultSize:void 0,disabled:e.constraintProps.disabled,minSize:0,maxSize:100,itemId:e.id})):n.map(e=>{let{element:n,constraintProps:r}=e,i=0;r.collapsedSize!==void 0&&(i=Ny(My({axisSize:t,itemElement:n,styleProp:r.collapsedSize})/t*100));let a;r.collapsedThreshold!==void 0&&(a=Ny(My({axisSize:t,itemElement:n,styleProp:r.collapsedThreshold})/t*100));let o;r.defaultSize!==void 0&&(o=Ny(My({axisSize:t,itemElement:n,styleProp:r.defaultSize})/t*100));let s=0;r.minSize!==void 0&&(s=Ny(My({axisSize:t,itemElement:n,styleProp:r.minSize})/t*100));let c=100;return r.maxSize!==void 0&&(c=Ny(My({axisSize:t,itemElement:n,styleProp:r.maxSize})/t*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsedThreshold:a,collapsible:r.collapsible===!0,defaultSize:o,disabled:r.disabled,minSize:s,maxSize:c,itemId:e.id}})}var Fy=new Map,Iy=new Yv,Ly=0,Ry=[],zy;function By(){Ly++}function Vy(){for(let e=0;e<Ry.length;e++)try{Iy.emit(`axisChange`,Ry[e])}catch(e){zy??={error:e}}Ry.length=0}function Hy(){if(Ly===1&&Vy(),Ly--,Ly===0&&zy){let{error:e}=zy;throw zy=void 0,e}}function Uy(e){Fy=new Map(Fy),Fy.delete(e)}function Wy(e,t){for(let[t]of Fy)if(t.id===e)return t}function Gy(e,t){for(let[t,n]of Fy)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Ky(){return Fy}function qy(e,t){return Iy.addListener(`axisChange`,n=>{n.axis.id===e&&t(n)})}function Jy(e,t,n){let r=Fy.get(e);Fy=new Map(Fy),Fy.set(e,t);let i={axis:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t};Ly>0?Ry.push(i):Iy.emit(`axisChange`,i)}function Yy(e,{pointerId:t,pointerType:n}){return t===e.pointerId||n===`pen`&&e.pointerType===`pen`}function Xy(e,t,n={}){return e.ownerDocument===t&&(n.pointerId===void 0||Yy(e,n))}function Zy(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Qy(e,t,n=0){return Math.abs(Ny(e)-Ny(t))<=n}function $y(e,t){return Qy(e,t)?0:e>t?1:-1}function eb({overrideDisabledItems:e,itemConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsedThreshold:a,collapsible:o,disabled:s,maxSize:c=100,minSize:l=0}=t;if(s&&!e)return n;if($y(r,l)<0){if(o){let e=a??(l-i)/2,t=$y(n,i)<=0,o=t?i+e:l-e,s=$y(r,o);r=$y(r,i)<=0||s<0||a!==void 0&&t&&s===0?i:l}else r=l}return r=Math.min(c,r),r=Ny(r),r}function tb({delta:e,initialLayout:t,itemConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Qy(e,0))return t;let o=a===`imperative-api`,s=n.map(({itemId:e})=>t[e]),c=n.map(({itemId:e})=>i[e]),l=[...s],[u,d]=r;Wv(u!=null,`Invalid first pivot index`),Wv(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Wv(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Wv(n!=null,`Previous layout not found for panel index ${t}`),Qy(n,i)){let t=o-n;$y(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Wv(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Wv(n!=null,`Previous layout not found for panel index ${t}`),Qy(n,o)){let t=n-i;$y(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Wv(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsedSize:a,collapsedThreshold:o,collapsible:c,minSize:l}=r;if(c&&$y(i,l)<0){let t=l-a,n=o??t/2;if($y(i+Math.abs(e),l)<0){let r=$y(Math.abs(e),n);e=r>0||r===0&&o===void 0&&e<0?e<0?-t:t:0}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Wv(e!=null,`Previous layout not found for panel index ${r}`);let a=eb({overrideDisabledItems:o,itemConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Wv(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=eb({overrideDisabledItems:o,itemConstraints:n[t],prevSize:i,size:a});if(!Qy(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Zy(c,l))return i;{let t=e<0?d:u,r=s[t];Wv(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=eb({overrideDisabledItems:o,itemConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!Qy(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Wv(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=eb({overrideDisabledItems:o,itemConstraints:n[r],prevSize:i,size:a});if(Qy(i,s)||(t-=s-i,l[r]=s),Qy(t,0))break;e>0?r--:r++}}}return Qy(Object.values(l).reduce((e,t)=>t+e,0),100,.1)?l.reduce((e,t,r)=>(e[n[r].itemId]=t,e),{}):i}function nb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||$y(e[n],t[n])!==0)return!1;return!0}function rb(e){By();try{ib(e)}finally{Hy()}}function ib({commit:e,event:t,hitRegions:n,initialLayoutMap:r,mountedAxes:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0,c=Qv(),l=c.state===`active`?c.previews:[],u=new Map(c.state===`active`?c.previewLayoutMap:void 0);n.forEach(n=>{let{axis:o,axisSize:c}=n,{orientation:d,items:f}=o;if(e&&o.resizePreviewMode!==`separator`)return;let{disableCursor:p}=o.mutableState,m=0;m=a?d===`horizontal`?(t.clientX-a.x)/c*100:(t.clientY-a.y)/c*100:d===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let h=r.get(o),g=i.get(o);if(!h||!g)return;let{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:b,separatorToItems:x}=g;if(v&&b&&x){let t=o.resizePreviewMode===`separator`?u.get(o)??b:b,r=tb({delta:m,initialLayout:h,itemConstraints:v,pivotIndices:n.items.map(e=>f.indexOf(e)),prevLayout:t,trigger:`mouse-or-touch`});if(o.resizePreviewMode===`separator`&&!e&&!nb(r,t)){u.set(o,r);let e=0,t=f.map(t=>(e+=r[t.id]-h[t.id],c/100*e));l=l.map(e=>{if(e.axis!==o)return e;let n=t[e.itemIndex];return n===e.offset?e:{...e,offset:n}})}if(nb(r,t)&&m!==0&&!p)switch(d){case`horizontal`:s|=m<0?oy:sy;break;case`vertical`:s|=m<0?cy:ly}(o.resizePreviewMode!==`separator`||e)&&!nb(r,b)&&Jy(n.axis,{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:r,requestedAxisSize:y,requestedLayout:r,separatorToItems:x})}});let d=0;t.movementX===0?d|=o&uy:d|=s&uy,t.movementY===0?d|=o&dy:d|=s&dy;let f=c.state===`active`&&(t.clientX!==c.pointerDownAtPoint.x||t.clientY!==c.pointerDownAtPoint.y);ey(d,l,u,f)}function ab(e,t){let n=Qv();if(n.state!==`active`||!Xy(n,e,t))return;let r=Ky();By();try{rb({commit:!0,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags}),Vy(),ty({cursorFlags:0,state:`inactive`}),n.hitRegions.length>0&&(t.preventDefault?.(),n.hitRegions.forEach(e=>{if(!r.has(e.axis))return;let t=Gy(e.axis.id,!0);Jy(e.axis,t,{isUserInteraction:!0})}))}finally{Hy()}}function ob(e){if(e.defaultPrevented)return;let{clientX:t,clientY:n,movementX:r,movementY:i}=e;ab(e.currentTarget,{clientX:t,clientY:n,movementX:r,movementY:i})}function sb(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Ty(n,a.rect);switch(e){case`horizontal`:(t.x<i.x||t.x===i.x&&t.y<=i.y)&&(r=a,i=t);break;case`vertical`:(t.y<i.y||t.y===i.y&&t.x<=i.x)&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function cb(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function lb(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:hb(e),b:hb(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Wv(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:mb(pb(n.a)),b:mb(pb(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var ub=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function db(e){let t=getComputedStyle(gb(e)??e).display;return t===`flex`||t===`inline-flex`}function fb(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||db(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||ub.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function pb(e){let t=e.length;for(;t--;){let n=e[t];if(Wv(n,`Missing node`),fb(n))return n}return null}function mb(e){return e&&Number(getComputedStyle(e).zIndex)||0}function hb(e){let t=[];for(;e;)t.push(e),e=gb(e);return t}function gb(e){let{parentNode:t}=e;return cb(t)?t.host:t}function _b(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function vb(e){try{return e.matches(`:modal`)}catch{return!1}}function yb({axisElement:e,hitRegion:t,pointerEventTarget:n}){if(wy(n)){let t=n.closest(`dialog`);if(t&&!t.contains(e)&&vb(t))return!1}if(!wy(n)||n.contains(e)||e.contains(n)||!n.isConnected||!e.isConnected)return!0;if(lb(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(_b(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function bb(e,t,n){let r=[];return t.forEach((t,i)=>{if(i.disabled||i.element.ownerDocument!==n)return;let a=Dy({axis:i}),o=sb(i.orientation,a,{x:e.clientX,y:e.clientY});o&&o.distance.x<=0&&o.distance.y<=0&&yb({axisElement:i.element,hitRegion:o.hitRegion.rect,pointerEventTarget:e.target})&&r.push(o.hitRegion)}),r}function xb(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Ny(i.defaultSize);n+=e,r[i.itemId]=e}else r[i.itemId]=void 0;let i=e.length-t;if(i!==0){let t=Ny((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.itemId]=t)}return r}function Sb(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}function Cb({axis:e,itemConstraints:t}){let n=e.items.map(({id:e})=>e).join(`,`),r=e.mutableState.defaultLayout;return e.mutableState.layouts[n]??(r&&Sb(e.items,r)?r:xb(t))}function wb(e,t){if(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 Tb(e,t){return e.length===t.length&&e.every((e,n)=>wb(e,t[n]))}function Eb({layout:e,itemConstraints:t}){let n=t.map(({itemId:t})=>e[t]),r=[...n],i=r.reduce((e,t)=>e+t,0);if(Object.keys(e).length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${Object.values(e).map(e=>`${e}%`).join(`, `)}`);if(!Qy(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Wv(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Wv(i!=null,`No layout data found for index ${e}`);let o=r[e];Wv(o!=null,`No layout data found for index ${e}`);let s=eb({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!Qy(a,0))for(let e=0;e<t.length;e++){let n=r[e];Wv(n!=null,`No layout data found for index ${e}`);let i=n+a,o=eb({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,Qy(a,0)))break}return r.reduce((e,n,r)=>(e[t[r].itemId]=n,e),{})}function Db({itemIds:e,layout:t}){return Eb({layout:t,itemConstraints:e.map(e=>({collapsedSize:0,collapsible:!1,defaultSize:void 0,disabled:void 0,itemId:e,maxSize:100,minSize:0}))})}function Ob({axis:e,nextAxisSize:t,prevAxisSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.items){let e=r[l.id]??0;switch(l.constraintProps.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Ny(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Ny((r[e]??0)/a*l);else{let e=Ny(l/c.length);for(let t of c)u[t]=e}return u}function kb({axis:e,axisState:t}){let n=yy({axis:e});if(n===0)return;let r=Py(e,n),i=t.requestedAxisSize,a=t.requestedLayout;t.defaultLayoutDeferred&&(i=n,a=Db({itemIds:e.items.map(({id:e})=>e),layout:Cb({axis:e,itemConstraints:r})}));let o=Eb({layout:Ob({axis:e,nextAxisSize:n,prevAxisSize:i,prevLayout:a}),itemConstraints:r});return{changed:t.defaultLayoutDeferred||!nb(t.layout,o)||!Tb(t.derivedItemConstraints,r)||t.axisSize!==n,state:{defaultLayoutDeferred:!1,derivedItemConstraints:r,axisSize:n,layout:o,requestedAxisSize:i,requestedLayout:a,separatorToItems:t.separatorToItems}}}function Ab({axisId:e,itemId:t}){let n=()=>{let t=Ky();for(let[n,r]of t)if(n.id===e)return{axis:n,...r};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedItemConstraints.find(e=>e.itemId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let{axis:e,...r}=n(),i=kb({axis:e,axisState:r}),a=i?.state??r,o=a.derivedItemConstraints.find(e=>e.itemId===t);if(o===void 0)throw Error(`Panel constraints not found for Panel ${t}`);let s=a.layout[t];if(s===void 0)throw Error(`Layout not found for Panel ${t}`);return{axis:e,changed:i?.changed===!0,itemConstraints:o,itemSize:s,state:a}},a=()=>{let e=n().axis.items.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},s=({nextSize:e,items:n,prevLayout:r,derivedItemConstraints:i})=>{let a=r[t],o=n.findIndex(e=>e.id===t),s=o===0,c=o===n.length-1;if(c&&e<a&&(s||n.slice(0,o).every((e,t)=>{let n=i[t];return n?.collapsible&&Qy(n.collapsedSize,r[n.itemId])}))){let e=n.slice(0,o).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:Ny(100-e)}}return tb({delta:c?a-e:e-a,initialLayout:r,itemConstraints:i,pivotIndices:c?[o-1,o]:[o,o+1],prevLayout:r,trigger:`imperative-api`})},c=(e,{axis:t,changed:n,itemSize:r,state:i})=>{if(e===r)return;let{derivedItemConstraints:a,axisSize:o,layout:c}=i,l=Eb({layout:s({nextSize:e,items:t.items,prevLayout:c,derivedItemConstraints:a}),itemConstraints:a});(n||!nb(c,l))&&Jy(t,{...i,layout:l,requestedAxisSize:o,requestedLayout:l})};return{collapse:()=>{let e=i(),{collapsible:t,collapsedSize:n}=e.itemConstraints,{mutableValues:r}=a(),o=e.itemSize;t&&o!==n&&(r.expandToSize=o,c(n,e))},expand:()=>{let e=i(),{collapsible:t,collapsedSize:n,minSize:r}=e.itemConstraints,{mutableValues:o}=a(),s=e.itemSize;if(t&&s===n){let t=o.expandToSize??r;t===0&&(t=1),c(t,e)}},getSize:()=>{let{axis:e}=n(),r=o(),{element:i}=a();return{asPercentage:r,inPixels:e.layoutStrategy?e.layoutStrategy.getItemSizeInPixels(t):e.orientation===`horizontal`?i.offsetWidth:i.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=o();return e&&Qy(t,n)},resize:e=>{let t=i(),{axisSize:n}=t.state,{element:r}=a(),o=Ny(My({axisSize:n,itemElement:r,styleProp:e})/n*100);c(o,t)}}}function jb(e){e.defaultPrevented||bb(e,Ky(),e.currentTarget).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.items.find(e=>e.constraintProps.defaultSize!==void 0);if(n){let r=n.constraintProps.defaultSize,i=Ab({axisId:t.axis.id,itemId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Mb(e){let t=Ky();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Nb({axisId:e}){let t=()=>{let t=Ky();for(let[n,r]of t)if(n.id===e)return{axis:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{axis:n,...r}=t(),i=kb({axis:n,axisState:r}),a=i?.state??r,{defaultLayoutDeferred:o,derivedItemConstraints:s,axisSize:c,layout:l}=a,u=Eb({layout:e,itemConstraints:s});return o?l:((i?.changed||!nb(l,u))&&Jy(n,{...a,layout:u,requestedAxisSize:c,requestedLayout:u}),u)}}}function Pb(e,t){let n=Mb(e),r=Gy(n.id,!0),i=n.separators.find(t=>t.element===e);Wv(i,`Matching separator not found`);let a=r.separatorToItems.get(i);Wv(a,`Matching panels not found`);let o=a.map(e=>n.items.indexOf(e)),s=Nb({axisId:n.id}).getLayout(),c=Eb({layout:tb({delta:t,initialLayout:s,itemConstraints:r.derivedItemConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),itemConstraints:r.derivedItemConstraints});nb(s,c)||Jy(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedItemConstraints:r.derivedItemConstraints,axisSize:r.axisSize,layout:c,requestedAxisSize:r.axisSize,requestedLayout:c,separatorToItems:r.separatorToItems},{isUserInteraction:!0})}function Fb(e){return e.separators.filter(e=>!e.disabled)}function Ib(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Mb(t);if(!(n.disabled||n.separators.find(e=>e.element===t)?.disabled))switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Pb(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Pb(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Pb(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Pb(t,-5);break;case`End`:e.preventDefault(),Pb(t,100);break;case`Enter`:{e.preventDefault();let{derivedItemConstraints:r,layout:i,separatorToItems:a}=Gy(n.id,!0),o=n.separators.find(e=>e.element===t);Wv(o,`Matching separator not found`);let s=a.get(o);Wv(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.itemId===c.id);if(Wv(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Pb(t,(l.collapsedSize===e?n.mutableState.expandedItemSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let t=Fb(n).map(e=>e.element),r=t.findIndex(t=>t===e.currentTarget);Wv(r!==-1,`Index not found`),t[e.shiftKey?r>0?r-1:t.length-1:r+1<t.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),Pb(t,-100)}}function Lb(e,t){let n=Qv();if(n.state!==`active`||!Xy(n,e,t))return!1;let r=Ky();By();try{n.previewLayoutMap.forEach((e,t)=>{let n=r.get(t);t.resizePreviewMode===`separator`&&n&&!nb(e,n.layout)&&Jy(t,{...n,layout:e,requestedAxisSize:n.axisSize,requestedLayout:e})}),Vy(),ty({cursorFlags:0,state:`inactive`}),n.hitRegions.forEach(e=>{if(!r.has(e.axis))return;let t=Gy(e.axis.id,!0);Jy(e.axis,t,{isUserInteraction:!0})})}finally{Hy()}return!0}function Rb(e){let t=Qv();if(t.state!==`active`)return;let n=t.hitRegions.flatMap(({separator:e})=>e?[e.element]:[]);!n.some(t=>t===e.target)||n.some(t=>t.hasPointerCapture?.(e.pointerId))||Lb(e.currentTarget,e)}function zb(e){Lb(e.currentTarget,e)}function Bb(e,t){let{element:n,orientation:r,items:i}=e,a=n.getBoundingClientRect(),o=r===`horizontal`;return Dy({expandHitTargets:!1,axis:e,includeDisabled:!0}).map(({items:r,rect:s,separator:c},l)=>{let u=i.indexOf(r[0]),d=o?s.left+s.width/2:s.top+s.height/2;return{active:t.some(t=>{if(t.axis!==e||t.items[0]!==r[0])return!1;if(c||t.separator)return t.separator===c;let n=o?t.rect.left+t.rect.width/2:t.rect.top+t.rect.height/2;return Qy(d,n)}),axis:e,key:c?`separator-${c.id}`:`panel-${r[0].id}-${l}`,offset:0,itemIndex:u,rect:new DOMRect((o&&!c?d:s.left)-a.left-n.clientLeft+n.scrollLeft,(!o&&!c?d:s.top)-a.top-n.clientTop+n.scrollTop,o&&!c?0:s.width,!o&&!c?0:s.height),separator:c}})}function Vb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Qv();if(t.state===`active`){Yy(t,e)&&Lb(t.ownerDocument,t);return}let n=Ky(),r=bb(e,n,e.currentTarget);if(r.length===0)return;let i=new Map,a=!1;r.forEach(e=>{e.separator&&(a||(a=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let t=n.get(e.axis);t&&i.set(e.axis,t.layout)});let o=Array.from(i.keys()).flatMap(e=>e.resizePreviewMode===`separator`?Bb(e,r):[]);ty({cursorFlags:0,didPointerMove:!1,hitRegions:r,initialLayoutMap:i,ownerDocument:e.currentTarget,pointerDownAtPoint:{x:e.clientX,y:e.clientY},pointerId:e.pointerId,pointerType:e.pointerType,previewLayoutMap:new Map(i),previews:o,state:`active`}),e.preventDefault()}function Hb(e){let t=e.currentTarget,n=Ky(),r=Qv();if(r.state===`active`){if(!Xy(r,t,e))return;rb({commit:!1,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedAxes:n,prevCursorFlags:r.cursorFlags})}}function Ub(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Qv(),r=Ky();switch(n.state){case`active`:if(!Xy(n,t,e))return;if(e.buttons===0){Lb(t,e);return}for(let t of n.hitRegions)if(t.separator){let{element:n}=t.separator;n.isConnected&&!n.hasPointerCapture?.(e.pointerId)&&n.setPointerCapture?.(e.pointerId)}rb({commit:!1,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags});break;default:{let i=bb(e,r,t);i.length===0?n.state!==`inactive`&&ty({cursorFlags:0,state:`inactive`}):ty({cursorFlags:0,hitRegions:i,ownerDocument:t,state:`hover`});break}}}function Wb(e){if(e.relatedTarget instanceof HTMLIFrameElement){let t=Qv();t.state===`hover`&&t.ownerDocument===e.currentTarget&&ty({cursorFlags:0,state:`inactive`})}}function Gb(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||ab(e.currentTarget,e)}function Kb(e){e.target===e.currentTarget&&Lb(e.currentTarget.document)}function qb(e){Lb(e.currentTarget.document)}function Jb(e,t,n){if(!n[0])return;let r=e.items.find(e=>e.element===t);if(!r||!r.onResize)return;let i=yy({axis:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Ny(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}var Yb=new Map,Xb=!1;function Zb(e){let t=!0;Wv(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{let r;By();try{for(let i of n){let{borderBoxSize:n,target:a}=i;if(a===e.element){if(t){let t=Gy(e.id);if(!t)break;let n=kb({axis:e,axisState:t});if(!n)break;if(!n.changed)continue;Jy(e,n.state)}}else try{Jb(e,a,n)}catch(e){r??={error:e}}}}finally{Hy()}if(r)throw r.error});a.observe(e.element),e.items.forEach(e=>{Wv(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=yy({axis:e}),s=Py(e,o),c=Cb({axis:e,itemConstraints:s}),l=Eb({layout:c,itemConstraints:s}),u=e.element.ownerDocument,d=u.defaultView;Yb.set(u,(Yb.get(u)??0)+1);let f=new Map;return Dy({axis:e,includeDisabled:!0}).forEach(e=>{e.separator&&f.set(e.separator,e.items)}),Jy(e,{defaultLayoutDeferred:o===0,derivedItemConstraints:s,axisSize:o,layout:l,requestedAxisSize:o,requestedLayout:Db({itemIds:e.items.map(({id:e})=>e),layout:c}),separatorToItems:f}),e.separators.forEach(e=>{Wv(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Ib)}),Xb||(Xb=!0,$v(vy)),Yb.get(u)===1&&(u.addEventListener(`contextmenu`,ob,!0),u.addEventListener(`dblclick`,jb,!0),u.addEventListener(`lostpointercapture`,Rb,!0),u.addEventListener(`pointercancel`,zb,!0),u.addEventListener(`pointerdown`,Vb,!0),u.addEventListener(`pointerleave`,Hb),u.addEventListener(`pointermove`,Ub),u.addEventListener(`pointerout`,Wb),u.addEventListener(`pointerup`,Gb,!0),d?.addEventListener(`blur`,Kb),d?.addEventListener(`pagehide`,qb)),function(){t=!1,Yb.set(u,Math.max(0,(Yb.get(u)??0)-1)),Uy(e),ry(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Ib)}),Yb.get(u)||(u.removeEventListener(`contextmenu`,ob,!0),u.removeEventListener(`dblclick`,jb,!0),u.removeEventListener(`lostpointercapture`,Rb,!0),u.removeEventListener(`pointercancel`,zb,!0),u.removeEventListener(`pointerdown`,Vb,!0),u.removeEventListener(`pointerleave`,Hb),u.removeEventListener(`pointermove`,Ub),u.removeEventListener(`pointerout`,Wb),u.removeEventListener(`pointerup`,Gb,!0),d?.removeEventListener(`blur`,Kb),d?.removeEventListener(`pagehide`,qb)),a.disconnect()}}function Qb({derivedItemConstraints:e,axis:t,layout:n,prevLayout:r,requestedLayout:i}){let a=t.items.map(({id:e})=>e).join(`,`);t.mutableState.layouts[a]=i,r&&e.forEach(e=>{if(e.collapsible){let i=Qy(e.collapsedSize,n[e.itemId]),a=Qy(e.collapsedSize,r[e.itemId]);i&&!a&&(t.mutableState.expandedItemSizes[e.itemId]=r[e.itemId])}})}function $b(){let[e,t]=(0,_.useState)({});return[e,(0,_.useCallback)(()=>t({}),[])]}function ex(e){let t=(0,_.useRef)({...e});return Bv(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var tx=(0,_.createContext)(null);function nee({layout:e,itemConstraints:t,itemId:n,itemIndex:r}){let i,a,o=e[n],s=t.find(e=>e.itemId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Eb({layout:tb({delta:l-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n],i=Eb({layout:tb({delta:c-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function ree({attributes:e,axisId:t,axisOrientation:n,children:r,className:i,"data-testid":a,disableCursor:o,disabled:s,disableDoubleClick:c,elementRef:l,id:u,isSharedHitRegion:d,preview:f,registerSeparator:p,requiredStyle:m,style:h,styleDefaults:g,tabIndex:v=0,updateSeparatorProps:y}){let b=ex({disabled:s,disableDoubleClick:c,children:r,className:i,preview:f,style:h}),[x,S]=(0,_.useState)({}),[C,w]=(0,_.useState)(`inactive`),[T,E]=(0,_.useState)(!1),D=(0,_.useRef)(null),O=(0,_.useRef)(null),k=Hv(D,l),A=n===`horizontal`?`vertical`:`horizontal`;Bv(()=>{let e=D.current;if(e!==null){let n={disabled:b.disabled,disableDoubleClick:b.disableDoubleClick,element:e,id:u,get children(){return b.children},get className(){return b.className},get preview(){return b.preview},get style(){return b.style}};O.current=n;let r=p(n),i=$v(e=>{w(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===n||(d?.(e)??!1))?e.next.state:`inactive`)}),a=qy(t,e=>{let{derivedItemConstraints:t,layout:r,separatorToItems:i}=e.next,a=i.get(n);if(a){let n=a[0],i=t.findIndex(e=>e.itemId===n.id),{layoutStrategy:o}=e.axis;S({...nee({layout:r,itemConstraints:t,itemId:n.id,itemIndex:i}),...o?.getItemAriaControls&&{valueControls:o.getItemAriaControls(n.id)}})}});return()=>{O.current=null,i(),a(),r()}}},[t,u,d,p,b]),Bv(()=>{let e=O.current;e&&ny(e)},[f]),(0,_.useEffect)(()=>{y(u,{disabled:s,disableDoubleClick:c})},[s,c,u,y]);let j;s&&!o&&(j=`not-allowed`);let M;if(s)M=`disabled`;else switch(C){case`active`:M=`active`;break;default:M=T?`focus`:C}return(0,X.jsx)(`div`,{...e,"aria-controls":x.valueControls,"aria-disabled":s||void 0,"aria-orientation":A,"aria-valuemax":x.valueMax,"aria-valuemin":x.valueMin,"aria-valuenow":x.valueNow,children:r,className:i,"data-separator":M,"data-testid":a,id:u,onBlur:()=>E(!1),onFocus:()=>E(!0),ref:k,role:`separator`,style:{...g,cursor:j,...h,...m,touchAction:`none`},tabIndex:s?void 0:v})}function iee(e){for(let t=1;t<e.length;t++)if(by(e[t-1],e[t])>0)return!1;return!0}function aee({separator:e}){let{element:t}=e,n=(0,_.useRef)(null);return Bv(()=>{let e=t.cloneNode(!0),r=[t,...t.querySelectorAll(`*`)],i=[e,...e.querySelectorAll(`*`)],a=t.ownerDocument.defaultView;return r.forEach((e,t)=>{let n=i[t];if(n instanceof a.HTMLElement||n instanceof a.SVGElement){let t=a.getComputedStyle(e);for(let e=0;e<t.length;e++){let r=t.item(e);n.style.setProperty(r,t.getPropertyValue(r))}}n.removeAttribute(`data-testid`),n.removeAttribute(`id`)}),Object.assign(e.style,{boxSizing:`border-box`,height:`100%`,margin:`0`,position:`static`,transform:`none`,width:`100%`}),n.current.appendChild(e),()=>e.remove()},[t]),(0,X.jsx)(`div`,{ref:n,style:{height:`100%`,opacity:.65,pointerEvents:`none`,width:`100%`}})}function nx(){let e=(0,_.useContext)(tx);return Wv(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function rx(e){let{registerOverlay:t}=nx(),n=(0,_.useRef)(e);wb(n.current,e)||(n.current=e);let r=n.current;return Bv(()=>t(r),[t,r]),null}rx.displayName=`SeparatorOverlay`;function ix({active:e,orientation:t,style:n,...r}){let i;switch(t){case`horizontal`:i={height:`100%`,minWidth:`1px`};break;case`vertical`:i={minHeight:`1px`,width:`100%`}}return(0,X.jsx)(`div`,{...r,"data-separator-overlay":e?`active`:`inactive`,style:{...i,...n,flexShrink:0,pointerEvents:`none`}})}function ax({overlay:e,preview:t}){let{axis:n,offset:r,rect:i,separator:a}=t,o=n.orientation===`horizontal`,s=a?.preview,c=e;return(0,_.isValidElement)(s)&&s.type===rx&&(c=s.props,s=void 0),s??(c?s=(0,X.jsx)(ix,{...c,active:t.active,orientation:n.orientation}):a&&(s=(0,X.jsx)(aee,{separator:a}))),(0,X.jsx)(`div`,{"aria-hidden":`true`,"data-resize-preview":!0,inert:!0,style:{height:i.height,left:i.left,pointerEvents:`none`,position:`absolute`,top:i.top,transform:o?`translateX(${r}px)`:`translateY(${r}px)`,width:i.width},children:s})}function ox(e){return Array.from(e).sort(by)}function sx(e,t){let n=(0,_.useRef)({getLayout:()=>({}),setLayout:iy});(0,_.useImperativeHandle)(t,()=>n.current,[]),Bv(()=>{Object.assign(n.current,Nb({axisId:e}))})}function cx({groupId:e,resizePreviewMode:t}){let[n,r]=(0,_.useState)([]),i=(0,_.useRef)(n);return Bv(()=>{let n=n=>{let a=Wy(e),o=t===`separator`&&n.state===`active`?n.previews.filter(e=>e.axis===a&&(e.active||!Qy(e.offset,0))):[],s=i.current;s.length===o.length&&o.every((e,t)=>e===s[t])||(i.current=o,r(o))};if(t!==`separator`){n(Qv());return}let a=$v(({next:e})=>n(e));return n(Qv()),a},[e,t]),n}function lx({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizePreviewMode:d=`panel`,resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...m}){let h=(0,_.useRef)({onLayoutChange:{},onLayoutChanged:{}}),g=Vv(e=>{nb(h.current.onLayoutChange,e)||(h.current.onLayoutChange=e,c?.(e))}),v=Vv((e,t,n)=>{nb(h.current.onLayoutChanged,e)||(h.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t,requestedLayout:n}))}),y=zv(s),[b,x]=(0,_.useState)(),S=cx({groupId:y,resizePreviewMode:d}),C=(0,_.useRef)(null),[w,T]=$b(),E=(0,_.useRef)([]),D=(0,_.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),O=Hv(C,a);sx(y,o);let k=Vv((e,t)=>{let r=Gy(e);if(r)return{flexGrow:r.layout[t]??1};if(n?.[t])return{flexGrow:n?.[t]}}),A=ex({defaultLayout:n,disableCursor:r,resizeTargetMinimumSize:f}),j=(0,_.useMemo)(()=>({get disableCursor(){return!!A.disableCursor},getPanelStyles:k,id:y,orientation:u,registerPanel:e=>{let t=D.current;return t.panels=xy(u,[...t.panels,e]),T(),()=>{t.panels=t.panels.filter(t=>t!==e),T()}},registerOverlay:e=>(x(e),()=>{x(void 0)}),registerSeparator:e=>{let t=D.current;return t.separators=xy(u,[...t.separators,e]),T(),()=>{t.separators=t.separators.filter(t=>t!==e),T()}},updatePanelProps:(e,{disabled:t})=>{let n=D.current.panels.find(t=>t.id===e);if(!n||n.constraintProps.disabled===t)return;n.constraintProps.disabled=t;let r=Wy(y),i=Gy(y);r&&i&&Jy(r,{...i,derivedItemConstraints:Py(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=D.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[k,y,T,u,A]),M=(0,_.useRef)(null);return Bv(()=>{let e=C.current;if(e===null)return;let t=D.current;t.panels=xy(u,t.panels),t.separators=xy(u,t.separators),E.current=ox([...t.panels.map(({element:e})=>e),...t.separators.map(({element:e})=>e)]);let n;if(A.defaultLayout!==void 0&&Object.keys(A.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=A.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:y,mutableState:{defaultLayout:n,disableCursor:!!A.disableCursor,expandedItemSizes:D.current.lastExpandedPanelSizes,layouts:D.current.layouts},orientation:u,items:t.panels,resizePreviewMode:d,get resizeTargetMinimumSize(){return A.resizeTargetMinimumSize},separators:t.separators};M.current=r;let a=Zb(r),{defaultLayoutDeferred:o,derivedItemConstraints:s,layout:c,requestedLayout:l}=Gy(r.id,!0);if(!o&&s.length>0)try{try{g(c)}finally{v(c,!1,l)}}catch(e){throw M.current=null,a(),e}let f=qy(y,e=>{let{defaultLayoutDeferred:t,derivedItemConstraints:n,layout:i,requestedLayout:a}=e.next;if(t||n.length===0)return;Qb({derivedItemConstraints:n,axis:r,layout:i,prevLayout:e.prev?.layout,requestedLayout:a});let o=Qv(),s=o.state!==`active`||!o.hitRegions.some(e=>e.axis===r);try{g(i)}finally{s&&v(i,e.isUserInteraction,a)}});return()=>{M.current=null,a(),f()}},[i,y,v,g,u,w,d,A]),Bv(()=>{iee(E.current)||T()}),(0,_.useEffect)(()=>{let e=M.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,X.jsx)(tx.Provider,{value:j,children:(0,X.jsxs)(`div`,{...m,className:t,"data-group":!0,"data-testid":Uv(m,s),id:y,ref:O,style:{height:`100%`,width:`100%`,overflow:`hidden`,position:d===`separator`?`relative`:void 0,...p,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:[e,S.map(e=>(0,X.jsx)(ax,{overlay:b,preview:e},e.key))]})})}lx.displayName=`Group`;function ux(e,t){return`react-resizable-panels:${[e,...t].join(`:`)}`}function dx({id:e,panelIds:t,storage:n}){let r=ux(e,[]),i=n.getItem(r);if(i)try{let e=JSON.parse(i);if(t){let n=e[t.join(`,`)];if(n&&Array.isArray(n.layout)&&t.length===n.layout.length){let e={};for(let r=0;r<t.length;r++)e[t[r]]=n.layout[r];return e}}else{let t=Object.keys(e);if(t.length===1){let n=e[t[0]];if(n&&Array.isArray(n.layout)){let e=t[0].split(`,`);if(e.length===n.layout.length){let t={};for(let r=0;r<e.length;r++)t[e[r]]=n.layout[r];return t}}}}}catch{}}function fx({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:r=localStorage,...i}){let a=n!==void 0,o=`id`in i?i.id:i.groupId,s=ux(o,n??[]),c=(0,_.useSyncExternalStore)(px,()=>r.getItem(s),()=>r.getItem(s)),l=(0,_.useMemo)(()=>{if(c){let e=JSON.parse(c),t=Object.values(e);if(Array.from(t).every(e=>typeof e==`number`))return e}},[c]),u=(0,_.useMemo)(()=>{if(!l)return dx({id:o,panelIds:n,storage:r})},[l,o,n,r]),d=l??u,f=(0,_.useRef)(null),p=(0,_.useCallback)(()=>{let e=f.current;e&&(f.current=null,clearTimeout(e))},[]);(0,_.useLayoutEffect)(()=>()=>{p()},[p]);let m=(0,_.useCallback)((e,n)=>{if(t&&!n.isUserInteraction)return;p();let i=n.requestedLayout??e,s;s=a?ux(o,Object.keys(i)):ux(o,[]);try{r.setItem(s,JSON.stringify(i))}catch(e){console.error(e)}},[p,a,o,t,r]);return{defaultLayout:d,onLayoutChange:(0,_.useCallback)(t=>{p(),e===0?m(t,{isUserInteraction:!1}):f.current=setTimeout(()=>{m(t,{isUserInteraction:!1})},e)},[p,e,m]),onLayoutChanged:m}}function px(){return function(){}}function mx(e,t){let{id:n}=nx(),r=(0,_.useRef)({collapse:ay,expand:ay,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:ay});(0,_.useImperativeHandle)(t,()=>r.current,[]),Bv(()=>{Object.assign(r.current,Ab({axisId:n,itemId:e}))})}function hx({children:e,className:t,collapsedSize:n=`0%`,collapsedThreshold:r,collapsible:i=!1,defaultSize:a,disabled:o,elementRef:s,groupResizeBehavior:c=`preserve-relative-size`,id:l,maxSize:u=`100%`,minSize:d=`0%`,onResize:f,panelRef:p,style:m,...h}){let g=Rv(l),v=zv(l),y=ex({disabled:o}),b=(0,_.useRef)(null),x=Hv(b,s),{getPanelStyles:S,id:C,orientation:w,registerPanel:T,updatePanelProps:E}=nx(),D=f!==null,O=Vv((e,t,n)=>{f?.(e,l,n)});Bv(()=>{let e=b.current;if(e!==null){let t={element:e,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:D?O:void 0,constraintProps:{groupResizeBehavior:c,collapsedSize:n,collapsedThreshold:r,collapsible:i,defaultSize:a,disabled:y.disabled,maxSize:u,minSize:d}};return T(t)}},[c,n,r,i,a,D,v,g,u,d,O,T,y]),(0,_.useEffect)(()=>{E(v,{disabled:o})},[o,v,E]),mx(v,p);let k=()=>{let e=S(C,v);if(e)return JSON.stringify(e)},A=(0,_.useSyncExternalStore)(e=>qy(C,e),k,k),j;return j=A?JSON.parse(A):a===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:a},(0,X.jsx)(`div`,{...h,"data-disabled":o||void 0,"data-panel":!0,"data-testid":Uv(h,l),id:v,ref:x,style:{...gx,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...j},children:(0,X.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...m,touchAction:w===`horizontal`?`pan-y`:`pan-x`},children:e})})}hx.displayName=`Panel`;var gx={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function _x(){return(0,_.useRef)(null)}var vx={flexBasis:`auto`},yx={flexGrow:0,flexShrink:0};function bx({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,preview:o,style:s,...c}){let l=zv(a),{disableCursor:u,id:d,orientation:f,registerSeparator:p,updateSeparatorProps:m}=nx();return(0,X.jsx)(ree,{attributes:c,axisId:d,axisOrientation:f,className:t,"data-testid":Uv(c,a),disableCursor:u,disabled:n,disableDoubleClick:r,elementRef:i,id:l,preview:o,registerSeparator:p,requiredStyle:yx,style:s,styleDefaults:vx,updateSeparatorProps:m,children:e})}bx.displayName=`Separator`;function xx({className:e,...t}){return(0,X.jsx)(lx,{"data-slot":`resizable-panel-group`,className:Q(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function Sx({...e}){return(0,X.jsx)(hx,{"data-slot":`resizable-panel`,...e})}function Cx({withHandle:e,className:t,children:n,...r}){return(0,X.jsxs)(bx,{"data-slot":`resizable-handle`,className:Q(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...r,children:[e&&(0,X.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),n]})}var wx=class extends Error{code;details;constructor(e,t,n={}){super(t),this.name=`BoardWriteError`,this.code=e,this.details=n}};async function Tx(e,t,n=`POST`,r=fetch){let i=await r(e,t instanceof FormData?{method:n,body:t}:{method:n,headers:{"content-type":`application/json`},body:JSON.stringify(t)});i.status===401&&Qg.setState({canWrite:!1});let a=await i.json().catch(()=>null);if(a===null)throw new wx(`internal`,`The board answered ${i.status}.`);if(!a.ok)throw new wx(a.error.code,a.error.message,a.error.details);return a.data}function Ex(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Dx(e,t=`|`){return e.map(e=>Qx(e)).join(t)}function Ox(e,t){return typeof t==`bigint`?t.toString():t}var kx=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Ax(e){return new kx(e)}function jx(e){return e==null}function Mx(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Nx(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Px(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Fx(e){return Px(e._zod.def)??e._zod.def.shape}function Ix(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Nx(this,t,e),e},enumerable:!0,configurable:!0})}function Lx(e,t,n){t in e?Nx(e,t,n):e[t]=n}function Rx(e,t,n,r){let i=Fx(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Ix(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Lx(e,a,r?r(n.value,a):n.value))}}function zx(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ix(e,n,()=>t[n]):Lx(e,n,r.value))}}function Bx(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Vx(e){return JSON.stringify(e)}function Hx(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ux=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Wx(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Gx=Ax(()=>{if(HS.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Kx(e){if(Wx(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Wx(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function qx(e){return Kx(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Jx=new Set([`string`,`number`,`symbol`]);function Yx(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Xx(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Zx(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Qx(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function $x(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var eS={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tS={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function nS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Rx(i,e,rS(e,t)),Xx(e,Bx(n,{shape:i,checks:[]}))}function rS(e,t){let n=Fx(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function iS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(rS(e,t)),a={};return Rx(a,e,Reflect.ownKeys(Fx(e)).filter(e=>!i.has(e))),Xx(e,Bx(n,{shape:a,checks:[]}))}function aS(e,t){if(!Kx(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Fx(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Xx(e,Bx(e._zod.def,{shape:oS(e,t)}))}function oS(e,t){let n={};return Rx(n,e,Reflect.ownKeys(Fx(e))),zx(n,t),n}function sS(e,t){if(!Kx(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Xx(e,Bx(e._zod.def,{shape:oS(e,t)}))}function cS(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Rx(n,e,Reflect.ownKeys(Fx(e))),Rx(n,t,Reflect.ownKeys(Fx(t))),Xx(e,Bx(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function lS(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(rS(t,n)):void 0,o={};return Rx(o,t,Reflect.ownKeys(Fx(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Xx(t,Bx(t._zod.def,{shape:o,checks:[]}))}function uS(e,t,n){let r=n?new Set(rS(t,n)):void 0,i={};return Rx(i,t,Reflect.ownKeys(Fx(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Xx(t,Bx(t._zod.def,{shape:i}))}function dS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function fS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function pS(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function mS(e){return typeof e==`string`?e:e?.message}function hS(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function gS(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function _S(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:mS(e.inst?._zod.def?.error?.(e))??mS(a?.(e))??mS(t?.error?.(e))??mS(n.customError?.(e))??mS(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var vS=/[\uD800-\uDBFF]/;function yS(e){let t=e.length;if(!vS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function bS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function xS(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function SS(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function CS(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):DS(e,n,r.value)}}function wS(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function TS(e,t,n){return wS(e,t,n,!1)}function ES(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return wS(this,n,r(this))},set(e){wS(this,n,e)}})}return t}function DS(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:wS(this,t,n.bind(this))},set(e){wS(this,t,e)}})}function OS(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var kS,AS=!1,jS={configurable:!0,get(){AS=!0}};function MS(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&kS!==e._zod?kS=void 0:(kS=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,jS);let e=AS;AS=!1;try{let r=n(this);return AS?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),AS||=e,r}catch(n){throw delete this[t],AS||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function NS(e,t,n,r){let i=OS(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var PS=`~constantCatch`;function FS(e){let t=()=>e;return t[PS]=!0,t}var IS,LS={value:void 0,enumerable:!1},RS=`captureStackTrace`in Error?Error:null;function zS(e){let t=RS;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return RS=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){LS.value=new a(r);try{Object.defineProperty(n,"_zod",LS)}finally{LS.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),CS(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?zS(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var BS=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},VS=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(IS=globalThis).__zod_globalConfig??(IS.__zod_globalConfig={});var HS=globalThis.__zod_globalConfig;function US(e){return e&&Object.assign(HS,e),HS}function WS(){let e=this._zod;return e.message??=JSON.stringify(e.def,Ox,2),e.message}function GS(e){this._zod.message=e}var KS={get:WS,set:GS,enumerable:!0,configurable:!0},qS={value:void 0,enumerable:!1},JS=new WeakSet([Object.prototype,Error.prototype]),YS=$(`$ZodError`,(e,t)=>{e.name=`$ZodError`,qS.value=t,Object.defineProperty(e,"issues",qS),qS.value=void 0,Object.defineProperty(e,"message",KS);let n=Object.getPrototypeOf(e);JS.has(n)||(JS.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function XS(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ZS(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?XS(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function QS(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function $S(e,t){return{callee:t?.callee??e,Err:t?.Err}}var eC=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new BS;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>_S(e,o,US())));throw Ux(n,a?.callee??t),n}return s.value};return t},tC=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>_S(e,o,US())));throw Ux(n,a?.callee??t),n}return s.value};return t},nC=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new BS;return a.issues.length?rC(e,a.issues,i):{success:!0,data:a.value}};function rC(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>_S(e,n,US()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var iC=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?rC(e,a.issues,i):{success:!0,data:a.value}},aC=Symbol.for(`zod.compile.invalid`),oC=Symbol.for(`zod.compile.fallback`),sC=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==aC)return!0;if(r.definite===!0&&n===void 0)return!1}return cC(e,t,n)});function cC(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[oC]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new BS;return a.issues.length===0}var lC=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},uC=e=>{let t=eC(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,$S(n,a))};return n},dC=e=>{let t=eC(e),n=(e,r,i,a)=>t(e,r,i,$S(n,a));return n},fC=e=>{let t=tC(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,$S(n,a))};return n},pC=e=>{let t=tC(e),n=async(e,r,i,a)=>await t(e,r,i,$S(n,a));return n},mC=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return nC(e)(t,n,i)},hC=e=>(t,n,r)=>nC(e)(t,n,r),gC=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return iC(e)(t,n,i)},_C=e=>async(t,n,r)=>iC(e)(t,n,r),vC=/^[cC][0-9a-z]{6,}$/,yC=/^[0-9a-z]+$/,bC=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,xC=/^[0-9a-vA-V]{20}$/,SC=/^[A-Za-z0-9]{27}$/,CC=/^[a-zA-Z0-9_-]{21}$/;function wC(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var TC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,EC=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,DC=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,OC=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kC=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function AC(){return new RegExp(kC,`u`)}var jC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,MC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,NC=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,PC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,FC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,IC=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,LC=/^https?$/,RC=/^\+[1-9]\d{6,14}$/,zC=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function BC(e){return RegExp(`^${e}$`)}var VC=BC(zC);function HC(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function UC(e){return RegExp(`^${HC(e)}$`)}function WC(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${HC({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${HC({precision:e.precision})}`:n;return RegExp(`^${zC}T(?:${r})$`)}var GC=/^[\s\S]{0,}$/,KC=/^(?:true|false)$/i,qC=/^[^A-Z]*$/,JC=/^[^a-z]*$/,YC=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),XC=e=>{let t=e.value;return!jx(t)&&t.length!==void 0},ZC=$(`$ZodCheckMaxLength`,(e,t)=>{var n;YC.init(e,t),(n=e._zod.def).when??(n.when=XC),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?yS(r):i)<=t.maximum)return;let a=bS(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),QC=$(`$ZodCheckMinLength`,(e,t)=>{var n;YC.init(e,t),(n=e._zod.def).when??(n.when=XC),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?yS(r):i)>=t.minimum)return;let a=bS(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$C=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;YC.init(e,t),(n=e._zod.def).when??(n.when=XC),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?yS(r):i;if(a===t.length)return;let o=bS(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ew=$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;YC.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),tw=$(`$ZodCheckRegex`,(e,t)=>{ew.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nw=$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=qC,ew.init(e,t)}),rw=$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=JC,ew.init(e,t)}),iw=$(`$ZodCheckIncludes`,(e,t)=>{YC.init(e,t);let n=Yx(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),aw=$(`$ZodCheckStartsWith`,(e,t)=>{YC.init(e,t);let n=RegExp(`^${Yx(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ow=$(`$ZodCheckEndsWith`,(e,t)=>{YC.init(e,t);let n=RegExp(`.*${Yx(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),sw=$(`$ZodCheckOverwrite`,(e,t)=>{YC.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),cw=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
10
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
11
+ `)}\n};`)(...Object.values(this.closed))}},lw={major:4,minor:6,patch:7},uw=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lw;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=dS(t),a;for(let o of n){if(o._zod.def.when){if(fS(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new BS;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(gS(t.issues,n,e),i||=dS(t,n))});else{if(t.issues.length===n)continue;gS(t.issues,n,e),i||=dS(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(dS(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new BS;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new BS;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return TS(this,`~standard`,pw(this))},set"~standard"(e){wS(this,`~standard`,e)}}),dw=(e,t)=>e.issues.length?{issues:e.issues.map(e=>_S(e,t,US()))}:{value:e.value};async function fw(e,t){let n={async:!0};return dw(await e._zod.run({value:t,issues:[]},n),n)}function pw(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return dw(r,n)}catch{}return fw(e,t)},vendor:`zod`,version:1}}var mw=$(`$ZodString`,(e,t)=>{uw.init(e,t),e._zod.pattern=t.pattern??GC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),hw=$(`$ZodStringFormat`,(e,t)=>{ew.init(e,t),mw.init(e,t)}),gw=$(`$ZodGUID`,(e,t)=>{t.pattern??=EC,hw.init(e,t)}),_w=$(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=DC(e)}else t.pattern??=DC();hw.init(e,t)}),vw=$(`$ZodEmail`,(e,t)=>{t.pattern??=OC,hw.init(e,t)});function yw(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function bw(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?yw(e)||2:xw(e,t)}function xw(e,t){if(!t.normalize&&t.protocol?.source===LC.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Sw=/[\t\n\r]/g;function Cw(e){return e.replace(Sw,``)}function ww(e,t){return t.lastIndex=0,t.test(e.hostname)}function Tw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Ew=$(`$ZodURL`,(e,t)=>{hw.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=bw(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Cw(r);return}t.hostname&&!ww(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Tw(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Cw(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Dw=$(`$ZodEmoji`,(e,t)=>{t.pattern??=AC(),hw.init(e,t)}),Ow=$(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?CC:wC(t.length),hw.init(e,t)}),kw=$(`$ZodCUID`,(e,t)=>{t.pattern??=vC,hw.init(e,t)}),Aw=$(`$ZodCUID2`,(e,t)=>{t.pattern??=yC,hw.init(e,t)}),jw=$(`$ZodULID`,(e,t)=>{t.pattern??=bC,hw.init(e,t)}),Mw=$(`$ZodXID`,(e,t)=>{t.pattern??=xC,hw.init(e,t)}),Nw=$(`$ZodKSUID`,(e,t)=>{t.pattern??=SC,hw.init(e,t)}),Pw=$(`$ZodISODateTime`,(e,t)=>{t.pattern??=WC(t),hw.init(e,t)}),Fw=$(`$ZodISODate`,(e,t)=>{t.pattern??=VC,hw.init(e,t)}),Iw=$(`$ZodISOTime`,(e,t)=>{t.pattern??=UC(t),hw.init(e,t)}),Lw=$(`$ZodISODuration`,(e,t)=>{t.pattern??=TC,hw.init(e,t)}),Rw=$(`$ZodIPv4`,(e,t)=>{t.pattern??=jC,hw.init(e,t)}),zw=/^[0-9a-fA-F:.]+$/;function Bw(e){return zw.test(e)?yw(`http://[${e}]`):!1}var Vw=$(`$ZodIPv6`,(e,t)=>{t.pattern??=MC,hw.init(e,t),e._zod.check=n=>{Bw(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Hw=$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=NC,hw.init(e,t)});function Uw(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Bw(n)}var Ww=$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=PC,hw.init(e,t),e._zod.check=n=>{Uw(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Gw(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Kw=/^[0-9a-zA-Z+/]*={0,2}$/,qw=$(`$ZodBase64`,(e,t)=>{t.pattern??=Kw,hw.init(e,t),e._zod.check=n=>{Gw(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Jw=/^[A-Za-z0-9_-]*$/;function Yw(e){if(!Jw.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Gw(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Xw=$(`$ZodBase64URL`,(e,t)=>{t.pattern??=Jw,hw.init(e,t),e._zod.check=n=>{Yw(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Zw=$(`$ZodE164`,(e,t)=>{t.pattern??=RC,hw.init(e,t)});function Qw(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var $w=$(`$ZodJWT`,(e,t)=>{hw.init(e,t),e._zod.check=n=>{Qw(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),eT=$(`$ZodBoolean`,(e,t)=>{uw.init(e,t),e._zod.pattern=KC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),tT=$(`$ZodUnknown`,(e,t)=>{uw.init(e,t),e._zod.parse=e=>e}),nT=$(`$ZodNever`,(e,t)=>{uw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function rT(e,t){let n=hS(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of hS(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,gS(n.issues,t,e),n}}return i(n,a)}}var iT=e=>Array.isArray(e)?e.length:-1;function aT(e,t,n){e.issues.length&&t.issues.push(...pS(n,e.issues)),t.value[n]=e.value}var oT=$(`$ZodArray`,(e,t)=>{uw.init(e,t);let n=HS.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>aT(t,r,e)));else if(aT(c,r,e),s&&c.issues.length!==0&&dS(c))break}return o.length?Promise.all(o).then(()=>r):r},rT(e,iT)});function sT(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...pS(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var cT=[];function lT(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:cT,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=$x(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function uT(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(dS(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>sT(e,n,i,t,d,f))):sT(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var dT=$(`$ZodObject`,(e,t)=>{uw.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Ax(()=>lT(t));MS(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Nx(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Wx,o=t.catchall,s,c=HS.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(dS(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>sT(n,t,e,r,a,o))):sT(s,t,e,r,a,o)}return o?uT(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),fT=$(`$ZodObjectJIT`,(e,t)=>{dT.init(e,t);let n=e._zod.parse,r=Ax(()=>lT(t)),i=HS.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new cw([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
12
+ let ${e}_ab = false;
13
+ for (let i = 0; i < ${e}.issues.length; i++) {
14
+ const iss = ${e}.issues[i];
15
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
16
+ payload.issues.push(iss);
17
+ if (iss.continue !== true) ${e}_ab = true;
18
+ }
19
+ if (${e}_ab && ctx && ctx.abortEarly) {
20
+ payload.value = newResult;
21
+ return payload;
22
+ }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Vx(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
23
+ const ${n}_present = ${i};
24
+ if (!${n}.issues.length || ${n}_present) {
25
+ if (${n}.issues.length) {${c(n,r)}
26
+ }
27
+
28
+ if (${e}) {
29
+ newResult[${r}] = ${n}.value;
30
+ }
31
+ }
32
+
33
+ `)}else f?(o.write(`
34
+ if (${n}.issues.length) {${c(n,r)}
35
+ }
36
+ `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
37
+ if (${n}.value !== undefined || ${i}) {
38
+ newResult[${r}] = ${n}.value;
39
+ }
40
+ `)):o.write(`
41
+ const ${n}_present = ${i};
42
+ if (${n}.issues.length) {${c(n,r)}
43
+ }
44
+ if (!${n}_present && !${n}.issues.length) {
45
+ payload.issues.push({
46
+ code: "invalid_type",
47
+ expected: "nonoptional",
48
+ input: undefined,
49
+ path: [${r}]
50
+ });
51
+ if (ctx && ctx.abortEarly) {
52
+ payload.value = newResult;
53
+ return payload;
54
+ }
55
+ }
56
+
57
+ if (${n}_present) {
58
+ newResult[${r}] = ${n}.value;
59
+ }
60
+
61
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Wx,c=!HS.jitless,l=c&&Gx.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?uT([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function pT(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!dS(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>_S(e,r,US())))}),t)}var mT=$(`$ZodUnion`,(e,t)=>{uw.init(e,t),MS(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),MS(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),MS(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),MS(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Mx(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>pT(t,r,e,i)):pT(o,r,e,i)}}),hT=$(`$ZodIntersection`,(e,t)=>{uw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>_T(e,t,n)):_T(e,i,a)}});function gT(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Kx(e)&&Kx(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=gT(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=gT(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _T(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=gT(t.value,n.value);if(!c.valid){if(dS(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var vT=$(`$ZodEnum`,(e,t)=>{uw.init(e,t);let n=Ex(t.entries),r=new Set(n);e._zod.values=r,MS(e,`pattern`,e=>{let t=Ex(e.def.entries).filter(e=>Jx.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Yx(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),yT=$(`$ZodLiteral`,(e,t)=>{uw.init(e,t);let n=new Set(t.values);e._zod.values=n,MS(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Yx(e):e?Yx(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),bT=$(`$ZodTransform`,(e,t)=>{uw.init(e,t),e._zod.optin=`optional`,HS.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new VS(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new BS;return n.value=i,n}});function xT(e,t){return e.value=t.issues.length?void 0:t.value,e}var ST=$(`$ZodOptional`,(e,t)=>{uw.init(e,t),MS(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,MS(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),MS(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Mx(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>xT(e,t)):xT(e,r)}return t.innerType._zod.run(e,n)}}),CT=$(`$ZodExactOptional`,(e,t)=>{ST.init(e,t),MS(e,`values`,e=>e.def.innerType._zod.values),MS(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),wT=$(`$ZodNullable`,(e,t)=>{uw.init(e,t),MS(e,`optin`,e=>e.def.innerType._zod.optin),MS(e,`optout`,e=>e.def.innerType._zod.optout),MS(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Mx(t.source)}|null)$`):void 0}),MS(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),TT=$(`$ZodDefault`,(e,t)=>{uw.init(e,t),e._zod.optin=`defaulted`,MS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ET(e,t)):ET(r,t)}});function ET(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var DT=$(`$ZodPrefault`,(e,t)=>{uw.init(e,t),e._zod.optin=`defaulted`,MS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),OT=$(`$ZodNonOptional`,(e,t)=>{uw.init(e,t),MS(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>kT(t,e)):kT(i,e)}});function kT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function AT(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>_S(e,r,US()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var jT=$(`$ZodCatch`,(e,t)=>{uw.init(e,t),MS(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),MS(e,`optout`,e=>e.def.innerType._zod.optout),MS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>AT(e,r,t,n)):AT(e,r,t,n)}}),MT=$(`$ZodPipe`,(e,t)=>{uw.init(e,t),MS(e,`values`,e=>e.def.in._zod.values),MS(e,`optin`,e=>e.def.in._zod.optin),MS(e,`optout`,e=>e.def.out._zod.optout),MS(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>NT(e,t.in,n)):NT(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>NT(e,t.out,n)):NT(r,t.out,n)}});function NT(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var PT=$(`$ZodReadonly`,(e,t)=>{uw.init(e,t),MS(e,`propValues`,e=>e.def.innerType._zod.propValues),MS(e,`values`,e=>e.def.innerType._zod.values),MS(e,`optin`,e=>e.def.innerType?._zod?.optin),MS(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(FT):FT(r)}});function FT(e){return e.memo||(e.value=Object.freeze(e.value)),e}var IT=$(`$ZodCustom`,(e,t)=>{YC.init(e,t),uw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>LT(t,n,r,e));LT(i,n,r,e)}});function LT(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(SS(e))}}var RT=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},zT=`~memo`,BT=[];function VT(e){return typeof e==`object`&&!!e}function HT(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var UT=new WeakMap,WT=0,GT=1,KT=2;function qT(e,t,n){let r=UT.get(e);if(r!==void 0)return r?KT:WT;if(t.has(e))return KT;t.add(e);let i=WT,a=e=>{if(i!==KT&&e?._zod){let r=qT(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=WT;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?GT:o.value?._zod?qT(o.value,t,n):WT;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Px(c);s(e?o(e,!0):GT),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?qT(r,t,!1):GT);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),JT(e,i)}function JT(e,t){return t!==GT&&UT.set(e,t===KT),t}function YT(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var XT,ZT=[],QT={alloc(e,t,n){let r=XT;if(!r)return n;XT=void 0;let i={value:n,issues:null};return r.set(t.value,i),ZT.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&eE(n,e.value))throw new RT;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=qT(e,new Set,!1);if(i===WT)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===KT||r?n=!0:r=!0}let l=s.value;if(!VT(l))return t(s,c);let u=c[zT];u||(u={buckets:new WeakMap,backEdges:void 0},c[zT]=u);let d;i===c?d=a:(d=YT(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...HT(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;XT=d;let p=ZT.length,m=t(s,c);XT=void 0;let h=ZT.length>p?ZT.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?HT(e.issues):BT),e)):(h&&(h.issues=m.issues.length?HT(m.issues):BT),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function $T(){return QT}function eE(e,t){let n=e[zT]?.backEdges;return n!==void 0&&VT(t)&&n.has(t)}var tE=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(xS(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Qx(e.values[0])}`:`Invalid option: expected one of ${Dx(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Dx(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function oee(){return{localeError:tE()}}var nE,see=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function cee(){return new see}(nE=globalThis).__zod_globalRegistry??(nE.__zod_globalRegistry=cee());var rE=globalThis.__zod_globalRegistry;function lee(e){return e.checks&&=[...e.checks],e}function uee(e,t){return new e(lee({type:`string`,...Zx(t)}))}function dee(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Zx(t)})}function fee(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Zx(t)})}function pee(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Zx(t)})}function mee(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Zx(t)})}function hee(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Zx(t)})}function gee(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Zx(t)})}function _ee(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Zx(t)})}function vee(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Zx(t)})}function yee(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Zx(t)})}function bee(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Zx(t)})}function xee(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Zx(t)})}function See(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Zx(t)})}function Cee(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Zx(t)})}function wee(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Zx(t)})}function Tee(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Zx(t)})}function Eee(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Zx(t)})}function Dee(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Zx(t)})}function Oee(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Zx(t)})}function kee(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Zx(t)})}function Aee(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Zx(t)})}function jee(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Zx(t)})}function Mee(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Zx(t)})}function Nee(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Zx(t)})}function Pee(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Zx(t)})}function Fee(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Zx(t)})}function Iee(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Zx(t)})}function Lee(e,t){return new e({type:`boolean`,...Zx(t)})}function Ree(e){return new e({type:`unknown`})}function zee(e,t){return new e({type:`never`,...Zx(t)})}function iE(e,t){return new ZC({check:`max_length`,...Zx(t),maximum:e})}function aE(e,t){return new QC({check:`min_length`,...Zx(t),minimum:e})}function oE(e,t){return new $C({check:`length_equals`,...Zx(t),length:e})}function Bee(e,t){return new tw({check:`string_format`,format:`regex`,...Zx(t),pattern:e})}function Vee(e){return new nw({check:`string_format`,format:`lowercase`,...Zx(e)})}function Hee(e){return new rw({check:`string_format`,format:`uppercase`,...Zx(e)})}function Uee(e,t){return new iw({check:`string_format`,format:`includes`,...Zx(t),includes:e})}function Wee(e,t){return new aw({check:`string_format`,format:`starts_with`,...Zx(t),prefix:e})}function Gee(e,t){return new ow({check:`string_format`,format:`ends_with`,...Zx(t),suffix:e})}function sE(e){return new sw({check:`overwrite`,tx:e})}function Kee(e){return sE(t=>t.normalize(e))}function cE(){return sE(e=>e.trim())}function lE(){return sE(e=>e.toLowerCase())}function uE(){return sE(e=>e.toUpperCase())}function dE(){return sE(e=>Hx(e))}function fE(e,t,n){return new e({type:`array`,element:t,...Zx(n)})}function pE(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Zx(n)})}function mE(e,t){let n=hE(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(SS(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(SS(r))}},e(t.value,t)),t);return n}function hE(e,t){let n=new YC({check:`custom`,...Zx(t)});return n._zod.check=e,n}function gE(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Nx(e,t,n[t]);return e}function _E(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??rE,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function vE(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function yE(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,yE(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&gE(o.schema,c),t.io===`input`&&kE(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function bE(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function xE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${bE(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+bE(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
62
+
63
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function SE(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;SE(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var CE=new Set([`type`,`properties`,`required`,`additionalProperties`]),wE=[`oneOf`,`anyOf`];function TE(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function EE(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!CE.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??TE(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Nx(n,r,e.length===1?e[0]:EE(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=TE(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function DE(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of CE)if(t in e)return;let n=t.filter(e=>wE.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=EE(t);else{let e=n[0],i=wE.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>EE([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,gE(e,r))}function OE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):gE(i,s),gE(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())SE(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])DE(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}gE(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Nx(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:jE(t,`input`,e.processors),output:jE(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function kE(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return kE(r.element,n);if(r.type===`set`)return kE(r.valueType,n);if(r.type===`lazy`)return kE(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return kE(r.innerType,n);if(r.type===`intersection`)return kE(r.left,n)||kE(r.right,n);if(r.type===`record`||r.type===`map`)return kE(r.keyType,n)||kE(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:kE(r.in,n)||kE(r.out,n);if(r.type===`object`){for(let e in r.shape)if(kE(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(kE(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(kE(e,n))return!0;return!!(r.rest&&kE(r.rest,n))}return!1}var AE=(e,t={})=>n=>{let r=_E({...n,processors:t});return yE(e,r),xE(r,e),OE(r,e)},jE=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=_E({...i??{},target:a,io:t,processors:n});return yE(e,o),xE(o,e),OE(o,e)},ME=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},NE=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},PE=(e,t)=>{ME(e,`minimum`,t),NE(e,`maximum`,t)},FE=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},IE=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},LE=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},RE=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},zE=(e,t)=>ME(e,`minimum`,t.minimum),BE=(e,t)=>NE(e,`maximum`,t.maximum),VE=e=>(t,n)=>{RE(t,n.format);let[r,i]=e[n.format];ME(t,`minimum`,r),NE(t,`maximum`,i)},HE={greater_than:(e,t)=>ME(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>NE(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>FE(e,t.value),number_format:VE(eS),bigint_format:VE(tS),min_length:zE,max_length:BE,length_equals:(e,t)=>PE(e,t.length),min_size:zE,max_size:BE,size_equals:(e,t)=>PE(e,t.size),string_format:(e,t)=>{RE(e,t.format),t.pattern&&IE(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>LE(e,t.mime)};function UE(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)HE[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ME(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ME(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&NE(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&NE(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&FE(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&LE(t,i.mime);for(let e of i.patterns??[])IE(t,e);return t}var WE={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},GE=new Map([[Kw,FC],[Jw,IC]]),KE=e=>GE.get(e)??e,qE=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=UE(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=WE[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(KE);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},JE=(e,t,n,r)=>{n.type=`boolean`},YE=(e,t,n,r)=>{n.not={}},XE=(e,t,n,r)=>{let i=e._zod.def,a=Ex(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},ZE=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(vE(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(vE(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},QE=(e,t,n,r)=>{vE(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},$E=(e,t,n,r)=>{vE(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},eD=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=UE(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=yE(a.element,t,{...r,path:[...r.path,`items`]})};function tD(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?tD(t.out):t.type===`catch`?tD(t.innerType):e._zod.optin}var nD=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&vE(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Nx(i.properties,e,yE(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?tD(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=yE(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},rD=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>yE(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},iD=(e,t,n,r)=>{let i=e._zod.def,a=yE(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=yE(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},aD=(e,t,n,r)=>{let i=e._zod.def,a=yE(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},oD=(e,t,n,r)=>{let i=e._zod.def;yE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},sD=Symbol();function cD(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(vE(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),sD):JSON.parse(o)}var lD=(e,t,n,r)=>{let i=e._zod.def;yE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=cD(i.defaultValue,e,t,n,r);o!==sD&&(n.default=o)},uD=(e,t,n,r)=>{let i=e._zod.def;yE(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=cD(i.defaultValue,e,t,n,r);o!==sD&&(n._prefault=o)},dD=(e,t,n,r)=>{let i=e._zod.def;yE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{vE(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},fD=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;yE(o,t,r);let s=t.seen.get(e);s.ref=o},pD=(e,t,n,r)=>{let i=e._zod.def;yE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},mD=(e,t,n,r)=>{let i=e._zod.def;yE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},hD=new WeakSet([Object.prototype,Error.prototype]);function gD(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var _D=$(`ZodError`,(e,t)=>{YS.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);hD.has(n)||(hD.add(n),gD(n,`format`,e=>t=>QS(e,t)),gD(n,`flatten`,e=>t=>ZS(e,t)),gD(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ox,2)}),gD(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ox,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),vD=eC(_D),yD=tC(_D),bD=nC(_D),xD=iC(_D),SD=uC(_D),CD=dC(_D),wD=fC(_D),TD=pC(_D),ED=mC(_D),DD=hC(_D),OD=gC(_D),kD=_C(_D);function AD(){HS.localeError||US(oee())}function jD(){HS.memoizer||US({memoizer:$T()})}var MD=$(`ZodType`,(e,t)=>(AD(),uw.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Bx(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Xx(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(KO(e,t))},superRefine(e,t){return this.check(qO(e,t))},overwrite(e){return this.check(sE(e))},optional(){return OO(this)},exactOptional(){return AO(this)},nullable(){return MO(this)},nullish(){return OO(MO(this))},nonoptional(e){return RO(this,e)},array(){return pO(this)},or(e){return vO([this,e])},and(e){return bO(this,e)},transform(e){return HO(this,EO(e))},default(e){return PO(this,e)},prefault(e){return IO(this,e)},catch(e){return BO(this,e)},pipe(e){return HO(this,e)},readonly(){return WO(this)},describe(e){let t=this.clone();return rE.add(t,{description:e}),t},meta(...e){if(e.length===0)return rE.get(this);let t=this.clone();return rE.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return TS(this,`~standard`,{...pw(this),jsonSchema:{input:jE(this,`input`),output:jE(this,`output`)}})},set"~standard"(e){wS(this,`~standard`,e)},parse:function e(t,n){return vD(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await yD(this,t,n,{callee:e})},safeParse(e,t){return bD(this,e,t)},async safeParseAsync(e,t){return xD(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){wS(this,`spa`,e)},validate(e,t){return sC(this,e,t)},validateAsync(e,t){return lC(this,e,t)},encode:function e(t,n){return SD(this,t,n,{callee:e})},decode:function e(t,n){return CD(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await wD(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await TD(this,t,n,{callee:e})},safeEncode(e,t){return ED(this,e,t)},safeDecode(e,t){return DD(this,e,t)},async safeEncodeAsync(e,t){return OD(this,e,t)},async safeDecodeAsync(e,t){return kD(this,e,t)},toJSONSchema(e){return AE(this,{})(e)},get description(){return rE.get(this)?.description},get _def(){return this._zod.def}}),ND=$(`_ZodString`,(e,t)=>{mw.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qE(e,t,n,r)},ES({format:e=>UE(e).format??null,minLength:e=>UE(e).minimum??null,maxLength:e=>UE(e).maximum??null},{regex(...e){return this.check(Bee(...e))},includes(...e){return this.check(Uee(...e))},startsWith(...e){return this.check(Wee(...e))},endsWith(...e){return this.check(Gee(...e))},min(...e){return this.check(aE(...e))},max(...e){return this.check(iE(...e))},length(...e){return this.check(oE(...e))},nonempty(...e){return this.check(aE(1,...e))},lowercase(e){return this.check(Vee(e))},uppercase(e){return this.check(Hee(e))},trim(){return this.check(cE())},normalize(...e){return this.check(Kee(...e))},toLowerCase(){return this.check(lE())},toUpperCase(){return this.check(uE())},slugify(){return this.check(dE())}})),PD=$(`ZodString`,(e,t)=>{mw.init(e,t),ND.init(e,t)},{email(e){return this.check(dee(VD,e))},url(e){return this.check(_ee(WD,e))},jwt(e){return this.check(Mee(aO,e))},emoji(e){return this.check(vee(GD,e))},guid(e){return this.check(fee(HD,e))},uuid(e){return this.check(pee(UD,e))},uuidv4(e){return this.check(mee(UD,e))},uuidv6(e){return this.check(hee(UD,e))},uuidv7(e){return this.check(gee(UD,e))},nanoid(e){return this.check(yee(KD,e))},cuid(e){return this.check(bee(qD,e))},cuid2(e){return this.check(xee(JD,e))},ulid(e){return this.check(See(YD,e))},base64(e){return this.check(kee(nO,e))},base64url(e){return this.check(Aee(rO,e))},xid(e){return this.check(Cee(XD,e))},ksuid(e){return this.check(wee(ZD,e))},ipv4(e){return this.check(Tee(QD,e))},ipv6(e){return this.check(Eee($D,e))},cidrv4(e){return this.check(Dee(eO,e))},cidrv6(e){return this.check(Oee(tO,e))},e164(e){return this.check(jee(iO,e))},datetime(e){return this.check(Nee(LD,e))},date(e){return this.check(Pee(RD,e))},time(e){return this.check(Fee(zD,e))},duration(e){return this.check(Iee(BD,e))}});function FD(e){return uee(PD,e)}var ID=$(`ZodStringFormat`,(e,t)=>{hw.init(e,t),ND.init(e,t)}),LD=$(`ZodISODateTime`,(e,t)=>{Pw.init(e,t),ID.init(e,t)}),RD=$(`ZodISODate`,(e,t)=>{Fw.init(e,t),ID.init(e,t)}),zD=$(`ZodISOTime`,(e,t)=>{Iw.init(e,t),ID.init(e,t)}),BD=$(`ZodISODuration`,(e,t)=>{Lw.init(e,t),ID.init(e,t)}),VD=$(`ZodEmail`,(e,t)=>{vw.init(e,t),ID.init(e,t)}),HD=$(`ZodGUID`,(e,t)=>{gw.init(e,t),ID.init(e,t)}),UD=$(`ZodUUID`,(e,t)=>{_w.init(e,t),ID.init(e,t)}),WD=$(`ZodURL`,(e,t)=>{Ew.init(e,t),ID.init(e,t)}),GD=$(`ZodEmoji`,(e,t)=>{Dw.init(e,t),ID.init(e,t)}),KD=$(`ZodNanoID`,(e,t)=>{Ow.init(e,t),ID.init(e,t)}),qD=$(`ZodCUID`,(e,t)=>{kw.init(e,t),ID.init(e,t)}),JD=$(`ZodCUID2`,(e,t)=>{Aw.init(e,t),ID.init(e,t)}),YD=$(`ZodULID`,(e,t)=>{jw.init(e,t),ID.init(e,t)}),XD=$(`ZodXID`,(e,t)=>{Mw.init(e,t),ID.init(e,t)}),ZD=$(`ZodKSUID`,(e,t)=>{Nw.init(e,t),ID.init(e,t)}),QD=$(`ZodIPv4`,(e,t)=>{Rw.init(e,t),ID.init(e,t)}),$D=$(`ZodIPv6`,(e,t)=>{Vw.init(e,t),ID.init(e,t)}),eO=$(`ZodCIDRv4`,(e,t)=>{Hw.init(e,t),ID.init(e,t)}),tO=$(`ZodCIDRv6`,(e,t)=>{Ww.init(e,t),ID.init(e,t)}),nO=$(`ZodBase64`,(e,t)=>{qw.init(e,t),ID.init(e,t)}),rO=$(`ZodBase64URL`,(e,t)=>{Xw.init(e,t),ID.init(e,t)}),iO=$(`ZodE164`,(e,t)=>{Zw.init(e,t),ID.init(e,t)}),aO=$(`ZodJWT`,(e,t)=>{$w.init(e,t),ID.init(e,t)}),oO=$(`ZodBoolean`,(e,t)=>{eT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JE(e,t,n,r)});function sO(e){return Lee(oO,e)}var cO=$(`ZodUnknown`,(e,t)=>{tT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function lO(){return Ree(cO)}var uO=$(`ZodNever`,(e,t)=>{nT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YE(e,t,n,r)});function dO(e){return zee(uO,e)}var fO=$(`ZodArray`,(e,t)=>{jD(),oT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eD(e,t,n,r),e.element=t.element},{min(e,t){return this.check(aE(e,t))},nonempty(e){return this.check(aE(1,e))},max(e,t){return this.check(iE(e,t))},length(e,t){return this.check(oE(e,t))},unwrap(){return this.element}});function pO(e,t){return fE(fO,e,t)}var mO=$(`ZodObject`,(e,t)=>{jD(),fT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nD(e,t,n,r),NS(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return SO(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Bx(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Bx(this._zod.def,{catchall:lO()}))},loose(){return this.clone(Bx(this._zod.def,{catchall:lO()}))},strict(){return this.clone(Bx(this._zod.def,{catchall:dO()}))},strip(){return this.clone(Bx(this._zod.def,{catchall:void 0}))},extend(e){return aS(this,e)},safeExtend(e){return sS(this,e)},merge(e){return cS(this,e)},pick(e){return nS(this,e)},omit(e){return iS(this,e)},partial(...e){return lS(DO,this,e[0])},exactPartial(...e){return lS(kO,this,e[0],`exactPartial`)},required(...e){return uS(LO,this,e[0])}});function hO(e,t){return new mO({type:`object`,shape:e??{},...Zx(t)})}function gO(e,t){return new mO({type:`object`,shape:e,catchall:lO(),...Zx(t)})}var _O=$(`ZodUnion`,(e,t)=>{mT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rD(e,t,n,r),e.options=t.options});function vO(e,t){return new _O({type:`union`,options:e,...Zx(t)})}var yO=$(`ZodIntersection`,(e,t)=>{hT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iD(e,t,n,r)});function bO(e,t){return new yO({type:`intersection`,left:e,right:t})}var xO=$(`ZodEnum`,(e,t)=>{vT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XE(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new xO({...t,checks:[],...Zx(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new xO({...t,checks:[],...Zx(r),entries:i})}});function SO(e,t){return new xO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Zx(t)})}var CO=$(`ZodLiteral`,(e,t)=>{yT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZE(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function wO(e,t){return new CO({type:`literal`,values:Array.isArray(e)?e:[e],...Zx(t)})}var TO=$(`ZodTransform`,(e,t)=>{jD(),bT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$E(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new VS(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(SS(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(SS(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function EO(e){return new TO({type:`transform`,transform:e})}var DO=$(`ZodOptional`,(e,t)=>{ST.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function OO(e){return new DO({type:`optional`,innerType:e})}var kO=$(`ZodExactOptional`,(e,t)=>{CT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function AO(e){return new kO({type:`optional`,innerType:e})}var jO=$(`ZodNullable`,(e,t)=>{wT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function MO(e){return new jO({type:`nullable`,innerType:e})}var NO=$(`ZodDefault`,(e,t)=>{TT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function PO(e,t){return new NO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():qx(t)}})}var FO=$(`ZodPrefault`,(e,t)=>{DT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function IO(e,t){return new FO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():qx(t)}})}var LO=$(`ZodNonOptional`,(e,t)=>{OT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function RO(e,t){return new LO({type:`nonoptional`,innerType:e,...Zx(t)})}var zO=$(`ZodCatch`,(e,t)=>{jT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BO(e,t){return new zO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:FS(t)})}var VO=$(`ZodPipe`,(e,t)=>{MT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fD(e,t,n,r),e.in=t.in,e.out=t.out});function HO(e,t){return new VO({type:`pipe`,in:e,out:t})}var UO=$(`ZodReadonly`,(e,t)=>{PT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function WO(e){return new UO({type:`readonly`,innerType:e})}var GO=$(`ZodCustom`,(e,t)=>{IT.init(e,t),MD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QE(e,t,n,r)});function KO(e,t={}){return pE(GO,e,t)}function qO(e,t){return mE(e,t)}var JO=gO({frame:FD(),session:FD(),agent:FD(),tag:FD(),claimedAt:FD(),expiresAt:FD()});function YO(e,t){return t===e||t.startsWith(`${e}/`)}gO({version:wO(1),claims:pO(JO)});var XO=class extends Error{reason;constructor(e){super(`The waiting edit was ${e}.`),this.reason=e,this.name=`WaitDropped`}},ZO=1e3,QO=N()(()=>({edits:[]})),$O=new Set,ek=1;function tk(){return F(QO,e=>e.edits)}function nk(e,t,{live:n=Qg,replace:r,dropWhen:i}){r&&sk(e,r);let a=()=>Object.values(n.getState().claims).filter(t=>e.some(e=>YO(e,t.frame))),o=a();return o.length===0?null:ok({label:t,refs:e,replace:r,dropWhen:i,live:n,holders:o.map(({frame:e,tag:t,claimedAt:n})=>({frame:e,tag:t,claimedAt:n})),ready:()=>n.getState().connected&&a().length===0})}function rk(e,t,{live:n=Qg,replace:r,dropWhen:i}={}){let{frame:a,tag:o,claimedAt:s,expiresAt:c}=e.details;if(typeof a!=`string`)return Promise.reject(e);let l={frame:a,tag:typeof o==`string`?o:a,claimedAt:typeof s==`string`?s:new Date().toISOString()},u=typeof c==`string`?Date.parse(c):NaN,d=Date.now(),f=!1;return r&&sk([a],r),ok({label:t,refs:[a],replace:r,dropWhen:i,live:n,holders:[l],ready:()=>{let{claims:e,connected:t}=n.getState();if(a in e&&(f=!0),!t||a in e)return!1;let r=Date.now();return f||r>=u||r-d>=2e3}})}async function ik(e,t,n,r={}){let i=nk(e,t,r);for(i&&await i;;)try{return await n()}catch(e){if(!(e instanceof wx)||e.code!==`frame-claimed`)throw e;await rk(e,t,r)}}function ak(){for(let e of[...$O])ck(e,new XO(`cancelled`))}function ok({label:e,refs:t,replace:n,dropWhen:r,live:i,holders:a,ready:o}){return new Promise((s,c)=>{let l={id:ek++,label:e,holders:a},u=()=>{r?.(i.getState())?ck(p,new XO(`cancelled`)):o()&&(ck(p),s())},d=i.subscribe(u),f=setInterval(u,ZO),p={edit:l,refs:t,replace:n,reject:c,stop:()=>{d(),clearInterval(f)}};$O.add(p),QO.setState(e=>({edits:[...e.edits,l]})),u()})}function sk(e,t){for(let n of[...$O])n.replace===t&&n.refs.every(t=>e.includes(t))&&ck(n,new XO(`replaced`))}function ck(e,t){$O.delete(e)&&(e.stop(),QO.setState(t=>({edits:t.edits.filter(t=>t!==e.edit)})),t&&e.reject(t))}function lk(e=fetch){let t=(t,n)=>Tx(t,n,`POST`,e),n=(e,n,r,i)=>ik(e,n,()=>t(r,i));return{addProject:e=>t(`/api/project/add`,{name:e}),renameProject:(e,n)=>t(`/api/project/rename`,{ref:e,name:n}),duplicateProject:e=>t(`/api/project/duplicate`,{ref:e}),deleteProject:e=>t(`/api/project/delete`,{ref:e}),projectTokens:(e,n)=>t(`/api/project/tokens`,{ref:e,...n}),addPage:(e,n)=>t(`/api/page/add`,{ref:e,index:n}),duplicatePage:e=>t(`/api/page/duplicate`,{ref:e}),renamePage:(e,t)=>n([e],`rename`,`/api/page/rename`,{ref:e,name:t}),movePage:(e,n)=>t(`/api/page/move`,{ref:e,index:n}),deletePage:e=>n([e],`delete`,`/api/page/delete`,{ref:e}),addFrame:(e,n,r,i)=>t(`/api/frame/add`,{ref:e,...n,x:r,y:i}),duplicateFrames:(e,n)=>t(`/api/frame/duplicate`,{refs:e,offset:n}),renameFrame:(e,t)=>n([e],`rename`,`/api/frame/rename`,{ref:e,name:t}),fitFrame:e=>n([e],`resize`,`/api/frame/fit`,{ref:e}),orderFrame:(e,n)=>t(`/api/frame/order`,{ref:e,index:n}),flagFrames:(e,n,r)=>t(`/api/frame/flag`,{refs:e,flag:n,on:r}),deleteFrames:e=>n(e,`delete`,`/api/frame/delete`,{refs:e}),copyFrames:e=>t(`/api/clipboard/copy`,{refs:e}),cutFrames:e=>n(e,`cut`,`/api/clipboard/cut`,{refs:e}),pasteFrames:(e,n)=>t(`/api/clipboard/paste`,{ref:e,at:n}),addSection:(e,n,r)=>t(`/api/section/add`,{page:e,name:r,box:n}),renameSection:(e,n,r)=>t(`/api/section/rename`,{page:e,section:n,name:r}),deleteSection:(e,n)=>t(`/api/section/delete`,{page:e,section:n}),undo:()=>t(`/api/undo`,{}),redo:()=>t(`/api/redo`,{})}}var uk=lk();function dk(e,t){return e.toLowerCase()===t.toLowerCase()}function fk(e,t){let n=new Set([...t].map(e=>e.toLowerCase()));if(!n.has(e.toLowerCase()))return e;for(let t=2;;t++){let r=`${e}-${t}`;if(!n.has(r.toLowerCase()))return r}}var pk=N()(()=>({ref:null}));function mk(){return F(pk,e=>e.ref)}function hk(e){pk.setState({ref:e})}function gk(){pk.setState({ref:null})}function _k(e){return t=>{t instanceof XO||_g.add({title:e,description:t instanceof Error?t.message:String(t),type:`error`})}}function vk(e){for(let t=e.length+1;;t++){let n=`page-${t}`;if(!e.some(e=>dk(e,n)))return n}}async function yk(e,t,{current:n,navigate:r,calls:i=uk}){try{let a=await i.renamePage(e.ref,t);e.name===n&&r(p_(e.project,a.name))}catch(t){_k(`Couldn't rename ${e.name}`)(t)}}async function bk(e,t,{current:n,navigate:r,calls:i=uk}){let a=t.filter(t=>t.ref!==e.ref),o=a[e.index]??a[e.index-1];try{await i.deletePage(e.ref)}catch(t){_k(`Couldn't delete ${e.name}`)(t);return}e.name===n&&r(o?p_(e.project,o.name):`/p/${encodeURIComponent(e.project)}`)}function xk(e,t,n=uk){let[,r]=Na();(0,_.useEffect)(()=>{let i=()=>Qg.getState().board?.projects.find(t=>t.name===e)?.pages??[],a=()=>i().find(e=>e.name===t),o=()=>Qg.getState().canWrite,s=()=>o()&&a()!==void 0,c=e=>r(p_(e.project,e.name)),l=ye([{id:`page.new`,label:`Add page`,group:`page`,command:{label:`Add page`,icon:gn},enabled:o,run:()=>{let t=i().map(e=>e.name),r=a();n.addPage(`${e}/${vk(t)}`,r?r.index+1:void 0).then(e=>{c(e),hk(e.ref)},_k(`Couldn't add a page`))}},{id:`page.duplicate`,label:`Duplicate page`,group:`page`,command:{label:`Duplicate page`,icon:rn},enabled:s,run:()=>{let e=a();e&&n.duplicatePage(e.ref).then(c,_k(`Couldn't duplicate ${e.name}`))}},{id:`page.rename`,label:`Rename page`,group:`page`,command:{label:`Rename page`,icon:Or},enabled:s,run:()=>{let e=a();e&&hk(e.ref)}},...[{id:`page.moveUp`,label:`Move up`,named:`Move page up`,by:-1,icon:_t},{id:`page.moveDown`,label:`Move down`,named:`Move page down`,by:1,icon:lt}].map(({id:e,label:t,named:r,by:o,icon:c})=>({id:e,label:t,group:`page`,command:{label:r,icon:c},enabled:()=>{let e=a(),t=e?e.index+o:-1;return s()&&t>=0&&t<i().length},run:()=>{let e=a();e&&n.movePage(e.ref,e.index+o).catch(_k(`Couldn't move ${e.name}`))}})),...[{id:`page.next`,label:`Next page`,by:1,icon:Nt},{id:`page.previous`,label:`Previous page`,by:-1,icon:Lt}].map(({id:e,label:t,by:n,icon:r})=>{let o=()=>{let e=a();return i().find(t=>e&&t.index===e.index+n)};return{id:e,label:t,group:`page`,command:{label:t,icon:r,keywords:[`go to`,`open`]},enabled:()=>o()!==void 0,run:()=>{let e=o();e&&c(e)}}}),{id:`page.delete`,label:`Delete page`,group:`page`,command:{label:`Delete page`,icon:Pi},enabled:s,run:()=>{let e=a();e&&bk(e,i(),{current:e.name,navigate:r,calls:n})}}]),u=Qg.subscribe((e,t)=>{(e.canWrite!==t.canWrite||e.board!==t.board)&&G()});return()=>{u(),l()}},[e,t,r,n])}var Sk=`frameboard.home.pins`;function Ck(){return(0,_.useSyncExternalStore)(jk,wk,wk)}function wk(){let e=Mk();return e!==Ok.raw&&(Ok={raw:e,pins:Pk(e)}),Ok.pins}function Tk(e){let t=new Set(wk());t.delete(e)||t.add(e),Nk(t)}function Ek(e,t){let n=new Set(wk());n.delete(e)&&Nk(n.add(t))}function Dk(e){let t=new Set(wk());t.delete(e)&&Nk(t)}var Ok={raw:null,pins:new Set},kk=null,Ak=new Set;function jk(e){return Ak.add(e),()=>Ak.delete(e)}function Mk(){if(kk!==null)return kk;try{return localStorage.getItem(Sk)}catch{return null}}function Nk(e){let t=JSON.stringify([...e]);try{localStorage.setItem(Sk,t),kk=null}catch{kk=t}for(let e of Ak)e();G()}function Pk(e){try{let t=JSON.parse(e??`[]`);return new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`):[])}catch{return new Set}}var Fk=N()(()=>({focused:null,renaming:null}));function Ik(e){return F(Fk,t=>t.renaming?.project===e?t.renaming:null)}function Lk(e){Fk.getState().focused!==e&&(Fk.setState({focused:e}),G())}function Rk(e){Fk.setState({renaming:{project:e,draft:e,refusal:null,attempt:0}})}function zk(){Fk.setState({renaming:null})}function Bk({name:e,pages:t}){let n=t[0];return n?p_(e,n.name):`/p/${encodeURIComponent(e)}`}async function Vk(e,t,n=uk){Fk.setState(({renaming:e})=>({renaming:e&&{...e,draft:t}}));try{await n.renameProject(e,t)}catch(t){return t instanceof wx&&t.code===`invalid-name`?(Fk.setState(({renaming:e})=>({renaming:e&&{...e,refusal:t.message,attempt:e.attempt+1}})),null):(zk(),_k(`Couldn't rename ${e}`)(t),null)}return Ek(e,t),zk(),Lk(t),t}function Hk(){return Fk.getState().focused}function Uk(e){(0,_.useEffect)(()=>ye([{id:`nav.home`,label:`All projects`,group:`project`,command:{label:`Go to all projects`,icon:Mn},keys:[`Alt+ArrowUp`],run:e}]),[e])}function Wk(e=uk,t){(0,_.useEffect)(()=>{let n=ye([{id:`project.new`,label:`New project`,group:`project`,command:{label:`New project`,icon:Sn},enabled:()=>Qg.getState().canWrite,run:()=>{t?.(),e.addProject().then(e=>{Lk(e.name),Rk(e.name)},_k(`Couldn't add a project`))}}]),r=Qg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&G()});return()=>{r(),n()}},[e,t])}function Gk(e,{calls:t=uk,onDeleted:n}={}){let[,r]=Na();(0,_.useEffect)(()=>{let i=()=>Qg.getState().canWrite,a=()=>{let t=e();return Qg.getState().board?.projects.find(e=>e.name===t)},o=()=>i()&&a()!==void 0,s=()=>a()?.name??``,c=ye([{id:`project.open`,label:`Open`,group:`project`,palette:!1,enabled:()=>a()!==void 0,run:()=>{let e=a();e&&r(Bk(e))}},{id:`project.rename`,label:`Rename`,group:`project`,command:{label:`Rename project`,icon:Or,hint:s},enabled:o,run:()=>{let e=a();e&&Rk(e.name)}},{id:`project.duplicate`,label:`Duplicate`,group:`project`,command:{label:`Duplicate project`,icon:rn,hint:s},enabled:o,run:()=>{let e=a();e&&t.duplicateProject(e.name).then(e=>Lk(e.name),_k(`Couldn't duplicate ${e.name}`))}},{id:`project.pin`,label:`Pin`,group:`project`,command:{label:`Pin project`,icon:Mr,hint:s},enabled:()=>a()!==void 0,checked:()=>wk().has(e()??``),run:()=>{let e=a();e&&Tk(e.name)}},{id:`project.delete`,label:`Delete`,group:`project`,command:{label:`Delete project`,icon:Pi,hint:s},enabled:o,run:()=>{let e=a();e&&t.deleteProject(e.name).then(()=>{Dk(e.name),n?.()},_k(`Couldn't delete ${e.name}`))}}]),l=Qg.subscribe((e,t)=>{(e.canWrite!==t.canWrite||e.board!==t.board)&&G()});return()=>{l(),c(),Fk.setState({focused:null,renaming:null})}},[t,r,e,n])}var Kk=[`all`,`images`,`video`,`fonts`,`other`],qk={all:`All`,images:`Images`,video:`Video`,fonts:`Fonts`,other:`Other`};function Jk(e){switch(e){case`image`:case`gif`:case`svg`:return`images`;case`video`:return`video`;case`font`:return`fonts`;default:return`other`}}function Yk(e){return Kk.map(t=>({chip:t,count:t===`all`?e.length:e.filter(e=>Jk(e.kind)===t).length})).filter(({chip:e,count:t})=>e===`all`||t>0)}function Xk(e,{chip:t,search:n}){let r=n.trim().toLowerCase(),i=new Map;for(let n of e){if(t!==`all`&&Jk(n.kind)!==t||r!==``&&!n.path.toLowerCase().includes(r))continue;let e=Zk(n.path),a=i.get(e);a?a.push(n):i.set(e,[n])}return[...i].map(([e,t])=>({folder:e,files:t})).sort((e,t)=>$k(e.folder,t.folder))}function Zk(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Qk(e){return e.slice(e.lastIndexOf(`/`)+1)}function $k(e,t){return e===``||t===``?e===``?t===``?0:-1:1:e.toLowerCase().localeCompare(t.toLowerCase())}async function eA(e){let t=await(await fetch(`/api/projects/${encodeURIComponent(e)}/assets`)).json();return t.ok?t.data:null}function tA(e){if(Array.isArray(e))return e}function nA(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function rA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iA(e,t){if(e){if(typeof e==`string`)return rA(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rA(e,t):void 0}}function aA(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
64
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oA(e,t){return tA(e)||nA(e,t)||iA(e,t)||aA()}var sA=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),cA=o(((e,t,n)=>{var r=n&&n.__assign||function(){return r=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},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var i=sA();function a(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function o(e,t){return t==null?e:r(r({},e),{options:r(r({},a(t)),a(e.options))})}function s(e,t,n){var r=t.map(function(t){var r=o(t,n);return(0,i.bind)(e,r)});return function(){r.forEach(function(e){return e()})}}e.bindAll=s})),lA=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=sA();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=cA();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),uA=`data-pdnd-honey-pot`;function dA(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function fA(e){var t=oA(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?dA(n)?r??null:n:null}function pA(e){"@babel/helpers - typeof";return pA=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},pA(e)}function mA(e,t){if(pA(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(pA(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hA(e){var t=mA(e,`string`);return pA(t)==`symbol`?t:t+``}function gA(e,t,n){return(t=hA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _A=2147483647,vA={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function yA(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var bA=yA(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function xA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xA(Object(n),!0).forEach(function(t){gA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var CA=2,wA=CA/2;function TA(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function EA(e){return{x:e.x-wA,y:e.y-wA}}function DA(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function OA(e){return{x:Math.min(e.x,window.innerWidth-CA),y:Math.min(e.y,window.innerHeight-CA)}}function kA(e){var t=e.client,n=OA(DA(EA(TA(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:CA,height:CA})}function AA(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function jA(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function MA(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(uA,`true`),bA()&&n.setAttribute(`popover`,`manual`);var r=kA({client:t});Object.assign(n.style,SA(SA({position:`fixed`},bA()?vA:{zIndex:_A}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},AA({clientRect:r}))),document.body.appendChild(n),bA()&&n.showPopover();var i=(0,lA.bind)(window,{type:`pointermove`,listener:function(e){r=kA({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,AA({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),jA({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,lA.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function NA(){var e=null;function t(){return e=null,(0,lA.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=MA({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function PA(e){if(Array.isArray(e))return rA(e)}function FA(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function IA(){throw TypeError(`Invalid attempt to spread non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LA(e){return PA(e)||FA(e)||iA(e)||IA()}var RA=yA(function(){return navigator.userAgent.includes(`Firefox`)}),zA=yA(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)});function BA(e){return`nodeName`in e}function VA(e){return BA(e)&&e.ownerDocument!==document}var HA={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};(function(){if(typeof window>`u`||!zA())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,lA.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[HA.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[HA.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function UA(e){var t=e.dragLeave;return zA()?t.hasOwnProperty(HA.isLeavingWindow):!1}function WA(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?zA()?UA({dragLeave:t}):r==null?!0:RA()?VA(r):r instanceof HTMLIFrameElement:!1}function GA(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){e<20?e++:t()}}()},{type:`pointerdown`,listener:t}]}function KA(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var qA=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),JA=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function YA(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),JA.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;JA.flush(),qA.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;qA(function(){JA.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;JA.flush(),qA.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var XA={isActive:!1};function ZA(){return!XA.isActive}function QA(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function $A(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function ej(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!ZA())return;var a=nj({event:t,dragType:n,getDropTargetsOver:r});XA.isActive=!0;var o={current:a};tj({event:t,current:a.dropTargets});var s=YA({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=$A({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=KA(e),i=r({target:dA(e.target)?fA({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),tj({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){XA.isActive=!1,f()}var f=(0,lA.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){WA({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:KA(e)},o.current.dropTargets.length?(e.preventDefault(),tj({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()):u()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:KA(e)},u()}}].concat(LA(GA({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:QA(t)})}function tj(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function nj(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=KA(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var rj={canStart:ZA,start:ej},ij=new Map;function aj(e){var t=e.typeKey,n=e.mount,r=ij.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return ij.set(t,i),i}function oj(e){var t=aj(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),ij.delete(e.typeKey))}}function sj(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function cj(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function lj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lj(Object(n),!0).forEach(function(t){gA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=fj(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
66
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function fj(e,t){if(e){if(typeof e==`string`)return pj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pj(e,t):void 0}}function pj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mj(e){return e.slice(0).reverse()}function hj(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return yA(sj(cj(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(LA(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=dj(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=uj(uj({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=dj(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=uj(uj({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=dj(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=uj(uj({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=mj(a),l=mj(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null)u.push(m);else{var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(uj(uj({},p),{},{isActiveDueToStickiness:!0}))}}return mj(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function gj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=_j(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
67
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function _j(e,t){if(e){if(typeof e==`string`)return vj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vj(e,t):void 0}}function vj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yj(Object(n),!0).forEach(function(t){gA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xj(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=bj({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return yA(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=gj(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function Sj(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=xj(),s=hj({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;rj.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:rj.canStart,start:l})}return oj({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var Cj=yA(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),wj=`pdnd:android-fallback`,Tj=`text/plain`,Ej=`application/vnd.pdnd`,Dj=new WeakMap;function Oj(e){return Dj.set(e.element,e),function(){Dj.delete(e.element)}}var kj=NA(),Aj=Sj({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return sj(kj.bindEvents(),(0,lA.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=Dj.get(n);if(r){var i=KA(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a))t.preventDefault();else{if(r.dragHandle){var o=fA({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=oA(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}Cj()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(Tj,wj),t.dataTransfer.setData(Ej,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=Dj.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:kj.getOnPostDispatch()}),jj=Aj.dropTarget,Mj=Aj.monitor;function Nj(e){return yA(sj(Aj.registerUsage(),Oj(e),cj(e.element,{attribute:`draggable`,value:`true`})))}var Pj=[`image`,`gif`,`svg`,`video`];function Fj(e){return Pj.includes(e)}var Ij={image:`image`,gif:`GIF`,svg:`SVG`,video:`video`,audio:`audio`,font:`font`,stylesheet:`stylesheet`,script:`script`,other:`file`};function Lj(e){if(e<1e3)return`${e} B`;let t=Math.round(e/1e3);if(t<1e3)return`${t} KB`;let n=e/1e6;return n<1e3?`${Rj(n)} MB`:`${Rj(n/1e3)} GB`}function Rj(e){return e.toFixed(1).replace(/\.0$/,``)}function zj({kind:e,size:t}){return`${Ij[e]} · ${Lj(t)}`}function Bj(e){return Ij[e]}function Vj({frames:e}){return e===void 0?null:e===0?`Unused`:`${e} ${e===1?`frame`:`frames`}`}function Hj(e){return`../assets/${e.split(`/`).map(encodeURIComponent).join(`/`)}`}function Uj(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`/frames/${encodeURIComponent(e)}/assets/${n}`}function Wj(e){return Fj(e.kind)}var Gj=Symbol(`asset-tile`);function Kj(e){return{[Gj]:!0,...e}}function qj(e){let{project:t,path:n,kind:r}=e;return e[Gj]===!0&&typeof t==`string`&&typeof n==`string`&&Fj(r)?{project:t,path:n,kind:r}:null}var Jj=1500;function Yj({project:e,file:t}){let[n,r]=(0,_.useState)(`idle`),i=(0,_.useRef)(void 0);(0,_.useEffect)(()=>()=>clearTimeout(i.current),[]);let a=(0,_.useRef)(null),o=$g(e=>e.canWrite),{path:s,kind:c}=t,l=Vj(t);(0,_.useEffect)(()=>{let t=a.current;if(t&&o&&Fj(c))return Nj({element:t,getInitialData:()=>Kj({project:e,path:s,kind:c})})},[e,s,c,o]);async function u(){let e=`copied`;try{await navigator.clipboard.writeText(Hj(t.path))}catch{e=`failed`}r(e),clearTimeout(i.current),i.current=setTimeout(()=>r(`idle`),Jj)}return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{ref:a,type:`button`,onClick:()=>void u(),"aria-label":`Copy path of ${[t.path,Bj(c),Lj(t.size),l].filter(Boolean).join(`, `)}`,className:`group relative block w-full overflow-hidden rounded-lg bg-muted text-left outline-none hover:ring-[1.5px] hover:ring-primary focus-visible:ring-[1.5px] focus-visible:ring-primary`,children:[(0,X.jsx)($j,{project:e,file:t}),(0,X.jsx)(`span`,{"aria-live":`polite`,className:`absolute top-[5px] right-[5px] rounded-[5px] bg-card px-1.5 py-0.5 text-[10px] text-foreground shadow-[0_1px_3px_rgba(0,0,0,.3)] group-hover:visible group-focus-visible:visible ${n===`idle`?`invisible`:``}`,children:Zj[n]}),(0,X.jsxs)(`span`,{className:`block truncate px-[7px] py-[5px] text-label font-normal`,children:[(0,X.jsx)(`span`,{title:t.path,children:Qk(t.path)}),(0,X.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:l===null?zj(t):(0,X.jsxs)(X.Fragment,{children:[Bj(c),` ·`,` `,(0,X.jsx)(`span`,{className:t.frames===0?Xj:void 0,children:l})]})})]})]})})}var Xj=`text-[color-mix(in_oklab,var(--note)_70%,var(--foreground))]`,Zj={idle:`Copy path`,copied:`Copied`,failed:`Copy failed`},Qj=`grid h-[72px] place-items-center text-muted-foreground`;function $j({project:e,file:t}){switch(t.kind){case`image`:case`gif`:case`svg`:return(0,X.jsx)(`span`,{className:Qj,children:(0,X.jsx)(`img`,{src:Uj(e,t.path),alt:``,loading:`lazy`,decoding:`async`,className:`h-[72px] w-full object-cover`})});case`video`:return(0,X.jsx)(`span`,{className:`${Qj} bg-[#111] text-white`,children:(0,X.jsx)(Ir,{"aria-hidden":!0,className:`size-4`})});case`audio`:return(0,X.jsx)(`span`,{className:Qj,children:(0,X.jsx)(cn,{"aria-hidden":!0,className:`size-4`})});case`font`:return(0,X.jsx)(`span`,{className:`${Qj} text-[26px] text-foreground`,children:`Aa`});default:return(0,X.jsx)(`span`,{className:`${Qj} font-mono`,children:`{ }`})}}function eM(e,t){let n=new FormData;for(let e of t)n.append(`files`,e);return Tx(`/api/projects/${encodeURIComponent(e)}/assets`,n)}var tM=`font-mono text-label font-normal text-foreground`;function nM({project:e,load:t=eA,upload:n=eM}){let r=$g(e=>e.canWrite),[i,a]=(0,_.useState)(0),o=cM(e,t,i),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)([]),p=(0,_.useRef)(null),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(`all`),[y,b]=(0,_.useState)(new Set);async function x(t){if(r&&t.length!==0){u(!0);try{let r=await n(e,t);f(r.refused.map(e=>({id:crypto.randomUUID(),text:`${e.name}: ${e.message}`})))}catch(e){f([{id:crypto.randomUUID(),text:e instanceof Error?e.message:String(e)}])}finally{u(!1),a(e=>e+1)}}}function S(e){oM(e)&&(e.preventDefault(),c(!1),x(sM(e)))}if(o===void 0)return null;if(o===null)return(0,X.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The assets did not load. Reload the board to try again.`});let C=o.files.length,w=Yk(o.files),T=w.some(e=>e.chip===g)?g:`all`,E=Xk(o.files,{chip:T,search:m}),D=()=>{h(``),v(`all`)},O=e=>b(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,X.jsxs)(`div`,{"aria-busy":l,onDragEnter:e=>oM(e)&&c(!0),onDragOver:e=>{oM(e)&&(e.preventDefault(),c(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||c(!1)},onDrop:S,className:`flex h-full flex-col overflow-y-auto pb-2 ${s&&r?`bg-primary/5 ring-[1.5px] ring-primary ring-inset`:``}`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between pt-2.5 pr-1.5 pb-1 pl-3 text-label text-muted-foreground`,children:[(0,X.jsxs)(`h3`,{children:[`assets/ · `,C,` `,C===1?`file`:`files`]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Add files`,disabled:!r,onClick:()=>p.current?.click(),className:`grid size-5 place-items-center rounded-md outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 disabled:hover:bg-transparent`,children:(0,X.jsx)(Rr,{"aria-hidden":!0,className:`size-3.5`})}),(0,X.jsx)(`input`,{ref:p,type:`file`,multiple:!0,hidden:!0,"aria-label":`Choose files to add`,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,x(t)}})]}),C===0?(0,X.jsxs)(`p`,{className:`mx-3 my-1 text-muted-foreground`,children:[`No files in `,(0,X.jsx)(`code`,{className:tM,children:`assets/`}),` yet.`]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`mx-2 mt-1 mb-1.5 flex h-[26px] shrink-0 items-center gap-1.5 rounded-md bg-muted px-2 focus-within:ring-[1.5px] focus-within:ring-primary`,children:[(0,X.jsx)(ii,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`search`,"aria-label":`Search assets`,placeholder:`Search assets`,value:m,spellCheck:!1,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Escape`&&m!==``&&(e.preventDefault(),e.stopPropagation(),h(``))},className:`min-w-0 flex-1 bg-transparent text-label outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden`})]}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Filter by kind`,className:`flex flex-wrap gap-1 px-2 pb-1.5`,children:w.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":e.chip===T,onClick:()=>v(e.chip),className:`inline-flex h-6 min-w-6 items-center justify-center rounded-full px-2 text-[10px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 ${e.chip===T?`bg-foreground text-background`:`bg-muted text-muted-foreground hover:text-foreground`}`,children:[qk[e.chip],e.chip===`all`?null:` ${e.count}`]},e.chip))}),E.length===0?(0,X.jsxs)(`div`,{className:`mx-3 my-1 text-muted-foreground`,children:[(0,X.jsx)(`p`,{children:iM(m,T)}),(0,X.jsx)(`button`,{type:`button`,onClick:D,className:`mt-1 rounded-sm text-foreground underline underline-offset-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Clear filter`})]}):E.map(t=>(0,X.jsx)(rM,{group:t,project:e,open:!y.has(t.folder),onToggle:()=>O(t.folder)},t.folder))]}),(0,X.jsx)(`div`,{className:`m-2 rounded-[10px] border-[1.5px] border-dashed border-border p-3 text-center leading-normal text-muted-foreground`,children:r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:l?`Adding files…`:`Drop files here to add them.`}),(0,X.jsx)(`br`,{}),`A frame links one as`,` `,(0,X.jsx)(`code`,{className:tM,children:`../assets/hero.png`})]}):(0,X.jsxs)(X.Fragment,{children:[`This tab is read-only, so files cannot be added. Run`,` `,(0,X.jsx)(`code`,{className:tM,children:`frameboard open`}),` for a tab that can.`]})}),d.length>0?(0,X.jsx)(`ul`,{role:`alert`,className:`mx-3 text-destructive`,children:d.map(e=>(0,X.jsx)(`li`,{className:`leading-[1.45]`,children:e.text},e.id))}):null]})}function rM({group:e,project:t,open:n,onToggle:r}){let i=n?Nt:Ft,a=e.files.length;return(0,X.jsxs)(`section`,{"aria-label":e.folder===``?`assets/`:e.folder,children:[(0,X.jsx)(`h4`,{children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:r,className:`mx-1 flex items-center gap-1 rounded-md px-1.5 py-1 text-label font-semibold outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,X.jsx)(i,{"aria-hidden":!0,className:`size-3 text-muted-foreground`}),e.folder===``?`assets/`:e.folder,(0,X.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,a]})]})}),n?(0,X.jsx)(`ul`,{className:`grid grid-cols-2 gap-2 px-2 pt-0.5 pb-2`,children:e.files.map(e=>(0,X.jsx)(Yj,{project:t,file:e},e.path))}):null]})}function iM(e,t){let n=t===`all`?`files`:`${aM[t]} files`,r=e.trim();return r===``?`No ${n} here.`:`No ${n} match "${r}".`}var aM={images:`image`,video:`video`,fonts:`font`,other:`other`};function oM(e){return e.dataTransfer.types.includes(`Files`)}function sM(e){let{items:t,files:n}=e.dataTransfer,r=[];for(let[e,i]of[...n].entries())t[e]?.webkitGetAsEntry?.()?.isDirectory||r.push(i);return r}function cM(e,t,n){let r=$g(e=>e.board),[i,a]=(0,_.useState)();return(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&a(e)}),()=>{n=!1}},[e,r,t,n]),i}var lM=[`light`,`dark`],uM=`theme`,dM=`data-frameboard`;function fM(e){return e===`light`||e===`dark`}function pM(e,t){e.setAttribute(`data-theme`,t),e.style.colorScheme=t,e.classList.toggle(`dark`,t===`dark`),e.classList.toggle(`light`,t===`light`)}function mM(e){return e===`dark`?`light`:`dark`}function hM(e,t,n,r){let i=new URLSearchParams({[uM]:t});return n!==void 0&&i.set(`v`,String(n)),r!==void 0&&i.set(`at`,r),`${f_(e)}?${i}`}var gM=`frameboard.theme`;function _M(){return N()(()=>({choice:`system`,system:`light`,flipped:new Set}))}function vM({choice:e,system:t}){return e===`system`?t:e}function yM(e,t){let n=e=>{t.root.classList.toggle(`dark`,vM(e)===`dark`)},r=()=>{e.setState({system:t.media.matches?`dark`:`light`})};e.setState({choice:kM(t.storage)}),r(),n(e.getState()),t.media.addEventListener(`change`,r);let i=e.subscribe((e,r)=>{n(e),e.choice!==r.choice&&AM(t.storage,e.choice)});return()=>{i(),t.media.removeEventListener(`change`,r)}}function bM(e){let t;try{t=e.localStorage}catch{t=null}return{storage:t,media:e.matchMedia(`(prefers-color-scheme: dark)`),root:e.document.documentElement}}function xM(e,t=jM){t.setState({choice:e})}function SM(e=jM){e.setState({choice:mM(vM(e.getState()))})}function CM(e,t=jM){let n=new Set(t.getState().flipped);n.delete(e)||n.add(e),t.setState({flipped:n})}function wM(e,t,n=jM){let r=Object.fromEntries([...n.getState().flipped].map(e=>[e,!0]));n.setState({flipped:new Set(Object.keys(Ig(r,e,t)))})}function TM(e,t=jM){return OM(t.getState(),e)}function EM(e=jM){return F(e,vM)}function DM(e,t=jM){return F(t,t=>OM(t,e))}function OM(e,t){let n=vM(e);return e.flipped.has(t)?mM(n):n}function kM(e){try{let t=e?.getItem(gM);return fM(t)?t:`system`}catch{return`system`}}function AM(e,t){try{e?.setItem(gM,t)}catch{}}var jM=_M(),MM=2,NM=16384;function PM(e,t,n=navigator.clipboard){return n.write([new ClipboardItem({"image/png":zM(e,t)})])}function FM(e,t,n=fetch){return Tx(`/api/frames/clipboard`,{refs:e,theme:t},`POST`,n)}function IM(e,t=MM){let n=Math.min(...e.map(e=>e.x)),r=Math.min(...e.map(e=>e.y)),i=Math.max(...e.map(e=>e.x+e.width)),a=Math.max(...e.map(e=>e.y+e.height)),o=Math.min(t,NM/(i-n),NM/(a-r)),s=e=>Math.round(e*o);return{width:s(i-n),height:s(a-r),places:e.map(e=>({x:s(e.x-n),y:s(e.y-r),width:s(e.width),height:s(e.height)}))}}function LM(e,t,n,r=navigator.clipboard){let i=RM(e,t,n);return r.write([new ClipboardItem({"image/png":i})])}async function RM(e,t,n){let r=IM(e.map(e=>e.box)),i=await Promise.all(e.map(async e=>createImageBitmap(await zM(e.ref,t)))),a=new OffscreenCanvas(r.width,r.height),o=a.getContext(`2d`);if(!o)throw Error(`This browser has no 2D canvas to compose on.`);return o.fillStyle=n,o.fillRect(0,0,r.width,r.height),i.forEach((e,t)=>{let n=r.places[t];n&&o.drawImage(e,n.x,n.y,n.width,n.height),e.close()}),a.convertToBlob({type:`image/png`})}async function zM(e,t){let n=new URLSearchParams({ref:e,theme:t}),r=await fetch(`/api/frames/png?${n}`);if(!r.ok)throw Error(`The board answered ${r.status}.`);return r.blob()}var BM=null;function VM(){return BM}var HM=0;async function UM(e=fetch){let t=++HM,n=null;try{let t=await(await e(`/api/health`)).json();typeof t.clipboard==`string`&&(n=t.clipboard)}catch{}t===HM&&(BM=n)}var WM=N()(()=>({byRef:{}}));function GM(e){return F(WM,t=>t.byRef[e])}function KM(){return F(WM,e=>e.byRef)}function qM(e){return WM.getState().byRef[e]}function JM(){return WM.getState().byRef}function YM(e){return WM.subscribe(e)}function XM(e,t){let n=Math.max(1,Math.round(t));iN(e,e=>e?.width===n?e:{width:n})}function ZM(e){iN(e,()=>void 0)}function QM(e,t,n){iN([e],e=>!e||e.width!==t?e:n===null?e.height===void 0?e:{width:t}:e.height===n?e:{width:t,height:n})}function $M(e,t,n){if(!n)return t;let r=e.hugHeight&&n.height!==void 0?n.height:t.height;return{...t,width:n.width,height:r}}function eN(e,t){return e.map(e=>{let n=t[e.ref];return n?{...e,box:$M(e,e.box,n)}:e})}function tN(e){return eN(e,KM())}function nN(e){return e.subscribe((e,t)=>{e.board&&e.board!==t.board&&rN(e.board)})}function rN(e){let t=new Set(e.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.flatMap(e=>e.hidden?[]:[e.ref])))),{byRef:n}=WM.getState();ZM(Object.keys(n).filter(e=>!t.has(e)))}function iN(e,t){let{byRef:n}=WM.getState(),r={...n},i=!1;for(let a of e){let e=t(n[a]);e!==n[a]&&(i=!0,e?r[a]=e:delete r[a])}i&&WM.setState({byRef:r})}function aN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oN(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}var sN=2e3,cN=N()(()=>({byRef:{}}));function lN(e){return F(cN,t=>t.byRef[e]?.box)}function uN(e){return hN(e,F(cN,e=>e.byRef))}function dN(e){return hN(e,cN.getState().byRef)}function fN(e){return $M(e,lN(e.ref)??e.box,GM(e.ref))}function pN(e){return tN(uN(e))}function mN(e){return eN(dN(e),JM())}function hN(e,t){return e.map(e=>{let n=t[e.ref];return n?{...e,box:n.box}:e})}function gN(e){ZM(Object.keys(e)),CN(Object.keys(e),t=>{let n=e[t];return n&&{box:n}})}var _N=new Map;async function vN(e,t,n,r=fetch,i){if(Object.keys(t).length===0&&!i)return!0;ZM(Object.keys(t));let a={...t},o={...n},s={...i?.boxes},c={...i?.expected};for(let e of Object.keys(t)){let t=_N.get(e);if(t){for(let[e,n]of Object.entries(t.owner.sections?.boxes??{})){if(e in s)continue;s[e]=n;let r=t.owner.sections?.expected[e];r&&(c[e]=r)}for(let[e,n]of Object.entries(t.owner.boxes)){if(e in a)continue;a[e]=n;let t=_N.get(e)?.box;t&&(o[e]=t)}}}for(let e of Object.keys(a)){let t=_N.get(e)?.box;t&&(o[e]=t)}let l=Object.keys(a),u=new Map(Object.entries(a).map(([e,t])=>[e,{box:t}]));CN(l,e=>u.get(e));let d=()=>{let{byRef:e}=cN.getState();CN(l.filter(t=>e[t]===u.get(t)),()=>void 0)},f=Object.keys(s).length>0?{boxes:s,expected:c}:void 0,p={boxes:a,sections:f},m=()=>{for(let e of l){let t=o[e];t&&_N.set(e,{box:t,owner:p})}},h=()=>{for(let e of l)_N.get(e)?.owner===p&&_N.delete(e)};m();try{await ik(l,yN(a,o),async()=>{h();try{return await Tx(`/api/frames/boxes`,{page:e,boxes:wN(a),expected:wN(o),sections:f?.boxes,expectedSections:f?.expected},`POST`,r)}catch(e){throw m(),e}},{replace:`boxes`})}catch{return h(),d(),!1}return setTimeout(d,sN),!0}function yN(e,t){return Object.entries(e).some(([e,n])=>{let r=t[e];return r&&(r.width!==n.width||r.height!==n.height)})?`resize`:`move`}function bN(e){CN(e,()=>void 0)}function xN(e){return e.subscribe((e,t)=>{e.board&&e.board!==t.board&&SN(e.board)})}function SN(e){let t=new Map(e.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.map(e=>[e.ref,e.box])))),{byRef:n}=cN.getState(),r=Object.entries(n).filter(([e,n])=>{let r=t.get(e);return r!==void 0&&!aN(r,n.box)});r.length!==Object.keys(n).length&&cN.setState({byRef:Object.fromEntries(r)})}function CN(e,t){if(e.length===0)return;let n={...cN.getState().byRef};for(let r of e){let e=t(r);e?n[r]=e:delete n[r]}cN.setState({byRef:n})}function wN(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.slice(e.lastIndexOf(`/`)+1),t]))}var TN=[1,2,3],EN=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`both`,label:`Both themes`}],DN=N()(()=>({scale:2,theme:`both`}));function ON(e,{scale:t,theme:n}){return AN(n).map(n=>`${e}.${n}@${t}x.png`)}async function kN(e,t){let n=ON(e.name,t);(await jN(e.ref,AN(t.theme),t.scale)).forEach((e,t)=>NN(e,n[t]??``))}function AN(e){return e===`both`?lM:[e]}async function jN(e,t,n){let r=[];for(let i of t){let t=new URLSearchParams({ref:e,theme:i,scale:String(n)}),a=await fetch(`/api/frames/png?${t}`);if(!a.ok)throw Error(await MN(a));r.push(await a.blob())}return r}async function MN(e){let t=await e.json().catch(()=>null);return typeof t==`object`&&t&&`error`in t&&typeof t.error==`object`&&t.error!==null&&`message`in t.error&&typeof t.error.message==`string`?t.error.message:`The board answered ${e.status}.`}function NN(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}var PN={phone:{width:390,height:844},tablet:{width:834,height:1194},desktop:{width:1440,height:900}},FN={phone:{min:320,max:479},tablet:{min:480,max:1023},desktop:{min:1024,max:1/0}},IN=[{name:`small-phone`,label:`Small phone`,group:`phone`,width:375,height:667},{name:`iphone-16`,label:`iPhone 16`,group:`phone`,width:393,height:852},{name:`android`,label:`Android`,group:`phone`,width:412,height:917},{name:`iphone-16-pro-max`,label:`iPhone 16 Pro Max`,group:`phone`,width:440,height:956},{name:`ipad-mini`,label:`iPad mini`,group:`tablet`,width:744,height:1133},{name:`ipad-pro-12-9`,label:`iPad Pro 12.9`,group:`tablet`,width:1024,height:1366},{name:`macbook-air`,label:`MacBook Air`,group:`desktop`,width:1280,height:832},{name:`full-hd`,label:`Full HD`,group:`desktop`,width:1920,height:1080},{name:`slide-16-9`,label:`Slide 16:9`,group:`slide`,width:1920,height:1080},{name:`slide-4-3`,label:`Slide 4:3`,group:`slide`,width:1024,height:768},{name:`og-card`,label:`Open Graph`,group:`social`,width:1200,height:630},{name:`linkedin-post`,label:`LinkedIn post`,group:`social`,width:1200,height:627}];[...IN.map(e=>e.name)];var LN=`desktop`;function RN(e){return Object.hasOwn(PN,e)}function zN(e){let{width:t,height:n}=RN(e)?PN[e]:IN.find(t=>t.name===e)??PN.desktop;return{width:t,height:n}}function BN(e){return Object.keys(FN).filter(RN).find(t=>{let{min:n,max:r}=FN[t];return e>=n&&e<=r})}function VN(e,t){return BN(t)===e?t:PN[e].width}var HN=[{preset:`phone`,label:`Phone`,icon:fi},{preset:`tablet`,label:`Tablet`,icon:Si},{preset:`desktop`,label:`Desktop`,icon:mr}];function UN(e){let{min:t,max:n}=FN[e];return Number.isFinite(n)?`${t} to ${n}`:`${t} and up`}var WN=[...HN.map(({preset:e,label:t,icon:n})=>({group:e,label:t,icon:n,rows:[{name:e,label:t,...PN[e]},...GN(e)]})),{group:`slide`,label:`Slide`,icon:Br,rows:GN(`slide`)},{group:`social`,label:`Social`,icon:ui,rows:GN(`social`)}].map(e=>({...e,rows:e.rows.toSorted((e,t)=>e.width-t.width)}));function GN(e){return IN.filter(t=>t.group===e)}function KN(e,t){let n=zN(t),r={},i={};for(let{ref:t,box:a}of e)(a.width!==n.width||a.height!==n.height)&&(r[t]={...a,...n},i[t]=a);return{boxes:r,expected:i}}function qN({width:e,height:t}){for(let{rows:n}of WN){let r=n.find(n=>n.width===e&&n.height===t);if(r)return r}}function JN(e){return`new:${e}`}var YN=N()(()=>({open:null,drafts:{}}));function XN(e){return F(YN,e)}function ZN(e,t){YN.setState(({drafts:n})=>{let{[e]:r,...i}=n;return{drafts:t===``?i:{...i,[e]:t}}})}function QN(){YN.setState({open:null})}var $N=()=>Qg.getState().canWrite;function eP(){(0,_.useEffect)(()=>{let e=ye([{id:`tool.note`,label:`Note`,group:`tool`,command:{label:`Add a note`,icon:ur},keys:[`n`],enabled:$N,run:()=>c_.setState({tool:`note`,mode:`edit`}),checked:()=>c_.getState().mode===`edit`&&c_.getState().tool===`note`}]),t=Qg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(G(),!e.canWrite&&c_.getState().tool===`note`&&c_.setState({tool:`move`}),!e.canWrite&&YN.getState().open?.kind===`new`&&QN())}),n=c_.subscribe(e=>{let t=YN.getState().open;(e.mode===`play`||t?.kind===`new`&&e.tool!==`note`)&&QN()});return()=>{n(),t(),e(),c_.getState().tool===`note`&&c_.setState({tool:`move`}),YN.getState().open?.kind===`new`&&QN()}},[])}function tP(){return N()(()=>({page:null,frames:[]}))}function nP(e,t,n){e.setState({page:t,frames:[...new Set(n)],element:null,section:void 0})}function rP(e,t,n){e.setState({page:t,frames:[],element:null,section:n})}function iP(e,t,n){e.setState({page:t,frames:[n.frame],element:n,section:void 0})}function aP(e,t,n){let{page:r,frames:i}=e.getState();if(r!==t){nP(e,t,[n]);return}let a=i.includes(n)?i.filter(e=>e!==n):[...i,n];e.setState({page:a.length===0?null:t,frames:a,element:null,section:void 0})}function oP(e){let{page:t,frames:n,element:r,section:i}=e.getState();(t!==null||n.length!==0||r||i)&&e.setState({page:null,frames:[],element:null,section:void 0})}function sP(e,t,n){let{page:r,frames:i,element:a}=e.getState();if(r===null)return;let o=e=>Fg(e,t,n);e.setState({page:o(r),frames:i.map(o),element:a&&{...a,frame:o(a.frame)}})}function cP(e,t){let{page:n,frames:r,section:i}=e.getState();if(n===null)return;let a=t.projects.flatMap(e=>e.pages).find(e=>e.ref===n);if(i!==void 0){a?.sections.some(e=>e.name===i)||oP(e);return}let o=new Set(a?.frames.filter(e=>!e.hidden).map(e=>e.ref)),s=r.filter(e=>o.has(e));s.length!==r.length&&(s.length===0?oP(e):e.setState({frames:s,element:null}))}function lP(e,t,n,r){e.getState().page!==t&&oP(e);let i=n.getState().board;i&&cP(e,i);let a=n.subscribe((t,n)=>{t.board&&t.board!==n.board&&cP(e,t.board)}),o=r.subscribe(t=>{t.mode===`play`&&oP(e)});return()=>{o(),a()}}var uP=new Map;function dP(e){uP.set(e,(uP.get(e)??0)+1);let t=!1;return()=>{t||(t=!0,uP.set(e,(uP.get(e)??1)-1))}}var fP=new Map;function pP(e,t){let n=(fP.get(e)??[]).filter(e=>e!==t);fP.set(e,[...n,t].slice(-100))}function mP(e,t){return(uP.get(e)??0)>0||(uP.get(null)??0)>0||t!=null&&(fP.get(e)?.includes(t)??!1)}function hP(e,t){let{page:n,element:r}=e.getState();if(!n||!r||mP(r.frame))return;let i=t(r.frame);i!==null&&i!==r.hash&&nP(e,n,[r.frame])}function gP(e,t){let{page:n,element:r}=e.getState();if(!n||!r||mP(r.frame))return;let i=t(r.frame);i!==null&&i!==r.hash&&!mP(r.frame,i)&&nP(e,n,[r.frame])}var _P=tP();function vP(e){return F(_P,e)}var yP=2,bP=40,xP=200,SP=[{name:`left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`right`,key:`ArrowRight`,dx:1,dy:0},{name:`up`,key:`ArrowUp`,dx:0,dy:-1},{name:`down`,key:`ArrowDown`,dx:0,dy:1}];function CP(){(0,_.useEffect)(()=>{UM();let e=ye(TP()),t=c_.subscribe(G),n=_P.subscribe(G),r=b_.onAttach(G);return()=>{r(),n(),t(),e()}},[])}function wP(){let{page:e,frames:t}=_P.getState(),n=Qg.getState().board?.projects.flatMap(e=>e.pages).find(t=>t.ref===e)?.frames.filter(e=>t.includes(e.ref));return dN(n??[])}function TP(){let e=()=>c_.getState(),t=e=>c_.setState(e),n=e=>({...e,group:`view`,enabled:b_.attached}),r=t=>()=>b_.attached()&&e().mode===`edit`&&t(_P.getState().frames.length);return[{id:`tool.move`,label:`Move`,group:`tool`,command:{label:`Use the move tool`,icon:vr},keys:[`v`],run:()=>t({tool:`move`,mode:`edit`}),checked:()=>e().mode===`edit`&&e().tool===`move`},{id:`tool.hand`,label:`Hand`,group:`tool`,command:{label:`Use the hand tool`,icon:An,keywords:[`pan`]},keys:[`h`],run:()=>t({tool:`hand`,mode:`edit`}),checked:()=>e().mode===`edit`&&e().tool===`hand`},{id:`mode.edit`,label:`Edit`,group:`mode`,command:{label:`Switch to Edit`,icon:Ar},run:()=>t({mode:`edit`}),checked:()=>e().mode===`edit`},{id:`mode.play`,label:`Play`,group:`mode`,command:{label:`Switch to Play`,icon:Ir},run:()=>t({mode:`play`}),checked:()=>e().mode===`play`},{id:`mode.exitPlay`,label:`Exit Play`,group:`mode`,palette:!1,keys:[`Escape`],enabled:()=>e().mode===`play`,run:()=>{document.activeElement instanceof HTMLIFrameElement&&document.activeElement.blur(),t({mode:`edit`})}},{id:`tool.disarm`,label:`Back to Move`,group:`tool`,palette:!1,keys:[`Escape`],enabled:()=>e().mode===`edit`&&e().tool!==`move`&&YN.getState().open===null,run:()=>{let e=document.activeElement;e instanceof HTMLElement&&e.closest(`[role="toolbar"]`)&&e.blur(),t({tool:`move`})}},{id:`view.hideUi`,label:`Hide UI`,group:`view`,command:{label:`Hide UI`,icon:wr},keys:[`$mod+Backslash`],run:()=>t({hideUi:!e().hideUi}),checked:()=>e().hideUi},n({id:`view.zoomIn`,label:`Zoom in`,command:{label:`Zoom in`,icon:Qi},keys:[`$mod+Equal`],run:()=>b_.zoomBy(yP)}),n({id:`view.zoomOut`,label:`Zoom out`,command:{label:`Zoom out`,icon:ea},keys:[`$mod+Minus`],run:()=>b_.zoomBy(1/yP)}),n({id:`view.zoomToFit`,label:`Zoom to fit`,command:{label:`Zoom to fit`,icon:cr},keys:[`Shift+Digit1`],run:b_.fit}),{id:`view.zoomToSelection`,label:`Zoom to selection`,group:`view`,command:{label:`Zoom to selection`,icon:Qr},keys:[`Shift+Digit2`],enabled:r(e=>e>0),run:()=>b_.fitTo(wP().map(e=>e.box))},...SP.flatMap(({name:e,key:t,dx:n,dy:i})=>[{id:`view.pan.${e}`,label:`Pan ${e}`,group:`view`,palette:!1,keys:[t],enabled:r(e=>e===0),run:()=>b_.panBy(n*bP,i*bP)},{id:`view.pan.${e}Far`,label:`Pan ${e} further`,group:`view`,palette:!1,keys:[`Shift+${t}`],enabled:r(e=>e===0),run:()=>b_.panBy(n*xP,i*xP)}]),{id:`frame.copyPng`,label:`Copy as PNG`,group:`frame`,command:{label:`Copy as PNG`,icon:rn},keys:[`$mod+Shift+KeyC`],enabled:r(e=>e>0),run:()=>{let e=wP(),[t]=e;if(!t)return;if(e.length>1){EP(e);return}let n=TM(t.ref);PM(t.ref,n).then(()=>_g.add({title:`Copied ${t.name}`,description:`PNG on the clipboard, in the ${n} theme.`,type:`success`}),_k(`Couldn't copy ${t.name}`))}},{id:`frame.copyRef`,label:`Copy frame ref`,group:`frame`,command:{label:`Copy frame ref`,icon:Jn,hint:()=>{let{frames:e}=_P.getState();return e.length===1?e[0]??``:`${e.length} frames`},keywords:[`path`,`reference`,`agent`]},enabled:r(e=>e>0),run:()=>{let e=_P.getState().frames;navigator.clipboard.writeText(e.join(`
68
+ `)).then(()=>_g.add({title:e.length===1?`Copied the frame ref`:`Copied ${e.length} frame refs`,description:e.join(`, `),type:`success`}),_k(`Couldn't copy the frame ref`))}},{id:`frame.exportPng`,label:`Export as PNG`,group:`frame`,command:{label:`Export as PNG`,icon:on,hint:()=>{let{scale:e,theme:t}=DN.getState();return`${e}x · ${t===`both`?`both themes`:`${t} theme`}`},keywords:[`download`,`image`,`save`]},enabled:r(e=>e===1),run:()=>{let[e]=wP();if(!e)return;let t=DN.getState();_g.promise(kN(e,t),{loading:{title:`Exporting ${e.name}`,type:`loading`},success:{title:`Exported ${e.name}`,description:ON(e.name,t).join(` and `),type:`success`},error:t=>({title:`Couldn't export ${e.name}`,description:t instanceof Error?t.message:String(t),type:`error`})})}},...WN.flatMap(({rows:e})=>e).map(e=>({id:`frame.resizeTo.${e.name}`,label:`Resize to ${e.label}`,group:`frame`,command:{label:`Resize to ${e.label}`,icon:Jr,hint:()=>`${e.width} × ${e.height}`,keywords:[`size`,`device`],searchOnly:!0},enabled:()=>r(e=>e>0)()&&Qg.getState().canWrite&&wP().every(e=>!e.locked),run:()=>{let{page:t}=_P.getState();if(!t)return;let{boxes:n,expected:r}=KN(wP(),e.name);vN(t,n,r)}})),n({id:`view.zoom50`,label:`Zoom to 50%`,command:{label:`Zoom to 50%`,icon:ea},run:()=>b_.zoomTo(.5)}),n({id:`view.zoom100`,label:`Zoom to 100%`,command:{label:`Zoom to 100%`,icon:Qr,keywords:[`actual size`]},keys:[`Shift+Digit0`],run:()=>b_.zoomTo(1)}),n({id:`view.zoom200`,label:`Zoom to 200%`,command:{label:`Zoom to 200%`,icon:Qi},run:()=>b_.zoomTo(2)})]}function EP(e){let t=vM(jM.getState()),n=e.length;if(VM()!==null&&Qg.getState().canWrite){_g.promise(FM(e.map(e=>e.ref),t),{loading:{title:`Copying ${n} frames`,type:`loading`},success:{title:`Copied ${n} frames`,description:`${n} PNG files on the clipboard, in the ${t} theme.`,type:`success`},error:DP});return}let r=document.querySelector(`[data-canvas]`),i=r?getComputedStyle(r).backgroundColor:`white`;_g.promise(LM(e,t,i),{loading:{title:`Copying ${n} frames`,type:`loading`},success:{title:`Copied ${n} frames as one image`,description:`This system takes one image, so the frames are laid out as on the canvas.`,type:`success`},error:DP})}function DP(e){return{title:`Couldn't copy the frames`,description:e instanceof Error?e.message:String(e),type:`error`}}var OP={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function kP(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),OP.hasOwnProperty(t)?{space:OP[t],local:e}:e}function AP(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function jP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function MP(e){var t=kP(e);return(t.local?jP:AP)(t)}function NP(){}function PP(e){return e==null?NP:function(){return this.querySelector(e)}}function FP(e){typeof e!=`function`&&(e=PP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new CI(r,this._parents)}function IP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function LP(){return[]}function RP(e){return e==null?LP:function(){return this.querySelectorAll(e)}}function zP(e){return function(){return IP(e.apply(this,arguments))}}function BP(e){e=typeof e==`function`?zP(e):RP(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new CI(r,i)}function VP(e){return function(){return this.matches(e)}}function HP(e){return function(t){return t.matches(e)}}var UP=Array.prototype.find;function WP(e){return function(){return UP.call(this.children,e)}}function GP(){return this.firstElementChild}function KP(e){return this.select(e==null?GP:WP(typeof e==`function`?e:HP(e)))}var qP=Array.prototype.filter;function JP(){return Array.from(this.children)}function YP(e){return function(){return qP.call(this.children,e)}}function XP(e){return this.selectAll(e==null?JP:YP(typeof e==`function`?e:HP(e)))}function ZP(e){typeof e!=`function`&&(e=VP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new CI(r,this._parents)}function QP(e){return Array(e.length)}function $P(){return new CI(this._enter||this._groups.map(QP),this._parents)}function eF(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}eF.prototype={constructor:eF,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function tF(e){return function(){return e}}function nF(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new eF(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function rF(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new eF(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function iF(e){return e.__data__}function aF(e,t){if(!arguments.length)return Array.from(this,iF);var n=t?rF:nF,r=this._parents,i=this._groups;typeof e!=`function`&&(e=tF(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=oF(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new CI(o,r),o._enter=s,o._exit=c,o}function oF(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function sF(){return new CI(this._exit||this._groups.map(QP),this._parents)}function cF(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function lF(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new CI(s,this._parents)}function uF(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function dF(e){e||=fF;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new CI(i,this._parents).order()}function fF(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pF(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mF(){return Array.from(this)}function hF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function gF(){let e=0;for(let t of this)++e;return e}function _F(){return!this.node()}function vF(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function yF(e){return function(){this.removeAttribute(e)}}function bF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xF(e,t){return function(){this.setAttribute(e,t)}}function SF(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function CF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function wF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function TF(e,t){var n=kP(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?bF:yF:typeof t==`function`?n.local?wF:CF:n.local?SF:xF)(n,t))}function EF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function DF(e){return function(){this.style.removeProperty(e)}}function OF(e,t,n){return function(){this.style.setProperty(e,t,n)}}function kF(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function AF(e,t,n){return arguments.length>1?this.each((t==null?DF:typeof t==`function`?kF:OF)(e,t,n??``)):jF(this.node(),e)}function jF(e,t){return e.style.getPropertyValue(t)||EF(e).getComputedStyle(e,null).getPropertyValue(t)}function MF(e){return function(){delete this[e]}}function NF(e,t){return function(){this[e]=t}}function PF(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function FF(e,t){return arguments.length>1?this.each((t==null?MF:typeof t==`function`?PF:NF)(e,t)):this.node()[e]}function IF(e){return e.trim().split(/^|\s+/)}function LF(e){return e.classList||new RF(e)}function RF(e){this._node=e,this._names=IF(e.getAttribute(`class`)||``)}RF.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function zF(e,t){for(var n=LF(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function BF(e,t){for(var n=LF(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function VF(e){return function(){zF(this,e)}}function HF(e){return function(){BF(this,e)}}function UF(e,t){return function(){(t.apply(this,arguments)?zF:BF)(this,e)}}function WF(e,t){var n=IF(e+``);if(arguments.length<2){for(var r=LF(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?UF:t?VF:HF)(n,t))}function GF(){this.textContent=``}function KF(e){return function(){this.textContent=e}}function qF(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function JF(e){return arguments.length?this.each(e==null?GF:(typeof e==`function`?qF:KF)(e)):this.node().textContent}function YF(){this.innerHTML=``}function XF(e){return function(){this.innerHTML=e}}function ZF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function QF(e){return arguments.length?this.each(e==null?YF:(typeof e==`function`?ZF:XF)(e)):this.node().innerHTML}function $F(){this.nextSibling&&this.parentNode.appendChild(this)}function eI(){return this.each($F)}function tI(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nI(){return this.each(tI)}function rI(e){var t=typeof e==`function`?e:MP(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function iI(){return null}function aI(e,t){var n=typeof e==`function`?e:MP(e),r=t==null?iI:typeof t==`function`?t:PP(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function oI(){var e=this.parentNode;e&&e.removeChild(this)}function sI(){return this.each(oI)}function cI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lI(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uI(e){return this.select(e?lI:cI)}function dI(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function fI(e){return function(t){e.call(this,t,this.__data__)}}function pI(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function mI(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function hI(e,t,n){return function(){var r=this.__on,i,a=fI(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function gI(e,t,n){var r=pI(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?hI:mI,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function _I(e,t,n){var r=EF(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function vI(e,t){return function(){return _I(this,e,t)}}function yI(e,t){return function(){return _I(this,e,t.apply(this,arguments))}}function bI(e,t){return this.each((typeof t==`function`?yI:vI)(e,t))}function*xI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var SI=[null];function CI(e,t){this._groups=e,this._parents=t}function wI(){return new CI([[document.documentElement]],SI)}function TI(){return this}CI.prototype=wI.prototype={constructor:CI,select:FP,selectAll:BP,selectChild:KP,selectChildren:XP,filter:ZP,data:aF,enter:$P,exit:sF,join:cF,merge:lF,selection:TI,order:uF,sort:dF,call:pF,nodes:mF,node:hF,size:gF,empty:_F,each:vF,attr:TF,style:AF,property:FF,classed:WF,text:JF,html:QF,raise:eI,lower:nI,append:rI,insert:aI,remove:sI,clone:uI,datum:dI,on:gI,dispatch:bI,[Symbol.iterator]:xI};function EI(e){return typeof e==`string`?new CI([[document.querySelector(e)]],[document.documentElement]):new CI([[e]],SI)}function DI(e){let t;for(;t=e.sourceEvent;)e=t;return e}function OI(e,t){if(e=DI(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var kI={value:()=>{}};function AI(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new jI(n)}function jI(e){this._=e}function MI(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}jI.prototype=AI.prototype={constructor:jI,on:function(e,t){var n=this._,r=MI(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=NI(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=PI(n[i],e.name,t);else if(t==null)for(i in n)n[i]=PI(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new jI(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function NI(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function PI(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=kI,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var FI={passive:!1},II={capture:!0,passive:!1};function LI(e){e.stopImmediatePropagation()}function RI(e){e.preventDefault(),e.stopImmediatePropagation()}function zI(e){var t=e.document.documentElement,n=EI(e).on(`dragstart.drag`,RI,II);`onselectstart`in t?n.on(`selectstart.drag`,RI,II):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function BI(e,t){var n=e.document.documentElement,r=EI(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,RI,II),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var VI=e=>()=>e;function HI(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}HI.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function UI(e){return!e.ctrlKey&&!e.button}function WI(){return this.parentNode}function GI(e,t){return t??{x:e.x,y:e.y}}function KI(){return navigator.maxTouchPoints||`ontouchstart`in this}function qI(){var e=UI,t=WI,n=GI,r=KI,i={},a=AI(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,FI).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(EI(n.view).on(`mousemove.drag`,m,II).on(`mouseup.drag`,h,II),zI(n.view),LI(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(RI(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){EI(e.view).on(`mousemove.drag mouseup.drag`,null),BI(e.view,l),RI(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(LI(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(RI(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(LI(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=OI(l||r,t),p,m,h;if((h=n.call(e,new HI(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=OI(l||a,t),_=o}u.call(r,e,new HI(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:VI(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:VI(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:VI(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:VI(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function JI(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function YI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function XI(){}var ZI=.7,QI=1/ZI,$I=`\\s*([+-]?\\d+)\\s*`,eL=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,tL=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,nL=/^#([0-9a-f]{3,8})$/,rL=RegExp(`^rgb\\(${$I},${$I},${$I}\\)$`),iL=RegExp(`^rgb\\(${tL},${tL},${tL}\\)$`),aL=RegExp(`^rgba\\(${$I},${$I},${$I},${eL}\\)$`),oL=RegExp(`^rgba\\(${tL},${tL},${tL},${eL}\\)$`),sL=RegExp(`^hsl\\(${eL},${tL},${tL}\\)$`),cL=RegExp(`^hsla\\(${eL},${tL},${tL},${eL}\\)$`),lL={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};JI(XI,mL,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:uL,formatHex:uL,formatHex8:dL,formatHsl:fL,formatRgb:pL,toString:pL});function uL(){return this.rgb().formatHex()}function dL(){return this.rgb().formatHex8()}function fL(){return EL(this).formatHsl()}function pL(){return this.rgb().formatRgb()}function mL(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=nL.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?hL(t):n===3?new yL(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gL(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gL(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=rL.exec(e))?new yL(t[1],t[2],t[3],1):(t=iL.exec(e))?new yL(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=aL.exec(e))?gL(t[1],t[2],t[3],t[4]):(t=oL.exec(e))?gL(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sL.exec(e))?TL(t[1],t[2]/100,t[3]/100,1):(t=cL.exec(e))?TL(t[1],t[2]/100,t[3]/100,t[4]):lL.hasOwnProperty(e)?hL(lL[e]):e===`transparent`?new yL(NaN,NaN,NaN,0):null}function hL(e){return new yL(e>>16&255,e>>8&255,e&255,1)}function gL(e,t,n,r){return r<=0&&(e=t=n=NaN),new yL(e,t,n,r)}function _L(e){return e instanceof XI||(e=mL(e)),e?(e=e.rgb(),new yL(e.r,e.g,e.b,e.opacity)):new yL}function vL(e,t,n,r){return arguments.length===1?_L(e):new yL(e,t,n,r??1)}function yL(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}JI(yL,vL,YI(XI,{brighter(e){return e=e==null?QI:QI**+e,new yL(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ZI:ZI**+e,new yL(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yL(CL(this.r),CL(this.g),CL(this.b),SL(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bL,formatHex:bL,formatHex8:qee,formatRgb:xL,toString:xL}));function bL(){return`#${wL(this.r)}${wL(this.g)}${wL(this.b)}`}function qee(){return`#${wL(this.r)}${wL(this.g)}${wL(this.b)}${wL((isNaN(this.opacity)?1:this.opacity)*255)}`}function xL(){let e=SL(this.opacity);return`${e===1?`rgb(`:`rgba(`}${CL(this.r)}, ${CL(this.g)}, ${CL(this.b)}${e===1?`)`:`, ${e})`}`}function SL(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function CL(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wL(e){return e=CL(e),(e<16?`0`:``)+e.toString(16)}function TL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new DL(e,t,n,r)}function EL(e){if(e instanceof DL)return new DL(e.h,e.s,e.l,e.opacity);if(e instanceof XI||(e=mL(e)),!e)return new DL;if(e instanceof DL)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new DL(o,s,c,e.opacity)}function Jee(e,t,n,r){return arguments.length===1?EL(e):new DL(e,t,n,r??1)}function DL(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}JI(DL,Jee,YI(XI,{brighter(e){return e=e==null?QI:QI**+e,new DL(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ZI:ZI**+e,new DL(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new yL(AL(e>=240?e-240:e+120,i,r),AL(e,i,r),AL(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new DL(OL(this.h),kL(this.s),kL(this.l),SL(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=SL(this.opacity);return`${e===1?`hsl(`:`hsla(`}${OL(this.h)}, ${kL(this.s)*100}%, ${kL(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function OL(e){return e=(e||0)%360,e<0?e+360:e}function kL(e){return Math.max(0,Math.min(1,e||0))}function AL(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var jL=e=>()=>e;function Yee(e,t){return function(n){return e+n*t}}function Xee(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Zee(e){return(e=+e)==1?ML:function(t,n){return n-t?Xee(t,n,e):jL(isNaN(t)?n:t)}}function ML(e,t){var n=t-e;return n?Yee(e,n):jL(isNaN(e)?t:e)}var NL=(function e(t){var n=Zee(t);function r(e,t){var r=n((e=vL(e)).r,(t=vL(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=ML(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function PL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var FL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,IL=new RegExp(FL.source,`g`);function Qee(e){return function(){return e}}function $ee(e){return function(t){return e(t)+``}}function ete(e,t){var n=FL.lastIndex=IL.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=FL.exec(e))&&(i=IL.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:PL(r,i)})),n=IL.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?$ee(c[0].x):Qee(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var LL=180/Math.PI,RL={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zL(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*LL,skewX:Math.atan(c)*LL,scaleX:o,scaleY:s}}var BL;function tte(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?RL:zL(t.a,t.b,t.c,t.d,t.e,t.f)}function nte(e){return e==null||(BL||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),BL.setAttribute(`transform`,e),!(e=BL.transform.baseVal.consolidate()))?RL:(e=e.matrix,zL(e.a,e.b,e.c,e.d,e.e,e.f))}function VL(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:PL(e,i)},{i:c-2,x:PL(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:PL(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:PL(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:PL(e,n)},{i:s-2,x:PL(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var rte=VL(tte,`px, `,`px)`,`deg)`),ite=VL(nte,`, `,`)`,`)`),ate=1e-12;function HL(e){return((e=Math.exp(e))+1/e)/2}function ote(e){return((e=Math.exp(e))-1/e)/2}function ste(e){return((e=Math.exp(2*e))-1)/(e+1)}var cte=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<ate)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=HL(y),c=s/(n*g)*(i*ste(t*r+y)-ote(y));return[a+c*d,o+c*f,s*i/HL(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),UL=0,WL=0,GL=0,KL=1e3,qL,JL,YL=0,XL=0,ZL=0,QL=typeof performance==`object`&&performance.now?performance:Date,$L=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eR(){return XL||=($L(lte),QL.now()+ZL)}function lte(){XL=0}function tR(){this._call=this._time=this._next=null}tR.prototype=nR.prototype={constructor:tR,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?eR():+n)+(t==null?0:+t),!this._next&&JL!==this&&(JL?JL._next=this:qL=this,JL=this),this._call=e,this._time=n,iR()},stop:function(){this._call&&(this._call=null,this._time=1/0,iR())}};function nR(e,t,n){var r=new tR;return r.restart(e,t,n),r}function ute(){eR(),++UL;for(var e=qL,t;e;)(t=XL-e._time)>=0&&e._call.call(void 0,t),e=e._next;--UL}function rR(){XL=(YL=QL.now())+ZL,UL=WL=0;try{ute()}finally{UL=0,fte(),XL=0}}function dte(){var e=QL.now(),t=e-YL;t>KL&&(ZL-=t,YL=e)}function fte(){for(var e,t=qL,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:qL=n);JL=e,iR(r)}function iR(e){UL||(WL&&=clearTimeout(WL),e-XL>24?(e<1/0&&(WL=setTimeout(rR,e-QL.now()-ZL)),GL&&=clearInterval(GL)):(GL||=(YL=QL.now(),setInterval(dte,KL)),UL=1,$L(rR)))}function aR(e,t,n){var r=new tR;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var pte=AI(`start`,`end`,`cancel`,`interrupt`),mte=[];function oR(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;hte(e,n,{name:t,index:r,group:i,on:pte,tween:mte,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function sR(e,t){var n=lR(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function cR(e,t){var n=lR(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function lR(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function hte(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=nR(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return aR(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(aR(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function uR(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function gte(e){return this.each(function(){uR(this,e)})}function _te(e,t){var n,r;return function(){var i=cR(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function vte(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=cR(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function yte(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=lR(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?_te:vte)(n,e,t))}function dR(e,t,n){var r=e._id;return e.each(function(){var e=cR(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return lR(e,r).value[t]}}function fR(e,t){var n;return(typeof t==`number`?PL:t instanceof mL?NL:(n=mL(t))?(t=n,NL):ete)(e,t)}function pR(e){return function(){this.removeAttribute(e)}}function mR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hR(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function gR(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function _R(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function vR(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function yR(e,t){var n=kP(e),r=n===`transform`?ite:fR;return this.attrTween(e,typeof t==`function`?(n.local?vR:_R)(n,r,dR(this,`attr.`+e,t)):t==null?(n.local?mR:pR)(n):(n.local?gR:hR)(n,r,t))}function bR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function xR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function SR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&xR(e,i)),n}return i._value=t,i}function CR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&bR(e,i)),n}return i._value=t,i}function wR(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=kP(e);return this.tween(n,(r.local?SR:CR)(r,t))}function TR(e,t){return function(){sR(this,e).delay=+t.apply(this,arguments)}}function ER(e,t){return t=+t,function(){sR(this,e).delay=t}}function DR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?TR:ER)(t,e)):lR(this.node(),t).delay}function OR(e,t){return function(){cR(this,e).duration=+t.apply(this,arguments)}}function kR(e,t){return t=+t,function(){cR(this,e).duration=t}}function AR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?OR:kR)(t,e)):lR(this.node(),t).duration}function jR(e,t){if(typeof t!=`function`)throw Error();return function(){cR(this,e).ease=t}}function MR(e){var t=this._id;return arguments.length?this.each(jR(t,e)):lR(this.node(),t).ease}function NR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();cR(this,e).ease=n}}function PR(e){if(typeof e!=`function`)throw Error();return this.each(NR(this._id,e))}function FR(e){typeof e!=`function`&&(e=VP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new uz(r,this._parents,this._name,this._id)}function IR(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new uz(o,this._parents,this._name,this._id)}function LR(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function RR(e,t,n){var r,i,a=LR(t)?sR:cR;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function zR(e,t){var n=this._id;return arguments.length<2?lR(this.node(),n).on.on(e):this.each(RR(n,e,t))}function BR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function VR(){return this.on(`end.remove`,BR(this._id))}function HR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=PP(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,oR(l[f],t,n,f,l,lR(u,n)));return new uz(a,this._parents,t,n)}function UR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=RP(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=lR(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&oR(p,t,n,h,f,m);a.push(f),o.push(u)}return new uz(a,o,t,n)}var WR=wI.prototype.constructor;function GR(){return new WR(this._groups,this._parents)}function KR(e,t){var n,r,i;return function(){var a=jF(this,e),o=(this.style.removeProperty(e),jF(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function qR(e){return function(){this.style.removeProperty(e)}}function JR(e,t,n){var r,i=n+``,a;return function(){var o=jF(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function YR(e,t,n){var r,i,a;return function(){var o=jF(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),jF(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function XR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=cR(this,e),l=c.on,u=c.value[a]==null?s||=qR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function ZR(e,t,n){var r=(e+=``)==`transform`?rte:fR;return t==null?this.styleTween(e,KR(e,r)).on(`end.style.`+e,qR(e)):typeof t==`function`?this.styleTween(e,YR(e,r,dR(this,`style.`+e,t))).each(XR(this._id,e)):this.styleTween(e,JR(e,r,t),n).on(`end.style.`+e,null)}function QR(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function $R(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&QR(e,a,n)),r}return a._value=t,a}function ez(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,$R(e,t,n??``))}function tz(e){return function(){this.textContent=e}}function nz(e){return function(){var t=e(this);this.textContent=t??``}}function rz(e){return this.tween(`text`,typeof e==`function`?nz(dR(this,`text`,e)):tz(e==null?``:e+``))}function iz(e){return function(t){this.textContent=e.call(this,t)}}function az(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&iz(r)),t}return r._value=e,r}function oz(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,az(e))}function sz(){for(var e=this._name,t=this._id,n=dz(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=lR(c,t);oR(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new uz(r,this._parents,e,n)}function cz(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=cR(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var lz=0;function uz(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function dz(){return++lz}var fz=wI.prototype;uz.prototype={constructor:uz,select:HR,selectAll:UR,selectChild:fz.selectChild,selectChildren:fz.selectChildren,filter:FR,merge:IR,selection:GR,transition:sz,call:fz.call,nodes:fz.nodes,node:fz.node,size:fz.size,empty:fz.empty,each:fz.each,on:zR,attr:yR,attrTween:wR,style:ZR,styleTween:ez,text:rz,textTween:oz,remove:VR,tween:yte,delay:DR,duration:AR,ease:MR,easeVarying:PR,end:cz,[Symbol.iterator]:fz[Symbol.iterator]};function pz(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mz={time:null,delay:0,duration:250,ease:pz};function hz(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function gz(e){var t,n;e instanceof uz?(t=e._id,e=e._name):(t=dz(),(n=mz).time=eR(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&oR(c,e,t,l,o,n||hz(c,t));return new uz(r,this._parents,e,t)}wI.prototype.interrupt=gte,wI.prototype.transition=gz;var _z=e=>()=>e;function vz(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function yz(e,t,n){this.k=e,this.x=t,this.y=n}yz.prototype={constructor:yz,scale:function(e){return e===1?this:new yz(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yz(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var bz=new yz(1,0,0);xz.prototype=yz.prototype;function xz(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bz;return e.__zoom}function Sz(e){e.stopImmediatePropagation()}function Cz(e){e.preventDefault(),e.stopImmediatePropagation()}function wz(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Tz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ez(){return this.__zoom||bz}function Dz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Oz(){return navigator.maxTouchPoints||`ontouchstart`in this}function kz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Az(){var e=wz,t=Tz,n=kz,r=Dz,i=Oz,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=cte,l=AI(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Ez).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Ez),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(bz.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new yz(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new yz(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new yz(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=EI(this.that).datum();l.call(e,this.that,new vz(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=OI(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],uR(this),s.start();Cz(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=EI(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=OI(t,i),l=t.clientX,u=t.clientY;zI(t.view),Sz(t),a.mouse=[c,this.__zoom.invert(c)],uR(this),a.start();function d(e){if(Cz(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=OI(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),BI(e.view,a.moved),Cz(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=OI(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Cz(r),s>0?EI(this).transition().duration(s).call(x,d,c,r):EI(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Sz(t),s=0;s<i;++s)c=r[s],l=OI(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),uR(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Cz(e),s=0;s<a;++s)c=i[s],l=OI(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Sz(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=OI(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=EI(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:_z(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:_z(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:_z(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:_z([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var jz=`/api/live`,Mz=crypto.randomUUID(),Nz=500;function Pz(e,{onShow:t,onDisconnect:n,unseen:r=q_,selection:i=_P,theme:a=jM}={}){let o,s,c=!1,l=()=>{let u=location.protocol===`https:`?`wss`:`ws`;o=new WebSocket(`${u}://${location.host}${jz}`),o.addEventListener(`open`,()=>{let t={type:`hello`,role:`board`,tab:Mz};o?.send(JSON.stringify(t)),e.setState({connected:!0})}),o.addEventListener(`message`,n=>{let o=JSON.parse(String(n.data));if(o.type===`board`)Hg(e,o.data),F_(r,o.data);else if(o.type===`changes`){tee(r,o.changes);let{board:t}=e.getState();t&&F_(r,t)}else if(o.type===`access`)Xg(e,o.write,o.dispatch);else if(o.type===`reload`)Zg(e,o.refs);else if(o.type===`renamed`){let{before:t,after:n}=o;Pg(e,t,n)&&(sP(i,t,n),wM(t,n,a),I_(r,t,n),Ng(e,t,n))}else o.type===`findings`?Yg(e,o.findings):o.type===`notes`?Ug(e,o.page,o.notes):o.type===`listeners`?Wg(e,o.listeners):o.type===`history`?Gg(e,{undo:o.undo,redo:o.redo}):o.type===`claims`?Kg(e,o.claims):o.type===`thumbnails`?qg(e,o.theme,o.stamps):o.type===`show`&&t?.(o.ref)}),o.addEventListener(`close`,()=>{Jg(e),n?.(),c||(s=setTimeout(l,Nz))})};return l(),()=>{c=!0,clearTimeout(s),o?.close()}}var Fz=1500;function Iz(e,{store:t=q_,doc:n=document}={}){let r=(0,_.useRef)(e),i=(0,_.useRef)(()=>{});(0,_.useEffect)(()=>{let e=new Map,a=t=>{clearTimeout(e.get(t)),e.delete(t)},o=()=>{let i=r.current,{unseen:o}=t.getState(),s=i&&n.visibilityState===`visible`?new Set(i.frames.filter(e=>e.ref in o).filter(e=>Lz(e.box,i.view,i.size)).map(e=>e.ref)):new Set;for(let t of[...e.keys()])s.has(t)||a(t);for(let n of s)e.has(n)||e.set(n,setTimeout(()=>{e.delete(n),M_(t,n)},Fz))},s=()=>{for(let e of _P.getState().frames)M_(t,e)};i.current=o,o(),s();let c=t.subscribe((e,t)=>{e.unseen!==t.unseen&&(s(),o())}),l=_P.subscribe(s);return n.addEventListener(`visibilitychange`,o),()=>{c(),l(),n.removeEventListener(`visibilitychange`,o);for(let t of[...e.keys()])a(t);i.current=()=>{}}},[t,n]),(0,_.useEffect)(()=>{r.current=e,i.current()},[e])}function Lz(e,t,n){let r=Math.max(e.x*t.k+t.x,0),i=Math.max(e.y*t.k+t.y,0),a=Math.min((e.x+e.width)*t.k+t.x,n.width),o=Math.min((e.y+e.height)*t.k+t.y,n.height),s=Math.max(0,a-r)*Math.max(0,o-i),c=e.width*t.k*e.height*t.k;return c>0&&s*2>=c}function Rz(e){return[...e.querySelectorAll(`*`)].filter(e=>!e.hasAttribute(dM))}function zz(e,t){let n=Rz(e).indexOf(t);return n===-1?null:n}function Bz(e,t){return Rz(e)[t]??null}function Vz(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}var Hz=e=>`calc(${e}px / var(--zoom, 1))`,Uz=`${Hz(1.5)} solid var(--primary)`;function Wz(e){return`${e.width} × ${e.height}`}function Gz(e,t){return{left:e.x-(t?.x??0),top:e.y-(t?.y??0),width:e.width,height:e.height}}function Kz(e,t,n,r){let i=eB(e,`[data-selection]`);if(!i)return;i.style.transform=`translate(${t}px, ${n}px)`,tB(i,`[data-handles]`,!0),tB(i,`[data-chip]`,!0);let a=eB(i,`[data-move-chip]`);a&&(a.hidden=!1,a.textContent=`${r.x}, ${r.y}`)}function qz(e,t){let n=eB(e,`[data-selection]`),r=oN(Object.values(t));if(!n||!r)return;Object.assign(n.style,$z(Gz(r)));for(let[e,i]of Object.entries(t)){let t=eB(n,`[data-outline="${CSS.escape(e)}"]`);t&&Object.assign(t.style,$z(Gz(i,r)))}let i=eB(n,`[data-chip]`);i&&Object.keys(t).length===1&&(i.textContent=Wz(r))}function Jz(e,t,n){let r=eB(e,`[data-marquee]`);r&&(r.hidden=t===null,t&&Object.assign(r.style,$z(Gz(t)))),eB(e,`[data-marquee-hits]`)?.replaceChildren(...n.map(e=>{let t=document.createElement(`div`);return t.className=`absolute`,Object.assign(t.style,$z(Gz(e)),{outline:Uz}),t}))}function Yz(e,t,n){eB(e,`[data-guides]`)?.replaceChildren(...t.map(e=>Zz(e.axis===`x`?`vertical`:`horizontal`,e)),...n.flatMap(e=>[Zz(e.axis===`x`?`horizontal`:`vertical`,e),Qz(e)]))}function Xz(e){let t=eB(e,`[data-selection]`);if(t){let e=t.hasAttribute(`data-inside`);t.style.transform=``,tB(t,`[data-handles]`,e),tB(t,`[data-chip]`,e),tB(t,`[data-move-chip]`,!0)}Jz(e,null,[]),Yz(e,[],[])}function Zz(e,{at:t,from:n,to:r}){let i=document.createElement(`div`);return i.className=`absolute bg-guide`,i.dataset.guide=e,Object.assign(i.style,e===`vertical`?{left:`${t}px`,top:`${n}px`,height:`${r-n}px`,width:Hz(1)}:{top:`${t}px`,left:`${n}px`,width:`${r-n}px`,height:Hz(1)}),i}function Qz(e){let t=document.createElement(`span`),n=Math.round(e.to-e.from);t.dataset.gap=String(n),t.textContent=String(n),t.className=`absolute origin-top-left rounded-[4px] bg-guide px-[5px] py-px text-[10px] leading-[14px] text-white tabular-nums`;let r=(e.from+e.to)/2;return Object.assign(t.style,{left:`${e.axis===`x`?r:e.at}px`,top:`${e.axis===`x`?e.at:r}px`,transform:`scale(calc(1 / var(--zoom, 1))) translate(-50%, -120%)`}),t}function $z(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`]))}function eB(e,t){return e.querySelector(t)}function tB(e,t,n){let r=eB(e,t);r&&(r.hidden=n)}var nB=[`nw`,`ne`,`sw`,`se`],rB=`${Hz(1)} dashed var(--primary)`,iB=1e6,aB=`absolute top-full left-1/2 origin-top-left rounded-[4px] bg-primary px-1.5 py-0.5 text-[10px] leading-[14px] whitespace-nowrap text-primary-foreground tabular-nums [transform:scale(calc(1/var(--zoom,1)))_translate(-50%,6px)]`;function oB({frames:e}){let t=vP(e=>e.frames),n=vP(e=>!!e.element),r=e.filter(e=>t.includes(e.ref)),i=pN(r),a=oN(i.map(e=>e.box)),o=oN(uN(r).map(e=>e.box)),s=KM(),c=r.some(e=>e.ref in s);return(0,X.jsxs)(`div`,{"data-overlay":!0,className:`pointer-events-none absolute top-0 left-0`,style:{zIndex:iB},children:[a?(0,X.jsx)(sB,{frames:i,bounds:a,size:o??a,previewed:c,inside:n}):null,(0,X.jsx)(`div`,{"data-marquee-hits":!0}),(0,X.jsx)(`div`,{"data-marquee":!0,hidden:!0,className:`absolute bg-primary/10`,style:{border:`${Hz(1)} solid var(--primary)`}}),(0,X.jsx)(`div`,{"data-guides":!0})]})}function sB({frames:e,bounds:t,size:n,previewed:r,inside:i}){let a=e.length>1;return(0,X.jsxs)(`div`,{"data-selection":!0,"data-inside":i||void 0,className:`absolute`,style:{...Gz(t),...i?{outline:rB,outlineOffset:Hz(1)}:{outline:Uz}},children:[a?e.map(e=>(0,X.jsx)(`div`,{"data-outline":e.ref,className:`absolute`,style:{...Gz(e.box,t),outline:Uz}},e.ref)):null,(0,X.jsx)(`div`,{"data-handles":!0,hidden:i,children:nB.map(e=>(0,X.jsx)(`span`,{"data-handle":e,className:`absolute -translate-1/2 border-primary bg-white`,style:{left:e.endsWith(`w`)?0:`100%`,top:e.startsWith(`n`)?0:`100%`,width:Hz(7),height:Hz(7),borderWidth:Hz(1.5)}},e))}),(0,X.jsx)(`span`,{"data-chip":!0,hidden:i,className:aB,children:a?`${e.length} frames`:`${r?`Stored `:``}${Wz(n)}`}),(0,X.jsx)(`span`,{"data-move-chip":!0,hidden:!0,className:aB})]})}var cB=2e3,lB=1;function uB({frames:e,container:t}){let n=l_(e=>e.mode===`play`),[r,i]=(0,_.useState)({}),a=(0,_.useRef)(e);if((0,_.useLayoutEffect)(()=>{a.current=e},[e]),(0,_.useEffect)(()=>{if(!t||n)return;let e=new Set,r=(t,n,r)=>{let a=lB++,{width:o,height:s}=$M(t,t.box,qM(t.ref)),c=n.whole?[{x:0,y:0,width:o,height:s}]:n.elements.flatMap(e=>{let t=Bz(r,e);if(!t)return[];let n=t.getBoundingClientRect();return[{x:n.left,y:n.top,width:n.width,height:n.height}]});if(_v.add(n.id),c.length===0)return;i(e=>({...e,[t.ref]:{key:a,boxes:c}})),gv.setState(e=>({glowing:{...e.glowing,[t.ref]:a}}));let l=setTimeout(()=>{e.delete(l),i(e=>{if(e[t.ref]?.key!==a)return e;let{[t.ref]:n,...r}=e;return r}),gv.setState(e=>{if(e.glowing[t.ref]!==a)return e;let{[t.ref]:n,...r}=e.glowing;return{glowing:r}})},cB);e.add(l)},o=()=>{let{unseen:e}=q_.getState(),{replays:n}=gv.getState(),i=[];for(let o of a.current){let a=e[o.ref];if(!a)continue;let s=o.ref in n;if(_v.has(a.id)&&!s)continue;let c=t.querySelector(`[data-frame="${CSS.escape(o.ref)}"] iframe`)?.contentDocument;c&&Vz(c)===a.hash&&(s&&i.push(o.ref),r(o,a,c))}i.length>0&&gv.setState(e=>({replays:Object.fromEntries(Object.entries(e.replays).filter(([e])=>!i.includes(e)))}))};o(),t.addEventListener(`load`,o,!0);let s=q_.subscribe((e,t)=>{e.unseen!==t.unseen&&o()}),c=gv.subscribe((e,t)=>{e.replays!==t.replays&&o()});return()=>{t.removeEventListener(`load`,o,!0),s(),c();for(let t of e)clearTimeout(t);i({}),gv.setState({glowing:{}})}},[t,n]),n)return null;let o=new Map(e.map(e=>[e.ref,e]));return Object.entries(r).flatMap(([e,{key:t,boxes:n}])=>{let r=o.get(e);return r?n.map((n,i)=>(0,X.jsx)(`span`,{"data-change-glow":e,"aria-hidden":!0,className:`pointer-events-none absolute rounded-[calc(8px/var(--zoom,1))] bg-[color-mix(in_srgb,var(--claim)_12%,transparent)] motion-safe:animate-change-glow`,style:{left:`calc(${r.box.x+n.x}px - ${Hz(4)})`,top:`calc(${r.box.y+n.y}px - ${Hz(4)})`,width:`calc(${n.width}px + ${Hz(8)})`,height:`calc(${n.height}px + ${Hz(8)})`,boxShadow:`0 0 0 ${Hz(2)} var(--claim), 0 0 ${Hz(18)} color-mix(in srgb, var(--claim) 55%, transparent)`,zIndex:iB-1}},`${t}-${i}`)):[]})}function dB(e){return e.slice(0,1).toUpperCase()}var fB=`claude`;function pB(e){let[t,n]=e.split(` · `);return n===void 0||!t?fB:t}function mB(e,t){let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m`}function hB(){let[e,t]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(e)},[]),e}var gB=`pointer-events-none w-[280px] rounded-[10px] border border-[color-mix(in_srgb,var(--claim)_50%,var(--border))] bg-card px-3 py-2.5 text-xs leading-[1.45] text-card-foreground shadow-[0_10px_30px_rgba(0,0,0,0.3)]`;function _B({page:e,frames:t}){let n=tk(),r=l_(e=>e.mode===`play`);(0,_.useEffect)(()=>{r&&ak()},[r]),(0,_.useEffect)(()=>()=>ak(),[e]);let i=n.length>0;(0,_.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&ak()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let a=uN(t);if(r)return null;let o=yB(n);return a.flatMap(e=>{let t=o.get(e.ref);return t?(0,X.jsx)(`div`,{className:`absolute origin-top-left [transform:scale(calc(1/var(--zoom,1)))]`,style:{left:`calc(${e.box.x}px + ${Hz(72)})`,top:`calc(${e.box.y+e.box.height}px - ${Hz(38)})`,zIndex:iB+1},children:(0,X.jsx)(bB,{frame:e.name,...t})},e.ref):[]})}function vB({frames:e}){let t=tk();if(l_(e=>e.mode===`play`))return null;let n=new Set(e.map(e=>e.ref)),r=[...yB(t)].filter(([e])=>!n.has(e));return r.length===0?null:(0,X.jsx)(`div`,{"data-waiting-dock":!0,className:`absolute bottom-[4.25rem] left-4 flex flex-col gap-2`,style:{zIndex:iB+1},children:r.map(([e,t])=>(0,X.jsx)(bB,{frame:e.slice(e.lastIndexOf(`/`)+1),...t},e))})}function yB(e){let t=new Map;for(let n of e)for(let e of n.holders)t.set(e.frame,{label:n.label,holder:e});return t}function bB({frame:e,label:t,holder:n}){let r=hB(),i=`${dB(n.tag)}${n.tag.slice(1)}`;return(0,X.jsxs)(`div`,{"data-waiting-card":n.frame,role:`status`,className:gB,children:[(0,X.jsxs)(`b`,{className:`block font-semibold`,children:[i,` is editing `,e]}),(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Your `,t,` will wait until it finishes, about`,` `,(0,X.jsx)(`span`,{"data-waiting-elapsed":!0,children:mB(n.claimedAt,r)}),` so far.`]})]})}function xB(e,t,n){let r=n.width/t.k,i=n.height/t.k,a=-t.x/t.k-r,o=-t.y/t.k-i,s=a+3*r,c=o+3*i,l=new Set;for(let{ref:t,box:n}of e)n.x<s&&n.x+n.width>a&&n.y<c&&n.y+n.height>o&&l.add(t);return l}function SB(e){let t=N()(()=>({byRef:{}})),n=(e,n,r)=>{let i=t.getState().byRef[e];i&&i.version>r||t.setState(t=>({byRef:{...t.byRef,[e]:{...n,version:r}}}))},r=(e,n)=>{let r=t.getState().byRef[e];r&&r.version>=n||i(e,n)},i=(t,r)=>{n(t,{status:`loading`},r),e(t).then(e=>n(t,{status:`ready`,tree:e},r),e=>n(t,{status:`refused`,message:e instanceof Error?e.message:String(e)},r))},a=(e,n)=>(r(e,n),new Promise(n=>{let r=()=>{let r=t.getState().byRef[e];return!r||r.status===`loading`?!1:(n(r.status===`ready`?r.tree:null),!0)};if(r())return;let i=t.subscribe(()=>{r()&&i()})}));return{store:t,request:r,read:a,catchUp:async(e,n,r)=>{let o=await a(e,r),s=t.getState().byRef[e];!o||o.hash===n||!s||s.version>r||(i(e,r),await a(e,r))}}}async function CB(e,t=fetch){let n=await t(`/api/frames/elements?ref=${encodeURIComponent(e)}`),r=await n.json().catch(()=>null);if(!r)throw Error(`The board answered ${n.status}.`);if(!r.ok)throw Error(r.error.message);return r.data}var wB=SB(e=>CB(e));function TB(e){let t=wB.store.getState().byRef[e];return t?.status===`ready`?t.tree:null}function EB(e){let t=$g(t=>e?t.reloads[e]??0:0);return(0,_.useEffect)(()=>{e&&wB.request(e,t)},[e,t]),F(wB.store,t=>e?t.byRef[e]??null:null)}function DB(e){wB.request(e,Qg.getState().reloads[e]??0)}function OB(e,t){return wB.catchUp(e,t,Qg.getState().reloads[e]??0)}function kB(e){return wB.read(e,Qg.getState().reloads[e]??0)}function AB(e,t){return e.find(e=>e.parent===t)?.index}function jB(e,t){return e.find(e=>e.index===t)?.parent}function MB(e,t,n){let r=jB(e,t);if(r===void 0)return;let i=e.filter(e=>e.parent===r),a=i.findIndex(e=>e.index===t),o=i.length;return i[(a+n+o)%o]?.index}function NB(e,t){let n=jB(e,t);if(n===void 0)return;let r=e.filter(e=>e.parent===n),i=r.findIndex(e=>e.index===t);return i<0?void 0:{place:i,count:r.length}}function PB(e,t,n){let r=jB(e,t),i=e[0];if(r===void 0||!i)return;let a=e.filter(e=>e.parent===r),o=a.findIndex(e=>e.index===t),s=n(o,a.length);if(s===o||s<0||s>=a.length)return;let c=a.filter(e=>e.index!==t);return{parent:r??i.index-1,before:c[s]?.index??null}}var FB=new Map,IB=new Map;function LB({frame:e,index:t}){return`${e}\n${t}`}function RB(e){return IB.get(LB(e))??null}function zB(e){IB.delete(LB(e))}function BB(e,t,n,r={}){return VB(t.frame,i=>HB(i,e,t,n,r)).then(e=>e!==null)}function VB(e,t){let n=t(FB.get(e));return FB.set(e,n),n.finally(()=>{FB.get(e)===n&&FB.delete(e)})}async function HB(e,t,n,r,{selection:i=_P,send:a=fetch,notify:o=({copy:e,...t})=>_g.add({...t,type:`warning`,...e===void 0?{}:{actionProps:{children:`Copy text`,onClick:()=>void navigator.clipboard.writeText(e)}}})}){let s=e?await e:void 0;if(s===null)return hP(i,UB),null;let c=s!==void 0&&s.from.includes(n.hash),l=c?s.at.get(n.index):void 0,u=c&&(!s.shifted||l!==void 0),d=u?s.to:n.hash,f=u?l??n.index:n.index,p=()=>{};try{let e=await ik([n.frame],`edit`,async()=>{p=dP(n.frame),pP(n.frame,d);try{return await Tx(`/api/frames/edit`,{ref:n.frame,index:f,hash:d,change:r},`POST`,a)}catch(e){throw p(),e}}),o=e.from!==void 0&&e.from!==d;o&&e.from&&pP(n.frame,e.from),pP(n.frame,e.hash);let{page:l,frames:u,element:m}=i.getState(),h=!m&&l===t&&u.length===1&&u[0]===n.frame;(m?.frame===n.frame&&(m.index===n.index||m.index===f)||o&&h)&&iP(i,t,{frame:n.frame,index:e.index,hash:e.hash}),p(),gP(i,UB);let g=new Map(c?s.at:[]);return g.set(n.index,e.index),{from:c?[...s.from,d]:[n.hash],to:e.hash,at:g,shifted:c&&s.shifted||o}}catch(e){if(!(e instanceof XO)){let t=r.kind===`text`?r.value:void 0,i=e instanceof wx&&e.code===`stale-address`,a=i&&t!==void 0&&e.details.moved===!1;a&&IB.set(LB(n),t),o({title:`Edit not saved`,description:e instanceof wx?WB(e.message)+(a?` Press Enter to apply your text anyway.`:``):`The board could not be reached, so nothing was written.`,...i&&t!==void 0?{copy:t}:{}})}return p(),hP(i,UB),null}}function UB(e){let t=document.querySelector(`[data-frame="${CSS.escape(e)}"] iframe`)?.contentDocument;return t?Vz(t):null}function WB(e){let t=/^\S+\.html\b/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1);return/[.!?]$/.test(t)?t:`${t}.`}function GB(e,t,n,r,i){return{onPreview:r=>i?.(e,r?n(r(t)):null),onCommit:i=>r({kind:`style`,property:e,value:n(i(t))})}}var KB={width:240,height:135},qB=3e3,JB=1e4;function YB(e,t){let n=e&&e.width>0&&e.height>0?e:KB,r=Math.min(1,t>0?t/n.width:1,JB/n.width,JB/n.height);return{width:Math.max(1,Math.round(n.width*r)),height:Math.max(1,Math.round(n.height*r))}}function XB(e,t,n=qB){return t===`svg`?QB(e):new Promise(r=>{let i=t===`video`?document.createElement(`video`):new Image,a=e=>{clearTimeout(o),i.removeAttribute(`src`),r(e&&e.width>0&&e.height>0?e:null)},o=setTimeout(()=>a(null),n);i.addEventListener(`error`,()=>a(null),{once:!0}),i instanceof HTMLVideoElement?(i.preload=`metadata`,i.muted=!0,i.addEventListener(`loadedmetadata`,()=>a({width:i.videoWidth,height:i.videoHeight}),{once:!0})):i.addEventListener(`load`,()=>a({width:i.naturalWidth,height:i.naturalHeight}),{once:!0}),i.src=e})}var ZB=/^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/;async function QB(e){let t;try{let n=await fetch(e);if(!n.ok)return null;t=await n.text()}catch{return null}let n=new DOMParser().parseFromString(t,`image/svg+xml`).documentElement;if(n.localName!==`svg`)return null;let r=ZB.exec(n.getAttribute(`width`)??``)?.[1],i=ZB.exec(n.getAttribute(`height`)??``)?.[1];if(r&&i)return $B(Number(r),Number(i));let a=(n.getAttribute(`viewBox`)??``).trim().split(/[\s,]+/).map(Number);return a.length===4?$B(a[2]??0,a[3]??0):null}function $B(e,t){return e>0&&t>0?{width:Math.round(e),height:Math.round(t)}:null}var eV=new Set([`HTML`,`BODY`]);function tV(e,t,n){let r=[...t].filter(e=>!e.hidden&&nV(e.box,n)).sort((e,t)=>t.order-e.order)[0];if(!r)return null;let i=e.querySelector(`[data-frame="${CSS.escape(r.ref)}"] iframe`),a=i?.contentDocument,o=a?.elementFromPoint(n.x-r.box.x,n.y-r.box.y),s=i?.dataset.renderedAt??null,c=a&&o&&s&&!eV.has(o.tagName)?zz(a,o):null;return{frame:{ref:r.ref,name:r.name},element:c,renderedAt:c===null?null:s,at:n}}function nV(e,{x:t,y:n}){return t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height}var rV=new Set(`area.br.col.embed.hr.iframe.img.input.link.meta.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`)),iV=`http://www.w3.org/1999/xhtml`;function aV(e,t){if(e.localName===`body`)return!0;if(e.namespaceURI!==iV||rV.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let n=t.getComputedStyle(e).display;return n.startsWith(`inline`)||n===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function oV(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1};if(!t.endsWith(`flex`))return{row:!1,reverse:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`)}}function sV(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function cV(e,t){let n=e.defaultView,r=e.body;if(!n||!r)return null;let i=e.elementFromPoint(t.x,t.y);for(i&&r.contains(i)||(i=r);i&&!aV(i,n);)i=i.parentElement;let a=i&&zz(e,i);if(!i||a==null)return null;let o=n.getComputedStyle(i),{row:s,reverse:c}=oV(o),l=[...i.children].flatMap(t=>{let n=zz(e,t),r=t.getBoundingClientRect();return n!==null&&(r.width>0||r.height>0)?[{index:n,box:r}]:[]}),u=l.findIndex(({box:e})=>sV(t,e,s,c)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(o.getPropertyValue(`padding-${e}`))||0;return{parent:a,before:f?.index??null,row:s,room:Math.max(0,i.clientWidth-p(`left`)-p(`right`)),line:lV(i.getBoundingClientRect(),o,s,c,{after:d?.box,ahead:f?.box})}}function lV(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function uV(e,t,n){let r=tV(e,t,n),i=t.find(e=>e.ref===r?.frame.ref);if(!i)return null;let a=fV(e,i.ref),o=a?Vz(a):null,s=a&&o?cV(a,{x:n.x-i.box.x,y:n.y-i.box.y}):null;return o&&s?{frame:i,hash:o,gap:s}:null}function dV(e,t,n,{frame:r,index:i}){let a=uV(e,t,n),o=a?.frame.ref===r?fV(e,r):null,s=o?Bz(o,i):null,c=o&&a?Bz(o,a.gap.parent):null;if(!a||!o||!s||!c||s.contains(c))return null;let l=s.nextElementSibling;return c===s.parentElement&&(a.gap.before===i||a.gap.before===(l?zz(o,l):null))?null:a}function fV(e,t){return e.querySelector(`[data-frame="${CSS.escape(t)}"] iframe`)?.contentDocument??null}async function pV(e,t,n,r,i,{selection:a=_P,mode:o=c_,live:s=Qg,send:c=fetch,notify:l=e=>_g.add({...e,type:`warning`}),size:u,asset:d}={}){let f=uV(e,n,r);if(!f||i===`asset`&&!d)return null;let{gap:p}=f,m=i===`asset`&&d?{kind:i,path:d.path,...u??YB(d.natural,p.room)}:i===`divider`?{kind:i,vertical:p.row}:i===`text`||!u?{kind:i}:{kind:i,...u};return yV(f,`Nothing placed`,e=>({url:`/api/frames/insert`,body:{ref:f.frame.ref,hash:e,parent:p.parent,before:p.before,element:m}}),e=>{iP(a,t,e),o.setState({tool:`move`})},{live:s,send:c,notify:l})}async function mV(e,t,n,r,i,{measure:a=XB,...o}={}){let s=o.size?null:await a(Uj(i.project,i.path),i.kind);return pV(e,t,n,r,`asset`,{...o,asset:{path:i.path,natural:s}})}async function hV(e,t,n,r,i,{selection:a=_P,live:o=Qg,send:s=fetch,notify:c=e=>_g.add({...e,type:`warning`})}={}){let l=dV(e,n,r,i);return l?yV(l,`Nothing moved`,e=>({url:`/api/frames/move`,body:{ref:i.frame,hash:e,index:i.index,parent:l.gap.parent,before:l.gap.before}}),e=>iP(a,t,e),{live:o,send:s,notify:c}):null}async function gV(e,t,n,{selection:r=_P,live:i=Qg,send:a=fetch,notify:o=e=>_g.add({...e,type:`warning`}),tree:s=vV}={}){let c=t.frame,l=i.getState().claims[c];if(l)return o({title:`Nothing moved`,description:`${l.tag} is editing ${c.split(`/`).at(-1)??c}, so nothing was written.`}),null;let u=null;return await VB(c,async i=>{let l=i?await i:void 0;if(l===null)return null;let d=l!==void 0&&l.from.includes(t.hash),f=d?l.moves?.get(_V(t.hash,t.index))??l.at.get(t.index):void 0,p=d&&(!l.shifted||f!==void 0),m=p?l.to:t.hash,h=p?f??t.index:t.index,g=await s(c,m);if(!g)return o({title:`Nothing moved`,description:`The frame changed since it was read, so nothing was written.`}),null;let _=PB(g.elements,h,n);if(!_)return l??{from:[m],to:m,at:new Map,shifted:!1};let v=dP(c);pP(c,m);try{let n=await Tx(`/api/frames/move`,{ref:c,hash:m,index:h,parent:_.parent,before:_.before},`POST`,a);pP(c,n.hash),OB(c,n.hash),u={frame:c,index:n.index,hash:n.hash},iP(r,e,u);let i=new Map(d?l.at:[]);i.set(t.index,n.index);let o=new Map;for(let[e,t]of d&&l.moves||[])t===h&&o.set(e,n.index);return o.set(_V(t.hash,t.index),n.index),o.set(_V(m,h),n.index),{from:d?[...l.from,m]:[m],to:n.hash,at:i,shifted:!0,moves:o}}catch(e){return o({title:`Nothing moved`,description:e instanceof wx?WB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{v()}}),u}function _V(e,t){return`${e}\n${t}`}async function vV(e,t){let n=TB(e);if(n?.hash===t)return n;let r=await CB(e).catch(()=>null);return r?.hash===t?r:null}async function yV({frame:e,hash:t},n,r,i,{live:a,send:o,notify:s}){let c=e.ref,l=a.getState().claims[c];if(l)return s({title:n,description:`${l.tag} is editing ${e.name}, so nothing was written.`}),null;let u=null;return await VB(c,async e=>{let a=e?await e:void 0;if(a===null)return null;let l=a!==void 0&&a.from.includes(t)&&!a.shifted?a.to:t,d=dP(c);pP(c,l);try{let{url:e,body:t}=r(l),n=await Tx(e,t,`POST`,o);return pP(c,n.hash),OB(c,n.hash),u={frame:c,index:n.index,hash:n.hash},i(u),{from:[l],to:n.hash,at:new Map,shifted:!0}}catch(e){return s({title:n,description:e instanceof wx?WB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{d()}}),u}async function bV(e,t,{selection:n=_P,live:r=Qg,send:i=fetch,notify:a=e=>_g.add({...e,type:`warning`})}={}){let o=t.frame;return await VB(o,async s=>{let c=s?await s:void 0;if(c===null)return null;let l=c!==void 0&&c.from.includes(t.hash)&&!c.shifted?c.to:t.hash,u=()=>{};try{let a=await ik([o],`delete`,async()=>{u=dP(o),pP(o,l);try{return await Tx(`/api/frames/remove`,{ref:o,index:t.index,hash:l},`POST`,i)}catch(e){throw u(),e}},{live:r});return pP(o,a.hash),OB(o,a.hash),nP(n,e,[o]),{from:[l],to:a.hash,at:new Map,shifted:!0}}catch(e){return e instanceof XO||a({title:`Nothing deleted`,description:e instanceof wx?WB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{u()}})!==null}var xV=new Map;function SV({frame:e,index:t}){return`${e}\n${t}`}async function CV(e,t,n,{selection:r=_P,live:i=Qg,send:a=fetch,notify:o=e=>_g.add({...e,type:`warning`}),inline:s}={}){let c=t.frame,l=n?`Nothing placed`:`Nothing moved`,u=xV.get(SV(t))??{},d=n?[]:[`width`,`height`].filter(e=>u[e]!==void 0&&s?.[e]===u[e]),f=i.getState().claims[c];return f?(o({title:l,description:`${f.tag} is editing ${c.split(`/`).at(-1)??c}, so nothing was written.`}),!1):await VB(c,async i=>{let s=i?await i:void 0;if(s===null)return null;let u=s!==void 0&&s.from.includes(t.hash)&&!s.shifted,f=u?s.to:t.hash,p=u?s.at.get(t.index)??t.index:t.index,m=dP(c);pP(c,f);try{let i=await Tx(`/api/frames/place`,{ref:c,hash:f,index:p,spot:n,...d.length>0?{drop:d}:{}},`POST`,a);pP(c,i.hash),OB(c,i.hash),iP(r,e,{frame:c,index:i.index,hash:i.hash});let o=SV({frame:c,index:i.index});n?xV.set(o,Object.fromEntries(i.sized.map(e=>[e,`${n[e]??0}px`]))):xV.delete(o);let l=new Map(u?s.at:[]);return l.set(t.index,i.index),{from:u?[...s.from,f]:[f],to:i.hash,at:l,shifted:!1}}catch(e){return o({title:l,description:e instanceof wx?WB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{m()}})!==null}var wV=[`layer`,`stack`,`order`];function TV(){let e=document.activeElement;return!e||e===document.body||e.closest(`[data-canvas]`)!==null&&e.closest(`[data-note-marker], [data-note-card]`)===null}function EV(e){let{selection:t,mode:n}=e,r=()=>{let{page:r,frames:i,element:a}=t.getState(),o=i[0];if(n.getState().mode!==`edit`||r!==e.page()||i.length!==1||!o)return null;let s=e.treeOf(o);return!s||a&&a.hash!==s.hash?null:{page:r,frame:o,at:a?.index??null,tree:s}},i=e=>{let n=()=>{let t=r();if(!t)return;let n=e(t.tree.elements,t.at);return n===void 0?void 0:{...t,next:n}};return{enabled:()=>n()!==void 0,run:()=>{let e=n();if(!e)return;let{page:r,frame:i,next:a,tree:o}=e;if(a===null)nP(t,r,[i]);else{let e={frame:i,index:a,hash:o.hash};iP(t,r,e)}}}},a=e=>(t,n)=>n===null?void 0:e(t,n),o=t=>({enabled:()=>e.boardFocused()&&t.enabled(),run:t.run}),s=i(a(jB)),c=()=>{let{page:r,element:i}=t.getState();return n.getState().mode===`edit`&&r===e.page()&&!!i},l=n=>({enabled:()=>c()&&e.writable()&&e.boardFocused(),run:()=>{let{page:r,element:i}=t.getState();r&&i&&e.move(r,i,e=>e+n)}}),u=n=>{let i=()=>{let e=r();if(!e||e.at===null)return!1;let t=NB(e.tree.elements,e.at);if(!t)return!1;let i=n(t.place,t.count);return i!==t.place&&i>=0&&i<t.count};return{enabled:()=>c()&&e.writable()&&i(),run:()=>{let{page:r,element:i}=t.getState();r&&i&&e.move(r,i,n)}}};return[{id:`element.down`,label:`Select child`,group:`selection`,palette:!1,keys:[`Enter`],...o(i(AB))},{id:`element.up`,label:`Select parent`,group:`selection`,palette:!1,keys:[`Escape`],enabled:()=>c()&&(e.noteOpen()||n.getState().tool===`move`&&s.enabled()),run:()=>{e.noteOpen()||s.run()}},{id:`element.delete`,label:`Delete`,group:`selection`,command:{label:`Delete element`,icon:Pi,keywords:[`remove`]},keys:[`Backspace`,`Delete`],enabled:()=>c()&&e.writable(),run:()=>{let{page:n,element:r}=t.getState();n&&r&&e.remove(n,r)}},{id:`element.moveUp`,label:`Move up among siblings`,group:`selection`,palette:!1,keys:[`Alt+Shift+ArrowUp`],...l(-1)},{id:`element.moveDown`,label:`Move down among siblings`,group:`selection`,palette:!1,keys:[`Alt+Shift+ArrowDown`],...l(1)},{id:`element.toFront`,label:`Bring to front`,group:`selection`,command:{label:`Bring to front`,icon:yt,keywords:wV},...u((e,t)=>t-1)},{id:`element.forward`,label:`Bring forward`,group:`selection`,command:{label:`Bring forward`,icon:_t,keywords:wV},...u(e=>e+1)},{id:`element.backward`,label:`Send backward`,group:`selection`,command:{label:`Send backward`,icon:lt,keywords:wV},...u(e=>e-1)},{id:`element.toBack`,label:`Send to back`,group:`selection`,command:{label:`Send to back`,icon:oi,keywords:wV},...u(()=>0)},{id:`element.next`,label:`Select next sibling`,group:`selection`,palette:!1,keys:[`Tab`],...o(i(a((e,t)=>MB(e,t,1))))},{id:`element.previous`,label:`Select previous sibling`,group:`selection`,palette:!1,keys:[`Shift+Tab`],...o(i(a((e,t)=>MB(e,t,-1))))}]}function DV(e){(0,_.useEffect)(()=>{let t=ye(EV({page:()=>e,selection:_P,mode:c_,treeOf:TB,noteOpen:()=>YN.getState().open!==null,boardFocused:TV,writable:()=>Qg.getState().canWrite,remove:(e,t)=>void bV(e,t),move:(e,t,n)=>void gV(e,t,n)})),n=()=>{let{frames:e}=_P.getState();e.length===1&&e[0]&&DB(e[0])};n();let r=[_P.subscribe(n),Qg.subscribe((e,t)=>{e.reloads!==t.reloads&&n()}),_P.subscribe(G),c_.subscribe(G),Qg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&G()}),YN.subscribe(G),wB.store.subscribe(G)];return()=>{for(let e of r)e();t()}},[e])}var OV=[{left:0,top:0},{left:`100%`,top:0},{left:0,top:`100%`},{left:`100%`,top:`100%`}];function kV({frames:e,container:t}){let n=vP(e=>e.element??null),r=e.find(e=>e.ref===n?.frame),i=lN(r?.ref??``),a=AV(t,n),o=i??r?.box;return!o||!a?null:(0,X.jsxs)(`div`,{"data-element-selection":!0,className:`pointer-events-none absolute`,style:{left:o.x+a.x,top:o.y+a.y,width:a.width,height:a.height,outline:Uz,outlineOffset:Hz(2),zIndex:iB},children:[OV.map(e=>(0,X.jsx)(`span`,{"data-element-corner":!0,className:`absolute -translate-1/2 border-primary bg-white`,style:{...e,width:Hz(7),height:Hz(7),borderWidth:Hz(1.5)}},`${e.left}-${e.top}`)),(0,X.jsx)(`span`,{"data-chip":!0,className:aB,children:Wz(a)})]})}function AV(e,t){let[n,r]=(0,_.useState)(null),i=t?.frame,a=t?.index,o=t?.hash,s=t?`${i}:${a}:${o}`:null;return(0,_.useEffect)(()=>{if(!e||s===null||i===void 0||a===void 0)return;let t=e=>r({key:s,box:e}),n=()=>{},c=()=>{n();let r=e.querySelector(`[data-frame="${CSS.escape(i)}"] iframe`)?.contentDocument,s=r&&Vz(r)===o?Bz(r,a):null,c=r?.defaultView;if(!s||!c){t(null);return}let l=()=>{let e=s.getBoundingClientRect();t({x:Math.round(e.left),y:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)})};l();let u=new c.ResizeObserver(l);u.observe(s),u.observe(s.ownerDocument.documentElement),c.addEventListener(`scroll`,l,!0),n=()=>{u.disconnect(),c.removeEventListener(`scroll`,l,!0)}};return c(),e.addEventListener(`load`,c,!0),()=>{e.removeEventListener(`load`,c,!0),n()}},[e,s,i,a,o]),n?.key===s?n.box:null}function jV(e,t,n,r){let i=tV(e,t,n);if(!i||i.element===null)return null;let a=e.querySelector(`[data-frame="${CSS.escape(i.frame.ref)}"] iframe`)?.contentDocument,o=a?Vz(a):null;if(!a||!o)return null;let s=r(i.frame.ref);if(s?.hash!==o)return null;for(let e=Bz(a,i.element);e&&e!==a.body;e=e.parentElement){let t=zz(a,e);if(t!==null&&s.elements.find(e=>e.index===t)?.tag===e.localName)return{frame:i.frame.ref,index:t,hash:o}}return null}async function MV(e,t,n,r){let i=tV(e,t,n);if(!i||i.element===null)return null;let a=await r(i.frame.ref);return a?jV(e,t,n,()=>a):null}function NV(e,t,n,r){let i=0,a=0,o=!1,s=()=>{!o&&a!==i&&t.getState().canWrite&&(o=!0,a=i,r({tab:n,...PV(e.getState())}).catch(()=>{}).finally(()=>{o=!1,s()}))},c=()=>{i+=1,s()};c();let l=e.subscribe(c),u=t.subscribe((e,t)=>{e.canWrite&&!t.canWrite&&c()});return()=>{u(),l()}}function PV({page:e,frames:t,element:n}){return{page:e,frames:[...t],element:n?{ref:n.frame,index:n.index,hash:n.hash}:null}}function FV({className:e,...t}){return(0,X.jsx)(`kbd`,{"data-slot":`kbd`,className:Q(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function IV({className:e,...t}){return(0,X.jsx)(`kbd`,{"data-slot":`kbd-group`,className:Q(`inline-flex items-center gap-1`,e),...t})}function LV({className:e,...t}){return(0,X.jsx)(`textarea`,{"data-slot":`textarea`,className:Q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function RV(e){let{nativeEvent:t,currentTarget:n}=e;return t instanceof InputEvent&&(t.inputType===`historyUndo`||t.inputType===`historyRedo`)&&n.ownerDocument.activeElement!==n}var zV=/\r\n|\r|\n/g;function BV({text:e,disabled:t,write:n,element:r}){let[i,a]=(0,_.useState)(()=>RB(r)),[o,s]=(0,_.useState)(null);o&&o.over!==e&&s(null);let c=o?.over===e?o.value:null,[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(!1),f=()=>{d.current?d.current=!1:i!==null&&(a(null),zB(r),i!==e&&(s({value:i,over:e}),n({kind:`text`,value:i}).then(e=>{e||(s(null),a(RB(r)))})))};return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-text`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-text`,className:`mb-2 text-xs font-semibold`,children:`Text`}),(0,X.jsx)(LV,{"aria-labelledby":`inspector-text`,value:i??c??e,disabled:t,onChange:e=>{RV(e)||a(e.currentTarget.value.replace(zV,` `))},onFocus:()=>u(!0),onBlur:()=>{u(!1),f()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.shiftKey||f()),e.key===`Escape`&&(a(null),zB(r),d.current=!0,e.currentTarget.blur())},className:`max-h-28 min-h-11 resize-none overflow-y-auto rounded-md border-0 bg-input px-2 py-1.5 text-xs leading-[1.4] md:text-xs dark:bg-input`}),(0,X.jsxs)(`p`,{className:Q(`mt-2.5 flex items-center gap-1 text-(length:--text-caption) font-normal text-muted-foreground`,!l&&`invisible`),children:[(0,X.jsx)(FV,{children:`Enter`}),` to apply, `,(0,X.jsx)(FV,{children:`Esc`}),` to cancel`]})]})}var VV=`data-frameboard-editing`;function HV(e,t,n){let r=e.defaultView,i=Bz(e,t.index);if(!r||Vz(e)!==t.hash||!(i instanceof r.HTMLElement)||i.childElementCount>0||(i.textContent??``).trim()===``)return null;let a=i,o=a.textContent??``,s=!0,c=()=>{s=!1,a.removeAttribute(`contenteditable`),a.removeAttribute(VV),a.removeEventListener(`keydown`,d),a.removeEventListener(`paste`,f),a.removeEventListener(`blur`,u),r.removeEventListener(`pagehide`,c)},l=()=>{s&&(c(),a.textContent=o)};function u(){if(!s)return;c();let e=(a.textContent??``).replace(zV,` `);a.textContent=e,e!==o&&n({kind:`text`,value:e}).then(e=>{!e&&a.isConnected&&(a.textContent=o)})}function d(e){e.key===`Enter`&&(e.preventDefault(),e.shiftKey?p(` `):u()),e.key===`Escape`&&(e.preventDefault(),l())}function f(e){e.preventDefault(),p((e.clipboardData?.getData(`text/plain`)??``).replace(zV,` `))}let p=t=>{let n=r.getSelection()?.getRangeAt(0);if(!n||!a.contains(n.commonAncestorContainer))return;n.deleteContents();let i=e.createTextNode(t);n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.normalize()};a.setAttribute(`contenteditable`,`plaintext-only`),a.setAttribute(VV,``),a.addEventListener(`keydown`,d),a.addEventListener(`paste`,f),a.addEventListener(`blur`,u),r.addEventListener(`pagehide`,c),a.focus();let m=e.createRange();m.selectNodeContents(a);let h=r.getSelection();return h?.removeAllRanges(),h?.addRange(m),l}function UV(e,t){return e.querySelector(`[data-frame="${CSS.escape(t)}"] iframe`)?.contentDocument??null}function WV(e,t,n,r){let i=t.find(e=>e.ref===n.frame),a=i&&UV(e,i.ref),o=a&&Bz(a,n.index);if(!i||!o)return!1;let s=o.getBoundingClientRect(),c=r.x-i.box.x,l=r.y-i.box.y;return c>=s.left&&c<s.right&&l>=s.top&&l<s.bottom}function GV(e,t,n,r){let i=null,a=()=>{e.removeEventListener(`load`,o,!0),s()};function o(){let r=UV(e,t.frame);i=r?HV(r,t,n):null,i&&a()}let s=r.subscribe(({element:e})=>{(e?.frame!==t.frame||e.index!==t.index)&&a()});return e.addEventListener(`load`,o,!0),o(),()=>{a(),i?.()}}function KV({name:e,label:t,onCommit:n,onCancel:r,hug:i=!1,clearable:a=!1}){let o=(0,_.useRef)(null),s=(0,_.useRef)(!1),[c,l]=(0,_.useState)(e);(0,_.useEffect)(()=>{o.current?.focus(),o.current?.select()},[]);let u=t=>{if(s.current)return;s.current=!0;let i=o.current?.value.trim()??``;t&&(a||i!==``)&&i!==e?n(i):r()},d=(0,X.jsx)(`input`,{ref:o,"aria-label":t,value:c,onChange:e=>l(e.target.value),size:i?1:void 0,spellCheck:!1,onClick:e=>e.preventDefault(),onKeyDown:e=>{if(e.key===`Enter`)u(!0);else if(e.key===`Escape`)u(!1);else return;e.preventDefault(),e.stopPropagation()},onBlur:()=>u(!0),className:Q(`h-[22px] min-w-0 rounded-[5px] bg-background px-1.5 text-foreground ring-[1.5px] ring-primary outline-none selection:bg-primary/45`,i?`col-start-1 row-start-1 w-full`:`-ml-1.5 flex-1`)});return i?(0,X.jsxs)(`span`,{className:`-ml-1.5 inline-grid max-w-[calc(100%+0.375rem)] min-w-0 grid-cols-[minmax(0,auto)]`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1 h-0 px-1.5 whitespace-pre`,children:`${c} `}),d]}):d}var qV=_.createContext(void 0);function JV(e){let t=_.useContext(qV);if(t===void 0&&!e)throw Error(Za(47));return t}var YV={...gp,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!gp.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&gp.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>gp.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},XV=class extends wo{constructor(e,t,n){let r=new sp;super(ZV(e,r,t,n),QV(r),YV)}setOpen=(e,t)=>{let n=t.reason===gd,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=ep(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=$f(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),gu.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function ZV(e,t,n,r=!1){let i={...up(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function QV(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:_.createRef(),beforeTriggerFocusGuardRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),stickIfOpenTimeout:new as,stickIfOpen:!0,triggerElements:e}}var $V=co(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=tH(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),op(u,d),rp(u);let{forceUnmount:m}=ip(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),_.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),_.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,fd(zd))}),[m,u]);let h=d||f||s!=null;return(0,X.jsxs)(qV.Provider,{value:u,children:[s&&(0,X.jsx)(Xf,{handle:s,store:u}),h&&(0,X.jsx)(nH,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function eH(e){return JV(!0)?(0,X.jsx)($V,{props:e}):(0,X.jsx)(Df,{children:(0,X.jsx)($V,{props:e})})}function tH(e,t){let n=Yf((e,n)=>new XV(t,e,n));return _.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function nH({store:e,modal:t}){let n=Uf(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return ap(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}function rH(e){return Xu(e,`base-ui`)}function iH(e,t){function n(n,r,i){let a=n.currentTarget;gu.flushSync(()=>{e.setOpen(!1,fd(Ed,n.nativeEvent,a))}),vl(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&yl(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function aH(e){let t=_.useRef(``),n=_.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:_.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function oH(e,t){let n=_.useRef(e),r=J(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function sH(e,t){let{onClick:n,onPointerDown:r}=aH(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(vs?`touch`:``))}));return _.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function cH(e){let[t,n]=_.useState(null),r=sH(e,n);return oH(e,t=>{t&&!e&&n(null)}),_.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var lH=lo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=JV(!0),h=_p(s)??m;if(!h)throw Error(Za(74));let g=rH(f),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=_.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=np(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`isPressOpenedByTrigger`,g),E=h.useState(`isTouchPressOpen`,l),D=h.useState(`hasTriggerFocusGuards`,g),O=Dp(y,{enabled:!a&&l&&!E,mouseOnly:!0,move:!1,handleClose:Up(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=Lf(y,{stickIfOpen:J(()=>h.context.stickIfOpen)}),A=sH(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,w),{getButtonProps:M,buttonRef:N}=sd({disabled:a,native:o}),P={open(e){return T?Qs.open(e):Zs.open(e)}},{handlePreFocusGuardFocus:F,handleFocusTargetFocus:I}=iH(h,S),L=Z(`button`,e,{state:{disabled:a,open:b},ref:[N,t,C,S],props:[k.reference,O,j,A,{[Su]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,M],stateAttributesMapping:P}),R=(0,X.jsx)(_.Fragment,{children:L},g);return D?(0,X.jsxs)(_.Fragment,{children:[(0,X.jsx)(jl,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:F}),R,(0,X.jsx)(jl,{ref:h.context.triggerFocusTargetRef,onFocus:I})]}):R}),uH=_.createContext(void 0);function dH(){let e=_.useContext(uH);if(e===void 0)throw Error(Za(45));return e}var fH=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return JV().useState(`mounted`)||n?(0,X.jsx)(uH.Provider,{value:n,children:(0,X.jsx)(Gd,{ref:t,...r})}):null}),pH=_.createContext(void 0);function mH(){let e=_.useContext(pH);if(!e)throw Error(Za(46));return e}var hH=_.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function gH(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=_.useRef(null),o=_.useRef(null),s=yu(r);q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var _H={},vH={},yH=``;function bH(e,t){return No(e)?e:t}function xH(e,t,n){return/hidden|clip/.test(e.getComputedStyle(bH(t,n)).overflowY)}function SH(e){if(typeof document>`u`)return!1;let t=Zo(e);return Do(t).innerWidth-t.documentElement.clientWidth>0}function CH(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Zo(e),n=t.documentElement,r=t.body,i=bH(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function wH(e){let t=Zo(e),n=t.documentElement,r=t.body,i=bH(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function TH(e){let t=Zo(e),n=t.documentElement,r=t.body,i=Do(n),a=0,o=0,s=!1,c=ns.create();if(Cs&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,_H={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},yH=n.style.scrollBehavior,vH={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=bH(n,r);s=CH(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,_H),Object.assign(r.style,vH),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=yH)}function d(){u(),c.request(l)}l();let f=Qo(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var EH=new class{lockCount=0;restore=null;timeoutLock=as.create();timeoutUnlock=as.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Zo(e),n=t.documentElement,r=t.body,i=Do(n);if(xH(i,n,r)){let t=new i.MutationObserver(()=>{xH(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=vs||!SH(e);this.restore=a?wH(e):TH(e)}};function DH(e=!0,t=null){q(()=>{if(e)return EH.acquire(t)},[e,t])}var OH=20;function kH(e,t,n,r){let[i,a]=_.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=Zo(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-OH)},[e,t,n]),DH(e&&(!t||i),r)}var AH=_.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Ou,..._}=e,v=JV(),y=dH(),b=Tf(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=lh({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});gH({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;kH(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=ph(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,X.jsxs)(pH.Provider,{value:j,children:[S&&M&&(0,X.jsx)(hH,{inert:du(!C),cutout:T}),(0,X.jsx)(Ef,{id:b,children:P})]})}),jH=`ArrowUp`,MH=`ArrowDown`,NH=`ArrowLeft`,PH=`ArrowRight`,FH=`Home`,IH=`PageUp`,LH=`PageDown`,RH=new Set([jH,MH,NH,PH,FH,`End`]),zH=[`Shift`,`Control`,`Alt`,`Meta`];function BH(e){return jo(e)&&e.tagName===`INPUT`}function VH(e){return!!(BH(e)&&e.selectionStart!=null||jo(e)&&e.tagName===`TEXTAREA`)}function HH(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=UH(e,t,`left`),a=WH(e),o=WH(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=UH(e,t,`top`),r=WH(e),i=WH(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function UH(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function WH(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var GH=_.createContext(void 0);function KH(e){let t=_.useContext(GH);if(t===void 0&&!e)throw Error(Za(69));return t}var qH=_.createContext(void 0);function JH(){let[e,t]=_.useState(0),n=J(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:_.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var YH=_.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=JV(),l=mH(),u=KH(!0)!=null,{context:d,hasClosePart:f}=JH(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);bu({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Tp(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Jf(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Z(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...qf,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&RH.has(e.key)&&e.stopPropagation()}},fh(g),s],stateAttributesMapping:ec});return(0,X.jsx)(If,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:jo(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,X.jsx)(qH.Provider,{value:d,children:M})})}),XH=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=JV(),s=rH(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Z(`h2`,e,{ref:t,props:[{id:s},a]})});function ZH({...e}){return(0,X.jsx)(eH,{"data-slot":`popover`,...e})}function QH({...e}){return(0,X.jsx)(lH,{"data-slot":`popover-trigger`,...e})}function $H({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,anchor:a,...o}){return(0,X.jsx)(fH,{children:(0,X.jsx)(AH,{align:t,alignOffset:n,side:r,sideOffset:i,anchor:a,className:`isolate z-50`,children:(0,X.jsx)(YH,{"data-slot":`popover-content`,className:Q(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}function eU({className:e,...t}){return(0,X.jsx)(XH,{"data-slot":`popover-title`,className:Q(`font-medium`,e),...t})}function tU(){return N()(()=>({ref:null,mode:`flip`,hash:null,split:.5}))}var nU=tU();function rU(e){return F(nU,e)}var iU={compare:nU,unseen:q_,held:async(e,t)=>{try{return(await fetch(hM(e,`light`,void 0,t),{cache:`no-store`})).ok}catch{return!1}}};async function aU(e,t,{compare:n,unseen:r,held:i}=iU){let a=r.getState().base[e];if(!a)return;let o=n.getState();o.ref===e&&o.hash===a?n.setState({mode:t}):await i(e,a)?r.getState().base[e]===a&&n.setState({ref:e,mode:t,hash:a,split:.5}):(L_(r,e),_g.add({title:`The version before is gone`,description:`The server keeps it until it restarts or 200 later changes land.`,type:`warning`}))}function oU(e=nU){e.getState().ref!==null&&e.setState({ref:null,hash:null})}function sU(e,t=nU){let{ref:n}=t.getState(),r=n&&document.querySelector(`[data-frame="${CSS.escape(n)}"]`);if(!r)return;let{left:i,width:a}=r.getBoundingClientRect();a<=0||t.setState({split:Math.min(1,Math.max(0,(e-i)/a))})}var cU={...iU,selection:_P,mode:c_};function lU(e=cU){(0,_.useEffect)(()=>{let{compare:t,unseen:n,selection:r,mode:i}=e,a=()=>i.getState().mode===`edit`,o=()=>{let{frames:e}=r.getState(),[t]=e;return e.length===1&&t&&n.getState().base[t]?t:null},s=e=>()=>{let n=t.getState();return n.ref!==null&&n.mode===e},c=t=>()=>{let n=o();n&&aU(n,t,e)},l=ye([{id:`frame.compare`,label:`Compare with before`,group:`frame`,command:{label:`Compare with before`,icon:On},enabled:()=>a()&&o()!==null,checked:s(`flip`),run:c(`flip`)},{id:`frame.compare.split`,label:`Split with before`,group:`frame`,command:{label:`Split with before`,icon:Zt},enabled:()=>a()&&o()!==null,checked:s(`split`),run:c(`split`)},{id:`frame.compare.end`,label:`End compare`,group:`frame`,keys:[`Escape`],command:{label:`End compare`,icon:Xi},enabled:()=>t.getState().ref!==null,run:()=>oU(t)}]),u=[t.subscribe(G),n.subscribe(e=>{let{ref:n,hash:r}=t.getState();n&&e.base[n]!==r&&oU(t),G()}),r.subscribe(()=>oU(t)),i.subscribe(e=>{(e.mode===`play`||e.tool===`note`)&&oU(t)})];return()=>{for(let e of u)e();l(),oU(t)}},[e])}var uU=.05;function dU({frameRef:e,name:t,hash:n}){let r=rU(e=>e.mode),i=rU(e=>e.split),a=DM(e),o=(0,_.useRef)(null),s=(0,_.useMemo)(()=>hM(e,TM(e),void 0,n),[e,n]);(0,_.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{let t=e.contentDocument?.documentElement;t&&pM(t,a)};return t(),e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[a]);let c=r===`split`,l=`${Math.round(i*1e3)/10}%`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{"data-compare-before":e,className:`absolute inset-0 overflow-hidden`,style:c?{clipPath:`inset(0 calc(100% - ${l}) 0 0)`}:void 0,children:(0,X.jsx)(`iframe`,{ref:o,title:`${t} before`,src:s,tabIndex:-1,style:{colorScheme:a},className:`block size-full border-0 bg-[color:Canvas]`})}),(0,X.jsx)(fU,{side:`left`,children:`Before`}),c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(fU,{side:`right`,children:`Now`}),(0,X.jsx)(pU,{frameRef:e,name:t,at:i,percent:l})]}):null]})}function fU({side:e,children:t}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`pointer-events-none absolute bottom-[calc(6px/var(--zoom,1))] flex h-[18px] items-center rounded-[9px] bg-[color-mix(in_srgb,var(--claim)_22%,var(--card))] px-1.5 text-label font-medium text-claim [transform:scale(calc(1/var(--zoom,1)))]`,e===`left`?`left-[calc(6px/var(--zoom,1))] origin-bottom-left`:`right-[calc(6px/var(--zoom,1))] origin-bottom-right`),children:t})}function pU({frameRef:e,name:t,at:n,percent:r}){let i=e=>nU.setState({split:Math.min(1,Math.max(0,e))});return(0,X.jsx)(`div`,{"data-compare-divider":e,role:`slider`,tabIndex:0,"aria-label":`Split between ${t} before and now`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n*100),"aria-valuetext":`${Math.round(n*100)}% before`,onKeyDown:e=>{let t={ArrowLeft:-.05,ArrowDown:-.05,ArrowRight:uU,ArrowUp:uU}[e.key];if(t!==void 0)i(n+t);else if(e.key===`Home`)i(0);else if(e.key===`End`)i(1);else return;e.preventDefault(),e.stopPropagation()},className:`absolute top-0 bottom-0 w-[calc(2px/var(--zoom,1))] -translate-x-1/2 bg-claim outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,style:{left:r},children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-1/2 left-1/2 h-7 w-3.5 rounded-[7px] bg-card shadow-[0_0_0_2px_var(--claim)] [transform:translate(-50%,-50%)_scale(calc(1/var(--zoom,1)))]`})})}var mU=[{value:`now`,label:`Now`},{value:`flip`,label:`Before`},{value:`split`,label:`Split`}];function hU({frameRef:e,name:t}){let n=rU(t=>t.ref===e),r=rU(e=>e.mode),i=t=>{t===`now`?oU():aU(e,t)};if(!n)return(0,X.jsx)(`button`,{type:`button`,"data-label-control":!0,"aria-label":`Compare ${t} with before`,title:`Compare with before`,onClick:()=>i(`flip`),className:`grid size-[18px] shrink-0 place-items-center rounded-[5px] bg-secondary text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(On,{"aria-hidden":!0,className:`size-3`})});let a=r;return(0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":`Compare ${t}`,onKeyDown:t=>{let n={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1}[t.key];if(n===void 0)return;t.preventDefault(),t.stopPropagation();let r=mU[(mU.findIndex(e=>e.value===a)+n+mU.length)%mU.length];r&&(i(r.value),r.value!==`now`&&requestAnimationFrame(()=>document.querySelector(`[data-compare-option="${CSS.escape(`${e}:${r.value}`)}"]`)?.focus()))},className:`flex shrink-0 gap-px rounded-md bg-secondary p-0.5`,children:mU.map(({value:t,label:n})=>{let r=t===a;return(0,X.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,tabIndex:r?0:-1,"data-label-control":!0,"data-compare-option":`${e}:${t}`,onClick:()=>i(t),className:Q(`flex h-4 items-center rounded px-1.5 font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`bg-card text-foreground shadow-[0_0_0_1px_var(--border)]`:`text-muted-foreground hover:text-foreground`),children:n},t)})})}function gU(){return(0,X.jsx)(`span`,{role:`img`,"aria-label":`Unseen change`,"data-unseen":!0,className:`inline-block size-[7px] shrink-0 rounded-full bg-claim`})}function _U({claim:e}){let t=hB(),n=`${dB(e.tag)}${e.tag.slice(1)}`;return(0,X.jsxs)(`span`,{"data-claim-tag":!0,className:`inline-flex min-w-0 items-center gap-1.5 rounded-full bg-[color-mix(in_srgb,var(--claim)_18%,transparent)] py-0.5 pr-2 pl-[3px] font-medium text-[color-mix(in_srgb,var(--claim)_70%,var(--foreground))] motion-safe:animate-claim-tag`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`grid size-4 shrink-0 place-items-center rounded-full bg-claim text-[9px] font-bold text-card motion-safe:animate-claim-dot`,children:dB(e.agent)}),(0,X.jsxs)(`span`,{className:`truncate`,children:[n,(0,X.jsxs)(`span`,{"data-claim-elapsed":!0,className:`ml-1.5 font-normal text-[color-mix(in_srgb,var(--muted-foreground)_60%,var(--foreground))]`,children:[`editing · `,mB(e.claimedAt,t)]})]})]})}function vU({findings:e}){return(0,X.jsx)(`ul`,{className:`flex flex-col`,children:e.map((e,t)=>(0,X.jsxs)(`li`,{"data-severity":e.severity,className:`grid grid-cols-[14px_1fr] gap-1.5 rounded-md p-1.5 hover:bg-accent data-[severity=error]:[--h:var(--destructive)] data-[severity=warning]:[--h:var(--note)]`,children:[(0,X.jsx)(Ii,{role:`img`,"aria-label":e.severity===`error`?`Error`:`Warning`,className:`mt-px size-[11px] text-[var(--h)]`,strokeWidth:2}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`p`,{className:`text-xs break-words`,children:[(0,X.jsx)(`span`,{className:`font-semibold`,children:e.rule}),(0,X.jsx)(yU,{finding:e})]}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] break-words text-muted-foreground`,children:e.message})]})]},`${e.rule}:${e.location?.startOffset??``}:${t}`))})}function yU({finding:e}){let t=[bU(e),e.location?`line ${e.location.line}`:null].filter(Boolean).join(`, `);return t?(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,t]}):null}function bU(e){if(e.frame===null||e.path===`${e.frame}.html`)return null;let t=`${e.frame.split(`/`)[0]}/`;return e.path.startsWith(t)?e.path.slice(t.length):e.path}var xU=N()(()=>({ref:null}));function SU(e){xU.setState({ref:e})}function CU(e){return F(xU,t=>t.ref===e)}function wU(e,t){let n=e.contentDocument;if(!n?.body)return null;let r=e.style.height;try{e.style.height=`1px`;let r=TU(n);return e.style.height=`${t}px`,r===TU(n)?r:null}finally{e.style.height=r}}function TU(e){let t=e.defaultView;if(!t)return 1;let n=e=>{let n=t.getComputedStyle(e);return n.overflowX!==`visible`||n.overflowY!==`visible`},r=t=>{for(let r=t.parentElement;r&&r!==e.body;r=r.parentElement)if(n(r))return!0;return!1},i=(e,t)=>e<t?(t-e)/2:0,a=r=>{let a=-1/0;if(n(r))return a;let o=parseFloat(t.getComputedStyle(r).lineHeight);for(let n of r.childNodes){if(n.nodeType!==t.Node.TEXT_NODE)continue;let r=e.createRange();r.selectNodeContents(n);for(let e of r.getClientRects())(e.width!==0||e.height!==0)&&(a=Math.max(a,e.bottom-i(o,e.height)))}return a},o=[`img`,`video`,`canvas`,`iframe`,`object`,`embed`,`audio`],s=e=>{let n=e.getBoundingClientRect();if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||o.includes(e.localName))return n.bottom;let r=t.getComputedStyle(e);if(r.display!==`inline`||parseFloat(r.paddingBottom)+parseFloat(r.borderBottomWidth)>0)return n.bottom;let a=parseFloat(r.paddingTop)+parseFloat(r.borderTopWidth);return n.bottom-i(parseFloat(r.lineHeight),n.height-a)},c=e.documentElement.getBoundingClientRect().bottom;for(let t of e.querySelectorAll(`body *`))r(t)||(c=Math.max(c,s(t),a(t)));return Math.max(1,Math.ceil(c+t.scrollY))}function EU(){return N()(()=>({held:0}))}var DU=EU(),OU=N()(()=>({ref:null,surface:`layers`}));function kU(e){return F(OU,t=>t.surface===e?t.ref:null)}function AU(e,t){OU.setState({ref:e,surface:t})}function jU(){OU.setState({ref:null})}async function MU(e,t,n=uk){try{await n.renameFrame(e.ref,t)}catch(t){_k(`Couldn't rename ${e.name}`)(t)}}function NU(e){let{selection:t,mode:n,live:r,clipboard:i,calls:a}=e,o=()=>n.getState().mode===`edit`&&r.getState().canWrite&&!t.getState().element,s=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},c=()=>s().map(e=>e.ref),l=()=>o()&&s().length>0,u=()=>l()&&s().every(e=>!e.locked),d=n=>nP(t,e.page(),n.map(e=>e.ref)),f=e=>e.length===1?e[0]?.name??``:`${e.length} frames`,p=(e,t)=>n=>{i.setState(n),_g.add({title:`${e} ${f(t)}`,description:`Paste with ${U(`$mod+KeyV`)} on any page.`,type:`success`})};return[{id:`frame.rename`,label:`Rename frame`,group:`frame`,keys:[`F2`],command:{label:`Rename frame`,icon:Or},enabled:()=>o()&&s().length===1&&!n.getState().hideUi,run:()=>{let[e]=s();e&&(n.setState({tool:`move`}),AU(e.ref,`inspector`))}},{id:`frame.duplicate`,label:`Duplicate`,group:`frame`,command:{label:`Duplicate frame`,icon:tn},keys:[`$mod+KeyD`],enabled:l,run:()=>{let e=s();a.duplicateFrames(c()).then(d,_k(`Couldn't duplicate ${f(e)}`))}},{id:`frame.delete`,label:`Delete`,group:`frame`,command:{label:`Delete frame`,icon:Pi},keys:[`Backspace`,`Delete`],enabled:u,run:()=>{let e=s();a.deleteFrames(c()).catch(_k(`Couldn't delete ${f(e)}`))}},{id:`frame.hide`,label:`Hide`,group:`frame`,command:{label:`Hide frame`,icon:fn},keys:[`$mod+Shift+KeyH`],enabled:l,run:()=>{let e=s();a.flagFrames(c(),`hidden`,!0).catch(_k(`Couldn't hide ${f(e)}`))}},{id:`frame.lock`,label:`Lock`,group:`frame`,command:{label:`Lock or unlock frame`,icon:or},keys:[`$mod+Shift+KeyL`],enabled:l,checked:()=>{let e=s();return e.length>0&&e.every(e=>e.locked)},run:()=>{let e=s(),t=!e.every(e=>e.locked);a.flagFrames(c(),`locked`,t).catch(_k(`Couldn't ${t?`lock`:`unlock`} ${f(e)}`))}},{id:`frame.copy`,label:`Copy`,group:`frame`,command:{label:`Copy frame`,icon:rn},keys:[`$mod+KeyC`],enabled:l,run:()=>{let e=s();a.copyFrames(c()).then(p(`Copied`,e),_k(`Couldn't copy ${f(e)}`))}},{id:`frame.cut`,label:`Cut`,group:`frame`,command:{label:`Cut frame`,icon:ni},keys:[`$mod+KeyX`],enabled:u,run:()=>{let e=s();a.cutFrames(c()).then(p(`Cut`,e),_k(`Couldn't cut ${f(e)}`))}},{id:`frame.paste`,label:`Paste`,group:`frame`,command:{label:`Paste frames`,icon:qt},keys:[`$mod+KeyV`],enabled:()=>o()&&i.getState().held>0,run:()=>{a.pasteFrames(e.page()).then(d,_k(`Couldn't paste`))}}]}function PU(e,t){let n=(0,_.useRef)(e),r=(0,_.useRef)(t);(0,_.useEffect)(()=>{n.current=e,r.current=t},[e,t]),(0,_.useEffect)(()=>{let e=ye(NU({page:()=>n.current,frames:()=>r.current,selection:_P,mode:c_,live:Qg,clipboard:DU,calls:uk})),t=[_P.subscribe(G),c_.subscribe(G),DU.subscribe(G),Qg.subscribe((e,t)=>{!e.connected&&t.connected&&DU.setState({held:0}),G()})];return()=>{for(let e of t)e();e()}},[])}var FU=[`Escape`],IU=(0,_.memo)(function({frame:e,live:t,version:n,findings:r,claim:i,unseen:a=!1}){let{x:o,y:s,width:c,height:l}=fN(e),u=(lN(e.ref)??e.box).width,d=GM(e.ref),f=kU(`canvas`)===e.ref,p=vP(t=>t.frames.includes(e.ref)),m=(0,_.useRef)(null),h=l_(e=>e.mode===`play`),g=DM(e.ref),v=CU(e.ref),y=J_(t=>e.ref in t.base),b=rU(t=>t.ref===e.ref?t.hash:null),x=(0,_.useRef)(e.modifiedAt);(0,_.useEffect)(()=>{x.current=e.modifiedAt},[e.modifiedAt]);let[S,C]=(0,_.useState)({ref:e.ref,version:n,live:t});(S.version!==n||S.live!==t)&&C({ref:e.ref,version:n,live:t});let w=(0,_.useMemo)(()=>S.live?hM(S.ref,TM(S.ref),S.version):null,[S]);(0,_.useEffect)(()=>{let e=m.current;if(!t||!e)return;let n=()=>{let t=e.contentDocument?.documentElement;t&&pM(t,g)};return n(),e.addEventListener(`load`,n),()=>e.removeEventListener(`load`,n)},[g,t]),(0,_.useEffect)(()=>{let e=m.current;if(!t||!e)return;let n=()=>{e.dataset.renderedAt=x.current};return e.addEventListener(`load`,n),()=>e.removeEventListener(`load`,n)},[t]),(0,_.useEffect)(()=>{let n=m.current;if(!t||!n)return;let r=()=>{let{page:t,element:r}=_P.getState(),i=n.contentDocument;if(r?.frame!==e.ref||!t||!i)return;let a=Vz(i);a===r.hash||mP(e.ref,a)||nP(_P,t,[e.ref])};return n.addEventListener(`load`,r),()=>n.removeEventListener(`load`,r)},[t,e.ref]);let T=d?.width,{hugHeight:E,box:D}=e;(0,_.useEffect)(()=>{let n=m.current;if(!t||!n||T===void 0||!E)return;let r=()=>QM(e.ref,T,wU(n,D.height));return r(),n.addEventListener(`load`,r),()=>n.removeEventListener(`load`,r)},[t,T,E,e.ref,D.height]),(0,_.useEffect)(()=>{let e=m.current;if(!h||!e)return;let t=()=>{},n=()=>{t();let n=e.contentWindow;t=n?Te(n,FU):()=>{}};return n(),e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n),t()}},[h,t]);let O=i&&!h?i:void 0;return(0,X.jsxs)(`div`,{"data-frame":e.ref,"data-selected":p||void 0,"data-claimed":O?!0:void 0,"data-findings-open":v||void 0,className:`absolute`,style:{left:o,top:s,width:c,height:l,zIndex:e.order},children:[(0,X.jsxs)(`div`,{className:Q(`absolute bottom-full left-0 flex origin-bottom-left items-center gap-1.5 pb-1 text-label [transform:scale(calc(1/var(--zoom,1)))]`,`[[data-label-crowded]:not([data-label-hover]):not([data-selected]):not([data-findings-open])>&]:hidden`,O?`text-claim`:`text-muted-foreground`,f&&`invisible`),style:{maxWidth:`calc(${Math.max(c,u)}px * var(--zoom, 1))`},title:e.name,children:[e.locked?(0,X.jsx)(or,{role:`img`,"aria-label":`Locked`,className:`size-[11px] shrink-0`,strokeWidth:1.6}):null,a&&!i?(0,X.jsx)(gU,{}):null,(0,X.jsx)(`span`,{className:Q(`truncate`,(d||O)&&`shrink-[1000]`),children:e.name}),d?(0,X.jsx)(BU,{width:d.width}):null,h?null:(0,X.jsx)(zU,{frameRef:e.ref,name:e.name,theme:g}),y&&!h?(0,X.jsx)(hU,{frameRef:e.ref,name:e.name}):null,O?(0,X.jsx)(_U,{claim:O}):null,r&&r.length>0?(0,X.jsx)(UU,{frame:e,findings:r}):null]}),t?(0,X.jsx)(`iframe`,{ref:m,title:e.name,src:w??void 0,style:{colorScheme:g},className:`block size-full border-0 bg-[color:Canvas]`}):(0,X.jsx)(`div`,{"data-placeholder":!0,className:`size-full border border-border bg-card`}),t&&b&&!h?(0,X.jsx)(dU,{frameRef:e.ref,name:e.name,hash:b}):null,O?(0,X.jsx)(HU,{}):null,r&&r.length>0?(0,X.jsx)(`span`,{"aria-hidden":!0,"data-findings-dot":!0,"data-findings-badge":e.ref,"data-severity":VU(r),className:Q(`absolute top-0 left-0 hidden size-2.5 rounded-full shadow-[0_0_0_2px_var(--background)] [transform:translate(-50%,-50%)_scale(calc(1/var(--zoom,1)))] data-[severity=error]:bg-destructive data-[severity=warning]:bg-note`,`[[data-label-crowded]:not([data-label-hover]):not([data-selected]):not([data-findings-open])>&]:block`)}):null]})});function LU({frames:e,calls:t=uk}){let n=kU(`canvas`),r=e.find(e=>e.ref===n);return r?(0,X.jsx)(RU,{frame:r,calls:t}):null}function RU({frame:e,calls:t}){let{x:n,y:r,width:i}=fN(e);return(0,X.jsx)(`div`,{className:`absolute`,style:{left:n,top:r},children:(0,X.jsx)(`div`,{className:`pointer-events-auto absolute bottom-0 left-0 flex w-max origin-bottom-left pr-1.5 pb-0.5 text-label [transform:scale(calc(1/var(--zoom,1)))]`,style:{maxWidth:`clamp(160px, calc(${i}px * var(--zoom, 1)), 240px)`},children:(0,X.jsx)(KV,{hug:!0,name:e.name,label:`Rename frame ${e.name}`,onCommit:n=>{jU(),MU(e,n,t)},onCancel:jU})})})}function zU({frameRef:e,name:t,theme:n}){let r=EM(),i=`Flip ${t} to ${n===`dark`?`light`:`dark`}`;return n===r?(0,X.jsx)(`button`,{type:`button`,"data-label-control":!0,"aria-label":i,title:i,onClick:()=>CM(e),className:`invisible grid h-[18px] w-[18px] min-w-0 shrink place-items-center overflow-hidden rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 [[data-label-hover]_&]:visible`,children:(0,X.jsx)(bi,{"aria-hidden":!0,className:`size-3`})}):(0,X.jsxs)(`button`,{type:`button`,"data-label-control":!0,"aria-label":i,title:i,onClick:()=>CM(e),className:`flex h-[18px] min-w-0 shrink items-center gap-1 overflow-hidden rounded-[5px] bg-[color-mix(in_srgb,var(--foreground)_14%,transparent)] px-[5px] text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,X.jsx)(n===`dark`?gr:bi,{"aria-hidden":!0,className:`size-3`}),n===`dark`?`Dark`:`Light`]})}function BU({width:e}){return(0,X.jsxs)(`span`,{"data-preview-chip":!0,title:`Previewed at ${e} px wide. The frame's size is unchanged.`,className:`flex h-[18px] min-w-0 shrink items-center gap-1 overflow-hidden rounded-[5px] bg-[color-mix(in_srgb,var(--foreground)_14%,transparent)] px-[5px] text-foreground`,children:[(0,X.jsx)(br,{"aria-hidden":!0,className:`size-3 shrink-0`}),(0,X.jsxs)(`span`,{className:`truncate`,children:[`Preview `,e]})]})}function VU(e){return e.some(e=>e.severity===`error`)?`error`:`warning`}function HU(){return(0,X.jsx)(`svg`,{"aria-hidden":!0,"data-claim-outline":!0,className:`pointer-events-none absolute -inset-[calc(3px/var(--zoom,1))] size-[calc(100%+6px/var(--zoom,1))] overflow-visible`,children:(0,X.jsx)(`rect`,{width:`100%`,height:`100%`,fill:`none`,className:`stroke-claim [stroke-width:calc(1.5px/var(--zoom,1))] [stroke-dasharray:calc(4.5px/var(--zoom,1))_calc(3px/var(--zoom,1))] motion-safe:animate-claim-outline`})})}function UU({frame:e,findings:t}){let n=CU(e.ref),r=t.length,i=VU(t),a=`${r} finding${r===1?``:`s`}`;return(0,X.jsxs)(ZH,{open:n,onOpenChange:t=>SU(t?e.ref:null),children:[(0,X.jsxs)(QH,{"data-findings-badge":e.ref,"aria-label":`${r} check finding${r===1?``:`s`}`,"data-severity":i,className:`flex h-[18px] shrink-0 items-center gap-[3px] rounded-[9px] bg-[color-mix(in_srgb,var(--h)_34%,transparent)] pr-1.5 pl-[5px] font-medium text-[color-mix(in_srgb,var(--h)_55%,var(--foreground))] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--h)_75%,transparent)] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 data-[severity=error]:[--h:var(--destructive)] data-[severity=warning]:[--h:var(--note)]`,children:[(0,X.jsx)(Ii,{"aria-hidden":!0,className:`size-3 text-[var(--h)]`}),r]}),(0,X.jsxs)($H,{side:`bottom`,align:`start`,sideOffset:6,initialFocus:!0,className:`w-[330px] gap-1.5 p-2.5 text-body`,children:[(0,X.jsxs)(eU,{className:`text-[11px] font-semibold text-muted-foreground`,children:[a,` on `,e.name]}),(0,X.jsx)(vU,{findings:t})]})]})}function WU(e,t){let n=Object.entries(e),r=oN(n.map(([,e])=>e));if(!r||n.length<2)return{...e};let i=e=>{switch(t){case`left`:return{...e,x:r.x};case`center`:return{...e,x:Math.round(r.x+(r.width-e.width)/2)};case`right`:return{...e,x:r.x+r.width-e.width};case`top`:return{...e,y:r.y};case`middle`:return{...e,y:Math.round(r.y+(r.height-e.height)/2)};case`bottom`:return{...e,y:r.y+r.height-e.height}}};return Object.fromEntries(n.map(([e,t])=>[e,i(t)]))}function GU(e,t){let n=Object.entries(e);if(n.length<3)return{...e};let r=e=>t===`horizontal`?e.x:e.y,i=e=>t===`horizontal`?e.width:e.height,a=n.toSorted(([,e],[,t])=>r(e)-r(t)||i(e)-i(t)),[,o]=a[0]??[],[,s]=a.at(-1)??[];if(!o||!s)return{...e};let c=(r(s)+i(s)-r(o)-a.reduce((e,[,t])=>e+i(t),0))/(a.length-1),l={},u=r(o);for(let[e,n]of a){let r=Math.round(u);l[e]=t===`horizontal`?{...n,x:r}:{...n,y:r},u+=i(n)+c}return l}var KU=[{name:`Left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`Right`,key:`ArrowRight`,dx:1,dy:0},{name:`Up`,key:`ArrowUp`,dx:0,dy:-1},{name:`Down`,key:`ArrowDown`,dx:0,dy:1}],qU=[{id:`arrange.alignLeft`,label:`Align left`,alignment:`left`,key:`Alt+KeyA`},{id:`arrange.alignCenter`,label:`Align horizontal centers`,alignment:`center`,key:`Alt+KeyH`},{id:`arrange.alignRight`,label:`Align right`,alignment:`right`,key:`Alt+KeyD`},{id:`arrange.alignTop`,label:`Align top`,alignment:`top`,key:`Alt+KeyW`},{id:`arrange.alignMiddle`,label:`Align vertical centers`,alignment:`middle`,key:`Alt+KeyV`},{id:`arrange.alignBottom`,label:`Align bottom`,alignment:`bottom`,key:`Alt+KeyS`}],JU=[{id:`arrange.distributeHorizontal`,label:`Distribute horizontal spacing`,axis:`horizontal`,key:`Control+Alt+KeyH`},{id:`arrange.distributeVertical`,label:`Distribute vertical spacing`,axis:`vertical`,key:`Control+Alt+KeyV`}];function YU(e){let{selection:t,mode:n,live:r}=e,i=()=>n.getState().mode===`edit`,a=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},o=e=>()=>{let t=a();return i()&&r.getState().canWrite&&t.length>=e&&t.every(e=>!e.locked)},s=null,c,l=()=>{clearTimeout(c);let t=s;s=null,t&&e.write(t.page,t.boxes,t.started)},u=t=>{let n=a(),r=e.page(),i=n.map(e=>e.ref);s&&(s.page!==r||!ZU(s.refs,i))&&l(),s||={page:r,refs:i,started:QU(n),boxes:QU(n)};let{boxes:o}=s;for(let e of n){let n=o[e.ref]??e.box;o[e.ref]=t(n)}e.hold(o),clearTimeout(c),c=setTimeout(l,300)},d=t=>{let n=QU(a()),r=t(n),i=Object.keys(r).filter(e=>{let t=r[e],i=n[e];return t&&i&&(t.x!==i.x||t.y!==i.y)});e.write(e.page(),$U(r,i),$U(n,i))};return[{id:`selection.clear`,label:`Clear selection`,group:`selection`,palette:!1,keys:[`Escape`],enabled:()=>i()&&n.getState().tool===`move`&&(t.getState().frames.length>0||t.getState().section!==void 0),run:()=>oP(t)},{id:`selection.all`,label:`Select all`,group:`selection`,command:{label:`Select all`},keys:[`$mod+KeyA`],enabled:()=>i()&&e.frames().length>0,run:()=>nP(t,e.page(),e.frames().map(e=>e.ref))},...KU.flatMap(({name:e,key:t,dx:n,dy:r})=>[{id:`frame.nudge${e}`,label:`Nudge ${e.toLowerCase()}`,group:`frame`,palette:!1,keys:[t],enabled:o(1),run:()=>u(e=>({...e,x:e.x+n,y:e.y+r}))},{id:`frame.nudge${e}Far`,label:`Nudge ${e.toLowerCase()} 10 px`,group:`frame`,palette:!1,keys:[`Shift+${t}`],enabled:o(1),run:()=>u(e=>({...e,x:e.x+n*10,y:e.y+r*10}))},{id:`frame.resize${e}`,label:n===0?r>0?`Make taller`:`Make shorter`:n>0?`Make wider`:`Make narrower`,group:`frame`,palette:!1,keys:[`$mod+${t}`],enabled:o(1),run:()=>u(e=>({...e,width:Math.max(1,e.width+n),height:Math.max(1,e.height+r)}))}]),{id:`frame.fitHeight`,label:`Fit height`,group:`frame`,command:{label:`Fit height to content`},enabled:()=>o(1)()&&a().length===1,run:()=>{let[t]=a();t&&e.fit(t.ref).catch(_k(`Couldn't fit ${t.name} to its content`))}},...qU.map(({id:e,label:t,alignment:n,key:r})=>({id:e,label:t,group:`arrange`,command:{label:t},keys:[r],enabled:o(2),run:()=>d(e=>WU(e,n))})),...JU.map(({id:e,label:t,axis:n,key:r})=>({id:e,label:t,group:`arrange`,command:{label:t},keys:[r],enabled:o(3),run:()=>d(e=>GU(e,n))}))]}function XU(e,t){let n=(0,_.useRef)(e),r=(0,_.useRef)(t);(0,_.useEffect)(()=>{n.current=e,r.current=t},[e,t]),(0,_.useEffect)(()=>{let e=ye(YU({page:()=>n.current,frames:()=>dN(r.current),selection:_P,mode:c_,live:Qg,hold:gN,write:vN,fit:uk.fitFrame})),t=[_P.subscribe(G),Qg.subscribe(G)];return()=>{for(let e of t)e();e()}},[])}function ZU(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function QU(e){return Object.fromEntries(e.map(e=>[e.ref,e.box]))}function $U(e,t){return Object.fromEntries(t.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}))}function eW(e,t,n){let r=n.width/t.width,i=n.height/t.height;return Object.fromEntries(Object.entries(e).map(([e,a])=>{let o=Math.round(n.x+(a.x-t.x)*r),s=Math.round(n.y+(a.y-t.y)*i),c=Math.round(n.x+(a.x+a.width-t.x)*r),l=Math.round(n.y+(a.y+a.height-t.y)*i);return[e,{x:o,y:s,width:Math.max(1,c-o),height:Math.max(1,l-s)}]}))}function tW(e,t,n,r){let i=t===`nw`||t===`sw`,a=t===`nw`||t===`ne`,o=Math.round(e.x),s=Math.round(e.y),c=Math.round(e.x+e.width),l=Math.round(e.y+e.height),u=i?Math.min(Math.round(o+n),c-1):o,d=a?Math.min(Math.round(s+r),l-1):s;return{x:u,y:d,width:i?c-u:Math.max(1,Math.round(c+n)-o),height:a?l-d:Math.max(1,Math.round(l+r)-s)}}function nW(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}function rW(e){let[t,n]=(0,_.useState)(null),r=e?.frame,i=e?.index,a=e?.hash,o=e?`${r}:${i}`:null;return(0,_.useEffect)(()=>{if(r===void 0||i===void 0||o===null)return;let e=document.querySelector(`[data-frame="${CSS.escape(r)}"] iframe`);if(!e)return;let t=()=>{let t=e.contentDocument;if(!t||Vz(t)!==a)return;let r=Bz(t,i),s=t.defaultView;r&&s&&n({at:o,live:aW(r,s)})};return t(),e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[r,i,a,o]),t?.at===o?t.live:null}function iW(e){let[t,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let t=`[data-frame="${CSS.escape(e)}"]`,r=t=>{let r=t?.contentDocument,i=r?Vz(r):null,a=r?.body?zz(r,r.body):null;i!==null&&a!==null&&n({frame:e,index:a,hash:i})},i=e=>{let n=e.target;n instanceof HTMLIFrameElement&&n.closest(t)&&r(n)};return r(document.querySelector(`${t} iframe`)),document.addEventListener(`load`,i,!0),()=>document.removeEventListener(`load`,i,!0)},[e]),t?.frame===e?t:null}function aW(e,t){let n=t.getComputedStyle(e),r=e.textContent??``,i=[n.borderTopWidth,n.borderRightWidth,n.borderBottomWidth,n.borderLeftWidth];return{opacity:Number(n.opacity),radius:Math.round(parseFloat(n.borderTopLeftRadius)||0),fontFamily:n.fontFamily,fontSize:pW(n.fontSize),fontWeight:Number(n.fontWeight),lineHeight:n.lineHeight===`normal`?null:pW(n.lineHeight),letterSpacing:n.letterSpacing===`normal`?0:pW(n.letterSpacing),textAlign:hW(n.textAlign,n.direction),textDecorationLine:n.textDecorationLine,textTransform:n.textTransform,textWrapStyle:n.getPropertyValue(`text-wrap-style`)||`auto`,truncated:n.textOverflow===`ellipsis`&&n.overflowX!==`visible`&&n.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:n.display,color:n.color,bordered:i.some(e=>parseFloat(e)>0),holdsText:r.trim()!==``,textOnly:e.childElementCount===0&&r.trim()!==``,text:r,rotation:{degrees:lW(n.rotate),scale:uW(n.scale),own:fW(e,t),translated:dW(n.transform)},placement:oW(e,n,t),layout:sW(e,n,t),inline:mW(e)}}function oW(e,t,n){let r=t.position===`absolute`||t.position===`fixed`,i=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},a=i(t.width),o=i(t.height),s=`style`in e?e.style:null,c={width:s?.getPropertyValue(`width`)??``,height:s?.getPropertyValue(`height`)??``};if(r&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:r,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:a,height:o,inline:c};let l=e.ownerDocument,u=e.parentElement,d=e=>{let t=n.getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},f=null;if(t.position!==`fixed`){if(!r&&u&&u!==l.body&&u!==l.documentElement)f=u;else for(let e=u;e&&!f;e=e.parentElement)d(e)&&(f=e)}let p=t.position===`fixed`?0:-n.scrollX,m=t.position===`fixed`?0:-n.scrollY;if(f){let e=f.getBoundingClientRect();p=e.left+f.clientLeft-f.scrollLeft,m=e.top+f.clientTop-f.scrollTop}let h=e.getBoundingClientRect();return{free:r,left:Math.round(h.left-p-(parseFloat(t.marginLeft)||0)),top:Math.round(h.top-m-(parseFloat(t.marginTop)||0)),width:a,height:o,inline:c}}function sW(e,t,n){let r=e.parentElement,i=r?n.getComputedStyle(r):null,a=`offsetWidth`in e?e:null,o=e=>pW(e)||0;return{flow:nW(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!a?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:o(t.rowGap),columnGap:t.columnGap===`normal`?0:o(t.columnGap),padding:{top:o(t.paddingTop),right:o(t.paddingRight),bottom:o(t.paddingBottom),left:o(t.paddingLeft)},parent:i?nW(i.display,i.flexDirection,i.flexWrap):`block`,parentAlignItems:i?.alignItems??`normal`,width:Math.round(a?.offsetWidth??0),height:Math.round(a?.offsetHeight??0)}}var cW={deg:1,grad:.9,rad:180/Math.PI,turn:360};function lW(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?cW[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function uW(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function dW(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}function fW(e,t){let n=`style`in e?e:null,r=!!n?.style.getPropertyValue(`rotate`),i=!!n?.style.getPropertyValue(`scale`);if(!n||!r&&!i)return{};let a=n.getAttribute(`style`);n.style.removeProperty(`rotate`),n.style.removeProperty(`scale`);let o=t.getComputedStyle(n),s={...r?{rotate:lW(o.rotate)}:{},...i?{scale:uW(o.scale)}:{}};return a===null?n.removeAttribute(`style`):n.setAttribute(`style`,a),s}function pW(e){return Math.round(parseFloat(e)*100)/100}function mW(e){let t=`style`in e?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function hW(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}function gW(e,t,n,r=_W){let[i,a]=(0,_.useState)(null),o=e===null?null:`${e}:${t??``}`;return(0,_.useEffect)(()=>{if(e===null||o===null)return;let n=!0;return r(e,t).catch(()=>null).then(e=>{n&&e&&a({at:o,styles:e})}),()=>{n=!1}},[e,t,n,o,r]),i?.at===o?i.styles:null}async function _W(e,t){let n=new URLSearchParams({ref:e});t!==void 0&&n.set(`index`,String(t));let r=await(await fetch(`/api/frames/styles?${n}`)).json();return r.ok?r.data:null}var vW=new Map;function yW(e,t,n){let r=`${e.frame}:${e.index}:${t}`,i=document.querySelector(`[data-frame="${CSS.escape(e.frame)}"] iframe`)?.contentDocument,a=i?Bz(i,e.index):null,o=a&&`style`in a?a:null,s=vW.get(r);if(n===null){if(vW.delete(r),!s||s.element!==o||!o)return;s.value===``?o.style.removeProperty(t):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&vW.set(r,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t)}),o.style.setProperty(t,n,`important`))}function bW(e){return e?.localName===`div`&&e.childElementCount===0&&(e.textContent??``).trim()===``}function xW(e,t,n,r,i){let{width:a,height:o}=tW(e,t,n,r);if(!i||e.width<=0||e.height<=0)return{width:a,height:o};let s=Math.max(a/e.width,o/e.height);return{width:Math.max(1,Math.round(e.width*s)),height:Math.max(1,Math.round(e.height*s))}}function SW(e,t){let n=e.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;if(!n||Vz(n)!==t.hash)return!1;let r=Bz(n,t.index),i=r?n.defaultView?.getComputedStyle(r).rotate:void 0;return bW(r)&&i!==void 0&&lW(i)===0}function CW(e,t){let n=Qg.getState().claims[t.frame];if(n)return _g.add({title:`Nothing resized`,description:`${n.tag} is editing ${t.frame.split(`/`).at(-1)}, so nothing was written.`,type:`warning`}),null;let r=e=>{yW(t,`width`,e?`${e.width}px`:null),yW(t,`height`,e?`${e.height}px`:null)};return{preview:r,commit:async({width:n,height:i})=>{let a=await BB(e,t,{kind:`styles`,declarations:[{property:`width`,value:`${n}px`},{property:`height`,value:`${i}px`}]});return a||r(null),a},cancel:()=>r(null)}}function wW(e,t){let n=e.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;if(!n||Vz(n)!==t.hash)return null;let r=Bz(n,t.index),i=r?n.defaultView?.getComputedStyle(r):void 0;if(!i||i.position!==`absolute`&&i.position!==`fixed`)return null;let a=parseFloat(i.left),o=parseFloat(i.top);return Number.isNaN(a)||Number.isNaN(o)?null:{left:a,top:o}}function TW(e,t){let n=Qg.getState().claims[t.frame];if(n)return _g.add({title:`Nothing moved`,description:`${n.tag} is editing ${t.frame.split(`/`).at(-1)}, so nothing was written.`,type:`warning`}),null;let r=e=>{yW(t,`left`,e?`${e.left}px`:null),yW(t,`top`,e?`${e.top}px`:null)};return{preview:r,commit:async({left:n,top:i})=>{let a=await BB(e,t,{kind:`styles`,declarations:[{property:`left`,value:`${n}px`},{property:`top`,value:`${i}px`}]});return a||r(null),a},cancel:()=>r(null)}}function EW(e,t,n){let{x:r,y:i,width:a}=e.box,o=t===null?null:n?.querySelector(`[data-frame="${CSS.escape(e.ref)}"] iframe`)?.contentDocument,s=o&&t!==null?Bz(o,t):null;if(!s)return{x:r+a,y:i};let c=s.getBoundingClientRect();return{x:r+Math.min(c.right,a),y:i+Math.max(c.top,0)}}var DW=`tool.image`,OW=[{kind:`rectangle`,id:`tool.rectangle`,label:`Rectangle`,key:`r`,icon:mi},{kind:`ellipse`,id:`tool.ellipse`,label:`Ellipse`,key:`o`,icon:Gt},{kind:`divider`,id:`tool.divider`,label:`Divider`,key:`l`,icon:fr}],kW=N()(()=>({shape:`rectangle`})),AW=N()(()=>({file:null})),jW=N()(()=>({open:!1}));function MW(e){AW.setState({file:e}),jW.setState({open:!1}),c_.setState({tool:`image`,mode:`edit`}),G()}var NW=N()(()=>({carried:null})),PW=null;function FW(e){PW=e}function IW(){let e=PW;return PW=null,e}function LW(e){return OW.find(t=>t.kind===e)??OW[0]}function RW(){return LW(F(kW,e=>e.shape))}function zW(){let{mode:e,tool:t}=c_.getState();return e===`edit`?t===`text`?`text`:t===`image`?AW.getState().file?`asset`:null:t===`shape`?kW.getState().shape:null:null}function BW(e){return e===`text`||e===`shape`||e===`image`}var VW=()=>Qg.getState().canWrite,HW=()=>BW(c_.getState().tool);function UW(){(0,_.useEffect)(()=>{let e=ye([{id:`tool.text`,label:`Text`,group:`tool`,command:{label:`Add text`,icon:Hi},keys:[`t`],enabled:VW,run:()=>c_.setState({tool:`text`,mode:`edit`}),checked:()=>c_.getState().mode===`edit`&&c_.getState().tool===`text`},...OW.map(e=>({id:e.id,label:e.label,group:`tool`,command:{label:`Add ${/^[aeiou]/i.test(e.label)?`an`:`a`} ${e.label.toLowerCase()}`,icon:e.icon},keys:[e.key],enabled:VW,run:()=>{kW.setState({shape:e.kind}),c_.setState({tool:`shape`,mode:`edit`}),G()},checked:()=>c_.getState().mode===`edit`&&c_.getState().tool===`shape`&&kW.getState().shape===e.kind})),{id:DW,label:`Image or video`,group:`tool`,command:{label:`Add an image or video`,icon:Pn},keys:[`$mod+Shift+KeyK`],enabled:VW,run:()=>jW.setState({open:!0}),checked:()=>c_.getState().mode===`edit`&&c_.getState().tool===`image`}]),t=Qg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(G(),!e.canWrite&&(jW.setState({open:!1}),HW()&&c_.setState({tool:`move`})))});return()=>{t(),e(),jW.setState({open:!1}),HW()&&c_.setState({tool:`move`})}},[])}function WW(e,t,n){let r=6/n,i=(e,t)=>Math.abs(e-t)<=r,a=i(t.x,e.x),o=i(t.x,e.x+e.width),s=i(t.y,e.y),c=i(t.y,e.y+e.height);return s&&a?`nw`:s&&o?`ne`:c&&a?`sw`:c&&o?`se`:null}function GW(e,t,n){let r=6/n,i=(e,t,n)=>e>=t-r&&e<=n+r,a=(e,t)=>Math.abs(e-t)<=r,o=e.x+e.width,s=e.y+e.height;return i(t.x,e.x,o)&&(a(t.y,e.y)||a(t.y,s))||i(t.y,e.y,s)&&(a(t.x,e.x)||a(t.x,o))}function KW(e,t,n){for(let r of e.querySelectorAll(t)){let{left:e,right:t,top:i,bottom:a}=r.getBoundingClientRect();if(n.clientX>=e&&n.clientX<=t&&n.clientY>=i&&n.clientY<=a)return r}return null}function qW(e,t){return KW(e,`[data-findings-badge]`,t)?.dataset.findingsBadge??null}function JW(e){let t=e.querySelector(`[data-element-selection]`);if(!t)return null;let{left:n,top:r,width:i,height:a}=t.style;return{x:parseFloat(n),y:parseFloat(r),width:parseFloat(i),height:parseFloat(a)}}function YW(e,t,n){let r=20/n;for(let n=e.length-1;n>=0;--n){let i=e[n];if(!i||i.hidden)continue;let{x:a,y:o,width:s,height:c}=i.box;if(t.x>=a&&t.x<=a+s&&t.y>=o-r&&t.y<=o+c)return i}return null}function XW(e,t){return e.filter(({hidden:e,box:n})=>!e&&n.x<=t.x+t.width&&n.x+n.width>=t.x&&n.y<=t.y+t.height&&n.y+n.height>=t.y)}var ZW=[`start`,`center`,`end`];function QW(e,t,n){let r=eG(e,t,`x`,ZW,n),i=eG(e,t,`y`,ZW,n);return nG({...e,x:Math.round(e.x+(r?.delta??0)),y:Math.round(e.y+(i?.delta??0))},r,i)}function $W(e,t,n,r){let i=eG(e,n,`x`,[t.x],r),a=eG(e,n,`y`,[t.y],r),o={...e},s=Math.round(i?.delta??0),c=Math.round(a?.delta??0);return t.x===`start`?(o.x+=s,o.width-=s):o.width+=s,t.y===`start`?(o.y+=c,o.height-=c):o.height+=c,o.width<1||o.height<1?{box:e,guides:[],gaps:[]}:nG(o,i,a)}function eG(e,t,n,r,i){let a=null;for(let o of r.map(t=>tG(e,n,t)))for(let e of t)for(let t of ZW.map(t=>tG(e,n,t))){let n=t-o;Math.abs(n)>i||a&&Math.abs(n)>Math.abs(a.delta)||(a&&n===a.delta&&t===a.at?a.targets.includes(e)||a.targets.push(e):a={delta:n,at:t,targets:[e]})}return a}function tG(e,t,n){let r=t===`x`?e.x:e.y,i=t===`x`?e.width:e.height;return n===`start`?r:n===`end`?r+i:r+i/2}function nG(e,t,n){let r=[];if(t){let n=[e,...t.targets];r.push({axis:`x`,at:t.at,from:Math.min(...n.map(e=>e.y)),to:Math.max(...n.map(e=>e.y+e.height))})}if(n){let t=[e,...n.targets];r.push({axis:`y`,at:n.at,from:Math.min(...t.map(e=>e.x)),to:Math.max(...t.map(e=>e.x+e.width))})}let i=[],a=n?rG(e,n.targets,`x`):null;a&&i.push(a);let o=t?rG(e,t.targets,`y`):null;return o&&i.push(o),{box:e,guides:r,gaps:i}}function rG(e,t,n){let r=null,i=e=>n===`x`?e.x:e.y,a=e=>i(e)+(n===`x`?e.width:e.height),o=n===`x`?e.y+e.height/2:e.x+e.width/2;for(let s of t){let t=a(s)<=i(e)?{from:a(s),to:i(e)}:a(e)<=i(s)?{from:a(e),to:i(s)}:null;!t||t.to-t.from<=0||r&&r.to-r.from<=t.to-t.from||(r={axis:n,at:o,...t})}return r}var iG={selection:_P,mode:c_,canWrite:()=>Qg.getState().canWrite,write:vN,duplicate:uk.duplicateFrames,openFindings:SU,splitAt:sU,moveElement:hV,isShape:SW,resizeShape:CW,placedOffsets:wW,movePlaced:TW};function aG(e,t,n=iG){let{selection:r,mode:i}=n,a={kind:`none`},o={x:0,y:0},s={x:0,y:0},c=!1,l=!1,u=null,d=new Map,f=()=>t.layer.querySelector(`[data-overlay]`),p=(e,n)=>{let r=t.layer.querySelector(`[data-element-selection]`);r&&(r.style.transform=e===0&&n===0?``:`translate(${e}px, ${n}px)`)},m=(e,n,r)=>{let i=t.viewport.querySelectorAll(`[data-note-frame]`);for(let t of i){let i=e.includes(t.dataset.noteFrame??``)&&(n!==0||r!==0);t.style.translate=i?`${n}px ${r}px`:``}},h=(e,n,r)=>{let i=t.viewport.querySelectorAll(`[data-note-frame="${CSS.escape(e.frame)}"][data-note-element="${e.index}"]`);for(let e of i)e.style.translate=n!==0||r!==0?`${n}px ${r}px`:``},g=e=>{let n=t.viewport.querySelectorAll(`[data-note-frame]`);for(let r of n){let n=r.dataset.noteFrame??``,i=e[n];if(!i){r.style.translate=``;continue}let a=r.dataset.noteElement,o=EW({ref:n,box:i},a===void 0?null:Number(a),t.layer),s=o.x-parseFloat(r.style.left),c=o.y-parseFloat(r.style.top);r.style.translate=s!==0||c!==0?`${s}px ${c}px`:``}},_=()=>xz(t.viewport).k,v=e=>{let[n,r]=OI(e,t.viewport),{x:i,y:a,k:o}=xz(t.viewport);return{x:(n-i)/o,y:(r-a)/o}},y=e=>{let{page:n,frames:i}=r.getState();return n===t.page?e.filter(e=>i.includes(e.ref)):[]},b=e=>Object.fromEntries(e.map(e=>[e.ref,e.box])),x=e=>t.sections?.().find(t=>t.name===e),S=e=>t.layer.querySelector(`[data-section="${CSS.escape(e)}"]`),C=(e,t)=>{let n=S(e);n&&Object.assign(n.style,{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})},w=e=>{let i=mN(t.frames()),d=v(e);o=d,s={x:e.clientX,y:e.clientY},c=!1,u=e;let f=oG();l=f!==null,f?.blur();let p=KW(t.layer,`[data-label-control]`,e);if(p){a={kind:`control`,element:p};return}if(KW(t.layer,`[data-compare-divider]`,e)){a={kind:`divider`},n.splitAt(e.clientX);return}let m=qW(t.layer,e);if(m){a={kind:`badge`,ref:m};return}let h=r.getState().element,g=h?JW(t.layer):null,S=g?WW(g,d,_()):null;if(h&&g&&S&&n.isShape(t.layer,h)){a={kind:`shape`,key:h,corner:S,box:g};return}if(h&&g){let r=GW(g,d,_());if(r||sG(g,d)){a={kind:`element`,key:h,frame:r?null:YW(i,d,_()),shift:e.shiftKey,placed:n.placedOffsets(t.layer,h)};return}}let C=x(r.getState().page===t.page?r.getState().section:void 0),w=C?KW(t.layer,`[data-section-corner]`,e):null;if(C&&w){a={kind:`section-resize`,section:C,corner:w.dataset.sectionCorner,moved:!1};return}let T=oN(y(i).map(e=>e.box)),E=T&&!h?WW(T,d,_()):null,D=y(dN(t.frames())),O=oN(D.map(e=>e.box));if(O&&E){a={kind:`resize`,corner:E,boxes:b(D),bounds:O};return}let k=i.some(e=>sG(e.box,d))?null:cG(t.layer,`[data-section-label]`,e),A=x(k?.dataset.sectionLabel);if(A){l||rP(r,t.page,A.name),a={kind:`section`,section:A};return}let j=YW(i,d,_());if(j){let n=!D.some(({ref:e})=>e===j.ref);!l&&!e.shiftKey&&n&&nP(r,t.page,[j.ref]),a={kind:`press`,frame:j,shift:e.shiftKey}}else a={kind:`marquee`,shift:e.shiftKey,base:e.shiftKey?r.getState().frames:[]}},T=()=>{if(a.kind===`shape`){let e=n.canWrite()?n.resizeShape(t.page,a.key):null;a=e?{...a,kind:`shape-resize`,resize:e,size:null}:{kind:`none`}}else if(a.kind===`element`&&a.placed){let e=n.canWrite()?n.movePlaced(t.page,a.key):null;a=e?{kind:`placed`,key:a.key,from:a.placed,move:e,to:null}:{kind:`none`}}else if(a.kind===`element`)a=n.canWrite()?{kind:`carry`,key:a.key}:{kind:`none`},a.kind===`carry`&&NW.setState({carried:a.key});else if(a.kind===`section`){let{section:e}=a,i=dN(t.pageFrames?.()??t.frames()).filter(t=>e.frames.includes(t.name));a=n.canWrite()&&i.every(({locked:e})=>!e)?{kind:`section-move`,section:e,boxes:b(i)}:{kind:`none`},a.kind===`section-move`&&(rP(r,t.page,e.name),ZM(Object.keys(a.boxes)),d=E(Object.keys(a.boxes)))}else if(a.kind===`section-resize`)n.canWrite()||(a={kind:`none`});else if(a.kind===`press`||a.kind===`resize`){if(a.kind===`press`){let{frame:e,shift:i}=a,o=!r.getState().frames.includes(e.ref);i&&o?aP(r,t.page,e.ref):l&&o&&nP(r,t.page,[e.ref]);let s=y(dN(t.frames())),c=oN(s.map(({box:e})=>e));a=c&&s.every(({locked:e})=>!e)&&n.canWrite()?{kind:`move`,boxes:b(s),bounds:c}:{kind:`none`}}else{let e=Object.keys(a.boxes);(t.frames().some(t=>e.includes(t.ref)&&t.locked)||!n.canWrite())&&(a={kind:`none`})}(a.kind===`move`||a.kind===`resize`)&&(ZM(Object.keys(a.boxes)),d=E(Object.keys(a.boxes)))}},E=e=>new Map(e.flatMap(e=>{let n=t.layer.querySelector(`[data-frame="${CSS.escape(e)}"]`);return n?[[e,n]]:[]})),D=e=>{let n=f();if(!n)return;let r=v(e),i=r.x-o.x,s=r.y-o.y,c=e.ctrlKey?-1:6/_(),l=()=>mN(t.frames()).filter(e=>!(`boxes`in a&&e.ref in a.boxes)).map(e=>e.box);switch(a.kind){case`move`:{let{bounds:e,boxes:t}=a,r=QW({...e,x:Math.round(e.x+i),y:Math.round(e.y+s)},l(),c),o=r.box.x-e.x,u=r.box.y-e.y;for(let[e,n]of Object.entries(t)){let t=d.get(e);t&&(t.style.left=`${n.x+o}px`,t.style.top=`${n.y+u}px`)}Kz(n,o,u,r.box),p(o,u),m(Object.keys(t),o,u),Yz(n,r.guides,r.gaps);return}case`resize`:{let{bounds:e,boxes:t,corner:r}=a,o=$W(tW(e,r,i,s),{x:r.endsWith(`w`)?`start`:`end`,y:r.startsWith(`n`)?`start`:`end`},l(),c),u=eW(t,e,o.box);for(let[e,t]of Object.entries(u)){let n=d.get(e);n&&Object.assign(n.style,{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})}g(u),qz(n,u),Yz(n,o.guides,o.gaps);return}case`section-move`:{let{section:e,boxes:t}=a,r=QW({...e.box,x:Math.round(e.box.x+i),y:Math.round(e.box.y+s)},l(),c),o=r.box.x-e.box.x,u=r.box.y-e.box.y;C(e.name,r.box);for(let[e,n]of Object.entries(t)){let t=d.get(e);t&&(t.style.left=`${n.x+o}px`,t.style.top=`${n.y+u}px`)}m(Object.keys(t),o,u),Yz(n,r.guides,r.gaps);return}case`section-resize`:a.moved=!0,C(a.section.name,lG(tW(a.section.box,a.corner,i,s)));return;case`placed`:{let e=Math.round(i),t=Math.round(s);a.to={left:a.from.left+e,top:a.from.top+t},a.move.preview(a.to),p(e,t),h(a.key,e,t);return}case`shape-resize`:a.size=xW(a.box,a.corner,i,s,e.shiftKey),a.resize.preview(a.size);return;case`marquee`:{let e=uG(o,r);Jz(n,e,XW(mN(t.frames()),e).map(e=>e.box));return}default:return}},O=e=>{let[i]=Object.entries(e),a=i?d.get(i[0]):void 0;if(!i||!a)return;let o={x:parseFloat(a.style.left)-i[1].x,y:parseFloat(a.style.top)-i[1].y};for(let[t,n]of Object.entries(e)){let e=d.get(t);e&&(e.style.left=`${n.x}px`,e.style.top=`${n.y}px`)}if(o.x===0&&o.y===0)return;let s=Object.keys(e);n.duplicate(s,o).then(e=>nP(r,t.page,e.map(e=>e.ref)),_k(s.length===1?`Couldn't duplicate ${s[0]?.split(`/`).at(-1)??`the frame`}`:`Couldn't duplicate ${s.length} frames`))},k=e=>{let i=f();if(!c){if(l){a={kind:`none`};return}a.kind===`badge`?n.openFindings(a.ref):a.kind===`control`?a.element.click():a.kind===`press`||a.kind===`element`&&a.frame?a.shift?aP(r,t.page,a.frame.ref):nP(r,t.page,[a.frame.ref]):a.kind===`section`?rP(r,t.page,a.section.name):a.kind===`marquee`&&!a.shift&&oP(r),a={kind:`none`};return}i&&Xz(i),p(0,0),m([],0,0);let s=v(e);if(a.kind===`marquee`){let e=XW(mN(t.frames()),uG(o,s)).map(e=>e.ref);nP(r,t.page,[...a.base,...e])}else if(a.kind===`shape-resize`){let{box:e,corner:t,resize:n,size:r}=a,i=xW(e,t,0,0,!1);r&&(r.width!==i.width||r.height!==i.height)?n.commit(r):n.cancel()}else if(a.kind===`placed`){let{from:e,to:t,move:n}=a;t&&(t.left!==e.left||t.top!==e.top)?n.commit(t):n.cancel()}else if(a.kind===`carry`)NW.setState({carried:null}),n.moveElement(t.layer,t.page,mN(t.frames()),s,a.key);else if(a.kind===`section-move`)A(a.section,a.boxes);else if(a.kind===`section-resize`&&a.moved)A(a.section,{});else if(a.kind===`move`&&e.altKey)O(a.boxes);else if(a.kind===`move`||a.kind===`resize`){let e={},r={};for(let[t,n]of Object.entries(a.boxes)){let i=d.get(t);if(!i)continue;let o=a.kind===`move`?{...n,x:parseFloat(i.style.left),y:parseFloat(i.style.top)}:{x:parseFloat(i.style.left),y:parseFloat(i.style.top),width:parseFloat(i.style.width),height:parseFloat(i.style.height)};aN(o,n)||(e[t]=o,r[t]=n)}n.write(t.page,e,r)}a={kind:`none`},d=new Map},A=(e,r)=>{let i=S(e.name);if(!i)return;let a={x:parseFloat(i.style.left),y:parseFloat(i.style.top),width:parseFloat(i.style.width),height:parseFloat(i.style.height)};if(aN(a,e.box))return;let o={},s={},c=a.x-e.box.x,l=a.y-e.box.y;for(let[e,t]of Object.entries(r))o[e]={...t,x:t.x+c,y:t.y+l},s[e]=t;n.write(t.page,o,s,void 0,{boxes:{[e.name]:a},expected:{[e.name]:e.box}}).then(t=>{t||C(e.name,e.box)})},j=e=>{e.key===`Escape`&&a.kind===`placed`&&(e.preventDefault(),e.stopImmediatePropagation(),a.move.cancel(),p(0,0),h(a.key,0,0),a={kind:`none`})},M=e=>{e.key===`Control`&&c&&u&&D(new MouseEvent(`mousemove`,{clientX:u.clientX,clientY:u.clientY,ctrlKey:e.type===`keydown`}))},N=qI().container(()=>t.viewport).filter(e=>{let{mode:t,tool:n,spacePan:r}=i.getState();return e.button===0&&t===`edit`&&n===`move`&&!r}).touchable(!1).on(`start`,e=>{w(e.sourceEvent),addEventListener(`keydown`,j,!0),addEventListener(`keydown`,M),addEventListener(`keyup`,M)}).on(`drag`,e=>{let t=e.sourceEvent;if(u=t,a.kind===`divider`)n.splitAt(t.clientX);else{if(!c){if(Math.hypot(t.clientX-s.x,t.clientY-s.y)<=3)return;c=!0,T()}D(t)}}).on(`end`,e=>{removeEventListener(`keydown`,j,!0),removeEventListener(`keydown`,M),removeEventListener(`keyup`,M),k(e.sourceEvent),u=null}),P=e=>{e.ctrlKey&&e.button===0&&e.preventDefault()},F=EI(e);return F.call(N),e.addEventListener(`contextmenu`,P),()=>{F.on(`.drag`,null),e.removeEventListener(`contextmenu`,P),removeEventListener(`keydown`,j,!0),removeEventListener(`keydown`,M),removeEventListener(`keyup`,M)}}function oG(){let e=document.activeElement;return e instanceof HTMLElement&&e.matches(`input, textarea`)&&e.closest(`[data-inspector]`)?e:null}function sG(e,t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height}function cG(e,t,n){return[...e.querySelectorAll(t)].reverse().find(e=>{let{left:t,right:r,top:i,bottom:a}=e.getBoundingClientRect();return n.clientX>=t&&n.clientX<=r&&n.clientY>=i&&n.clientY<=a})??null}function lG(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.max(1,Math.round(e.width)),height:Math.max(1,Math.round(e.height))}}function uG(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var dG=/^#[0-9a-f]{6}$/i,fG=`flex h-[26px] items-center gap-2 rounded-md bg-input px-2 text-xs`,pG=`-ml-1 max-w-max truncate rounded-[4px] bg-[color-mix(in_srgb,var(--foreground)_9%,transparent)] px-1.5 py-px`,mG=`shadow-[inset_0_0_0_1px_var(--faint)]`;function hG(e,t){let n=`token`in e?`var(${e.token})`:e.raw;if(t>=100)return n;if(`raw`in e&&dG.test(e.raw)){let n=Math.round(t/100*255).toString(16).padStart(2,`0`);return`${e.raw}${n}`}return`color-mix(in srgb, ${n} ${t}%, transparent)`}function gG(e,t,n){return e.find(e=>e.name===t)?.[n]??null}function _G(e,t,n){let r=e.token?gG(t,e.token,n):e.value;return r===null?null:e.percent>=100?r:`color-mix(in srgb, ${r} ${e.percent}%, transparent)`}function vG(e){return e.replace(/^--/,``)}var yG=200,bG={width:800,height:600},xG=N()(()=>({tool:`frame`}));function SG(){return F(xG,e=>e.tool)}var CG=N()(()=>({name:null}));function wG(){return F(CG,e=>e.name)}function TG(e){CG.setState({name:e})}function EG(){CG.setState({name:null})}function DG(e){let t=oN(e.map(e=>e.box));return t?{x:Math.round(t.x-40),y:Math.round(t.y-yG),width:Math.round(t.width+80),height:Math.round(t.height+40+yG)}:null}var OG=[{name:`Left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`Right`,key:`ArrowRight`,dx:1,dy:0},{name:`Up`,key:`ArrowUp`,dx:0,dy:-1},{name:`Down`,key:`ArrowDown`,dx:0,dy:1}];function kG(e){let{selection:t,mode:n,live:r,calls:i}=e,a=()=>n.getState().mode===`edit`&&r.getState().canWrite&&!t.getState().element,o=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},s=()=>{let{page:n,section:r}=t.getState();if(n===e.page()&&r!==void 0)return e.sections().find(e=>e.name===r)},c=()=>a()&&s()!==void 0,l=t=>dN(e.frames()).filter(e=>t.frames.includes(e.name)),u=()=>{let e=s();return a()&&e!==void 0&&l(e).every(e=>!e.locked)},d=!1,f=(t,n)=>{let r=s();if(!r||d)return;let i=l(r),a=e=>({...e,x:e.x+t,y:e.y+n});d=!0,(e.write??vN)(e.page(),Object.fromEntries(i.map(e=>[e.ref,a(e.box)])),Object.fromEntries(i.map(e=>[e.ref,e.box])),void 0,{boxes:{[r.name]:a(r.box)},expected:{[r.name]:r.box}}).finally(()=>{d=!1})};return[{id:`section.wrap`,label:`Wrap in section`,group:`frame`,command:{label:`Wrap frames in a section`,icon:Er,keywords:[`group`]},keys:[`$mod+Alt+KeyG`],enabled:()=>a()&&o().length>0,run:()=>{let n=DG(o());if(!n)return;let r=e.page();i.addSection(r,n).then(e=>rP(t,r,e.name)).catch(_k(`Couldn't wrap in a section`))}},{id:`section.rename`,label:`Rename section`,group:`section`,command:{label:`Rename section`,icon:Or},keys:[`F2`],enabled:c,run:()=>{let e=s();e&&TG(e.name)}},{id:`section.delete`,label:`Delete section`,group:`section`,command:{label:`Delete section, keeping its frames`,icon:Pi},keys:[`Backspace`,`Delete`],enabled:c,run:()=>{let n=s();n&&i.deleteSection(e.page(),n.name).then(()=>oP(t)).catch(_k(`Couldn't delete ${n.name}`))}},...OG.flatMap(({name:e,key:t,dx:n,dy:r})=>[{id:`section.nudge${e}`,label:`Nudge section ${e.toLowerCase()}`,group:`section`,palette:!1,keys:[t],enabled:u,run:()=>f(n,r)},{id:`section.nudge${e}Far`,label:`Nudge section ${e.toLowerCase()} 10 px`,group:`section`,palette:!1,keys:[`Shift+${t}`],enabled:u,run:()=>f(n*10,r*10)}]),{id:`tool.section`,label:`Section`,group:`tool`,command:{label:`Draw a section`,icon:Er},keys:[`Shift+KeyS`],enabled:()=>r.getState().canWrite,run:()=>{xG.setState({tool:`section`}),n.setState({tool:`section`,mode:`edit`})},checked:()=>n.getState().mode===`edit`&&n.getState().tool===`section`}]}async function AG(e,t,{calls:n=uk,selection:r=_P,mode:i=c_}={}){try{let a=await n.addSection(e,{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width??bG.width),height:Math.round(t.height??bG.height)});return rP(r,e,a.name),i.setState({tool:`move`}),a}catch(e){return _k(`Couldn't add a section`)(e),null}}function jG(e,t,n){let r=(0,_.useRef)({page:e,frames:t,sections:n});(0,_.useEffect)(()=>{r.current={page:e,frames:t,sections:n}},[e,t,n]),(0,_.useEffect)(()=>{let e=ye(kG({page:()=>r.current.page,frames:()=>r.current.frames,sections:()=>r.current.sections,selection:_P,mode:c_,live:Qg,calls:uk})),t=[_P.subscribe(G),c_.subscribe(G),Qg.subscribe((e,t)=>{G(),e.canWrite!==t.canWrite&&!e.canWrite&&c_.getState().tool===`section`&&c_.setState({tool:`move`})})];return()=>{for(let e of t)e();e()}},[])}var MG=N()(()=>({preset:LN}));function NG(){return F(MG,e=>e.preset)}function PG(e){MG.setState({preset:e})}var FG=`frame`;async function IG(e,{page:t,frames:n,preset:r=MG,selection:i=_P,mode:a=c_,calls:o=uk,visible:s,view:c=b_}){let{width:l,height:u}=e,d=l===void 0||u===void 0?null:{width:l,height:u},f=r.getState().preset,p=fk(d?FG:f,n.map(e=>e.name));try{let n=await o.addFrame(`${t}/${p}`,d??zN(f),Math.round(e.x),Math.round(e.y));return nP(i,t,[n.ref]),a.setState({tool:`move`}),s&&!LG(n.box,s)&&c.centerOn(n.box),n}catch(e){return _k(`Couldn't add a frame`)(e),null}}function LG(e,t){return e.x>=t.x&&e.y>=t.y&&e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height}var RG=()=>Qg.getState().canWrite;function zG(){(0,_.useEffect)(()=>{let e=ye([{id:`tool.frame`,label:`Frame`,group:`tool`,command:{label:`Add a frame`,icon:En},keys:[`f`],enabled:RG,run:()=>{xG.setState({tool:`frame`}),c_.setState({tool:`frame`,mode:`edit`})},checked:()=>c_.getState().mode===`edit`&&c_.getState().tool===`frame`}]),t=Qg.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(G(),!e.canWrite&&c_.getState().tool===`frame`&&c_.setState({tool:`move`}))});return()=>{t(),e()}},[])}function BG(e,t=VG){let n=$g(e=>e.board),[r,i]=(0,_.useState)();return(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&i(e)}),()=>{n=!1}},[e,n,t]),r}async function VG(e){let t=await(await fetch(`/api/projects/${encodeURIComponent(e)}/tokens`)).json();return t.ok?t.data:null}var HG=[{family:`Geist`,package:`@fontsource-variable/geist`,packageFamily:`Geist Variable`,folder:`geist`,weights:{min:100,max:900},fallback:`sans-serif`,startsLook:!0},{family:`Geist Mono`,package:`@fontsource-variable/geist-mono`,packageFamily:`Geist Mono Variable`,folder:`geist-mono`,weights:{min:100,max:900},fallback:`monospace`,startsLook:!0},{family:`Inter`,package:`@fontsource-variable/inter`,packageFamily:`Inter Variable`,folder:`inter`,weights:{min:100,max:900},fallback:`sans-serif`,startsLook:!0},{family:`Source Serif 4`,package:`@fontsource-variable/source-serif-4`,packageFamily:`Source Serif 4 Variable`,folder:`source-serif-4`,weights:{min:200,max:900},fallback:`serif`,startsLook:!0},{family:`Caveat`,package:`@fontsource-variable/caveat`,packageFamily:`Caveat Variable`,folder:`caveat`,weights:{min:400,max:700},fallback:`cursive`,startsLook:!1}],UG=`/frameboard/faces`;function WG(e){return`${UG}/${e.folder}/index.css`}function GG(e){return`${/\s/.test(e.family)?`'${e.family}'`:e.family}, ${e.fallback}`}var KG={blue:{light:`#2f7bf0`,dark:`#4e92f6`},red:{light:`#e5484d`,dark:`#ff6369`},green:{light:`#30a46c`,dark:`#3dd68c`},orange:{light:`#f76b15`,dark:`#ff801f`},purple:{light:`#8e4ec6`,dark:`#9a5cd0`}},qG=Object.fromEntries(HG.filter(e=>e.startsLook).map(e=>[e.folder,{family:e.family,stack:GG(e)}])),JG={accent:`blue`,font:`geist`},YG=`untitled`,XG=`page-1`;function ZG(e,t){if(!e||!t)return!1;let[n,...r]=e.projects;if(!n||r.length>0||n.name!==`untitled`)return!1;let[i,...a]=n.pages;return i!==void 0&&a.length===0&&i.name===`page-1`&&i.frames.length===0}var QG={phase:`idle`,project:null,at:0,withLook:null,name:null,size:`phone`,accent:JG.accent,font:JG.font,drawer:`agent`,refusal:null,busy:!1,moved:!1,landing:!1},$G=N()(()=>QG);function eK(e){let t=$g(e=>e.board),n=$g(e=>e.canWrite),r=F($G,e=>e.phase),i=F($G,e=>e.project);return!n||e.frames.length>0?!1:r===`open`?e.project===i:r===`idle`&&ZG(t,n)}function tK(e){$G.setState({landing:e===`/`})}function nK(){let e=$g(e=>e.board),t=$g(e=>e.canWrite),n=$g(e=>e.accessKnown),r=F($G,e=>e.landing),i=F($G,e=>e.phase),[,a]=Na(),o=i===`idle`&&ZG(e,t),s=e!==null&&n;return(0,_.useEffect)(()=>{r&&s&&($G.setState({landing:!1}),o&&a(p_(YG,XG),{replace:!0}))},[r,s,o,a]),r&&(!s||o)}function rK(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)}function iK(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return t.slice(n+1)===`.frameboard`?n>0?t.slice(0,n):`/`:e}function aK(e,t){return`Draw a ${e} screen for ${t} on frameboard`}var oK={phone:`Phone`,tablet:`Tablet`,desktop:`Desktop`},sK={phone:`h-9 w-5`,tablet:`h-[38px] w-[30px]`,desktop:`h-[30px] w-[46px]`},cK={blue:`Blue`,red:`Red`,green:`Green`,orange:`Orange`,purple:`Purple`};function lK({page:e,calls:t=uk,loadTokens:n}){let r=F($G),i=BG(e.project,n),a=$g(e=>e.board?.root??``),[,o]=Na(),s=(0,_.useRef)(null),c=r.project??e.project,l=r.withLook??(i==null||i.sheets.length===0),u=l?[`name`,`size`,`look`,`agent`]:[`name`,`size`,`agent`],d=Math.min(r.at,u.length-1),f=u[d]??`name`,p=r.name??c,m=rK(p);(0,_.useEffect)(()=>{r.moved&&(s.current?.focus(),$G.setState({moved:!1}))},[r.moved]);let h=e=>$G.setState(e),g=()=>h({phase:`open`,project:c,withLook:l,refusal:null}),v=()=>h({at:d+1,refusal:null,busy:!1,moved:!0}),y=(e,t)=>{e instanceof wx?h({refusal:e.message,busy:!1}):(h({busy:!1}),_k(t)(e))},b=async()=>{if(l)try{await t.projectTokens(c,{accent:r.accent,font:r.font})}catch(e){if(!(e instanceof wx&&e.code===`tokens-exist`))return h({busy:!1}),_k(`Couldn't write ${c}/tokens.css`)(e)}if(r.drawer===`self`){PG(r.size);let n=await IG({x:0,y:0},{page:e.ref,frames:e.frames,calls:t});n&&b_.fitTo([n.box])}h({phase:`done`,busy:!1}),_g.add({title:`Board set up`,description:r.drawer===`self`?`Added a ${r.size} frame to ${e.name}.`:`Paste the prompt into Claude Code to draw the first frame of ${c}.`,type:`success`})},x=async()=>{if(!r.busy){if(g(),h({busy:!0}),f===`name`){if(m===``)return h({refusal:`Enter a name for the project.`,busy:!1});if(m===c)return v();try{await t.renameProject(c,m)}catch(e){return y(e,`Couldn't rename ${c}`)}return Ek(c,m),h({project:m,name:null}),o(p_(m,e.name),{replace:!0}),v()}if(f===`agent`)return b();v()}};return(0,X.jsxs)(`section`,{"aria-labelledby":`guide-title`,className:`pointer-events-auto absolute top-1/2 left-1/2 w-110 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[52%] overflow-hidden rounded-[14px] border border-border bg-card text-body text-card-foreground shadow-[0_16px_48px_rgba(0,0,0,.16),0_1px_3px_rgba(0,0,0,.08)]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-3.5`,children:[(0,X.jsx)(`h2`,{id:`guide-title`,className:`text-sm font-semibold`,children:`Set up your board`}),(0,X.jsxs)(`span`,{className:`ml-auto text-muted-foreground tabular-nums`,children:[d+1,` of `,u.length]})]}),(0,X.jsx)(`div`,{"aria-hidden":!0,className:`flex gap-1 px-4 pt-2.5`,children:u.map((e,t)=>(0,X.jsx)(`i`,{className:Q(`h-[3px] flex-1 rounded-sm`,t<=d?`bg-primary`:`bg-muted`)},e))}),(0,X.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},children:[(0,X.jsxs)(`div`,{className:`p-4`,children:[(0,X.jsx)(`h3`,{ref:s,id:`guide-step`,tabIndex:-1,className:`mb-1 text-base font-semibold outline-none`,children:uK[f]}),f===`name`?(0,X.jsx)(hK,{name:p,project:c,folder:m,refusal:r.refusal,onChange:e=>h({name:e,refusal:null})}):f===`size`?(0,X.jsx)(_K,{size:r.size,page:e.name,onChange:e=>h({size:e})}):f===`look`?(0,X.jsx)(vK,{accent:r.accent,font:r.font,project:c,refusal:r.refusal,onChange:e=>h(e)}):(0,X.jsx)(yK,{drawer:r.drawer,folder:iK(a),sheet:l?`${c}/tokens.css`:null,prompt:aK(r.size,c),size:r.size,page:e.name,onChange:e=>h({drawer:e})})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-4 py-3`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>h({phase:`done`}),className:`h-[30px] rounded-lg px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Skip setup`}),d>0?(0,X.jsx)(`button`,{type:`button`,onClick:()=>h({at:d-1,refusal:null,moved:!0}),className:`ml-auto h-[30px] rounded-lg bg-muted px-3 font-medium outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Back`}):null,(0,X.jsx)(`button`,{type:`submit`,"aria-disabled":r.busy,className:Q(`h-[30px] rounded-lg bg-primary px-3 font-medium text-primary-foreground outline-none hover:bg-primary/85 focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:opacity-60`,d===0&&`ml-auto`),children:f===`agent`?`Finish`:`Next`})]})]})]})}var uK={name:`What are you designing?`,size:`Which screen first?`,look:`Pick a starting look`,agent:`Who draws the first frame?`};function dK({children:e}){return(0,X.jsx)(`p`,{className:`leading-[1.55] text-muted-foreground`,children:e})}function fK({children:e}){return(0,X.jsx)(`p`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5 text-label font-normal text-muted-foreground`,children:e})}function pK({children:e,className:t}){return(0,X.jsx)(`code`,{className:Q(`rounded bg-muted px-[5px] py-px font-mono text-[10.5px]`,t),children:e})}function mK({id:e,children:t}){return(0,X.jsx)(`p`,{id:e,role:`alert`,className:`mt-1.5 text-label leading-[1.45] font-normal text-destructive`,children:t})}function hK({name:e,project:t,folder:n,refusal:r,onChange:i}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(dK,{children:`Give the project a name. You can rename it any time from the header.`}),(0,X.jsx)(`input`,{autoFocus:!0,"aria-labelledby":`guide-step`,"aria-invalid":r!==null,"aria-describedby":r?`guide-refusal`:void 0,value:e,spellCheck:!1,onChange:e=>i(e.target.value),className:`mt-3 h-[34px] w-full rounded-lg bg-background px-2.5 text-[13px] text-foreground ring-[1.5px] ring-primary outline-none selection:bg-primary/45 aria-invalid:ring-destructive`}),r?(0,X.jsx)(mK,{id:`guide-refusal`,children:r}):null,(0,X.jsx)(fK,{children:n===t||n===``?(0,X.jsxs)(X.Fragment,{children:[`Keeps `,(0,X.jsxs)(pK,{children:[t,`/`]})]}):(0,X.jsxs)(X.Fragment,{children:[`Renames `,(0,X.jsxs)(pK,{children:[t,`/`]}),` to `,(0,X.jsxs)(pK,{children:[n,`/`]})]})})]})}function gK({group:e,checked:t,onSelect:n,className:r,children:i,label:a,labelledBy:o,disabled:s=!1}){return(0,X.jsxs)(`label`,{className:Q(`relative has-checked:border-primary has-checked:shadow-[0_0_0_1px_var(--primary)] has-[input:focus-visible]:ring-3 has-[input:focus-visible]:ring-ring/50 has-disabled:opacity-60`,r),children:[(0,X.jsx)(`input`,{type:`radio`,name:e,checked:t,onChange:n,disabled:s,"aria-label":a,"aria-labelledby":o,className:`peer sr-only`}),i]})}function _K({size:e,page:t,onChange:n}){let r=Object.keys(PN);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(dK,{children:`Sets the size of your first frame. Add other sizes later from the Frame tool.`}),(0,X.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-step`,className:`mt-3 grid grid-cols-3 gap-2`,children:r.map(t=>(0,X.jsxs)(gK,{group:`guide-size`,checked:e===t,onSelect:()=>n(t),className:`flex flex-col items-center gap-2 rounded-[10px] border border-border px-2 pt-3.5 pb-2.5 text-muted-foreground has-checked:text-primary`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`rounded border-[1.5px] border-current`,sK[t])}),(0,X.jsx)(`b`,{className:`font-semibold text-foreground`,children:oK[t]}),PN[t].width,` × `,PN[t].height]},t))}),(0,X.jsxs)(fK,{children:[`Sizes the first frame on `,(0,X.jsx)(pK,{children:t})]})]})}function vK({accent:e,font:t,project:n,refusal:r,onChange:i}){let a=Object.keys(KG),o=Object.keys(qG);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(dK,{children:`Every frame in this project reads these tokens, in light and dark. The Theme tab shows them.`}),(0,X.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[(0,X.jsxs)(`div`,{className:`rounded-lg bg-muted px-2.5 py-2`,children:[(0,X.jsx)(`span`,{id:`guide-accent`,className:`mb-1.5 block text-label font-normal text-muted-foreground`,children:`Accent`}),(0,X.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-accent`,className:`flex gap-1.5`,children:a.map(n=>(0,X.jsx)(gK,{group:`guide-accent`,label:cK[n],checked:e===n,onSelect:()=>i({accent:n,font:t}),className:`size-5 overflow-hidden rounded-[5px] has-checked:shadow-[0_0_0_2px_var(--muted),0_0_0_3.5px_var(--foreground)]`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`absolute inset-0 rounded-[5px] bg-(--swatch) dark:bg-(--swatch-dark)`,mG),style:{"--swatch":KG[n].light,"--swatch-dark":KG[n].dark}})},n))})]}),(0,X.jsxs)(`label`,{className:`rounded-lg bg-muted px-2.5 py-2`,children:[HG.filter(e=>e.startsLook).map(e=>(0,X.jsx)(`link`,{rel:`stylesheet`,href:WG(e)},e.folder)),(0,X.jsx)(`span`,{className:`mb-1.5 block text-label font-normal text-muted-foreground`,children:`Font`}),(0,X.jsxs)(`span`,{className:`relative block`,children:[(0,X.jsx)(`select`,{value:t,onChange:t=>i({accent:e,font:t.target.value}),className:`h-[26px] w-full appearance-none rounded-md bg-card px-2 text-foreground shadow-[0_0_0_1px_var(--border)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-60`,children:o.map(e=>(0,X.jsx)(`option`,{value:e,style:{fontFamily:qG[e].stack},children:qG[e].family},e))}),(0,X.jsx)(Nt,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 right-2 size-2.5 -translate-y-1/2`})]})]})]}),r?(0,X.jsx)(mK,{id:`guide-refusal`,children:r}):null,(0,X.jsxs)(fK,{children:[`Finish writes `,(0,X.jsxs)(pK,{children:[n,`/tokens.css`]})]})]})}function yK({drawer:e,folder:t,sheet:n,prompt:r,size:i,page:a,onChange:o}){let[s,c]=(0,_.useState)(null),l=`flex gap-2.5 rounded-[10px] border border-border px-3 py-2.5 text-left`,u=`mt-px size-3.5 flex-none rounded-full border-[1.5px] border-muted-foreground peer-checked:border-4 peer-checked:border-primary`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(dK,{children:`Frameboard is drawn on by a coding agent. You can also start from a blank frame.`}),(0,X.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-step`,className:`mt-3 flex flex-col gap-2`,children:[(0,X.jsxs)(gK,{group:`guide-drawer`,checked:e===`agent`,onSelect:()=>o(`agent`),labelledBy:`guide-agent-name guide-agent-hint`,className:l,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:u}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`b`,{id:`guide-agent-name`,className:`mb-0.5 block font-semibold`,children:`My agent`}),(0,X.jsxs)(`span`,{id:`guide-agent-hint`,className:`leading-[1.45] text-muted-foreground`,children:[`Paste this into Claude Code opened in`,` `,(0,X.jsx)(pK,{className:`inline-block max-w-full wrap-anywhere`,children:t})]}),e===`agent`?(0,X.jsxs)(`span`,{className:`mt-2.5 flex items-center gap-2 rounded-lg bg-muted py-2 pr-2 pl-2.5`,children:[(0,X.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[11.5px] text-foreground`,children:r}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>void navigator.clipboard.writeText(r).then(()=>c(r),_k(`Couldn't copy the prompt`)),className:`h-6 rounded-md px-1.5 text-label font-normal text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:s===r?`Copied`:`Copy`})]}):null]})]}),(0,X.jsxs)(gK,{group:`guide-drawer`,checked:e===`self`,onSelect:()=>o(`self`),className:l,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:u}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`b`,{className:`mb-0.5 block font-semibold`,children:`I’ll start myself`}),(0,X.jsxs)(`span`,{className:`leading-[1.45] text-muted-foreground`,children:[`Adds an empty `,i,` frame to `,a,`.`]})]})]})]}),(0,X.jsx)(fK,{children:n===null?e===`agent`?`Writes nothing until your agent draws`:`Writes one frame file`:e===`agent`?(0,X.jsxs)(X.Fragment,{children:[`Finish writes only `,(0,X.jsx)(pK,{children:n})]}):(0,X.jsxs)(X.Fragment,{children:[`Finish writes `,(0,X.jsx)(pK,{children:n}),` and one frame file`]})})]})}function bK(e){let t=new Map;for(let{ref:n,box:r}of e){let i=1/0;for(let t of e)t.ref!==n&&(!(t.box.x<r.x+r.width&&t.box.x+t.box.width>r.x)||t.box.y>=r.y||(i=Math.min(i,Math.max(0,r.y-(t.box.y+t.box.height)))));t.set(n,i)}return t}function xK(e,t,n){for(let r of e.querySelectorAll(`[data-frame]`)){let e=t.get(r.dataset.frame??``)??1/0;r.toggleAttribute(`data-label-crowded`,e*n<20)}}function SK(e,t){for(let n of e.querySelectorAll(`[data-frame]`))n.toggleAttribute(`data-label-hover`,n.dataset.frame===t)}function CK(){return N()(()=>({at:null,frame:null}))}var wK=CK();function TK(e){let{place:t,selection:n,mode:r,live:i,clipboard:a,theme:o,notes:s,calls:c}=e,l=()=>r.getState().mode===`edit`,u=()=>l()&&i.getState().canWrite,d=()=>{let{page:t,frames:r}=n.getState();return t===e.page()?r:[]},f=()=>{let e=d(),n=t.getState().frame;return n&&e.includes(n)?n:e[0]},p=()=>{let e=f();return e?mM(TM(e,o)):null};return[{id:`frame.flipTheme`,get label(){let e=p();return e?`Flip to ${e}`:`Flip frame theme`},group:`frame`,command:{label:`Flip frame theme`,icon:vi},enabled:()=>l()&&d().length>0,run:()=>{let e=p();if(e)for(let t of d())TM(t,o)!==e&&CM(t,o)}},{id:`frame.pasteAt`,label:`Paste here`,group:`frame`,palette:!1,enabled:()=>u()&&a.getState().held>0&&t.getState().at!==null,run:()=>{let{at:r}=t.getState();if(!r)return;let i=e.page();c.pasteFrames(i,{x:Math.round(r.x),y:Math.round(r.y)}).then(e=>nP(n,i,e.map(e=>e.ref)),_k(`Couldn't paste`))}},{id:`frame.newAt`,label:`New frame here`,group:`frame`,palette:!1,enabled:()=>u()&&t.getState().at!==null,run:()=>{let{at:i}=t.getState();i&&IG(i,{page:e.page(),frames:e.frames(),preset:e.preset,selection:n,mode:r,calls:c})}},{id:`note.addHere`,label:`Add a note here`,group:`note`,palette:!1,enabled:()=>u()&&!!n.getState().element&&d().length>0&&t.getState().at!==null,run:()=>{let{at:i}=t.getState(),{element:a}=n.getState(),o=e.frames().find(e=>e.ref===a?.frame);if(!i||!a||!o)return;let c=e.renderedAt(o.ref);r.setState({tool:`note`}),s.setState({open:{kind:`new`,pick:{frame:{ref:o.ref,name:o.name},element:c?a.index:null,renderedAt:c,at:i}}})}},{id:`note.addOnFrame`,label:`Add a note`,group:`note`,palette:!1,enabled:()=>u()&&t.getState().at!==null&&t.getState().frame!==null,run:()=>{let{at:n,frame:i}=t.getState(),a=e.frames().find(e=>e.ref===i);n&&a&&(r.setState({tool:`note`}),s.setState({open:{kind:`new`,pick:{frame:{ref:a.ref,name:a.name},element:null,renderedAt:null,at:n}}}))}}]}function EK(e,t,n){let r=(0,_.useRef)(e),i=(0,_.useRef)(t),a=(0,_.useRef)(n);(0,_.useEffect)(()=>{r.current=e,i.current=t,a.current=n},[e,t,n]),(0,_.useEffect)(()=>{let e=ye(TK({page:()=>r.current,frames:()=>i.current,renderedAt:e=>a.current(e),place:wK,selection:_P,mode:c_,live:Qg,clipboard:DU,theme:jM,preset:MG,notes:YN,calls:uk})),t=[wK.subscribe(G),jM.subscribe(G),_P.subscribe(G),c_.subscribe(G),DU.subscribe(G),Qg.subscribe(G)];return()=>{for(let e of t)e();e()}},[])}var DK=_.createContext(void 0);function OK(e=!0){let t=_.useContext(DK);if(t===void 0&&!e)throw Error(Za(25));return t}var kK=_.createContext(void 0);function AK(e){let t=_.useContext(kK);if(t===void 0&&!e)throw Error(Za(33));return t}var jK=_.createContext(void 0);function MK(e){let t=_.useContext(jK);if(t===void 0&&!e)throw Error(Za(36));return t}function NK({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=_.useRef(e!==void 0),[a,o]=_.useState(()=>t);return[i&&e!==void 0?e:a,_.useCallback(e=>{i||o(e)},[])]}var PK=_.createContext(null);function FK(e=`root`){let t=_.useContext(PK),n=_.useContext(jK);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var IK={visible:!0,ref:null};function LK(){return IK}function RK(e,t,n=`root`){let r=FK(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??LK)({label:e.label,children:e.children,render:e.render}),a=Ml(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function zK(e){e.preventDefault()}function BK(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=MK(),u=OK(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,v=!f&&h&&n?0:-1;return _.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":p,onMouseDown:f?zK:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:yd})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!xs&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&od(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var VK={type:`regular-item`};function HK(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=_.useRef(null),{getButtonProps:d,buttonRef:f}=sd({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=BK({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=_.useCallback(e=>Wl(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=Ml(u,f);return _.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var UK=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function WK(){return _.useContext(UK)}function GK(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=WK(),u=_.useRef(-1),[d,f]=_.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=_.useRef(null),h=_.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var KK=`data-checked`,qK=`data-unchecked`,JK={checked(e){return e?{[KK]:``}:{[qK]:``}},...Bs},YK=_.createContext(void 0);function XK(){let e=_.useContext(YK);if(e===void 0)throw Error(Za(31));return e}var ZK=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=_.useState(void 0),c=Z(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,X.jsx)(YK.Provider,{value:s,children:c})}),QK=_.forwardRef(function(e,t){let n=FK()?.Group??ZK;return(0,X.jsx)(n,{...e,ref:t})}),$K=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=rH(a),c=XK();return q(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Z(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),eq=_.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=MK(),f=GK({guess:!0,label:a}),p=rH(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=HK({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:VK});return Z(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),tq=_.forwardRef(function(e,t){let n=RK(e,t);return n.visible?(0,X.jsx)(eq,{...e,ref:n.ref}):null}),nq=_.createContext(void 0);function rq(){return _.useContext(nq)}function iq(e,t){let n=ou(e.render);if(_.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function aq(e,t,n){let r=iq(e,t),i=r===t?void 0:r;return[r,_.useCallback(e=>n?.(e?i:void 0),[i,n])]}function oq(e,t,n){let r=ou(e.render),i=_.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var sq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=MK(),m=rq(),{side:h,align:g}=AK(),v=KH(!0)!=null,y=l.useState(`open`),b=l.useState(`transitionStatus`),x=l.useState(`popupProps`),S=l.useState(`mounted`),C=l.useState(`instantType`),w=l.useState(`activeTriggerElement`),T=l.useState(`parent`),E=l.useState(`lastOpenChangeReason`),D=l.useState(`rootId`),O=l.useState(`floatingRootContext`),k=l.useState(`floatingTreeRoot`),A=l.useState(`closeDelay`),j=l.useState(`hoverEnabled`),M=l.useState(`disabled`),N=l.useState(`openMethod`),P=l.useState(`activeTriggerId`),F=l.useState(`listElement`),[I,L]=aq(e,u,d),R=oq(e,w,P),z=T.type===`menu`?m:void 0,B=T.type===`context-menu`,V=s??T.type!==`menu`;s===void 0&&F&&T.type!==`menu`&&(V=()=>l.state.activeIndex===null&&F),bu({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}}),_.useEffect(()=>{function e(e){l.setOpen(!1,fd(e.reason,e.domEvent))}return k.events.on(`close`,e),()=>{k.events.off(`close`,e)}},[k.events,l]),Tp(O,{enabled:j&&!M&&!B&&T.type!==`menubar`,closeDelay:A});let ee=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:te,handleFocus:ne}=(_.useContext(PK)?.useParentHandoff??lq)(l,T,y,f),re=Z(`div`,e,{state:{transitionStatus:b,side:h,align:g,open:y,nested:T.type===`menu`,instant:C},ref:[t,l.context.popupRef,ee,L],stateAttributesMapping:ec,props:[x,{id:I,...F?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":R},onKeyDown(e){z?.onPopupKeyDown?.(e),v&&RH.has(e.key)&&e.stopPropagation()},onFocus:ne},fh(b),c,{"data-rootownerid":D}]}),H=T.type===void 0||B;(w||T.type===`menubar`&&E!==`outside-press`)&&(H=!0);let U=z?.getReturnElement??te;return(0,X.jsx)(If,{context:O,openInteractionType:N,modal:B,disabled:!S,returnFocus:a??U??H,explicitReturnFocus:a===void 0&&U?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type===`menubar`?void 0:k,previousFocusableElement:w,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),cq={parentVirtualFocusRef:void 0,handleFocus:void 0};function lq(){return cq}var uq=_.forwardRef(function(e,t){let n=FK()?.Popup??sq;return(0,X.jsx)(n,{...e,ref:t})}),dq=_.createContext(void 0);function fq(){let e=_.useContext(dq);if(e===void 0)throw Error(Za(32));return e}var pq=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=MK();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,X.jsx)(dq.Provider,{value:n,children:(0,X.jsx)(Gd,{ref:t,...r,portalOwnerRole:o})})});function mq(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=_.useState(0),s=Ya(gq).current,c=Ya(hq).current,l=_.useRef(0),u=_.useRef(!0),d=_.useRef(null),f=_.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),g=J(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!yq(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&bq(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=vq(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=J(()=>{let[e,t]=_q(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),q(()=>{u.current&&y()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=J(e=>(s.add(e),()=>{s.delete(e)})),x=_.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,X.jsx)(UK.Provider,{value:x,children:t})}function hq(){return new Map}function gq(){return new Set}function _q(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>bq(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function vq(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function yq(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function bq(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var xq=_.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Du,style:g,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=MK(),S=fq(),C=OK(!0),w=y.useState(`parent`),T=y.useState(`floatingRootContext`),E=y.useState(`floatingTreeRoot`),D=y.useState(`mounted`),O=y.useState(`open`),k=y.useState(`modal`),A=y.useState(`openMethod`),j=y.useState(`activeTriggerElement`),M=y.useState(`transitionStatus`),N=y.useState(`positionerElement`),P=y.useState(`instantType`),F=y.useState(`adaptiveOrigin`),I=y.useState(`lastOpenChangeReason`),L=y.useState(`floatingNodeId`),R=y.useState(`floatingParentNodeId`),z=T.useState(`domReferenceElement`),B=n,V=c,ee=l,te=s,ne=h;w.type===`context-menu`&&(B=n??w.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,V=e.sideOffset??-5));let re=o,H=te;w.type===`menu`?(re??=`inline-end`,H??=`start`,ne=e.collisionAvoidance??Ou):w.type===`menubar`&&(re??=w.context.orientation===`vertical`?`inline-end`:`bottom`,H??=`start`);let U=w.type===`context-menu`,ie=lh({anchor:B,floatingRootContext:T,positionMethod:C?`fixed`:r,mounted:D,side:re,sideOffset:V,align:H,alignOffset:ee,arrowPadding:U?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:L,keepMounted:S,disableAnchorTracking:m,collisionAvoidance:ne,shift:U?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:E,adaptiveOrigin:F,lazyFlip:b?`placement`:!1});_.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===L&&y.set(`hoverEnabled`,!1),e.nodeId!==L&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,fd(Fd)))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[y,E.events,L]),_.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,fd(t))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[E.events,y]);let ae=os();_.useEffect(()=>{O||ae.clear()},[O,ae]),_.useEffect(()=>{function e(e){if(O&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&j&&j!==e.target){let e=y.select(`closeDelay`);e>0?ae.isStarted()||ae.start(e,()=>{y.setOpen(!1,fd(Fd))}):y.setOpen(!1,fd(Fd))}else ae.clear()}}return E.events.on(`itemhover`,e),()=>{E.events.off(`itemhover`,e)}},[E.events,O,j,y,ae]),_.useEffect(()=>{let e={open:O,nodeId:L,parentNodeId:R,reason:y.select(`lastOpenChangeReason`)};E.events.emit(`menuopenchange`,e)},[E.events,O,y,L,R]),gH({store:y,domReference:z,positionerElement:N,open:O});let oe={open:O,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,nested:w.type===`menu`,instant:P},W=w.type===`menubar`&&w.context.modal;kH(O&&(W||k&&I!==`trigger-hover`),A===`touch`,N,j);let se=ph(e,oe,{styles:ie.positionerStyles,transitionStatus:M,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!D,inert:!O}),ce=D&&w.type!==`menu`&&(w.type!==`menubar`&&k&&I!==`trigger-hover`||w.type===`menubar`&&w.context.modal),le=null;return w.type===`menubar`?le=w.context.contentElement:w.type===void 0&&(le=j),(0,X.jsxs)(kK.Provider,{value:ie,children:[ce&&(0,X.jsx)(hH,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:du(!O),cutout:le}),(0,X.jsx)(Ef,{id:L,children:(0,X.jsx)(mq,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:se})})]})}),Sq=_.createContext(void 0);function Cq(){let e=_.useContext(Sq);if(e===void 0)throw Error(Za(34));return e}var wq=_.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=_.useState(void 0),[p,m]=NK({controlled:i,default:a,name:`MenuRadioGroup`}),h=J((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=Z(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),v=_.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,X.jsx)(YK.Provider,{value:f,children:(0,X.jsx)(Sq.Provider,{value:v,children:g})})}),Tq=_.memo(_.forwardRef(function(e,t){let n=FK()?.RadioGroup??wq;return(0,X.jsx)(n,{...e,ref:t})})),Eq=_.createContext(void 0);function Dq(){let e=_.useContext(Eq);if(e===void 0)throw Error(Za(35));return e}var Oq=_.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,{store:f}=MK(),{value:p,setValue:m,disabled:h}=Cq(),g=GK({guess:!0,label:a}),v=rH(i),y=f.useState(`isActive`,g.index),b=f.useState(`floatingNodeId`),x=f.useState(`itemProps`),S=f.useState(`disabled`),C=s||h||S,w=p===l,{getItemProps:T,itemRef:E}=HK({closeOnClick:c,disabled:C,highlighted:y,id:v,store:f,nativeButton:o,nodeId:b,itemMetadata:VK}),D=_.useMemo(()=>({disabled:C,highlighted:y,checked:w}),[C,y,w]);function O(e){let t=fd(yd,e.nativeEvent,void 0,{preventUnmountOnClose:Wa});m(l,t)}let k=Z(`div`,e,{state:D,stateAttributesMapping:JK,props:[x,{role:`menuitemradio`,"aria-checked":w,onClick:O},d,T],ref:[E,t,g.ref]});return(0,X.jsx)(Eq.Provider,{value:D,children:k})}),kq=_.forwardRef(function(e,t){let n=RK(e,t);return n.visible?(0,X.jsx)(Oq,{...e,ref:n.ref}):null}),Aq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Dq(),c=_.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=Gf(s.checked);return bu({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),Z(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:JK,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),jq=_.createContext(null);function Mq(e){let t=_.useContext(jq);if(t===null&&!e)throw Error(Za(5));return t}function Nq(e){return e==null?md:e.type.startsWith(`key`)?kd:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Ad:md}var Pq={...gp,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=gp.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Cs&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!gp.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Fq=class extends wo{constructor(e,t,n=!1){let r=new sp,i=Lq(r,t,n,e);super(i,Iq(r),Pq),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Iq(e){return{positionerRef:_.createRef(),popupRef:_.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:_.createRef(),beforeTriggerFocusGuardRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Lq(e,t,n=!1,r){return{...up(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Ka,inputProps:Ka,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new bf,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ka,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Rq=_.createContext(null);function zq(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Bq(e,t){return e===`list-navigation`||zq(e,t)}var Vq=co(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:v=!1,virtualFocus:y=!1,virtualFocusRef:b,allowEscape:x=!0,resetOnPointerLeave:S=!0}=e,C=OK(!0),w=MK(!0),T=Mq(!0),E=w?.store,D=w?.virtualFocus??!1,O=_.useMemo(()=>v&&E?{type:`menu`,store:E}:T?{type:`menubar`,context:T}:C&&!E?{type:`context-menu`,context:C}:{type:void 0},[C,E,T,v]),k=rH(),A=rH(),[j,M]=_.useState(void 0),N=(j??A)||void 0,P=Cf(),F=O.type===`menu`?O.store:void 0,I=(n??o)&&F?.state.transitionStatus===`starting`,L=Ya(()=>I?F?.state.instantType:void 0).current,R=Ya(()=>{let e=new Fq({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:O,disabled:s,highlightItemOnHover:g,modal:O.type===void 0?c:void 0,rootId:k,instantType:L},N,P!=null);return e.context.virtualFocusRef=b,e}).current;R.useControlledProp(`openProp`,n),R.useControlledProp(`triggerIdProp`,m),R.useContextCallback(`onOpenChangeComplete`,i);let z=R.useState(`floatingTreeRoot`),B=Tf(z),V=R.useState(`open`),ee=R.useState(`activeTriggerElement`),te=R.useState(`positionerElement`),ne=R.useState(`hoverEnabled`),re=R.useState(`disabled`),H=R.useState(`lastOpenChangeReason`),U=R.useState(`parent`),ie=R.useState(`activeIndex`),ae=R.useState(`keyboardOpen`),oe=R.useState(`payload`),W=R.useState(`floatingParentNodeId`),se=_.useRef(null),ce=_.useRef(U.type!==`context-menu`),le=os(),ue=_.useRef(!0),de=os(),fe=W!=null,{openMethod:pe,triggerProps:me}=cH(V);R.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:U.type===void 0?c:void 0,openMethod:pe,rootId:k}),rp(R);let{forceUnmount:he,transitionStatus:ge}=ip(V,R,()=>{R.set(`allowMouseEnter`,!1)},I),_e=yu(R.context.popupRef);_.useEffect(()=>{if(L===void 0)return;let e=()=>{R.state.instantType===L&&R.set(`instantType`,void 0)};if(!V){e();return}if(ge!==void 0)return;if(R.context.popupRef.current==null){e();return}let t=new AbortController;return _e(e,t.signal),()=>{t.abort()}},[L,V,ge,_e,R]),q(()=>{C&&!w?R.update({parent:{type:`context-menu`,context:C},floatingNodeId:B,floatingParentNodeId:P}):(w||!R.select(`activeTriggerElement`))&&R.update({floatingNodeId:B,floatingParentNodeId:P})},[C,w,B,P,ee,R]),_.useEffect(()=>{V||(se.current=null),U.type===`context-menu`&&(V?le.start(500,()=>{ce.current=!0}):(le.clear(),ce.current=!1))},[le,V,U.type]),q(()=>{!V&&!ne&&R.set(`hoverEnabled`,!0)},[V,ne,R]);let ve=J((e,t)=>{let n=t.reason;if(!e&&!R.select(`open`)||V===e&&t.trigger===ee&&H===n)return;let i=ep(t);if(!e&&t.trigger==null&&(t.trigger=ee??void 0),r?.(e,t),t.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ue.current)return;e&&n===`trigger-focus`?(ue.current=!1,de.start(300,()=>{ue.current=!0})):(ue.current=!0,de.clear());let o=!e&&(n===`escape-key`||n==null);se.current=t.event;let s=$f(R.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Bq(n,a),s.instantType=U.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:zq(n,a)?`click`:o?`dismiss`:void 0,R.update(s)}),ye=Wf({popupStore:R,floatingRootContext:R.state.floatingRootContext,floatingId:N,nested:P!=null,onOpenChange:ve}),G=ye.context.events;q(()=>{let e=({open:e,eventDetails:t})=>ve(e,t);return G.on(`setOpen`,e),()=>{G?.off(`setOpen`,e)}},[G,ve]),q(()=>R.subscribeToParentMenu(),[R]);let be=_.useCallback(()=>{R.setOpen(!1,fd(zd))},[R]);_.useImperativeHandle(d,()=>({unmount:he,close:be}),[he,be]);let xe;U.type===`context-menu`&&(xe=U.context),_.useImperativeHandle(xe?.positionerRef,()=>te,[te]),_.useImperativeHandle(xe?.actionsRef,()=>({setOpen:ve}),[ve]);let Se=Uf(ye,{enabled:!re,bubbles:{escapeKey:f&&U.type===`menu`},outsidePress(){return U.type!==`context-menu`||se.current?.type===`contextmenu`||ce.current},externalTree:fe?z:void 0}),Ce=Ym(),we=Pp(ye,{enabled:!re,listRef:R.context.itemDomElements,activeIndex:ie,virtual:y,nested:U.type===`menubar`||!y&&U.type!==void 0,parentOrientation:U.type===`menubar`?U.context.orientation:void 0,loopFocus:l,focusItemOnOpen:y?ae:void 0,allowEscape:y&&l&&x,orientation:u,triggerOrientation:y?`vertical`:u,rtl:Ce===`rtl`,disabledIndices:Ga,onNavigate(e,t){R.setActiveIndex(e,Nq(t),t?.nativeEvent)},openOnArrowKeyDown:U.type!==`context-menu`&&!(y&&v),externalTree:!y&&fe?z:void 0,nestedReturnFocusRef:F?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:S}),Te=_.useCallback(e=>{R.context.typingRef.current=e},[R]),Ee=Fp(ye,{enabled:!re&&!y,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:ie,resetMs:500,onMatch:(e,t)=>{V&&e!==ie&&R.setActiveIndex(e,kd,t.nativeEvent)},onTyping:Te}),De=J(a),Oe=_.useRef(-1),ke=J(()=>{let e=R.state.activeIndex,t=e===null?void 0:R.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Oe.current===n&&R.context.reportedItem===t)return;Oe.current=n,R.context.reportedItem=t,y&&R.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=R.context;R.context.highlightReason=md,R.context.highlightEvent=void 0,a&&De(t,pd(r,i,{label:t===void 0?void 0:R.context.itemLabels.current[n]??void 0}))});q(()=>{ke()},[ie,ke]);let Ae=_.useMemo(()=>{if(!y)return we.reference;if(!we.trigger)return Ka;let{onFocus:e,...t}=we.trigger;return t},[y,we.reference,we.trigger]);R.useSyncedValue(`inputProps`,y?we.reference??Ka:Ka);let je=_.useMemo(()=>{let e=Wl(Ee.reference,Ae,Se.reference,{onMouseMove(){R.set(`allowMouseEnter`,!0)}},me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=V,e},[R,Ee.reference,Ae,Se.reference,me,V]),Me=_.useMemo(()=>{let e=Wl(we.trigger,Se.trigger,me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[we.trigger,Se.trigger,me]);Ya(()=>(R.update({inactiveTriggerProps:Me}),null)),ap(R,{floatingRootContext:ye,activeTriggerProps:je,inactiveTriggerProps:Me,popupProps:_.useMemo(()=>Wl(qf,{onMouseMove(){R.set(`allowMouseEnter`,!0),U.type===`menu`&&R.set(`hoverEnabled`,!1)},onClick(){R.select(`hoverEnabled`)&&R.set(`hoverEnabled`,!1)},onKeyDown(e){let t=R.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ee.floating,we.floating,Se.floating),[U.type,R,Ee.floating,we.floating,Se.floating]),itemProps:we.item??Ka});let Ne=_.useMemo(()=>({store:R,parent:O,orientation:u,loopFocus:l,allowEscape:x,defaultFloatingId:A,setRenderedFloatingId:M,virtualFocus:y,parentVirtualFocus:D,syncHighlightedItem:ke}),[R,O,u,l,x,A,y,D,ke]),Pe=typeof t==`function`?t({payload:oe}):t,Fe=(0,X.jsxs)(jK.Provider,{value:Ne,children:[p&&(0,X.jsx)(Xf,{handle:p,store:R}),Pe]});return(U.type===void 0||U.type===`context-menu`)&&(Fe=(0,X.jsx)(Df,{externalTree:z,children:Fe})),Fe});function Hq(e){let t=_.useContext(Rq);if(t===null)return(0,X.jsx)(Vq,{...e});let n=t.Root;return(0,X.jsx)(Rq.Provider,{value:null,children:(0,X.jsx)(n,{...t.options,...e})})}var Uq={};function Wq(e){MK();let t=_.useContext(Rq);if(t!==null){let n=t.SubmenuRoot;return(0,X.jsx)(Rq.Provider,{value:null,children:(0,X.jsx)(n,{...t.options,...e})})}return(0,X.jsx)(nq.Provider,{value:Uq,children:(0,X.jsx)(Vq,{...e,isSubmenu:!0})})}var Gq=5;function Kq(e,t){let n=qq(t);return e.clientX>=n.left-Gq&&e.clientX<=n.right+Gq&&e.clientY>=n.top-Gq&&e.clientY<=n.bottom+Gq}function qq(e){let t=e.getBoundingClientRect(),n=Do(e);if(Es)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Jq(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=id(),{ref:i,index:a}=GK(e),o=n===a,s=_.useRef(null),c=Ml(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Yq(e){let{render:t,className:n,style:r,state:i=Ka,props:a=Ga,refs:o=Ga,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Jq({metadata:s});return Z(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Xq(e){if(jo(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Uo(e))return Xq(Ko(e))}function Zq(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=_.useRef(!1);return _.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Zo(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Ka,[t,n,r])}var Qq=lo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=MK(!0),h=_p(d)??m?.store;if(!h)throw Error(Za(85));let g=rH(s),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerControlsId`,g),S=_.useRef(null),C=eJ(),w=id(!0),T=wf(),E=_.useMemo(()=>T??new bf,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=np(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:Tf(E),floatingParentNodeId:Cf(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=sd({disabled:j,native:o});_.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=_.useRef(null),F=os(),I=J(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Y(P.current,t)||Y(h.select(`positionerElement`),t)||t===P.current||t!=null&&Xq(t)===h.select(`rootId`)||Kq(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:Pd})});_.useEffect(()=>{let e=Zo(P.current);if(b&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,I,{once:!0}),()=>{e.removeEventListener(`mouseup`,I)}},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=Dp(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:Up({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=$q(b,h.select(`lastOpenChangeReason`)),B=Lf(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),V=yp(y,{enabled:!j&&L}),ee=Zq({open:b,enabled:k,mouseDownAction:`open`}),te=_.useMemo(()=>Wl(V.reference,B.reference),[V.reference,B.reference]),ne=h.useState(`triggerProps`,O),re=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:H,handleFocusTargetFocus:U}=iH(h,S),ie={disabled:j,open:b},ae=[P,t,N,D,S],oe=[te,R??Ka,ne,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Zo(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},re,k?{role:`menuitem`}:{},ee,p,M],W=Z(`button`,e,{enabled:!k,stateAttributesMapping:Qs,state:ie,ref:ae,props:oe});return k?(0,X.jsx)(Yq,{tag:`button`,render:n,className:r,style:i,state:ie,refs:ae,props:oe,stateAttributesMapping:Qs}):b?(0,X.jsxs)(_.Fragment,{children:[(0,X.jsx)(jl,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:H},`${g}-pre-focus-guard`),(0,X.jsx)(_.Fragment,{children:W},g),(0,X.jsx)(jl,{ref:h.context.triggerFocusTargetRef,onFocus:U},`${g}-post-focus-guard`)]}):(0,X.jsx)(_.Fragment,{children:W},g)});function $q(e,t){let n=os(),[r,i]=_.useState(!1);return q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function eJ(){let e=Mq(!0);return _.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var tJ=_.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Z(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function nJ(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var rJ={"aria-expanded":void 0},iJ=_.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=MK(!0);if(p?.parent.type!==`menu`)throw Error(Za(37));let m=AK(),h=rq(),{store:g,parentVirtualFocus:v}=p,y=p.parent.store,b=GK({guess:!0,label:a}),x=rH(o),S=g.useState(`open`),C=_.useRef(!1),w=g.useState(`positionerElement`),T=g.useState(`floatingRootContext`),E=g.useState(`floatingTreeRoot`),D=g.useState(`triggerPopupId`,x),O=Qf(x,g),k=J(e=>{O(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:x??null,activeTriggerElement:e,closeDelay:u})}),A=_.useRef(null),j=_.useCallback(e=>{A.current=e,g.set(`activeTriggerElement`,e)},[g]);q(()=>(k(A.current),()=>k(null)),[k,x,g]),q(()=>{if(!S||!w)return;function e(e){ks(e)===g.context.beforeContentFocusGuardRef.current&&(C.current=e.relatedTarget===A.current)}return w.addEventListener(`focusout`,e,!0),()=>{C.current=!1,w.removeEventListener(`focusout`,e,!0)}},[S,w,g]),g.useSyncedValue(`closeDelay`,u);let M=g.useState(`disabled`),N=y.useState(`disabled`),P=d||M||N,F=y.useState(`itemProps`),I=y.useState(`isActive`,b.index),L=_.useMemo(()=>({type:`submenu-trigger`,setActive(e){y.select(`highlightItemOnHover`)&&y.setActiveIndex(b.index,Ad,e)}}),[y,b.index]),{getItemProps:R,itemRef:z}=HK({closeOnClick:!1,disabled:P,highlighted:I,id:x,store:g,typingRef:y.context.typingRef,nativeButton:s,itemMetadata:L,nodeId:m?.context.nodeId}),B=Dp(T,{enabled:g.useState(`hoverEnabled`)&&c&&!P,handleClose:Up({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>y.select(`allowMouseEnter`):void 0,triggerElementRef:A,externalTree:E,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),V=Lf(T,{enabled:!P,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??Ka,ee=g.useState(`triggerProps`,!0);delete ee.id;let te={disabled:P,highlighted:I,open:S},ne=g.useState(`openMethod`),re=g.useState(`lastOpenChangeReason`)===`list-navigation`||ne===`keyboard`,H=S&&re&&Ts;return Z(`div`,e,{state:te,stateAttributesMapping:Zs,props:[V,B,ee,h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0,F,H?rJ:void 0,{"aria-controls":D,tabIndex:v||!(S||I)?-1:0,onFocus(e){g.select(`open`)&&C.current&&(C.current=!1,g.setOpen(!1,fd(Ed,e.nativeEvent)))},onBlur(){I&&y.setActiveIndex(null,md)}},f,R],ref:[t,b.ref,z,k,j]})}),aJ=_.forwardRef(function(e,t){let n=RK(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?Wl(n.props,e):e;return(0,X.jsx)(iJ,{...r,ref:n.ref})});function oJ(e){return Array.isArray(e)?e.map(e=>oJ(e)).join(`,`):e==null?``:String(e)}function sJ(e){let[t,n]=_.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=_.useRef(null),i=_.useRef(null),a=_.useRef(null),o=_.useRef(null),s=_.useRef(!0),c=_.useRef(null),l=Xu(),u=_.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,X.jsx)(DK.Provider,{value:u,children:(0,X.jsx)(jK.Provider,{value:void 0,children:(0,X.jsx)(Hq,{...e})})})}var cJ=500,lJ=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=OK(!1),{store:m}=MK(!1),h=m.useState(`open`),g=m.useState(`disabled`),v=_.useRef(null),y=_.useRef(null),b=os(),x=os(),S=_.useRef(!1),C=_.useRef(null);function w(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),S.current=!1,s.current?.setOpen(!0,fd(hd,n)),x.start(cJ,()=>{S.current=!0})}function T(e){if(g)return;d.current=!0,fc(e),w(e.clientX,e.clientY,e.nativeEvent);let t=Zo(v.current);C.current?.abort();let n=new AbortController;C.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!S.current)return;x.clear(),S.current=!1;let t=ks(e);Y(u.current,t)||p&&t&&Xq(t)===p||s.current?.setOpen(!1,fd(Pd,e))},{once:!0,signal:n.signal})}function E(){b.clear(),y.current=null}function D(e){if(g||(d.current=!1,e.touches.length!==1)){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};y.current=n,b.start(cJ,()=>{w(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1)E();else if(b.isStarted()&&y.current){let t=e.touches[0],n=Math.abs(t.clientX-y.current.x),r=Math.abs(t.clientY-y.current.y);(n>10||r>10)&&E()}}return _.useEffect(()=>()=>{C.current?.abort()},[]),_.useEffect(()=>{function e(e){if(g)return;let t=ks(e);(Y(v.current,t)||Y(c.current,t)||Y(l.current,t))&&e.preventDefault()}return Qo(Zo(v.current),`contextmenu`,e)},[l,g,c]),Z(`div`,e,{state:{open:h},ref:[v,t],props:[{onContextMenu:T,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:Qs})}),uJ=xq;function dJ({...e}){return(0,X.jsx)(sJ,{"data-slot":`context-menu`,...e})}function fJ({className:e,...t}){return(0,X.jsx)(lJ,{"data-slot":`context-menu-trigger`,className:Q(`select-none`,e),...t})}function pJ({className:e,align:t=`start`,alignOffset:n=4,side:r=`right`,sideOffset:i=0,...a}){return(0,X.jsx)(pq,{children:(0,X.jsx)(uJ,{className:`isolate z-50 outline-none`,align:t,alignOffset:n,side:r,sideOffset:i,children:(0,X.jsx)(uq,{"data-slot":`context-menu-content`,className:Q(`z-50 max-h-(--available-height) w-50 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[10px] bg-popover p-1 text-xs text-popover-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-1 ring-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function mJ({...e}){return(0,X.jsx)(QK,{"data-slot":`context-menu-group`,...e})}function hJ({className:e,inset:t,...n}){return(0,X.jsx)($K,{"data-slot":`context-menu-label`,"data-inset":t,className:Q(`px-2 pt-1.5 pb-1 text-[11px] font-semibold text-muted-foreground data-inset:pl-7`,e),...n})}function gJ({className:e,inset:t,variant:n=`default`,...r}){return(0,X.jsx)(tq,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:Q(`group/context-menu-item relative flex h-7 cursor-default items-center gap-1.5 rounded-md px-2 py-0 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function _J({className:e,...t}){return(0,X.jsx)(tJ,{"data-slot":`context-menu-separator`,className:Q(`my-1 h-px bg-border`,e),...t})}function vJ({className:e,...t}){return(0,X.jsx)(`kbd`,{"data-slot":`context-menu-shortcut`,className:Q(`ml-auto grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-[11px] font-normal text-muted-foreground`,e),...t})}function yJ({action:e,children:t,binding:n,chips:r,keyName:i,variant:a}){let o=pe(n===void 0?e?.keys:[n],fe()),s=r??(o?ie(o):[]);return(0,X.jsxs)(gJ,{variant:a,disabled:!e||!be(e),"aria-keyshortcuts":i,onClick:()=>e?.run(),children:[t??e?.label,s.length>0?(0,X.jsx)(`span`,{"aria-hidden":!0,className:`ml-auto flex gap-[3px]`,children:s.map((e,t)=>(0,X.jsx)(`kbd`,{className:`grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-[11px] font-normal text-muted-foreground`,children:e},t))}):null]})}function bJ({action:e}){return(0,X.jsx)(yJ,{action:e,chips:[`⌫`],keyName:`Delete`,variant:`destructive`,children:`Delete`})}function xJ({children:e}){return(0,X.jsx)(hJ,{children:e})}function SJ(e,t,n,r){let i=r?e.find(e=>e.ref===r.frame&&!e.hidden):void 0;if(r&&i&&CJ(r.box,t))return{kind:`element`,frame:i,at:t};let a=YW(e,t,n);return a?{kind:`frame`,frame:a,at:t}:{kind:`canvas`,at:t}}function CJ(e,{x:t,y:n}){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}var wJ={frame:`w-55`,element:`w-[230px]`,canvas:`w-[210px]`};function TJ({page:e,frames:t,viewport:n,layer:r,trigger:i}){let[a,o]=(0,_.useState)(null),s=e=>{let i=n.current,a=r.current;if(!i||!a)return null;let o=xz(i),[s,c]=o.invert(OI(e,i)),{element:l}=_P.getState(),u=l?JW(a):null;return SJ(t(),{x:s,y:c},o.k,l&&u?{frame:l.frame,box:u}:null)};return(0,X.jsxs)(dJ,{onOpenChangeComplete:e=>{e||wK.setState({at:null,frame:null})},children:[(0,X.jsx)(fJ,{render:i,onContextMenu:t=>{let n=t.nativeEvent.defaultPrevented?null:s(t.nativeEvent);if(!n)t.preventBaseUIHandler();else{if(n.kind===`frame`){let{frames:t,element:r}=_P.getState();(r||!t.includes(n.frame.ref))&&nP(_P,e,[n.frame.ref])}wK.setState({at:n.at,frame:n.kind===`canvas`?null:n.frame.ref}),o(n)}}}),(0,X.jsxs)(pJ,{className:a?wJ[a.kind]:void 0,children:[a?.kind===`frame`?(0,X.jsx)(DJ,{}):null,a?.kind===`element`?(0,X.jsx)(kJ,{noteable:!0}):null,a?.kind===`canvas`?(0,X.jsx)(jJ,{}):null]})]})}var EJ=[`frame.copy`,`frame.cut`,`frame.copyPng`,`frame.duplicate`,`section.wrap`,`frame.rename`,`frame.fitHeight`,`frame.compare`,`note.addOnFrame`,`tool.note`,`frame.hide`,`frame.lock`,`frame.flipTheme`,`frame.delete`];function DJ(){let[e,t,n,r,i,a,o,s,c,l,u,d,f,p]=xe(EJ),m=vP(e=>e.frames.length);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(mJ,{children:[(0,X.jsx)(xJ,{children:m>1?`${m} frames`:`Frame`}),(0,X.jsx)(yJ,{action:e,children:`Copy`}),(0,X.jsx)(yJ,{action:t,children:`Cut`}),(0,X.jsx)(yJ,{action:n,children:`Copy as PNG`}),(0,X.jsx)(yJ,{action:r,children:`Duplicate`}),(0,X.jsx)(yJ,{action:i,children:`Wrap in section`}),(0,X.jsx)(yJ,{action:a,children:`Rename`}),(0,X.jsx)(yJ,{action:o,children:`Fit height`}),(0,X.jsx)(yJ,{action:s,children:`Compare with before`}),(0,X.jsx)(yJ,{action:c,binding:l?.keys?.[0],children:`Add a note`})]}),(0,X.jsx)(_J,{}),(0,X.jsxs)(mJ,{children:[(0,X.jsx)(yJ,{action:u,children:`Hide`}),(0,X.jsx)(yJ,{action:d,children:d?.checked?.()?`Unlock`:`Lock`}),(0,X.jsx)(yJ,{action:f})]}),(0,X.jsx)(_J,{}),(0,X.jsx)(bJ,{action:p})]})}var OJ=[`note.addHere`,`tool.note`,`element.up`,`view.zoomToSelection`,`element.toFront`,`element.forward`,`element.moveDown`,`element.backward`,`element.moveUp`,`element.toBack`,`frame.copyPng`,`element.delete`];function kJ({noteable:e}){let[t,n,r,i,a,o,s,c,l,u,d,f]=xe(OJ),p=vP(e=>e.element??null),m=p?TB(p.frame):null,h=p&&m?jB(m.elements,p.index)===null:!0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(mJ,{children:[(0,X.jsx)(xJ,{children:`Element`}),e?(0,X.jsx)(yJ,{action:t,binding:n?.keys?.[0],children:`Add a note here`}):null,(0,X.jsx)(yJ,{action:r,children:h?`Select frame`:`Select parent`}),(0,X.jsx)(yJ,{action:i,children:`Zoom to selection`}),(0,X.jsx)(_J,{}),(0,X.jsx)(yJ,{action:a,children:`Bring to front`}),(0,X.jsx)(yJ,{action:o,binding:s?.keys?.[0],children:`Bring forward`}),(0,X.jsx)(yJ,{action:c,binding:l?.keys?.[0],children:`Send backward`}),(0,X.jsx)(yJ,{action:u,children:`Send to back`}),(0,X.jsx)(_J,{}),(0,X.jsx)(yJ,{action:d,children:`Copy frame as PNG`})]}),(0,X.jsx)(_J,{}),(0,X.jsx)(bJ,{action:f})]})}var AJ=[`frame.pasteAt`,`frame.paste`,`frame.newAt`,`tool.frame`,`selection.all`,`view.zoomToFit`,`view.hideUi`];function jJ(){let[e,t,n,r,i,a,o]=xe(AJ);return(0,X.jsxs)(mJ,{children:[(0,X.jsx)(xJ,{children:`Empty canvas`}),(0,X.jsx)(yJ,{action:e,binding:t?.keys?.[0],children:`Paste here`}),(0,X.jsx)(yJ,{action:n,binding:r?.keys?.[0],children:`New frame here`}),(0,X.jsx)(_J,{}),(0,X.jsx)(yJ,{action:i,children:`Select all`}),(0,X.jsx)(yJ,{action:a,children:`Zoom to fit`}),(0,X.jsx)(yJ,{action:o,children:`Hide UI`})]})}var MJ=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),NJ=`Only PNG, JPEG, GIF, and WebP images go in a note.`;function PJ(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),i=(0,_.useRef)(e);return(0,_.useEffect)(()=>{i.current=e},[e]),(0,_.useEffect)(()=>()=>{for(let e of i.current)URL.revokeObjectURL(e.url)},[]),{images:e,refusal:n,add:e=>{let n=e.filter(e=>MJ.has(e.type));r(n.length<e.length?NJ:null),n.length!==0&&t(e=>[...e,...n.map(e=>({id:crypto.randomUUID(),file:e,url:URL.createObjectURL(e)}))])},remove:n=>{let i=e.find(e=>e.id===n);i&&URL.revokeObjectURL(i.url),r(null),t(e=>e.filter(e=>e.id!==n))},upload:async t=>{if(e.length===0)return[];let n=new FormData;n.append(`page`,t);for(let t of e)n.append(`files`,t.file);return(await Tx(`/api/notes/images`,n)).images},clear:()=>{for(let t of e)URL.revokeObjectURL(t.url);r(null),t([])}}}function FJ(e){return[...e?.files??[]].filter(e=>e.type.startsWith(`image/`))}function IJ(e){return[...e?.types??[]].includes(`Files`)}var LJ=`frameboard:new-session`;function RJ(e,t,n=!1){return t&&e.some(e=>e.session===t)?t:e.length===1?e[0]?.session??``:e.length===0&&n?LJ:``}function zJ(e,t,n,r,i=r){return e===`frameboard:new-session`&&r||t.some(t=>t.session===e)?e:RJ(t,n,r&&i)}function BJ(e){return e===``?{}:e===`frameboard:new-session`?{dispatch:!0}:{to:e}}function VJ(e){if(e instanceof wx){if(e.code===`stale-address`)return`The frame changed since it was clicked. Click the element again.`;if(e.code===`unauthorized`)return`This tab cannot write. Run frameboard open for a tab that can.`;if(e.code===`notes-invalid`)return`This page's notes.json does not read. Fix it by hand and try again.`;if(e.code===`dispatch-unavailable`)return`Restart serve with FRAMEBOARD_DISPATCH set to start a session.`;if(e.code===`image-type-refused`)return`Only PNG, JPEG, GIF, and WebP images go in a note.`;if(e.code===`asset-too-large`)return`The images are too large to send. Remove one and try again.`;if(e.code===`dispatch-failed`)return`The session did not start. Check .run/dispatch.log and try again.`}return`The note did not save. Try again.`}var HJ=`.notes/`,UJ=`block size-12 overflow-hidden rounded-md border border-border bg-muted object-cover`;function WJ({images:e,onRemove:t}){return e.length===0?null:(0,X.jsx)(`ul`,{"aria-label":`Images`,className:`mb-1.5 flex flex-wrap gap-1.5`,children:e.map((e,n)=>(0,X.jsxs)(`li`,{className:`relative`,children:[(0,X.jsx)(`img`,{src:e.url,alt:`Image ${n+1}: ${e.file.name}`,className:UJ}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove image ${n+1}`,onClick:()=>t(e.id),className:`absolute -top-1.5 -right-1.5 grid size-6 place-items-center rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,X.jsx)(`span`,{className:`grid size-4 place-items-center rounded-full bg-foreground text-card hover:bg-foreground/80`,children:(0,X.jsx)(Xi,{"aria-hidden":!0,className:`size-3`})})})]},e.id))})}function GJ({page:e,images:t}){let[n,r]=e.split(`/`),i=t.filter(e=>e.startsWith(HJ));return!n||!r||i.length===0?null:(0,X.jsx)(`ul`,{"aria-label":`Images`,className:`mt-1.5 flex flex-wrap gap-1.5`,children:i.map((e,t)=>{let i=`/api/note-images/${encodeURIComponent(n)}/${encodeURIComponent(r)}/${encodeURIComponent(e.slice(7))}`;return(0,X.jsx)(`li`,{children:(0,X.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,"aria-label":`Open image ${t+1} full size`,className:`block rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,X.jsx)(`img`,{src:i,alt:``,className:UJ})})},e)})})}function KJ({listeners:e}){return(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 font-normal text-muted-foreground`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-claim`}),e.length===0?`No session listening`:`${e.length} listening`]})}function qJ({listeners:e,value:t,onChange:n,disabled:r,dispatch:i=!1,optional:a=!1}){let o=e.length===0&&!i,s=e.length===0&&(o||a);return(0,X.jsxs)(`label`,{className:`relative flex h-[26px] min-w-0 items-center gap-1.5 rounded-md bg-muted pr-6 pl-2 text-foreground has-[select:disabled]:opacity-60 has-[select:focus-visible]:ring-3 has-[select:focus-visible]:ring-ring/50`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-[7px] shrink-0 rounded-full bg-claim`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Send to`}),(0,X.jsxs)(`select`,{value:t,disabled:r||o,onChange:e=>n(e.target.value),className:`min-w-0 appearance-none truncate bg-transparent outline-none disabled:cursor-not-allowed`,children:[s?(0,X.jsx)(`option`,{value:``,children:`No session`}):null,e.length>1?(0,X.jsx)(`option`,{value:``,disabled:!0,children:`Pick a session`}):null,e.map(e=>(0,X.jsx)(`option`,{value:e.session,children:e.tag},e.session)),i?(0,X.jsx)(`option`,{value:LJ,children:`New session`}):null]}),(0,X.jsx)(Nt,{"aria-hidden":!0,className:`pointer-events-none absolute right-2 size-2.5 text-muted-foreground`})]})}function JJ({pick:e,onClose:t}){let n=$g(e=>e.listeners),r=$g(t=>t.claims[e.frame.ref]?.session),i=$g(e=>e.canWrite),a=$g(e=>e.dispatch),o=JN(e.frame.ref),s=XN(e=>e.drafts[o]??``),c=e=>ZN(o,e),[l,u]=(0,_.useState)(()=>RJ(n,r,a)),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(!1),h=PJ(),g=zJ(l,n,r,a),v=async n=>{if(s.trim()===``)f(`Write the note first`);else if(n===``)f(`Pick a session to send it to`);else{m(!0);try{let r=e.frame.ref.split(`/`).slice(0,-1).join(`/`),i=await h.upload(r);await Tx(`/api/notes`,{frame:e.frame.ref,text:s.trim(),...i.length===0?{}:{images:i},...e.element===null?{}:{element:e.element,renderedAt:e.renderedAt},...n===null?{}:BJ(n)}),c(``),h.clear(),c_.getState().tool===`note`&&c_.setState({tool:`move`}),t()}catch(e){f(VJ(e))}finally{m(!1)}}};return(0,X.jsx)(YJ,{title:`New note on ${e.frame.name}`,listeners:n,onClose:t,children:(0,X.jsxs)(`form`,{className:`m-3 rounded-lg border border-border p-2`,onSubmit:e=>{e.preventDefault(),v(g)},onDragOver:e=>{i&&IJ(e.dataTransfer)&&e.preventDefault()},onDrop:e=>{i&&IJ(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),h.add([...e.dataTransfer.files]))},children:[(0,X.jsx)(`textarea`,{"aria-label":`Note on ${e.frame.name}`,autoFocus:!0,value:s,disabled:!i,onChange:e=>{c(e.target.value),f(null)},onPaste:e=>{let t=FJ(e.clipboardData);t.length!==0&&(e.preventDefault(),h.add(t))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()},rows:2,className:`block min-h-7 w-full resize-none bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),(0,X.jsx)(WJ,{images:h.images,onRemove:h.remove}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(qJ,{listeners:n,value:g,onChange:e=>{u(e),f(null)},disabled:!i,dispatch:a}),(0,X.jsx)(XJ,{variant:`ghost`,className:`ml-auto`,disabled:!i||p,onClick:()=>void v(null),children:`Save`}),(0,X.jsx)(XJ,{type:`submit`,variant:`primary`,disabled:!i||p||n.length===0&&!a,children:`Send`})]}),d??h.refusal?(0,X.jsx)(`p`,{role:`alert`,className:`mt-2 text-destructive`,children:d??h.refusal}):null]})})}function YJ({title:e,listeners:t,onClose:n,children:r}){return(0,X.jsxs)(`section`,{"aria-label":e,"data-note-card":!0,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},onPointerDown:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),className:`pointer-events-auto flex w-[300px] flex-col overflow-hidden rounded-xl border border-border bg-card text-body text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)]`,children:[(0,X.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border px-3 py-2.5 font-semibold`,children:[(0,X.jsx)(`h2`,{className:`truncate`,children:e}),(0,X.jsx)(KJ,{listeners:t})]}),r]})}function XJ({variant:e,className:t,type:n=`button`,...r}){return(0,X.jsx)(`button`,{type:n,className:Q(`flex h-[26px] shrink-0 items-center rounded-lg px-3 font-medium outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50`,e===`primary`?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-muted text-foreground hover:bg-accent`,t),...r})}function ZJ({title:e,notes:t,onPick:n,onClose:r}){let i=(0,_.useRef)([]),[a,o]=(0,_.useState)(0);(0,_.useEffect)(()=>{i.current[0]?.focus()},[]);let s=e=>{let n=(e+t.length)%t.length;o(n),i.current[n]?.focus()},c={ArrowDown:()=>s(a+1),ArrowUp:()=>s(a-1),Home:()=>s(0),End:()=>s(t.length-1)};return(0,X.jsxs)(`section`,{"aria-label":e,"data-note-card":!0,onKeyDown:e=>{if(e.key===`Escape`){e.stopPropagation(),r();return}let t=c[e.key];t&&(e.preventDefault(),e.stopPropagation(),t())},onPointerDown:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),className:`pointer-events-auto flex min-h-0 w-[240px] flex-col overflow-hidden rounded-xl border border-border bg-card text-body text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)]`,children:[(0,X.jsx)(`h2`,{className:`px-3 pt-2.5 pb-1 font-normal text-muted-foreground`,children:e}),(0,X.jsx)(`div`,{role:`menu`,"aria-label":e,className:`flex min-h-0 flex-col overflow-y-auto p-1`,children:t.map((e,t)=>(0,X.jsxs)(`button`,{ref:e=>{i.current[t]=e},type:`button`,role:`menuitem`,"aria-label":`Note ${e.number}: ${QJ(e.text)}`,tabIndex:t===a?0:-1,onFocus:()=>o(t),onClick:()=>n(e.id),className:`flex h-7 shrink-0 items-center gap-2 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`grid size-[18px] shrink-0 place-items-center rounded-[9px_9px_9px_2px] bg-note text-caption font-semibold text-[#1a1a1a]`,children:e.number}),(0,X.jsx)(`span`,{className:`truncate`,children:QJ(e.text)})]},e.id))})]})}function QJ(e){return e.split(`
69
+ `,1)[0]??``}function $J(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}var eY,tY=!1,nY=new Set;function rY(){return(0,_.useSyncExternalStore)(sY,()=>eY?.name)}function iY(){return(0,_.useSyncExternalStore)(sY,()=>eY?.source??null)}async function aY(e){oY(await Tx(`/api/author`,{name:e}))}function oY(e){eY=e;for(let e of nY)e()}function sY(e){return nY.add(e),tY||(tY=!0,fetch(`/api/author`).then(e=>e.json()).then(e=>e.ok?e.data:{name:null,source:null}).catch(()=>({name:null,source:null})).then(e=>{eY===void 0&&oY(e)})),()=>{nY.delete(e)}}function cY({notes:e,page:t,onClose:n}){let r=$g(e=>e.listeners),i=$g(n=>t?n.claims[`${t}/${e[0]?.frame}`]?.session:void 0),a=$g(e=>e.canWrite),o=$g(e=>e.dispatch),s=e[0]?.id??``,c=XN(e=>e.drafts[s]??``),l=e=>ZN(s,e),[u,d]=(0,_.useState)(()=>RJ(r,i)),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),g=PJ(),v=(0,_.useRef)(null),y=dY(v,e.length),b=e[0];if(!b)return null;let x=zJ(u,r,i,o,!1),S=async(e,t)=>{h(!0);try{await e(),t?.()}catch(e){p(VJ(e))}finally{h(!1)}},C=()=>{let e=c.trim();e===``&&g.images.length>0?p(`Write a reply to go with the images`):e===``&&x===``?p(r.length>1?`Pick a session to send it to`:`Write a reply first`):e===``?S(()=>Tx(`/api/notes/${b.id}/send`,BJ(x))):S(async()=>{let n=t?await g.upload(t):[];await Tx(`/api/notes/${b.id}/replies`,{text:e,...n.length===0?{}:{images:n},...BJ(x)})},()=>{l(``),g.clear()})};return(0,X.jsxs)(YJ,{title:`Note ${b.number??``}`.trim(),listeners:r,onClose:n,children:[(0,X.jsx)(`ol`,{ref:v,"aria-label":`Messages`,tabIndex:0,onScroll:y,onKeyDown:e=>{uY.has(e.key)&&e.stopPropagation()},className:`min-h-0 overflow-y-auto outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:e.map(e=>(0,X.jsx)(lY,{note:e,page:t},e.id))}),(0,X.jsxs)(`form`,{className:`mx-3 mt-1.5 mb-3 rounded-lg border border-border p-2`,onSubmit:e=>{e.preventDefault(),C()},onDragOver:e=>{a&&t&&IJ(e.dataTransfer)&&e.preventDefault()},onDrop:e=>{a&&t&&IJ(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),g.add([...e.dataTransfer.files]))},children:[(0,X.jsx)(`textarea`,{"aria-label":`Reply`,placeholder:`Reply, or hand it on…`,value:c,disabled:!a,onChange:e=>{l(e.target.value),p(null)},onPaste:e=>{let n=FJ(e.clipboardData);t&&n.length!==0&&(e.preventDefault(),g.add(n))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()},rows:1,className:`block min-h-7 w-full resize-none bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),(0,X.jsx)(WJ,{images:g.images,onRemove:g.remove}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(qJ,{listeners:r,value:x,onChange:e=>{d(e),p(null)},disabled:!a,dispatch:o,optional:!0}),(0,X.jsx)(XJ,{variant:`ghost`,className:`ml-auto`,disabled:!a||m,onClick:()=>void S(()=>Tx(`/api/notes/${b.id}/done`,{}),n),children:`Done`}),(0,X.jsx)(XJ,{type:`submit`,variant:`primary`,disabled:!a||m,children:`Send`})]}),f??g.refusal?(0,X.jsx)(`p`,{role:`alert`,className:`mt-2 text-destructive`,children:f??g.refusal}):null]})]})}function lY({note:e,page:t}){let n=rY(),r=e.from===`agent`;return(0,X.jsxs)(`li`,{className:`flex gap-2.5 px-3 py-2.5`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`grid size-[22px] flex-none place-items-center rounded-full text-[10px] font-bold`,r?`bg-claim/25 text-claim`:`bg-foreground text-card`),children:r?`C`:$J(e.author??n??``)||`Y`}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`b`,{className:`font-semibold`,children:r?`claude`:`You`}),(0,X.jsx)(`time`,{dateTime:e.createdAt,className:`ml-1.5 text-muted-foreground`,children:fY(e.createdAt)}),(0,X.jsx)(`p`,{className:`mt-0.5 leading-[1.45] break-words whitespace-pre-wrap`,children:e.text}),t&&e.images?(0,X.jsx)(GJ,{page:t,images:e.images}):null]})]})}var uY=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]);function dY(e,t){let n=(0,_.useRef)(!0);return(0,_.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(()=>{n.current&&t.scrollTo({top:t.scrollHeight})});return r.observe(t),()=>r.disconnect()},[e]),(0,_.useLayoutEffect)(()=>{let t=e.current;n.current&&t?.scrollTo({top:t.scrollHeight})},[e,t]),()=>{let t=e.current;t&&(n.current=t.scrollHeight-t.scrollTop-t.clientHeight<1)}}function fY(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:`${t.getHours()%12||12}:${String(t.getMinutes()).padStart(2,`0`)}`}function pY({page:e,frames:t,container:n}){let r=$g(t=>t.notes[e]),i=l_(e=>e.mode===`play`),a=XN(e=>e.open),[o,s]=(0,_.useState)(null);OY(n),DY(a!==null);let c=pN(t),l=new Map(c.map(e=>[e.name,e])),u=e=>{let t=l.get(e.frame);return t?EW(t,e.element,n):null},d=hY(i?[]:mY((r??[]).filter(e=>e.thread===null&&e.state!==`done`),u)),f=d.find(e=>e.key===o&&e.notes.length>1),p=_Y(f,d);if(i)return null;let m=Math.max(0,...(r??[]).map(e=>e.number??0))+1,h=t=>{s(null),YN.setState({open:{kind:`thread`,page:e,id:t}})},g=a?.kind===`thread`&&a.page===e?(r??[]).filter(e=>e.id===a.id||e.thread===a.id):null,v=g?.[0],y=v?d.find(e=>e.notes.some(e=>e.id===v.id))?.at??u(v):null;o!==null&&!f&&s(null);let b=e=>{s(null),document.querySelector(`[data-note-spot="${CSS.escape(e)}"]`)?.focus()};return(0,X.jsxs)(X.Fragment,{children:[d.map(e=>{let[t]=e.notes;if(!t||t.number===null)return null;let n=l.get(t.frame)?.ref;if(e.notes.length===1)return(0,X.jsx)(SY,{content:t.number,at:e.at,frame:n,element:t.element,pin:e.key,active:a?.kind===`thread`&&a.id===t.id,label:`Note ${t.number} on ${t.frame}`,onOpen:()=>h(t.id)},t.id);let r=e.notes.some(e=>a?.kind===`thread`&&a.id===e.id);return(0,X.jsx)(SY,{content:e.notes.length,at:e.at,frame:n,element:t.element,pin:e.key,spot:e.key,active:r||o===e.key,expanded:o===e.key,label:`${e.notes.length} notes on ${t.frame}`,onOpen:()=>{QN(),s(t=>t===e.key?null:e.key)}},e.key)}),a?.kind===`new`&&t.some(e=>e.ref===a.pick.frame.ref)?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(SY,{content:m,at:a.pick.at,active:!0}),(0,X.jsx)(EY,{at:a.pick.at,onDismiss:QN,children:(0,X.jsx)(JJ,{pick:a.pick,onClose:QN},a.pick.frame.ref)})]}):null,f?(0,X.jsx)(EY,{at:f.at,onDismiss:()=>s(null),children:(0,X.jsx)(`div`,{className:`contents`,onFocus:p.onFocus,onBlur:p.onBlur,children:(0,X.jsx)(ZJ,{title:`${f.notes.length} notes on ${f.notes[0]?.frame}`,notes:f.notes,onPick:e=>{b(f.key),h(e)},onClose:()=>b(f.key)})})}):null,g&&y?(0,X.jsx)(EY,{at:y,onDismiss:QN,children:(0,X.jsx)(cY,{notes:g,page:e,onClose:QN})}):null]})}function mY(e,t){let n=[];for(let r of e){let e=t(r);e&&r.number!==null&&n.push({note:r,at:e})}return n}function hY(e){let t=()=>gY(e,b_.zoom()),n=(0,_.useSyncExternalStore)(b_.onZoom,t,t),r=new Map(e.map(e=>[e.note.id,e]));return n===``?[]:n.split(`|`).map(e=>{let[t=``,n=``]=e.split(`:`);return{key:t,at:r.get(t)?.at??{x:0,y:0},notes:n.split(`,`).flatMap(e=>r.get(e)?.note??[])}})}function gY(e,t){return vY(e,t).map(e=>`${e.key}:${e.notes.map(e=>e.id).join(`,`)}`).join(`|`)}function _Y(e,t){let n=(0,_.useRef)(!1),r=(0,_.useRef)(null);return(0,_.useLayoutEffect)(()=>{let i=r.current;if(r.current=e?.notes[0]?.id??null,e||i===null||!n.current)return;n.current=!1;let a=t.find(e=>e.notes.some(e=>e.id===i));a&&document.querySelector(`[data-note-pin="${CSS.escape(a.key)}"]`)?.focus()}),{onFocus:()=>{n.current=!0},onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(n.current=!1)}}}function vY(e,t){let n=yY/t,r=[];for(let{note:t,at:i}of e){let e=r.find(e=>Math.abs(e.at.x-i.x)<n&&Math.abs(e.at.y-i.y)<n);e?e.notes.push(t):r.push({key:t.id,at:i,notes:[t]})}for(let e of r)e.notes.sort((e,t)=>(e.number??0)-(t.number??0));return r}var yY=24,bY=7,xY={x:bY+yY/2,y:-(bY+yY/2)};function SY({content:e,at:t,frame:n,element:r,pin:i,spot:a,active:o,expanded:s=o,label:c,onOpen:l}){let u=Q(`pointer-events-auto absolute grid size-[24px] origin-top-left place-items-center rounded-[12px_12px_12px_2px] bg-note text-label font-semibold text-[#1a1a1a] shadow-[0_2px_6px_rgba(0,0,0,.25)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,o&&`shadow-[0_0_0_3px_color-mix(in_srgb,var(--note)_35%,transparent),0_2px_6px_rgba(0,0,0,.25)]`),d={left:t.x,top:t.y,transform:`scale(calc(1 / var(--zoom, 1))) translate(${bY}px, ${-(bY+yY)}px)`};return l?(0,X.jsx)(`button`,{type:`button`,"data-note-marker":!0,"data-note-frame":n,"data-note-element":r??void 0,"data-note-pin":i,"data-note-spot":a,"aria-label":c,"aria-haspopup":a===void 0?void 0:`menu`,"aria-expanded":s,onPointerDown:e=>e.stopPropagation(),onClick:l,className:u,style:d,children:e}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:u,style:d,children:e})}var CY={x:21,y:-25},wY={left:xY.x+CY.x,right:CY.x-xY.x,top:xY.y+CY.y},TY=12;function EY({at:e,onDismiss:t,children:n}){let r=(0,_.useRef)(null),[i,a]=(0,_.useState)({flip:!1,y:0,cap:null});(0,_.useEffect)(()=>{let e=e=>{let n=e.target;n instanceof Node&&r.current?.contains(n)||n instanceof Element&&n.closest(`[data-note-marker]`)||t()};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[t]);let[o,s]=(0,_.useState)(0);return(0,_.useEffect)(()=>{let e=()=>s(e=>e+1),t=b_.onZoom(e),n=b_.onHandMove(e);return()=>{t(),n()}},[]),(0,_.useLayoutEffect)(()=>{let e=r.current,t=e?.closest(`[data-canvas]`);if(!e||!t)return;let n=t.getBoundingClientRect(),o=document.querySelector(`[role="toolbar"][aria-label="Tools"]`),s=Math.min(n.bottom,o?.getBoundingClientRect().top??n.bottom),c=document.querySelector(`[data-view-only-notice]`),l=Math.max(n.top,c?.getBoundingClientRect().bottom??n.top),u=e.getBoundingClientRect(),d=i.flip?u.right+u.width+2*CY.x:u.right,f=u.top-i.y,p={flip:d>n.right-TY,y:f<l+TY?l+TY-f:Math.min(0,s-TY-(f+u.height)),cap:s-l-24};(p.flip!==i.flip||Math.abs(p.y-i.y)>.5||p.cap!==i.cap)&&a(p)},[e.x,e.y,i,o]),(0,X.jsx)(`div`,{className:`absolute origin-top-left [transform:scale(calc(1/var(--zoom,1)))]`,style:{left:e.x,top:e.y},children:(0,X.jsx)(`div`,{ref:r,className:`absolute flex flex-col`,onBlur:e=>{let n=e.relatedTarget;n instanceof Node&&!e.currentTarget.contains(n)&&t()},style:{top:wY.top+i.y,maxHeight:i.cap??void 0,...i.flip?{right:wY.right}:{left:wY.left}},children:n})})}function DY(e){(0,_.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&QN()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function OY(e){let[,t]=(0,_.useState)(0);(0,_.useEffect)(()=>{if(!e)return;let n=()=>t(e=>e+1);return e.addEventListener(`load`,n,!0),()=>e.removeEventListener(`load`,n,!0)},[e])}var kY=N()(()=>({at:null}));function AY(e,{enabled:t,container:n,page:r,frames:i,toBoard:a,place:o=mV}){(0,_.useEffect)(()=>{let s=e.current;if(!t||!s||!n)return;let c=e=>{e.dataTransfer?.types.includes(`Files`)&&e.preventDefault()};s.addEventListener(`dragover`,c),s.addEventListener(`drop`,c);let l=e=>kY.setState({at:e&&a(e)}),u=jj({element:s,canDrop:({source:e})=>Qg.getState().canWrite&&qj(e.data)!==null,onDragEnter:({location:e})=>l(e.current.input),onDrag:({location:e})=>l(e.current.input),onDragLeave:()=>l(null),onDrop:({source:e,location:t})=>{l(null);let s=qj(e.data);s&&o(n,r,i(),a(t.current.input),s)}});return()=>{u(),s.removeEventListener(`dragover`,c),s.removeEventListener(`drop`,c),l(null)}},[e,t,n,r,i,a,o])}function jY({viewport:e,container:t,frames:n,toBoard:r}){let i=l_(e=>e.mode===`edit`&&BW(e.tool)),a=F(NW,e=>e.carried),o=F(kY,e=>e.at),s=i||a!==null,[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null);(0,_.useEffect)(()=>{if(t)return kY.subscribe(({at:e})=>{let r=e&&uV(t,n(),e),i=r?MY(r):null;d(e=>PY(e,i)?e:i)})},[t,n]),(0,_.useEffect)(()=>{let i=e.current;if(!s||!i||!t)return;let o=e=>{if(!a&&e.buttons&1&&NY())return;let i=r(e),o=a?dV(t,n(),i,a):uV(t,n(),i),s=o&&MY(o);l(e=>PY(e,s)?e:s)},c=()=>l(null);return i.addEventListener(`pointermove`,o),i.addEventListener(`pointerleave`,c),()=>{i.removeEventListener(`pointermove`,o),i.removeEventListener(`pointerleave`,c),l(null)}},[s,a,e,t,n,r]);let f=o?u:s?c:null;if(!f)return null;let p=f.height===0;return(0,X.jsx)(`div`,{"data-drop-line":!0,"aria-hidden":!0,className:`pointer-events-none absolute rounded-full bg-primary`,style:{left:f.x,top:f.y,width:p?f.width:Hz(2),height:p?Hz(2):f.height,translate:p?`0 -50%`:`-50% 0`,zIndex:iB}})}function MY({frame:e,gap:t}){return{...t.line,x:e.box.x+t.line.x,y:e.box.y+t.line.y}}function NY(){let e=zW();return e===`rectangle`||e===`ellipse`||e===`asset`}function PY(e,t){return e===t||e!==null&&t!==null&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FY({viewport:e,toBoard:t}){let n=F(kW,e=>e.shape),r=l_(e=>e.mode===`edit`&&(e.tool===`frame`||e.tool===`section`||e.tool===`image`||e.tool===`shape`&&n!==`divider`)),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let n=e.current;if(!r||!n)return;let i=null,o=null,s=e=>{FW(null),o=null,i=e.button===0&&!c_.getState().spacePan?{from:t(e),x:e.clientX,y:e.clientY}:null},c=e=>{if(!i)return;let n=Math.hypot(e.clientX-i.x,e.clientY-i.y);!o&&n<=3||(o=IY(i.from,t(e)),a(o))},l=()=>{i&&o&&FW({from:i.from,at:{x:Math.round(o.x),y:Math.round(o.y)},size:{width:Math.max(1,Math.round(o.width)),height:Math.max(1,Math.round(o.height))}}),i=null,o=null,a(null)};return n.addEventListener(`pointerdown`,s),addEventListener(`pointermove`,c),addEventListener(`pointerup`,l),()=>{n.removeEventListener(`pointerdown`,s),removeEventListener(`pointermove`,c),removeEventListener(`pointerup`,l),FW(null),a(null)}},[r,e,t]),!r||!i?null:(0,X.jsx)(`div`,{"data-shape-draft":!0,"aria-hidden":!0,className:`pointer-events-none absolute bg-primary/10`,style:{left:i.x,top:i.y,width:i.width,height:i.height,border:`${Hz(1)} solid var(--primary)`,zIndex:iB}})}function IY(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var LY=[`nw`,`ne`,`sw`,`se`],RY={nw:`top-0 left-0`,ne:`top-0 right-0`,sw:`bottom-0 left-0`,se:`right-0 bottom-0`};function zY({page:e,sections:t}){let n=vP(t=>t.page===e?t.section:void 0);return t.map(e=>(0,X.jsx)(BY,{section:e,selected:e.name===n},e.name))}function BY({section:e,selected:t}){let{x:n,y:r,width:i,height:a}=e.box;return(0,X.jsxs)(`div`,{"data-section":e.name,"data-selected":t||void 0,className:Q(`pointer-events-none absolute rounded-[calc(10px/var(--zoom,1))] bg-foreground/5`,t&&`outline-solid outline-primary [outline-width:calc(1.5px/var(--zoom,1))]`),style:{left:n,top:r,width:i,height:a},children:[(0,X.jsx)(`div`,{"data-section-label":e.name,className:Q(`absolute top-0 left-0 origin-top-left truncate px-3 pt-2 text-body font-medium [transform:scale(calc(1/var(--zoom,1)))]`,t?`text-foreground`:`text-muted-foreground`),style:{maxWidth:`calc(${i}px * var(--zoom, 1))`},title:e.name,children:e.name}),t?LY.map(e=>(0,X.jsx)(`div`,{"data-section-corner":e,className:Q(`absolute size-[7px] border-[1.5px] border-primary bg-background [transform:translate(var(--hx),var(--hy))_scale(calc(1/var(--zoom,1)))]`,RY[e],e.startsWith(`n`)?`[--hy:-50%]`:`[--hy:50%]`,e.endsWith(`w`)?`[--hx:-50%]`:`[--hx:50%]`)},e)):null]})}var VY=1.2;function HY(e,t){return e===0?!1:t===WheelEvent.DOM_DELTA_LINE||Math.abs(e)>=50}function UY(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*16:e}function WY(e,t){return e===0?1:HY(e,t)?e<0?VY:1/VY:2**(-e*.01)}function GY(e){return 1-(1-e)**3}var KY=[.02,4],qY=64,JY=150,YY=400,XY=new Map,ZY=new Set;function QY({page:e,reloads:t,findings:n,claims:r,focus:i,onFocused:a,calls:o=uk}){let s=(0,_.useRef)(null),c=(0,_.useRef)(null),l=(0,_.useRef)(null),u=(0,_.useRef)(null),[d,f]=(0,_.useState)(null),p=(0,_.useRef)(null),m=(0,_.useRef)(null),h=$g(e=>e.aliases),g=Mg(h,e.ref),v=(0,_.useRef)(0),y=(0,_.useRef)(null),b=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{b.current?.(),b.current=null},[e.ref]);let x=l_(e=>e.mode===`play`),S=l_(e=>e.tool===`hand`),C=l_(e=>e.tool===`note`),w=l_(e=>e.tool===`frame`),T=l_(e=>e.tool===`section`),E=l_(e=>BW(e.tool)),D=l_(e=>e.spacePan);(0,_.useEffect)(()=>o_(window),[]),eP(),UW();let O=J_(e=>e.unseen),[k,A]=(0,_.useState)(null),j=(0,_.useMemo)(()=>e.frames.filter(e=>!e.hidden),[e.frames]),M=(0,_.useRef)(j),N=(0,_.useRef)(e.sections),P=(0,_.useRef)(e.frames);(0,_.useLayoutEffect)(()=>{M.current=j,N.current=e.sections,P.current=e.frames},[j,e.sections,e.frames]);let F=(0,_.useMemo)(()=>bK(j),[j]),I=(0,_.useRef)(F);(0,_.useLayoutEffect)(()=>{I.current=F;let e=s.current,t=c.current;e&&t&&xK(t,F,xz(e).k)},[F]),DV(e.ref),XU(e.ref,j),EK(e.ref,e.frames,e=>c.current?.querySelector(`[data-frame="${CSS.escape(e)}"] iframe`)?.dataset.renderedAt??null),(0,_.useLayoutEffect)(()=>{let e=s.current,t=c.current;if(!e||!t)return;let n=EI(e),r,i=!1,a=t=>A({view:t,size:rX(e)}),o=Az().scaleExtent(KY).filter(e=>{if(e.type===`wheel`||e.type.startsWith(`touch`))return!0;let{button:t,ctrlKey:n}=e;if(n)return!1;let{mode:r,tool:i,spacePan:a}=c_.getState();return t===1||t===0&&(i===`hand`||r===`play`||a)}).on(`zoom`,({transform:{x:e,y:n,k:a}})=>{clearTimeout(r);for(let r of[t,u.current])r&&(r.style.transform=`translate(${e}px, ${n}px) scale(${a})`,r.style.setProperty(`--zoom`,String(a)));xK(t,I.current,a),XY.set(g,{x:e,y:n,k:a}),w_(a),i||(ZY.delete(g),C_())}).on(`end`,({transform:{x:e,y:t,k:n}})=>{clearTimeout(r),r=setTimeout(()=>a({x:e,y:t,k:n}),JY)});n.call(o).on(`dblclick.zoom`,null).on(`wheel.zoom`,t=>{if(t.preventDefault(),t.ctrlKey||t.metaKey){o.scaleBy(n,WY(t.deltaY,t.deltaMode),OI(t,e));return}let r=t.shiftKey&&t.deltaX===0,i=r?t.deltaY:t.deltaX,a=r?0:t.deltaY,{deltaMode:s}=t,c=-UY(i,s),l=-UY(a,s),u=HY(i,s),f=HY(a,s);d(u?0:c,f?0:l),(u||f)&&v(u?c:0,f?l:0)},{passive:!1});let l=0,d=(t,r)=>{if(t===0&&r===0)return;let i=xz(e).k;o.translateBy(n,t/i,r/i)},f=0,h={x:0,y:0},_=()=>{cancelAnimationFrame(f),h={x:0,y:0}},v=(e,t)=>{if(cancelAnimationFrame(l),matchMedia(`(prefers-reduced-motion: reduce)`).matches){d(e,t);return}cancelAnimationFrame(f);let n={x:h.x+e,y:h.y+t};h=n;let r=performance.now(),i=0,a=e=>{let t=GY(Math.min(1,Math.max(0,e-r)/120));d(n.x*(t-i),n.y*(t-i)),i=t,h={x:n.x*(1-t),y:n.y*(1-t)},t<1&&(f=requestAnimationFrame(a))};f=requestAnimationFrame(a)},y=({x:e,y:t,k:r})=>{i=!0;try{o.transform(n,bz.translate(e,t).scale(r))}finally{i=!1}},b=XY.get(g),x=!b||ZY.has(g),S=M.current.length===0;S&&x?ZY.add(g):ZY.delete(g);let C=b&&(S||!x)?b:iX(M.current,rX(e));y(C),clearTimeout(r),a(C);let w=new ResizeObserver(()=>a(XY.get(g)??C));w.observe(e),p.current=t=>{if(cancelAnimationFrame(l),_(),matchMedia(`(prefers-reduced-motion: reduce)`).matches){y(t);return}let n=xz(e),r=performance.now(),i=e=>{let a=Math.min(1,(e-r)/YY);if(a===1){y(t);return}let o=a<.5?4*a**3:1-(-2*a+2)**3/2;y({x:n.x+(t.x-n.x)*o,y:n.y+(t.y-n.y)*o,k:n.k*(t.k/n.k)**o}),l=requestAnimationFrame(i)};l=requestAnimationFrame(i)};let T=()=>{_(),C_()};e.addEventListener(`pointerdown`,T,{capture:!0});let E=null,D=e=>{e!==E&&(E=e,SK(t,e))},O=t=>{let n=xz(e),[r,i]=n.invert(OI(t,e));D(YW(mN(M.current),{x:r,y:i},n.k)?.ref??null)},k=()=>D(null);return e.addEventListener(`pointermove`,O),e.addEventListener(`pointerleave`,k),m.current={zoomBy:e=>o.scaleBy(n,e),zoomTo:e=>o.scaleTo(n,e),fit:()=>{C_(),p.current?.(iX(M.current,rX(e)))},fitTo:t=>{C_(),p.current?.(iX(t.map(e=>({box:e})),rX(e)))},panBy:(t,r)=>{let i=xz(e).k;o.translateBy(n,-t/i,-r/i)},centerOn:(t,n)=>p.current?.(nX(t,n??xz(e).k,rX(e))),visible:()=>{let t=xz(e),{width:n,height:r}=rX(e),[i,a]=t.invert([0,0]);return{x:i,y:a,width:n/t.k,height:r/t.k}}},()=>{e.removeEventListener(`pointerdown`,T,{capture:!0}),e.removeEventListener(`pointermove`,O),e.removeEventListener(`pointerleave`,k),m.current=null,clearTimeout(r),cancelAnimationFrame(l),cancelAnimationFrame(f),p.current=null,w.disconnect(),n.on(`.zoom`,null)}},[g]),(0,_.useLayoutEffect)(()=>{let t=m.current;return t?S_(t,e.ref):void 0},[g,e.ref]),(0,_.useEffect)(()=>{let t=lP(_P,e.ref,Qg,c_),n=xN(Qg),r=NV(_P,Qg,Mz,e=>Tx(`/api/selection`,e));return()=>{r(),n(),t()}},[e.ref]),(0,_.useEffect)(()=>{let t=s.current,n=c.current,r=l.current;if(t&&n&&r)return aG(r,{viewport:t,layer:n,page:e.ref,frames:()=>M.current,sections:()=>N.current,pageFrames:()=>P.current})},[e.ref,x]),(0,_.useEffect)(()=>{let e=s.current;if(j.length===0||!e||!p.current||!ZY.delete(g))return;let t=xz(e),n=rX(e),[r,i]=t.invert([0,0]),[a,o]=t.invert([n.width,n.height]);j.every(({box:e})=>e.x>=r&&e.y>=i&&e.x+e.width<=a&&e.y+e.height<=o)||p.current(iX(j,n))},[j,g]),(0,_.useEffect)(()=>{let e=j.find(e=>e.ref===i),t=s.current;e&&t&&p.current&&(p.current(iX([e],rX(t))),a?.())},[i,j,a]);let L=(0,_.useCallback)(e=>{let t=s.current;if(!t)return{x:0,y:0};let[n,r]=xz(t).invert(OI(e,t));return{x:n,y:r}},[]),R=(0,_.useCallback)(()=>mN(M.current),[]);AY(l,{enabled:!x,container:d,page:e.ref,frames:R,toBoard:L});let z=(t,n)=>{if(!d)return!1;let r=n=>BB(e.ref,t,n);if(b.current?.(),b.current=null,n)return b.current=GV(d,t,r,_P),!0;let i=d.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;return iP(_P,e.ref,t),b.current=i?HV(i,t,r):null,b.current!==null},B=e=>{let t=s.current,n=y.current;if(t&&d&&n&&!(C||S||w||T||E)){let[r,i]=xz(t).invert(OI(e,t)),a=mN(j);if(WV(d,a,n,{x:r,y:i})&&z(n,!1))return}V(e)},V=t=>{let n=s.current;if(C||S||w||T||E||!n||!d)return;let[r,i]=xz(n).invert(OI(t,n)),a=++v.current;MV(d,mN(j),{x:r,y:i},kB).then(t=>{t&&a===v.current&&iP(_P,e.ref,t)})},ee=t=>{let n=s.current;if(C||S||w||T||E||!n||!d||KW(d,`[data-label-control]`,t))return!1;let r=xz(n),[i,a]=r.invert(OI(t,n)),o=YW(mN(j),{x:i,y:a},r.k),c=_P.getState();return o!==null&&a<o.box.y&&c.page===e.ref&&c.frames.length===1&&c.frames[0]===o.ref},te=(0,_.useMemo)(()=>k?xB(j,k.view,k.size):null,[j,k]);return Iz((0,_.useMemo)(()=>k?{frames:j,...k}:null,[j,k])),(0,X.jsxs)(`div`,{ref:s,"data-canvas":!0,className:Q(`relative size-full touch-none overflow-hidden bg-background`,(C||w||T||E)&&!x&&`cursor-crosshair`,(D||S&&!x)&&`cursor-grab active:cursor-grabbing`),children:[(0,X.jsx)(`div`,{ref:e=>{c.current=e,f(e)},"data-layer":!0,className:`absolute top-0 left-0 origin-top-left`,children:e.layoutError?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(zY,{page:e.ref,sections:e.sections}),j.map(e=>(0,X.jsx)(IU,{frame:e,live:te?.has(e.ref)??!1,version:t[e.ref]??0,findings:n?.[e.ref],claim:r?.[e.ref],unseen:e.ref in O},Mg(h,e.ref))),(0,X.jsx)(oB,{frames:j}),(0,X.jsx)(kV,{frames:j,container:d}),(0,X.jsx)(jY,{viewport:s,container:d,frames:R,toBoard:L}),(0,X.jsx)(FY,{viewport:s,toBoard:L}),(0,X.jsx)(uB,{frames:j,container:d}),(0,X.jsx)(_B,{page:e.ref,frames:j})]})}),x?null:(0,X.jsx)(TJ,{page:e.ref,frames:()=>mN(M.current),viewport:s,layer:c,trigger:(0,X.jsx)(`div`,{ref:l,"data-hit-layer":!0,className:`absolute inset-0`,onClickCapture:t=>{let n=s.current;if(!(C||w||T||E)||!n||!d)return;t.stopPropagation();let r=xz(n),[i,a]=r.invert(OI(t.nativeEvent,n)),c=zW(),l=AW.getState().file;if(c===`asset`&&l){let t=IW();mV(d,e.ref,mN(j),t?.from??{x:i,y:a},l,{size:t?.size});return}if(c){let t=IW();pV(d,e.ref,mN(j),t?.from??{x:i,y:a},c,{size:t?.size}).then(e=>{e&&c===`text`&&z(e,!0)});return}if(T){let t=IW(),n=t&&t.size.width*r.k>=40&&t.size.height*r.k>=40?{...t.at,...t.size}:null;AG(e.ref,n??{x:i,y:a},{calls:o});return}if(w){let t=IW(),o=t&&t.size.width*r.k>=40&&t.size.height*r.k>=40?{...t.at,...t.size}:null,s=rX(n),[c,l]=r.invert([0,0]);IG(o??{x:i,y:a},{page:e.ref,frames:e.frames,visible:{x:c,y:l,width:s.width/r.k,height:s.height/r.k}});return}let u=tV(d,mN(j),{x:i,y:a});u?YN.setState({open:{kind:`new`,pick:u}}):QN()},onClick:e=>{e.metaKey&&V(e.nativeEvent)},onMouseDownCapture:e=>{e.detail<=1&&(y.current=_P.getState().element??null)},onDoubleClick:e=>{if(ee(e.nativeEvent)){let e=Se(`frame.rename`),[t]=_P.getState().frames;e&&be(e)&&t&&AU(t,`canvas`)}else B(e.nativeEvent)}})}),(0,X.jsxs)(`div`,{ref:u,"data-notes-layer":!0,className:`pointer-events-none absolute top-0 left-0 origin-top-left`,children:[(0,X.jsx)(pY,{page:e.ref,frames:j,container:d}),(0,X.jsx)(LU,{frames:j})]}),(0,X.jsx)(vB,{frames:j}),e.layoutError?(0,X.jsx)($Y,{error:e.layoutError}):j.length===0?(0,X.jsx)(eX,{page:e,calls:o}):null]})}function $Y({error:e}){return(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center p-6`,children:(0,X.jsxs)(`div`,{role:`alert`,className:`max-w-md rounded-lg border border-border bg-card p-4 text-body text-card-foreground`,children:[(0,X.jsx)(`p`,{className:`text-panel`,children:`This page's layout does not read`}),(0,X.jsx)(`p`,{className:`mt-1 break-all text-muted-foreground`,children:e.path}),(0,X.jsx)(`p`,{className:`mt-2`,children:e.message})]})})}function eX({page:e,calls:t}){return eK(e)?(0,X.jsx)(lK,{page:e,calls:t}):(0,X.jsx)(tX,{hidden:e.frames,calls:t})}function tX({hidden:e,calls:t}){let n=fe(),r=$g(e=>e.canWrite);if(e.length>0){let n=e.length===1?`1 hidden frame stays`:`${e.length} hidden frames stay`,i=`Show ${e.length} frame${e.length===1?``:`s`}`;return(0,X.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center text-body leading-[1.6] text-[color-mix(in_srgb,var(--muted-foreground)_85%,var(--foreground))]`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,X.jsx)(`p`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Every frame on this page is hidden`}),(0,X.jsxs)(`p`,{children:[n,` listed under Layers.`]}),r?(0,X.jsx)(`button`,{type:`button`,onClick:()=>void t.flagFrames(e.map(e=>e.ref),`hidden`,!1).catch(_k(`Couldn't show the hidden frames`)),className:`pointer-events-auto mt-3.5 h-[30px] rounded-lg bg-muted px-3 font-medium text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:i}):null]})}return(0,X.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center text-body leading-[1.6] text-[color-mix(in_srgb,var(--muted-foreground)_85%,var(--foreground))]`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,X.jsx)(`p`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`This page has no frames`}),(0,X.jsxs)(`p`,{children:[`Pick the Frame tool`,` `,n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`kbd`,{className:`rounded-[5px] bg-muted px-1.5 py-0.5 font-mono text-label font-normal text-foreground`,children:`F`}),` `]}):null,`and click on the canvas,`,(0,X.jsx)(`br`,{}),`or ask your agent to draw one.`]})]})}function nX(e,t,n){return e.width*t>n.width-128||e.height*t>n.height-128?iX([{box:e}],n):{x:n.width/2-(e.x+e.width/2)*t,y:n.height/2-(e.y+e.height/2)*t,k:t}}function rX(e){return{width:e.clientWidth,height:e.clientHeight}}function iX(e,t){if(e.length===0||t.width===0||t.height===0)return{x:qY,y:qY,k:1};let n=Math.min(...e.map(({box:e})=>e.x)),r=Math.min(...e.map(({box:e})=>e.y)),i=Math.max(...e.map(({box:e})=>e.x+e.width)),a=Math.max(...e.map(({box:e})=>e.y+e.height)),o=Math.min((t.width-128)/(i-n),(t.height-128)/(a-r),1),s=Math.max(KY[0],o);return{x:(t.width-(i-n)*s)/2-n*s,y:(t.height-(a-r)*s)/2-r*s,k:s}}function aX({...e}){return(0,X.jsx)(Hq,{"data-slot":`dropdown-menu`,...e})}function oX({...e}){return(0,X.jsx)(Qq,{"data-slot":`dropdown-menu-trigger`,...e})}function sX({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,X.jsx)(pq,{children:(0,X.jsx)(xq,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,X.jsx)(uq,{"data-slot":`dropdown-menu-content`,className:Q(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function cX({...e}){return(0,X.jsx)(QK,{"data-slot":`dropdown-menu-group`,...e})}function lX({className:e,inset:t,...n}){return(0,X.jsx)($K,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:Q(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function uX({className:e,inset:t,variant:n=`default`,...r}){return(0,X.jsx)(tq,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:Q(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function dX({...e}){return(0,X.jsx)(Wq,{"data-slot":`dropdown-menu-sub`,...e})}function fX({className:e,inset:t,children:n,...r}){return(0,X.jsxs)(aJ,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:Q(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,X.jsx)(Ft,{className:`ml-auto`})]})}function pX({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,X.jsx)(sX,{"data-slot":`dropdown-menu-sub-content`,className:Q(`w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function mX({...e}){return(0,X.jsx)(Tq,{"data-slot":`dropdown-menu-radio-group`,...e})}function hX({className:e,children:t,inset:n,...r}){return(0,X.jsxs)(kq,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:Q(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,X.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,X.jsx)(Aq,{children:(0,X.jsx)(kt,{})})}),t]})}function gX({className:e,...t}){return(0,X.jsx)(tJ,{"data-slot":`dropdown-menu-separator`,className:Q(`-mx-1 my-1 h-px bg-border`,e),...t})}var _X=_.createContext(void 0);function vX(e){let t=_.useContext(_X);if(t===void 0&&!e)throw Error(Za(72));return t}var yX={...gp,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bX=class extends wo{constructor(e,t,n){let r=new sp;super(xX(e,r,t,n),SX(r),yX)}setOpen=(e,t)=>{tp(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,fd(hd,e))}};function xX(e,t,n,r=!1){return{...up(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function SX(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var CX=co(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Yf((e,t)=>new bX({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),v=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),rp(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=ip(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=_.useRef(null);q(()=>{m&&t&&p.setOpen(!1,fd(Id))},[m,t,p]),q(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),_.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,fd(zd))}),[b,p]);let E=h||v||!t&&a!==`none`;return(0,X.jsxs)(_X.Provider,{value:p,children:[l&&(0,X.jsx)(Xf,{handle:l,store:p}),E&&(0,X.jsx)(wX,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function wX({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Uf(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Bf(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=_.useMemo(()=>Wl(a.reference,i.reference),[a.reference,i.reference]);return ap(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Ka}),null}var TX=_.createContext(void 0);function EX(){return _.useContext(TX)}var DX=`data-base-ui-tooltip-trigger`;function OX(e){let t=ks(e);return Ao(t)?t:null}var kX=lo(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=vX(!0),m=_p(a)??p;if(!m)throw Error(Za(82));let h=rH(d),g=m.useState(`isTriggerActive`,h),v=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=_.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=np(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=EX(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=af(y,{open:v}),k=wp(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Jd(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=_.useRef(!1),I=os(),L=_.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=Os(e,`[${DX}]`);return n!==null&&n!==t&&Y(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=Dp(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Up():null,restMs:R,delay(){return u==null&&O?{close:Zd(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),ee=yp(y,{enabled:!j}).reference,te=e=>{let t=F.current,n=OX(e),r=B(n),i=b.current,a=i&&n&&Y(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,fd(gd,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&gc(L.current)){let t=()=>{F.current||M.current||m.select(`open`)||m.setOpen(!0,fd(gd,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ne=m.useState(`appliedTriggerProps`,C||N!==`none`);return Z(`button`,e,{state:{open:v},ref:[t,S,b],props:[V,ee,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(OX(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[tc]:j?``:void 0,[DX]:j?void 0:``},f],stateAttributesMapping:Zs})}),AX=_.createContext(void 0);function jX(){let e=_.useContext(AX);if(e===void 0)throw Error(Za(70));return e}var MX=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return vX().useState(`mounted`)||n?(0,X.jsx)(AX.Provider,{value:n,children:(0,X.jsx)(Kd,{ref:t,...r})}):null}),NX=_.createContext(void 0);function PX(){let e=_.useContext(NX);if(e===void 0)throw Error(Za(71));return e}var FX=_.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Ou,style:g,...v}=e,y=vX(),b=jX(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=lh({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=ph(e,_.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,X.jsx)(NX.Provider,{value:O,children:k})}),IX=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=vX(),{side:s,align:c}=PX(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);bu({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Tp(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Z(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[qf,f,fh(d),a],stateAttributesMapping:ec})}),LX=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=vX(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=PX();return Z(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:$s})}),RX=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=_.useMemo(()=>({open:t,close:n}),[t,n]);return(0,X.jsx)(TX.Provider,{value:t,children:(0,X.jsx)(rf,{delay:i,timeoutMs:r,children:e.children})})};function zX({delay:e=0,...t}){return(0,X.jsx)(RX,{"data-slot":`tooltip-provider`,delay:e,...t})}function BX({...e}){return(0,X.jsx)(CX,{"data-slot":`tooltip`,...e})}function VX({...e}){return(0,X.jsx)(kX,{"data-slot":`tooltip-trigger`,...e})}function HX({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,X.jsx)(MX,{children:(0,X.jsx)(FX,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,X.jsxs)(IX,{"data-slot":`tooltip-content`,className:Q(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background motion-reduce:animate-none! has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,X.jsx)(LX,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}function UX({label:e,keys:t,children:n,side:r=`top`}){let i=pe(t,fe());return(0,X.jsxs)(BX,{children:[(0,X.jsx)(VX,{render:n}),(0,X.jsx)(HX,{side:r,sideOffset:6,className:`rounded-md px-2 py-[5px] text-[11px]`,children:i?`${e} ${U(i)}`:e})]})}function WX({className:e,...t}){return(0,X.jsx)(sX,{className:Q(`w-60 rounded-[10px] p-1 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,e),...t})}function GX({action:e,label:t,keys:n,children:r}){let i=pe(e?.keys??n,fe());return(0,X.jsxs)(uX,{disabled:!e||!be(e),onClick:()=>e?.run(),className:KX,children:[r??e?.label??t,i?(0,X.jsx)(qX,{children:U(i)}):null]})}var KX=`h-7 rounded-md px-2 py-0 text-xs`;function qX({children:e}){return(0,X.jsx)(`kbd`,{className:`ml-auto grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-label font-normal text-muted-foreground`,children:e})}var JX=[`view.hideUi`],YX=[`project.rename`,`project.duplicate`,`nav.home`],XX=[];function ZX({project:e,page:t,calls:n}){let[r]=xe(JX);return(0,X.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-1.5 border-b border-sidebar-border px-2`,children:[(0,X.jsx)(UX,{label:`Home`,side:`bottom`,children:(0,X.jsx)(Ba,{href:`/`,"aria-label":`Home`,className:$X,children:(0,X.jsx)(Mn,{"aria-hidden":!0,className:`size-[15px]`})})}),(0,X.jsx)(QX,{project:e,page:t,calls:n}),(0,X.jsx)(UX,{label:`Hide UI`,keys:r?.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Hide UI`,onClick:()=>r?.run(),className:$X,children:(0,X.jsx)(wr,{"aria-hidden":!0,className:`size-[15px]`})})})]})}function QX({project:e,page:t,calls:n}){let[r,i,a]=xe(YX),o=Ik(e.name),s=$g(e=>e.board?.projects??XX),[,c]=Na(),l=s.filter(t=>t.name!==e.name),u=r!==void 0&&be(r);return o?(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1 text-panel`,children:(0,X.jsx)(KV,{name:o.draft,label:`Rename project ${e.name}`,onCommit:r=>{Vk(e.name,r,n).then(e=>{e&&c(p_(e,t),{replace:!0})})},onCancel:zk},o.attempt)}):(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,X.jsx)(`button`,{type:`button`,disabled:!u,title:u?`Rename ${e.name}`:e.name,onClick:()=>r?.run(),className:`min-w-0 truncate rounded-[5px] px-1 -ml-1 text-left text-panel outline-none hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:bg-transparent`,children:e.name}),(0,X.jsxs)(aX,{children:[(0,X.jsx)(oX,{"aria-label":`Project menu`,className:`grid size-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring/50 aria-expanded:bg-sidebar-accent`,children:(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-3`})}),(0,X.jsxs)(WX,{align:`start`,sideOffset:6,className:`w-56`,children:[(0,X.jsx)(GX,{action:r,label:`Rename`}),(0,X.jsx)(GX,{action:i,label:`Duplicate`}),(0,X.jsxs)(dX,{children:[(0,X.jsx)(fX,{disabled:l.length===0,className:KX,children:`Switch project`}),(0,X.jsx)(pX,{className:`w-56 rounded-[10px] p-1 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,children:l.map(e=>(0,X.jsx)(uX,{onClick:()=>c(Bk(e)),className:KX,children:(0,X.jsx)(`span`,{className:`truncate`,children:e.name})},e.name))})]}),(0,X.jsx)(gX,{}),(0,X.jsx)(GX,{action:a,label:`All projects`})]})]})]})}var $X=`grid size-[26px] shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,eZ={name:`frameboard`,version:`0.24.0`,description:`A local design board that coding agents draw on as plain HTML files`,keywords:[`design`,`board`,`canvas`,`html`,`coding-agent`,`claude-code`,`cli`],homepage:`https://github.com/erclx/frameboard#readme`,bugs:{url:`https://github.com/erclx/frameboard/issues`},repository:{type:`git`,url:`git+https://github.com/erclx/frameboard.git`},license:`MIT`,type:`module`,bin:{frameboard:`dist/cli.js`},files:[`dist`],engines:{node:`>=22`},scripts:{typecheck:`tsc --noEmit`,build:`vite build && rolldown -c rolldown.config.ts && bun scripts/copy-faces.ts`,dev:`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/dev.ts`,preview:`bun scripts/preview.ts`,test:`vitest`,"test:run":`bun scripts/test-locked.ts vitest run --reporter=verbose --maxWorkers=50%`,"test:ui":`vitest --ui`,"test:coverage":`vitest run --coverage --project node`,"test:e2e":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/test-locked.ts playwright test`,"test:e2e:changed":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/test-locked.ts playwright test --only-changed`,"test:e2e:ui":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && playwright test --ui`,"test:e2e:report":`playwright show-report`,"check:full":`bun scripts/verify.ts && bun run test:e2e`,"measure:canvas":`bun run build && playwright test -c e2e/perf/playwright.config.ts`,"smoke:prod":`bun e2e/screenshot.ts --check-console-clean --require-base-url`,prepare:`husky`,"design:sync":`bun scripts/design-sync.ts`,check:`bun scripts/verify.ts`,"check:format":`oxfmt --check .`,format:`oxfmt .`,lint:`oxlint --max-warnings 0 --disable-nested-config`,"lint:fix":`oxlint --fix --max-warnings 0 --disable-nested-config`,screenshot:`PREVIEW_PORT=$(bash scripts/worktree-port.sh 4173) && export PREVIEW_PORT && bash scripts/screenshot.sh`,"screenshot:compare":`bun run build && bun scripts/screenshot-compare.ts`,"readme-screenshot":`PREVIEW_PORT=$(bash scripts/worktree-port.sh 4173) && export PREVIEW_PORT && bash scripts/readme-screenshot.sh`},devDependencies:{"@atlaskit/pragmatic-drag-and-drop":`4.0.0`,"@atlaskit/pragmatic-drag-and-drop-hitbox":`3.0.0`,"@base-ui/react":`^1.9.0`,"@bramus/specificity":`^2.4.3`,"@commitlint/cli":`^21.2.3`,"@commitlint/config-conventional":`^21.2.3`,"@fontsource-variable/caveat":`^5.3.0`,"@fontsource-variable/geist":`^5.3.0`,"@fontsource-variable/geist-mono":`^5.3.0`,"@fontsource-variable/inter":`^5.3.0`,"@fontsource-variable/source-serif-4":`^5.3.1`,"@hono/node-server":`^2.1.5`,"@playwright/test":`^1.64.1`,"@tailwindcss/vite":`^4.3.3`,"@testing-library/jest-dom":`^7.0.1`,"@testing-library/react":`^16.3.3`,"@testing-library/user-event":`^14.6.8`,"@types/d3-drag":`^3.0.7`,"@types/d3-selection":`^3.0.12`,"@types/d3-zoom":`^3.0.9`,"@types/jsdom":`^30.0.0`,"@types/node":`^26.6.5`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@types/ws":`^8.18.2`,"@vitejs/plugin-react":`^6.1.2`,"@vitest/browser-playwright":`^5.0.4`,"@vitest/coverage-v8":`^5`,"@vitest/ui":`^5`,chokidar:`^6.0.0`,"class-variance-authority":`^0.7.1`,cmdk:`^1.1.1`,cn:`^0.5.0`,commander:`^15.0.0`,"css-select":`^7.0.0`,"d3-drag":`3.0.0`,"d3-selection":`^3.0.0`,"d3-zoom":`^3.0.0`,"eslint-plugin-check-file":`^3.3.2`,"eslint-plugin-simple-import-sort":`^14.0.0`,"fast-check":`^4.10.2`,hono:`^4.13.13`,husky:`^9.1.7`,jsdom:`^30.1.2`,"lucide-react":`^1.57.0`,oxfmt:`0.74.0`,oxlint:`1.89.0`,parse5:`^8.0.1`,"parse5-htmlparser2-tree-adapter":`^8.0.1`,playwright:`^1.64.1`,postcss:`^8.5.6`,react:`^19.3.1`,"react-dom":`^19.3.1`,"react-resizable-panels":`^4.14.5`,rolldown:`^1.2.14`,shadcn:`^4.21.5`,tailwindcss:`^4.3.3`,tinykeys:`^4.0.1`,"tw-animate-css":`^1.4.0`,typescript:`^7`,vite:`^8.3.4`,vitest:`^5`,wouter:`^3.13.0`,ws:`^8.22.0`,zod:`^4.6.7`,zustand:`^5.0.15`},dependencies:{"playwright-core":`1.64.1`}},tZ={config:`Saved on this machine`,git:`From git user.name`};function nZ({name:e,source:t=null,align:n=`start`}){let[r]=xe([`help.shortcuts`]),i=we(`theme`),a=i.find(e=>e.checked?.()),o=t?tZ[t]:null;return(0,X.jsxs)(aX,{children:[(0,X.jsx)(oX,{"aria-label":e&&o?`${e}, ${o.toLowerCase()}`:`Account`,className:`rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,X.jsx)(aZ,{name:e??null})}),(0,X.jsxs)(WX,{align:n,alignOffset:n===`start`?-25:-10,sideOffset:7,children:[e===void 0?null:(0,X.jsx)(rZ,{name:e,caption:o}),(0,X.jsx)(GX,{action:r,label:`Keyboard shortcuts`}),(0,X.jsxs)(dX,{children:[(0,X.jsxs)(fX,{disabled:i.length===0,className:`${KX} data-disabled:opacity-50`,children:[`Theme`,a?(0,X.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:a.label}):null]}),(0,X.jsx)(pX,{className:`rounded-[10px] ring-border`,children:(0,X.jsx)(mX,{value:a?.id??``,children:i.map(e=>(0,X.jsx)(hX,{value:e.id,onClick:()=>e.run(),className:`h-7 py-0 text-xs`,children:e.label},e.id))})})]}),(0,X.jsx)(uX,{className:KX,render:(0,X.jsx)(`a`,{href:eZ.homepage}),children:`Docs`})]})]})}function rZ({name:e,caption:t}){let n=$g(e=>e.canWrite),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=(0,_.useRef)(!1);if((0,_.useEffect)(()=>{!r&&o.current&&(o.current=!1,a.current?.focus())},[r]),!e&&!n)return null;let s=()=>{o.current=!0,i(!1)};return r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5 p-2`,onKeyDown:e=>{e.key!==`Tab`&&e.stopPropagation()},children:[(0,X.jsx)(aZ,{name:e}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 pl-1.5`,children:[(0,X.jsx)(KV,{hug:!0,clearable:!0,name:e??``,label:`Your name`,onCommit:e=>{s(),aY(e).catch(e=>_g.add({title:`Couldn't save your name`,description:e instanceof Error?e.message:String(e),type:`error`}))},onCancel:s}),(0,X.jsx)(`p`,{className:`mt-0.5 text-label font-normal text-muted-foreground`,children:e?t??``:`Signs your notes`})]})]}),(0,X.jsx)(gX,{})]}):(0,X.jsxs)(X.Fragment,{children:[n?(0,X.jsx)(uX,{ref:a,closeOnClick:!1,onClick:()=>i(!0),"aria-label":e?`Edit your name, ${e}`:`Set your name`,className:`gap-2.5 p-2`,children:(0,X.jsx)(iZ,{name:e,caption:t})}):(0,X.jsx)(`div`,{className:`flex items-center gap-2.5 p-2`,children:(0,X.jsx)(iZ,{name:e,caption:t})}),(0,X.jsx)(gX,{})]})}function iZ({name:e,caption:t}){return e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(aZ,{name:e}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`truncate font-semibold`,title:e,children:e}),t?(0,X.jsx)(`p`,{className:`text-label font-normal text-muted-foreground`,children:t}):null]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`grid size-[22px] shrink-0 place-items-center rounded-full bg-muted text-[10px] font-bold text-muted-foreground`,children:`?`}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`font-semibold text-primary`,children:`Set your name`}),(0,X.jsx)(`p`,{className:`text-label font-normal text-muted-foreground`,children:`Signs your notes`})]})]})}function aZ({name:e}){return(0,X.jsx)(`span`,{"aria-hidden":!0,"data-avatar":!0,className:`grid size-[22px] shrink-0 place-items-center rounded-full bg-foreground text-[10px] font-bold text-card`,children:e?$J(e):(0,X.jsx)(Ji,{className:`size-3`})})}var oZ=[{id:`view.zoomIn`,label:`Zoom in`},{id:`view.zoomOut`,label:`Zoom out`},{id:`view.zoomToFit`,label:`Zoom to fit`}],sZ=[{id:`view.zoom50`,label:`50%`},{id:`view.zoom100`,label:`100%`},{id:`view.zoom200`,label:`200%`}],cZ=[...oZ,...sZ].map(e=>e.id);function lZ({align:e=`end`,className:t}){let n=(0,_.useRef)(null),r=xe(cZ);return(0,_.useEffect)(()=>{let e=()=>{n.current&&(n.current.textContent=uZ(b_.zoom()))};return e(),b_.onZoom(e)},[]),(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{"aria-label":`Zoom`,className:Q(`flex h-6 items-center gap-1 rounded-md px-1 text-muted-foreground tabular-nums outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,t),children:[(0,X.jsx)(`span`,{ref:n,"data-zoom-level":!0}),(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,X.jsxs)(WX,{align:e,sideOffset:8,className:`w-48`,children:[oZ.map((e,t)=>(0,X.jsx)(GX,{action:r[t],label:e.label},e.id)),(0,X.jsx)(gX,{}),sZ.map((e,t)=>(0,X.jsx)(GX,{action:r[oZ.length+t],label:e.label,children:e.label},e.id))]})]})}function uZ(e){return`${Math.round(e*100)}%`}function dZ({project:e,page:t,calls:n}){let[r]=xe([`view.hideUi`]),i=rY(),a=iY();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`absolute top-3 left-3 z-10 flex max-w-[calc(100%-10rem)] items-center gap-2 rounded-[10px] border border-border bg-card py-1.5 pr-2 pl-1.5 shadow-[0_2px_8px_rgba(0,0,0,.12)]`,children:[(0,X.jsx)(UX,{label:`Home`,side:`bottom`,children:(0,X.jsx)(Ba,{href:`/`,"aria-label":`Home`,className:fZ,children:(0,X.jsx)(Mn,{"aria-hidden":!0,className:`size-[15px]`})})}),(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-4 w-px shrink-0 bg-border`}),(0,X.jsx)(QX,{project:e,page:t,calls:n}),(0,X.jsx)(UX,{label:`Show UI`,keys:r?.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Show UI`,onClick:()=>r?.run(),className:fZ,children:(0,X.jsx)(wr,{"aria-hidden":!0,className:`size-[15px]`})})})]}),(0,X.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex h-[34px] items-center gap-1.5 rounded-lg border border-border bg-card pr-2.5 pl-1.5`,children:[(0,X.jsx)(nZ,{name:i,source:a,align:`end`}),(0,X.jsx)(lZ,{className:`text-foreground`})]})]})}var fZ=`grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,pZ=`a[href], button, input, select, textarea, summary, [onclick], [tabindex], [contenteditable], video[controls], audio[controls], script`;function mZ(e){return Rz(e).some(e=>e.matches(pZ))}function hZ(e,t=document){let n=e.filter(e=>!e.hidden);if(n.length===0)return`unread`;let r=!1;for(let e of n){let n=t.querySelector(`[data-frame="${CSS.escape(e.ref)}"] > iframe`)?.contentDocument;if(!n||!gZ(n))r=!0;else if(mZ(n))return`clickable`}return r?`unread`:`static`}function gZ(e){return e.readyState===`complete`&&e.URL!==`about:blank`}function _Z(e){return document.addEventListener(`load`,e,!0),()=>document.removeEventListener(`load`,e,!0)}function vZ({frames:e}){let t=(0,_.useSyncExternalStore)(_Z,(0,_.useCallback)(()=>hZ(e),[e]),()=>`unread`);return(0,X.jsxs)(`p`,{role:`status`,className:`pointer-events-none absolute top-3.5 left-1/2 z-10 flex -translate-x-1/2 flex-col items-center rounded-[14px] bg-primary px-3 py-1.5 font-medium whitespace-nowrap text-primary-foreground`,children:[(0,X.jsx)(`span`,{children:`Playing. Clicks go to the frames. Esc to edit`}),t===`static`?(0,X.jsx)(`span`,{className:`font-normal`,children:`Nothing on this page takes a click`}):null]})}var yZ=`font-mono text-label font-normal text-foreground`;function bZ({project:e,anchor:t,load:n=eA,upload:r=eM}){let i=$g(e=>e.canWrite),a=F(jW,e=>e.open)&&i;return(0,X.jsx)(ZH,{open:a,onOpenChange:e=>jW.setState({open:e}),children:(0,X.jsx)($H,{anchor:t,side:`top`,sideOffset:8,"aria-label":`Image or video`,className:`w-[260px] gap-0 p-0 text-xs`,children:a?(0,X.jsx)(xZ,{project:e,load:n,upload:r}):null})})}function xZ({project:e,load:t,upload:n}){let[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&o(e)}),()=>{n=!1}},[e,t,r]);async function f(t){if(t.length!==0){c(!0);try{let r=await n(e,t);u(r.refused.length>0?r.refused.map(e=>`${e.name}: ${e.message}`).join(` `):null)}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1),i(e=>e+1)}}}if(a===void 0)return null;if(a===null)return(0,X.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The assets did not load. Reload the board to try again.`});let p=a.files.filter(Wj);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h3`,{className:`px-3 pt-2.5 pb-1 text-label text-muted-foreground`,children:[`Image or video · `,p.length,` `,p.length===1?`file`:`files`]}),p.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 pt-1 pb-3`,children:[(0,X.jsxs)(`p`,{className:`leading-normal text-muted-foreground`,children:[`No images or videos in `,(0,X.jsx)(`code`,{className:yZ,children:`assets/`}),` yet.`]}),(0,X.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>d.current?.click(),className:`h-7 rounded-md bg-primary px-2.5 font-medium text-primary-foreground outline-none hover:bg-primary/90 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,children:s?`Adding files…`:`Add files`}),(0,X.jsx)(`input`,{ref:d,type:`file`,multiple:!0,hidden:!0,accept:`image/*,video/*,.svg`,"aria-label":`Choose files to add`,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,f(t)}})]}):(0,X.jsx)(`ul`,{className:`grid max-h-[320px] grid-cols-2 gap-2 overflow-y-auto px-2 pt-1 pb-2`,children:p.map(t=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>MW({project:e,path:t.path,kind:t.kind}),"aria-label":`Place ${t.path}`,className:`block w-full overflow-hidden rounded-lg bg-muted text-left outline-none hover:ring-[1.5px] hover:ring-primary focus-visible:ring-[1.5px] focus-visible:ring-primary`,children:[(0,X.jsx)($j,{project:e,file:t}),(0,X.jsxs)(`span`,{className:`block truncate px-[7px] py-[5px] text-label font-normal`,children:[(0,X.jsx)(`span`,{title:t.path,children:t.path}),(0,X.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:zj(t)})]})]})},t.path))}),l?(0,X.jsx)(`p`,{role:`alert`,className:`mx-3 mb-2 text-destructive`,children:l}):null]})}var SZ=`tool.shape`,CZ=`tool.frame`,wZ=`tool.section`,TZ=[{tool:`frame`,id:CZ,label:`Frame`,key:`f`,icon:En},{tool:`section`,id:wZ,label:`Section`,key:`Shift+KeyS`,icon:Er}],EZ=[[{id:`tool.move`,label:`Move`,keys:[`v`],icon:vr},{id:`tool.hand`,label:`Hand`,keys:[`h`],icon:An},{id:CZ,label:`Frame`,keys:[`f`],icon:En},{id:`tool.text`,label:`Text`,keys:[`t`],icon:Hi},{id:SZ,label:`Shape`,icon:OW[0].icon},{id:`tool.note`,label:`Note`,keys:[`n`],icon:ur}],[{id:`edit.undo`,label:`Undo`,icon:Ki},{id:`edit.redo`,label:`Redo`,icon:Hr}],[{id:`view.zoomToFit`,label:`Zoom to fit`,keys:[`Shift+Digit1`],icon:cr},{id:`theme.toggle`,label:`Theme`,icon:bi,darkIcon:gr}]],DZ=[{id:`mode.edit`,label:`Edit`,icon:Ar},{id:`mode.play`,label:`Play`,icon:Ir}],OZ=[...[...EZ.flat(),...DZ].map(e=>e.id).filter(e=>e!==SZ),...OW.map(e=>e.id),DW,wZ];function kZ({project:e}){let t=xe(OZ),n=new Map(OZ.map((e,n)=>[e,t[n]])),r=(0,_.useRef)(null);return(0,X.jsxs)(`div`,{ref:r,role:`toolbar`,"aria-label":`Tools`,className:`absolute bottom-4 left-1/2 z-10 flex max-w-[calc(100%-1.5rem)] -translate-x-1/2 items-center gap-0.5 overflow-x-auto rounded-xl border border-border bg-card p-[5px] shadow-[0_6px_24px_rgba(0,0,0,.18),0_1px_3px_rgba(0,0,0,.12)]`,children:[EZ.map((e,t)=>(0,X.jsxs)(_.Fragment,{children:[t>0?(0,X.jsx)(PZ,{}):null,e.map(e=>e.id===SZ?(0,X.jsx)(jZ,{actions:n},e.id):e.id===CZ?(0,X.jsx)(MZ,{actions:n},e.id):(0,X.jsx)(AZ,{slot:e,action:n.get(e.id)},e.id))]},e[0]?.id)),(0,X.jsx)(PZ,{}),(0,X.jsx)(`div`,{className:`flex shrink-0 rounded-lg bg-muted p-0.5`,children:DZ.map(e=>(0,X.jsx)(NZ,{slot:e,action:n.get(e.id)},e.id))}),e===void 0?null:(0,X.jsx)(bZ,{project:e,anchor:r})]})}function AZ({slot:e,action:t,pressed:n}){let r=FZ(e,t),{label:i,keys:a,enabled:o,run:s}=r,c=n??r.on,l=e.icon,u=e.darkIcon;return(0,X.jsx)(UX,{label:i,keys:a,children:(0,X.jsxs)(`button`,{type:`button`,"aria-label":i,"aria-pressed":t?.checked||n!==void 0?c:void 0,"aria-disabled":!o||void 0,onClick:s,className:Q(`grid size-8 shrink-0 place-items-center rounded-[7px] text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent`,c&&`bg-primary text-primary-foreground hover:bg-primary aria-disabled:hover:bg-primary`),children:[(0,X.jsx)(l,{"aria-hidden":!0,className:Q(`size-4`,u&&`dark:hidden`)}),u?(0,X.jsx)(u,{"aria-hidden":!0,className:`hidden size-4 dark:block`}):null]})})}function jZ({actions:e}){let t=RW(),n=fe(),r=e.get(t.id),i={id:t.id,label:t.label,keys:[t.key],icon:t.icon},a=OW.some(t=>e.get(t.id)?.checked?.()??!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(AZ,{slot:i,action:r,pressed:a}),(0,X.jsxs)(aX,{children:[(0,X.jsx)(oX,{"aria-label":`Shapes`,className:`-ml-0.5 grid h-8 w-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,children:(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-[9px]`})}),(0,X.jsxs)(WX,{side:`top`,align:`start`,sideOffset:8,className:`w-[220px]`,children:[(0,X.jsx)(mX,{value:t.kind,onValueChange:t=>{let n=e.get(LW(t).id);n&&be(n)&&n.run()},children:OW.map(t=>{let r=e.get(t.id),i=pe(r?.keys??[t.key],n),a=t.icon;return(0,X.jsxs)(hX,{value:t.kind,closeOnClick:!0,disabled:!r||!be(r),className:Q(KX,`gap-2 pr-2 data-checked:bg-primary data-checked:text-primary-foreground [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`),children:[(0,X.jsx)(a,{"aria-hidden":!0,className:`size-[13px]`}),t.label,i?(0,X.jsx)(qX,{children:U(i)}):null]},t.id)})}),(0,X.jsx)(gX,{}),(0,X.jsx)(GX,{action:e.get(DW),label:`Image or video`,keys:[`$mod+Shift+KeyK`],children:(0,X.jsxs)(`span`,{className:`flex items-center gap-2 whitespace-nowrap`,children:[(0,X.jsx)(Pn,{"aria-hidden":!0,className:`size-[13px]`}),`Image or video…`]})})]})]})]})}function MZ({actions:e}){let t=SG(),n=fe(),r=TZ.find(e=>e.tool===t)??TZ[0],i={id:r.id,label:r.label,keys:[r.key],icon:r.icon},a=TZ.some(t=>e.get(t.id)?.checked?.()??!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(AZ,{slot:i,action:e.get(r.id),pressed:a}),(0,X.jsxs)(aX,{children:[(0,X.jsx)(oX,{"aria-label":`Frame tools`,className:`-ml-0.5 grid h-8 w-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,children:(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-[9px]`})}),(0,X.jsx)(WX,{side:`top`,align:`start`,sideOffset:8,className:`w-[196px]`,children:(0,X.jsx)(mX,{value:t,onValueChange:t=>{let n=TZ.find(e=>e.tool===t),r=n&&e.get(n.id);r&&be(r)&&r.run()},children:TZ.map(t=>{let r=e.get(t.id),i=pe(r?.keys??[t.key],n),a=t.icon;return(0,X.jsxs)(hX,{value:t.tool,closeOnClick:!0,disabled:!r||!be(r),className:Q(KX,`gap-2 pr-2 data-checked:bg-primary data-checked:text-primary-foreground [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`),children:[(0,X.jsx)(a,{"aria-hidden":!0,className:`size-[13px]`}),t.label,i?(0,X.jsx)(qX,{children:U(i)}):null]},t.id)})})})]})]})}function NZ({slot:e,action:t}){let{label:n,keys:r,on:i,enabled:a,run:o}=FZ(e,t),s=e.icon;return(0,X.jsx)(UX,{label:n,keys:r,children:(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":!a||void 0,onClick:o,className:Q(`flex h-[26px] items-center gap-[5px] rounded-md px-[9px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50`,i&&e.id===`mode.play`?`bg-primary text-primary-foreground hover:text-primary-foreground`:i&&`bg-card text-foreground ring-1 ring-border`),children:[(0,X.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}),n]})})}function PZ(){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:`mx-[5px] h-5 w-px shrink-0 bg-border`})}function FZ(e,t){let n=t?be(t):!1;return{label:t?.label??e.label,keys:t?.keys??e.keys,on:t?.checked?.()??!1,enabled:n,run:()=>{t&&n&&t.run()}}}function IZ(){return N()(()=>({open:!1,focusRequest:0}))}var LZ=IZ();function RZ(e){return F(LZ,e)}function zZ(e=LZ,t=c_){t.setState({hideUi:!1}),e.setState(e=>({open:!0,focusRequest:e.focusRequest+1}))}function BZ(e=LZ){e.setState({open:!1})}function VZ(e=LZ,t=c_){(0,_.useEffect)(()=>{let n=ye([{id:`find.open`,label:`Find`,group:`tool`,keys:[`$mod+KeyF`],run:()=>zZ(e,t),command:{label:`Find frames, elements, and text`,icon:ii}}]);return()=>{n(),BZ(e)}},[e,t])}function HZ({listeners:e,claims:t}){let n=F(Y_,e=>e.session);if(e.length===0)return null;let r=new Map(Object.values(t).map(e=>[e.session,e.agent]));return(0,X.jsx)(`span`,{className:`ml-1 flex items-center`,children:e.map((e,t)=>{let i=r.has(e.session),a=n===e.session,o=(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`grid size-[22px] place-items-center rounded-full text-[9px] font-bold text-card shadow-[0_0_0_2px_var(--sidebar)]`,i?`bg-claim`:`bg-[color-mix(in_srgb,var(--claim)_55%,var(--sidebar))]`),children:dB(r.get(e.session)??pB(e.tag))});return(0,X.jsxs)(`button`,{type:`button`,"aria-label":`${e.tag}, ${i?`editing`:`listening`}`,"aria-pressed":a,title:a?`Stop following ${e.tag}`:`Follow ${e.tag}`,"data-editing":i||void 0,onClick:()=>a?Q_():Z_(e.session),className:Q(`rounded-full outline-none hover:brightness-110 focus-visible:ring-2 focus-visible:ring-ring/50`,a?`flex items-center gap-1.5 py-0.5 pr-2 pl-0.5 text-[11px] font-semibold text-claim shadow-[0_0_0_1.5px_var(--claim)]`:t>0&&`-ml-1.5`,a&&t>0&&`ml-1.5`),children:[o,a?`Following`:null]},e.session)})})}var UZ=[[{id:`arrange.alignLeft`,icon:tt},{id:`arrange.alignCenter`,icon:Ge},{id:`arrange.alignRight`,icon:Ye}],[{id:`arrange.alignTop`,icon:rt},{id:`arrange.alignMiddle`,icon:Ue},{id:`arrange.alignBottom`,icon:qe}],[{id:`arrange.distributeHorizontal`,icon:Ze},{id:`arrange.distributeVertical`,icon:at}]],WZ=UZ.flat().map(({id:e})=>e);function GZ(){let e=xe(WZ),t=new Map(e.flatMap(e=>e?[[e.id,e]]:[]));return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-arrange`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-arrange`,className:`mb-2 text-xs font-semibold`,children:`Arrange`}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:UZ.map(e=>(0,X.jsx)(`div`,{role:`group`,className:`flex gap-0.5 rounded-md bg-input p-0.5`,children:e.map(({id:e,icon:n})=>(0,X.jsx)(KZ,{action:t.get(e),icon:n},e))},e[0]?.id))})]})}function KZ({action:e,icon:t}){return e?(0,X.jsx)(UX,{label:e.label,keys:e.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":e.label,disabled:!be(e),onClick:e.run,className:`grid h-[22px] w-7 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar disabled:pointer-events-none disabled:opacity-40`,children:(0,X.jsx)(t,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})}):null}function qZ({frame:e}){let t=$g(t=>t.findings[e]);return!t||t.length===0?null:(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-checks`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-2`,children:[(0,X.jsxs)(`h2`,{id:`inspector-checks`,className:`mb-1 text-xs font-semibold`,children:[`Checks · `,t.length]}),(0,X.jsx)(`div`,{className:`-mx-1.5`,children:(0,X.jsx)(vU,{findings:t})})]})}var JZ=new Map;function YZ(e,t){let n=JSON.stringify({locale:oJ(e),options:t}),r=JZ.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return JZ.set(n,i),i}function XZ(e,t,n){return e==null?``:YZ(t,n).format(e)}var ZZ=_.createContext(void 0);function QZ(){let e=_.useContext(ZZ);if(e===void 0)throw Error(Za(43));return e}var $Z=`data-valid`,eQ=`data-invalid`,tQ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},nQ={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},rQ={valid(e){return e===null?null:e?{[$Z]:``}:{[eQ]:``}}},iQ={invalid:void 0,name:void 0,validityData:{state:tQ,errors:[],error:``,value:``,initialValue:null},setValidityData:Wa,disabled:void 0,setTouched:Wa,setDirty:Wa,setFilled:Wa,setFocused:Wa,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:nQ,registerFieldControl:Wa,validation:{getValidationProps:(e,t=Ka)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Wa,getInputControl:()=>null,commit:async()=>{},change:Wa}},aQ=_.createContext(iQ);function oQ(e=!0){let t=_.useContext(aQ);if(t.setValidityData===Wa&&!e)throw Error(Za(28));return t}var sQ=_.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Wa,validationMode:`onSubmit`,submitCountRef:{current:0}});function cQ(){return _.useContext(sQ)}var lQ=_.createContext({controlId:void 0,registerControlId:Wa,resetControlId:Wa,labelId:void 0,setLabelId:Wa,messageIds:[],setMessageIds:Wa,getDescriptionProps:e=>e});function uQ(){return _.useContext(lQ)}function dQ(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=uQ(),o=rH(),s=Ya(()=>Symbol()),c=_.useRef(!1),l=_.useRef(!1),u=J(()=>{c.current&&i!==Wa&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===Wa){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}var fQ={inputValue:()=>null,value:()=>null,...rQ},pQ=`零〇一二三四五六七八九`,mQ=/[٠-٩۰-۹0-9]/g,hQ=/[零〇一二三四五六七八九]/g,gQ=[`%`,`٪`,`%`,`﹪`],_Q=[`‰`,`؉`],vQ=/[%٪%﹪]/,yQ=/[‰؉]/,bQ=/[%٪%﹪]/g,xQ=/[‰؉]/g,SQ=/[٠-٩۰-۹]/,CQ=/[零〇一二三四五六七八九]/,wQ=/[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;function TQ(e){return wQ.test(e)}var EQ=[`.`,`,`,`.`,`,`,`٫`,`٬`],DQ=/\p{Zs}/u,OQ=/\p{Cf}/u,kQ=/\p{Cf}/gu,AQ=[`+`,`+`,`﹢`],jQ=[`-`,`−`,`-`,`‒`,`–`,`—`,`﹣`],MQ=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function NQ(e,t){let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)}var PQ=/[-−-‒–—﹣]/gu,FQ=/[++﹢]/gu,IQ=/[-−-‒–—﹣]/,LQ=/[++﹢]/,RQ=11111.1;function zQ(e,t){return YZ(e,t).formatToParts(RQ)}function BQ(e,t){let n=zQ(e,t),r={};n.forEach(e=>{r[e.type]=e.value});let i=`.`;return YZ(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(i=e.value)}),{...r,decimal:i}}function VQ(e,t,n){let r=e.replace(kQ,``).trim();r=r.replace(PQ,`-`).replace(FQ,`+`);let i=!1,a=(e,t)=>(t===`-`&&(i=!0),``);r=r.replace(/([+-])\s*$/,a).replace(/^\s*([+-])/,a);let o=t;o===void 0&&(SQ.test(r)?o=`ar`:CQ.test(r)&&(o=`zh`));let{group:s,decimal:c,currency:l,exponentSeparator:u}=BQ(o,n),d=YZ(o,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>MQ(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;s&&(p=/\p{Zs}/u.test(s)?/\p{Zs}/gu:s===`'`||s===`’`?/['’]/g:new RegExp(MQ(s),`g`));let m=[[p,``],[new RegExp(MQ(c),`g`),`.`],[/[.٫]/g,`.`],[/[,٬]/g,``],[l?new RegExp(MQ(l),`g`):null,``],[f,``],[bQ,``],[xQ,``],[u?new RegExp(MQ(u),`g`):null,`e`],[mQ,e=>String(e.charCodeAt(0)%16)],[hQ,e=>String(Math.max(pQ.indexOf(e)-1,0))]].reduce((e,[t,n])=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||r.includes(`∞`))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=vQ.test(e)||v===`percent`;return yQ.test(e)?_=NQ(_,-3):!y&&b&&(_=NQ(_,-2)),Number.isFinite(_)?_:null}var HQ=1e-10,UQ=1e-10;function WQ(e){return e?.maximumFractionDigits!=null||e?.minimumFractionDigits!=null||e?.maximumSignificantDigits!=null||e?.minimumSignificantDigits!=null||e?.roundingIncrement!=null||e?.roundingMode!=null||e?.roundingPriority!=null}function GQ(e,t){if(!Number.isFinite(e))return e;if(!WQ(t)){let t=parseFloat(e.toPrecision(15));return Math.abs(t-e)<=Math.min(2**-52*Math.max(1,Math.abs(e)),UQ)?t:e}let n=YZ(`en-US`,{...t,signDisplay:`auto`,currencySign:`standard`,notation:t.notation===`compact`?`standard`:t.notation,useGrouping:!1}),r=n.format(e),i=VQ(r,`en-US`,t);return i===null?e:n.format(i)===r?i:e}function KQ(e,t,n,r){let i=Math.abs(n),a=Math.sign(n),o=i*HQ*a,s=e-t+o;return r?t+Math.round(s/n)*n:t+(a>0?Math.floor(s/i):Math.ceil(s/i))*i}function qQ(e,t,n,r,i,a,o,s,c){if(e===null)return e;let l=e;if(t!=null&&o&&t!==0&&(l=KQ(l,s||n===-(2**53-1)?i:n,t,s)),c&&(l=Au(l,n,r)),t==null&&!WQ(a))return l;let u=GQ(l,a);return c?Au(u,n,r):u}var JQ=_.forwardRef(function(e,t){let{id:n,min:r,max:i,smallStep:a=.1,step:o=1,largeStep:s=10,required:c=!1,disabled:l=!1,readOnly:u=!1,form:d,name:f,defaultValue:p=null,value:m,onValueChange:h,onValueCommitted:g,allowWheelScrub:v=!1,snapOnStep:y=!1,allowOutOfRange:b=!1,format:x,locale:S,render:C,className:w,inputRef:T,style:E,...D}=e,{setDirty:O,validityData:k,disabled:A,setFilled:j,name:M,state:N,validation:P}=oQ(),{clearErrors:F}=cQ(),I=A||l,L=M??f,R=o===`any`?1:o,[z,B]=_.useState(!1),V=r??-(2**53-1),ee=i??2**53-1,te=r??0,ne=x?.style,re=_.useRef(null),H=Ml(T,P.inputRef),U=dQ({id:n}),[ie,ae]=NK({controlled:m,default:p,name:`NumberField`,state:`value`}),oe=Jd(ie);q(()=>{j(ie!==null)},[j,ie]);let W=$o(),se=Jd(x),ce=_.useRef(!1),le=J((e,t)=>{ce.current=!1,g?.(e,t)}),ue=_.useRef(!0),de=_.useRef(null),[fe,pe]=_.useState(()=>XZ(ie,S,x)),[me,he]=_.useState(`numeric`),ge=J(()=>{let e=zQ(S,x),t=new Set(EQ),n=e=>e.forEach(e=>t.add(e)),r=e.find(e=>e.type===`decimal`)?.value??BQ(S,x).decimal;t.add(r),e.forEach(e=>{e.type!==`integer`&&e.type!==`fraction`&&e.type!==`exponentInteger`&&e.type!==`compact`&&(n(Array.from(e.value)),DQ.test(e.value)&&t.add(` `))});let i=ne===`percent`||ne===`unit`&&x?.unit===`percent`,a=ne===`percent`||ne===`unit`&&x?.unit===`permille`;return i&&n(gQ),a&&n(_Q),n(AQ),(V<0||b)&&n(jQ),t}),_e=J(e=>e?.altKey?a:e?.shiftKey?s:R),ve=J((e,t)=>{let n=t.event,r=t.direction,i=t.reason.startsWith(`input-`)||t.reason===`none`,a=!b||!i,o=qQ(e,r?_e(n)*r:void 0,V,ee,te,se.current,y,n?.altKey??!1,a),s=o!==ie||i&&(e!==ie||ue.current===!1);if(s){if(h?.(o,t),t.isCanceled)return!1;ae(o),O(o!==k.initialValue),ce.current=!0}return de.current=o,ue.current&&pe(XZ(o,S,x)),W(),s}),ye=J((e,{direction:t,currentValue:n,event:r,reason:i})=>{let a=n??oe.current,o=r;return typeof a==`number`?ve(a+e*t,fd(i,o,void 0,{direction:t})):ve(0,fd(i,o))});q(function(){if(!ue.current)return;let e=XZ(ie,S,x);e!==fe&&pe(e)}),q(function(){if(!vs)return;let e=`text`;V>=0&&(e=`decimal`),he(e)},[V]);let G=J(()=>{let e=re.current;if(!e)return;let t=e.value.length;e.setSelectionRange(t,t),e.focus()});_.useEffect(function(){let e=re.current;if(I||u||!v||!e)return;function t(e){if(e.ctrlKey||Ds(Zo(re.current))!==re.current)return;let t=Math.abs(e.deltaX)>Math.abs(e.deltaY),n=e.shiftKey&&t?e.deltaX:e.deltaY;if(n===0||!e.shiftKey&&t)return;e.preventDefault(),ue.current=!0;let r=_e(e);ye(r,{direction:n>0?-1:1,event:e,reason:`wheel`})&&le(de.current,pd(Md,e))}return Qo(e,`wheel`,t)},[v,ye,I,u,_e,le,de,oe]);let be=_.useMemo(()=>({...N,disabled:I,readOnly:u,required:c,value:ie,inputValue:fe,scrubbing:z}),[N,I,u,c,ie,fe,z]),xe=_.useMemo(()=>({inputRef:re,focusInput:G,minWithDefault:V,maxWithDefault:ee,id:U,setValue:ve,incrementValue:ye,getStepAmount:_e,allowInputSyncRef:ue,formatOptionsRef:se,valueRef:oe,lastChangedValueRef:de,hasPendingCommitRef:ce,name:L,nameProp:f,inputMode:me,getAllowedNonNumericKeys:ge,min:r,max:i,setInputValue:pe,locale:S,setIsScrubbing:B,state:be,onValueCommitted:le}),[re,G,V,ee,U,ve,ye,_e,se,oe,L,f,me,ge,r,i,pe,S,be,le]),Se=Z(`div`,e,{ref:t,state:be,props:D,stateAttributesMapping:fQ});return(0,X.jsxs)(ZZ.Provider,{value:xe,children:[Se,(0,X.jsx)(`input`,{...P.getValidationProps(I,{onFocus(){G()},onChange(e){if(e.nativeEvent.defaultPrevented||I||u)return;let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=fd(md,e.nativeEvent);ve(n,r),F(L),P.change(de.current??n)}}),ref:H,type:`number`,form:d,name:L,value:ie??``,min:r,max:i,step:o,disabled:I,readOnly:u,required:c,"aria-hidden":!0,tabIndex:-1,style:L?Al:kl,suppressHydrationWarning:!0})]})});function YQ(e){return e===`touch`||e===`pen`}function XQ(e,t,n){let{setFocused:r,focusOwnerRef:i}=oQ(),a=J(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function ZQ(e,t,n,r,i=!0,a){let{registerFieldControl:o}=oQ(),s=Ya(()=>Symbol());q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var QQ=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),$Q=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{allowInputSyncRef:o,formatOptionsRef:s,getAllowedNonNumericKeys:c,getStepAmount:l,id:u,incrementValue:d,inputMode:f,max:p,min:m,name:h,nameProp:g,setValue:v,state:y,setInputValue:b,locale:x,inputRef:S,onValueCommitted:C,lastChangedValueRef:w,hasPendingCommitRef:T,valueRef:E}=QZ(),{disabled:D,readOnly:O,required:k,value:A,inputValue:j}=y,{clearErrors:M}=cQ(),{validationMode:N,setTouched:P,invalid:F,shouldValidateOnChange:I,validation:L}=oQ(),{labelId:R}=uQ(),z=XQ(D,S),B=_.useRef(!1),V=_.useRef(null);return ZQ(S,u,A,void 0,!D,g),q(()=>{if(V.current!=null){let e=V.current;V.current=null,S.current?.setSelectionRange(e,e)}}),oH(A,()=>{M(h),B.current&&!I()?B.current=!1:L.change(A)}),Z(`input`,e,{ref:[t,S],state:y,props:[{id:u,required:k,disabled:D,readOnly:O,inputMode:f,value:j,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":!D&&F?!0:void 0,"aria-labelledby":R,suppressHydrationWarning:!0,onFocus(e){e.defaultPrevented||D||z(!0)},onBlur(e){if(e.defaultPrevented||D||(P(!0),z(!1),O))return;let t=!o.current,n=T.current;if(o.current=!0,j.trim()===``){let r=fd(Cd,e.nativeEvent);if(v(null,r),r.isCanceled)return;N===`onBlur`&&L.commit(null),(t||n||A!==null)&&C(null,pd(Cd,e.nativeEvent));return}let r=s.current,i=VQ(j,x,r);if(i===null)return;let a=WQ(r),c;c=!t&&!a?A:a?GQ(i,r):i;let l=pd(wd,e.nativeEvent),u=A!==c,d=t||u||n,f=c;if(u){let t=fd(wd,e.nativeEvent);if(B.current=!0,v(c,t),t.isCanceled){B.current=!1;return}f=w.current,f===A&&(B.current=!1)}N===`onBlur`&&L.commit(f),d&&C(f,l);let p=XZ(f,x,r);j!==p&&b(p)},onChange(e){if(e.nativeEvent.defaultPrevented)return;o.current=!1;let t=e.currentTarget.value;if(t.trim()===``){b(t),v(null,fd(Cd,e.nativeEvent));return}let n=c();if(!Array.from(t).every(e=>TQ(e)||IQ.test(e)||n.has(e)||OQ.test(e)))return;let r=VQ(t,x,s.current);b(t),r!==null&&v(r,fd(Sd,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||O||D)return;let t=e.nativeEvent,n=!o.current,r=c(),i=r.has(e.key),{decimal:a,currency:u,percentSign:f}=BQ(x,s.current),h=e.currentTarget.selectionStart,g=e.currentTarget.selectionEnd,_=h===0&&g===j.length,y=e=>h!=null&&g!=null&&e>=h&&e<g;[[IQ,PQ],[LQ,FQ]].forEach(([t,n])=>{if(t.test(e.key)&&Array.from(r).some(e=>t.test(e))){let e=j.search(n),t=e!==-1&&y(e);i=!(IQ.test(j)||LQ.test(j))||_||t}}),[a,u,f].forEach(t=>{if(e.key===t){let e=j.indexOf(t),n=y(e);i=e===-1||_||n}});let b=QQ.has(e.key),S=e.key===`ArrowUp`||e.key===`ArrowDown`;if(e.which===229||e.altKey&&!S||e.ctrlKey||e.metaKey||i||TQ(e.key)||b)return;let T=null;if(e.key===`Home`&&m!=null?T=m:e.key===`End`&&p!=null&&(T=p),e.key.length>1&&!S&&T===null)return;let k=n?VQ(j,x,s.current):null,A=l(e);e.preventDefault(),e.stopPropagation();let M=pd(kd,t),N=!1;(S||T!==null)&&(o.current=!0),S?(n||(w.current=E.current),N=d(A,{direction:e.key===`ArrowUp`?1:-1,currentValue:k,event:t,reason:kd})):T!==null&&(N=v(T,fd(kd,t))),N&&C(w.current,M)},onPaste(e){if(e.defaultPrevented||O||D)return;let t=``;try{t=e.clipboardData?.getData(`text/plain`)??``}catch{return}e.preventDefault();let n=e.currentTarget,r=n.selectionStart,i=n.selectionEnd,a=j.slice(0,r)+t+j.slice(i),c=VQ(a,x,s.current);c!==null&&(o.current=!1,V.current=r+t.length,v(c,fd(Td,e.nativeEvent)),b(a))}},a,e=>L.getValidationProps(D,e)],stateAttributesMapping:fQ})}),e$=_.createContext(void 0);function t$(){let e=_.useContext(e$);if(e===void 0)throw Error(Za(44));return e}function n$(e,t){let n=Do(t);if(e!=null){let n=t.getBoundingClientRect();return{left:n.left-e/2,top:n.top-e/2,right:n.right+e/2,bottom:n.bottom+e/2}}let r=n.visualViewport;return r?{left:r.offsetLeft,top:r.offsetTop,right:r.offsetLeft+r.width,bottom:r.offsetTop+r.height}:{left:0,top:0,right:n.document.documentElement.clientWidth,bottom:n.document.documentElement.clientHeight}}var r$={touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`},i$=_.forwardRef(function(e,t){let{render:n,className:r,direction:i=`horizontal`,pixelSensitivity:a=2,teleportDistance:o,style:s,...c}=e,{state:l,setIsScrubbing:u,inputRef:d,focusInput:f,incrementValue:p,allowInputSyncRef:m,getStepAmount:h,onValueCommitted:g,lastChangedValueRef:v,valueRef:y}=QZ(),{disabled:b,readOnly:x}=l,S=_.useRef(null),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(null),E=_.useRef(!1),D=_.useRef(null),O=_.useRef({x:0,y:0}),k=os(),A=os(),[j,M]=_.useState(!1),[N,P]=_.useState(!1),[F,I]=_.useState(!1);function L(e,t,n){let r=Do(e).visualViewport?.scale??1;e.style.transform=`translate3d(${t}px,${n}px,0) scale(${1/r})`}let R=J(({movementX:e,movementY:t})=>{let n=D.current,r=S.current;if(!n||!r)return;let i=n$(o,r),a=O.current,s=(e,t,n,r)=>e+t<n?r-t:e+t>r?n-t:e,c={x:s(Math.round(a.x+e),n.offsetWidth/2,i.left,i.right),y:s(Math.round(a.y+t),n.offsetHeight/2,i.top,i.bottom)};O.current=c,L(n,c.x,c.y)}),z=J((e,{clientX:t,clientY:n})=>{gu.flushSync(()=>{I(e),u(e)});let r=D.current;if(!r||!e)return;let i={x:t-r.offsetWidth/2,y:n-r.offsetHeight/2};O.current=i,L(r,i.x,i.y)});_.useEffect(function(){if(!d.current||b||x||!F)return;let e=0;function t(e){function t(){try{Zo(S.current).exitPointerLock()}catch{}finally{C.current=!1,z(!1,e),g(v.current??y.current,pd(Nd,e));let t=T.current,n=d.current;if(!w.current&&t!=null&&n){let e=Do(n).MouseEvent;A.start(0,()=>{E.current||t.dispatchEvent(new e(`click`,{bubbles:!0,cancelable:!0}))})}w.current=!1,T.current=null}}ws?k.start(20,t):t()}function n(t){if(!C.current)return;t.preventDefault(),R(t);let{movementX:n,movementY:r}=t;if(e+=i===`vertical`?r:n,Math.abs(e)>=a){e=0,w.current=!0;let a=(i===`vertical`?-r:n)*h(t);a!==0&&(m.current=!0,p(Math.abs(a),{direction:a>=0?1:-1,event:t,reason:Nd}))}}let r=Do(d.current),o=Xo(Qo(r,`pointerup`,t,!0),Qo(r,`pointermove`,n,!0));return()=>{k.clear(),o()}},[b,x,m,p,F,h,d,z,R,i,a,v,g,y,k,A]),_.useEffect(()=>()=>{if(C.current){C.current=!1,u(!1);try{Zo(S.current).exitPointerLock()}catch{}}},[u]),_.useEffect(function(){let e=S.current;if(!e||b||x)return;function t(e){e.touches.length===1&&e.preventDefault()}return Qo(e,`touchstart`,t)},[b,x]);let B=Z(`span`,e,{ref:[t,S],state:l,props:[{role:`presentation`,style:r$,onClickCapture(){E.current=!0},async onPointerDown(e){if(e.defaultPrevented||x||e.button||b)return;let t=e.pointerType===`touch`;if(M(t),e.pointerType===`mouse`&&(e.preventDefault(),f()),C.current=!0,w.current=!1,E.current=!1,A.clear(),T.current=ks(e.nativeEvent),z(!0,e.nativeEvent),!t&&!Cs)try{await Zo(S.current).body.requestPointerLock(),P(!1)}catch{P(!0)}finally{C.current&&z(!0,e.nativeEvent)}}},c],stateAttributesMapping:fQ}),V=_.useMemo(()=>({isScrubbing:F,isTouchInput:j,isPointerLockDenied:N,scrubAreaCursorRef:D}),[F,j,N]);return(0,X.jsx)(e$.Provider,{value:V,children:B})}),a$={position:`fixed`,top:0,left:0,pointerEvents:`none`},o$=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=QZ(),{isScrubbing:s,isTouchInput:c,isPointerLockDenied:l,scrubAreaCursorRef:u}=t$(),[d,f]=_.useState(null),p=Z(`span`,e,{enabled:s&&!Cs&&!c&&!l,ref:[t,u,f],state:o,props:[{role:`presentation`,style:a$},a],stateAttributesMapping:fQ});return p&&gu.createPortal(p,Zo(d).body)}),s$=new Set([`ArrowUp`,`ArrowDown`]),c$=`group-has-[[data-scrub]:hover]/number:bg-foreground/10 group-has-[[data-scrub]:hover]/number:text-foreground group-data-[scrubbing]/number:bg-foreground/10 group-data-[scrubbing]/number:text-foreground`,l$=`group-has-[[data-scrub]:hover]/number:text-foreground group-data-[scrubbing]/number:text-foreground`;function u$({label:e,caption:t,prefix:n,inset:r=`pl-[26px]`,scrubValue:i=!1,className:a,inputClassName:o,value:s,empty:c=`Mixed`,step:l=1,min:u,max:d,format:f,disabled:p,onPreview:m,onCommit:h}){let[g,v]=(0,_.useState)(null),y=(0,_.useRef)(null),[b,x]=(0,_.useState)(null);b&&b.over!==s&&x(null);let S=b?.over===s?b.value:null,C=(0,_.useRef)(null),w=e=>{!y.current&&e&&(C.current=S??s),y.current=e,v(e)},T=(0,_.useRef)(!1),E=(0,_.useRef)(!1),D=(0,_.useRef)(!1),O=e=>Math.min(d??1/0,Math.max(u??-1/0,e)),k=({value:e,offset:t})=>t?t=>O(t+e):()=>O(e),A=e=>{e.value!==null&&m?.(k({value:e.value,offset:e.offset}))},j=()=>{y.current&&m?.(null),w(null),T.current&&(E.current=!0)},M=()=>{let e=y.current;if(!e)return;w(null);let t=e.offset?e.value===0:e.value===C.current;if(e.value===null||t){m?.(null);return}let n=k({value:e.value,offset:e.offset});s!==null&&!e.offset&&x({value:O(e.value),over:s}),Promise.resolve(h(n)).then(e=>{e===!1&&(x(null),m?.(null))})},N=e=>{let t=(e.shiftKey?l*10:l)*(e.key===`ArrowUp`?1:-1),n=y.current,r=S??s,i=n?.value==null?r===null?{offset:!0,value:t}:{offset:!1,value:O(r+t)}:{offset:n.offset,value:n.offset?n.value+t:O(n.value+t)};w(i),A(i)},P=e=>{if(s$.has(e.key)&&(e.preventDefault(),e.stopPropagation(),N(e)),e.key===`Enter`){M();let t=e.currentTarget;t.blur(),t.focus()}e.key===`Escape`&&(j(),D.current=!0,e.currentTarget.blur())},F=e=>{p||e.button!==0||(T.current=!0,E.current=!1,s===null&&!y.current&&w({value:0,offset:!0}))},I=(0,_.useMemo)(()=>({useGrouping:!1,...f,...g?.offset?{signDisplay:`exceptZero`}:{}}),[g?.offset,f]),L=(0,X.jsx)($Q,{"aria-label":e,placeholder:s===null?c:void 0,className:Q(`h-[26px] w-full min-w-0 rounded-md border-0 bg-input px-2 text-xs text-foreground tabular-nums outline-none placeholder:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,n?r:void 0,i&&`cursor-ew-resize`,i&&!p&&c$,o),onFocus:e=>e.currentTarget.select(),onChange:e=>{RV(e)&&e.preventBaseUIHandler()},onKeyDown:P,onKeyUp:e=>{s$.has(e.key)&&M()},onBlur:()=>{D.current?D.current=!1:M()}});return(0,X.jsxs)(JQ,{className:Q(`group/number block`,a),value:g?g.value:S??s,step:l,largeStep:l*10,min:u,max:d,format:I,disabled:p,onValueChange:(e,t)=>{if(t.reason===`scrub`){if(E.current)return;let t={value:e,offset:s===null};w(t),A(t)}else(t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-paste`)&&w({value:e,offset:!1})},onValueCommitted:(e,t)=>{t.reason===`scrub`&&(T.current=!1,E.current?E.current=!1:M())},children:[t?(0,X.jsxs)(i$,{"aria-hidden":!0,"data-scrub":!0,className:Q(`mb-[3px] ml-0.5 block w-max cursor-ew-resize text-(length:--text-caption) font-normal text-muted-foreground select-none`,!p&&l$),onPointerDown:F,children:[t,(0,X.jsx)(d$,{})]}):null,(t=>n&&typeof n!=`string`?(0,X.jsx)(UX,{label:e,children:t}):t)((0,X.jsxs)(`div`,{className:`relative`,children:[n?(0,X.jsxs)(i$,{"aria-hidden":!0,"data-scrub":!0,className:Q(`absolute inset-y-0 left-0 flex min-w-6 cursor-ew-resize items-center justify-center rounded-l-md px-1.5 text-xs text-muted-foreground select-none`,!p&&c$),onPointerDown:F,children:[n,(0,X.jsx)(d$,{})]}):null,i?(0,X.jsxs)(i$,{"data-scrub":!0,className:`block`,onPointerDown:F,children:[L,(0,X.jsx)(d$,{})]}):L]}))]})}function d$(){return(0,X.jsx)(o$,{className:`z-50`,children:(0,X.jsx)(br,{"aria-hidden":!0,className:`-mt-2 -ml-2 size-4 text-foreground drop-shadow-[0_0_1px_var(--background)]`})})}var f$={style:`unit`,unit:`degree`,unitDisplay:`narrow`,maximumFractionDigits:2};function p$(e){let t=(e%360+360)%360;return Math.round((t>180?t-360:t)*100)/100}function m$(e,{rotate:t}){return t===e?``:`${e}deg`}function h$(e,t,{scale:n}){let r=t===`x`?-e.x:e.x,i=t===`y`?-e.y:e.y;return n?.x===r&&n.y===i?``:`${r} ${i}`}function g$(){return(0,X.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:[(0,X.jsx)(`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}),(0,X.jsx)(`path`,{d:`M3 11a10 10 0 0 1 10 10`})]})}function _$({degrees:e,scale:t,translated:n}){return n?`Its transform moves it, so a rotation would swing it away`:e===null||t===null?`A 3D rotate or scale has no rotation here`:null}function v$({rotation:e,disabled:t,write:n,preview:r}){let{degrees:i,scale:a,own:o}=e,s=_$(e),c=t||s!==null,l=i??0,u=e=>n({kind:`style`,property:`rotate`,value:m$(e,o)}),d=[{label:`Rotate 90°`,icon:Kr,press:()=>void u(p$(l+90))},...[`x`,`y`].map(e=>({label:e===`x`?`Flip horizontal`:`Flip vertical`,icon:e===`x`?Bi:Ri,press:()=>void n({kind:`style`,property:`scale`,value:h$(a??{x:1,y:1},e,o)})}))];return(0,X.jsxs)(X.Fragment,{children:[s?(0,X.jsx)(`span`,{id:`inspector-rotation-lock`,className:`sr-only`,children:s}):null,(0,X.jsxs)(`div`,{className:`mt-1.5 grid grid-cols-2 items-end gap-1.5`,children:[(0,X.jsx)(u$,{label:`Rotation`,caption:`Rotation`,prefix:(0,X.jsx)(g$,{}),inset:`pl-[28px]`,value:i,empty:`3D`,format:f$,disabled:c,onPreview:e=>r?.(`rotate`,e?`${e(l)}deg`:null),onCommit:e=>{let t=p$(e(l));return t===l?Promise.resolve(!1):u(t)}}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Rotate and flip`,className:`grid grid-cols-3 gap-0.5 rounded-md bg-input p-0.5`,children:d.map(({label:e,icon:n,press:r})=>(0,X.jsx)(UX,{label:s??e,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":e,"aria-describedby":s?`inspector-rotation-lock`:void 0,"aria-disabled":s!==null||void 0,disabled:t,onClick:()=>{c||r()},className:Q(`grid h-[22px] place-items-center rounded-[5px] text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,c?`opacity-50`:`hover:text-foreground`),children:(0,X.jsx)(n,{"aria-hidden":!0,className:`size-[13px]`})})},e))})]})]})}var y$={style:`unit`,unit:`percent`,maximumFractionDigits:0},b$={maximumFractionDigits:0};function x$(){return(0,X.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`}),(0,X.jsx)(`path`,{d:`M12 4a8 8 0 0 1 0 16z`,fill:`currentColor`})]})}function S$(){return(0,X.jsx)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:(0,X.jsx)(`path`,{d:`M4 20V10a6 6 0 0 1 6-6h10`})})}function C$({opacity:e,radius:t,rotation:n,disabled:r,write:i,preview:a}){let o=Math.round(e*100);return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-appearance`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-appearance`,className:`mb-2 text-xs font-semibold`,children:`Appearance`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(u$,{label:`Opacity`,caption:`Opacity`,prefix:(0,X.jsx)(x$,{}),inset:`pl-[28px]`,value:o,min:0,max:100,format:y$,disabled:r,...GB(`opacity`,o,e=>String(e/100),i,a)}),(0,X.jsx)(u$,{label:`Corner radius`,caption:`Corner radius`,prefix:(0,X.jsx)(S$,{}),inset:`pl-[28px]`,value:t,min:0,format:b$,disabled:r,...GB(`border-radius`,t,e=>`${e}px`,i,a)})]}),(0,X.jsx)(v$,{rotation:n,disabled:r,write:i,preview:a})]})}function w$(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}function T$(e){return e==null?void 0:`${e}-label`}function E$(e,t){return e??t}function D$(e,t){return e-t}function O$(e,t,n,r,i,a){let o=Au(e,n,r);if(!i)return o;let s=a.slice();return s[t]=Au(o,a[t-1]??-1/0,a[t+1]??1/0),s.sort(D$)}function k$(e,t,n){if(!Array.isArray(e))return!0;let r=t*n;for(let t=0;t<e.length-1;t+=1)if(!(Math.abs(e[t]-e[t+1])>=r))return!1;return!0}var A$=()=>null,j$={activeThumbIndex:A$,max:A$,min:A$,minStepsBetweenValues:A$,step:A$,values:A$,...rQ},M$=_.createContext(void 0);function N$(){let e=_.useContext(M$);if(e===void 0)throw Error(Za(62));return e}function P$(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&w$(e,t)}var F$=_.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:s,largeStep:c=10,locale:l,render:u,max:d=100,min:f=0,minStepsBetweenValues:p=0,form:m,name:h,onValueChange:g,onValueCommitted:v,orientation:y=`horizontal`,step:b=1,thumbCollisionBehavior:x=`push`,thumbAlignment:S=`center`,value:C,style:w,...T}=e,E=rH(o),D=T$(E),O=J(g),k=J(v),{clearErrors:A}=cQ(),{state:j,disabled:M,name:N,setTouched:P,setDirty:F,validityData:I,validation:L}=oQ(),{labelId:R}=uQ(),[z,B]=_.useState(),V=n??E$(R,z),ee=M||a,te=N??h,[ne,re]=NK({controlled:C,default:i??f,name:`Slider`}),H=_.useRef(null),U=_.useRef(null),ie=_.useRef([]),ae=_.useRef(null),oe=_.useRef(-1),W=_.useRef(null),se=_.useRef(md),[ce,le]=_.useState(-1),[ue,de]=_.useState(-1),[fe,pe]=_.useState(!1),[me,he]=_.useState(()=>new Map),[ge,_e]=_.useState([void 0,void 0]),ve=J(e=>{le(e),e!==-1&&de(e)}),ye=J(e=>{e&&(U.current=e)}),G=Array.isArray(ne),be=_.useMemo(()=>G?ne.map(e=>Au(e,f,d)).sort(D$):[Au(ne,f,d)],[d,f,G,ne]),xe=G?be:be[0];ZQ(L.inputRef,E,xe,void 0,!ee,h),oH(xe,()=>{A(te),L.change(xe);let e=I.initialValue,t;t=Array.isArray(xe)&&Array.isArray(e)?!w$(xe,e):xe!==e,F(t)});let Se=J((e,t)=>{if(Number.isNaN(e)||P$(e,ne))return!1;let n=t.event,r=n.constructor,i=new r(n.type,n);return Object.defineProperty(i,"target",{writable:!0,value:{value:e,name:te}}),t.event=i,O(e,t),!t.isCanceled&&(se.current=t.reason,re(e),!0)}),Ce=J((e,t,n)=>{let r=O$(e,t,f,d,G,be);if(k$(r,b,p)){let e=`key`in n?kd:Sd,i=Se(r,fd(e,n.nativeEvent,void 0,{activeThumbIndex:t}));P(!0),i&&k(r,pd(e,n.nativeEvent))}});q(()=>{if(!ee)return;let e=Ds(Zo(H.current));Y(H.current,e)&&e.blur(),ce!==-1&&ve(-1)},[ce,ee,ve]);let we=_.useMemo(()=>({...j,activeThumbIndex:ce,disabled:ee,dragging:fe,orientation:y,max:d,min:f,minStepsBetweenValues:p,step:b,values:be}),[j,ce,ee,fe,d,f,p,y,b,be]),Te=_.useMemo(()=>({active:ce,controlRef:U,disabled:ee,dragging:fe,validation:L,format:s,handleInputChange:Ce,indicatorPosition:ge,inset:S!==`center`,isArrayValue:G,labelId:V,rootLabelId:D,largeStep:c,lastUsedThumbIndex:ue,lastChangeReasonRef:se,form:m,locale:l,max:d,min:f,minStepsBetweenValues:p,name:te,onValueCommitted:k,orientation:y,pressedThumbCenterOffsetRef:ae,pressedThumbIndexRef:oe,pressedValuesRef:W,registerFieldControlRef:ye,renderBeforeHydration:S===`edge`,setActive:ve,setDragging:pe,setIndicatorPosition:_e,setLabelId:B,setValue:Se,state:we,step:b,thumbCollisionBehavior:x,thumbMap:me,thumbRefs:ie,values:be}),[ce,V,D,ee,fe,L,s,Ce,ge,c,ue,m,l,d,f,p,te,k,y,G,ye,ve,Se,we,b,x,S,me,be]),Ee=Z(`div`,e,{state:we,ref:[t,H],props:[{"aria-labelledby":V,id:E,role:`group`},T,e=>L.getValidationProps(ee,e)],stateAttributesMapping:j$});return(0,X.jsx)(M$.Provider,{value:Te,children:(0,X.jsx)(mq,{elementsRef:ie,onMapChange:he,children:Ee})})});function I$(e,t){let n=e.getBoundingClientRect();return t?(n.top+n.bottom)/2:(n.left+n.right)/2}function L$(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function R$(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(L$(t),L$(n))))}function z$(e,t,n,r,i,a,o,s){let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=Au(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=Au(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=Au(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function B$(e,t,n,r,i,a,o,s,c,l){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;if(e===`push`)return{value:z$(u,i,a,o,s,c,l),thumbIndex:i,didSwap:!1};let p=u.slice(),m=p[i-1],h=p[i+1],g=m==null?o:m+f,_=h==null?s:h-f,v=Number(Au(a,g,_).toFixed(12));switch(p[i]=v,e){case`swap`:{let e=u[i],t=1e-7,n=a>e,r=a<e,g=n&&h!=null&&a>=h-t,_=r&&m!=null&&a<=m+t;if(!g&&!_)return{value:p,thumbIndex:i,didSwap:!1};let y=g?i+1:i-1,b=p.map((e,t)=>t===i?v:d[t]??u[t]),x=a;x=g?Math.max(a,p[y]):Math.min(a,p[y]);let S=z$(p,y,x,o,s,c,l,b),C=g?y-1:y+1,w=S[C-1],T=S[C+1],E=w==null?o:w+f;E=Math.max(E,o+C*f);let D=T==null?s:T-f;D=Math.min(D,s-(S.length-1-C)*f);let O=Au(v,E,D);return S[C]=Number(O.toFixed(12)),{value:S,thumbIndex:y,didSwap:!0}}default:return{value:p,thumbIndex:i,didSwap:!1}}}var V$=2;function H$(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function U$(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var W$=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{disabled:o,dragging:s,inset:c,isArrayValue:l,lastChangeReasonRef:u,max:d,min:f,minStepsBetweenValues:p,onValueCommitted:m,orientation:h,pressedThumbCenterOffsetRef:g,pressedThumbIndexRef:v,pressedValuesRef:y,registerFieldControlRef:b,renderBeforeHydration:x,setActive:S,setDragging:C,setValue:w,state:T,step:E,thumbCollisionBehavior:D,thumbRefs:O,values:k}=N$(),A=Ym(),j=k.length>1,M=h===`vertical`,N=_.useRef(null),P=_.useRef(null),F=J(e=>{e&&P.current==null&&(P.current=Do(e).getComputedStyle(e))}),I=_.useRef(null),L=_.useRef(0),R=_.useRef(0),z=_.useRef(null),B=_.useRef(!1),V=Jd(k);function ee(e){return e?.querySelector(`input[type="range"]`)}function te(e){v.current=e,O.current[e]||(g.current=null)}function ne(){v.current=-1,g.current=null}function re(e){return Ao(e)?O.current.some(t=>!Ao(t)||!Y(t,e)?!1:ee(t)?.disabled===!0):!1}function H(e){let t=N.current,n=v.current;if(!t||n<0||n>=k.length)return n>=k.length&&(z.current=null),null;let{width:r,height:i,bottom:a,left:o,right:s}=t.getBoundingClientRect(),c=H$(P.current,M),u=R.current,m=(M?i:r)-c.start-c.end-u*2,h=g.current??0,_=e.x-h,b=e.y-h,x=Au(((M?a-b-c.end:(A===`rtl`?s-_:_-o)-c.start)-u)/m,0,1),S=(d-f)*x+f;return S=R$(S,E,f),S=Au(S,f,d),j?B$(D,k,V.current,y.current,n,S,f,d,E,p):{value:l?[S]:S,thumbIndex:n,didSwap:!1}}function U(e){y.current=j?k.slice():null,z.current=null,V.current=k;let t=v.current,n=t;if(t>-1&&t<k.length){if(k[t]===d){let e=t;for(;e>0&&k[e-1]===d;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(Ao(a)&&!ee(a)?.disabled){let o=I$(a,M),s=Math.abs(e[t]-o);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&te(n),c){let e=O.current[n];if(Ao(e)){let t=e.getBoundingClientRect();R.current=t[M?`height`:`width`]/2}}}function ie(e){let t=ee(O.current?.[e]);t&&t.focus({preventScroll:!0,focusVisible:!1})}function ae(e,t,n){let r=w(e.value,fd(t,n,void 0,{activeThumbIndex:e.thumbIndex}));return r&&(z.current=e.value,V.current=Array.isArray(e.value)?e.value:[e.value],e.didSwap&&(te(e.thumbIndex),ie(e.thumbIndex))),r}let oe=J(e=>{let t=U$(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){W(e);return}let n=H(t);n!=null&&k$(n.value,E,p)&&(!s&&L.current>V$&&C(!0),ae(n,jd,e))}),W=J(e=>{if(U$(e,I)==null)return;S(-1),C(!1),g.current=null;let t=z.current;if(Array.isArray(t)&&t.length!==k.length&&(z.current=null),z.current!=null){let t=u.current;m(z.current,pd(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),v.current=-1,le()}),se=J(e=>{I.current??W(e)}),ce=J(e=>{let t=B.current;if(B.current=!1,o)return;if(re(ks(e))){ne();return}let n=e.changedTouches[0];if(n==null)return;if(I.current=n.identifier,!t){let t={x:n.clientX,y:n.clientY};U(t);let r=H(t);if(r==null)return;ie(r.thumbIndex),ae(r,xd,e),L.current=0}let r=Zo(N.current);r.addEventListener(`touchmove`,oe,{passive:!0}),r.addEventListener(`touchend`,W,{passive:!0}),r.addEventListener(`touchcancel`,W,{passive:!0})}),le=J(()=>{let e=Zo(N.current);e.removeEventListener(`pointermove`,oe),e.removeEventListener(`pointerup`,W),e.removeEventListener(`pointercancel`,se),e.removeEventListener(`touchmove`,oe),e.removeEventListener(`touchend`,W),e.removeEventListener(`touchcancel`,W),I.current=null,y.current=null,z.current=null,B.current=!1}),ue=rs();return _.useEffect(()=>{let e=N.current;if(!e)return()=>le();let t=Qo(e,`touchstart`,ce,{passive:!0});return()=>{t(),ue.cancel(),le()}},[le,ce,N,ue]),_.useEffect(()=>{o&&le()},[o,le]),Z(`div`,e,{state:T,ref:[t,b,N,F],props:[{"data-base-ui-slider-control":x?``:void 0,onPointerDown(e){B.current=!1;let t=N.current,n=ks(e.nativeEvent);if(!t||o||e.defaultPrevented||!Ao(n)||e.button!==0)return;if(re(n)){ne();return}let r={x:e.clientX,y:e.clientY};U(r);let i=H(r);if(i==null)return;Y(O.current[i.thumbIndex],Ds(Zo(t)))?e.preventDefault():ue.request(()=>{ie(i.thumbIndex)}),C(!0),g.current??ae(i,xd,e.nativeEvent),e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0,B.current=YQ(e.pointerType);let a=Zo(t);a.addEventListener(`pointermove`,oe,{passive:!0}),a.addEventListener(`pointerup`,W,{once:!0}),a.addEventListener(`pointercancel`,se,{once:!0})}},a],stateAttributesMapping:j$})}),G$=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=N$();return Z(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:j$})}),K$=()=>()=>{},q$=()=>!0,J$=()=>!1;function Y$(){return(0,ia.useSyncExternalStore)(K$,q$,J$)}function X$(){let[e,t]=_.useState(!1);return _.useEffect(()=>{t(!0)},[]),e}var Z$=ro(18)?Y$:X$;function Q$(){return!Z$()}function $$(e,t,n){return(e-t)*100/(n-t)}var e1=_.createContext(void 0),bte={disableStyleElements:!1};function t1(){return _.useContext(e1)??bte}function n1(e){let{script:t}=e,{nonce:n}=t1();return Q$()?(0,X.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var r1=`data-index`,i1,a1=new Set([...RH,IH,LH]);function o1(e,t,n,r){if(!(t<0))return e.length===2?`${XZ(e[t],r,n)} ${t===0?`start`:`end`} range`:n?XZ(e[t],r,n):void 0}function s1(e,t,n,r,i){let a=e+t*n;return Au(Number(a.toFixed(Math.max(L$(e),L$(t),L$(r)))),r,i)}var c1=_.forwardRef(function(e,t){let{render:n,children:r,className:i,"aria-describedby":a,"aria-label":o,"aria-labelledby":s,"aria-valuetext":c,disabled:l=!1,getAriaLabel:u,getAriaValueText:d,id:f,index:p,inputRef:m,onBlur:h,onFocus:g,onKeyDown:v,tabIndex:y,style:b,...x}=e,S=rH(f),{active:C,lastUsedThumbIndex:w,controlRef:T,disabled:E,validation:D,format:O,handleInputChange:k,inset:A,isArrayValue:j,labelId:M,largeStep:N,locale:P,max:F,min:I,minStepsBetweenValues:L,form:R,name:z,orientation:B,pressedThumbCenterOffsetRef:V,pressedThumbIndexRef:ee,renderBeforeHydration:te,setActive:ne,setIndicatorPosition:re,state:H,step:U,thumbRefs:ie,values:ae}=N$(),oe=Ym(),W=l||E,se=ae.length>1,ce=B===`vertical`,le=oe===`rtl`,{setTouched:ue,validationMode:de}=oQ(),fe=_.useRef(null),pe=_.useRef(null),me=XQ(W,pe),he=_.useRef(!1),ge=J(e=>{he.current||g?.(e)}),_e=J(e=>{he.current||h?.(e)}),ve=rH(),ye=dQ(),G=se?ve:ye,{ref:be,index:xe}=GK({metadata:_.useMemo(()=>({inputId:G}),[G])}),Se=se?p??xe:0,Ce=Se===ae.length-1,we=ae[Se],Te=$$(we,I,F),[Ee,De]=_.useState(),Oe=Q$(),ke=w>=0&&w<ae.length?w:-1,Ae=J(()=>{let e=T.current,t=fe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Te/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;De(s),Se===0?re(e=>[s,e[1]]):Ce&&re(e=>[e[0],s])});q(()=>{A&&queueMicrotask(Ae)},[Ae,A]),q(()=>{A&&Ae()},[Ae,A,Te]),q(()=>{if(!A)return;let e=T.current,t=fe.current;if(!e||!t)return;let n=Do(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Ae);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[T,Ae,A]);let je=ce?`bottom`:`insetInlineStart`,Me=ce?`left`:`top`,Ne;se?C===Se?Ne=2:ke===Se&&(Ne=1):C===Se&&(Ne=1);let Pe;Pe=!A&&!Number.isFinite(Te)?kl:{position:`absolute`,[je]:A?`var(--position)`:`${Te}%`,[Me]:`50%`,translate:`${(ce||!le?-1:1)*50}% ${(ce?1:-1)*50}%`,zIndex:Ne,...A&&{"--position":`${Ee??0}%`,visibility:te&&Oe||Ee===void 0?`hidden`:void 0}};let Fe;ce&&(Fe=le?`vertical-rl`:`vertical-lr`);let Ie=typeof u==`function`?u(Se):o,Le=Wl({"aria-label":Ie,"aria-labelledby":s??(Ie==null?M:void 0),"aria-describedby":a,"aria-orientation":B,"aria-valuenow":we,"aria-valuetext":typeof d==`function`?d(XZ(we,P,O),we,Se):c??o1(ae,Se,O,P),disabled:W,form:R,id:G,max:F,min:I,name:z,onChange(e){k(e.currentTarget.valueAsNumber,Se,e)},onFocus(e){let t=he.current;he.current=!1,ne(Se),me(!0),t&&e.stopPropagation()},onBlur(e){he.current?e.stopPropagation():(ne(-1),!ie.current.some(t=>Y(t,e.relatedTarget))&&(ue(!0),me(!1),de===`onBlur`&&D.commit(O$(we,Se,I,F,j,ae))))},onKeyDown(e){if(e.defaultPrevented||!a1.has(e.key))return;RH.has(e.key)&&e.stopPropagation();let t=null,n=0,r=e.shiftKey?N:U,i=R$(we,U,I);switch(e.key){case jH:n=1;break;case PH:n=le?-1:1;break;case MH:n=-1;break;case NH:n=le?1:-1;break;case IH:r=N,n=1;break;case LH:r=N,n=-1;break;case`End`:t=se&&Number.isFinite(ae[Se+1])?ae[Se+1]-U*L:F;break;case FH:t=se&&Number.isFinite(ae[Se-1])?ae[Se-1]+U*L:I}if(n!==0&&(t=s1(i,r,n,I,F)),t!==null){let n=e.currentTarget;cc(n)||(he.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),k(t,Se,e),e.preventDefault()}},step:U,style:{...kl,width:`100%`,height:`100%`,writingMode:Fe},tabIndex:y,type:`range`,value:we??``},e=>D.getValidationProps(W,e),{onFocus:ge,onBlur:_e,onKeyDown:v}),Re=Ml(pe,D.inputRef,m);return Z(`div`,e,{state:H,ref:[t,be,fe],props:[{[r1]:Se,children:(0,X.jsxs)(_.Fragment,{children:[r,(0,X.jsx)(`input`,{ref:Re,...Le,suppressHydrationWarning:!0}),A&&Ce&&te&&(i1||=(0,X.jsx)(n1,{script:``}))]}),id:S,onPointerDown(e){if(W)return;ee.current=Se;let t=I$(e.currentTarget,ce);V.current=(ce?e.clientY:e.clientX)-t},style:Pe,suppressHydrationWarning:te||void 0},x],stateAttributesMapping:j$})}),l1=_.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=oQ(),{clearErrors:C,elementRef:w,submitCountRef:T}=cQ(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=uQ(),A=dQ({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=J(()=>S.inputRef.current?.value);ZQ(S.inputRef,A,M,N,!E,a),q(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,l,S.inputRef,b]),oH(M,()=>{M!==void 0&&(C(D),v(M!==(y.initialValue??``)),S.change(M))});let P=_.useRef(null),F=XQ(E,P),I=os();return Z(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=fd(md,e.nativeEvent);c?.(t,n),!j&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(g(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:rQ})}),u1=_.forwardRef(function(e,t){return(0,X.jsx)(l1,{ref:t,...e})});function d1({className:e,type:t,...n}){return(0,X.jsx)(u1,{type:t,"data-slot":`input`,className:Q(`h-[26px] w-full min-w-0 rounded-md border-0 bg-input px-2 text-xs text-foreground tabular-nums outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-2 aria-invalid:ring-destructive/40`,e),...n})}var f1=_.createContext(void 0);function p1(){let e=_.useContext(f1);if(e===void 0)throw Error(Za(64));return e}var m1=`data-activation-direction`,h1={tabActivationDirection:e=>({[m1]:e})},g1=_.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=_.useRef([]),[f,p]=_.useState(()=>new Map),[m,h]=NK({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[v,y]=_.useState(()=>new Map),b=_.useRef(void 0),x=_.useCallback(e=>_1(v,e),[v]),[S,C]=_.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:w,tabActivationDirection:T}=S,E=T,D=!1;w!==m&&(E=v1(w,m,a,v),D=w!=null&&m!=null&&x(m)==null);let O=D?w:m,k=w!==O||T!==E;q(()=>{k&&C({previousValue:O,tabActivationDirection:E})},[O,k,E]);let A=J((e,t)=>{t.activationDirection=v1(m,e,a,v),i?.(e,t),!t.isCanceled&&h(()=>e)}),j=J((e,t)=>{i?.(e,fd(t,void 0,void 0,{activationDirection:`none`}))}),M=J((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),N=_.useCallback(e=>f.get(e),[f]),P=_.useCallback(e=>{for(let t of v.values())if(e===t.value)return t.id},[v]),F=_.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:P,getTabPanelIdByValue:N,onValueChange:A,orientation:a,registerMountedTabPanel:M,setTabMap:y,tabActivationDirection:E,value:m}),[x,P,N,A,a,M,y,E,m]),I=_.useMemo(()=>{for(let e of v.values())if(e.value===m)return e},[v,m]),L=_.useMemo(()=>{for(let e of v.values())if(!e.disabled)return e.value},[v]),R=_.useRef(!u),z=_.useRef(r),B=_.useRef(u),V=_.useRef(!1);q(()=>{if(g)return;function e(e,t){h(()=>e),C({previousValue:e,tabActivationDirection:`none`}),j(e,t),R.current=!1}if(v.size===0){V.current&&m!==null&&!b.current?.isConnected&&e(null,Ld);return}V.current=!0,b.current=v.keys().next().value;let t=I?.disabled,n=I==null&&m!==null;if(!t&&m===z.current&&(B.current=!1),B.current&&t&&m===z.current)return;let r=R.current;if(t||n){let n=L??null;if(m===n){R.current=!1;return}let i=Ld;r?i=Rd:t&&(i=Id),e(n,i)}else r&&I!=null&&(j(m,Rd),R.current=!1)},[L,g,j,I,h,v,m]);let ee=Z(`div`,e,{state:{orientation:a,tabActivationDirection:E},ref:t,props:l,stateAttributesMapping:h1});return(0,X.jsx)(f1.Provider,{value:F,children:(0,X.jsx)(mq,{elementsRef:d,children:ee})})});function _1(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function v1(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=_1(r,e),c=_1(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var y1=`data-composite-item-active`,b1=_.createContext(void 0);function x1(){let e=_.useContext(b1);if(e===void 0)throw Error(Za(65));return e}var S1=_.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=p1(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:v}=x1(),{highlightedIndex:y,onHighlightedIndexChange:b}=id(),x=rH(o),{compositeProps:S,compositeRef:C,index:w}=Jq({metadata:_.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=_.useRef(!1),D=_.useRef(null),O=J(e=>{D.current?.(),D.current=e?g(e):null});q(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&y!==w))return;let e=v;if(e!=null){let t=Ds(Zo(e));if(t&&Y(e,t))return}r||b(w)},[T,w,y,b,r,v]);let{getButtonProps:k,buttonRef:A}=sd({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=_.useRef(!1),N=_.useRef(!1);function P(e){f(a,fd(md,e.nativeEvent,void 0,{activationDirection:`none`}))}function F(e){T||r||P(e)}function I(e){T||r||h&&(!M.current||N.current)&&P(e)}function L(e){if(T||r)return;M.current=!0,N.current=e.button===0;let t=Zo(e.currentTarget);function n(){M.current=!1,N.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return Z(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:F,onFocus:I,onPointerDown:L,[y1]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:h1})}),C1=`data-index`,w1={...h1,...Bs},T1=_.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=p1(),p=rH(),{ref:m,index:h}=GK(),g=r===c,{mounted:v,transitionStatus:y,setMounted:b}=Gf(g),x=!v,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:y},w=_.useRef(null),T=Z(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":S,hidden:x,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:du(!g),[C1]:h},s],stateAttributesMapping:w1});return bu({open:g,ref:w,onComplete(){g||b(!1)}}),q(()=>{if(!(p==null||x&&!a))return f(r,p)},[x,a,r,p,f]),a||v?T:null});function E1(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=Ga}=e,[p,m]=_.useState(0),h=r!=null,g=_.useRef(null),v=Ml(g,c),y=_.useRef([]),b=_.useRef(!1),x=_.useRef(null),S=o??p,C=J((e,t=!1)=>{if(x.current=y.current[e]??null,(s??m)(e),t){let t=y.current[e];HH(g.current,t,a,n)}}),w=J(e=>{if(e.size===0)return;if(b.current){let e=y.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||Xc(e,S,d)?C(D1(e,d)):x.current=t}else t!==S&&C(t);return}b.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(Xc(t,S,d)){let e=Yc(t,{disabledIndices:d});Gc(t,e)||C(e)}HH(g.current,r,a,n)});q(()=>{if(d==null||o!=null||!b.current)return;let e=y.current;if(Xc(e,S,d)){let t=Yc(e,{disabledIndices:d});Gc(e,t)||C(t)}},[d,o,S,y,C]);let T=J((e,t,n)=>i?i(e,t,n,y):n),E=J(e=>{let o=e.key===`Home`||e.key===`End`;if(!RH.has(e.key)||!l&&o||O1(e,f)||!g.current)return;let s=a===`rtl`,c=s?NH:PH,p=s?PH:NH,m=n===`vertical`?MH:c,_=n===`vertical`?jH:p,v=ks(e.nativeEvent);if(v!=null&&VH(v)&&!nJ(v)){let t=v.selectionStart,n=v.selectionEnd,r=v.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=S,x=Kc(y,d),w=qc(y,d);r!=null&&(b=r({disabledIndices:d,elementsRef:y,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,y))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,y))):b=Yc(y.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!Gc(y.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))});return{props:{ref:v,onFocus(e){let t=g.current,n=ks(e.nativeEvent);t&&n!=null&&VH(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:y,onMapChange:w,relayKeyboardEvent:E}}function D1(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Xc(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function O1(e,t){for(let n of zH)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function k1(e){let{render:t,className:n,style:r,refs:i=Ga,props:a=Ga,state:o=Ka,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=E1({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:v,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:Ym(),disabledIndices:y,modifierKeys:b}),A=Z(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),j=_.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return(0,X.jsx)(rd.Provider,{value:j,children:(0,X.jsx)(mq,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var A1=_.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=p1(),[d,f]=_.useState(0),[p,m]=_.useState(null),h=_.useRef(new Set),g=_.useRef(new Set),v=_.useRef(null);q(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return v.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[p]);let y=J(e=>(h.current.add(e),()=>{h.current.delete(e)})),b=J(e=>(g.current.add(e),v.current?.observe(e),()=>{g.current.delete(e),v.current?.unobserve(e)})),x={orientation:c,tabActivationDirection:u},S={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},C=_.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:p}),[n,y,b,p]);return(0,X.jsx)(b1.Provider,{value:C,children:(0,X.jsx)(k1,{render:a,className:r,style:o,state:x,refs:[t,m],props:[S,s],stateAttributesMapping:h1,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:Ga})})});function j1({className:e,orientation:t=`horizontal`,...n}){return(0,X.jsx)(g1,{"data-slot":`tabs`,"data-orientation":t,className:Q(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var M1=mg(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function N1({className:e,variant:t=`default`,...n}){return(0,X.jsx)(A1,{"data-slot":`tabs-list`,"data-variant":t,className:Q(M1({variant:t}),e),...n})}function P1({className:e,...t}){return(0,X.jsx)(S1,{"data-slot":`tabs-trigger`,className:Q(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function F1({className:e,...t}){return(0,X.jsx)(T1,{"data-slot":`tabs-content`,className:Q(`flex-1 text-sm outline-none`,e),...t})}var I1={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,1],ArrowDown:[0,-1]};function L1({hsv:e,onChange:t}){let n=n=>{let r=n.currentTarget.getBoundingClientRect();t({h:e.h,s:R1((n.clientX-r.left)/r.width),v:R1(1-(n.clientY-r.top)/r.height)})};return(0,X.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":`Saturation and brightness`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.s*100),"aria-valuetext":`Saturation ${Math.round(e.s*100)}%, brightness ${Math.round(e.v*100)}%`,className:`relative h-[150px] touch-none rounded-[7px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e.h} 100% 50%))`},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.focus(),n(e)},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&n(e)},onKeyDown:n=>{let r=I1[n.key];if(!r)return;n.preventDefault();let i=n.shiftKey?.1:.01;t({h:e.h,s:R1(e.s+r[0]*i),v:R1(e.v+r[1]*i)})},children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,.4)]`,style:{left:`${e.s*100}%`,top:`${(1-e.v)*100}%`}})})}function R1(e){return Math.min(1,Math.max(0,e))}var z1=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function B1(e){let t=z1.exec(e.trim())?.[1];if(!t)return null;let n=t.length<=4?[...t].map(e=>e+e).join(``):t,r=e=>parseInt(n.slice(e,e+2),16);return{r:r(0),g:r(2),b:r(4),a:n.length===8?X1(r(6)/255,3):1}}function V1({r:e,g:t,b:n}){return[e,t,n].map(e=>Math.round(Y1(e,0,255)).toString(16).padStart(2,`0`)).join(``).toUpperCase()}function H1(e){let t=e.trim().toLowerCase(),n=/^rgba?\(([^)]*)\)$/.exec(t);if(n?.[1]){let e=n[1].split(/[\s,/]+/).filter(Boolean).map(Number),[t,r,i,a=1]=e;return t===void 0||r===void 0||i===void 0||e.some(e=>!Number.isFinite(e))?null:{r:t,g:r,b:i,a}}let r=/^color\(srgb ([^)]*)\)$/.exec(t);if(r?.[1]){let e=r[1].split(/[\s/]+/).filter(Boolean).map(Number),[t,n,i,a=1]=e;return t===void 0||n===void 0||i===void 0||e.some(e=>!Number.isFinite(e))?null:{r:t*255,g:n*255,b:i*255,a}}return B1(t)}function U1(e,t){let n=t.ownerDocument.createElement(`span`);if(n.style.color=e,n.style.color===``)return null;n.style.display=`none`,t.append(n);let r=getComputedStyle(n).color;n.remove();let i=H1(r);return i?W1(i):null}function W1({r:e,g:t,b:n}){let[r,i,a]=[e/255,t/255,n/255],o=Math.max(r,i,a),s=o-Math.min(r,i,a);return{h:J1(r,i,a,o,s),s:o===0?0:s/o,v:o}}function G1({h:e,s:t,v:n},r=1){let i=r=>{let i=(r+e/60)%6;return(n-n*t*Math.max(0,Math.min(i,4-i,1)))*255};return{r:i(5),g:i(3),b:i(1),a:r}}function K1({r:e,g:t,b:n}){let[r,i,a]=[e/255,t/255,n/255],o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2,u=c===0?0:c/(1-Math.abs(2*l-1));return{h:J1(r,i,a,o,c),s:u*100,l:l*100}}function q1({h:e,s:t,l:n},r=1){let i=t/100,a=n/100,o=i*Math.min(a,1-a),s=t=>{let n=(t+e/30)%12;return(a-o*Math.max(-1,Math.min(n-3,9-n,1)))*255};return{r:s(0),g:s(8),b:s(4),a:r}}function J1(e,t,n,r,i){return i===0?0:((r===e?(t-n)/i%6:r===t?(n-e)/i+2:(e-t)/i+4)*60+360)%360}function Y1(e,t,n){return Math.min(n,Math.max(t,e))}function X1(e,t){let n=10**t;return Math.round(e*n)/n}var Z1=[{mode:`hex`,label:`Hex`},{mode:`rgb`,label:`RGB`},{mode:`hsl`,label:`HSL`}],Q1=`h-6 rounded-[5px] border-0 text-xs font-medium text-muted-foreground data-active:bg-card data-active:text-foreground data-active:shadow-none data-active:ring-1 data-active:ring-border dark:data-active:bg-card`,$1={style:`unit`,unit:`percent`,maximumFractionDigits:0};function e0(){let e=window.EyeDropper;return e?new e:null}function t0({label:e,color:t,onColor:n,onSubmit:r,tab:i,onTab:a,tokens:o,theme:s,token:c,onToken:l,tokensTab:u=!0}){let[d,f]=(0,_.useState)(`hex`),p=G1(t.hsv),m=V1(p),h=typeof window<`u`&&`EyeDropper`in window,g=e=>n({...t,hsv:e}),v=e=>{let n=W1({...e,a:1});g(n.s===0?{...n,h:t.hsv.h}:n)};return(0,X.jsxs)(j1,{value:i,onValueChange:e=>a(e),className:`gap-0`,children:[u?(0,X.jsxs)(N1,{className:`mb-2.5 h-7 w-full shrink-0 rounded-[7px] p-0.5`,children:[(0,X.jsx)(P1,{value:`custom`,className:Q1,children:`Custom`}),(0,X.jsx)(P1,{value:`tokens`,className:Q1,children:`Tokens`})]}):null,(0,X.jsxs)(F1,{value:`custom`,className:`text-xs`,children:[(0,X.jsx)(L1,{hsv:t.hsv,onChange:g}),(0,X.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2`,children:[h?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Pick a color from the screen`,onClick:()=>{e0()?.open().then(({sRGBHex:e})=>{let t=H1(e);t&&v(t)}).catch(()=>{})},className:`grid size-5 shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(Pr,{"aria-hidden":!0,className:`size-3.5`})}):null,(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1.5`,children:[(0,X.jsx)(n0,{label:`Hue`,value:t.hsv.h,max:360,onChange:e=>g({...t.hsv,h:e}),background:`linear-gradient(to right, red, #ff0, lime, cyan, blue, #f0f, red)`}),(0,X.jsx)(n0,{label:`Opacity`,value:t.percent,max:100,onChange:e=>n({...t,percent:e}),background:`linear-gradient(to right, transparent, #${m}), repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 8px 8px`})]})]}),(0,X.jsxs)(`div`,{className:`mt-2.5 flex gap-1.5`,children:[(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{"aria-label":`Color format`,className:`flex h-[26px] shrink-0 items-center gap-1 rounded-md bg-input px-2 text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[Z1.find(e=>e.mode===d)?.label,(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,X.jsx)(WX,{align:`start`,sideOffset:6,className:`w-28`,children:Z1.map(e=>(0,X.jsx)(uX,{className:KX,onClick:()=>f(e.mode),children:e.label},e.mode))})]}),d===`hex`?(0,X.jsx)(r0,{hex:m,onHex:v,onSubmit:r}):null,(0,X.jsx)(u$,{label:`${e} opacity`,className:`ml-auto w-14 shrink-0`,inputClassName:`text-right`,value:t.percent,min:0,max:100,format:$1,disabled:!1,onCommit:e=>n({...t,percent:e(t.percent)})})]}),d===`rgb`?(0,X.jsx)(i0,{values:[p.r,p.g,p.b].map(Math.round),names:[`Red`,`Green`,`Blue`],maxes:[255,255,255],onChange:([e=0,t=0,n=0])=>v({r:e,g:t,b:n})}):d===`hsl`?(0,X.jsx)(a0,{hsv:t.hsv,onChange:v}):null,o.length>0?(0,X.jsxs)(`div`,{className:`mt-2.5 border-t border-border pt-2`,children:[(0,X.jsx)(`p`,{className:`mb-1.5 text-label font-semibold text-muted-foreground`,children:`Tokens`}),(0,X.jsx)(`div`,{className:`grid grid-cols-7 gap-1.5`,children:o.map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-label":vG(e.name),"aria-pressed":e.name===c,title:vG(e.name),onClick:()=>l(e.name),className:Q(`aspect-square rounded-[5px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 aria-pressed:shadow-[0_0_0_2px_var(--primary)]`,mG),style:{background:e[s]??void 0}},e.name))})]}):null]}),(0,X.jsx)(F1,{value:`tokens`,className:`text-xs`,children:o.length===0?(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`This project names no color tokens.`}):(0,X.jsx)(`ul`,{"aria-label":`${e} tokens`,className:`-mx-1 flex max-h-56 flex-col overflow-y-auto`,children:o.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":e.name===c,onClick:()=>l(e.name),className:`flex h-7 w-full items-center gap-2 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 aria-pressed:bg-accent`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px]`,mG),style:{background:e[s]??void 0}}),vG(e.name)]})},e.name))})})]})}function n0({label:e,value:t,max:n,onChange:r,background:i}){return(0,X.jsx)(F$,{value:t,max:n,onValueChange:e=>r(Array.isArray(e)?e[0]??0:e),children:(0,X.jsx)(W$,{className:`flex h-3.5 touch-none items-center select-none`,children:(0,X.jsx)(G$,{className:`h-2.5 w-full rounded-full select-none`,style:{background:i},children:(0,X.jsx)(c1,{"aria-label":e,className:`size-3.5 rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,.35)] select-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/50`})})})})}function r0({hex:e,onHex:t,onSubmit:n}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(e);if(a!==e){o(e);let t=B1(r);t&&V1(t)===e||i(e)}return(0,X.jsx)(d1,{"aria-label":`Hex`,className:`flex-1`,value:r,spellCheck:!1,onFocus:e=>e.currentTarget.select(),onChange:e=>{let n=e.currentTarget.value;i(n);let r=/^#?[0-9a-f]{6}$/i.test(n.trim())?B1(n):null;r&&t(r)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n())}})}function i0({values:e,names:t,maxes:n,onChange:r}){return(0,X.jsx)(`div`,{className:`mt-1.5 grid grid-cols-3 gap-1`,children:t.map((t,i)=>(0,X.jsx)(u$,{label:t,prefix:t[0],inset:`pl-[26px]`,inputClassName:`pr-1`,value:e[i]??0,min:0,max:n[i],format:{maximumFractionDigits:0},disabled:!1,onCommit:t=>r(e.map((e,n)=>n===i?t(e):e))},t))})}function a0({hsv:e,onChange:t}){let n=K1(G1(e));return(0,X.jsx)(i0,{values:[e.h,n.s,n.l].map(Math.round),names:[`Hue`,`Saturation`,`Lightness`],maxes:[360,100,100],onChange:([e=0,n=0,r=0])=>t(q1({h:e,s:n,l:r}))})}function o0({color:e,className:t}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px]`,mG,e===null&&`border border-dashed border-faint`,t),style:e===null?void 0:{background:e}})}function s0(){return(0,X.jsx)(`span`,{role:`img`,"aria-label":`Raw value, not a token`,title:`Raw value`,children:(0,X.jsx)(zt,{"aria-hidden":!0,className:`size-[13px] text-note`})})}var c0={hsv:{h:0,s:0,v:0},percent:100};function l0({hsv:e,percent:t}){return hG({raw:`#${V1(G1(e)).toLowerCase()}`},t)}var u0={style:`unit`,unit:`percent`,maximumFractionDigits:0};function d0({label:e,value:t,tokens:n,theme:r,disabled:i,onWrite:a,onRemove:o,onPreview:s,currentColor:c}){let l=(0,_.useRef)(null),[u,d]=(0,_.useState)(null),f=t.token?{token:t.token}:{raw:t.value},p=t.token?gG(n,t.token,r):null,m=_G(t,n,r),h=t.token!==null||dG.test(t.value),g=e=>{let n=t.token?p:t.value,r=n?.trim().toLowerCase()===`currentcolor`?c??n:n,i=r&&l.current?U1(r,l.current):null,a=i?{hsv:i,percent:t.percent}:c0;d({tab:e,from:a,color:a})},v=e=>{if(!u)return;d(null);let t=l0(u.color);t!==l0(u.from)&&(e?a(t).then(e=>{e||s?.(null)}):s?.(null))};return(0,X.jsxs)(`div`,{ref:l,className:fG,children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e} color`,disabled:i,onClick:()=>g(`custom`),className:`grid shrink-0 place-items-center rounded-[3px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(o0,{color:m})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e} token`,disabled:i,onClick:()=>g(`tokens`),className:Q(`min-w-0 truncate text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-default`,t.token?pG:`flex-1 tabular-nums`),children:t.token?vG(t.token):t.value.replace(/^#/,``)}),(0,X.jsx)(ZH,{open:u!==null,onOpenChange:(e,t)=>{e||v(t.reason!==`escape-key`)},children:(0,X.jsx)($H,{anchor:l,side:`left`,align:`start`,sideOffset:12,"aria-label":`${e} color picker`,className:`w-[248px] gap-0 rounded-xl p-2.5 text-xs shadow-[0_14px_40px_rgba(0,0,0,.28)]`,children:u?(0,X.jsx)(t0,{label:e,color:u.color,onColor:e=>{d({...u,color:e}),s?.(l0(e))},onSubmit:()=>v(!0),tab:u.tab,onTab:e=>d({...u,tab:e}),tokens:n,theme:r,token:t.token,onToken:e=>{let n=u?.color.percent??t.percent;d(null),s?.(null),a(hG({token:e},n))}}):null})}),(0,X.jsx)(u$,{label:`${e} opacity`,className:`ml-auto w-12 shrink-0`,inputClassName:`h-5 rounded-sm px-1 text-right text-muted-foreground focus-visible:text-foreground`,value:t.percent,min:0,max:100,format:u0,disabled:i||!h,scrubValue:!0,onPreview:e=>s?.(e?hG(f,e(t.percent)):null),onCommit:e=>a(hG(f,e(t.percent)))}),t.token?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Detach ${vG(t.token)}`,title:`Detach the token to its value`,disabled:i||p===null,onClick:()=>{p!==null&&a(hG({raw:p},t.percent))},className:`grid shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(Kn,{"aria-hidden":!0,className:`size-[13px]`})}):(0,X.jsx)(s0,{}),o?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.toLowerCase()}`,title:`Remove the ${e.toLowerCase()}`,disabled:i,onClick:o,className:`grid shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(fr,{"aria-hidden":!0,className:`size-[13px]`})}):null]})}function f0({title:e,add:t,children:n}){let r=`inspector-${e.toLowerCase()}`;return(0,X.jsxs)(`section`,{"aria-labelledby":r,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`h2`,{id:r,className:`text-xs font-semibold`,children:e}),(0,X.jsx)(`button`,{type:`button`,"aria-label":t.label,disabled:t.disabled,onClick:t.onAdd,className:`grid size-5 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,children:(0,X.jsx)(Rr,{"aria-hidden":!0,className:`size-[13px]`})})]}),n?(0,X.jsx)(`div`,{className:`mt-2`,children:n}):null]})}function p0({textOnly:e,color:t,backgroundColor:n,tokens:r,theme:i,inline:a,shorthand:o=!1,disabled:s,write:c,preview:l,currentColor:u}){let d=e?`color`:`background-color`,f=e?t:n,p=f&&f.value.trim().toLowerCase()!==`transparent`?f:null,m=r[0],h=e=>c({kind:`style`,property:d,value:e});return(0,X.jsx)(f0,{title:`Fill`,add:{label:`Add fill`,disabled:s||p!==null||!m,onAdd:()=>{m&&h(`var(${m.name})`)}},children:p?(0,X.jsx)(d0,{label:`Fill`,value:p,tokens:r,theme:i,disabled:s,onWrite:h,onRemove:a?()=>void c({kind:`style`,property:e?`color`:o?`background`:`background-color`,value:``}):e?void 0:()=>void h(`transparent`),onPreview:e=>l?.(d,e),currentColor:u}):null})}var m0={maximumFractionDigits:0},h0={fixed:`Fixed`,hug:`Hug`,fill:`Fill`},g0=new Set([`normal`,`stretch`]);function _0(e,t,n,r,i){let a=e.parent===`vertical`||e.parent===`horizontal`||e.parent===`wrap`,o=a&&e.parent===`vertical`==(t===`height`),s=[];return r===`fixed`?(s.push({property:t,value:`${i??(t===`width`?e.width:e.height)}px`}),o&&n===`fill`&&s.push({property:`flex`,value:`0 1 auto`}),s):r===`fill`?((n===`fixed`||!o&&n===`hug`)&&s.push({property:t,value:`auto`}),s.push(o?{property:`flex`,value:`1 1 0`}:{property:`align-self`,value:`stretch`}),s):a?((n===`fixed`||n===null)&&s.push({property:t,value:`auto`}),o&&(n===`fill`||n===null)&&s.push({property:`flex`,value:`0 1 auto`}),o||s.push({property:`align-self`,value:g0.has(e.parentAlignItems)?`flex-start`:`auto`}),s):(s.push({property:t,value:t===`width`?`fit-content`:`auto`}),s)}function v0({layout:e,size:t,disabled:n,write:r,preview:i}){let a=e.parent===`vertical`||e.parent===`horizontal`||e.parent===`wrap`?[`fixed`,`hug`,`fill`]:[`fixed`,`hug`],o=o=>{let s=o===`width`?e.width:e.height,c=t?.[o]??null,l=o===`width`?`Width`:`Height`,u=(t,n)=>{let i=_0(e,o,c,t,n);return i.length===0?Promise.resolve(!1):r({kind:`styles`,declarations:i})};return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(u$,{label:l,prefix:o===`width`?`W`:`H`,inputClassName:`pr-[44px]`,value:s,min:0,format:m0,disabled:n,onPreview:e=>i?.(o,e?`${Math.max(0,e(s))}px`:null),onCommit:e=>u(`fixed`,Math.max(0,e(s)))}),(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{"aria-label":`${l} mode`,disabled:n||t===null,className:`absolute inset-y-0 right-0 flex items-center gap-px rounded-r-md px-1 text-caption text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[c?h0[c]:`Auto`,(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,X.jsx)(WX,{align:`end`,sideOffset:6,className:`w-auto`,children:(0,X.jsx)(mX,{value:c,onValueChange:e=>{e!==c&&u(e)},children:a.map(e=>(0,X.jsx)(hX,{value:e,closeOnClick:!0,className:`${KX} pr-8`,children:h0[e]},e))})})]})]},o)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Size`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[o(`width`),o(`height`)]})]})}var y0=[{value:`none`,label:`No decoration`,icon:fr},{value:`underline`,label:`Underline`,icon:Wi},{value:`line-through`,label:`Strikethrough`,icon:gi}],b0=[{value:`none`,label:`No case`,icon:fr},{value:`uppercase`,label:`Uppercase`,icon:Dt},{value:`lowercase`,label:`Lowercase`,icon:Ct},{value:`capitalize`,label:`Title case`,icon:Tt}],x0=[{value:`off`,label:`No truncation`,icon:fr},{value:`on`,label:`Truncate text`,icon:un}],S0={on:[{property:`overflow`,value:`hidden`},{property:`text-wrap-mode`,value:`nowrap`},{property:`text-overflow`,value:`ellipsis`}],off:[{property:`overflow`,value:`visible`},{property:`text-wrap-mode`,value:`wrap`},{property:`text-overflow`,value:`clip`}]},C0=[{value:`auto`,name:`Auto`},{value:`balance`,name:`Balance`},{value:`pretty`,name:`Pretty`}];function w0({details:e,disabled:t,write:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=e=>{e.key===`Escape`&&e.target instanceof Node&&a.current?.contains(e.target)&&(e.stopPropagation(),i(!1))},s=C0.find(({value:t})=>t===e.textWrapStyle)??C0[0];return(0,X.jsxs)(ZH,{open:r,onOpenChange:i,children:[(0,X.jsx)(UX,{label:`Type details`,children:(0,X.jsx)(QH,{"aria-label":`Type details`,disabled:t,className:`grid size-[26px] place-items-center rounded-md bg-input text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-expanded:text-foreground`,children:(0,X.jsx)(ci,{"aria-hidden":!0,className:`size-[13px]`})})}),(0,X.jsxs)($H,{side:`bottom`,align:`end`,sideOffset:6,ref:a,initialFocus:a,onKeyDownCapture:o,"aria-label":`Type details`,className:`w-60 gap-2 rounded-[10px] p-2.5 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,children:[(0,X.jsx)(T0,{id:`type-details-decoration`,label:`Decoration`,children:(0,X.jsx)(D0,{labelledBy:`type-details-decoration`,options:y0,current:e.textDecorationLine,disabled:t,onPick:e=>void n({kind:`style`,property:`text-decoration-line`,value:e})})}),(0,X.jsx)(T0,{id:`type-details-case`,label:`Case`,children:(0,X.jsx)(D0,{labelledBy:`type-details-case`,options:b0,current:e.textTransform,disabled:t,onPick:e=>void n({kind:`style`,property:`text-transform`,value:e})})}),(0,X.jsx)(T0,{id:`type-details-truncate`,label:`Truncate`,children:(0,X.jsx)(D0,{labelledBy:`type-details-truncate`,options:x0,current:e.truncated?`on`:`off`,disabled:t||e.display===`inline`,onPick:e=>void n({kind:`styles`,declarations:e===`on`?S0.on:S0.off})})}),(0,X.jsx)(T0,{id:`type-details-wrap`,label:`Wrap`,children:(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{"aria-label":`Wrap`,disabled:t,className:`flex h-[26px] w-24 items-center gap-1 rounded-md bg-input px-2 text-left text-xs text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:s.name}),(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsx)(WX,{align:`end`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,X.jsx)(mX,{value:s.value,onValueChange:e=>{e!==s.value&&n({kind:`style`,property:`text-wrap-style`,value:e})},children:C0.map(({value:e,name:t})=>(0,X.jsx)(hX,{value:e,closeOnClick:!0,className:Q(KX,`pr-8`),children:t},e))})})]})})]})]})}function T0({id:e,label:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex h-[26px] items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{id:e,className:`text-muted-foreground`,children:t}),n]})}var E0={ArrowRight:(e,t)=>(e+1)%t,ArrowDown:(e,t)=>(e+1)%t,ArrowLeft:(e,t)=>(e-1+t)%t,ArrowUp:(e,t)=>(e-1+t)%t,Home:()=>0,End:(e,t)=>t-1};function D0({labelledBy:e,options:t,current:n,disabled:r,onPick:i}){let a=(0,_.useRef)([]),o=t.findIndex(({value:e})=>e===n),s=o===-1?0:o,c=(e,n)=>{let r=E0[e.key];r&&(e.preventDefault(),a.current[r(n,t.length)]?.focus())};return(0,X.jsx)(`div`,{role:`group`,"aria-labelledby":e,className:`flex w-max gap-0.5 rounded-md bg-input p-0.5`,children:t.map(({value:e,label:t,icon:o},l)=>(0,X.jsx)(UX,{label:t,children:(0,X.jsx)(`button`,{ref:e=>{a.current[l]=e},type:`button`,"aria-label":t,"aria-pressed":e===n,tabIndex:l===s?0:-1,disabled:r,onKeyDown:e=>c(e,l),onClick:()=>{e!==n&&i(e)},className:Q(`grid h-[22px] w-7 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,e===n&&`bg-sidebar text-foreground`),children:(0,X.jsx)(o,{"aria-hidden":!0,className:`size-[13px]`})})},e))})}var O0={maximumFractionDigits:0},k0=[{value:`block`,label:`Block`,icon:mi},{value:`vertical`,label:`Vertical`,icon:lt},{value:`horizontal`,label:`Horizontal`,icon:pt},{value:`wrap`,label:`Wrap`,icon:Mi},{value:`grid`,label:`Grid`,icon:Bn}],A0=[{value:`fixed`,label:`Gap between: space items by the Gap value`,icon:Ze},{value:`auto`,label:`Auto gap: spread items with space between`,icon:$e}],j0=[`start`,`center`,`end`],M0={start:`flex-start`,center:`center`,end:`flex-end`};function N0(e){return e===`center`?`center`:[`flex-end`,`end`,`right`,`last baseline`].includes(e)?`end`:`start`}function P0(e,t){let n=[],r=(e,t,r)=>{t!==r&&n.push({property:e,value:t})};return r(`display`,t===`block`?e.inline?`inline-block`:`block`:t===`grid`?e.inline?`inline-grid`:`grid`:e.inline?`inline-flex`:`flex`,F0(e)),(t===`vertical`||t===`horizontal`||t===`wrap`)&&(r(`flex-direction`,t===`vertical`?`column`:`row`,e.direction),r(`flex-wrap`,t===`wrap`?`wrap`:`nowrap`,e.wrap)),n}function F0({flow:e,inline:t}){return e===`grid`?t?`inline-grid`:`grid`:e===`block`?t?`inline-block`:`block`:t?`inline-flex`:`flex`}function I0({layout:e,flow:t,textOnly:n,disabled:r,write:i,preview:a}){let o=t?.rule??null,s=e.flow===`vertical`||e.flow===`horizontal`||e.flow===`wrap`,c=t=>{let n=P0(e,t);n.length>0&&i({kind:`styles`,declarations:n})};return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-layout`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{id:`inspector-layout`,className:`text-xs font-semibold`,children:`Layout`}),o&&o.count>1?(0,X.jsx)(UX,{label:`The flow comes from a rule these elements share. An edit writes this element alone.`,children:(0,X.jsxs)(`span`,{tabIndex:0,className:`min-w-0 truncate text-caption text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,X.jsx)(`code`,{className:`font-mono text-foreground`,children:o.selector}),` · `,`shared by `,o.count,` elements`]})}):null,!n&&e.flow===`block`?(0,X.jsx)(UX,{label:`Add flow`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Add flow`,disabled:r,onClick:()=>c(`vertical`),className:`grid size-5 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(Rr,{"aria-hidden":!0,className:`size-[13px]`})})}):null]}),n?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{id:`inspector-flow`,className:`sr-only`,children:`Flow`}),(0,X.jsx)(D0,{labelledBy:`inspector-flow`,options:k0,current:e.flow,disabled:r,onPick:e=>c(e)})]}),(0,X.jsx)(v0,{layout:e,size:t?.size??null,disabled:r,write:i,preview:a}),s||e.flow===`grid`?(0,X.jsx)(L0,{layout:e,flex:s,disabled:r,write:i,preview:a}):null,(0,X.jsx)(V0,{padding:e.padding,disabled:r,write:i,preview:a})]})}function L0({layout:e,flex:t,disabled:n,write:r,preview:i}){let a=e.flow===`vertical`,o=e.justify===`space-between`,s=a?e.rowGap:e.columnGap,c=(0,X.jsx)(u$,{label:`Gap`,prefix:(0,X.jsx)(U0,{}),inset:`pl-[28px]`,value:s,min:0,format:O0,disabled:n,onPreview:e=>i?.(`gap`,e?`${e(s)}px`:null),onCommit:e=>r({kind:`style`,property:`gap`,value:`${e(s)}px`})});if(!t)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Gap`}),c]});let l=N0(e.justify),u=N0(e.alignItems);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{id:`inspector-alignment-gap`,className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Alignment and gap`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-[62px_1fr] gap-1.5`,children:[(0,X.jsx)(B0,{vertical:a,main:o?null:l,cross:u,disabled:n,onPick:(e,t)=>void r({kind:`styles`,declarations:[{property:`justify-content`,value:M0[e]},{property:`align-items`,value:M0[t]}]})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,(0,X.jsx)(D0,{labelledBy:`inspector-alignment-gap`,options:A0,current:o?`auto`:`fixed`,disabled:n,onPick:t=>void r({kind:`style`,property:`justify-content`,value:t===`auto`?`space-between`:e.ownJustify?``:`flex-start`})})]})]})]})}var R0={ArrowRight:e=>e%3==2?e:e+1,ArrowLeft:e=>e%3==0?e:e-1,ArrowDown:e=>e>=6?e:e+3,ArrowUp:e=>e<3?e:e-3},z0={start:[`top`,`left`],center:[`center`,`center`],end:[`bottom`,`right`]};function B0({vertical:e,main:t,cross:n,disabled:r,onPick:i}){let a=(0,_.useRef)([]),o=(r,i)=>{let a=j0[e?r:i];return j0[e?i:r]===n&&(t===null||a===t)},[s,c]=(0,_.useState)(null),l=Array.from({length:9},(e,t)=>o(Math.floor(t/3),t%3)).indexOf(!0),u=s??(l===-1?0:l),d=(e,t)=>{let n=R0[e.key];n&&(e.preventDefault(),a.current[n(t)]?.focus())};return(0,X.jsx)(`div`,{role:`group`,"aria-label":`Alignment`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||c(null)},className:`grid h-[58px] grid-cols-3 grid-rows-3 rounded-md bg-input p-1`,children:j0.flatMap((t,n)=>j0.map((s,l)=>{let f=e?t:s,p=e?s:t,m=n*3+l,h=o(n,l),g=`Align ${z0[t][0]} ${z0[s][1]}`;return(0,X.jsx)(`button`,{ref:e=>{a.current[m]=e},type:`button`,"aria-label":g,"aria-pressed":h,tabIndex:m===u?0:-1,disabled:r,onFocus:()=>c(m),onKeyDown:e=>d(e,m),onClick:()=>i(f,p),className:`group/cell grid place-items-center rounded-[3px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`rounded-full`,h?`h-0.5 w-2.5 bg-primary`:`size-[3px] bg-muted-foreground/50 group-hover/cell:bg-foreground`)})},`${t}-${s}`)}))})}function V0({padding:e,disabled:t,write:n,preview:r}){let[i,a]=(0,_.useState)(e.left!==e.right||e.top!==e.bottom),o=(i,a,o)=>{let s=o.map(t=>e[t]),[c=0]=s,l=s.every(e=>e===c);return(0,X.jsx)(u$,{label:i,prefix:a,inset:`pl-[28px]`,value:l?c:null,min:0,format:O0,disabled:t,onPreview:t=>{for(let n of o)r?.(`padding-${n}`,t?`${Math.max(0,t(e[n]))}px`:null)},onCommit:t=>n({kind:`styles`,declarations:o.map(n=>({property:`padding-${n}`,value:`${Math.max(0,t(e[n]))}px`}))})},i)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Padding`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr_26px] gap-1.5`,children:[i?(0,X.jsxs)(X.Fragment,{children:[o(`Left padding`,(0,X.jsx)(K0,{side:`left`}),[`left`]),o(`Top padding`,(0,X.jsx)(K0,{side:`top`}),[`top`])]}):(0,X.jsxs)(X.Fragment,{children:[o(`Horizontal padding`,(0,X.jsx)(W0,{vertical:!1}),[`left`,`right`]),o(`Vertical padding`,(0,X.jsx)(W0,{vertical:!0}),[`top`,`bottom`])]}),(0,X.jsx)(UX,{label:`Padding per side`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Padding per side`,"aria-pressed":i,disabled:t,onClick:()=>a(!i),className:Q(`grid h-[26px] place-items-center rounded-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,i&&`bg-input text-foreground`),children:(0,X.jsx)(ei,{"aria-hidden":!0,className:`size-[13px]`})})}),i?(0,X.jsxs)(X.Fragment,{children:[o(`Right padding`,(0,X.jsx)(K0,{side:`right`}),[`right`]),o(`Bottom padding`,(0,X.jsx)(K0,{side:`bottom`}),[`bottom`])]}):null]})]})}function H0({children:e}){return(0,X.jsx)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:e})}function U0(){return(0,X.jsx)(H0,{children:(0,X.jsx)(`path`,{d:`M4 5v14M20 5v14M10 9v6M14 9v6`})})}function W0({vertical:e}){return e?(0,X.jsxs)(H0,{children:[(0,X.jsx)(`path`,{d:`M5 4h14M5 20h14`}),(0,X.jsx)(`rect`,{x:`9`,y:`8`,width:`6`,height:`8`,rx:`1`})]}):(0,X.jsxs)(H0,{children:[(0,X.jsx)(`path`,{d:`M4 5v14M20 5v14`}),(0,X.jsx)(`rect`,{x:`8`,y:`9`,width:`8`,height:`6`,rx:`1`})]})}var G0={top:`M5 4h14`,right:`M20 5v14`,bottom:`M5 20h14`,left:`M4 5v14`};function K0({side:e}){return(0,X.jsxs)(H0,{children:[(0,X.jsx)(`path`,{d:G0[e]}),(0,X.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,opacity:.5})]})}var q0={maximumFractionDigits:0},J0=`Free positions it inside its parent`;function Y0({placement:e,disabled:t,write:n,preview:r,place:i}){let{free:a,left:o,top:s,width:c,height:l}=e,u=e=>{e!==a&&i(e?{left:o,top:s,...c===null?{}:{width:c},...l===null?{}:{height:l}}:null)},d=[{label:`In flow`,on:!a,value:!1},{label:`Free`,on:a,value:!0}];return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-position`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsxs)(`div`,{className:Q(`flex items-center justify-between`,a?`mb-2`:void 0),children:[(0,X.jsx)(`h2`,{id:`inspector-position`,className:`text-xs font-semibold`,children:`Position`}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Placement`,className:`flex gap-0.5 rounded-md bg-input p-0.5`,children:d.map(({label:e,on:n,value:r})=>{let i=(0,X.jsx)(`button`,{type:`button`,"aria-pressed":n,disabled:t,onClick:()=>u(r),className:Q(`flex h-5 items-center rounded-[5px] px-2 text-[11px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,n&&`bg-sidebar text-foreground shadow-xs`),children:e},e);return r?(0,X.jsx)(UX,{label:J0,side:`bottom`,children:i},e):i})})]}),a?(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(u$,{prefix:`X`,label:`X position in its parent`,value:o,format:q0,disabled:t,...GB(`left`,o,e=>`${e}px`,n,r)}),(0,X.jsx)(u$,{prefix:`Y`,label:`Y position in its parent`,value:s,format:q0,disabled:t,...GB(`top`,s,e=>`${e}px`,n,r)})]}):null]})}function X0({boxShadow:e,shadows:t,theme:n,disabled:r,write:i}){let a=!e||e.value.trim().toLowerCase()===`none`,o=a?null:e.token?gG(t,e.token,n):e.value,s=e=>void i({kind:`style`,property:`box-shadow`,value:e});return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-shadow`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-shadow`,className:`mb-2 text-xs font-semibold`,children:`Shadow`}),(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{"aria-label":`Shadow`,disabled:r,className:`${fG} w-full text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,X.jsx)(Z0,{shadow:o}),a?(0,X.jsx)(`span`,{className:`flex-1 text-muted-foreground`,children:`None`}):e.token?(0,X.jsx)(`span`,{className:pG,children:vG(e.token)}):(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:e.value}),!a&&!e.token?(0,X.jsx)(s0,{}):null,(0,X.jsx)(Nt,{"aria-hidden":!0,className:`ml-auto size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsxs)(WX,{align:`start`,sideOffset:6,className:`w-(--anchor-width)`,children:[t.map(e=>(0,X.jsxs)(uX,{className:KX,onClick:()=>s(`var(${e.name})`),children:[(0,X.jsx)(Z0,{shadow:e[n]}),vG(e.name)]},e.name)),t.length>0?(0,X.jsx)(gX,{}):null,(0,X.jsx)(uX,{className:KX,onClick:()=>{a||s(`none`)},children:`None`})]})]})]})}function Z0({shadow:e}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px] bg-sidebar`,mG),style:e?{boxShadow:e}:void 0})}var Q0=`--border`;function $0({bordered:e,borderColor:t,tokens:n,theme:r,inline:i,disabled:a,write:o,preview:s,currentColor:c}){let l=n.find(e=>e.name===Q0)?.name??n[0]?.name,u=e?t??{value:`currentcolor`,token:null,percent:100}:null;return(0,X.jsx)(f0,{title:`Stroke`,add:{label:`Add stroke`,disabled:a||e||l===void 0,onAdd:()=>{l!==void 0&&o({kind:`style`,property:`border`,value:`1px solid var(${l})`})}},children:u?(0,X.jsx)(d0,{label:`Stroke`,value:u,tokens:n,theme:r,disabled:a,onWrite:e=>o({kind:`style`,property:`border-color`,value:e}),onPreview:e=>s?.(`border-color`,e),currentColor:c,onRemove:()=>void o(i?{kind:`style`,property:`border`,value:``}:{kind:`style`,property:`border-style`,value:`none`})}):null})}function e2(e){return(e.split(`,`)[0]??``).trim().replace(/^["']|["']$/g,``)}function t2(e){let t=e2(e).toLowerCase();return HG.find(e=>e.family.toLowerCase()===t)??null}function n2(e){let t=e.flatMap(e=>{let t=e.light??e.dark;return!t||/^-?[\d.]/.test(t.trim())?[]:[{value:`var(${e.name})`,name:e.name.replace(/^--/,``),token:e.name,stack:t}]}),n=HG.map(e=>{let t=/\s/.test(e.family)?`'${e.family}'`:e.family;return{value:t,name:e.family,token:null,stack:t}});return[...t,...n]}function r2(e,t,n){if(t)return n.find(e=>e.token===t)??{value:`var(${t})`,name:t.replace(/^--/,``),token:t,stack:e};let r=t2(e);return n.find(e=>!e.token&&e.name===r?.family)??null}var i2=[{value:100,name:`Thin`},{value:200,name:`Extra Light`},{value:300,name:`Light`},{value:400,name:`Regular`},{value:500,name:`Medium`},{value:600,name:`Semi Bold`},{value:700,name:`Bold`},{value:800,name:`Extra Bold`},{value:900,name:`Black`}];function a2(e){if(!e)return i2;let{min:t,max:n}=e.weights;return i2.filter(({value:e})=>e>=t&&e<=n)}function o2(e,t){return t.find(({value:t})=>t===e)?.name??String(e)}var s2=[{value:`left`,label:`Align text left`,icon:Ai},{value:`center`,label:`Align text center`,icon:wi},{value:`right`,label:`Align text right`,icon:Ei},{value:`justify`,label:`Justify text`,icon:Oi}],c2={maximumFractionDigits:2},l2=1.2;function u2({fonts:e,fontFamily:t,fontToken:n,fontSize:r,fontWeight:i,lineHeight:a,letterSpacing:o,textAlign:s,details:c,disabled:l,write:u,preview:d}){let f=a2(t2(t)),p=n2(e),m=r2(t,n,p);return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-typography`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-typography`,className:`mb-2 text-xs font-semibold`,children:`Typography`}),HG.map(e=>(0,X.jsx)(`link`,{rel:`stylesheet`,href:WG(e)},e.folder)),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(f2,{label:`Font family`,shown:m?.token?(0,X.jsx)(`span`,{className:pG,children:m.name}):m?.name??e2(t),current:m?.value??null,options:p.map(({value:e,name:t,stack:n})=>({value:e,name:t,font:n})),disabled:l,onPick:e=>void u({kind:`style`,property:`font-family`,value:e}),className:`col-span-2`}),(0,X.jsx)(f2,{label:`Font weight`,shown:(0,X.jsxs)(X.Fragment,{children:[o2(i,f),f.some(({value:e})=>e===i)?(0,X.jsx)(d2,{value:i}):null]}),current:String(i),options:f.map(({value:e,name:t})=>({value:String(e),name:t,hint:(0,X.jsx)(d2,{value:e})})),disabled:l,onPick:e=>void u({kind:`style`,property:`font-weight`,value:e})}),(0,X.jsx)(u$,{label:`Font size`,prefix:`Size`,inset:`pl-[40px]`,value:r,min:1,format:c2,disabled:l,...GB(`font-size`,r,e=>`${e}px`,u,d)}),(0,X.jsx)(u$,{label:`Line height`,caption:`Line height`,prefix:(0,X.jsx)(Wn,{"aria-hidden":!0,className:`size-3`,strokeWidth:1.6}),inset:`pl-[28px]`,value:a,empty:`Auto`,min:0,format:c2,disabled:l,...GB(`line-height`,a??Math.round(r*l2),e=>`${e}px`,u,d)}),(0,X.jsx)(u$,{label:`Letter spacing`,caption:`Letter spacing`,prefix:(0,X.jsx)(Hn,{"aria-hidden":!0,className:`size-3`,strokeWidth:1.6}),inset:`pl-[28px]`,value:o,format:c2,disabled:l,...GB(`letter-spacing`,o,e=>`${e}px`,u,d)})]}),(0,X.jsx)(`p`,{id:`inspector-alignment`,className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Alignment`}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(D0,{labelledBy:`inspector-alignment`,options:s2,current:s,disabled:l,onPick:e=>void u({kind:`style`,property:`text-align`,value:e})}),(0,X.jsx)(w0,{details:c,disabled:l,write:u})]})]})}function d2({value:e}){return(0,X.jsx)(`span`,{className:`ml-auto pl-2 text-muted-foreground tabular-nums`,children:e})}function f2({label:e,shown:t,current:n,options:r,disabled:i,onPick:a,className:o}){return(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{"aria-label":e,disabled:i,className:Q(`flex h-[26px] min-w-0 items-center gap-1 rounded-md bg-input px-2 text-left text-xs text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,o),children:[(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center truncate`,children:t}),(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsx)(WX,{align:`start`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,X.jsx)(mX,{value:n,onValueChange:e=>{e!==n&&a(e)},children:r.map(e=>(0,X.jsxs)(hX,{value:e.value,closeOnClick:!0,className:Q(KX,`pr-8`),style:e.font?{fontFamily:e.font}:void 0,children:[e.name,e.hint]},e.value))})})]})}function p2({frame:e}){let t=F(DN,e=>e.scale),n=F(DN,e=>e.theme),[r,i]=(0,_.useState)(!1),a=ON(e.name,{scale:t,theme:n});return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-export`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-export`,className:`mb-2 text-xs font-semibold`,children:`Export`}),(0,X.jsxs)(`div`,{className:`mb-2 grid grid-cols-[70px_1fr] gap-1.5`,children:[(0,X.jsx)(m2,{label:`Export scale`,shown:`${t}x`,value:String(t),options:TN.map(e=>({value:String(e),label:`${e}x`})),onPick:e=>{let t=TN.find(t=>String(t)===e);t&&DN.setState({scale:t})}}),(0,X.jsx)(m2,{label:`Export theme`,shown:EN.find(e=>e.value===n)?.label??``,value:n,options:EN,onPick:e=>{let t=EN.find(t=>t.value===e);t&&DN.setState({theme:t.value})}})]}),(0,X.jsx)(gg,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>{i(!0),kN(e,{scale:t,theme:n}).catch(_k(`Couldn't export ${e.name}`)).finally(()=>i(!1))},className:`w-full bg-transparent text-xs dark:bg-transparent`,children:r?`Exporting`:`Export ${e.name}`}),(0,X.jsxs)(`p`,{className:`mt-1.5 text-caption text-muted-foreground`,children:[`PNG, `,a.join(` and `)]})]})}function m2({label:e,shown:t,value:n,options:r,onPick:i}){return(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{"aria-label":e,className:Q(fG,`min-w-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`),children:[(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:t}),(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,X.jsx)(WX,{align:`start`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,X.jsx)(mX,{value:n,onValueChange:i,children:r.map(e=>(0,X.jsx)(hX,{value:e.value,closeOnClick:!0,className:Q(KX,`pr-8`),children:e.label},e.value))})})]})}function h2({frames:e}){let t=KM(),n=e.map(e=>e.ref),r=e.map(e=>t[e.ref]?.width??e.box.width),i=n.some(e=>t[e]!==void 0),a=_2(r),o=(0,_.useRef)(null),s=e=>{o.current??={widths:r,previews:Object.fromEntries(n.map(e=>[e,t[e]]))};let i=o.current.widths;for(let[t,r]of n.entries()){let n=i[t];n!==void 0&&XM([r],e(n))}};return(0,X.jsxs)(`div`,{role:`group`,"aria-labelledby":`inspector-preview`,className:`mt-2.5`,children:[(0,X.jsxs)(`div`,{className:`mb-1.5 flex h-4 items-center justify-between`,children:[(0,X.jsx)(`span`,{id:`inspector-preview`,className:`text-caption text-muted-foreground`,children:`Preview`}),i?(0,X.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Size unchanged`}):null]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,X.jsx)(`div`,{className:`flex h-[26px] gap-0.5 rounded-md bg-input p-0.5`,children:HN.map(({preset:e,label:t,icon:i})=>{let a=`${UN(e)}, default ${PN[e].width}`,o=r.length>0&&r.every(t=>BN(t)===e);return(0,X.jsx)(UX,{label:`${t}, ${a}`,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Preview at ${t.toLowerCase()} width, ${a}`,"aria-pressed":o,onClick:()=>{for(let[t,i]of n.entries()){let n=r[t];n!==void 0&&XM([i],VN(e,n))}},className:Q(`grid flex-1 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar`,o&&`bg-sidebar text-foreground shadow-xs`),children:(0,X.jsx)(i,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})},e)})}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(u$,{prefix:(0,X.jsx)(br,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6}),label:`Preview width`,value:a,min:1,format:g2,disabled:!1,inputClassName:i?`pr-7`:void 0,onPreview:e=>{if(e){s(e);return}let t=o.current;if(o.current=null,t)for(let[e,n]of Object.entries(t.previews))n?XM([e],n.width):ZM([e])},onCommit:e=>{s(e),o.current=null}}),i?(0,X.jsx)(`span`,{className:`absolute inset-y-0 right-0.5 flex items-center`,children:(0,X.jsx)(UX,{label:`End preview`,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`End preview`,onClick:()=>ZM(n),className:`grid size-6 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar`,children:(0,X.jsx)(Xi,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})})}):null]})]})]})}var g2={maximumFractionDigits:0};function _2(e){let[t]=e;return t!==void 0&&e.every(e=>e===t)?t:null}var v2=[{key:`x`,letter:`X`,label:`X position`},{key:`y`,letter:`Y`,label:`Y position`},{key:`width`,letter:`W`,label:`Width`},{key:`height`,letter:`H`,label:`Height`}],y2=[`frame.fitHeight`];function b2({frames:e,page:t,named:n=!0,write:r=vN,calls:i}){let a=$g(e=>e.canWrite),o=kU(`inspector`),[s]=xe(y2),c=(0,_.useRef)(null),[l]=e;if(!l)return null;let u=e.length>1,d=e.some(e=>e.locked),f=(t,n)=>{let r=c.current??Object.fromEntries(e.map(({ref:e,box:t})=>[e,t])),i={},a={};for(let[e,o]of Object.entries(r)){let r={...o,[t]:n(o[t])};r[t]!==o[t]&&(i[e]=r,a[e]=o)}return{boxes:i,expected:a}},p=(t,n)=>{n?(c.current??=Object.fromEntries(e.map(({ref:e,box:t})=>[e,t])),gN({...c.current,...f(t,n).boxes})):(c.current&&bN(Object.keys(c.current)),c.current=null)},m=(e,n)=>{let{boxes:i,expected:a}=f(e,n),o=c.current;return c.current=null,o&&bN(Object.keys(o).filter(e=>!(e in i))),r(t,i,a)};return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-frame`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(x2,{frames:e,disabled:!a||d,onPick:n=>{let{boxes:i,expected:a}=KN(e,n);r(t,i,a)}}),u||!n?null:o===l.ref?(0,X.jsx)(`div`,{className:`mb-1.5 flex h-[26px] items-center pl-1.5`,children:(0,X.jsx)(KV,{name:l.name,label:`Rename frame ${l.name}`,onCommit:e=>{jU(),MU(l,e,i)},onCancel:jU})}):(0,X.jsx)(`button`,{type:`button`,"aria-label":`Rename frame ${l.name}`,disabled:!a,onClick:()=>AU(l.ref,`inspector`),className:`mb-1.5 block h-[26px] w-full truncate rounded-md bg-input px-2 text-left text-xs outline-none hover:ring-1 hover:ring-border focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:ring-0`,children:l.name}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:v2.map(({key:t,letter:n,label:r})=>{let i=t===`height`&&!u&&s?s:null;return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(u$,{prefix:n,label:r,value:w2(e.map(({box:e})=>e[t])),min:t===`width`||t===`height`?1:void 0,format:S2,disabled:!a||d,inputClassName:i?`pr-7`:void 0,onPreview:e=>p(t,e),onCommit:e=>m(t,e)}),i?(0,X.jsx)(`span`,{className:`absolute inset-y-0 right-0.5 flex items-center`,children:(0,X.jsx)(C2,{action:i})}):null]},t)})}),(0,X.jsx)(h2,{frames:e})]})}function x2({frames:e,disabled:t,onPick:n}){let r=e.map(({box:e})=>qN(e)),[i]=r,a=r.every(e=>e?.name===i?.name),o=a?i?.name:void 0,s=a?i?.label??`Custom`:`Mixed`;return(0,X.jsxs)(`div`,{className:`mb-2 flex h-5 items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{id:`inspector-frame`,className:`-ml-1 text-xs font-semibold`,children:(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{disabled:t,"aria-describedby":`inspector-frame-size`,className:`flex h-5 items-center gap-1 rounded-[5px] px-1 outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:bg-transparent aria-expanded:bg-accent`,children:[e.length>1?`${e.length} frames`:`Frame`,(0,X.jsx)(Nt,{"aria-hidden":!0,className:Q(`size-2.5 text-muted-foreground`,t&&`opacity-0`)})]}),(0,X.jsx)(WX,{align:`start`,sideOffset:4,className:`w-auto min-w-[220px]`,children:WN.map(({group:e,label:t,rows:r},i)=>(0,X.jsxs)(_.Fragment,{children:[i>0?(0,X.jsx)(gX,{}):null,(0,X.jsxs)(mX,{value:r.some(e=>e.name===o)?o:null,onValueChange:e=>{e!==o&&n(e)},children:[(0,X.jsx)(lX,{className:`px-2 text-label font-normal`,children:t}),r.map(e=>(0,X.jsxs)(hX,{value:e.name,closeOnClick:!0,className:Q(KX,`pr-8 whitespace-nowrap`),children:[e.label,(0,X.jsxs)(`span`,{className:`ml-auto pl-2 text-muted-foreground tabular-nums`,children:[e.width,` × `,e.height]})]},e.name))]})]},e))})]})}),(0,X.jsx)(`span`,{id:`inspector-frame-size`,className:`truncate text-muted-foreground`,children:s})]})}var S2={maximumFractionDigits:0};function C2({action:e}){return(0,X.jsx)(UX,{label:e.label,keys:e.keys,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":e.label,disabled:!be(e),onClick:e.run,className:`grid size-6 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar disabled:pointer-events-none disabled:opacity-40`,children:(0,X.jsx)(bn,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})})}function w2(e){let[t]=e;return t!==void 0&&e.every(e=>e===t)?t:null}function T2({colors:e,tokens:t,theme:n}){return e.length===0?null:(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-selection-colors`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-selection-colors`,className:`mb-2 text-xs font-semibold`,children:`Selection colors`}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map(e=>(0,X.jsxs)(`li`,{className:fG,children:[(0,X.jsx)(o0,{color:_G(e,t,n)}),e.token?(0,X.jsx)(`span`,{className:pG,children:vG(e.token)}):(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate tabular-nums`,children:e.value.replace(/^#/,``)}),(0,X.jsxs)(`span`,{className:`ml-auto text-muted-foreground tabular-nums`,children:[e.percent,`%`]}),e.token?(0,X.jsx)(Kn,{role:`img`,"aria-label":`Token`,className:`size-[13px] shrink-0 text-muted-foreground`}):(0,X.jsx)(s0,{})]},`${e.token??e.value}:${e.percent}`))})]})}function E2(){let e=rY(),t=iY(),n=l_(e=>e.mode===`play`),r=l_(e=>e.mode===`edit`&&e.tool===`frame`),i=u_(),a=$g(e=>e.listeners),o=$g(e=>e.claims),s=vP(e=>e.page),c=vP(e=>e.frames),l=vP(e=>e.element??null),u=uN($g(e=>e.board?.projects.flatMap(e=>e.pages).find(e=>e.ref===s))?.frames.filter(e=>c.includes(e.ref))??[]),d=l&&u.length===1?l:null;return(0,X.jsxs)(`aside`,{"aria-label":`Inspector`,"data-inspector":!0,className:`flex h-full min-w-0 flex-col overflow-y-auto bg-sidebar text-body text-sidebar-foreground`,children:[(0,X.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-sidebar-border px-3`,children:[(0,X.jsxs)(`span`,{className:`flex items-center`,children:[(0,X.jsx)(nZ,{name:e,source:t}),(0,X.jsx)(HZ,{listeners:a,claims:o})]}),(0,X.jsx)(lZ,{})]}),i?(0,X.jsx)(`p`,{className:`border-b border-sidebar-border px-3 py-2.5 text-muted-foreground`,children:`View only. Run frameboard open to edit`}):null,r?(0,X.jsx)(M2,{}):s&&u.length>0?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(b2,{page:s,frames:u,named:!d}),u.length>1?(0,X.jsx)(GZ,{}):null,u.length===1&&!d&&u[0]?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A2,{page:s,frame:u[0].ref}),(0,X.jsx)(qZ,{frame:u[0].ref})]}):null,d?(0,X.jsx)(k2,{page:s,element:d}):(0,X.jsx)(j2,{frames:u}),u.length===1&&!d&&u[0]?(0,X.jsx)(p2,{frame:u[0]},u[0].ref):null]}):(0,X.jsx)(`div`,{className:`px-3 pt-2.5 pb-3 text-muted-foreground`,children:n?(0,X.jsx)(`p`,{children:`Playing. Nothing selects while frames take the clicks.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{children:`Select a frame to see its details.`}),(0,X.jsx)(`p`,{className:`mt-4`,children:`Click a frame, or drag on the canvas to select several.`})]})})]})}var D2=`--shadow`;function O2(e){let t=BG(e.split(`/`)[0]??``)?.tokens??[];return{colors:t.filter(e=>e.group===`color`&&!e.name.startsWith(D2)),shadows:t.filter(e=>e.name.startsWith(D2)),fonts:t.filter(e=>e.group===`font`)}}function k2({page:e,element:t}){let n=$g(e=>e.canWrite),r=DM(t.frame),i=rW(t),a=gW(t.frame,t.index,t.hash),{colors:o,shadows:s,fonts:c}=O2(t.frame);if(!i)return(0,X.jsx)(`p`,{className:`px-3 pt-2.5 pb-3 text-muted-foreground`,children:`The element’s details show once its frame is on screen.`});let l=!n,u=n=>BB(e,t,n),d=(e,n)=>yW(t,e,n),f=a?.element;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Y0,{placement:i.placement,disabled:l,write:u,preview:d,place:n=>CV(e,t,n,{inline:i.placement.inline})}),(0,X.jsx)(I0,{layout:i.layout,flow:f?.flow,textOnly:i.textOnly,disabled:l,write:u,preview:d}),(0,X.jsx)(C$,{opacity:i.opacity,radius:i.radius,rotation:i.rotation,disabled:l,write:u,preview:d}),i.holdsText?(0,X.jsx)(u2,{fonts:c,fontFamily:i.fontFamily,fontToken:f?.fontFamily?.token??null,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,textAlign:i.textAlign,details:i,disabled:l,write:u,preview:d}):null,(0,X.jsx)(p0,{textOnly:i.textOnly,color:f?.color??null,backgroundColor:f?.backgroundColor??null,tokens:o,theme:r,inline:i.textOnly?i.inline.color:i.inline.backgroundColor,shorthand:!i.textOnly&&i.inline.background,disabled:l,write:u,preview:d,currentColor:i.color}),i.textOnly?(0,X.jsx)(BV,{text:i.text,disabled:l,write:u,element:t},`${t.frame}\n${t.index}`):null,(0,X.jsx)($0,{bordered:i.bordered,borderColor:f?.borderColor??null,tokens:o,theme:r,inline:i.inline.border,disabled:l,write:u,preview:d,currentColor:i.color}),(0,X.jsx)(X0,{boxShadow:f?.boxShadow??null,shadows:s,theme:r,disabled:l,write:u}),(0,X.jsx)(T2,{colors:a?.colors??[],tokens:o,theme:r})]})}function A2({page:e,frame:t}){let n=$g(e=>e.canWrite),r=DM(t),i=iW(t),a=rW(i),o=gW(t,i?.index,i?.hash??``),{colors:s}=O2(t);return!i||!a?null:(0,X.jsx)(p0,{textOnly:!1,color:null,backgroundColor:o?.element?.backgroundColor??null,tokens:s,theme:r,inline:a.inline.backgroundColor,shorthand:a.inline.background,disabled:!n,write:t=>BB(e,i,t),preview:(e,t)=>yW(i,e,t),currentColor:a.color})}function j2({frames:e}){let[t]=e,n=DM(t?.ref??``),{colors:r}=O2(t?.ref??``),i=e.map(e=>e.ref).join(`
70
+ `),a=$g(e=>i.split(`
71
+ `).map(t=>e.reloads[t]??0).join(`:`)),[o,s]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!0;return Promise.all(i.split(`
72
+ `).map(e=>_W(e).catch(()=>null))).then(t=>{if(!e)return;let n=new Map;for(let e of t.flatMap(e=>e?.colors??[])){let t=`${e.token??e.value.toLowerCase()}:${e.percent}`;n.has(t)||n.set(t,e)}s({refs:i,colors:[...n.values()]})}),()=>{e=!1}},[i,a]),(0,X.jsx)(T2,{colors:o?.refs===i?o.colors:[],tokens:r,theme:n})}function M2(){let e=NG();return(0,X.jsxs)(`section`,{"aria-labelledby":`inspector-presets`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,X.jsx)(`h2`,{id:`inspector-presets`,className:`mb-2 text-xs font-semibold`,children:`Frame`}),(0,X.jsx)(`div`,{className:`-mx-1.5 flex flex-col`,children:WN.map(({group:t,label:n,icon:r,rows:i})=>(0,X.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`inspector-presets-${t}`,className:`flex flex-col`,children:[(0,X.jsx)(`h3`,{id:`inspector-presets-${t}`,className:`px-1.5 pt-1.5 pb-0.5 text-label text-muted-foreground`,children:n}),i.map(t=>(0,X.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t.name===e,onClick:()=>PG(t.name),className:Q(`flex h-[26px] items-center gap-1.5 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50`,t.name===e&&`bg-accent`),children:[(0,X.jsx)(r,{"aria-hidden":!0,className:`size-[13px] text-muted-foreground`,strokeWidth:1.6}),(0,X.jsx)(`span`,{className:`flex-1`,children:t.label}),(0,X.jsxs)(`span`,{className:Q(`tabular-nums`,t.name===e?`text-accent-foreground`:`text-muted-foreground`),children:[t.width,` × `,t.height]})]},t.name))]},t))}),(0,X.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`Click on the canvas to place it.`})]})}var N2=K(`layout-row-glyph`,[[`rect`,{x:`4`,y:`5`,width:`4`,height:`14`,rx:`1`,key:`a`}],[`rect`,{x:`10`,y:`5`,width:`4`,height:`14`,rx:`1`,key:`b`}],[`rect`,{x:`16`,y:`5`,width:`4`,height:`9`,rx:`1`,key:`c`}]]),P2=K(`layout-column-glyph`,[[`rect`,{x:`5`,y:`4`,width:`14`,height:`4`,rx:`1`,key:`a`}],[`rect`,{x:`5`,y:`10`,width:`14`,height:`4`,rx:`1`,key:`b`}],[`rect`,{x:`5`,y:`16`,width:`9`,height:`4`,rx:`1`,key:`c`}]]),F2=K(`grid-glyph`,[[`rect`,{x:`4`,y:`4`,width:`7`,height:`7`,rx:`1`,key:`a`}],[`rect`,{x:`13`,y:`4`,width:`7`,height:`7`,rx:`1`,key:`b`}],[`rect`,{x:`4`,y:`13`,width:`7`,height:`7`,rx:`1`,key:`c`}],[`rect`,{x:`13`,y:`13`,width:`7`,height:`7`,rx:`1`,key:`d`}]]),I2=K(`block-glyph`,[[`rect`,{x:`5`,y:`7`,width:`14`,height:`10`,rx:`1`,key:`a`}]]),L2=K(`placed-glyph`,[[`path`,{d:`M4 8V4h4`,key:`a`}],[`rect`,{x:`8`,y:`8`,width:`12`,height:`10`,rx:`1`,key:`b`}]]),R2={row:N2,column:P2,grid:F2,block:I2};function z2(e){return e.textOnly?Hi:e.tag===`img`||e.tag===`video`?Pn:e.placed?L2:e.tag===`hr`?fr:e.round?Gt:R2[e.layout]}var B2=null;function V2(e,t){let[n=``,r=``]=e.split(`/`),i=p_(n,r);if(B2?.(),B2=null,t(),H2(i)&&b_.attached()){U2();return}let a=b_.onAttach(()=>{b_.attached()&&(a(),B2=null,U2())});B2=a,va(i)}function H2(e){return decodeURIComponent(location.pathname)===decodeURIComponent(e)}function U2(){Se(`view.zoomToSelection`)?.run()}function W2(e,t,n=_P,r=UB){let i=`${e}/${t.page}`,{index:a,hash:o}=t;V2(i,()=>{let e=r(t.ref),s=e!==null&&e!==o&&!mP(t.ref,e);a===null||o===null||s?nP(n,i,[t.ref]):iP(n,i,{frame:t.ref,index:a,hash:o})})}function G2(e,t,n,r=q2){let[i,a]=(0,_.useState)(null),o=(0,_.useRef)(0),s=(0,_.useRef)(n);(0,_.useEffect)(()=>{s.current=n},[n]);let c=$g(t=>K2(t.reloads,e)),l=t.trim()===``,u=`${c}\n${e}\n${t}`;if((0,_.useEffect)(()=>{let n=++o.current;if(l)return;let i=setTimeout(()=>{r(e,t).then(e=>{n===o.current&&a({key:u,status:`ready`,result:e,lead:s.current})},e=>{if(n!==o.current)return;let t=e instanceof Error?e.message:String(e);a({key:u,status:`refused`,message:t})})},120);return()=>clearTimeout(i)},[e,t,l,u,r]),l)return{status:`idle`};if(i?.status===`ready`){let{result:e,lead:t}=i;return{status:`ready`,result:e,lead:t,updating:i.key!==u}}return i?.status===`refused`&&i.key===u?i:{status:`loading`}}function K2(e,t){let n=0;for(let[r,i]of Object.entries(e))r.startsWith(`${t}/`)&&(n+=i);return n}async function q2(e,t,n=fetch){let r=await n(`/api/find?${new URLSearchParams({project:e,q:t})}`),i=await r.json().catch(()=>null);if(!i)throw Error(`The board answered ${r.status}.`);if(!i.ok)throw Error(i.error.message);return i.data}var J2=[{value:`all`,label:`All`},{value:`frame`,label:`Frames`},{value:`element`,label:`Elements`},{value:`text`,label:`Text`}],Y2={frame:En,element:I2,text:Hi},X2={frame:`frame`,element:`element`,text:`text`};function Z2({project:e,page:t,load:n,pick:r=W2,trees:i=wB}){let[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(`all`),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(null),f=RZ(e=>e.focusRequest),p=G2(e,a,t,n),m=(0,_.useId)();(0,_.useEffect)(()=>{d.current?.focus(),d.current?.select()},[f]);let h=r4(p.status===`ready`?p.result.hits.filter(e=>s===`all`||e.kind===s):[],p.status===`ready`?p.lead:``),g=h.flatMap(e=>e.hits),v=g.find(e=>i4(e)===l)??g[0]??null,y=e=>`${m}-${i4(e)}`,b=t=>{u(i4(t)),r(e,t)};return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col text-xs`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),BZ())},children:[(0,X.jsxs)(`div`,{className:`m-2 flex shrink-0 items-center gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-[7px] bg-muted px-2 focus-within:ring-[1.5px] focus-within:ring-primary`,children:[(0,X.jsx)(ii,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,X.jsx)(`input`,{ref:d,role:`combobox`,"aria-label":`Find in ${e}`,"aria-expanded":g.length>0,"aria-controls":m,"aria-autocomplete":`list`,"aria-activedescendant":v?y(v):void 0,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),g.length===0)return;let t=v?g.indexOf(v):-1,n=e.key===`ArrowDown`?1:-1,r=g[(t+n+g.length)%g.length];r&&u(i4(r))}else e.key===`Enter`&&v&&(e.preventDefault(),b(v))},spellCheck:!1,autoComplete:`off`,className:`min-w-0 flex-1 bg-transparent text-xs text-foreground outline-none`})]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":a===``?`Close find`:`Clear the search`,onClick:()=>{a===``?BZ():(o(``),d.current?.focus())},className:`grid size-[26px] shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 active:bg-accent`,children:(0,X.jsx)(Xi,{"aria-hidden":!0,className:`size-3.5`})})]}),(0,X.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex shrink-0 gap-1 px-2 pb-1.5`,children:J2.map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-pressed":s===e.value,onClick:()=>c(e.value),className:Q(`flex h-[22px] items-center rounded-full px-2 text-[11px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,s===e.value?`bg-foreground text-sidebar`:`bg-muted text-muted-foreground hover:bg-accent hover:text-foreground`),children:e.label},e.value))}),(0,X.jsx)(`div`,{id:m,role:`listbox`,"aria-label":`Matches`,"aria-busy":p.status===`ready`&&p.updating,className:Q(`min-h-0 overflow-y-auto pb-1`,p.status===`ready`&&p.updating&&`opacity-60`),children:h.map(e=>(0,X.jsxs)(`div`,{role:`group`,"aria-labelledby":`${m}-${e.page}`,children:[(0,X.jsxs)(`div`,{className:`flex justify-between px-3 pt-2 pb-0.5 text-[11px] font-semibold text-muted-foreground`,children:[(0,X.jsx)(`span`,{id:`${m}-${e.page}`,children:e.page}),(0,X.jsx)(`span`,{children:e.hits.length})]}),e.hits.map(e=>(0,X.jsx)(Q2,{id:y(e),hit:e,query:a,active:e===v,onPick:()=>b(e),trees:i},i4(e)))]},e.page))}),(0,X.jsx)(t4,{answer:p,project:e,shown:g.length,filter:s,onShowAll:()=>c(`all`)}),(0,X.jsx)(`p`,{className:`shrink-0 px-3 pt-2 pb-3 text-[11px] text-muted-foreground`,children:`Esc goes back to the layers`})]})}function Q2({id:e,hit:t,query:n,active:r,onPick:i,trees:a}){let o=e4(t,a),s=t.kind===`text`?`Text in ${t.frame}`:(0,X.jsx)(n4,{text:t.name,query:n}),c=t.kind===`text`?(0,X.jsxs)(X.Fragment,{children:[`“`,(0,X.jsx)(n4,{text:t.snippet??``,query:n}),`”`]}):t.kind===`element`?`in ${t.frame}`:X2.frame;return(0,X.jsxs)(`div`,{id:e,role:`option`,"aria-selected":r,onMouseDown:e=>e.preventDefault(),onClick:i,className:Q(`mx-1.5 flex items-start gap-2 rounded-md px-2 py-[5px] text-foreground hover:bg-sidebar-accent`,r&&`bg-accent`),children:[(0,X.jsx)($2,{icon:o?z2(o):Y2[t.kind]}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`truncate`,children:s}),(0,X.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:c})]})]})}function $2({icon:e}){return(0,X.jsx)(e,{"aria-hidden":!0,className:`mt-px size-[13px] shrink-0 text-muted-foreground`})}function e4(e,t){let n=e.kind===`frame`?null:e.ref,r=$g(e=>n?e.reloads[n]??0:0);(0,_.useEffect)(()=>{n&&t.request(n,r)},[n,r,t]);let i=F(t.store,e=>n?e.byRef[n]:void 0);return i?.status!==`ready`||i.tree.hash!==e.hash?null:i.tree.elements.find(({index:t})=>t===e.index)??null}function t4({answer:e,project:t,shown:n,filter:r,onShowAll:i}){let a=`shrink-0 px-3 pt-2 text-[11px]`;if(e.status===`idle`)return(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Type to find frames, elements, and text across every page of `,t,`.`]});if(e.status===`loading`)return null;if(e.status===`refused`)return(0,X.jsx)(`p`,{role:`alert`,className:Q(a,`text-destructive`),children:e.message});let{hits:o,truncated:s,query:c}=e.result;return o.length===0?(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Nothing in `,t,` matches “`,c.trim(),`”.`]}):n===0&&r!==`all`?(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[s?`The first ${o.length} matches hold no ${X2[r]}. Type more to narrow them.`:`No ${X2[r]} matches.`,` `,(0,X.jsx)(`button`,{type:`button`,onClick:i,className:`text-foreground underline underline-offset-2 outline-none hover:text-primary focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Show all`})]}):s?(0,X.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Showing the first `,o.length,` matches. Type more to narrow them.`]}):null}function n4({text:e,query:t}){let n=t.trim().toLowerCase(),r=n===``?-1:e.toLowerCase().indexOf(n);return r===-1?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsxs)(X.Fragment,{children:[e.slice(0,r),(0,X.jsx)(`mark`,{className:`rounded-[2px] bg-primary/35 text-foreground`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function r4(e,t){let n=[];for(let t of e){let e=n.find(e=>e.page===t.page);e?e.hits.push(t):n.push({page:t.page,hits:[t]})}let r=n.findIndex(e=>e.page===t);return r>0&&n.unshift(...n.splice(r,1)),n}function i4(e){return`${e.kind}:${e.ref}:${e.index??``}`}function a4(e){let t=(0,_.useRef)(!1);return{onKeyDown:e=>{if(!(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey))return;e.preventDefault(),e.stopPropagation(),t.current=!0;let n=e.currentTarget.getBoundingClientRect();e.currentTarget.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,clientX:n.left+n.width/2,clientY:n.top+n.height/2}))},onOpenChangeComplete:n=>{n&&t.current&&(t.current=!1,e.current?.querySelector(`[role="menuitem"]:not([aria-disabled="true"])`)?.focus())}}}var o4=[`view.zoomToSelection`,`frame.duplicate`,`frame.hide`,`frame.lock`,`frame.delete`];function s4({frame:e,page:t,trigger:n}){let r=xe(o4),[i,a,o,s,c]=vP(n=>n.page===t&&!n.element&&n.frames.includes(e.ref))?r:r.map(()=>void 0),l=$g(e=>e.canWrite),u=(0,_.useRef)(null),d=a4(u);return(0,X.jsxs)(dJ,{onOpenChange:n=>{if(!n||e.hidden||c_.getState().mode!==`edit`)return;let{page:r,frames:i,element:a}=_P.getState();(a||r!==t||!i.includes(e.ref))&&nP(_P,t,[e.ref])},onOpenChangeComplete:d.onOpenChangeComplete,children:[(0,X.jsx)(fJ,{render:n,onKeyDown:d.onKeyDown}),(0,X.jsxs)(pJ,{ref:u,className:`w-55`,children:[(0,X.jsxs)(mJ,{children:[(0,X.jsx)(xJ,{children:`Frame in layers`}),(0,X.jsx)(yJ,{action:i,children:`Zoom to frame`}),(0,X.jsx)(yJ,{action:{id:`layers.rename`,label:`Rename`,group:`frame`,palette:!1,enabled:()=>l&&c_.getState().mode===`edit`,run:()=>AU(e.ref,`layers`)}}),(0,X.jsx)(yJ,{action:a,children:`Duplicate`}),(0,X.jsx)(yJ,{action:o,children:`Hide`}),(0,X.jsx)(yJ,{action:s,children:s?.checked?.()?`Unlock`:`Lock`})]}),(0,X.jsx)(_J,{}),(0,X.jsx)(bJ,{action:c})]})]})}var c4=[`section.delete`];function l4({section:e,page:t,trigger:n}){let[r]=xe(c4),i=$g(e=>e.canWrite),a=(0,_.useRef)(null),o=a4(a);return(0,X.jsxs)(dJ,{onOpenChange:n=>{n&&c_.getState().mode===`edit`&&rP(_P,t,e.name)},onOpenChangeComplete:o.onOpenChangeComplete,children:[(0,X.jsx)(fJ,{render:n,onKeyDown:o.onKeyDown}),(0,X.jsxs)(pJ,{ref:a,className:`w-55`,children:[(0,X.jsxs)(mJ,{children:[(0,X.jsx)(xJ,{children:`Section`}),(0,X.jsx)(yJ,{action:{id:`layers.renameSection`,label:`Rename`,group:`section`,palette:!1,enabled:()=>i&&c_.getState().mode===`edit`,run:()=>TG(e.name)}})]}),(0,X.jsx)(_J,{}),(0,X.jsx)(bJ,{action:r})]})]})}function u4({page:e,element:t,trigger:n}){let r=(0,_.useRef)(null),i=a4(r);return(0,X.jsxs)(dJ,{onOpenChange:n=>{n&&iP(_P,e,t)},onOpenChangeComplete:i.onOpenChangeComplete,children:[(0,X.jsx)(fJ,{render:n,onKeyDown:i.onKeyDown}),(0,X.jsx)(pJ,{ref:r,className:`w-[230px]`,children:(0,X.jsx)(kJ,{noteable:!1})})]})}function d4({edge:e}){return e===null?null:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`pointer-events-none absolute right-1.5 left-5 z-10 h-0.5 rounded-[1px] bg-primary`,`before:absolute before:-top-[3px] before:-left-[5px] before:size-2 before:rounded-full before:border-2 before:border-primary before:bg-sidebar before:content-['']`,e===`top`?`-top-px`:`-bottom-px`)})}function f4(e){return e[p4]??null}var p4=Symbol(`closestEdge`);function m4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?m4(Object(n),!0).forEach(function(t){gA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var g4={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}};function _4(e,t){var n=t.element,r=t.input,i=t.allowedEdges,a={x:r.clientX,y:r.clientY},o=n.getBoundingClientRect(),s=i.map(function(e){return{edge:e,value:g4[e](o,a)}}).sort(function(e,t){return e.value-t.value})[0]?.edge??null;return h4(h4({},e),{},gA({},p4,s))}function v4(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(t===-1||r===-1||t===r)return t;if(n==null)return r;var a=i===`vertical`&&n===`bottom`||i===`horizontal`&&n===`right`;return t<r?a?r:r-1:a?r+1:r}function y4(e,t){return e.list===t&&typeof e.index==`number`}function b4(e,{list:t,index:n,enabled:r}){let[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let i=e.current;if(!i||!r)return;let o={list:t,index:n};return sj(Nj({element:i,getInitialData:()=>o}),jj({element:i,canDrop:({source:e})=>y4(e.data,t),getData:({input:e})=>_4(o,{element:i,input:e,allowedEdges:[`top`,`bottom`]}),onDrag:({self:e,source:t})=>{let r=f4(e.data),i=t.data.index,o=i===n||r===`top`&&i===n-1||r===`bottom`&&i===n+1;a(o?null:r)},onDragLeave:()=>a(null),onDrop:()=>a(null)}))},[e,t,n,r]),i}function x4(e,t){(0,_.useEffect)(()=>Mj({canMonitor:({source:t})=>typeof e==`string`?y4(t.data,e):typeof t.data.list==`string`&&e(t.data.list)&&y4(t.data,t.data.list),onDrop:({source:e,location:n})=>{let r=n.current.dropTargets[0],i=e.data.list;if(!r||!y4(r.data,i))return;let a=e.data.index,o=v4({startIndex:a,indexOfTarget:r.data.index,closestEdgeOfTarget:f4(r.data),axis:`vertical`});o!==a&&t(a,o,i)}}),[e,t])}var S4=14,C4=8;function w4(e,t){return`elements\n${e}\n${t??``}`}function T4({frame:e,page:t,selected:n,frameSelected:r,isOpen:i,toggle:a}){let o=EB(e.ref),s=$g(e=>e.canWrite),[c,l]=(0,_.useState)(null),u=o?.status===`ready`?o.tree:null,d=w4(e.ref,null).slice(0,-1);if(x4((0,_.useCallback)(e=>e.startsWith(d),[d]),(0,_.useCallback)((n,r,i)=>{let a=u?.elements.filter(t=>w4(e.ref,t.parent)===i)[n];u&&a&&gV(t,{frame:e.ref,index:a.index,hash:u.hash},()=>r)},[u,e.ref,t])),!o||o.status===`loading`)return(0,X.jsx)(O4,{depth:1,children:`Reading elements`});if(o.status===`refused`)return(0,X.jsx)(O4,{depth:1,title:o.message,children:`This frame cannot be addressed`});let f=A4(o.tree.elements,i);if(f.length===0)return(0,X.jsx)(O4,{depth:1,children:`No elements`});let p=new Set(o.tree.elements.map(e=>e.parent)),m=k4(o.tree.elements);return(0,X.jsx)(`ul`,{"aria-label":`Elements of ${e.name}`,children:f.map(({element:u,depth:d})=>(0,X.jsx)(E4,{page:t,element:u,elementKey:{frame:e.ref,index:u.index,hash:o.tree.hash},depth:d,place:m.get(u.index)??0,list:w4(e.ref,u.parent),open:i(u.index),holds:p.has(u.index),toggle:()=>a(u.index),tint:u.index===n?`bg-primary/26`:r?`bg-primary/13`:n===null?`hover:bg-accent`:`bg-primary/7`,isSelected:u.index===n,canWrite:s,renaming:c===u.index,setRenaming:e=>l(e?u.index:null)},u.index))})}function E4({page:e,element:t,elementKey:n,depth:r,place:i,list:a,open:o,holds:s,toggle:c,tint:l,isSelected:u,canWrite:d,renaming:f,setRenaming:p}){let m=(0,_.useRef)(null),h=b4(m,{list:a,index:i,enabled:d&&!f}),g=(0,X.jsx)(D4,{icon:z2(t),selected:u});return(0,X.jsx)(u4,{page:e,element:n,trigger:(0,X.jsxs)(`li`,{ref:m,className:Q(`relative flex h-[26px] items-center gap-1.5 pr-2 text-foreground`,l),style:{paddingLeft:C4+r*S4},children:[(0,X.jsx)(d4,{edge:h}),s?(0,X.jsx)(`button`,{type:`button`,"aria-label":`${o?`Hide`:`Show`} what ${t.name} holds`,"aria-expanded":o,onClick:c,className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:o?(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`}):(0,X.jsx)(Ft,{"aria-hidden":!0,className:`size-2.5`})}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:`w-2.5 shrink-0`}),f?(0,X.jsxs)(X.Fragment,{children:[g,(0,X.jsx)(KV,{hug:!0,name:t.name,label:`Rename ${t.name}`,onCommit:t=>{p(!1),BB(e,n,{kind:`attribute`,name:`data-name`,value:t})},onCancel:()=>p(!1)})]}):(0,X.jsxs)(`button`,{type:`button`,"aria-current":u?`true`:void 0,onClick:()=>iP(_P,e,n),onDoubleClick:()=>{d&&p(!0)},onKeyDown:e=>{e.key===`F2`&&d&&(e.preventDefault(),e.stopPropagation(),p(!0))},className:`flex min-w-0 flex-1 items-center gap-1.5 self-stretch text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[g,(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:t.name,children:t.name})]})]})})}function D4({icon:e,selected:t}){return(0,X.jsx)(e,{"aria-hidden":!0,className:Q(`size-[13px] shrink-0`,t?`text-primary`:`text-muted-foreground`)})}function O4({depth:e,title:t,children:n}){return(0,X.jsx)(`p`,{title:t,className:`flex h-[26px] items-center truncate pr-2 text-muted-foreground`,style:{paddingLeft:C4+e*S4+16},children:n})}function k4(e){let t=new Map,n=new Map;for(let r of e){let e=t.get(r.parent)??0;n.set(r.index,e),t.set(r.parent,e+1)}return n}function A4(e,t){let n=new Map,r=[];for(let i of e){if(i.parent===null){n.set(i.index,1),r.push({element:i,depth:1});continue}let e=n.get(i.parent);e!==void 0&&t(i.parent)&&(n.set(i.index,e+1),r.push({element:i,depth:e+1}))}return r}function j4({id:e,title:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex h-[29px] items-center justify-between px-3 pt-1 text-label text-muted-foreground`,children:[(0,X.jsx)(`h2`,{id:e,children:t}),n]})}function M4({section:e,page:t,open:n,onToggle:r,selected:i,canWrite:a,calls:o,children:s}){let c=wG()===e.name,l=e.frames.length,u=(0,X.jsx)(Er,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`});return(0,X.jsxs)(`li`,{"aria-label":`Section ${e.name}`,className:`flex flex-col`,children:[(0,X.jsx)(`div`,{className:`mx-1.5 overflow-hidden rounded-md`,children:(0,X.jsx)(l4,{section:e,page:t,trigger:(0,X.jsxs)(`div`,{className:Q(`group flex h-[26px] items-center gap-1.5 pr-1 pl-2 text-foreground`,i?`bg-primary/26`:`hover:bg-accent`),children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":`${n?`Hide`:`Show`} the frames of ${e.name}`,"aria-expanded":n,onClick:r,className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:n?(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`}):(0,X.jsx)(Ft,{"aria-hidden":!0,className:`size-2.5`})}),c?(0,X.jsxs)(X.Fragment,{children:[u,(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,X.jsx)(KV,{hug:!0,name:e.name,label:`Rename section ${e.name}`,onCommit:n=>{EG(),n!==e.name&&o.renameSection(t,e.name,n).then(e=>rP(_P,t,e.name)).catch(_k(`Couldn't rename ${e.name}`))},onCancel:EG})})]}):(0,X.jsxs)(`button`,{type:`button`,"aria-label":`Select section ${e.name}`,onClick:()=>{c_.getState().mode===`edit`&&(rP(_P,t,e.name),b_.reveal(e.box))},onDoubleClick:()=>{a&&TG(e.name)},onKeyDown:t=>{t.key===`F2`&&a&&(t.preventDefault(),t.stopPropagation(),TG(e.name))},className:`flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-[5px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[u,(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,X.jsx)(`span`,{"aria-label":`${l} frame${l===1?``:`s`}`,className:`shrink-0 pr-1.5 text-[color-mix(in_srgb,var(--muted-foreground)_70%,var(--foreground))] tabular-nums`,children:l})]})]})})}),n&&l>0?(0,X.jsx)(`ul`,{"aria-label":`Frames of ${e.name}`,className:`flex flex-col pl-3.5`,children:s}):null]})}var N4=`layers`,P4=`layers:section:`,F4=e=>e===N4||e.startsWith(P4),I4=[];function L4({frames:e,sections:t=I4,calls:n=uk}){let[r,i]=(0,_.useState)(new Set),[a,o]=(0,_.useState)(new Set),s=vP(e=>e.page),c=vP(e=>e.section),l=vP(e=>e.frames),u=vP(e=>e.element??null),d=$g(e=>e.canWrite);J4(i);let f=q4(e,t);x4(F4,(0,_.useCallback)((r,i,a)=>{let o=q4(e,t).find(e=>e.list===a),s=o?.rows[r];if(!o||!s)return;let c=o.rows.filter(e=>e.ref!==s.ref),l=e.filter(e=>e.ref!==s.ref),u=c[i],d=c[i-1],f=u?l.findIndex(e=>e.ref===u.ref)+1:d?l.findIndex(e=>e.ref===d.ref):0;n.orderFrame(s.ref,f).catch(_k(`Couldn't move ${s.name}`))},[e,t,n]));let p=e=>r.has(e),m=e=>i(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),h=(e,t,r)=>{let i=p(e.ref),a=u?.frame===e.ref,o=!a&&s===G4(e)&&l.includes(e.ref);return(0,X.jsx)(U4,{frame:e,index:t,list:r,canWrite:d,calls:n,tint:o?`bg-primary/26`:a?`bg-primary/7`:void 0,chevron:(0,X.jsx)(`button`,{type:`button`,"aria-label":`${i?`Hide`:`Show`} the elements of ${e.name}`,"aria-expanded":i,onClick:()=>m(e.ref),className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:i?(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-2.5`}):(0,X.jsx)(Ft,{"aria-hidden":!0,className:`size-2.5`})}),children:i?(0,X.jsx)(T4,{frame:e,page:G4(e),selected:a?u?.index??null:null,frameSelected:o,isOpen:t=>p(W4(e.ref,t)),toggle:t=>m(W4(e.ref,t))}):null},e.ref)};return(0,X.jsxs)(`section`,{"aria-labelledby":`layers-heading`,className:`flex min-h-0 flex-col`,children:[(0,X.jsx)(j4,{id:`layers-heading`,title:`Layers`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Collapse all layers`,title:`Collapse all layers`,onClick:()=>{i(new Set),o(new Set(t.map(e=>e.name)))},className:`group/target grid size-6 place-items-center text-muted-foreground outline-none hover:text-foreground`,children:(0,X.jsx)(`span`,{className:`grid size-5 place-items-center rounded-md group-hover/target:bg-accent group-focus-visible/target:ring-3 group-focus-visible/target:ring-ring/50`,children:(0,X.jsx)(Xn,{"aria-hidden":!0,className:`size-[15px]`})})})}),e.length===0?(0,X.jsx)(`p`,{className:`px-3.5 py-1 text-muted-foreground`,children:`No frames on this page`}):(0,X.jsx)(`ul`,{className:`flex min-h-0 flex-col overflow-y-auto pb-1`,children:f.map(t=>{let r=t.rows.map((e,n)=>h(e,n,t.list));if(!t.section)return r;let{section:i}=t,s=t.rows.some(e=>l.includes(e.ref)||u?.frame===e.ref);return(0,X.jsx)(M4,{section:i,page:K4(e),open:!a.has(i.name)||s,onToggle:()=>o(e=>{let t=new Set(e);return t.delete(i.name)||t.add(i.name),t}),selected:c===i.name,canWrite:d,calls:n,children:r},`${P4}${i.name}`)})})]})}var R4=`group/target grid size-6 shrink-0 place-items-center outline-none hover:text-foreground disabled:pointer-events-none`,z4=`text-[color-mix(in_srgb,var(--muted-foreground)_70%,var(--foreground))]`,B4=`grid size-5 place-items-center rounded-[5px] group-hover/target:bg-accent group-focus-visible/target:ring-2 group-focus-visible/target:ring-ring/50`,V4=`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`,H4={hidden:[`show`,`hide`],locked:[`unlock`,`lock`]};function U4({frame:e,index:t,list:n,canWrite:r,calls:i,tint:a,chevron:o,children:s}){let c=(0,_.useRef)(null),l=kU(`layers`)===e.ref,u=$g(t=>t.claims[e.ref]),d=J_(t=>e.ref in t.unseen),f=b4(c,{list:n,index:t,enabled:r&&!l}),p=t=>{if(e.hidden||c_.getState().mode!==`edit`)return;t.shiftKey?aP(_P,G4(e),e.ref):nP(_P,G4(e),[e.ref]);let[n]=mN([e]);n&&_P.getState().frames.includes(e.ref)&&b_.reveal(n.box)},m=(t,n)=>i.flagFrames([e.ref],t,n).catch(_k(`Couldn't ${H4[t][+!!n]} ${e.name}`)),h=(0,X.jsx)(En,{"aria-hidden":!0,className:Q(`size-[13px] shrink-0`,e.hidden?z4:`text-muted-foreground`)});return(0,X.jsxs)(`li`,{ref:c,"aria-label":e.hidden?`${e.name}, hidden`:e.name,className:`relative mx-1.5`,children:[(0,X.jsx)(d4,{edge:f}),(0,X.jsxs)(`div`,{className:`flex flex-col overflow-hidden rounded-md`,children:[(0,X.jsx)(s4,{frame:e,page:G4(e),trigger:(0,X.jsxs)(`div`,{className:Q(`group flex h-[26px] items-center gap-1.5 pr-1 pl-2 text-foreground`,e.hidden&&z4,a??`hover:bg-accent`),children:[o,l?(0,X.jsxs)(X.Fragment,{children:[h,(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,X.jsx)(KV,{hug:!0,name:e.name,label:`Rename frame ${e.name}`,onCommit:t=>{jU(),MU(e,t,i)},onCancel:jU})})]}):(0,X.jsxs)(`button`,{type:`button`,"aria-label":`Select ${e.name}`,onClick:p,onDoubleClick:()=>{r&&AU(e.ref,`layers`)},onKeyDown:t=>{t.key===`F2`&&r&&(t.preventDefault(),t.stopPropagation(),AU(e.ref,`layers`))},className:`flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-[5px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[h,(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]}),u?(0,X.jsx)(`span`,{role:`img`,"aria-label":`${u.tag} is editing`,className:`ml-auto size-[7px] shrink-0 rounded-full bg-claim shadow-[0_0_0_3px_color-mix(in_srgb,var(--claim)_25%,transparent)]`}):d?(0,X.jsx)(gU,{}):null,(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e.hidden?`Show`:`Hide`} ${e.name}`,"aria-pressed":e.hidden,disabled:!r,onClick:()=>void m(`hidden`,!e.hidden),className:Q(R4,e.hidden?z4:Q(`text-muted-foreground`,V4)),children:(0,X.jsx)(`span`,{className:B4,children:e.hidden?(0,X.jsx)(fn,{"aria-hidden":!0,className:`size-[13px]`}):(0,X.jsx)(mn,{"aria-hidden":!0,className:`size-[13px]`})})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`${e.locked?`Unlock`:`Lock`} ${e.name}`,"aria-pressed":e.locked,disabled:!r,onClick:()=>void m(`locked`,!e.locked),className:Q(R4,`text-muted-foreground`,!e.locked&&V4),children:(0,X.jsx)(`span`,{className:B4,children:e.locked?(0,X.jsx)(or,{"aria-hidden":!0,className:`size-[13px]`}):(0,X.jsx)(ir,{"aria-hidden":!0,className:`size-[13px]`})})})]})}),s]})]})}function W4(e,t){return`${e}#${t}`}function G4(e){return`${e.project}/${e.page}`}function K4(e){let[t]=e;return t?G4(t):``}function q4(e,t){let n=[...e].reverse(),r=new Set(t.flatMap(e=>e.frames));return[...[...t].reverse().map(e=>({list:`${P4}${e.name}`,section:e,rows:n.filter(t=>e.frames.includes(t.name))})),{list:N4,rows:n.filter(e=>!r.has(e.name))}]}function J4(e){(0,_.useEffect)(()=>{let t=null,n=()=>{let n=t;if(!n)return;let r=TB(n.frame),i=[n.frame];if(r){t=null;for(let e=jB(r.elements,n.index);typeof e==`number`;e=jB(r.elements,e))i.push(W4(n.frame,e))}e(e=>i.every(t=>e.has(t))?e:new Set([...e,...i]))},r=_P.subscribe((e,r)=>{e.element&&e.element!==r.element&&(t=e.element,n())}),i=wB.store.subscribe(n);return()=>{i(),r()}},[e])}function Y4({count:e,className:t}){return e===0?null:(0,X.jsx)(`span`,{role:`img`,"aria-label":`${e} unseen ${e===1?`change`:`changes`}`,"data-unseen-count":!0,className:Q(`shrink-0 text-[11px] font-semibold text-claim`,t),children:e})}var X4=[`page.rename`,`page.duplicate`,`page.new`,`page.moveUp`,`page.moveDown`,`page.delete`];function Z4({onOpen:e,trigger:t}){let[n,r,i,a,o,s]=xe(X4),c=(0,_.useRef)(null),l=a4(c);return(0,X.jsxs)(dJ,{onOpenChange:t=>{t&&e()},onOpenChangeComplete:l.onOpenChangeComplete,children:[(0,X.jsx)(fJ,{render:t,onKeyDown:l.onKeyDown}),(0,X.jsxs)(pJ,{ref:c,children:[(0,X.jsxs)(mJ,{children:[(0,X.jsx)(xJ,{children:`Page`}),(0,X.jsx)(yJ,{action:n,children:`Rename`}),(0,X.jsx)(yJ,{action:r,children:`Duplicate`}),(0,X.jsx)(yJ,{action:i,children:`New page below`})]}),(0,X.jsx)(_J,{}),(0,X.jsxs)(mJ,{children:[(0,X.jsx)(yJ,{action:a,children:`Move up`}),(0,X.jsx)(yJ,{action:o,children:`Move down`})]}),(0,X.jsx)(_J,{}),(0,X.jsx)(bJ,{action:s})]})]})}var Q4=`pages`,$4=`group/target grid size-6 place-items-center text-muted-foreground outline-none hover:text-foreground aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-pressed:text-foreground`,e3=`grid size-5 place-items-center rounded-md group-hover/target:bg-accent group-focus-visible/target:ring-3 group-focus-visible/target:ring-ring/50 group-aria-disabled/target:bg-transparent group-aria-pressed/target:bg-accent`;function t3({pages:e,current:t,calls:n=uk}){let[,r]=Na(),i={current:t,navigate:r,calls:n},[a]=xe([`page.new`]),o=a?be(a):!1,s=$g(e=>e.canWrite),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),f=u.trim().toLowerCase(),p=f?e.filter(e=>e.name.toLowerCase().includes(f)):e;x4(Q4,(0,_.useCallback)((t,r)=>{let i=e[t];i&&n.movePage(i.ref,r).catch(_k(`Couldn't move ${i.name}`))},[e,n]));let m=()=>{l(!1),d(``)};return(0,X.jsxs)(`nav`,{"aria-labelledby":`pages-heading`,className:`flex h-full min-h-0 flex-col`,children:[(0,X.jsx)(j4,{id:`pages-heading`,title:`Pages`,children:(0,X.jsxs)(`span`,{className:`flex gap-0.5`,children:[(0,X.jsx)(UX,{label:`Search pages`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Search pages`,"aria-pressed":c,onClick:()=>c?m():l(!0),className:$4,children:(0,X.jsx)(`span`,{className:e3,children:(0,X.jsx)(ii,{"aria-hidden":!0,className:`size-[13px]`})})})}),(0,X.jsx)(UX,{label:a?.label??`Add page`,keys:a?.keys,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":a?.label??`Add page`,"aria-disabled":!o||void 0,onClick:()=>{a&&o&&a.run()},className:$4,children:(0,X.jsx)(`span`,{className:e3,children:(0,X.jsx)(Rr,{"aria-hidden":!0,className:`size-[13px]`})})})})]})}),c?(0,X.jsxs)(`div`,{className:`mx-2 mb-1.5 flex h-[26px] shrink-0 items-center gap-1.5 rounded-md bg-muted px-2 ring-[1.5px] ring-primary`,children:[(0,X.jsx)(ii,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`}),(0,X.jsx)(`input`,{autoFocus:!0,"aria-label":`Search pages`,value:u,spellCheck:!1,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())},className:`min-w-0 flex-1 bg-transparent text-foreground outline-none`}),(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`Esc`})]}):null,p.length===0&&f?(0,X.jsxs)(`p`,{className:`px-3.5 py-1 text-muted-foreground`,children:[`No page names match `,u.trim()]}):(0,X.jsx)(`ul`,{className:`flex min-h-0 flex-col mt-[3px] overflow-y-auto pt-1 pb-0.5`,children:p.map(t=>(0,X.jsx)(r3,{page:t,pages:e,context:i,needle:f,canWrite:s},t.ref))})]})}var n3=`mx-1.5 flex h-[26px] items-center gap-1.5 rounded-md pr-2 pl-2 text-foreground`;function r3({page:e,pages:t,context:n,needle:r,canWrite:i}){let{current:a}=n,o=(0,_.useRef)(null),s=e.name===a;(0,_.useEffect)(()=>{s&&o.current?.scrollIntoView({block:`nearest`})},[s]);let c=mk()===e.ref,l=J_(t=>B_(t.unseen,e.ref)),u=b4(o,{list:Q4,index:e.index,enabled:i&&!r&&!c});return(0,X.jsxs)(`li`,{ref:o,className:`relative`,children:[(0,X.jsx)(d4,{edge:u}),c?(0,X.jsx)(`div`,{className:Q(n3,e.name===a&&`bg-accent`),children:(0,X.jsx)(KV,{hug:!0,name:e.name,label:`Rename page ${e.name}`,onCommit:t=>{gk(),yk(e,t,n)},onCancel:gk})}):(0,X.jsx)(Z4,{onOpen:()=>{e.name!==a&&n.navigate(p_(e.project,e.name))},trigger:(0,X.jsxs)(Ba,{href:p_(e.project,e.name),"aria-current":e.name===a?`page`:void 0,draggable:!1,onDoubleClick:()=>{i&&hk(e.ref)},onKeyDown:r=>{if(i){if(r.key===`F2`)hk(e.ref);else if(r.key===`Delete`||r.key===`Backspace`)bk(e,t,n);else return;r.preventDefault(),r.stopPropagation()}},className:Q(n3,`outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset aria-[current=page]:bg-accent`),children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:(0,X.jsx)(i3,{name:e.name,needle:r})}),(0,X.jsx)(Y4,{count:l}),e.layoutError?(0,X.jsx)(Ii,{role:`img`,"aria-label":`Layout does not read`,className:`size-3.5 shrink-0 text-note`,children:(0,X.jsx)(`title`,{children:`Layout does not read`})}):null]})})]})}function i3({name:e,needle:t}){let n=t?e.toLowerCase().indexOf(t):-1;return n<0?e:(0,X.jsxs)(X.Fragment,{children:[e.slice(0,n),(0,X.jsx)(`mark`,{className:`rounded-[2px] bg-primary/30 text-inherit`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function a3(e){return`frameboard.board.pages.${e}`}var o3=26,s3=12,c3=64;function l3(e){return 36+e*o3+s3}var u3=`h-6 rounded-[5px] border-0 text-xs font-medium text-muted-foreground data-active:bg-card data-active:text-foreground data-active:shadow-none data-active:ring-1 data-active:ring-border dark:data-active:bg-card`;function d3({project:e,page:t,theme:n,assets:r,storage:i,calls:a}){let o=RZ(e=>e.open),s=a3(e.name),c=fx({id:s,onlySaveAfterUserInteractions:!0,storage:i}),l=_x(),u=(0,_.useRef)(!1),d=l3(Math.min(Math.max(e.pages.length,4),8)),[f,p]=(0,_.useState)(`design`),m=!o&&f===`design`,h=(0,_.useRef)({project:e.name,pages:e.pages.length});(0,_.useEffect)(()=>{if(!m)return;let t=requestAnimationFrame(()=>{let t=l.current;if(!t)return;let n=h.current;h.current={project:e.name,pages:e.pages.length},n.project!==e.name||e.pages.length<=n.pages||t.getSize().inPixels>d-1||(u.current=!0,t.resize(d))});return()=>cancelAnimationFrame(t)},[m,e.name,e.pages.length,d,l]);let g=e.pages.find(e=>e.name===t),v=g?.frames??[];return(0,X.jsxs)(`aside`,{"aria-label":`Pages and layers`,className:`flex h-full min-w-0 flex-col bg-sidebar text-sidebar-foreground`,children:[(0,X.jsx)(ZX,{project:e,page:t,calls:a}),o?(0,X.jsx)(Z2,{project:e.name,page:t}):(0,X.jsxs)(j1,{value:f,onValueChange:e=>p(String(e)),className:`min-h-0 flex-1 gap-0`,children:[(0,X.jsxs)(N1,{className:`m-2 h-7 w-auto shrink-0 rounded-[7px] p-0.5`,children:[(0,X.jsx)(P1,{value:`design`,className:u3,children:`Design`}),(0,X.jsx)(P1,{value:`theme`,disabled:!n,className:u3,children:`Theme`}),(0,X.jsx)(P1,{value:`assets`,disabled:!r,className:u3,children:`Assets`})]}),(0,X.jsx)(F1,{value:`design`,className:`flex min-h-0 flex-col text-xs`,children:(0,X.jsxs)(xx,{id:s,orientation:`vertical`,defaultLayout:c.defaultLayout,onLayoutChanged:(e,t)=>{c.onLayoutChanged(e,u.current?{...t,isUserInteraction:!0}:t),u.current=!1},children:[(0,X.jsx)(Sx,{id:`pages`,panelRef:l,defaultSize:d,minSize:c3,children:(0,X.jsx)(t3,{pages:e.pages,current:t,calls:a})}),(0,X.jsx)(Cx,{"aria-label":`Resize the pages list`,disableDoubleClick:!0,onDoubleClick:()=>{let e=l.current;!e||Math.abs(e.getSize().inPixels-d)<1||(u.current=!0,e.resize(d))},className:`group cursor-row-resize aria-[orientation=horizontal]:h-[9px] border-t border-sidebar-border bg-transparent after:hidden focus-visible:ring-0 data-[separator=active]:border-t-2 data-[separator=active]:border-faint focus-visible:border-t-2 focus-visible:border-primary`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-[3px] w-7 rounded-[2px] bg-faint group-data-[separator=active]:bg-muted-foreground group-focus-visible:bg-primary`})}),(0,X.jsx)(Sx,{id:`layers`,minSize:c3,children:(0,X.jsx)(L4,{frames:v,sections:g?.sections,calls:a})})]},s)}),(0,X.jsx)(F1,{value:`theme`,className:`min-h-0 text-xs`,children:n}),(0,X.jsx)(F1,{value:`assets`,className:`min-h-0 text-xs`,children:r})]})]})}var f3=[`color`,`radius`,`font`,`other`],p3=hO({name:FD(),group:SO(f3),light:FD().nullable(),dark:FD().nullable(),sheet:FD(),overrides:sO()});hO({sheets:pO(hO({path:FD(),kind:SO([`board`,`project`]),error:FD().nullable(),hash:FD()})),tokens:pO(p3)});var m3=`mx-1.5 grid h-7 items-center gap-1.5 rounded-md px-1.5`;function h3({row:e,fromProject:t,editable:n,onWrite:r}){let i=(0,_.useRef)(null);return(0,X.jsxs)(`li`,{ref:i,className:Q(m3,`grid-cols-[1fr_18px_18px]`),children:[(0,X.jsx)(v3,{row:e,fromProject:t,editable:n,onWrite:r}),[`light`,`dark`].map(t=>n?(0,X.jsx)(C3,{name:e.name,side:t,value:e[t],row:i,onWrite:r},t):(0,X.jsx)(b3,{side:t,value:e[t]},t))]})}function g3({row:e,fromProject:t,editable:n,onWrite:r}){let i=e.light??e.dark??``,a=_3.exec(i.trim());return(0,X.jsxs)(`li`,{className:Q(m3,`grid-cols-[1fr_auto]`),children:[(0,X.jsx)(v3,{row:e,fromProject:t,editable:n,onWrite:r}),n?a?(0,X.jsx)(w3,{name:e.name,value:Number(a[1]),unit:a[2]??``,onWrite:r}):(0,X.jsx)(T3,{name:e.name,value:i,shown:E3(e),onWrite:r}):(0,X.jsx)(`span`,{className:`max-w-32 truncate text-muted-foreground`,title:E3(e),children:E3(e)})]})}var _3=/^(-?\d*\.?\d+)([a-z%]*)$/i;function v3({row:e,fromProject:t,editable:n,onWrite:r}){return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:[(0,X.jsx)(`span`,{className:`text-faint`,children:`--`}),e.name.replace(/^--/,``)]}),(0,X.jsx)(`span`,{className:Q(`shrink-0 rounded-[3px] border px-1 text-[9px] leading-[14px]`,t?`border-primary text-foreground`:`border-border text-muted-foreground`),children:t?`Project`:`Board`}),n&&e.overrides?(0,X.jsx)(`button`,{type:`button`,"aria-label":`Reset ${e.name.replace(/^--/,``)} to the board value`,title:`Reset to the board value`,onClick:()=>void r({name:e.name,reset:!0}),className:`-ml-1 grid size-6 shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(Wr,{"aria-hidden":!0,className:`size-3`})}):null]})}var y3={light:`Light`,dark:`Dark`};function b3({side:e,value:t}){return t===null?(0,X.jsx)(`span`,{role:`img`,"aria-label":`${y3[e]}: not set`,title:`Not set in ${e}`,className:`size-4 rounded-[4px] border border-dashed border-faint`}):(0,X.jsx)(`span`,{role:`img`,"aria-label":`${y3[e]}: ${t}`,title:t,className:Q(`size-4 rounded-[4px]`,mG),style:{background:t}})}var x3={hsv:{h:0,s:0,v:0},percent:100};function S3({hsv:e,percent:t}){return hG({raw:`#${V1(G1(e)).toLowerCase()}`},t)}function C3({name:e,side:t,value:n,row:r,onWrite:i}){let a=(0,_.useRef)(null),[o,s]=(0,_.useState)(null),c=y3[t],l=o?S3(o.color):n,u=()=>{let e=n&&a.current?U1(n,a.current):null,t=e?{hsv:e,percent:100}:x3;s({from:t,color:t})},d=n=>{if(!o)return;s(null);let r=S3(o.color);n&&r!==S3(o.from)&&i({name:e,side:t,value:r})};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{ref:a,type:`button`,"aria-label":`${c}: ${n??`not set`}`,title:n??`Not set in ${t}`,onClick:u,className:`-m-[3px] grid size-6 place-items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-4 rounded-[4px]`,l===null?`border border-dashed border-faint`:mG),style:l===null?void 0:{background:l}})}),(0,X.jsx)(ZH,{open:o!==null,onOpenChange:(e,t)=>{e||d(t.reason!==`escape-key`)},children:(0,X.jsx)($H,{anchor:r,side:`right`,align:`start`,sideOffset:16,"aria-label":`${e.replace(/^--/,``)} ${t} color`,className:`w-[248px] gap-0 rounded-xl p-2.5 text-xs shadow-[0_14px_40px_rgba(0,0,0,.28)]`,children:o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`mb-2 text-xs font-semibold`,children:c}),(0,X.jsx)(t0,{label:c,color:o.color,onColor:e=>s({...o,color:e}),onSubmit:()=>d(!0),tab:`custom`,onTab:()=>{},tokens:[],theme:t,token:null,onToken:()=>{},tokensTab:!1})]}):null})})]})}function w3({name:e,value:t,unit:n,onWrite:r}){return(0,X.jsxs)(`span`,{className:`flex items-center text-muted-foreground`,children:[(0,X.jsx)(u$,{label:`${e.replace(/^--/,``)} value`,className:`w-12`,inputClassName:`h-5 rounded-sm px-1 text-right text-muted-foreground focus-visible:text-foreground`,value:t,min:t>=0?0:void 0,format:{maximumFractionDigits:3},disabled:!1,scrubValue:!0,onCommit:i=>r({name:e,side:`both`,value:`${i(t)}${n}`})}),n]})}function T3({name:e,value:t,shown:n,onWrite:r}){let[i,a]=(0,_.useState)(null),o=(0,_.useRef)(!1),s=(0,_.useRef)(!1),c=`${e.replace(/^--/,``)} value`,l=(n,c)=>{if(i===null||s.current)return;s.current=!0,o.current=c,a(null);let l=i.trim();n&&l!==``&&l!==t.trim()&&r({name:e,side:`both`,value:l})};return i===null?(0,X.jsx)(`button`,{ref:e=>{e&&o.current&&(o.current=!1,e.focus())},type:`button`,"aria-label":`${c}: ${t}`,title:t,onClick:()=>{s.current=!1,a(t)},className:`max-w-32 truncate rounded-sm px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:n}):(0,X.jsx)(`input`,{"aria-label":c,autoFocus:!0,value:i,spellCheck:!1,onFocus:e=>e.currentTarget.select(),onChange:e=>a(e.currentTarget.value),onBlur:()=>l(!0,!1),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),l(!0,!0)):e.key===`Escape`&&(e.preventDefault(),l(!1,!0))},className:`h-5 w-32 rounded-sm bg-input px-1 text-right outline-none focus-visible:ring-2 focus-visible:ring-ring/50`})}function E3(e){let t=e.light??e.dark??``;return e.group===`font`?t.split(`,`)[0]?.trim().replace(/^["']|["']$/g,``)??t:t}async function D3(e,t,n,{send:r=fetch,notify:i=e=>_g.add({...e,type:`error`})}={}){try{return await Tx(`/api/tokens/edit`,{project:e,hash:t,...n},`POST`,r)}catch(e){return i({title:`Couldn't change ${n.name.replace(/^--/,``)}`,description:e instanceof wx&&e.code===`stale-tokens`?`The token sheet changed since the tab read it. Try again on the value it shows now.`:e instanceof Error?e.message:String(e)}),null}}var O3={color:`Color`,radius:`Radius`,font:`Font`,other:`Other`},k3=`font-mono text-label font-normal text-foreground`;function A3({project:e,load:t=VG,write:n=D3}){let r=BG(e,t),i=$g(e=>e.canWrite),a=(0,_.useRef)(Promise.resolve()),o=(0,_.useRef)({});if(r===void 0)return null;if(r===null)return(0,X.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The tokens did not load. Reload the board to try again.`});if(r.sheets.length===0)return(0,X.jsx)(j3,{});let s=r.sheets.find(e=>e.kind===`board`),c=r.sheets.find(e=>e.kind===`project`),l=s?.path.startsWith(`/`)??!1,u={project:i&&(c?.error??null)===null,board:i&&s!==void 0&&s.error===null&&!l},d={project:c?.hash??null,board:s?.hash??null},f=t=>r=>{let i=a.current.then(async()=>{let i=d[t],a=o.current[t],s=await n(e,a&&a.over===i?a.hash:i,{...r,sheet:t});return s&&(o.current={...o.current,[t]:{over:i,hash:s.hash}}),s!==null});return a.current=i,i},p={project:f(`project`),board:f(`board`)};return(0,X.jsxs)(`div`,{className:`flex flex-col pb-2`,children:[(0,X.jsxs)(`p`,{className:`mx-3 mt-1 mb-2 rounded-lg bg-muted px-2.5 py-2 leading-[1.45] text-muted-foreground`,children:[`From`,` `,s?(0,X.jsxs)(X.Fragment,{children:[`board `,(0,X.jsx)(`code`,{className:k3,children:s.path}),c?`, overridden by `:null]}):null,c?(0,X.jsxs)(X.Fragment,{children:[`project `,(0,X.jsx)(`code`,{className:k3,children:c.path})]}):null,`.`,u.project||u.board?` Click a value to edit it.`:null,i&&l?` Board values stay read-only here, since that sheet sits outside the board folder.`:null]}),r.sheets.filter(e=>e.error!==null).map(e=>(0,X.jsxs)(`p`,{role:`alert`,className:`mx-3 mb-2 leading-[1.45] text-destructive`,children:[(0,X.jsx)(`code`,{className:k3,children:e.path}),` does not parse, so its tokens are missing here: `,e.error,`. Fix the file or ask the agent.`]},e.path)),r.tokens.length===0?(0,X.jsx)(`p`,{className:`mx-3 text-muted-foreground`,children:`These sheets set no tokens under :root, [data-theme], or .dark.`}):null,f3.map(e=>{let t=r.tokens.filter(t=>t.group===e);if(t.length===0)return null;let n=e===`color`?h3:g3;return(0,X.jsxs)(`section`,{"aria-labelledby":`tokens-${e}`,children:[(0,X.jsx)(`h3`,{id:`tokens-${e}`,className:`px-3 pt-2.5 pb-1 text-label text-muted-foreground`,children:O3[e]}),e===`color`?(0,X.jsx)(M3,{}):null,(0,X.jsx)(`ul`,{children:t.map(e=>{let t=e.sheet===c?.path?`project`:`board`;return(0,X.jsx)(n,{row:e,fromProject:t===`project`,editable:u[t],onWrite:p[t]},e.name)})})]},e)})]})}function j3(){return(0,X.jsxs)(`div`,{className:`m-3 rounded-[10px] border border-dashed border-border p-4 leading-normal text-muted-foreground`,children:[(0,X.jsx)(`p`,{className:`mb-1 font-semibold text-foreground`,children:`No tokens yet`}),`Frames render unstyled until a token sheet exists. Add one at`,` `,(0,X.jsx)(`code`,{className:k3,children:`tokens.css`}),` in this project, or in the board folder for every project.`]})}function M3(){return(0,X.jsxs)(`div`,{"aria-hidden":!0,className:`grid grid-cols-[1fr_18px_18px] gap-1.5 px-3 py-1 text-center text-[10px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{}),(0,X.jsx)(`span`,{children:`L`}),(0,X.jsx)(`span`,{children:`D`})]})}function N3(e=_P,t=Qg){let n=()=>e.getState().frames,r=e=>qM(e)?.width??tv(t.getState().board,e)?.width;return[...HN.map(({preset:e,label:t,icon:i})=>{let a=`Preview at ${t.toLowerCase()} width`;return{id:`preview.${e}`,label:a,group:`preview`,command:{label:a,icon:i,hint:()=>UN(e)},enabled:()=>n().length>0,checked:()=>n().length>0&&n().every(t=>{let n=r(t);return n!==void 0&&BN(n)===e}),run:()=>{for(let t of n())XM([t],VN(e,r(t)??0))}}}),{id:`preview.end`,label:`End preview`,group:`preview`,command:{label:`End preview`,icon:br},enabled:()=>n().some(e=>qM(e)!==void 0),run:()=>ZM(n())}]}function P3(){(0,_.useEffect)(()=>{let e=ye(N3()),t=[_P.subscribe(G),YM(G),nN(Qg)];return()=>{for(let e of t)e();e()}},[])}var F3={defaultSize:240,minSize:200,maxSize:400},I3=[],L3=[],R3=`frameboard.board.panels`;function z3({project:e,page:t}){let n=$g(t=>t.board?.projects.find(t=>t.name===e)),r=$g(e=>e.reloads),i=$g(e=>e.findings),a=$g(e=>e.claims),o=$g(e=>e.focus),s=(0,_.useCallback)(()=>Qg.setState({focus:null}),[]),c=l_(e=>e.hideUi),l=l_(e=>e.mode===`play`),u=fx({id:R3,panelIds:c?[`canvas`]:[`left`,`canvas`,`right`],onlySaveAfterUserInteractions:!0,storage:V3}),d=n?.pages.find(e=>e.name===t),f=$g(e=>d?Mg(e.aliases,d.ref):``),[,p]=Na();(0,_.useEffect)(()=>{if(t!==void 0)return Qg.subscribe((n,r)=>{let i=zg(r,n,`${e}/${t}`);if(i===null)return;let[a=``,o=``]=i.split(`/`);p(p_(a,o),{replace:!0})})},[e,t,p]);let m=(0,_.useCallback)(()=>e,[e]),h=(0,_.useCallback)(()=>p(`/`),[p]);if(Gk(m,{onDeleted:h}),Uk(h),Wk(uk,h),CP(),xk(e,t),PU(d?.ref??``,d?.frames??I3),zG(),jG(d?.ref??``,d?.frames??I3,d?.sections??L3),xv(),lU(),$_(),VZ(),P3(),!n)return(0,X.jsx)(B3,{message:`No project ${e} on this board.`});let g=n.pages[0];return t===void 0&&g?(0,X.jsx)(Ua,{to:p_(e,g.name),replace:!0}):(0,X.jsxs)(xx,{id:`board`,className:`text-body`,defaultLayout:u.defaultLayout,onLayoutChanged:u.onLayoutChanged,children:[c?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Sx,{id:`left`,...F3,groupResizeBehavior:`preserve-pixel-size`,children:(0,X.jsx)(d3,{project:n,page:t??``,theme:(0,X.jsx)(A3,{project:n.name}),assets:(0,X.jsx)(nM,{project:n.name},n.name),storage:V3})}),(0,X.jsx)(Cx,{"aria-label":`Resize the left panel`})]}),(0,X.jsx)(Sx,{id:`canvas`,children:(0,X.jsxs)(`main`,{className:`relative size-full min-w-0`,children:[d?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(QY,{page:d,reloads:r,findings:i,claims:a,focus:o,onFocused:s},f),(0,X.jsx)(kZ,{project:n.name}),(0,X.jsx)(Ov,{})]}):(0,X.jsx)(B3,{message:g?`No page ${t} in ${e}.`:`${e} has no pages yet. An agent adds one with frameboard page add <name>.`}),l?(0,X.jsx)(vZ,{frames:d?.frames??I3}):null,c?(0,X.jsx)(dZ,{project:n,page:t??``}):null]})}),c?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Cx,{"aria-label":`Resize the inspector`}),(0,X.jsx)(Sx,{id:`right`,...F3,groupResizeBehavior:`preserve-pixel-size`,children:(0,X.jsx)(E2,{})})]})]})}function B3({message:e}){return(0,X.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,X.jsx)(`p`,{className:`text-body text-muted-foreground`,children:e}),(0,X.jsx)(Ba,{href:`/`,className:hg({variant:`outline`}),children:`Go home`})]})}var V3={getItem:e=>{try{return localStorage.getItem(e)}catch{return null}},setItem:(e,t)=>{try{localStorage.setItem(e,t)}catch{}}},H3=[`home.layoutGrid`,`home.layoutList`,`project.new`,`theme.toggle`];function U3({hasProjects:e}){let[t,n,r,i]=xe(H3);return(0,X.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-border bg-card px-4 sm:px-6`,children:[(0,X.jsxs)(`span`,{className:`flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,X.jsx)(q3,{}),`Frameboard`]}),e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{role:`group`,"aria-label":`Layout`,className:`flex rounded-lg bg-muted p-0.5`,children:[(0,X.jsx)(G3,{action:t,label:`Grid`,children:(0,X.jsx)(Bn,{"aria-hidden":!0,className:`size-3.5`})}),(0,X.jsx)(G3,{action:n,label:`List`,children:(0,X.jsx)(Qn,{"aria-hidden":!0,className:`size-3.5`})})]}),(0,X.jsx)(W3,{action:r,compact:!0})]}):null,(0,X.jsxs)(`button`,{type:`button`,"aria-label":i?.label??`Theme`,title:i?.label??`Theme`,...K3(i),className:`grid size-[26px] place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent`,children:[(0,X.jsx)(bi,{"aria-hidden":!0,className:`size-[15px] dark:hidden`}),(0,X.jsx)(gr,{"aria-hidden":!0,className:`hidden size-[15px] dark:block`})]})]})}function W3({action:e,className:t,compact:n=!1}){return(0,X.jsxs)(`button`,{type:`button`,"aria-label":`New project`,...K3(e),className:Q(`flex h-[30px] items-center gap-1.5 rounded-lg bg-primary px-3 font-medium text-primary-foreground outline-none hover:bg-primary/90 focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-primary`,t),children:[(0,X.jsx)(Rr,{"aria-hidden":!0,className:`size-3.5`}),(0,X.jsx)(`span`,{className:Q(`whitespace-nowrap`,n&&`hidden sm:inline`),children:`New project`})]})}function G3({action:e,label:t,children:n}){let r=e?.checked?.()??!1;return(0,X.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"aria-pressed":r,...K3(e),className:Q(`grid h-[26px] w-7 place-items-center rounded-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,r&&`bg-card text-foreground ring-1 ring-border`),children:n})}function K3(e){let t=e?be(e):!1;return{"aria-disabled":!t||void 0,onClick:()=>{e&&t&&e.run()}}}function q3(){return(0,X.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 64 64`,className:`size-6 -translate-y-[1.5px]`,children:[(0,X.jsx)(`rect`,{x:`4`,y:`12`,width:`48`,height:`48`,rx:`12`,className:`fill-primary`}),(0,X.jsx)(`rect`,{x:`34`,y:`4`,width:`26`,height:`26`,rx:`7`,strokeWidth:`4`,className:`fill-foreground stroke-card`})]})}function J3(){let[e]=xe([`project.new`]);return(0,X.jsx)(`div`,{className:`relative flex-1`,children:(0,X.jsxs)(`div`,{className:`absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center leading-[1.6] text-muted-foreground`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,X.jsx)(`h1`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`No projects yet`}),(0,X.jsx)(`p`,{children:`A project holds the pages and frames for one thing you are designing.`}),(0,X.jsx)(W3,{action:e,className:`mx-auto mt-3.5 mb-2.5`}),(0,X.jsxs)(`p`,{children:[`or from a terminal`,` `,(0,X.jsx)(`code`,{className:`rounded-[5px] bg-muted px-1.5 py-0.5 font-mono text-label font-normal text-foreground`,children:`frameboard project add <name>`})]})]})})}var Y3=`frameboard.home.layout`;function X3(){let[e,t]=(0,_.useState)(Z3),n=(0,_.useRef)(e);return(0,_.useEffect)(()=>{let e=e=>{n.current=e,t(e),Q3(e),G()};return ye([{id:`home.layoutGrid`,label:`Grid`,group:`home`,command:{label:`Show projects as a grid`,icon:Bn},run:()=>e(`grid`),checked:()=>n.current===`grid`},{id:`home.layoutList`,label:`List`,group:`home`,command:{label:`Show projects as a list`,icon:Qn},run:()=>e(`list`),checked:()=>n.current===`list`}])},[]),e}function Z3(){try{return localStorage.getItem(Y3)===`list`?`list`:`grid`}catch{return`grid`}}function Q3(e){try{localStorage.setItem(Y3,e)}catch{}}var $3=[`project.open`,`project.rename`,`project.duplicate`,`project.pin`,`project.delete`];function e6({project:e,trigger:t}){let[n,r,i,a,o]=xe($3),s=(0,_.useRef)(null),c=a4(s);return(0,X.jsxs)(dJ,{onOpenChange:t=>{t&&Lk(e)},onOpenChangeComplete:c.onOpenChangeComplete,children:[(0,X.jsx)(fJ,{render:t,onKeyDown:c.onKeyDown}),(0,X.jsxs)(pJ,{ref:s,children:[(0,X.jsxs)(mJ,{children:[(0,X.jsx)(hJ,{children:`Project`}),(0,X.jsx)(t6,{action:n,keyHint:`↵`,keyName:`Enter`,children:`Open`}),(0,X.jsx)(t6,{action:r,children:`Rename`}),(0,X.jsx)(t6,{action:i,children:`Duplicate`}),(0,X.jsx)(t6,{action:a,children:a?.checked?.()?`Unpin`:`Pin`})]}),(0,X.jsx)(_J,{}),(0,X.jsx)(t6,{action:o,keyHint:`⌫`,keyName:`Delete`,variant:`destructive`,children:`Delete`})]})]})}function t6({action:e,children:t,keyHint:n,keyName:r,variant:i}){return(0,X.jsxs)(gJ,{variant:i,disabled:!e||!be(e),"aria-keyshortcuts":r,onClick:()=>e?.run(),children:[t,n?(0,X.jsx)(vJ,{"aria-hidden":!0,children:n}):null]})}function n6(e){for(let t of e.pages){let e=t.frames.filter(e=>!e.hidden);if(e.length>0)return e}return[]}function r6({project:e,captures:t,className:n}){let r=n6(e);if(r.length===0)return null;let i=r.map(e=>e.box),a=Math.min(...i.map(e=>e.x)),o=Math.min(...i.map(e=>e.y)),s=Math.max(...i.map(e=>e.x+e.width)),c=Math.max(...i.map(e=>e.y+e.height));return(0,X.jsx)(`svg`,{"aria-hidden":!0,"data-skeleton":!0,viewBox:`${a} ${o} ${s-a} ${c-o}`,preserveAspectRatio:`xMidYMin meet`,className:n,children:r.map(({ref:e,box:n})=>{let r=t?.stamps[e];return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`rect`,{x:n.x,y:n.y,width:n.width,height:n.height,className:`fill-white stroke-black/6`,strokeWidth:1,vectorEffect:`non-scaling-stroke`}),t&&r?(0,X.jsx)(`image`,{href:i6(e,t.theme,r),x:n.x,y:n.y,width:n.width,height:n.height,preserveAspectRatio:`none`}):null]},e)})})}function i6(e,t,n){return`/api/thumbnails/png?${new URLSearchParams({ref:e,theme:t,v:n})}`}var a6=[`home.sortEdited`,`home.sortCreated`,`home.sortName`],o6=[`home.sortReverse`],s6={dates:[`Newest first`,`Oldest first`],name:[`A to Z`,`Z to A`]},c6=`h-7 px-2 py-0 text-xs`;function l6(){let e=xe(a6).filter(e=>e!==void 0),[t]=xe(o6),n=e.find(e=>e.checked?.()),r=t?.checked?.()??!1,[i,a]=n?.id===`home.sortName`?s6.name:s6.dates;return(0,X.jsxs)(aX,{children:[(0,X.jsxs)(oX,{className:`flex h-7 items-center gap-1.5 rounded-lg pr-2 pl-2.5 font-medium text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 data-popup-open:bg-muted`,children:[(0,X.jsx)(ht,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`}),`Sort: `,n?.label??`Last edited`,(0,X.jsx)(Nt,{"aria-hidden":!0,className:`size-3 text-muted-foreground`})]}),(0,X.jsxs)(WX,{align:`end`,className:`w-45`,children:[(0,X.jsxs)(cX,{children:[(0,X.jsx)(lX,{className:`px-2 pt-1.5 pb-1 text-[11px] font-semibold text-muted-foreground`,children:`Sort by`}),(0,X.jsx)(mX,{value:n?.id??``,children:e.map(e=>(0,X.jsx)(hX,{value:e.id,closeOnClick:!0,onClick:()=>e.run(),className:c6,children:e.label},e.id))})]}),t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(gX,{}),(0,X.jsx)(mX,{value:r?a:i,children:[i,a].map(e=>(0,X.jsx)(hX,{value:e,closeOnClick:!0,onClick:()=>{e===a!==r&&t.run()},className:c6,children:e},e))})]}):null]})]})}function u6({projects:e,layout:t,now:n,calls:r}){let i=J_(e=>e.unseen),a=EM(),o={theme:a,stamps:$g(e=>e.thumbnails[a])},s=F(Fk,e=>e.focused),c=Ck(),l=e.some(e=>e.name===s)?s:e[0]?.name,u=e.findIndex(e=>!c.has(e.name)),d=u>0?u:-1;return(0,X.jsxs)(`main`,{className:`px-4 py-8 sm:px-12`,children:[(0,X.jsxs)(`div`,{className:`mb-5 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h1`,{className:`text-title`,children:`Projects`}),(0,X.jsx)(l6,{})]}),t===`grid`?(0,X.jsx)(`ul`,{onKeyDown:e=>d6(e,`grid`),className:`grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-5`,children:e.map((e,t)=>(0,X.jsxs)(_.Fragment,{children:[t===d?(0,X.jsx)(`li`,{"aria-hidden":!0,"data-pin-divider":!0,className:`col-span-full h-px bg-border`}):null,(0,X.jsx)(`li`,{children:(0,X.jsxs)(g6,{project:e,tabbable:e.name===l,className:`block overflow-hidden rounded-xl border border-border bg-card text-card-foreground outline-none hover:ring-2 hover:ring-primary focus-visible:ring-2 focus-visible:ring-primary data-popup-open:ring-2 data-popup-open:ring-primary`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`m-1.5 block h-[150px] overflow-hidden rounded-lg bg-background p-3.5`,children:(0,X.jsx)(r6,{project:e,captures:o,className:`size-full`})}),(0,X.jsxs)(`span`,{className:`flex flex-col px-3 pt-1.5 pb-3`,children:[(0,X.jsx)(v6,{project:e,calls:r,type:`text-panel`,unseen:B_(i,e.name),pinned:c.has(e.name)}),(0,X.jsx)(b6,{project:e,now:n,prefix:`Edited `})]})]})})]},e.name))}):(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-card text-card-foreground`,children:[(0,X.jsxs)(`div`,{"aria-hidden":!0,className:`grid h-9 grid-cols-[48px_1fr] sm:grid-cols-[48px_1fr_160px_160px] items-center border-b border-border px-4 text-label text-muted-foreground`,children:[(0,X.jsx)(`span`,{}),(0,X.jsx)(`span`,{children:`Name`}),(0,X.jsx)(`span`,{className:`hidden sm:block`,children:`Edited`}),(0,X.jsx)(`span`,{className:`hidden sm:block`,children:`Created`})]}),(0,X.jsx)(`ul`,{onKeyDown:e=>d6(e,`list`),children:e.map((e,t)=>(0,X.jsxs)(_.Fragment,{children:[t===d?(0,X.jsx)(`li`,{"aria-hidden":!0,"data-pin-divider":!0,className:`h-1.5 border-b border-border bg-muted`}):null,(0,X.jsx)(`li`,{className:`not-last:border-b`,children:(0,X.jsxs)(g6,{project:e,tabbable:e.name===l,className:`grid h-12 grid-cols-[48px_1fr] sm:grid-cols-[48px_1fr_160px_160px] items-center px-4 outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset data-popup-open:ring-2 data-popup-open:ring-primary data-popup-open:ring-inset`,children:[(0,X.jsx)(y6,{project:e}),(0,X.jsx)(v6,{project:e,calls:r,type:`font-medium`,unseen:B_(i,e.name),pinned:c.has(e.name),className:`pr-4`}),(0,X.jsx)(`span`,{className:`hidden truncate sm:block`,children:(0,X.jsx)(b6,{project:e,now:n,prefix:``})}),(0,X.jsx)(`span`,{className:`hidden sm:block`,children:(0,X.jsx)(x6,{project:e})})]})})]},e.name))})]})]})}function d6(e,t){let n=e.target;if(!(n instanceof HTMLElement)||!n.matches(h6))return;let r=[...e.currentTarget.querySelectorAll(h6)],i=r.indexOf(n),a=t===`grid`,o=f6(e),s={ArrowLeft:a?i-1:i,ArrowRight:a?i+1:i,ArrowUp:a?m6(r,i,-1):i-1,ArrowDown:a?m6(r,i,1):i+1,Home:0,End:r.length-1}[o];s!==void 0&&(e.preventDefault(),r[Math.min(Math.max(s,0),r.length-1)]?.focus())}function f6(e){let t=e.ctrlKey||e.metaKey||e.altKey,n=p6[e.key];return n&&!t&&de()?n:e.key}var p6={h:`ArrowLeft`,j:`ArrowDown`,k:`ArrowUp`,l:`ArrowRight`};function m6(e,t,n){let r=e.map(e=>e.getBoundingClientRect()),i=r[t];if(!i)return t;let a=r.map(e=>e.top).filter(e=>(e-i.top)*n>0);if(a.length===0)return t;let o=n>0?Math.min(...a):Math.max(...a),s=t;return r.forEach((e,n)=>{if(e.top!==o)return;let a=r[s];(s===t||a&&Math.abs(e.left-i.left)<Math.abs(a.left-i.left))&&(s=n)}),s}var h6=`[data-project-link]`;function g6({project:e,tabbable:t,className:n,children:r}){return Ik(e.name)===null?(0,X.jsx)(e6,{project:e.name,trigger:(0,X.jsx)(Ba,{href:Bk(e),"data-project-link":!0,tabIndex:t?0:-1,onFocus:()=>Lk(e.name),onKeyDown:t=>{let n=_6[t.key];if(!n)return;Lk(e.name);let r=Se(n);r&&be(r)&&r.run(),t.preventDefault()},className:n,children:r})}):(0,X.jsx)(`div`,{className:n,children:r})}var _6={F2:`project.rename`,Delete:`project.delete`,Backspace:`project.delete`};function v6({project:e,calls:t,type:n,unseen:r,pinned:i,className:a}){let o=Ik(e.name);return o?(0,X.jsxs)(`span`,{className:Q(`flex min-w-0 flex-col`,n),children:[(0,X.jsx)(`span`,{className:`flex h-lh items-center pl-1.5`,children:(0,X.jsx)(KV,{name:o.draft,label:`Rename project ${e.name}`,onCommit:n=>void Vk(e.name,n,t),onCancel:zk},o.attempt)}),o.refusal?(0,X.jsx)(`span`,{role:`alert`,className:`mt-1 text-label font-normal text-destructive`,children:o.refusal}):null]}):(0,X.jsxs)(`span`,{className:Q(`flex min-w-0 items-center gap-1.5`,a),children:[(0,X.jsx)(`span`,{className:Q(`truncate`,n),title:e.name,children:e.name}),(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[i?(0,X.jsx)(Mr,{role:`img`,"aria-label":`Pinned`,className:`size-[13px] shrink-0 fill-current text-foreground`}):null,(0,X.jsx)(Y4,{count:r})]})]})}function y6({project:e}){return(0,X.jsx)(`span`,{"aria-hidden":!0,className:`block h-[22px] w-8 overflow-hidden rounded bg-background p-[5px]`,children:(0,X.jsx)(r6,{project:e,className:`size-full`})})}function b6({project:e,now:t,prefix:n}){return(0,X.jsxs)(`span`,{"data-edited":!0,className:`truncate text-body text-muted-foreground`,title:new Date(e.modifiedAt).toLocaleString(),children:[n,C6(Date.parse(e.modifiedAt),t)]})}function x6({project:e}){if(!e.createdAt)return(0,X.jsx)(`span`,{});let t=new Date(e.createdAt);return(0,X.jsx)(`time`,{dateTime:e.createdAt,className:`text-body text-muted-foreground`,title:t.toLocaleString(),children:w6(t)})}var S6=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]];function C6(e,t){let n=Math.max(0,(t-e)/1e3),r=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});for(let[e,t]of S6)if(n>=t)return r.format(-Math.floor(n/t),e);return`just now`}function w6(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}var T6=`frameboard.home.sort`,E6=`frameboard.home.sortDirection`,D6=[`edited`,`created`,`name`],O6={edited:`desc`,created:`desc`,name:`asc`};function k6(){let[e,t]=(0,_.useState)(F6),n=(0,_.useRef)(e);return(0,_.useEffect)(()=>{let e=e=>{n.current=e,t(e),I6(e),G()},r=(t,r,i,a)=>({id:t,label:i,group:`home`,command:{label:`Sort projects by ${i.toLowerCase()}`,icon:a},run:()=>e({by:r,direction:O6[r]}),checked:()=>n.current.by===r});return ye([r(`home.sortEdited`,`edited`,`Last edited`,Yt),r(`home.sortCreated`,`created`,`Created`,xt),r(`home.sortName`,`name`,`Name`,Tt),{id:`home.sortReverse`,label:`Reverse`,group:`home`,command:{label:`Reverse project order`,icon:st},run:()=>{let{by:t,direction:r}=n.current;e({by:t,direction:r===`asc`?`desc`:`asc`})},checked:()=>n.current.direction!==O6[n.current.by]}])},[]),e}function A6(e,t,n,r=O6[t]){let i=M6[t],a=r===`asc`?1:-1;return[...e].sort((e,r)=>Number(n.has(r.name))-Number(n.has(e.name))||(t===`created`?N6(e,r):0)||a*i(e,r)||j6(e,r))}var j6=(e,t)=>e.name.localeCompare(t.name,`en`,{sensitivity:`base`})||(e.name<t.name?-1:+(e.name>t.name)),M6={edited:(e,t)=>Date.parse(e.modifiedAt)-Date.parse(t.modifiedAt),created:(e,t)=>P6(e)-P6(t),name:j6},N6=(e,t)=>Number(e.createdAt===null)-Number(t.createdAt===null);function P6(e){return e.createdAt?Date.parse(e.createdAt):0}function F6(){try{let e=localStorage.getItem(T6),t=D6.find(t=>t===e)??`edited`,n=localStorage.getItem(E6);return{by:t,direction:n===`asc`||n===`desc`?n:O6[t]}}catch{return{by:`edited`,direction:O6.edited}}}function I6({by:e,direction:t}){try{localStorage.setItem(T6,e),localStorage.setItem(E6,t)}catch{}}var L6=100;function R6(e=fetch){let t=EM(),n=$g(e=>e.connected),r=$g(e=>e.board),i=$g(e=>e.reloads),a=(0,_.useRef)(new Map);(0,_.useEffect)(()=>{a.current=new Map},[t,n]),(0,_.useEffect)(()=>{if(!n||!r)return;let o=new Map(r.projects.flatMap(e=>n6(e)).map(({ref:e,box:t})=>[e,`${t.width}x${t.height}#${i[e]??0}`]));if(![...o].some(([e,t])=>a.current.get(e)!==t))return;let s=setTimeout(()=>{for(let[e,t]of o)a.current.set(e,t);z6(e,t)},L6);return()=>clearTimeout(s)},[e,t,n,r,i])}async function z6(e,t){try{let n=await(await e(`/api/thumbnails?theme=${t}`)).json();n.ok&&n.data&&qg(Qg,t,n.data.stamps)}catch{}}function B6({projects:e,calls:t}){let[n]=(0,_.useState)(Date.now),r=nK(),i=X3(),a=k6(),o=Ck();return Wk(t),Gk(Hk,{calls:t}),V6(),R6(),r?null:(0,X.jsxs)(`div`,{className:`flex min-h-full flex-col text-body`,children:[(0,X.jsx)(U3,{hasProjects:e.length>0}),e.length===0?(0,X.jsx)(J3,{}):(0,X.jsx)(u6,{projects:A6(e,a.by,o,a.direction),layout:i,now:n,calls:t})]})}function V6(){let e=()=>[...document.querySelectorAll(`[data-project-link]`)];(0,_.useEffect)(()=>{let t=()=>(document.activeElement??document.body)===document.body&&e().length>0,n=t=>()=>t(e())?.focus();return ye([{id:`home.focusCards`,label:`Focus the projects`,group:`project`,palette:!1,keys:[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`h`,`j`,`k`,`l`],enabled:t,run:n(e=>e.find(e=>e.tabIndex===0))},{id:`home.focusFirst`,label:`Focus the first project`,group:`project`,palette:!1,keys:[`Home`],enabled:t,run:n(e=>e[0])},{id:`home.focusLast`,label:`Focus the last project`,group:`project`,palette:!1,keys:[`End`],enabled:t,run:n(e=>e.at(-1))}])},[])}var H6=1,U6=.9,W6=.8,G6=.17,K6=.1,q6=.999,J6=.9999,Y6=.99,X6=/[\\\/_+.#"@\[\(\{&]/,Z6=/[\\\/_+.#"@\[\(\{&]/g,Q6=/[\s-]/,$6=/[\s-]/g;function e8(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?H6:Y6;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=e8(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=H6:X6.test(e.charAt(l-1))?(d*=W6,p=e.slice(i,l-1).match(Z6),p&&i>0&&(d*=q6**+p.length)):Q6.test(e.charAt(l-1))?(d*=U6,m=e.slice(i,l-1).match($6),m&&i>0&&(d*=q6**+m.length)):(d*=G6,i>0&&(d*=q6**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=J6)),(d<K6&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=e8(e,t,n,r,l+1,a+2,o),f*K6>d&&(d=f*K6)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function t8(e){return e.toLowerCase().replace($6,` `)}function n8(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,e8(e,t,t8(e),t8(t),0,0,{})}var r8=Object.defineProperty,i8=(e,t)=>r8(e,`name`,{value:t,configurable:!0}),a8=!!(typeof window<`u`&&window.document&&window.document.createElement);function o8(e,t,{checkForDefaultPrevented:n=!0}={}){return i8(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}i8(o8,`composeEventHandlers`);function s8(e){if(!a8)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}i8(s8,`getOwnerWindow`);function c8(e){if(!a8)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}i8(c8,`getOwnerDocument`);function l8(e,t=!1){let{activeElement:n}=c8(e);if(!n?.nodeName)return null;if(u8(n)&&n.contentDocument)return l8(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=c8(n).getElementById(e);if(t)return t}}return n}i8(l8,`getActiveElement`);function u8(e){return e.tagName===`IFRAME`}i8(u8,`isFrame`);var d8=Object.defineProperty,f8=(e,t)=>d8(e,`name`,{value:t,configurable:!0});function p8(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}f8(p8,`setRef`);function m8(...e){return t=>{let n=!1,r=e.map(e=>{let r=p8(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():p8(e[t],null)}}}}f8(m8,`composeRefs`);function h8(...e){return _.useCallback(m8(...e),e)}f8(h8,`useComposedRefs`);var g8=Object.defineProperty,_8=(e,t)=>g8(e,`name`,{value:t,configurable:!0});function v8(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=_8(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,X.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return _8(i,`useContext`),[r,i]}_8(v8,`createContext`);function y8(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=_8(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,X.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=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return _8(s,`useContext`),[o,s]}_8(r,`createContext`);let i=_8(()=>{let t=n.map(e=>_.createContext(e));return _8(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,b8(i,...t)]}_8(y8,`createContextScope`);function b8(...e){let t=e[0];if(e.length===1)return t;let n=_8(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return _8(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}_8(b8,`composeContextScopes`);var x8=globalThis?.document?_.useLayoutEffect:()=>{},S8=Object.defineProperty,C8=(e,t)=>S8(e,`name`,{value:t,configurable:!0}),w8=_.useId||(()=>void 0),T8=0;function E8(e){let[t,n]=_.useState(w8());return x8(()=>{e||n(e=>e??String(T8++))},[e]),e||(t?`radix-${t}`:``)}C8(E8,`useId`);var D8=Object.defineProperty,O8=(e,t)=>D8(e,`name`,{value:t,configurable:!0}),k8=_.useEffectEvent,A8=_.useInsertionEffect;function j8(e){if(typeof k8==`function`)return k8(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof A8==`function`?A8(()=>{t.current=e}):x8(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}O8(j8,`useEffectEvent`);var M8=Object.defineProperty,N8=(e,t)=>M8(e,`name`,{value:t,configurable:!0}),P8=_.useInsertionEffect||x8;function F8({prop:e,defaultProp:t,onChange:n=N8(()=>{},`onChange`),caller:r}){let[i,a,o]=I8({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=L8(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}N8(F8,`useControllableState`);function I8({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return P8(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}N8(I8,`useUncontrolledState`);function L8(e){return typeof e==`function`}N8(L8,`isFunction`);var R8=Symbol(`RADIX:SYNC_STATE`);function z8(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=j8(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===R8)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=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:R8,state:i})},[i,d.state,c]),[h,f]}N8(z8,`useControllableStateReducer`);var B8=Object.defineProperty,V8=(e,t)=>B8(e,`name`,{value:t,configurable:!0});function H8(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Q8(r),_.Children.forEach(r,e=>{if(J8(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;X8(n)&&typeof n5==`function`;)n=n5(n._payload);a=G8(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?q8(a):void 0,l=h8(n,c);if(!a){if(r||r===0)throw Error(o?t5(e):e5(e));return r}let u=K8(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}V8(H8,`createSlot`);var U8=Symbol.for(`radix.slottable`);function W8(e){let t=V8(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=U8,t}V8(W8,`createSlottable`);var G8=V8((e,t)=>`child`in e.props?_.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null:_.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function K8(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(` `):r===`aria-describedby`&&(n[r]=$8(a,i))}return{...e,...n}}V8(K8,`mergeProps`);function q8(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)}V8(q8,`getElementRef`);function J8(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===U8}V8(J8,`isSlottable`);var Y8=Symbol.for(`react.lazy`);function X8(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Y8&&`_payload`in e&&Z8(e._payload)}V8(X8,`isLazyComponent`);function Z8(e){return typeof e==`object`&&!!e&&`then`in e}V8(Z8,`isPromiseLike`);function Q8(e){let t=e;for(;X8(t)&&typeof n5==`function`;)t=n5(t._payload);return t}V8(Q8,`useUnwrappedLazy`);function $8(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}V8($8,`concatAriaDescribedby`);var e5=V8(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),t5=V8(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),n5=_.use,r5=Object.defineProperty,i5=(e,t)=>r5(e,`name`,{value:t,configurable:!0}),a5=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=H8(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,X.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function o5(e,t){e&&gu.flushSync(()=>e.dispatchEvent(t))}i5(o5,`dispatchDiscreteCustomEvent`);var s5=Object.defineProperty,c5=(e,t)=>s5(e,`name`,{value:t,configurable:!0}),l5=_.useInsertionEffect;function u5(e){let t=_.useRef(e);return typeof l5==`function`?l5(()=>{t.current=e}):x8(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}c5(u5,`useCallbackRef`);var d5=Object.defineProperty,f5=(e,t)=>d5(e,`name`,{value:t,configurable:!0}),p5=`dismissableLayer.update`,m5=`dismissableLayer.pointerDownOutside`,h5=`dismissableLayer.focusOutside`,g5,_5=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),v5=_.forwardRef(f5(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(_5),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=h8(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=x5(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=S5(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=u5(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(g5=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),C5(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=g5))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),C5())},[d,u]),_.useEffect(()=>{let e=f5(()=>m({}),`handleUpdate`);return document.addEventListener(p5,e),()=>document.removeEventListener(p5,e)},[]),(0,X.jsx)(a5.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:o8(e.onFocusCapture,T.onFocusCapture),onBlurCapture:o8(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:o8(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function y5(){let e=_.useContext(_5),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}f5(y5,`useDismissableLayerSurface`);var b5=f5(()=>!0,`IS_TRUE`);function x5(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=b5}=t,s=u5(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}f5(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}f5(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)}f5(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}f5(p,`handleInteractionBubble`);let m=f5(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||w5(m5,s,p,{discrete:!0})};if(f5(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:f5(()=>c.current=!0,`onPointerDownCapture`)}}f5(x5,`usePointerDownOutside`);function S5(e,t=globalThis?.document){let n=u5(e),r=_.useRef(!1);return _.useEffect(()=>{let e=f5(e=>{e.target&&!r.current&&w5(h5,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:f5(()=>r.current=!0,`onFocusCapture`),onBlurCapture:f5(()=>r.current=!1,`onBlurCapture`)}}f5(S5,`useFocusOutside`);function C5(){let e=new CustomEvent(p5);document.dispatchEvent(e)}f5(C5,`dispatchUpdate`);function w5(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?o5(i,a):i.dispatchEvent(a)}f5(w5,`handleAndDispatchCustomEvent`);var T5=Object.defineProperty,E5=(e,t)=>T5(e,`name`,{value:t,configurable:!0}),D5=`focusScope.autoFocusOnMount`,O5=`focusScope.autoFocusOnUnmount`,k5={bubbles:!1,cancelable:!0},A5=_.forwardRef(E5(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=_.useState(null),u=u5(a),d=u5(o),f=_.useRef(null),p=h8(t,l),m=_.useRef(i);_.useEffect(()=>{m.current=i});let h=_.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:V5(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||V5(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&V5(c)};E5(e,`handleFocusIn`),E5(t,`handleFocusOut`),E5(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),_.useEffect(()=>{if(c){H5.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(D5,k5);c.addEventListener(D5,u),c.dispatchEvent(t),t.defaultPrevented||(F5(G5(L5(c)),{select:!0}),document.activeElement===e&&V5(c))}return()=>{c.removeEventListener(D5,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(O5,k5);c.addEventListener(O5,d),c.dispatchEvent(r),r.defaultPrevented||V5(e??t.body,{select:!0}),c.removeEventListener(O5,d),H5.remove(g)},0)}}},[c,u,d,g]);let v=_.useCallback(e=>{if(!n&&!r||g.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]=I5(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&V5(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&V5(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,X.jsx)(a5.div,{tabIndex:-1,...s,ref:p,onKeyDown:v})},`FocusScope`)),j5=_.createContext(null);function M5({registry:e,children:t}){return e?(0,X.jsx)(j5.Provider,{value:e,children:t}):t}E5(M5,`FocusScopeBranchProvider`);function N5(){let[e,t]=_.useState([]);return{nodes:e,registry:_.useMemo(()=>({add:E5(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:E5(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}E5(N5,`useFocusScopeBranchRegistry`);function P5(e){let t=_.useContext(j5);_.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}E5(P5,`useFocusScopeBranch`);function F5(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(V5(r,{select:t}),document.activeElement!==n)return}E5(F5,`focusFirst`);function I5(e){let t=L5(e);return[R5(t,e),R5(t.reverse(),e)]}E5(I5,`getTabbableEdges`);function L5(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:E5(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}E5(L5,`getTabbableCandidates`);function R5(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):z5(r,{upTo:t})))return r}E5(R5,`findVisible`);function z5(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}E5(z5,`isHidden`);function B5(e){return e.tagName===`INPUT`&&typeof e.select==`function`}E5(B5,`isSelectableInput`);function V5(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&B5(e)&&t&&e.select()}}E5(V5,`focus`);var H5=U5();function U5(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=W5(e,t),e.unshift(t)},remove(t){e=W5(e,t),e[0]?.resume()}}}E5(U5,`createFocusScopesStack`);function W5(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}E5(W5,`arrayRemove`);function G5(e){return e.filter(e=>e.tagName!==`A`)}E5(G5,`removeLinks`);var K5=Object.defineProperty,q5=_.forwardRef(((e,t)=>K5(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);x8(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?gu.createPortal((0,X.jsx)(a5.div,{...r,ref:t}),o):null},`Portal`)),J5=Object.defineProperty,Y5=(e,t)=>J5(e,`name`,{value:t,configurable:!0});function X5(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}Y5(X5,`useStateMachine`);var Z5=Y5(e=>{let{present:t,children:n}=e,r=Q5(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=e7(r.ref,n7(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function Q5(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=X5(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??t7(r.current),o.current=void 0):a.current=`none`},[s]),x8(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=t7(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]),x8(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Y5(a=>{let o=t7(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=Y5(e=>{e.target===t&&(a.current=t7(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:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=t7(t)}else r.current=null;n(e)},[])}}Y5(Q5,`usePresence`);function $5(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Y5($5,`setRef`);function e7(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=$5(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():$5(n[e],null)}}},[])}Y5(e7,`useStableComposedRefs`);function t7(e){return e?.animationName||`none`}Y5(t7,`getAnimationName`);function n7(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)}Y5(n7,`getElementRef`);var r7=Object.defineProperty,i7=(e,t)=>r7(e,`name`,{value:t,configurable:!0}),a7=0,o7=null;function s7(e){return c7(),e.children}i7(s7,`FocusGuards`);function c7(){_.useEffect(()=>{o7||={start:l7(),end:l7()};let{start:e,end:t}=o7;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),a7++,()=>{a7===1&&(o7?.start.remove(),o7?.end.remove(),o7=null),a7=Math.max(0,a7-1)}},[])}i7(c7,`useFocusGuards`);function l7(){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}i7(l7,`createFocusGuard`);var u7=function(){return u7=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},u7.apply(this,arguments)};function d7(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 f7(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 p7=`right-scroll-bar-position`,m7=`width-before-scroll-bar`,h7=`with-scroll-bars-hidden`,g7=`--removed-body-scroll-bar-size`;function _7(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function v7(e,t){var n=(0,_.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 y7=typeof window<`u`?_.useLayoutEffect:_.useEffect,b7=new WeakMap;function x7(e,t){var n=v7(t||null,function(t){return e.forEach(function(e){return _7(e,t)})});return y7(function(){var t=b7.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||_7(e,null)}),i.forEach(function(e){r.has(e)||_7(e,a)})}b7.set(n,e)},[e]),n}function S7(e){return e}function C7(e,t){t===void 0&&(t=S7);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 w7(e){e===void 0&&(e={});var t=C7(null);return t.options=u7({async:!0,ssr:!1},e),t}var T7=function(e){var t=e.sideCar,n=d7(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 _.createElement(r,u7({},n))};T7.isSideCarExport=!0;function E7(e,t){return e.useMedium(t),T7}var D7=w7(),O7=function(){},k7=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:O7,onWheelCapture:O7,onTouchMoveCapture:O7}),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,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=d7(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=x7([n,t]),w=u7(u7({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:D7,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),u7(u7({},w),{ref:C})):_.createElement(y,u7({},w,{className:c,ref:C}),s))});k7.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},k7.classNames={fullWidth:m7,zeroRight:p7};var A7=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function j7(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=A7();return t&&e.setAttribute(`nonce`,t),e}function M7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function N7(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var xte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=j7())&&(M7(t,n),N7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ste=function(){var e=xte();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},P7=function(){var e=Ste();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Cte={left:0,top:0,right:0,gap:0},F7=function(e){return parseInt(e||``,10)||0},wte=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[F7(n),F7(r),F7(i)]},Tte=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Cte;var t=wte(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])}},Ete=P7(),I7=`data-scroll-locked`,Dte=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
73
+ .${h7} {
74
+ overflow: hidden ${r};
75
+ padding-right: ${s}px ${r};
76
+ }
77
+ body[${I7}] {
78
+ overflow: hidden ${r};
79
+ overscroll-behavior: contain;
80
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
81
+ padding-left: ${i}px;
82
+ padding-top: ${a}px;
83
+ padding-right: ${o}px;
84
+ margin-left:0;
85
+ margin-top:0;
86
+ margin-right: ${s}px ${r};
87
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
88
+ }
89
+
90
+ .${p7} {
91
+ right: ${s}px ${r};
92
+ }
93
+
94
+ .${m7} {
95
+ margin-right: ${s}px ${r};
96
+ }
97
+
98
+ .${p7} .${p7} {
99
+ right: 0 ${r};
100
+ }
101
+
102
+ .${m7} .${m7} {
103
+ margin-right: 0 ${r};
104
+ }
105
+
106
+ body[${I7}] {
107
+ ${g7}: ${s}px;
108
+ }
109
+ `},L7=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ote=function(){_.useEffect(function(){return document.body.setAttribute(I7,(L7()+1).toString()),function(){var e=L7()-1;e<=0?document.body.removeAttribute(I7):document.body.setAttribute(I7,e.toString())}},[])},kte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ote();var a=_.useMemo(function(){return Tte(i)},[i]);return _.createElement(Ete,{styles:Dte(a,!t,i,n?``:`!important`)})},R7=!1;if(typeof window<`u`)try{var z7=Object.defineProperty({},"passive",{get:function(){return R7=!0,!0}});window.addEventListener(`test`,z7,z7),window.removeEventListener(`test`,z7,z7)}catch{R7=!1}var B7=R7?{passive:!1}:!1,Ate=function(e){return e.tagName===`TEXTAREA`},V7=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ate(e)&&n[t]===`visible`)},jte=function(e){return V7(e,`overflowY`)},Mte=function(e){return V7(e,`overflowX`)},H7=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),U7(e,r)){var i=W7(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Nte=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Pte=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},U7=function(e,t){return e===`v`?jte(t):Mte(t)},W7=function(e,t){return e===`v`?Nte(t):Pte(t)},Fte=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ite=function(e,t,n,r,i){var a=Fte(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=W7(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&U7(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},G7=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K7=function(e){return[e.deltaX,e.deltaY]},q7=function(e){return e&&`current`in e?e.current:e},Lte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rte=function(e){return`
110
+ .block-interactivity-${e} {pointer-events: none;}
111
+ .allow-interactivity-${e} {pointer-events: all;}
112
+ `},zte=0,J7=[];function Bte(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(zte++)[0],a=_.useState(P7)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=f7([e.lockRef.current],(e.shards||[]).map(q7),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=G7(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=H7(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=H7(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 Ite(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(J7.length&&J7[J7.length-1]===a){var r=`deltaY`in n?K7(n):G7(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Lte(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(q7).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Vte(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=G7(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,K7(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,G7(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return J7.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,B7),document.addEventListener(`touchmove`,c,B7),document.addEventListener(`touchstart`,u,B7),function(){J7=J7.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,B7),document.removeEventListener(`touchmove`,c,B7),document.removeEventListener(`touchstart`,u,B7)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Rte(i)}):null,p?_.createElement(kte,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Hte=E7(D7,Bte),Y7=_.forwardRef(function(e,t){return _.createElement(k7,u7({},e,{ref:t,sideCar:Hte}))});Y7.classNames=k7.classNames;var Ute=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X7=new WeakMap,Z7=new WeakMap,Q7={},$7=0,e9=function(e){return e&&(e.host||e9(e.parentNode))},Wte=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=e9(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})},Gte=function(e,t,n,r){var i=Wte(t,Array.isArray(e)?e:[e]);Q7[n]||(Q7[n]=new WeakMap);var a=Q7[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=(X7.get(e)||0)+1,l=(a.get(e)||0)+1;X7.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Z7.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(),$7++,function(){o.forEach(function(e){var t=X7.get(e)-1,i=a.get(e)-1;X7.set(e,t),a.set(e,i),t||(Z7.has(e)||e.removeAttribute(r),Z7.delete(e)),i||e.removeAttribute(n)}),$7--,$7||(X7=new WeakMap,X7=new WeakMap,Z7=new WeakMap,Q7={})}},Kte=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ute(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Gte(r,i,n,`aria-hidden`)):function(){return null}},qte=Object.defineProperty,t9=(e,t)=>qte(e,`name`,{value:t,configurable:!0}),n9=`Dialog`,[r9,Jte]=y8(n9),[Yte,i9]=r9(n9),Xte=t9(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=N5(),[d,f]=F8({prop:r,defaultProp:i??!1,onChange:a,caller:n9}),[p,m]=_.useState(0),[h,g]=_.useState(0);return(0,X.jsx)(Yte,{scope:t,triggerRef:s,contentRef:c,contentId:E8(),titleId:E8(),descriptionId:E8(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),a9=`DialogPortal`,[Zte,o9]=r9(a9,{forceMount:void 0}),Qte=t9(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=i9(a9,t);return(0,X.jsx)(Zte,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,X.jsx)(Z5,{present:n||a.open,children:(0,X.jsx)(q5,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),s9=`DialogOverlay`,$te=_.forwardRef(t9(function(e,t){let n=o9(s9,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=i9(s9,e.__scopeDialog);return a.modal?(0,X.jsx)(Z5,{present:r||a.open,children:(0,X.jsx)(tne,{...i,ref:t})}):null},`DialogOverlay`)),ene=H8(`DialogOverlay.RemoveScroll`),tne=_.forwardRef(t9(function(e,t){let{__scopeDialog:n,...r}=e,i=i9(s9,n),a=h8(t,y5());return(0,X.jsx)(Y7,{as:ene,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,X.jsx)(a5.div,{"data-state":d9(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),c9=`DialogContent`,nne=_.forwardRef(t9(function(e,t){let n=o9(c9,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=i9(c9,e.__scopeDialog);return(0,X.jsx)(Z5,{present:r||a.open,children:a.modal?(0,X.jsx)(rne,{...i,ref:t}):(0,X.jsx)(ine,{...i,ref:t})})},`DialogContent`)),rne=_.forwardRef(t9(function(e,t){let n=i9(c9,e.__scopeDialog),r=_.useRef(null),i=h8(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Kte(e)},[]),(0,X.jsx)(l9,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:o8(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:o8(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:o8(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ine=_.forwardRef(t9(function(e,t){let n=i9(c9,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,X.jsx)(l9,{...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`)),l9=_.forwardRef(t9(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=i9(c9,n);return c7(),(0,X.jsx)(M5,{registry:l.branchRegistry,children:(0,X.jsx)(A5,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,X.jsx)(v5,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?u9(o,l.descriptionId):o,"data-state":d9(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function u9(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}t9(u9,`concatAriaDescribedby`);function d9(e){return e?`open`:`closed`}t9(d9,`getState`);var f9=`[cmdk-group=""]`,p9=`[cmdk-group-items=""]`,ane=`[cmdk-group-heading=""]`,m9=`[cmdk-item=""]`,h9=`${m9}:not([aria-disabled="true"])`,g9=`cmdk-item-select`,_9=`data-value`,one=(e,t,n)=>n8(e,t,n),v9=_.createContext(void 0),y9=()=>_.useContext(v9),b9=_.createContext(void 0),x9=()=>_.useContext(b9),S9=_.createContext(void 0),C9=_.forwardRef((e,t)=>{let n=D9(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=D9(()=>new Set),i=D9(()=>new Map),a=D9(()=>new Map),o=D9(()=>new Set),s=T9(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=E8(),b=E8(),x=E8(),S=_.useRef(null),C=_ne();E9(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),E9(()=>{C(6,A)},[]);let w=_.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=_.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??one;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(p9);t?t.appendChild(e.parentElement===t?e:e.closest(`${p9} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${p9} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${f9}[${_9}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(_9);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(f9)?.querySelector(ane))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${m9}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(h9)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(_9))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(_9))}function F(e){let t=j()?.closest(f9),n;for(;t&&!n;)t=e>0?hne(t,f9):gne(t,f9),n=t?.querySelector(h9);n?w.setState(`value`,n.getAttribute(_9)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return _.createElement(a5.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:g&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(g9);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:yne},c),A9(e,e=>_.createElement(b9.Provider,{value:w},_.createElement(v9.Provider,{value:T},e))))}),sne=_.forwardRef((e,t)=>{let n=E8(),r=_.useRef(null),i=_.useContext(S9),a=y9(),o=T9(e),s=o.current?.forceMount??i?.forceMount;E9(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=k9(n,r,[e.value,e.children,r],e.keywords),l=x9(),u=O9(e=>e.value&&e.value===c.current),d=O9(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);_.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(g9,f),()=>t.removeEventListener(g9,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:v,keywords:y,...b}=e;return _.createElement(a5.div,{ref:m8(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),cne=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=E8(),s=_.useRef(null),c=_.useRef(null),l=E8(),u=y9(),d=O9(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));E9(()=>u.group(o),[]),k9(o,s,[e.value,e.heading,c]);let f=_.useMemo(()=>({id:o,forceMount:i}),[i]);return _.createElement(a5.div,{ref:m8(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&_.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),A9(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(S9.Provider,{value:f},e))))}),lne=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=O9(e=>!e.search);return!n&&!a?null:_.createElement(a5.div,{ref:m8(i,t),...r,"cmdk-separator":``,role:`separator`})}),une=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=x9(),o=O9(e=>e.search),s=O9(e=>e.selectedItemId),c=y9();return _.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),_.createElement(a5.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),dne=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=O9(e=>e.selectedItemId),c=y9();return _.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),_.createElement(a5.div,{ref:m8(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},A9(e,e=>_.createElement(`div`,{ref:m8(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),fne=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(Xte,{open:n,onOpenChange:r},_.createElement(Qte,{container:o},_.createElement($te,{"cmdk-overlay":``,className:i}),_.createElement(nne,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement(C9,{ref:t,...s}))))}),pne=_.forwardRef((e,t)=>O9(e=>e.filtered.count===0)?_.createElement(a5.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),mne=_.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return _.createElement(a5.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},A9(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),w9=Object.assign(C9,{List:dne,Item:sne,Input:une,Group:cne,Separator:lne,Dialog:fne,Empty:pne,Loading:mne});function hne(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function gne(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function T9(e){let t=_.useRef(e);return E9(()=>{t.current=e}),t}var E9=typeof window>`u`?_.useEffect:_.useLayoutEffect;function D9(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function O9(e){let t=x9(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function k9(e,t,n,r=[]){let i=_.useRef(),a=y9();return E9(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(_9,s),i.current=s}),i}var _ne=()=>{let[e,t]=_.useState(),n=D9(()=>new Map);return E9(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function vne(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function A9({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(vne(t),{ref:t.ref},n(t.props.children)):n(t)}var yne={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},j9=_.createContext(void 0);function M9(e){let t=_.useContext(j9);if(!e&&t===void 0)throw Error(Za(27));return t}var bne=_.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=M9(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Z(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:ec,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),xne=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=M9(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=sd({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,fd(bd,e.nativeEvent))}return Z(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Sne=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=M9(),c=rH(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Z(`p`,e,{ref:t,props:[{id:c},o]})}),N9=_.createContext(void 0);function Cne(){let e=_.useContext(N9);if(e===void 0)throw Error(Za(26));return e}var wne=`--nested-dialogs`,Tne=`data-nested-dialog-open`,Ene={...$s,...Bs,nestedDialogOpen(e){return e?{[Tne]:``}:null}},Dne=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=M9(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Cne(),bu({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Jf(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Z(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...qf,hidden:!m,onKeyDown(e){RH.has(e.key)&&e.stopPropagation()},style:{[wne]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Ene});return(0,X.jsx)(If,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),One=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=M9(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,X.jsx)(N9.Provider,{value:n,children:(0,X.jsxs)(Gd,{ref:t,...r,children:[a&&o===!0&&(0,X.jsx)(hH,{ref:i.context.internalBackdropRef,inert:du(!s)}),e.children]})}):null});function kne({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=_.useState(0),[d,f]=_.useState(0),p=l===0,m=Uf(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=ks(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Y(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return DH(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),q(()=>{!r&&!i&&(u(0),f(0))},[r,i]),q(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),ap(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Ane={...gp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},jne=class extends wo{constructor(e,t,n){let r=new sp,i=Mne(e,r,t,n);super(i,Nne(r),Ane)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update($f(this.state,e,t.trigger)))}};function Mne(e,t,n,r=!1){return{...up(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Nne(e){return{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Pne(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,v=m?`alertdialog`:`dialog`,y=M9(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:v},x=Yf((e,t)=>new jne({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);op(x,S),rp(x);let{forceUnmount:T}=ip(S,x);_.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,fd(zd))}),[T,x]);let E=S||C||u!=null;return(0,X.jsxs)(j9.Provider,{value:x,children:[u&&(0,X.jsx)(Xf,{handle:u,store:x}),E&&(0,X.jsx)(kne,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var Fne=co(function(e){return Pne(`dialog`,e)}),Ine=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=M9(),c=rH(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Z(`h2`,e,{ref:t,props:[{id:c},o]})});function P9({...e}){return(0,X.jsx)(Fne,{"data-slot":`dialog`,...e})}function Lne({...e}){return(0,X.jsx)(One,{"data-slot":`dialog-portal`,...e})}function Rne({className:e,...t}){return(0,X.jsx)(bne,{"data-slot":`dialog-overlay`,className:Q(`fixed inset-0 isolate z-50 bg-black/20 duration-100 motion-reduce:animate-none! dark:bg-black/45 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function F9({className:e,children:t,showCloseButton:n=!0,...r}){return(0,X.jsxs)(Lne,{children:[(0,X.jsx)(Rne,{}),(0,X.jsxs)(Dne,{"data-slot":`dialog-content`,className:Q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-4 text-[12px] text-popover-foreground shadow-[0_24px_64px_rgba(0,0,0,0.35)] duration-100 outline-none motion-reduce:animate-none! sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,X.jsxs)(xne,{"data-slot":`dialog-close`,render:(0,X.jsx)(gg,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,X.jsx)(Xi,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function zne({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`dialog-header`,className:Q(`flex flex-col gap-2`,e),...t})}function I9({className:e,...t}){return(0,X.jsx)(Ine,{"data-slot":`dialog-title`,className:Q(`font-heading text-base leading-none font-medium`,e),...t})}function Bne({className:e,...t}){return(0,X.jsx)(Sne,{"data-slot":`dialog-description`,className:Q(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Vne({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Q(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var Hne=mg(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Une({className:e,align:t=`inline-start`,...n}){return(0,X.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Q(Hne({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function Wne({className:e,...t}){return(0,X.jsx)(w9,{"data-slot":`command`,className:Q(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover text-popover-foreground`,e),...t})}function Gne({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,X.jsxs)(P9,{...a,children:[(0,X.jsxs)(zne,{className:`sr-only`,children:[(0,X.jsx)(I9,{children:e}),(0,X.jsx)(Bne,{children:t})]}),(0,X.jsx)(F9,{className:Q(`top-[120px] translate-y-0 gap-0 overflow-hidden rounded-xl! p-0 sm:max-w-[560px]`,r),showCloseButton:i,children:n})]})}function Kne({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`command-input-wrapper`,children:(0,X.jsxs)(Vne,{className:`h-12 rounded-none! border-0 border-b border-border bg-transparent px-2 shadow-none! dark:bg-transparent *:data-[slot=input-group-addon]:pl-2!`,children:[(0,X.jsx)(w9.Input,{"data-slot":`command-input`,className:Q(`w-full text-[14px] outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,X.jsx)(Une,{children:(0,X.jsx)(ii,{className:`size-4 shrink-0 opacity-50`})})]})})}function qne({className:e,...t}){return(0,X.jsx)(w9.List,{"data-slot":`command-list`,className:Q(`no-scrollbar max-h-[420px] scroll-py-2 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function Jne({className:e,...t}){return(0,X.jsx)(w9.Empty,{"data-slot":`command-empty`,className:Q(`py-6 text-center text-body text-muted-foreground`,e),...t})}function L9({className:e,...t}){return(0,X.jsx)(w9.Group,{"data-slot":`command-group`,className:Q(`overflow-hidden px-2 py-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-[11px] **:[[cmdk-group-heading]]:font-semibold **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function R9({className:e,children:t,...n}){return(0,X.jsx)(w9.Item,{"data-slot":`command-item`,className:Q(`group/command-item relative flex h-[34px] cursor-default items-center gap-2.5 rounded-[7px] px-2 text-body outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-accent data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:text-muted-foreground [&_svg:not([class*='size-'])]:size-[15px]`,e),...n,children:t})}var z9=N()(()=>({open:null}));function B9(e){z9.setState({open:e})}function V9(){return F(z9,e=>e.open)}var Yne=`frameboard.palette.recent`,H9=5;function Xne(e){return N()((t,n)=>({ids:$ne(e),record:r=>{let i=[r,...n().ids.filter(e=>e!==r)].slice(0,H9);ere(e,i)&&t({ids:i})}}))}function Zne(e=U9){return F(e,e=>e.ids)}function Qne(e,t=U9){t.getState().record(e)}function $ne(e){try{let t=JSON.parse(e?.getItem(`frameboard.palette.recent`)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`).slice(0,H9):[]}catch{return[]}}function ere(e,t){if(!e)return!1;try{return e.setItem(Yne,JSON.stringify(t)),!0}catch{return!1}}function tre(){try{return window.localStorage}catch{return null}}var U9=Xne(tre());function nre(e,t){let n=e.projects.map(({name:e})=>({ref:e,label:e}));if(t===null)return{projects:n,pages:[],frames:[]};let r=[...e.projects.filter(e=>e.name===t),...e.projects.filter(e=>e.name!==t)];return{projects:n,pages:r.flatMap(e=>e.pages.map(t=>({ref:t.ref,label:t.name,hint:e.name}))),frames:r.flatMap(e=>e.pages.flatMap(t=>t.frames.map(n=>({ref:n.ref,label:n.name,hint:`${e.name} / ${t.name}`,...n.hidden?{hidden:!0}:{}}))))}}function rre(e){va(`/p/${encodeURIComponent(e)}`)}function W9(e){let[t=``,n=``]=e.split(`/`);va(p_(t,n))}function G9(e){let[t=``,n=``]=e.split(`/`),r=`${t}/${n}`;V2(r,()=>nP(_P,r,[e]))}async function K9(e,t=Qg,n=uk){await n.flagFrames([e],`hidden`,!1),await new Promise(n=>{let r=()=>{let r=ire(t.getState().board,e);return r!==`hidden`&&(n(r===`shown`),!0)};if(r())return;let i=t.subscribe(()=>{r()&&i()})})&&G9(e)}function ire(e,t){for(let n of e?.projects??[])for(let e of n.pages){let n=e.frames.find(e=>e.ref===t);if(n)return n.hidden?`hidden`:`shown`}return`gone`}function are(e){let t=e.split(`/`).at(-1)??e;K9(e).catch(_k(`Couldn't show ${t}`))}var ore=new Set([`frame`,`arrange`,`selection`,`section`,`preview`]);function sre(){let e=V9()===`commands`;return(0,X.jsx)(Gne,{open:e,onOpenChange:e=>B9(e?`commands`:null),title:`Command palette`,description:`Search for a frame, page, project, or action to run.`,children:(0,X.jsx)(cre,{})})}function cre(){let e=$g(e=>e.board),[,t]=Fa(`/p/:project/:page?`),n=Ce().filter(e=>e.group!==`mode`&&e.group!==`theme`||!e.checked?.()),r=$g(e=>e.canWrite),{frames:i,pages:a,projects:o}=e?nre(e,t?.project??null):{frames:[],pages:[],projects:[]},[s,c]=(0,_.useState)(``),l=Zne(),u=vP(e=>t?ure(e):null),d=l.flatMap(e=>n.find(t=>t.id===e)??[]),f=n.filter(e=>!e.command?.searchOnly&&!l.includes(e.id)&&(u===null||ore.has(e.group))),p=e=>()=>{B9(null),e()},m=e=>e.map(e=>(0,X.jsx)(lre,{action:e,choose:p},e.id)),h=(e,t,n,i)=>e.map(e=>(0,X.jsxs)(R9,{value:`${i}:${e.ref}`,keywords:[e.label,e.hint??``],disabled:e.hidden&&!r,onSelect:p(()=>e.hidden?are(e.ref):n(e.ref)),children:[e.hidden?(0,X.jsx)(fn,{}):t,(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),e.hidden?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Hidden`}):null,e.hint?(0,X.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.hint}):null]},e.ref));return(0,X.jsxs)(Wne,{filter:dre,children:[(0,X.jsx)(Kne,{value:s,onValueChange:c,placeholder:`Search frames, pages, and actions`}),(0,X.jsxs)(qne,{children:[(0,X.jsx)(Jne,{children:`Nothing matches.`}),s.trim()===``?(0,X.jsxs)(X.Fragment,{children:[d.length>0?(0,X.jsx)(L9,{heading:`Recent`,children:m(d)}):null,f.length>0?(0,X.jsx)(L9,{heading:u??`Actions`,children:m(f)}):null,a.length>0?(0,X.jsx)(L9,{heading:`Pages`,children:h(a,(0,X.jsx)(vn,{}),W9,`page`)}):null]}):(0,X.jsxs)(X.Fragment,{children:[i.length>0?(0,X.jsx)(L9,{heading:`Frames`,children:h(i,(0,X.jsx)(mi,{}),G9,`frame`)}):null,a.length>0?(0,X.jsx)(L9,{heading:`Pages`,children:h(a,(0,X.jsx)(vn,{}),W9,`page`)}):null,n.length>0?(0,X.jsx)(L9,{heading:`Actions`,children:m(n)}):null,o.length>0?(0,X.jsx)(L9,{heading:`Projects`,children:h(o,(0,X.jsx)(wn,{}),rre,`project`)}):null]})]})]})}function lre({action:e,choose:t}){let n=e.command?.label??e.label,r=e.command?.icon??$t,i=pe(e.keys,fe()),a=e.command?.hint?.();return(0,X.jsxs)(R9,{value:`action:${e.id}`,keywords:[n,...e.command?.keywords??[]],onSelect:t(()=>{Qne(e.id),e.run()}),children:[(0,X.jsx)(r,{}),(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:n}),a?(0,X.jsx)(`span`,{className:`truncate text-muted-foreground`,children:a}):null,i?(0,X.jsx)(IV,{children:ie(i).map(e=>(0,X.jsx)(FV,{children:e},e))}):null]})}function ure(e){if(e.element)return`For the selected element`;let t=e.frames.length;return t===1?`For 1 frame`:t>1?`For ${t} frames`:e.section===void 0?null:`For the section`}function dre(e,t,n=[]){let r=t.trim().toLowerCase();return r===``?1:Math.max(...n.map(e=>{let t=e.toLowerCase();return t.startsWith(r)?1:t.includes(r)?.8:q9(t.split(/[^\p{L}\p{N}]+/u).filter(Boolean),r.replace(/\s+/g,``))?.3:0}))}function q9(e,t){return t===``||e.some((n,r)=>{for(let i=fre(n,t);i>0;--i)if(q9(e.slice(r+1),t.slice(i)))return!0;return!1})}function fre(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n+=1;return n}var J9=H?`⌘`:`Ctrl`,Y9=H?`⇧`:`Shift`,pre=H?`⌃`:`Ctrl`,X9=[{title:`Tools`,rows:[{label:`Move`,actions:[`tool.move`]},{label:`Hand`,actions:[`tool.hand`]},{label:`Frame`,actions:[`tool.frame`]},{label:`Text`,actions:[`tool.text`]},{label:`Rectangle, ellipse, divider`,actions:[`tool.rectangle`,`tool.ellipse`,`tool.divider`]},{label:`Note`,actions:[`tool.note`]},{label:`Find`,actions:[`find.open`]},{label:`Command palette`,actions:[`palette.open`]},{label:`This list`,actions:[`help.shortcuts`]},{label:`All projects`,actions:[`nav.home`]}]},{title:`Selection`,rows:[{label:`Into an element`,gestures:[`${J9} click`]},{label:`One level down`,actions:[`element.down`]},{label:`One level up`,actions:[`element.up`]},{label:`Next sibling`,actions:[`element.next`]},{label:`Add to selection`,gestures:[`${Y9} click`]}]},{title:`View`,rows:[{label:`Zoom to fit`,actions:[`view.zoomToFit`]},{label:`Zoom to selection`,actions:[`view.zoomToSelection`]},{label:`Zoom to 100%`,actions:[`view.zoom100`]},{label:`Hide UI`,actions:[`view.hideUi`]},{label:`Undo`,actions:[`edit.undo`]},{label:`Redo`,actions:[`edit.redo`]}]},{title:`Frames`,rows:[{label:`Nudge`,gestures:[`Arrows`]},{label:`Bigger nudge`,gestures:[`${Y9} Arrows`]},{label:`Resize`,gestures:[`${J9} Arrows`]},{label:`Duplicate`,actions:[`frame.duplicate`]},{label:`Copy as PNG`,actions:[`frame.copyPng`]},{label:`Hide`,actions:[`frame.hide`]},{label:`Lock`,actions:[`frame.lock`]},{label:`Delete`,actions:[`frame.delete`]}]},{title:`Arrange`,rows:[{label:`Align left, right`,actions:[`arrange.alignLeft`,`arrange.alignRight`]},{label:`Align top, bottom`,actions:[`arrange.alignTop`,`arrange.alignBottom`]},{label:`Center`,actions:[`arrange.alignCenter`,`arrange.alignMiddle`]},{label:`Distribute`,actions:[`arrange.distributeHorizontal`,`arrange.distributeVertical`]},{label:`Snap off while dragging`,gestures:[`${pre} drag`]}]},{title:`Agents`,rows:[{label:`Show the agent change`,actions:[`changes.show`]},{label:`Next change`,actions:[`changes.next`]},{label:`Previous change`,actions:[`changes.previous`]},{label:`Mark all agent changes seen`,actions:[`changes.markAllSeen`]}]}],Z9=[{title:`Projects`,rows:[{label:`Move between projects`,gestures:[`Arrows`],characterGestures:[`H J K L`]},{label:`First, last`,gestures:[`Home`,`End`]},{label:`Open`,gestures:[`↵`]},{label:`Rename`,gestures:[`F2`]},{label:`Delete`,gestures:[`Delete`]},{label:`Menu`,gestures:[`${Y9} F10`]}]},{title:`General`,rows:[{label:`Command palette`,actions:[`palette.open`]},{label:`This list`,actions:[`help.shortcuts`]},{label:`Undo`,actions:[`edit.undo`]},{label:`Redo`,actions:[`edit.redo`]}]}],Q9=[...X9,...Z9].flatMap(e=>e.rows.flatMap(e=>e.actions??[]));function mre(){let e=V9()===`shortcuts`,[t]=Fa(`/`),n=t?Z9:X9,r=xe(Q9),i=new Map(Q9.map((e,t)=>[e,r[t]]));return(0,X.jsx)(P9,{open:e,onOpenChange:e=>B9(e?`shortcuts`:null),children:(0,X.jsxs)(F9,{showCloseButton:!1,className:`top-[90px] translate-y-0 gap-0 p-0 sm:max-w-[760px]`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 items-center gap-4 border-b border-border px-4 text-[14px]`,children:[(0,X.jsx)(I9,{className:`text-[14px] leading-none font-semibold`,children:`Keyboard shortcuts`}),(0,X.jsx)(hre,{}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Esc`})]}),(0,X.jsx)(`div`,{className:Q(`grid gap-x-7 gap-y-[18px] px-5 pt-4 pb-5`,t?`grid-cols-[1.3fr_1fr_1fr]`:`grid-cols-3`),children:n.map(e=>(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`pb-1.5 text-label text-muted-foreground`,children:e.title}),(0,X.jsx)(`ul`,{children:e.rows.map(e=>(0,X.jsx)(gre,{row:e,byId:i,spaced:t},e.label))})]},e.title))})]})})}function hre(){let e=fe();return(0,X.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-body text-muted-foreground`,children:[`Single-key shortcuts`,(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>ue(!e),className:`relative h-4 w-7 shrink-0 rounded-full bg-muted outline-none focus-visible:ring-2 focus-visible:ring-ring/50 aria-checked:bg-primary`,children:(0,X.jsx)(`span`,{"aria-hidden":!0,className:Q(`absolute top-0.5 left-0.5 size-3 rounded-full bg-background shadow-sm transition-transform motion-reduce:transition-none`,e&&`translate-x-3`)})})]})}function gre({row:e,byId:t,spaced:n}){let r=fe(),i=[...(e.actions??[]).flatMap(e=>{let n=t.get(e)?.keys?.[0];return n?[{text:ie(n).join(H?` `:`+`),off:!r&&se(n)}]:[]}),...(e.gestures??[]).map(e=>({text:e,off:!1})),...(e.characterGestures??[]).map(e=>({text:e,off:!r}))],a=e.actions!==void 0&&e.actions.every(e=>!t.get(e));return(0,X.jsxs)(`li`,{"aria-disabled":a||void 0,className:Q(`flex h-[26px] items-center justify-between aria-disabled:text-faint`,n&&`gap-3.5`),children:[(0,X.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,X.jsx)(IV,{children:i.map(e=>(0,X.jsx)(FV,{"data-off":e.off||void 0,className:`px-1.5 text-label font-normal whitespace-nowrap data-off:text-faint`,children:e.text},e.text))})]})}var _re={[Dv]:Av,[nv]:Lv},vre=1.6;function yre(){return(0,X.jsx)(ze,{strokeWidth:vre,children:(0,X.jsx)(zX,{delay:500,children:(0,X.jsxs)(Ag,{bodies:_re,children:[(0,X.jsx)(bre,{}),(0,X.jsx)(sre,{}),(0,X.jsx)(mre,{})]})})})}function bre(){let e=$g(e=>e.board?.projects),t=$g(e=>e.connected);return(0,_.useEffect)(()=>n_(),[]),(0,X.jsxs)(`div`,{className:`relative h-svh overflow-auto bg-background text-foreground`,children:[e?(0,X.jsxs)(Ha,{children:[(0,X.jsx)(za,{path:`/`,children:(0,X.jsx)(B6,{projects:e})}),(0,X.jsx)(za,{path:`/p/:project/:page`,children:({project:e,page:t})=>(0,X.jsx)(z3,{project:e,page:t})}),(0,X.jsx)(za,{path:`/p/:project`,children:({project:e})=>(0,X.jsx)(z3,{project:e})}),(0,X.jsx)(za,{children:(0,X.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6`,children:[(0,X.jsx)(`p`,{className:`text-body text-muted-foreground`,children:`Nothing on the board at this address.`}),(0,X.jsx)(Ba,{href:`/`,className:hg({variant:`outline`}),children:`Go home`})]})})]}):(0,X.jsx)(`p`,{role:`status`,className:`flex h-full items-center justify-center text-body text-muted-foreground`,children:`Connecting to the board`}),e&&!t?(0,X.jsx)(`p`,{role:`status`,className:`absolute top-3 left-1/2 -translate-x-1/2 rounded-xl border border-border bg-card px-3 py-1 text-body text-muted-foreground`,children:`Reconnecting to frameboard serve`}):null,e?(0,X.jsx)(d_,{}):null]})}function xre(e,t,n){return e.elements.length===t.elements.length&&e.elements.every((e,r)=>{let i=t.elements[r];return i!==void 0&&i.index===e.index&&i.parent===e.parent&&i.tag===e.tag&&(e.index===n||i.name===e.name)})&&t.elements.some(e=>e.index===n)}function Sre({store:e=Qg,calls:t=uk,navigate:n=va,selection:r=_P,notify:i=e=>_g.add({...e,type:`warning`}),mac:a=H,treeAt:o=async(e,t)=>{await OB(e,t);let n=await kB(e);return n?.hash===t?n:null}}={}){let s=(e,t)=>{bN(e.frames);for(let[t,n]of Object.entries(e.hashes??{}))pP(t,n);let{page:i,element:a}=r.getState(),s=a?e.hashes?.[a.frame]:void 0;if(i&&a&&s&&o(a.frame,s).then(e=>{r.getState().element===a&&(t?.hash===a.hash&&e&&xre(t,e,a.index)?iP(r,i,{...a,hash:s}):nP(r,i,[a.frame]))}),e.page===null)return;let[c=``,l=``]=e.page.split(`/`);n(p_(c,l))},c=(t,n,a)=>()=>{let c=()=>{},l=null,u=e.getState().history;ik([],a,async()=>{c=dP(null);let e=r.getState().element;return l=e?await o(e.frame,e.hash):null,t().catch(e=>{throw c(),e})},{live:e,dropWhen:({history:e})=>e.undo!==u.undo||e.redo!==u.redo}).then(e=>{c(),s(e,l),gP(r,UB)},e=>{c(),hP(r,UB),e instanceof wx&&e.code!==`nothing-to-undo`&&i({title:n,description:e.message})})},l=t=>()=>{let{canWrite:n,history:r}=e.getState();return n&&r[t]>0},u=ye([{id:`edit.undo`,label:`Undo`,group:`edit`,keys:[`$mod+KeyZ`],run:c(t.undo,`Undo skipped`,`undo`),enabled:l(`undo`),command:{label:`Undo`,icon:Ki}},{id:`edit.redo`,label:`Redo`,group:`edit`,keys:a?[`$mod+Shift+KeyZ`]:[`$mod+Shift+KeyZ`,`Control+KeyY`],run:c(t.redo,`Redo skipped`,`redo`),enabled:l(`redo`),command:{label:`Redo`,icon:Hr}}]),d=e.subscribe((e,t)=>{(e.history!==t.history||e.canWrite!==t.canWrite)&&G()});return()=>{d(),u()}}function Cre(){let e=ye([{id:`palette.open`,label:`Command palette`,group:`help`,palette:!1,keys:[`$mod+KeyK`],run:()=>B9(`commands`)},{id:`help.shortcuts`,label:`Keyboard shortcuts`,group:`help`,keys:[`Shift+?`],run:()=>B9(`shortcuts`),command:{label:`Keyboard shortcuts`,icon:Ut}},{id:`help.characterKeys`,label:`Single-key shortcuts`,group:`help`,run:()=>ue(!de()),checked:de,command:{get label(){return de()?`Turn single-key shortcuts off`:`Turn single-key shortcuts on`},icon:Rn}}]),t=_e.subscribe(G);return()=>{t(),e()}}var wre=[{choice:`system`,label:`System`,icon:mr},{choice:`light`,label:`Light`,icon:bi},{choice:`dark`,label:`Dark`,icon:gr}];function Tre(e=jM){let t=ye([{id:`theme.toggle`,label:`Theme`,group:`view`,command:{label:`Toggle theme`,icon:vi,keywords:[`dark`,`light`,`mode`]},run:()=>SM(e)},...wre.map(({choice:t,label:n,icon:r})=>({id:`theme.${t}`,label:n,group:`theme`,command:{label:`Use the ${n.toLowerCase()} theme`,icon:r,keywords:[`appearance`,`mode`]},run:()=>xM(t,e),checked:()=>e.getState().choice===t}))]),n=e.subscribe(G);return()=>{n(),t()}}var $9=document.getElementById(`root`);if(!$9)throw Error(`Missing #root element`);tK(window.location.pathname),pv(),Pz(Qg,{onShow:ov,onDisconnect:mv}),yM(jM,bM(window)),Tre(),Sre(),Cre(),Te(window),(0,v.createRoot)($9).render((0,X.jsx)(_.StrictMode,{children:(0,X.jsx)(yre,{})}));