@samva/vite 0.9.0 → 0.10.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.
@@ -1,32 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,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 ee={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ee,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),ee=Symbol.for(`react.lazy`),B=Symbol.for(`react.activity`),te=Symbol.for(`react.legacy_hidden`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.for(`react.view_transition`),V=Symbol.for(`react.recoverable`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case B:return`Activity`;case re: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?se(e.type)||`Memo`:t;case ee:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,H=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function U(e){return{current:e}}function pe(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function me(e,t){fe++,de[fe]=e.current,e.current=t}var he=U(null),ge=U(null),_e=U(null),ve=U(null);function ye(e,t){switch(me(_e,t),me(ge,e),me(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bp(t),e=xp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(he),me(he,e)}function be(){pe(he),pe(ge),pe(_e)}function xe(e){var t=e.memoizedState;t!==null&&(hh._currentValue=t.memoizedState,me(ve,e)),t=he.current;var n=xp(t,e.type);t!==n&&(me(ge,e),me(he,n))}function Se(e){ge.current===e&&(pe(he),pe(ge)),ve.current===e&&(pe(ve),hh._currentValue=ue)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+Ce+e+we}var Ee=!1;function De(e,t){if(!e||Ee)return``;Ee=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}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{Ee=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Te(n):``}function Oe(e,t){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te(`Lazy`);case 13:return e.child!==t&&t!==null?Te(`Suspense Fallback`):Te(`Suspense`);case 19:return Te(`SuspenseList`);case 0:case 15:return De(e.type,!1);case 11:return De(e.type.render,!1);case 1:return De(e.type,!0);case 31:return Te(`Activity`);case 30:return Te(`ViewTransition`);default:return``}}function ke(e){try{var t=``,n=null;do t+=Oe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Ae=Object.prototype.hasOwnProperty,je=t.unstable_scheduleCallback,Me=t.unstable_cancelCallback,Ne=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Fe=t.unstable_now,Ie=t.unstable_getCurrentPriorityLevel,Le=t.unstable_ImmediatePriority,Re=t.unstable_UserBlockingPriority,ze=t.unstable_NormalPriority,Be=t.unstable_LowPriority,Ve=t.unstable_IdlePriority,He=t.log,Ue=t.unstable_setDisableYieldValue,We=null,Ge=null;function Ke(e){if(typeof He==`function`&&Ue(e),Ge&&typeof Ge.setStrictMode==`function`)try{Ge.setStrictMode(We,e)}catch{}}var qe=Math.clz32?Math.clz32:Xe,Je=Math.log,Ye=Math.LN2;function Xe(e){return e>>>=0,e===0?32:31-(Je(e)/Ye|0)|0}var Ze=256,Qe=262144,$e=4194304;function et(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 tt(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=et(n))):i=et(o):i=et(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=et(n))):i=et(o)):i=et(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 nt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-qe(n),i=1<<r;t|=e[r],n&=~i}return t}function it(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 at(){var e=$e;return $e<<=1,!($e&62914560)&&($e=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-qe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&lt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-qe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=le.p;return e===0?(e=window.event,e===void 0?32:jh(e.type)):e}function ht(e,t){var n=le.p;try{return le.p=e,t()}finally{le.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt,Tt=`__reactLoad$`+gt;function Et(e){delete e[_t],delete e[vt],delete e[xt],delete e[St]}function Dt(e){var t;if(t=e[_t])return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xm(e);e!==null;){if(n=e[_t])return n;e=xm(e)}return t}e=n,n=e.parentNode}return null}function Ot(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function At(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function jt(e){e[wt]=!0}function Mt(e){e[Tt]=void 0}var Nt=new Set,Pt={};function Ft(e,t){It(e,t),It(e+`Capture`,t)}function It(e,t){for(Pt[e]=t,e=0;e<t.length;e++)Nt.add(t[e])}var Lt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Rt={},zt={};function Bt(e){return Ae.call(zt,e)?!0:Ae.call(Rt,e)?!1:Lt.test(e)?zt[e]=!0:(Rt[e]=!0,!1)}var Vt=!1;function Ht(){var e=Vt;return Vt=!1,e}function Ut(e,t,n){if(Bt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Gt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Jt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yt(e){if(!e._valueTracker){var t=qt(e)?`checked`:`value`;e._valueTracker=Jt(e,t,``+e[t])}}function Xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Zt=/[\n"\\]/g;function Qt(e){return e.replace(Zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function $t(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Kt(t)):e.value!==``+Kt(t)&&(e.value=``+Kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):tn(e,Kt(n)):o===`number`&&e.value==t?tn(e,Kt(e.value)):tn(e,Kt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Kt(s):e.removeAttribute(`name`)}function en(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)){Yt(e);return}n=n==null?``:``+Kt(n),t=t==null?n:``+Kt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Yt(e)}function tn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function nn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Kt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function rn(e,t,n){if(t!=null&&(t=``+Kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Kt(n)}function an(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ce(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Yt(e)}function on(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sn=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 cn(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||sn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function ln(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Vt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(cn(e,a,r),Vt=!0)}else for(var o in t)t.hasOwnProperty(o)&&cn(e,o,t[o])}function un(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 dn=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`]]),fn=/^[\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 pn(e){return fn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function mn(){}var hn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _n=null,vn=null;function yn(e){var t=Ot(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if($t(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="`+Qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));$t(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&&Xt(r)}break a;case`textarea`:rn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&nn(e,!!n.multiple,t,!1)}}}var bn=!1;function xn(e,t,n){if(bn)return e(t,n);bn=!0;try{return e(t)}finally{if(bn=!1,(_n!==null||vn!==null)&&(Kd(),_n&&(t=_n,e=vn,vn=_n=null,yn(t),e)))for(t=0;t<e.length;t++)yn(e[t])}}function Sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),wn=!1;if(Cn)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){wn=!0}}),window.addEventListener(`test`,Tn,Tn),window.removeEventListener(`test`,Tn,Tn)}catch{wn=!1}var En=null,Dn=null,On=null;function kn(){if(On)return On;var e,t=Dn,n=t.length,r,i=`value`in En?En.value:En.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 On=i.slice(e,1<r?1-r:void 0)}function An(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 jn(){return!0}function Mn(){return!1}function Nn(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)?jn:Mn,this.isPropagationStopped=Mn,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=jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Nn(Pn),In=D({},Pn,{view:0,detail:0}),Ln=Nn(In),Rn,zn,Bn,Vn=D({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,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!==Bn&&(Bn&&e.type===`mousemove`?(Rn=e.screenX-Bn.screenX,zn=e.screenY-Bn.screenY):zn=Rn=0,Bn=e),Rn)},movementY:function(e){return`movementY`in e?e.movementY:zn}}),Hn=Nn(Vn),Un=Nn(D({},Vn,{dataTransfer:0})),Wn=Nn(D({},In,{relatedTarget:0})),Gn=Nn(D({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Nn(D({},Pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Nn(D({},Pn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Nn(D({},In,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=An(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?An(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?An(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Nn(D({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Nn(D({},Pn,{submitter:0})),nr=Nn(D({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),rr=Nn(D({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Nn(D({},Vn,{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})),ar=Nn(D({},Pn,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=Cn&&`CompositionEvent`in window,cr=null;Cn&&`documentMode`in document&&(cr=document.documentMode);var lr=Cn&&`TextEvent`in window&&!cr,ur=Cn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=kn(),On=Dn=En=null,hr=!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 ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){_n?vn?vn.push(r):vn=[r]:_n=r,t=rp(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Yf(e,0)}function wr(e){if(Xt(kt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Cn){var Dr;if(Cn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,gn(e)),xn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(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(!Ae.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(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 Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(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=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(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=zr(e.document)}return t}function Wr(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 Gr=Cn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(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}),Jr&&Rr(Jr,r)||(Jr=r,r=rp(qr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};Cn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Ft(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Dd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Fd;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 hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=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)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[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&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-qe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Id)throw Id=0,Ld=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(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 Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(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 ji(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 Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=th(e,n,he.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case B:return e=Oi(31,n,t,a),e.elementType=B,e.lanes=o,e;case j:return Ni(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Oi(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Oi(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Oi(19,n,t,a),e.elementType=R,e.lanes=o,e;case te:case re:return e=a|32,e=Oi(30,n,t,e),e.elementType=re,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case ee:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:ke(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:ke(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-qe(r)-1;r&=~(1<<i),n+=1;var a=32-qe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-qe(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,ta=!1,na=null,ra=!1,ia=Error(i(519));function aa(e){throw da(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:Xf(`cancel`,t),Xf(`close`,t);break;case`iframe`:case`object`:case`embed`:Xf(`load`,t);break;case`video`:case`audio`:for(n=0;n<qf.length;n++)Xf(qf[n],t);break;case`source`:Xf(`error`,t);break;case`img`:case`image`:case`link`:Xf(`error`,t),Xf(`load`,t);break;case`details`:Xf(`toggle`,t);break;case`input`:Xf(`invalid`,t),en(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Xf(`invalid`,t);break;case`textarea`:Xf(`invalid`,t),an(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||lp(t.textContent,n)?(r.popover!=null&&(Xf(`beforetoggle`,t),Xf(`toggle`,t)),r.onScroll!=null&&Xf(`scroll`,t),r.onScrollEnd!=null&&Xf(`scrollend`,t),r.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:$i=$i.return}}function ca(e){if(e!==$i)return!1;if(!ta)return sa(e),ta=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Cp(e.type,e.memoizedProps)),n=!n),n&&ea&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=bm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=bm(e)}else t===27?(t=ea,jp(e.type)?(e=ym,ym=null,ea=e):ea=t):ea=$i?vm(e.stateNode.nextSibling):null;return!0}function la(){ea=$i=null,ta=!1}function ua(){var e=na;return e!==null&&(yd===null?yd=e:yd.push.apply(yd,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=U(null),pa=null,ma=null;function ha(e,t,n){me(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,pe(fa)}function _a(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 va(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),_a(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),_a(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),_a(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 ya(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;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ve.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[hh]:e.push(hh))}a=a.return}return e!==null&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(i(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=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()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(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 Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=Hf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(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 Va=H.S;H.S=function(e,t){if(Sd=Fe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=Of;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=Of;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=U(null);function Ua(){var e=Ha.current;return e===null?rd.pooledCache:e}function Wa(e,t){t===null?me(Ha,Ha.current):me(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(i(460)),qa=Error(i(474)),Ja=Error(i(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(mn,mn);else{if(e=rd,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,to(e),e}throw $a=t,Ka}}function Qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(i(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(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 so(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=Ai(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=Pi(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),ao(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ee&&Qa(i)===t.type)?(t=a(t,n.props),ao(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),ao(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=Ii(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=Ni(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=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case A:return t=Ii(t,e.mode,n),t.return=e,t;case ee:return t=Qa(t),f(e,t,n)}if(ce(t)||ae(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===F)return f(e,Ca(e,t),n);oo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ee:return n=Qa(n),p(e,t,n,r)}if(ce(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===F)return p(e,t,Ca(e,n),r);oo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ee:return r=Qa(r),m(e,t,n,r,i)}if(ce(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===F)return m(e,t,n,Ca(t,r),i);oo(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),ta&&Ji(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 ta&&Ji(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)}),ta&&Ji(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),ta&&Ji(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 ta&&Ji(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)}),ta&&Ji(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),ao(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ee&&Qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ao(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ni(o.props.children,e.mode,c,o.key),ao(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),ao(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=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case ee:return o=Qa(o),_(e,r,o,c)}if(ce(o))return h(e,r,o,c);if(ae(o)){if(l=ae(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,io(o),c);if(o.$$typeof===F)return _(e,r,Ca(e,o),c);oo(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=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var co=so(!0),lo=so(!1),uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function po(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 mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ho(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,nd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function go(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,ut(e,n)}}function _o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vo=!1;function yo(){if(vo){var e=La;if(e!==null)throw e}}function bo(e,t,n,r){vo=!1;var i=e.updateQueue;uo=!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?(ad&f)===f:(r&f)===f){f!==0&&f===Ia&&(vo=!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:uo=!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),pd|=o,e.lanes=o,e.memoizedState=d}}function xo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function So(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xo(n[e],t)}var Co=U(null),wo=U(0);function To(e,t){e=dd,me(wo,e),me(Co,t),dd=e|t.baseLanes}function Eo(){me(wo,dd),me(Co,Co.current)}function Do(){dd=wo.current,pe(Co),pe(wo)}var Oo=U(null),ko=null;function Ao(e){var t=e.alternate;me(Fo,Fo.current&1),me(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){me(Fo,Fo.current),me(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(me(Fo,Fo.current),me(Oo,e),ko===null&&(ko=e)):No()}function No(){me(Fo,Fo.current),me(Oo,Oo.current)}function Po(e){pe(Oo),ko===e&&(ko=null),pe(Fo)}var Fo=U(0);function Io(e,t){me(Oo,Oo.current),me(Fo,t)}function Lo(e){pe(Fo),pe(Oo),ko===e&&(ko=null)}function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hm(n)||gm(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 zo=0,Bo=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return zo=a,Bo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?hc:gc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){H.H=mc;var t=Vo!==null&&Vo.next!==null;if(zo=0,Ho=Vo=Bo=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&ba(e)&&(Nc=!0))}function es(e,t,n,r){Bo=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}H.H=_c,o=t(n,r)}while(Wo);return o}function ts(){var e=H.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(Bo.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}zo=0,Ho=Vo=Bo=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(Vo===null){var e=Bo.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?Bo.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw Bo.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=Za(Jo,e,t),t=Bo,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?hc:gc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===V)return;if(e.$$typeof===F)return Sa(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=Bo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Bo.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=ss(),Bo.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]=ne;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),Vo,e)}function ps(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?(zo&f)===f:(ad&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===Ia&&(d=!0);else if((zo&p)===p){u=u.next,p===Ia&&(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,Bo.lanes|=p,pd|=p;f=u.action,Go&&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,Bo.lanes|=f,pd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Nc=!0,d&&(n=La,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 ms(e){var t=os(),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);Lr(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=Bo,a=os(),o=ta;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,rd===null)throw Error(i(349));o||zo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Bo.updateQueue,t===null?(t=ss(),Bo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function bs(e){var t=Ci(e,2);t!==null&&Vd(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){Ke(!0);try{n()}finally{Ke(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,Vo,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(dc(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)}};H.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=H.T,o={};o.types=a===null?null:a.types,H.T=o;try{var s=n(i,r),c=H.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),H.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(ta){var n=rd.formState;if(n!==null){a:{var r=Bo;if(ta){if(ea){b:{for(var i=ea,a=ra;i.nodeType!==8;){if(!a){i=null;break b}if(i=vm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=vm(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,Bo,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,Bo,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,Bo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),Vo,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Bo.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=Vo;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Bo.updateQueue,t===null&&(t=ss(),Bo.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 Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();Bo.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Zo(r,Vo.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(Bo.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){Bo.flags|=4;var t=Bo.updateQueue;if(t===null)t=ss(),Bo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(nd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(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 Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){Ke(!0);try{e()}finally{Ke(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||zo&1073741824&&!(ad&261930)?e.memoizedState=t:(e.memoizedState=n,e=zd(),Bo.lanes|=e,pd|=e,n)}function Zs(e,t,n,r){return Lr(n,t)?n:Co.current===null?!(zo&106)||zo&1073741824&&!(ad&261930)?(Nc=!0,e.memoizedState=n):(e=zd(),Bo.lanes|=e,pd|=e,t):(e=Xs(e,n,r),Lr(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=le.p;le.p=a!==0&&8>a?a:8;var o=H.T,s={};s.types=o===null?null:o.types,H.T=s,uc(e,!1,t,n);try{var c=i(),l=H.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Ba(c,r),Rd(e)):lc(e,t,r,Rd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Rd())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),H.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,ue,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Rd())}function rc(){return Sa(hh)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Rd();e=mo(n);var r=ho(t,e,n);r!==null&&(Vd(r,t,n),go(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Rd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=Si(e,t,n,r),n!==null&&(Vd(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Rd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(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,Lr(s,o))return xi(e,t,i,0),rd===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Vd(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Hf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Vd(t,e,2)}function dc(e){var t=e.alternate;return e===Bo||t!==null&&t===Bo}function fc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var mc={readContext:Sa,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},hc={readContext:Sa,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){Ke(!0);try{e()}finally{Ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){Ke(!0);try{n(t)}finally{Ke(!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=sc.bind(null,Bo,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,Bo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,Bo,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Bo,a=as();if(ta){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),rd===null)throw Error(i(349));ad&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=rd.identifierPrefix;if(ta){var n=qi,r=Ki;n=(r&~(1<<32-qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,Bo,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,Bo)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if(nd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return Vo===null?Xs(n,e,t):Zs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(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 yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=mo(r);i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Vd(t,e,r),go(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=mo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Vd(t,e,r),go(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rd(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=ho(e,r,n),t!==null&&(Vd(t,e,n),go(t,e,n))}};function bc(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?!Rr(n,r)||!Rr(i,a):!0}function xc(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&&yc.enqueueReplaceState(t,t.state,null)}function Sc(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 Cc(e){gi(e)}function wc(e){console.error(e)}function Tc(e){gi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(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 Oc(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=mo(e),e.tag=3,e}function Ac(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(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(Td===null?Td=new Set([this]):Td.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,a,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?$d():n.alternate===null&&fd===0&&(fd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Sf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ya?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)),Sf(e,r,a)),!1}throw Error(i(435,n.tag))}return Sf(e,r,a),$d(),!1}if(ta)return t=Oo.current,t===null?(r!==ia&&(t=Error(i(423),{cause:r}),da(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Oc(e.stateNode,r,a),_o(e,a),fd!==4&&(fd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ia&&(e=Error(i(422),{cause:r}),da(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),vd===null?vd=[o]:vd.push(o),fd!==4&&(fd=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),_o(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`&&(Td===null||!Td.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),_o(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?lo(t,null,n,r):co(t,e.child,n,r)}function Fc(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 xa(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(ta&&s&&Xi(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(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 Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),Eo(),No()):(Wa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),Eo(),Mo(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return co(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Po(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ta){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(jo(t),(e=ea)?(e=mm(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(jo(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||ya(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(Co.current===null){if(r=rd,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Vd(r,e,s),Mc;$d()}t=Hc(e,t,n)}else e=o.treeContext,ea=vm(s.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(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 Gc(e,t,n,r,i){return xa(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(ta&&r&&Xi(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!Nc?(rs(e,t,a),ll(e,t,a)):(ta&&r&&Xi(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},fo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(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&&yc.enqueueReplaceState(a,a.state,null),bo(t,r,a,i),yo(),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=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=Sa(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)&&xc(t,a,r,o),uo=!1;var f=t.memoizedState;a.state=f,bo(t,r,a,i),yo(),l=t.memoizedState,s||f!==l||uo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=uo||bc(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,po(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=Sa(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)&&xc(t,a,r,c),uo=!1,f=t.memoizedState,a.state=f,bo(t,r,a,i),yo();var p=t.memoizedState;o!==d||f!==p||uo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=uo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(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,Wc(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=co(t,e.child,null,i),t.child=co(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return la(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ga()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=gd),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Fo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ta){if(i?Ao(t):No(),(e=ea)?(e=mm(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=gm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(Ao(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=Ai(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 $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return co(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(No(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,co(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),gm(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,da({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||ya(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(Co.current!==null)return tl(e,t,c);if(r=rd,r!==null&&(a=dt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Vd(r,e,a),Mc;return hm(o)||$d(),tl(e,t,c)}return hm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=vm(o.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ro(n)===null&&(t=e),e=e.sibling}return t}function al(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 ol(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 sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Fo.current;if(t.flags&128)return Io(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Io(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=ta?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(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=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(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&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(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=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function dl(e,t,n){switch(t.tag){case 3:ye(t,t.stateNode.containerInfo),ha(t,Oa,e.memoizedState.cache),la();break;case 27:case 5:xe(t);break;case 4:ye(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(Ao(t),e=ll(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Io(t,Fo.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,ta&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=se(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(ye(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,po(e,t),bo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==o.cache&&va(t,[Oa],n,!0),yo(),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=Jc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),da(a),t=Jc(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(ea=vm(e.firstChild),$i=t,ta=!0,na=null,ra=!0,n=lo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(la(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ta||(t.stateNode=Sp(t.type,t.pendingProps,_e.current,t)):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xe(t),e===null&&ta&&(r=t.stateNode=wm(t.type,t.pendingProps,_e.current),$i=t,ra=!0,a=ea,jp(t.type)?(ym=a,ea=vm(r.firstChild)):ea=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ta&&((a=r=ea)&&(r=fm(r,t.type,t.pendingProps,ra),r===null?a=!1:(t.stateNode=r,$i=t,ea=vm(r.firstChild),ra=!1,a=!0)),a||aa(t)),xe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Cp(a,o)?r=null:s!==null&&Cp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),hh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&ta&&((e=n=ea)&&(n=pm(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||aa(t)),null;case 13:return Qc(e,t,n);case 4:return ye(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,xa(t),a=Sa(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=rd,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},fo(t),ha(t,Oa,a)):((e.lanes&n)!==0&&(po(e,t),bo(t,null,null,n),yo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ha(t,Oa,r),r!==a.cache&&va(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ha(t,Oa,r))),Pc(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:ta&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?nh(t,r):nh(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(Xd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rh(t)){if(Xd())e.flags|=8192;else throw $a=Ya,qa}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,_d|=t)}function _l(e,t){if(!ta)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 vl(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 yl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Oa),be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(Se(t),n=_e.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=he.current,ca(t)?oa(t,e):(e=wm(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=he.current,ca(t))oa(t,o);else{var s=yp(_e.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[_t]=t,o[vt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(fp(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&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=_e.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$i,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||aa(t,!0)}else e=yp(e).createTextNode(r),e[_t]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[_t]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Po(t),t):(Po(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ca(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[_t]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Po(t),t):(Po(t),null)}return Po(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),gl(t,t.updateQueue),vl(t),null);case 4:return be(),e===null&&$f(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return ga(t.type),vl(t),null;case 19:if(Lo(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(fd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ro(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Io(t,Fo.current&1|2),ta&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Fe()>Cd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ta)return vl(t),null}else 2*Fe()-r.renderingStartTime>Cd&&n!==536870912&&(t.flags|=128,a=!0,_l(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=Fe(),e.sibling=null,o=Fo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ta?Io(t,o):(n=o,me(Oo,t),me(Fo,n),ko===null&&(ko=t)),ta&&Ji(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Po(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&pe(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Oa),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Oa),be(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(Po(t),t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(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 be(),null;case 10:return ga(t.type),null;case 22:case 23:return Po(t),Do(),e!==null&&pe(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Oa),null;case 25:return null;default:return null}}function xl(e,t){switch(Zi(t),t.tag){case 3:ga(Oa),be();break;case 26:case 27:case 5:Se(t);break;case 4:be();break;case 31:t.memoizedState!==null&&Po(t);break;case 13:Po(t);break;case 19:Lo(t);break;case 10:ga(t.type);break;case 22:case 23:Po(t),Do(),e!==null&&pe(Ha);break;case 24:ga(Oa)}}function Sl(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){xf(t,t.return,e)}}function Cl(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){xf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){xf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{So(t,n)}catch(t){xf(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){xf(e,t,n)}}function El(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=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Up(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Wp(e);h(e.child,!1,sm,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){xf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){xf(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){xf(e,t,n)}else n.current=null}}function Ol(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++)lm(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&lm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&um(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(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){xf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[vt]=t}catch(t){xf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jp(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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&&jp(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 Ll(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=mn)),Ol(e,r),Vt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,jp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),Vt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,jp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[_t]=e,t[vt]=n}catch(t){xf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Lp(o);r.push(s),s.view&&(a=!0)}else a||Lp(o).view&&(a=!0);Bl=!0,Pp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Fp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(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=hi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Bd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;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=hi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Bd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Bd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Bd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(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,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Lp(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&&Pp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Rp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Bd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,ou=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,_p=wh,e=Ur(e),Wr(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(vp={focusedElem:e,selectionRange:r},wh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&$l(e),gu(n))}}Vl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){xf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)dm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:dm(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=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Sl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){xf(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){xf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Lu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{So(e,t)}catch(e){xf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Tf.bind(null,n),_m(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||ou;t=au,i=ou,au=r,(ou=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),au=t,ou=i}break;case 30:Lu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){xf(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Vt=!0}catch(t){xf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Np(s,!0):Np(e.stateNode,!1)}catch(t){xf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Et(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(Ge&&typeof Ge.onCommitFiberUnmount==`function`)try{Ge.onCommitFiberUnmount(We,n)}catch{}switch(n.tag){case 26:ou||Dl(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ou&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ou||Dl(n,t),Al(n);var r=Su,i=Cu;jp(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),Tm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:ou||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),Vt=!0}catch(e){xf(n,t,e)}else try{Su.removeChild(n.stateNode),Vt=!0}catch(e){xf(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Mp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Xh(e)):Mp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),ou||Cl(4,n,t),wu(e,t,n);break;case 1:ou||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:ou=(r=ou)||n.memoizedState!==null,wu(e,t,n),ou=r;break;case 30:Dl(n,t),wu(e,t,n);break;case 7:ou||Dl(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xh(e)}catch(e){xf(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xh(e)}catch(e){xf(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ef.bind(null,e,t);t.then(r,r)}})}function Au(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(jp(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(i(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Au(t,e,n),Nu(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(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(au)e.stateNode=Sp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[wt]||r[_t]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[_t]=e,jt(r),t=r;break a;case`link`:if(o=$m(`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),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=$m(`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),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[_t]=e,jt(r),t=r}e.stateNode=t}}else au||eh(o,e.type,e.stateNode)}else e.stateNode=Jm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ou||t.parentNode.removeChild(t)):a.count--,n===null?au||eh(o,e.type,e.stateNode):Jm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{on(t,``),Vt=!0}catch(t){xf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Vt=!0}catch(t){xf(e,e.return,t)}}break;case 3:if(Vt=!1,Qm=null,o=ju,ju=km(t.containerInfo),Au(t,e,n),ju=o,Nu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Xh(t.containerInfo)}catch(t){xf(e,e.return,t)}cu&&(cu=!1,Pu(e)),Vt=!1;break;case 4:a=su,su=au,r=Ht(),o=ju,ju=km(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,Vt&&fu&&(pu=!0),Vt=r,su=a;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(xd=Fe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=ou,u=su;au=c||o,su=u||o,ou=l||s,Au(t,e,n),ou=l,su=u,au=c,Nu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||ou||(t=s||ou,n=au,r=ou,au=o||au,ou=t,Ru(e,2),au=n,ou=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:a&512&&(ou||r===null||Dl(r,r.return)),a=Ht(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&hi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&Vt&&(e.flags|=4),fu=o,Vt=a;break;case 21:break;case 7:a&512&&(ou||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(on(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){xf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,wh=!0,t.reset(),wh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else iu(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Wl(),Fu(t,e),!du&&!pu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Fp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Ul=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Xl(e,!1));break;case 30:r=du,i=Wl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Bd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Ru(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Ru(n,r);break;case 27:r&2&&Tm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Ru(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ou||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Dl(n,n.return),Ru(n,r);break;case 7:Dl(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:zu(i,a,n),Sl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){xf(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++)xo(l[i],c)}catch(e){xf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||eh(km(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),El(a,a.return);break;case 30:zu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Aa(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Aa(a)));break;case 12:if(a&2048){Hu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){xf(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Wu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ah(n,e)):oh(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&ah(n,e));break;case 3:case 4:var r=ju;ju=km(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:Cl(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:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,nd=0,rd=null,id=null,ad=0,od=0,sd=null,cd=!1,ld=!1,ud=!1,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=null,yd=null,bd=!1,xd=0,Sd=0,Cd=1/0,wd=null,Td=null,Ed=0,Dd=null,Od=null,kd=0,Ad=0,jd=null,Md=null,Nd=null,Pd=null,Fd=null,Id=0,Ld=null;function Rd(){return nd&2&&ad!==0?ad&-ad:H.T===null?mt():Hf()}function zd(){if(gd===0){if(!(ad&536870912)||ta){var e=Qe;Qe<<=1,!(Qe&3932160)&&(Qe=262144),gd=e}else gd=536870912}return e=Oo.current,e!==null&&(e.flags|=32),gd}function Bd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Up(pi(e.memoizedProps,n))),Pd===null&&(Pd=[]),Pd.push(t.bind(null,r))}}function Vd(e,t,n){(e===rd&&(od===2||od===9)||e.cancelPendingCommit!==null)&&(Jd(e,0),Gd(e,ad,gd,!1)),st(e,n),(!(nd&2)||e!==rd)&&(e===rd&&(!(nd&2)&&(md|=n),fd===4&&Gd(e,ad,gd,!1)),Pf(e))}function Hd(e,t,n){if(nd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||nt(e,t),a=r?nf(e,t):ef(e,t,!0),o=r;do{if(a===0){ld&&!r&&Gd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Wd(n)){a=ef(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=vd;var l=c.current.memoizedState.isDehydrated;if(l&&(Jd(c,s).flags|=256),s=ef(c,s,!1),s!==2&&s!==6){if(ud&&!l){c.errorRecoveryDisabledLanes|=o,md|=o,a=4;break a}o=yd,yd=a,o!==null&&(yd===null?yd=o:yd.push.apply(yd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Jd(e,0),Gd(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:Gd(r,t,gd,!cd);break a;case 2:yd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=xd+300-Fe(),10<a)){if(Gd(r,t,gd,!cd),tt(r,0,!0)!==0)break a;kd=t,r.timeoutHandle=Ep(Ud.bind(null,r,n,yd,wd,bd,t,gd,md,_d,cd,o,`Throttled`,-0,0),a);break a}Ud(r,n,yd,wd,bd,t,gd,md,_d,cd,o,null,-0,0)}break}while(1);Pf(e)}function Ud(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mn},Vl=null,Ju(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=uh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?xd-Fe():(a&4194048)===a?Sd-Fe():0,m=ch(d,m),m!==null)){kd=a,e.cancelPendingCommit=m(uf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Gd(e,a,o,!l);return}uf(e,t,a,n,r,i,o,s,c,l,u,d)}function Wd(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(!Lr(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 Gd(e,t,n,r){t=rt(e,t),t&=~hd,t&=~md,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-qe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&lt(e,n,t)}function Kd(){return nd&6?!0:(Ff(0,!1),!1)}function qd(){if(id!==null){if(od===0)var e=id.return;else e=id,ma=pa=null,is(e),no=null,ro=0,e=id;for(;e!==null;)xl(e.alternate,e),e=e.return;id=null}}function Jd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),kd=0,qd(),rd=e,id=n=Ai(e.current,null),ad=t,od=0,sd=null,cd=!1,ld=nt(e,t),ud=!1,_d=gd=hd=md=pd=fd=0,yd=vd=null,bd=!1,dd=rt(e,t),bi(),n}function Yd(e,t){Bo=null,H.H=mc,t===Ka||t===Ja?(t=eo(),od=3):t===qa?(t=eo(),od=4):od=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,sd=t,id===null&&(fd=1,Ec(e,Ri(t,e.current)))}function Xd(){var e=Oo.current;return e===null?!0:(ad&4194048)===ad?ko===null:(ad&62914560)===ad||ad&536870912?e===ko:!1}function Zd(){var e=H.H;return H.H=mc,e===null?mc:e}function Qd(){var e=H.A;return H.A=ed,e}function $d(){fd=4,cd||(ad&4194048)!==ad&&Oo.current!==null||(ld=!0),!(pd&134217727)&&!(md&134217727)||rd===null||Gd(rd,ad,gd,!1)}function ef(e,t,n){var r=nd;nd|=2;var i=Zd(),a=Qd();(rd!==e||ad!==t)&&(wd=null,Jd(e,t)),t=!1;var o=fd;a:do try{if(od!==0&&id!==null){var s=id,c=sd;switch(od){case 8:qd(),o=6;break a;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=od;if(od=0,sd=null,sf(e,s,c,l),n&&ld){o=0;break a}break;default:l=od,od=0,sd=null,sf(e,s,c,l)}}tf(),o=fd;break}catch(t){Yd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,nd=r,H.H=i,H.A=a,id===null&&(rd=null,ad=0,bi()),o}function tf(){for(;id!==null;)af(id)}function nf(e,t){var n=nd;nd|=2;var r=Zd(),a=Qd();rd!==e||ad!==t?(wd=null,Cd=Fe()+500,Jd(e,t)):ld=nt(e,t);a:do try{if(od!==0&&id!==null){t=id;var o=sd;b:switch(od){case 1:od=0,sd=null,sf(e,t,o,1);break;case 2:case 9:if(Xa(o)){od=0,sd=null,of(t);break}t=function(){od!==2&&od!==9||rd!==e||(od=7),Pf(e)},o.then(t,t);break a;case 3:od=7;break a;case 4:od=5;break a;case 7:Xa(o)?(od=0,sd=null,of(t)):(od=0,sd=null,sf(e,t,o,7));break;case 5:var s=null;switch(id.tag){case 26:s=id.memoizedState;case 5:case 27:var c=id;if(s?rh(s):c.stateNode.complete){od=0,sd=null;var l=c.sibling;if(l!==null)id=l;else{var u=c.return;u===null?id=null:(id=u,cf(u))}break b}}od=0,sd=null,sf(e,t,o,5);break;case 6:od=0,sd=null,sf(e,t,o,6);break;case 8:qd(),fd=6;break a;default:throw Error(i(462))}}rf();break}catch(t){Yd(e,t)}while(1);return ma=pa=null,H.H=r,H.A=a,nd=n,id===null?(rd=null,ad=0,bi(),fd):0}function rf(){for(;id!==null&&!Ne();)af(id)}function af(e){var t=fl(e.alternate,e,dd);e.memoizedProps=e.pendingProps,t===null?cf(e):id=t}function of(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,ad);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,ad);break;case 5:is(t);var r=t;r===$i&&(ta?(sa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(sa(r),ta=!0));default:xl(n,t),t=id=ji(t,dd),t=fl(n,t,dd)}e.memoizedProps=e.pendingProps,t===null?cf(e):id=t}function sf(e,t,n,r){ma=pa=null,is(t),no=null,ro=0;var i=t.return;try{if(jc(e,i,t,n,ad)){fd=1,Ec(e,Ri(n,e.current)),id=null;return}}catch(t){if(i!==null)throw id=i,t;fd=1,Ec(e,Ri(n,e.current)),id=null;return}t.flags&32768?(ta||r===1?e=!0:ld||ad&536870912?e=!1:(cd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),lf(t,e)):cf(t)}function cf(e){var t=e;do{if(t.flags&32768){lf(t,cd);return}e=t.return;var n=yl(t.alternate,t,dd);if(n!==null){id=n;return}if(t=t.sibling,t!==null){id=t;return}id=t=e}while(t!==null);fd===0&&(fd=5)}function lf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,id=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){id=e;return}id=e=n}while(e!==null);fd=6,id=null}function uf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do vf();while(Ed!==0);if(nd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===rd&&(id=rd=null,ad=0),Od=t,Dd=e,kd=n,jd=a,Md=r,df(e,t,n,s,c,l,f)}}function df(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ad=s,s|=yi,ct(e,n,s,r,i,a),Pd=null,(n&335544064)===n?(Fd=Na(e),r=10262):(Fd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Df(ze,function(){return yf(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=H.T,H.T=null,i=le.p,le.p=2,a=nd,nd|=4;try{hu(e,t,n)}finally{nd=a,le.p=i,H.T=r}}Ed=1,Bl?Nd=Vp(o,e.containerInfo,Fd,mf,hf,pf,gf,yf,ff,null,null):(mf(),hf(),gf())}function ff(e){if(Ed!==0){var t=Dd.onRecoverableError;t(e,{componentStack:null})}}function pf(){Ed===3&&(Ed=0,Iu(Od,Dd),Ed=4)}function mf(){if(Ed===1){Ed=0;var e=Dd,t=Od,n=kd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=H.T,H.T=null;var i=le.p;le.p=2;var a=nd;nd|=4;try{fu=pu=!1,Mu(t,e,n),n=vp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(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 _=Vr(s,h),v=Vr(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}}wh=!!_p,vp=_p=null}finally{nd=a,le.p=i,H.T=r}}e.current=t,Ed=2}}function hf(){if(Ed===2){Ed=0;var e=Dd,t=Od,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=H.T,H.T=null;var r=le.p;le.p=2;var i=nd;nd|=4;try{_u(e,t.alternate,t)}finally{nd=i,le.p=r,H.T=n}}Ed=3}}function gf(){if(Ed===4||Ed===3){Ed=0;var e=Nd;Nd=null,Pe();var t=Dd,n=Od,r=kd,i=Md,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Ed=5:(Ed=0,Od=Dd=null,_f(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Td=null),pt(r),n=n.stateNode,Ge&&typeof Ge.onCommitFiberRoot==`function`)try{Ge.onCommitFiberRoot(We,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=H.T,a=le.p,le.p=2,H.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{H.T=n,le.p=a}}if(i=Pd,o=Fd,Fd=null,i!==null&&(Pd=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);kd&3&&vf(),Pf(t),a=t.pendingLanes,r&261930&&a&42?t===Ld?Id++:(Id=0,Ld=t):(Id=0,Ld=null),Ff(0,!1)}}function _f(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function vf(){return Nd!==null&&(Nd.skipTransition(),Nd=null),mf(),hf(),gf(),yf()}function yf(){if(Ed!==5)return!1;var e=Dd,t=Ad;Ad=0;var n=pt(kd),r=H.T,a=le.p;try{le.p=32>n?32:n,H.T=null,n=jd,jd=null;var o=Dd,s=kd;if(Ed=0,Od=Dd=null,kd=0,nd&6)throw Error(i(331));var c=nd;if(nd|=4,Zu(o.current),Uu(o,o.current,s,n),nd=c,Ff(0,!1),Ge&&typeof Ge.onPostCommitFiberRoot==`function`)try{Ge.onPostCommitFiberRoot(We,o)}catch{}return!0}finally{le.p=a,H.T=r,_f(e,t)}}function bf(e,t,n){t=Ri(n,t),t=Oc(e.stateNode,t,2),e=ho(e,t,2),e!==null&&(st(e,2),Pf(e))}function xf(e,t,n){if(e.tag===3)bf(e,e,n);else for(;t!==null;){if(t.tag===3){bf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Td===null||!Td.has(r))){e=Ri(n,e),n=kc(2),r=ho(t,n,2),r!==null&&(Ac(n,r,t,e),st(r,2),Pf(r));break}}t=t.return}}function Sf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ud=!0,i.add(n),e=Cf.bind(null,e,t,n),t.then(e,e))}function Cf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rd===e&&(ad&n)===n&&(fd===4||fd===3&&(ad&62914560)===ad&&300>Fe()-xd?nd&2?hd|=n:Jd(e,0):hd|=n,_d===ad&&(_d=0)),Pf(e)}function wf(e,t){t===0&&(t=at()),e=Ci(e,t),e!==null&&(st(e,t),Pf(e))}function Tf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wf(e,n)}function Ef(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),wf(e,n)}function Df(e,t){return je(e,t)}var Of=null,kf=null,Af=!1,jf=!1,Mf=!1,Nf=0;function Pf(e){e!==kf&&e.next===null&&(kf===null?Of=kf=e:kf=kf.next=e),jf=!0,Af||(Af=!0,Vf())}function Ff(e,t){if(!Mf&&jf){Mf=!0;do for(var n=!1,r=Of;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Bf(r,a))}else a=ad,a=tt(r,r===rd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||nt(r,a)||(n=!0,Bf(r,a))}r=r.next}while(n);Mf=!1}}function If(){Lf()}function Lf(){jf=Af=!1;var e=0;Nf!==0&&Tp()&&(e=Nf);for(var t=Fe(),n=null,r=Of;r!==null;){var i=r.next,a=Rf(r,t);a===0?(r.next=null,n===null?Of=i:n.next=i,i===null&&(kf=n)):(n=r,(e!==0||a&3)&&(jf=!0)),r=i}Ed!==0&&Ed!==5||Ff(e,!1),Nf!==0&&(Nf=0)}function Rf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-qe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=rd,n=ad,n=tt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(od===2||od===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Me(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||nt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Me(r),pt(n)){case 2:case 8:n=Re;break;case 32:n=ze;break;case 268435456:n=Ve;break;default:n=ze}return r=zf.bind(null,e),n=je(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Me(r),e.callbackPriority=2,e.callbackNode=null,2}function zf(e,t){if(Ed!==0&&Ed!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(vf()&&e.callbackNode!==n)return null;var r=ad;return r=tt(e,e===rd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Hd(e,r,t),Rf(e,Fe()),e.callbackNode!=null&&e.callbackNode===n?zf.bind(null,e):null)}function Bf(e,t){if(vf())return null;Hd(e,t,!0)}function Vf(){kp(function(){nd&6?je(Le,If):Lf()})}function Hf(){if(Nf===0){var e=Ia;e===0&&(e=Ze,Ze<<=1,!(Ze&261888)&&(Ze=256)),Nf=e}return Nf}function Uf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:pn(e)}function Wf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Uf((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Uf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Fn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Nf!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Gf=0;Gf<ui.length;Gf++){var Kf=ui[Gf];di(Kf.toLowerCase(),`on`+(Kf[0].toUpperCase()+Kf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),It(`onMouseEnter`,[`mouseout`,`mouseover`]),It(`onMouseLeave`,[`mouseout`,`mouseover`]),It(`onPointerEnter`,[`pointerout`,`pointerover`]),It(`onPointerLeave`,[`pointerout`,`pointerover`]),Ft(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ft(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ft(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ft(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ft(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var qf=`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(` `),Jf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(qf));function Yf(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){gi(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){gi(e)}i.currentTarget=null,a=c}}}}function Xf(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(ep(t,e,2,!1),n.add(r))}function Zf(e,t,n){var r=0;t&&(r|=4),ep(n,e,r,t)}var Qf=`_reactListening`+Math.random().toString(36).slice(2);function $f(e){if(!e[Qf]){e[Qf]=!0,Nt.forEach(function(t){t!==`selectionchange`&&(Jf.has(t)||Zf(t,!1,e),Zf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qf]||(t[Qf]=!0,Zf(`selectionchange`,!1,t))}}function ep(e,t,n,r){switch(jh(t)){case 2:var i=Th;break;case 8:i=Eh;break;default:i=Dh}n=i.bind(null,t,n,e),i=void 0,!wn||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 tp(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}xn(function(){var r=a,i=gn(n),s=[];a:{var c=li.get(e);if(c!==void 0){var l=Fn,u=e;switch(e){case`keypress`:if(An(n)===0)break a;case`keydown`:case`keyup`:l=$n;break;case`focusin`:u=`focus`,l=Wn;break;case`focusout`:u=`blur`,l=Wn;break;case`beforeblur`:case`afterblur`:l=Wn;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=Hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case ni:case ri:case ii:l=Gn;break;case ci:l=rr;break;case`scroll`:case`scrollend`:l=Ln;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=er;break;case`submit`:l=tr;break;case`toggle`:case`beforetoggle`:l=ar}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=Sn(m,p),g!=null&&d.push(np(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!==hn&&(u=n.relatedTarget||n.fromElement)&&(Dt(u)||u[yt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Dt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=er,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:kt(c),h=l==null?u:kt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Dt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ip):null,c!==null&&ap(s,u,c,d,!1),l!==null&&f!==null&&ap(s,f,l,d,!0)))}a:{if(c=r?kt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&un(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?kt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(sr)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 hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=kn()):(En=i,Dn=`value`in En?En.value:En.textContent,hr=!0)),v=rp(r,b),0<v.length&&(b=new qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=rp(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Wf(s,e,r,n,i)}Yf(s,t)})}function np(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rp(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=Sn(e,n),i!=null&&r.unshift(np(e,i,a)),i=Sn(e,t),i!=null&&r.push(np(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ip(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ap(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=Sn(n,a),l!=null&&o.unshift(np(n,l,c))):i||(l=Sn(n,a),l!=null&&o.push(np(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var op=/\r\n?/g,sp=/\u0000|\uFFFD/g;function cp(e){return(typeof e==`string`?e:``+e).replace(op,`
9
- `).replace(sp,``)}function lp(e,t){return t=cp(t),cp(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||on(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&on(e,``+r);else return;break;case`className`:Wt(e,`class`,r);break;case`tabIndex`:Wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Wt(e,n,r);break;case`style`:ln(e,r,o);return;case`data`:if(t!==`object`){Wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(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`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=mn);return;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`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=pn(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`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Ut(e,`popover`,r);break;case`xlinkActuate`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ut(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=dn.get(n)||n,Ut(e,n,r);else return}Vt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:ln(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`)on(e,r);else if(typeof r==`number`||typeof r==`bigint`)on(e,``+r);else return;break;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=mn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Pt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[vt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Vt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ut(e,n,r)}return}Vt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Xf(`error`,e),Xf(`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:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:Xf(`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:up(e,t,r,d,n,null)}}en(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Xf(`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:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&nn(e,!!r,n,!0):nn(e,!!r,t,!1);return;case`textarea`:for(s in Xf(`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:up(e,t,s,c,n,null)}an(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:up(e,t,l,r,n,null)}return;case`dialog`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Xf(`cancel`,e),Xf(`close`,e);break;case`iframe`:case`object`:Xf(`load`,e);break;case`video`:case`audio`:for(r=0;r<qf.length;r++)Xf(qf[r],e);break;case`image`:Xf(`error`,e),Xf(`load`,e);break;case`details`:Xf(`toggle`,e);break;case`embed`:case`source`:case`link`:Xf(`error`,e),Xf(`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:up(e,t,u,r,n,null)}return;default:if(un(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(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)||up(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Vt=!0),o=m;break;case`name`:m!==f&&(Vt=!0),a=m;break;case`checked`:m!==f&&(Vt=!0),u=m;break;case`defaultChecked`:m!==f&&(Vt=!0),d=m;break;case`value`:m!==f&&(Vt=!0),s=m;break;case`defaultValue`:m!==f&&(Vt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}$t(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)||up(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Vt=!0),p=o;break;case`defaultValue`:o!==l&&(Vt=!0),c=o;break;case`multiple`:o!==l&&(Vt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?nn(e,!!n,n?[]:``,!1):nn(e,!!n,t,!0)):nn(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:up(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Vt=!0),p=a;break;case`defaultValue`:a!==o&&(Vt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}rn(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:up(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Vt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(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)&&up(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:up(e,t,u,p,r,m)}return;default:if(un(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(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||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(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||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){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&&hp(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&&hp(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 _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function bp(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 xp(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 Sp(e,t,n,r){return n=yp(n).createElement(e),n[_t]=r,n[vt]=t,fp(n,e,t),jt(n),n}function Cp(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 wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,W=typeof Promise==`function`?Promise:void 0,Op=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,kp=typeof queueMicrotask==`function`?queueMicrotask:W===void 0?Ep:function(e){return W.resolve(null).then(e).catch(Ap)};function Ap(e){setTimeout(function(){throw e})}function jp(e){return e===`head`}function Mp(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),Xh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Em(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Em(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Em(e.ownerDocument.body)}n=i}while(n);Xh(t)}function Np(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 Pp(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 Fp(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 Ip(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 Lp(e){return Ip(e.getBoundingClientRect(),getComputedStyle(e),e)}function Rp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Ip(t,n,e)}function zp(e){return e.documentElement.clientHeight}function Bp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Vp(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`&&(zp(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+=ih(f),u>sh){s.length=o;break}f=new Promise(Bp.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 Hp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Hp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hp.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},Hp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Up(e){return{name:e,group:new Hp(`group`,e),imagePair:new Hp(`image-pair`,e),old:new Hp(`old`,e),new:new Hp(`new`,e)}}function Wp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Wp.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(Yp(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=qp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Gp,e,s,r)}this._eventListeners=a}};function Gp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Wp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Yp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=qp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Kp,e,n,i),r.splice(t,1),a!==null&&a()}};function Kp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function qp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Jp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Yp(e,t,n,r){if(e.length===0)return-1;r=Jp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Jp(a.optionsOrUseCapture)===r)return i}return-1}Wp.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,qp(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,qp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Wp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=b(e),Sm(e,t))}Wp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Zp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Xp(t[n],e);n--);};function Zp(e,t){return t.push(e),!1}Wp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=yp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Qp,e,void 0,void 0))};function Qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Wp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,$p,e,void 0,void 0)};function $p(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Wp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,em,e,void 0,void 0);for(var n=t=0;n<tm.length;n++){var r=tm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):tm[t++]=r}tm.length=t}};function em(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var tm=[],nm=!1;function rm(e,t,n){tm.push({fragmentInstance:e,observer:t,instance:n}),nm||(nm=!0,Cm(function(){nm=!1;var e=tm;tm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Wp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,im,e,void 0,void 0),e};function im(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}Wp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Wp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Zp,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||am(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function am(e,t,n,r,i){var a=Dt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(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 om(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)}Wp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Zp,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),om(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),om(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function sm(e,t){return e=b(e),cm(e,t),!1}function cm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function lm(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,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<tm.length;i++){var a=tm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(tm[r++]=a)}tm.length=r,n.observe(e)}),cm(e,t))}function um(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,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?rm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function dm(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`:dm(n),Et(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function fm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[wt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=vm(e.nextSibling),e===null)break}return null}function pm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vm(e.nextSibling),e===null))return null;return e}function mm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vm(e.nextSibling),e===null))return null;return e}function hm(e){return e.data===`$?`||e.data===`$~`}function gm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _m(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 vm(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 ym=null;function bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xm(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 Sm(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 Cm(e){Op(function(){Op(function(t){return e(t)})})}function wm(e,t,n){switch(t=yp(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 Tm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===mn&&(e.onclick=null),Et(e)}function Em(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Et(e)}var Dm=new Map,Om=new Set;function km(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 Am=le.d;le.d={f:jm,r:Mm,D:Fm,C:Im,L:G,m:Lm,X:zm,S:Rm,M:Bm};function jm(){var e=Am.f(),t=Kd();return e||t}function Mm(e){var t=Ot(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Am.r(e)}var Nm=typeof document>`u`?null:document;function Pm(e,t,n){var r=Nm;if(r&&typeof t==`string`&&t){var i=Qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Om.has(i)||(Om.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),jt(t),r.head.appendChild(t)))}}function Fm(e){Am.D(e),Pm(`dns-prefetch`,e,null)}function Im(e,t){Am.C(e,t),Pm(`preconnect`,e,t)}function G(e,t,n){Am.L(e,t,n);var r=Nm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Qt(n.imageSizes)+`"]`)):i+=`[href="`+Qt(e)+`"]`;var a=i;switch(t){case`style`:a=Hm(e);break;case`script`:a=Km(e)}if(!(Dm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Dm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Tt]=!0,o.onload=o.onerror=function(){Mt(o)}),jt(o),r.head.appendChild(o)}}}function Lm(e,t){Am.m(e,t);var n=Nm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Qt(r)+`"][href="`+Qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Km(e)}if(!Dm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Dm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),fp(r,`link`,e),jt(r),n.head.appendChild(r)}}}function Rm(e,t,n){Am.S(e,t,n);var r=Nm;if(r&&e){var i=At(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Dm.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);jt(c),fp(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,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){Am.X(e,t);var n=Nm;if(n&&e){var r=At(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0},t),(t=Dm.get(i))&&Zm(e,t),a=n.createElement(`script`),jt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){Am.M(e,t);var n=Nm;if(n&&e){var r=At(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Dm.get(i))&&Zm(e,t),a=n.createElement(`script`),jt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=_e.current)?km(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=Hm(n.href),t=At(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hm(n.href);var o=At(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Dm.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},Dm.set(e,o)),Gm(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=Km(n),t=At(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hm(e){return`href="`+Qt(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Tt]){r.loading=1;return}}else t=e.createElement(`link`),t[Tt]=!0,t.onload=t.onerror=Mt.bind(null,t),fp(t,`link`,n),jt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Km(e){return`[src="`+Qt(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Qt(n.href)+`"]`);if(r)return t.instance=r,jt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),jt(r),fp(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,jt(o),o;r=Wm(n),(a=Dm.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),jt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,jt(a),a):(r=n,(a=Dm.get(o))&&(r=D({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),jt(a),fp(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,Ym(r,n.precedence,e));return t.instance}function Ym(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 Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function $m(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,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[wt]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function eh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function th(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 nh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function rh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ih(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ah(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ih(t),e.suspenseyImages.push(t)),e=dh.bind(e),t.decode().then(e,e))}function oh(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=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=uh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,jt(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Dm.get(i))&&Xm(r,i),a=a.createElement(`link`),jt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(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=uh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var sh=0;function ch(e,t){return e.stylesheets&&e.count===0&&ph(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&sh===0&&(sh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>sh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function lh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ph(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function uh(){this.count--,lh(this)}function dh(){this.imgCount--,lh(this)}var fh=null;function ph(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fh=new Map,t.forEach(mh,e),fh=null,uh.call(e))}function mh(e,t){if(!(t.state.loading&4)){var n=fh.get(e);if(n)var r=n.get(null);else{n=new Map,fh.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=uh.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 hh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function gh(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=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(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 _h(e,t,n,r,i,a,o,s,c,l,u,d){return e=new gh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},fo(a),e}function vh(e){return e?(e=Ei,e):Ei}function yh(e,t,n,r,i,a){i=vh(i),r.context===null?r.context=i:r.pendingContext=i,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ho(e,r,t),n!==null&&(Vd(n,e,t),go(n,e,t))}function bh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xh(e,t){bh(e,t),(e=e.alternate)&&bh(e,t)}function Sh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Vd(t,e,67108864),xh(e,67108864)}}function Ch(e){if(e.tag===13||e.tag===31){var t=Rd();t=ft(t);var n=Ci(e,t);n!==null&&Vd(n,e,t),xh(e,t)}}var wh=!0;function Th(e,t,n,r){var i=H.T;H.T=null;var a=le.p;try{le.p=2,Dh(e,t,n,r)}finally{le.p=a,H.T=i}}function Eh(e,t,n,r){var i=H.T;H.T=null;var a=le.p;try{le.p=8,Dh(e,t,n,r)}finally{le.p=a,H.T=i}}function Dh(e,t,n,r){if(wh){var i=Oh(r);if(i===null)tp(e,t,r,kh,n),Bh(e,r);else if(Hh(i,e,t,n,r))r.stopPropagation();else if(Bh(e,r),t&4&&-1<zh.indexOf(e)){for(;i!==null;){var a=Ot(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=et(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-qe(o);s.entanglements[1]|=c,o&=~c}Pf(a),!(nd&6)&&(Cd=Fe()+500,Ff(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Vd(s,a,2),Kd(),xh(a,2)}if(a=Oh(r),a===null&&tp(e,t,r,kh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else tp(e,t,r,null,n)}}function Oh(e){return e=gn(e),Ah(e)}var kh=null;function Ah(e){if(kh=null,e=Dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return kh=e,null}function jh(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(Ie()){case Le:return 2;case Re:return 8;case ze:case Be:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var Mh=!1,Nh=null,Ph=null,Fh=null,Ih=new Map,Lh=new Map,Rh=[],zh=`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 Bh(e,t){switch(e){case`focusin`:case`focusout`:Nh=null;break;case`dragenter`:case`dragleave`:Ph=null;break;case`mouseover`:case`mouseout`:Fh=null;break;case`pointerover`:case`pointerout`:Ih.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Lh.delete(t.pointerId)}}function Vh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ot(t),t!==null&&Sh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hh(e,t,n,r,i){switch(t){case`focusin`:return Nh=Vh(Nh,e,t,n,r,i),!0;case`dragenter`:return Ph=Vh(Ph,e,t,n,r,i),!0;case`mouseover`:return Fh=Vh(Fh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ih.set(a,Vh(Ih.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Lh.set(a,Vh(Lh.get(a)||null,e,t,n,r,i)),!0}return!1}function Uh(e){var t=Dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ht(e.priority,function(){Ch(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ht(e.priority,function(){Ch(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 Wh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);hn=r,n.target.dispatchEvent(r),hn=null}else return t=Ot(n),t!==null&&Sh(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){Wh(e)&&n.delete(t)}function Kh(){Mh=!1,Nh!==null&&Wh(Nh)&&(Nh=null),Ph!==null&&Wh(Ph)&&(Ph=null),Fh!==null&&Wh(Fh)&&(Fh=null),Ih.forEach(Gh),Lh.forEach(Gh)}function qh(e,n){e.blockedOn===n&&(e.blockedOn=null,Mh||(Mh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kh)))}var Jh=null;function Yh(e){Jh!==e&&(Jh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jh===e&&(Jh=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(Ah(r||n)===null)continue;break}var a=Ot(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Xh(e){function t(t){return qh(t,e)}Nh!==null&&qh(Nh,e),Ph!==null&&qh(Ph,e),Fh!==null&&qh(Fh,e),Ih.forEach(t),Lh.forEach(t);for(var n=0;n<Rh.length;n++){var r=Rh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rh.length&&(n=Rh[0],n.blockedOn===null);)Uh(n),n.blockedOn===null&&Rh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Yh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(Ah(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Yh(n)}}}function Zh(){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 Qh(e){this._internalRoot=e}$h.prototype.render=Qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;yh(n,Rd(),e,t,null,null)},$h.prototype.unmount=Qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yh(e.current,2,null,e,null,null),Kd(),t[yt]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rh.length&&t!==0&&t<Rh[n].priority;n++);Rh.splice(n,0,e),n===0&&Uh(e)}};var eg=n.version;if(eg!==`19.3.0`)throw Error(i(527,eg,`19.3.0`));le.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 tg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:H,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{We=ng.inject(tg),Ge=ng}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;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=_h(e,1,!1,null,null,n,r,null,o,s,c,Zh),e[yt]=t.current,$f(e),new Qh(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()})),_=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),v=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),y=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},b={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},x={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`},S={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`},C={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function w(e){switch(e){case`outline`:return b;case`fill`:return x;case`glyph-duo`:return S;case`outline-duo`:return C;default:return b}}var T=c(u(),1),E=(0,T.forwardRef)(({color:e=`currentColor`,secondaryColor:t=`currentColor`,size:n=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,variant:c=`outline`,sourceSize:l=24,...u},d)=>{let f=w(c),p=c===`outline`||c===`outline-duo`,m=c===`fill`||c===`glyph-duo`,h=`0 0 ${l} ${l}`,g=s.map(([n,r],i)=>{let a={...r};return a.fill&&a.fill!==`none`&&(a[`data-color`]===`color-2`&&t?a.fill=t:(!a[`data-color`]||a[`data-color`]===`color-1`)&&(a.fill=e)),a.stroke&&a.stroke!==`none`&&(a.stroke=a[`data-color`]===`color-2`&&t?t:e),(0,T.createElement)(n,{...a,key:i})});return(0,T.createElement)(`svg`,{ref:d,...f,viewBox:h,width:n,height:n,...p&&{stroke:e,strokeWidth:i?Number(r)*l/Number(n):r},...m&&{fill:e},className:v(`nucleo`,a),...!o&&!y(u)&&{"aria-hidden":`true`},...u},[...g,...Array.isArray(o)?o:o?[o]:[]])});E.displayName=`NucleoIcon`;var D=(e,t,n)=>{let r=(0,T.forwardRef)(({className:r,...i},a)=>(0,T.createElement)(E,{ref:a,iconNode:t,variant:n.variant,sourceSize:n.sourceSize,className:v(`nucleo-${_(n.componentName)}`,`nucleo-${e}`,r),...i}));return r.displayName=n.componentName,r},O=D(`arrow-left`,[[`line`,{x1:`2.75`,y1:`9`,x2:`15.25`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`7 13.25 2.75 9 7 4.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`arrow-left`,componentName:`ArrowLeft`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_arrow-left.svg`}),k=D(`arrows-expand`,[[`polyline`,{points:`7 2.75 2.75 2.75 2.75 7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.75`,y1:`2.75`,x2:`7`,y2:`7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`11 15.25 15.25 15.25 15.25 11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`15.25`,y1:`15.25`,x2:`11`,y2:`11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`11 2.75 15.25 2.75 15.25 7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.25`,y1:`2.75`,x2:`11`,y2:`7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`7 15.25 2.75 15.25 2.75 11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`2.75`,y1:`15.25`,x2:`7`,y2:`11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`arrows-expand`,componentName:`ArrowsExpand`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_arrows-expand.svg`}),A=D(`arrows-to-center`,[[`circle`,{cx:`9`,cy:`9`,r:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`5.75 2.25 5.75 5.75 2.25 5.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`5.75`,y1:`5.75`,x2:`2.5`,y2:`2.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`15.75 5.75 12.25 5.75 12.25 2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`12.25`,y1:`5.75`,x2:`15.5`,y2:`2.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`12.25 15.75 12.25 12.25 15.75 12.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`12.25`,y1:`12.25`,x2:`15.5`,y2:`15.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`2.25 12.25 5.75 12.25 5.75 15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`5.75`,y1:`12.25`,x2:`2.5`,y2:`15.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`arrows-to-center`,componentName:`ArrowsToCenter`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_arrows-to-center.svg`}),j=D(`bullet-list`,[[`path`,{d:`M8.75 11.25H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M8.75 14.75H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M8.75 4.25H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M8.75 7.75H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M4 5.75C4.9665 5.75 5.75 4.966 5.75 4C5.75 3.034 4.9665 2.25 4 2.25C3.0335 2.25 2.25 3.034 2.25 4C2.25 4.966 3.0335 5.75 4 5.75Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M4 12.75C4.9665 12.75 5.75 11.966 5.75 11C5.75 10.034 4.9665 9.25 4 9.25C3.0335 9.25 2.25 10.034 2.25 11C2.25 11.966 3.0335 12.75 4 12.75Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}]],{name:`bullet-list`,componentName:`BulletList`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_bullet-list.svg`}),M=D(`button-cursor`,[[`path`,{d:`m16.25,9.5v3c0,1.5188-1.2312,2.75-2.75,2.75H4.5c-1.5188,0-2.75-1.2312-2.75-2.75v-3`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`m8.1263,7.2324l5.94-2.1704c.2503-.0914.243-.4479-.0107-.5291l-2.7185-.8699-.8699-2.7185c-.0812-.2538-.4377-.261-.5291-.0107l-2.1704,5.94c-.0816.2235.1352.4404.3587.3587Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`path`,{d:`m4.7712,6.75h-.2712c-1.5188,0-2.75,1.2312-2.75,2.75s1.2312,2.75,2.75,2.75h9c1.5188,0,2.75-1.2312,2.75-2.75,0-.7036-.272-1.3384-.7067-1.8247`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`button-cursor`,componentName:`ButtonCursor`,collection:`ui`,variant:`outline`,category:`design-development`,sourceSize:18,filePath:`ui/outline/design-development/18px_button-cursor.svg`}),N=D(`chat-bubble`,[[`path`,{d:`M13.75,2.75H4.25c-1.105,0-2,.895-2,2v11.5l3.75-3h7.75c1.105,0,2-.895,2-2V4.75c0-1.105-.895-2-2-2Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chat-bubble`,componentName:`ChatBubble`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_chat-bubble.svg`}),P=D(`chevron-down`,[[`polyline`,{points:`15.25 6.5 9 12.75 2.75 6.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-down`,componentName:`ChevronDown`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-down.svg`}),F=D(`chevron-left`,[[`polyline`,{points:`11.5 15.25 5.25 9 11.5 2.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-left`,componentName:`ChevronLeft`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-left.svg`}),I=D(`chevron-right`,[[`polyline`,{points:`6.5 2.75 12.75 9 6.5 15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-right`,componentName:`ChevronRight`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-right.svg`}),L=D(`chevron-up`,[[`polyline`,{points:`2.75 11.5 9 5.25 15.25 11.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-up`,componentName:`ChevronUp`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-up.svg`}),R=D(`circle-check`,[[`circle`,{cx:`9`,cy:`9`,r:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`5.75 9.25 8 11.75 12.25 6.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`circle-check`,componentName:`CircleCheck`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_circle-check.svg`}),z=D(`clock`,[[`circle`,{cx:`9`,cy:`9`,r:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`9 4.75 9 9 12.25 11.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`clock`,componentName:`Clock`,collection:`ui`,variant:`outline`,category:`time`,sourceSize:18,filePath:`ui/outline/time/18px_clock.svg`}),ee=D(`divider-y`,[[`path`,{d:`m2.75,2.25v1.5c0,1.105.895,2,2,2h8.5c1.105,0,2-.895,2-2v-1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`m2.75,15.75v-1.5c0-1.105.895-2,2-2h8.5c1.105,0,2,.895,2,2v1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`16`,y1:`9`,x2:`2`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`divider-y`,componentName:`DividerY`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_divider-y.svg`}),B=D(`download`,[[`path`,{d:`M12 6.25H12.335C13.3 6.25 14.127 6.939 14.302 7.888L15.315 13.388C15.541 14.617 14.598 15.75 13.348 15.75H4.65199C3.40199 15.75 2.45899 14.617 2.68499 13.388L3.69799 7.888C3.87299 6.939 4.69999 6.25 5.66499 6.25H5.99999`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M12 9.5L9 12.5L6 9.5`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M9 12.5V1.25`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}]],{name:`download`,componentName:`Download`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_download.svg`}),te=D(`envelope`,[[`path`,{d:`M1.75,5.75l6.767,3.733c.301,.166,.665,.166,.966,0l6.767-3.733`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`3.25`,width:`14.5`,height:`11.5`,rx:`2`,ry:`2`,transform:`translate(18 18) rotate(180)`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`envelope`,componentName:`Envelope`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_envelope.svg`}),ne=D(`eye`,[[`path`,{d:`M9 11.75C10.5188 11.75 11.75 10.5188 11.75 9C11.75 7.48122 10.5188 6.25 9 6.25C7.48122 6.25 6.25 7.48122 6.25 9C6.25 10.5188 7.48122 11.75 9 11.75Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M15.9557 7.88669C16.3481 8.57939 16.3481 9.42049 15.9557 10.1132C15.0087 11.7849 12.7944 14.4999 9 14.4999C5.2056 14.4999 2.9912 11.7849 2.0443 10.1132C1.6519 9.42049 1.6519 8.57939 2.0443 7.88669C2.9913 6.21499 5.2056 3.5 9 3.5C12.7944 3.5 15.0088 6.21499 15.9557 7.88669Z`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}]],{name:`eye`,componentName:`Eye`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_eye.svg`}),re=D(`files`,[[`path`,{d:`M5.25,13.25h-1c-1.105,0-2-.895-2-2V3.25c0-1.105,.895-2,2-2h5c1.105,0,2,.895,2,2v1.052`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`path`,{d:`M5.25,14.25V6.25c0-1.105,.895-2,2-2h4.086c.265,0,.52,.105,.707,.293l2.914,2.914c.188,.188,.293,.442,.293,.707v6.086c0,1.105-.895,2-2,2H7.25c-1.105,0-2-.895-2-2Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M15.25,8.25h-3c-.552,0-1-.448-1-1v-3`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`files`,componentName:`Files`,collection:`ui`,variant:`outline`,category:`files`,sourceSize:18,filePath:`ui/outline/files/18px_files.svg`}),V=D(`frame`,[[`line`,{x1:`4.75`,y1:`2.25`,x2:`4.75`,y2:`.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`13.25`,y1:`2.25`,x2:`13.25`,y2:`.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`4.75`,y1:`17.25`,x2:`4.75`,y2:`15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`13.25`,y1:`17.25`,x2:`13.25`,y2:`15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.75`,y1:`4.75`,x2:`17.25`,y2:`4.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.75`,y1:`13.25`,x2:`17.25`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`.75`,y1:`4.75`,x2:`2.25`,y2:`4.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`.75`,y1:`13.25`,x2:`2.25`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`4.75`,y:`4.75`,width:`8.5`,height:`8.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`frame`,componentName:`Frame`,collection:`ui`,variant:`outline`,category:`design-development`,sourceSize:18,filePath:`ui/outline/design-development/18px_frame.svg`}),ie=D(`grid-layout-rows`,[[`rect`,{x:`2.75`,y:`2.75`,width:`12.5`,height:`4.5`,rx:`1.5`,ry:`1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`rect`,{x:`2.75`,y:`10.75`,width:`12.5`,height:`4.5`,rx:`1.5`,ry:`1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`grid-layout-rows`,componentName:`GridLayoutRows`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_grid-layout-rows.svg`}),ae=D(`heading-1`,[[`line`,{x1:`2.75`,y1:`4.75`,x2:`2.75`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`8.75`,y1:`4.75`,x2:`8.75`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.75`,y1:`9`,x2:`8.75`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M14.75,13.25V4.75s-.974,1.713-3.04,2.108`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`heading-1`,componentName:`Heading1`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_heading-1.svg`}),oe=D(`image`,[[`path`,{d:`M3.762,14.989l6.074-6.075c.781-.781,2.047-.781,2.828,0l2.586,2.586`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`2.75`,y:`2.75`,width:`12.5`,height:`12.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`circle`,{cx:`6.25`,cy:`7.25`,r:`1.25`,fill:`#000`,"data-color":`color-2`,"data-stroke":`none`}]],{name:`image`,componentName:`Image`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_image.svg`}),se=D(`layers`,[[`path`,{d:`M2.58,6.149L8.385,1.949c.367-.266,.864-.266,1.231,0l5.805,4.2c.579,.419,.579,1.282,0,1.701l-5.805,4.2c-.367,.266-.864,.266-1.231,0L2.58,7.851c-.579-.419-.579-1.282,0-1.701Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M15.746,10.533c.217,.439,.109,1.003-.326,1.317l-5.805,4.2c-.184,.133-.4,.199-.615,.199-.216,0-.432-.066-.615-.199L2.58,11.851c-.434-.314-.543-.878-.326-1.317`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`layers`,componentName:`Layers`,collection:`ui`,variant:`outline`,category:`design-development`,sourceSize:18,filePath:`ui/outline/design-development/18px_layers.svg`}),ce=D(`loader`,[[`line`,{x1:`9`,y1:`1.75`,x2:`9`,y2:`4.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`14.127`,y1:`3.873`,x2:`12.359`,y2:`5.641`,fill:`none`,opacity:`.88`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`16.25`,y1:`9`,x2:`13.75`,y2:`9`,fill:`none`,opacity:`.75`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`14.127`,y1:`14.127`,x2:`12.359`,y2:`12.359`,fill:`none`,opacity:`.63`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`9`,y1:`16.25`,x2:`9`,y2:`13.75`,fill:`none`,opacity:`.5`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`3.873`,y1:`14.127`,x2:`5.641`,y2:`12.359`,fill:`none`,opacity:`.38`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`1.75`,y1:`9`,x2:`4.25`,y2:`9`,fill:`none`,opacity:`.25`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`3.873`,y1:`3.873`,x2:`5.641`,y2:`5.641`,fill:`none`,opacity:`.13`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`loader`,componentName:`Loader`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_loader.svg`}),H=D(`message`,[[`path`,{d:`M14.25,2.25H3.75c-1.105,0-2,.896-2,2v7c0,1.104,.895,2,2,2h2v3l3.75-3h4.75c1.105,0,2-.896,2-2V4.25c0-1.104-.895-2-2-2Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`message`,componentName:`Message`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_message.svg`}),le=D(`mobile`,[[`path`,{d:`M10.5 2H7.5V2.75H10.5V2Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M12.25 1.75H5.75C4.6454 1.75 3.75 2.6454 3.75 3.75V14.25C3.75 15.3546 4.6454 16.25 5.75 16.25H12.25C13.3546 16.25 14.25 15.3546 14.25 14.25V3.75C14.25 2.6454 13.3546 1.75 12.25 1.75Z`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}]],{name:`mobile`,componentName:`Mobile`,collection:`ui`,variant:`outline`,category:`technology-devices`,sourceSize:18,filePath:`ui/outline/technology-devices/18px_mobile.svg`}),ue=D(`monitor`,[[`path`,{d:`M5.75 15.75C6.508 15.511 7.628 15.25 9 15.25C9.795 15.25 10.941 15.338 12.25 15.75`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M9 12.75V15.25`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M14.25 2.75H3.75C2.64543 2.75 1.75 3.64543 1.75 4.75V10.75C1.75 11.8546 2.64543 12.75 3.75 12.75H14.25C15.3546 12.75 16.25 11.8546 16.25 10.75V4.75C16.25 3.64543 15.3546 2.75 14.25 2.75Z`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}]],{name:`monitor`,componentName:`Monitor`,collection:`ui`,variant:`outline`,category:`technology-devices`,sourceSize:18,filePath:`ui/outline/technology-devices/18px_monitor.svg`}),de=D(`moon`,[[`path`,{d:`M13,11.75c-3.452,0-6.25-2.798-6.25-6.25,0-1.352,.433-2.599,1.162-3.622-3.364,.628-5.912,3.575-5.912,7.122,0,4.004,3.246,7.25,7.25,7.25,3.372,0,6.198-2.306,7.009-5.424-.95,.583-2.063,.924-3.259,.924Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`moon`,componentName:`Moon`,collection:`ui`,variant:`outline`,category:`weather`,sourceSize:18,filePath:`ui/outline/weather/18px_moon.svg`}),fe=D(`palette`,[[`line`,{x1:`15.25`,y1:`6.75`,x2:`2.75`,y2:`6.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.25`,y1:`11.25`,x2:`2.75`,y2:`11.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`2.75`,y:`2.75`,width:`12.5`,height:`12.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`palette`,componentName:`Palette`,collection:`ui`,variant:`outline`,category:`design-development`,sourceSize:18,filePath:`ui/outline/design-development/18px_palette.svg`}),U=D(`paper-plane`,[[`path`,{d:`M5.75,10.022v4.246c0,.409,.464,.645,.794,.404l.74-.539`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.58`,y1:`2.569`,x2:`5.75`,y2:`10.022`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`path`,{d:`M2.883,6.935L15.182,2.542c.363-.13,.73,.183,.66,.562l-2.196,11.86c-.067,.363-.492,.531-.789,.311L2.754,7.807c-.322-.238-.248-.738,.129-.873Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`paper-plane`,componentName:`PaperPlane`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_paper-plane.svg`}),pe=D(`paragraph`,[[`path`,{d:`M11.067,3.317c0-1.141-.925-2.067-2.067-2.067s-2.067,.925-2.067,2.067,.517,1.55,2.067,2.583c1.359,.906,3.1,2.067,3.1,3.617,0,1.712-1.388,2.583-3.1,2.583`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M6.933,14.683c0,1.141,.925,2.067,2.067,2.067s2.067-.925,2.067-2.067-.707-1.677-2.067-2.583c-1.55-1.033-3.1-2.067-3.1-3.617,0-1.712,1.388-2.583,3.1-2.583`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`paragraph`,componentName:`Paragraph`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_paragraph.svg`}),me=D(`sidebar-left`,[[`line`,{x1:`6.25`,y1:`2.75`,x2:`6.25`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,transform:`translate(18 18) rotate(180)`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-left`,componentName:`SidebarLeft`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-left.svg`}),he=D(`sidebar-left-hide`,[[`line`,{x1:`6.25`,y1:`2.75`,x2:`6.25`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`12.25 6.5 9.75 9 12.25 11.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,transform:`translate(18 18) rotate(180)`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-left-hide`,componentName:`SidebarLeftHide`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-left-hide.svg`}),ge=D(`sidebar-right`,[[`line`,{x1:`11.75`,y1:`2.75`,x2:`11.75`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-right`,componentName:`SidebarRight`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-right.svg`}),_e=D(`sidebar-right-hide`,[[`line`,{x1:`11.75`,y1:`2.75`,x2:`11.75`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`5.75 6.5 8.25 9 5.75 11.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-right-hide`,componentName:`SidebarRightHide`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-right-hide.svg`}),ve=D(`sliders`,[[`line`,{x1:`13.25`,y1:`5.25`,x2:`16.25`,y2:`5.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`1.75`,y1:`5.25`,x2:`8.75`,y2:`5.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`circle`,{cx:`11`,cy:`5.25`,r:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`4.75`,y1:`12.75`,x2:`1.75`,y2:`12.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`16.25`,y1:`12.75`,x2:`9.25`,y2:`12.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`circle`,{cx:`7`,cy:`12.75`,r:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`sliders`,componentName:`Sliders`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sliders.svg`}),ye=D(`sparkle`,[[`path`,{d:`M6.65802 4.02597L5.39502 3.60495L4.97402 2.34195C4.83702 1.93395 4.16202 1.93395 4.02502 2.34195L3.60402 3.60495L2.34102 4.02597C2.13702 4.09397 1.99902 4.28497 1.99902 4.49997C1.99902 4.71497 2.13702 4.90597 2.34102 4.97397L3.60402 5.39499L4.02502 6.65799C4.09302 6.86199 4.28502 6.99997 4.50002 6.99997C4.71502 6.99997 4.90602 6.86199 4.97502 6.65799L5.39602 5.39499L6.65902 4.97397C6.86302 4.90597 7.00102 4.71497 7.00102 4.49997C7.00102 4.28497 6.86202 4.09397 6.65802 4.02597Z`,fill:`#000`,"data-color":`color-2`,"data-stroke":`none`}],[`path`,{d:`M15.658 13.026L14.395 12.605L13.974 11.3419C13.837 10.9339 13.162 10.9339 13.025 11.3419L12.604 12.605L11.341 13.026C11.137 13.094 10.999 13.285 10.999 13.5C10.999 13.715 11.137 13.906 11.341 13.974L12.604 14.395L13.025 15.658C13.093 15.862 13.285 16 13.5 16C13.715 16 13.906 15.862 13.975 15.658L14.396 14.395L15.659 13.974C15.863 13.906 16.001 13.715 16.001 13.5C16.001 13.285 15.862 13.094 15.658 13.026Z`,fill:`#000`,"data-color":`color-2`,"data-stroke":`none`}],[`path`,{d:`M6 8.75L6.671 11.329L9.25 12L6.671 12.671L6 15.25L5.329 12.671L2.75 12L5.329 11.329L6 8.75Z`,fill:`black`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}],[`path`,{d:`M12 2.75L12.671 5.32898L15.25 6L12.671 6.67102L12 9.25L11.329 6.67102L8.75 6L11.329 5.32898L12 2.75Z`,fill:`black`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}]],{name:`sparkle`,componentName:`Sparkle`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_sparkle.svg`}),be=D(`sun`,[[`line`,{x1:`9`,y1:`1.25`,x2:`9`,y2:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`14.48`,y1:`3.52`,x2:`13.773`,y2:`4.227`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`16.75`,y1:`9`,x2:`15.75`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`14.48`,y1:`14.48`,x2:`13.773`,y2:`13.773`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`9`,y1:`16.75`,x2:`9`,y2:`15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`3.52`,y1:`14.48`,x2:`4.227`,y2:`13.773`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`1.25`,y1:`9`,x2:`2.25`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`3.52`,y1:`3.52`,x2:`4.227`,y2:`4.227`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`circle`,{cx:`9`,cy:`9`,r:`4.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sun`,componentName:`Sun`,collection:`ui`,variant:`outline`,category:`weather`,sourceSize:18,filePath:`ui/outline/weather/18px_sun.svg`}),xe=D(`text-columns`,[[`line`,{x1:`2.25`,y1:`10.75`,x2:`7.5`,y2:`10.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.25`,y1:`14.25`,x2:`7.5`,y2:`14.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.25`,y1:`7.25`,x2:`7.5`,y2:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.25`,y1:`3.75`,x2:`7.5`,y2:`3.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`10.5`,y1:`10.75`,x2:`15.75`,y2:`10.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`10.5`,y1:`14.25`,x2:`15.75`,y2:`14.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`10.5`,y1:`7.25`,x2:`15.75`,y2:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`10.5`,y1:`3.75`,x2:`15.75`,y2:`3.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`text-columns`,componentName:`TextColumns`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_text-columns.svg`}),Se=D(`xmark`,[[`line`,{x1:`14`,y1:`4`,x2:`4`,y2:`14`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`4`,y1:`4`,x2:`14`,y2:`14`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`xmark`,componentName:`Xmark`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_xmark.svg`}),Ce=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},we={pipe(){return Ce(this,arguments)}},Te=function(){function e(){}return e.prototype=we,e}(),Ee=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},De=e=>e,Oe=e=>()=>e,ke=Oe(!0),Ae=Oe(void 0),je=Ae;function Me(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Ne(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var Pe=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},Fe=new WeakSet;function Ie(e){return typeof e==`string`}function Le(e){return typeof e==`number`}function Re(e){return typeof e==`boolean`}function ze(e){return typeof e==`symbol`}function Be(e){return Ie(e)||Le(e)||ze(e)}function Ve(e){return typeof e==`function`}function He(e){return e!=null}function Ue(e){return!0}function We(e){return typeof e==`object`&&!!e||Ve(e)}var Ge=Ee(2,(e,t)=>We(e)&&t in e),Ke=`~effect/Hash`,qe=e=>{switch(typeof e){case`number`:return Qe(e);case`bigint`:return $e(e.toString(10));case`string`:return $e(e);case`undefined`:return $e(`undefined`);case`function`:case`object`:if(e===null)return $e(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?$e(`Invalid Date`):$e(e.toISOString());if(e instanceof RegExp)return $e(e.toString());{if(Fe.has(e))return Je(e);if(st.has(e))return st.get(e);let t=lt(e,()=>Ze(e)?e[Ke]():typeof e==`function`?Je(e):e instanceof DataView?rt(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?rt(e):e instanceof Map?it(e):e instanceof Set?at(e):tt(e));return st.set(e,t),t}default:return $e(String(e))}},Je=e=>(ot.has(e)||ot.set(e,Qe(Math.floor(Math.random()*(2**53-1)))),ot.get(e)),Ye=Ee(2,(e,t)=>e*53^t),Xe=e=>e&3221225471|e>>>1&1073741824,Ze=e=>Ge(e,Ke),Qe=e=>{if(e!==e||e===1/0||e===-1/0)return $e(String(e));let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Xe(t)},$e=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Xe(t)},et=(e,t)=>{let n=12289;for(let r of t)n^=Ye(qe(r),qe(e[r]));return Xe(n)},tt=e=>et(e,Pe(e)),nt=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Xe(r)},rt=nt(6151,qe),it=nt($e(`Map`),([e,t])=>Ye(qe(e),qe(t))),at=nt($e(`Set`),qe),ot=new WeakMap,st=new WeakMap,ct=new WeakSet;function lt(e,t){if(ct.has(e))return $e(`[Circular]`);ct.add(e);let n=t();return ct.delete(e),n}var ut=`~effect/Equal`;function dt(){return arguments.length===1?e=>ft(e,arguments[0]):ft(arguments[0],arguments[1])}function ft(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||Fe.has(e)||Fe.has(t)?!1:_t(e,t,gt):!1}function pt(e,t,n){let r=mt.has(e),i=ht.has(t);if(r&&i)return!0;if(r||i)return!1;mt.add(e),ht.add(t);let a=n();return mt.delete(e),ht.delete(t),a}var mt=new WeakSet,ht=new WeakSet;function gt(e,t){if(qe(e)!==qe(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=Et(e),r=Et(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:pt(e,t,()=>{if(i)return e[ut](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:yt(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return bt(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return bt(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Ct(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Tt(e,t):xt(e,t)})}function _t(e,t,n){let r=vt.get(e);if(!r)r=new WeakMap,vt.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=vt.get(t);return a||(a=new WeakMap,vt.set(t,a)),a.set(e,i),i}var vt=new WeakMap;function yt(e,t){for(let n=0;n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function bt(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 xt(e,t){let n=Pe(e),r=Pe(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!ft(e[i],t[i]))return!1;return!0}function St(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var Ct=St(ft,ft);function wt(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var Tt=wt(ft),Et=e=>Ge(e,ut),Dt=e=>(t,n)=>t===n||e(t,n),Ot=e=>e.length>0,kt=e=>e>0?Math.floor(e):0;function At(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function jt(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&At(e,n,t[n])}var Mt=Symbol.for(`~effect/Redactable`),Nt=e=>Ge(e,Mt);function Pt(e){return Nt(e)?Ft(e):e}function Ft(e){return e[Mt](globalThis[`~effect/Fiber/currentFiber`]?.context??Rt)}var It=`~effect/Fiber/currentFiber`,Lt=new Map,Rt={"~effect/Context":{},base:Lt,depth:0,mapUnsafe:Lt,pipe(){return Ce(this,arguments)}};function zt(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Bt;r.add(e);let l;if(Mt in e)l=c(Ft(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
10
- `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Ht(e);else if(!t?.ignoreToString&&Ge(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Ut(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${Vt(t)}:${c(Wt(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Vt(t)}: ${c(Wt(e,t),n+1)}`).join(`,
11
- `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Bt=`[Circular]`;function Vt(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Ht(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Ut(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Wt(e,t){try{return e[t]}catch{return`[property access threw]`}}var Gt=Symbol.for(`nodejs.util.inspect.custom`),Kt=e=>{try{return e=Pt(e),Ge(e,`toJSON`)&&Ve(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(Kt):e}catch{return`[toJSON threw]`}},qt={toJSON(){return Kt(this)},[Gt](){return this.toJSON()},toString(){return zt(this.toJSON())}},Jt=()=>Error.stackTraceLimit,Yt=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},Xt=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return Jt()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),Zt=`~effect/Effect`,Qt=`~effect/Exit`,$t={_A:De,_E:De,_R:De},en=`${Zt}/identifier`,tn=`${Zt}/args`,nn=`${Zt}/evaluate`,rn=`${Zt}/successCont`,an=`${Zt}/failureCont`,on=`${Zt}/ensureCont`,sn=Symbol.for(`effect/Effect/Yield`),cn={pipe(){return Ce(this,arguments)},toJSON(){return{...this}},toString(){return zt(this.toJSON(),{ignoreToString:!0,space:2})},[Gt](){return this.toJSON()}},ln={[Zt]:$t,...cn,[Symbol.iterator](){return new Yt(this)},toJSON(){return{_id:`Effect`,op:this[en],...tn in this?{args:this[tn]}:void 0}}},un=e=>Ge(e,Zt),dn=e=>Ge(e,Qt),fn=`~effect/Cause`,pn=`~effect/Cause/Reason`,mn=e=>Ge(e,fn),hn=class{constructor(e){this[fn]=fn,this.reasons=e}pipe(){return Ce(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${zt(this.reasons)})`}[Gt](){return this.toJSON()}[ut](e){return mn(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>dt(t,e.reasons[n]))}[Ke](){return rt(this.reasons)}},gn=new WeakMap,_n=class{[pn];annotations;_tag;constructor(e,t,n){if(this[pn]=pn,this._tag=e,t!==vn&&typeof n==`object`&&n&&t.size>0){let e=gn.get(n);e&&(t=new Map([...e,...t])),gn.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return Ce(this,arguments)}toString(){return zt(this)}[Gt](){return this.toString()}},vn=new Map,yn=class extends _n{constructor(e,t=vn){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${zt(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[ut](e){return Tn(e)&&dt(this.error,e.error)&&dt(this.annotations,e.annotations)}[Ke](){return Ye($e(this._tag))(Ye(qe(this.error))(qe(this.annotations)))}},bn=e=>new hn(e),xn=e=>new hn([new yn(e)]),Sn=class extends _n{constructor(e,t=vn){super(`Die`,t,e),this.defect=e}toString(){return`Die(${zt(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[ut](e){return En(e)&&dt(this.defect,e.defect)&&dt(this.annotations,e.annotations)}[Ke](){return Ye($e(this._tag))(Ye(qe(this.defect))(qe(this.annotations)))}},Cn=e=>new hn([new Sn(e)]),wn=Ee(e=>mn(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new hn(e.reasons.map(e=>e.annotate(t,n)))),Tn=e=>e._tag===`Fail`,En=e=>e._tag===`Die`,Dn=e=>e._tag===`Interrupt`;function On(e){return Ln(`Effect.evaluate: Not implemented`)}var kn=e=>({...ln,[en]:e.op,[nn]:e[nn]??On,[rn]:e[rn],[an]:e[an],[on]:e[on]}),An=e=>{let t=kn(e),n=function(e){this[tn]=e};return n.prototype=t,function(e){return new n(e)}},jn=e=>{let t={[Qt]:Qt,_tag:e.op,get[e.prop](){return this[tn]},...kn(e),toString(){return`${e.op}(${zt(this[tn])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[tn]}},[ut](e){return dn(e)&&e._tag===this._tag&&dt(this[tn],e[tn])},[Ke](){return Ye($e(e.op),qe(this[tn]))}},n=function(e){this[tn]=e};return n.prototype=t,function(e){return new n(e)}},Mn=jn({op:`Success`,prop:`value`,[nn](e){let t=e.getCont(rn);return t?t[rn](this[tn],e,this):e.yieldWith(this)}}),Nn={key:`effect/Cause/StackTrace`},Pn={key:`effect/Cause/InterruptorStackTrace`},Fn=jn({op:`Failure`,prop:`cause`,[nn](e){let t=this[tn],n=!1;e.cache.stackFrame&&(t=wn(t,{mapUnsafe:new Map([[Nn.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(an);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(an);return r?r[an](t,e,n?void 0:this):e.yieldWith(n?Fn(t):this)}}),In=e=>Fn(xn(e)),Ln=e=>Fn(Cn(e)),Rn=An({op:`WithFiber`,[nn](e){return this[tn](e)}}),zn=function(){class e extends globalThis.Error{}let t=kn({op:`YieldableError`,[nn](){return In(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Bn=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends zn{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(jt(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Vn=e=>{class t extends Bn{_tag=e}return t.prototype.name=e,t},Hn=`~effect/Cause/Done`,Un=e=>Ge(e,Hn),Wn={[Hn]:Hn,_tag:`Done`,value:void 0},Gn=e=>e===void 0?Wn:{[Hn]:Hn,_tag:`Done`,value:e},Kn=In(Wn),qn=e=>e===void 0?Kn:In(Gn(e)),Jn=`~effect/Option`,Yn={[Jn]:{_A:e=>e},...cn,[Symbol.iterator](){return new Yt(this)}},Xn=Object.defineProperty(Object.assign(Object.create(Yn),{_tag:`Some`,_op:`Some`,[ut](e){return $n(e)&&tr(e)&&dt(this.value,e.value)},[Ke](){return Ye(qe(this._tag))(qe(this.value))},toString(){return`some(${zt(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:Kt(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),Zn=qe(`None`),Qn=Object.assign(Object.create(Yn),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[ut](e){return $n(e)&&er(e)},[Ke](){return Zn},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),$n=e=>Ge(e,Jn),er=e=>e._tag===`None`,tr=e=>e._tag===`Some`,nr=Object.create(Qn),rr=function(e){this.value=e};rr.prototype=Xn;var ir=e=>new rr(e),ar=`~effect/Result`,or={[ar]:{_A:e=>e,_E:e=>e},...cn,[Symbol.iterator](){return new Yt(this)}},sr=Object.assign(Object.create(or),{_tag:`Success`,_op:`Success`,[ut](e){return lr(e)&&dr(e)&&dt(this.success,e.success)},[Ke](){return Ye(qe(this._tag))(qe(this.success))},toString(){return`success(${zt(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:Kt(this.success)}}}),cr=Object.assign(Object.create(or),{_tag:`Failure`,_op:`Failure`,[ut](e){return lr(e)&&ur(e)&&dt(this.failure,e.failure)},[Ke](){return Ye(qe(this._tag))(qe(this.failure))},toString(){return`failure(${zt(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:Kt(this.failure)}}}),lr=e=>Ge(e,ar),ur=e=>e._tag===`Failure`,dr=e=>e._tag===`Success`,fr=function(e){this.failure=e};fr.prototype=cr;var pr=e=>new fr(e),mr=function(e){this.success=e};mr.prototype=sr;var hr=e=>new mr(e);function gr(e){return(t,n)=>t===n?0:e(t,n)}var _r=gr((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),vr=e=>Ee(2,(t,n)=>e(t,n)===-1),yr=e=>Ee(2,(t,n)=>e(t,n)===1),br=e=>Ee(2,(t,n)=>e(t,n)!==1),xr=e=>Ee(2,(t,n)=>e(t,n)!==-1),Sr=()=>nr,Cr=ir,wr=er,Tr=tr,Er=Ee(2,(e,{onNone:t,onSome:n})=>wr(e)?t():n(e.value)),Dr=e=>(...t)=>{try{return Cr(e(...t))}catch{return Sr()}},Or=hr,kr=pr,Ar=ur,jr=globalThis.Array,Mr=Ee(2,(e,t)=>[...e,t]);jr.isArray;var Nr=Ot,Pr=Ot,Fr=()=>[],Ir=Ee(2,(e,t)=>e.map(t)),Lr=`~effect/BigDecimal`,Rr={[Lr]:Lr,[Ke](){let e=Kr(this);return Ye(qe(e.value),Qe(e.scale))},[ut](e){return zr(e)&&ti(this,e)},toString(){return`BigDecimal(${ni(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Gt](){return this.toJSON()},pipe(){return Ce(this,arguments)}},zr=e=>Ge(e,Lr),Br=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Rr);return n.value=e,n.scale=t,n},Vr=(e,t)=>{if(e!==Hr&&e%Wr===Hr)throw RangeError(`Value must be normalized`);let n=Br(e,t);return n.normalized=n,n},Hr=BigInt(0),Ur=BigInt(1),Wr=BigInt(10),Gr=Vr(Hr,0),Kr=e=>{if(e.normalized===void 0){if(e.value===Hr)e.normalized=Gr;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=Vr(BigInt(t.substring(0,t.length-n)),e.scale-n)}}return e.normalized},qr=100,Jr=[Ur],Yr=(e,t)=>e===t?0:e<t?-1:1,Xr=(e,t)=>{let n=`${e.value<Hr?-e.value:e.value}`,r=`${t.value<Hr?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==Hr)return i<Hr?-1:1;let a=Math.max(n.length,r.length);for(let e=0;e<a;e++){let t=e<n.length?n.charCodeAt(e):48,i=e<r.length?r.charCodeAt(e):48;if(t!==i)return t<i?-1:1}return 0},Zr=(e,t)=>{if(e.scale===t.scale)return Yr(e.value,t.value);let n=Qr(e),r=Qr(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>qr)return n===-1?Xr(t,e):Xr(e,t);let o=Jr[a]??=Wr**BigInt(a);return i>0?Yr(e.value,t.value*o):Yr(e.value*o,t.value)},Qr=e=>e.value===Hr?0:e.value<Hr?-1:1,$r=e=>e.value<Hr?Br(-e.value,e.scale):e,ei=Dt((e,t)=>Zr(e,t)===0),ti=Ee(2,(e,t)=>ei(e,t)),ni=e=>{let t=Kr(e);if(Math.abs(t.scale)>=16)return ri(t);let n=t.value<Hr,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},ri=e=>{if(ii(e))return`0e+0`;let t=Kr(e),n=`${$r(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${ai(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},ii=e=>e.value===Hr,ai=e=>e.value<Hr,oi=e=>kn({op:e.label,[nn]:e.evaluate}),si=`~effect/Context/Service`,ci=function(){function e(){}let t=e;Object.setPrototypeOf(t,li);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[di]=di,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&ui.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},li={[si]:si,...oi({label:`Service`,evaluate(e){return Mn(Mi(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Oi(this,e)},use(e){return Rn(t=>e(Mi(t.context,this)))},useSync(e){return Rn(t=>Mn(e(Mi(t.context,this))))}},ui=new Set,di=`~effect/Context/Reference`,fi=`~effect/Context`,pi=8,mi=8,hi=(e,t,n,r)=>{let i=Object.create(Si);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},gi=(e,t)=>{t&&(gi(e,t.parent),e.set(t.key,t.value))},_i=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return gi(t,e.overlay),e._flat=t},vi=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),xi(n)},yi=Symbol(),bi=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?yi:(n.overlay&&++n.baseHits>=mi&&(n.base=_i(n),n.overlay=void 0,n.depth=0),r)},xi=e=>hi(void 0,e,void 0,0),Si={get mapUnsafe(){return _i(this)},...cn,[fi]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ut](e){if(!wi(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!dt(r,n.get(e)))return!1;return!0},[Ke](){return Qe(this.mapUnsafe.size)}},Ci=(e,t)=>e.cacheRoot===t.cacheRoot,wi=e=>Ge(e,fi),Ti=e=>!!e[di],Ei=()=>Di,Di=xi(new Map),Oi=(e,t)=>xi(new Map([[e.key,t]])),ki=Ee(3,(e,t,n)=>Ai(e,t.key,n)),Ai=(e,t,n)=>{let r=e,i=ui.has(t)?void 0:r.cacheRoot;if(r.depth>=pi){let e=new Map(r.mapUnsafe);return e.set(t,n),hi(i,e,void 0,0)}return hi(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},ji=(e,t)=>{let n=bi(e,t);return n===yi?void 0:n},Mi=Ee(2,(e,t)=>{let n=bi(e,t.key);if(n===yi){if(Ti(t))return Pi(t);throw Fi(t)}return n}),Ni=`~effect/Context/defaultValue`,Pi=e=>Ni in e?e[Ni]:e[Ni]=e.defaultValue(),Fi=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
12
- `);e.splice(1,3),t.stack=e.join(`
13
- `)}return t},Ii=Ee(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:vi(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),Li=ci,Ri=`~effect/Duration`,zi=BigInt(0),Bi=BigInt(1),Vi=BigInt(2),Hi=BigInt(10),Ui=BigInt(1e3),Wi=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),Gi=e=>Wi(e*1e6),Ki=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=Hi**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*Vi>=a?Bi:zi);return r?-s:s},qi=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Ji=e=>{switch(typeof e){case`number`:return oa(e);case`bigint`:return aa(e);case`string`:{if(e===`Infinity`)return ra;if(e===`-Infinity`)return ia;let t=qi.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return aa(Ki(r,Bi));if(i===`micro`||i===`micros`)return aa(Ki(r,Ui));let a=Number(r);switch(i){case`milli`:case`millis`:return oa(a);case`second`:case`seconds`:return sa(a);case`minute`:case`minutes`:return ca(a);case`hour`:case`hours`:return la(a);case`day`:case`days`:return ua(a);case`week`:case`weeks`:return da(a)}break}case`object`:{if(e===null)break;if(Ri in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Le)?Yi(e):Number.isNaN(e[0])||Number.isNaN(e[1])?na:e[0]===-1/0||e[1]===-1/0?ia:e[0]===1/0||e[1]===1/0?ra:ea(Wi(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?ea(n):ea(Wi(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return Yi(e)},Yi=e=>{throw Error(`Invalid Input: ${e}`)},Xi={_tag:`Millis`,millis:0},Zi={_tag:`Infinity`},Qi={_tag:`NegativeInfinity`},$i={[Ri]:Ri,[Ke](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?qe(Wi(e)):Qe(this.value.millis)}case`Nanos`:return qe(this.value.nanos);default:return tt(this.value)}},[ut](e){return ta(e)&&ha(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[Gt](){return this.toJSON()},pipe(){return Ce(this,arguments)}},ea=e=>{let t=Object.create($i);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?Xi:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:Gi(e)}:e>0?Zi:Qi:e===zi?Xi:{_tag:`Nanos`,nanos:e},t},ta=e=>Ge(e,Ri),na=ea(0),ra=ea(1/0),ia=ea(-1/0),aa=e=>ea(e),oa=e=>ea(e),sa=e=>ea(e*1e3),ca=e=>ea(e*6e4),la=e=>ea(e*36e5),ua=e=>ea(e*864e5),da=e=>ea(e*6048e5),fa=e=>{let t=Ji(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return Gi(t.value.millis)}},pa=Ee(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(fa(e),t.value.nanos):n.onNanos(e.value.nanos,fa(t))),ma=(e,t)=>pa(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),ha=Ee(2,(e,t)=>ma(e,t)),ga=Li(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new xa}),_a=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},va=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},ya=e=>{try{return va(e)}catch{return _a(e)}},ba=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},xa=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?_a:ya)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new Sa(this.setImmediate)}},Sa=class{tasks=new ba;running=void 0;setImmediate;constructor(e=ya){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},Ca=Li(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),wa=Li(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),Ta=`effect/Tracer/ParentSpan`,Ea=`effect/Tracer`,Da=`effect/Metric/FiberRuntimeMetrics`,Oa=Li(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:Ae}),ka=Li(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:ke}),Aa=Li(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),ja=Li(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Ma=class extends _n{constructor(e,t=vn){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[ut](e){return Dn(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Ke](){return Ye($e(`${this._tag}:${this.fiberId}`))(Je(this.annotations))}},Na=e=>new hn([new Ma(e)]),Pa=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Or(n.error)}return kr(e)},Fa=e=>e.reasons.some(Dn),Ia=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=qe(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>dt(e,i)))continue;else t.push(i);r.push(i)}return r},La=Ee(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new hn(Ia(e.reasons,t.reasons));return dt(e,n)?e:n}),Ra=Ee(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Tn(e)?(n=!0,new yn(t(e.error),e.annotations)):e);return n?bn(r):e}),za=e=>{let t={Fail:[],Die:[],Interrupt:[]};for(let n=0;n<e.reasons.length;n++)t[e.reasons[n]._tag].push(e.reasons[n]);return t},Ba=e=>{let t=za(e);return t.Fail.length>0?t.Fail[0].error:t.Die.length>0?t.Die[0].defect:t.Interrupt.length>0?new globalThis.Error(`All fibers interrupted without error`):new globalThis.Error(`Empty cause`)},Va=`~effect/Fiber`,Ha={_A:De,_E:De},Ua={id:0},Wa=()=>globalThis[It],Ga=class{constructor(e,t=!0){this[Va]=Ha,this.setContext(e),this.id=++Ua.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}[Va];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;_parent;context;cache;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Mi(this.context,e)}addObserver(e){return this._exit?(e(this._exit),je):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>{if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=Na(e);this.cache.stackFrame&&(n=wn(n,Oi(Nn,this.cache.stackFrame))),t&&(n=wn(n,t)),this._interruptedCause=this._interruptedCause?La(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(no(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===sn)return;let n=Ja.interruptChildren&&Ja.interruptChildren(this);if(n!==void 0)return this.evaluate(Ao(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=Ei()}runLoop(e){let t=globalThis[It];globalThis[It]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){this._deferredInterrupt&&(this._deferredInterrupt=!1,i=no(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Ao(oo,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[nn](this),i===sn){let e=this._yielded;if(Qt in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return sn}}}catch(e){return Ge(i,nn)?this.runLoop(Ln(e)):Ln(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[It]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,qa;for(;;){let t=this._stack.pop();if(!t)return;let n=t[on];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}yieldWith(e){return this._yielded=e,sn}children(){return this._children??=new Set}pipe(){return Ce(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Ci(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=Ka(e);this.cache!==void 0&&this.cache.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},Ka=e=>{let t=ji(e,Ea);return{scheduler:Mi(e,ga),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Mi(e,ka),span:ji(e,Ta),logLevel:Mi(e,Aa),minimumLogLevel:Mi(e,ja),stackFrame:Mi(e,Oa),runtimeMetrics:ji(e,Da),maxOpsBeforeYield:Mi(e,Ca),preventYield:Mi(e,wa)}},qa={[rn](e,t){return no(t._interruptedCause)},[an](e,t){return no(t._interruptedCause)}},Ja={interruptChildren:void 0},Ya=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Pn.key,e.cache.stackFrame),xi(t)},Xa=e=>{let t=e;return t._exit?to(t._exit):mo(n=>t._exit?n(to(t._exit)):io(e.addObserver(e=>n(to(e)))))},Za=e=>mo(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(to(r))}return a(),io(()=>i?.())}),Qa=e=>Rn(t=>$a(e,t.id)),$a=Ee(e=>Ge(e[0],Va),(e,t,n)=>Rn(r=>{let i=Ya(r);return i=i&&n?Ii(i,n):i??n,e.interruptUnsafe(t,i),ko(Xa(e))})),eo=e=>Rn(t=>{let n=Ya(t),r=Fr();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return ko(Za(r))}),to=Mn,no=Fn,ro=In,io=An({op:`Sync`,[nn](e){let t=this[tn](),n=e.getCont(rn);return n?n[rn](t,e):e.yieldWith(Mn(t))}}),ao=An({op:`Suspend`,[nn](e){return this[tn]()}}),oo=An({op:`Yield`,[nn](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Lo)},this[tn]??0),e.yieldWith(()=>{t=!0})}})(0),so=e=>ao(()=>no(Xt(e))),co=e=>Ln(e),lo=to(void 0),uo=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Fs(e,`An error occurred in Effect.tryPromise`):e.catch;return fo(function(e,r){let i=t=>{try{e(ro(Xt(()=>n(t))))}catch(t){e(co(t))}};try{Xt(()=>t(r)).then(t=>e(to(t)),i)}catch(e){i(e)}},t.length!==0)},fo=function(){let e=kn({op:`Async`,[nn](e){let t=Xt(()=>this.register.bind(e.cache.scheduler)),n=!1,r=!1,i=this.withSignal?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(po(()=>(n=!0,i?.abort(),a??Lo))),sn):r}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),po=An({op:`AsyncFinalizer`,[on](e){e.interruptible&&(e.interruptible=!1,e._stack.push(vs))},[an](e,t){return Fa(e)?Ao(this[tn](),()=>no(e)):no(e)}}),mo=e=>fo(e,e.length>=2),ho=(...e)=>{if(e.length===1){let t=e[0];return ao(()=>bo(t()))}let[t,n]=e;return ao(()=>bo(n.call(t.self)))},go=(e,...t)=>{let n=t.length===0?function(){return ao(()=>bo(e.apply(this,arguments)))}:function(){let n=ao(()=>bo(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return _o(e.length,n)},_o=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),vo=(e,...t)=>_o(e.length,t.length===0?function(){return yo(()=>e.apply(this,arguments))}:function(){let n=yo(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),yo=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return to(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return ao(()=>n?(n=!1,Ao(r.value,e=>bo(t,e))):ao(()=>bo(e())))}}}catch(e){return co(e)}},bo=function(){let e=kn({op:`Iterator`,[rn](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return to(r.value);if(!jo(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[nn](e){return this[rn](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),xo=function(e){return e._stack.push(this),this[tn]},So=kn({op:`OnSuccess`,[nn]:xo}),Co=function(e,t){this[tn]=e,this[rn]=t};Co.prototype=So;var wo=function(e,t,n){this[tn]=e,this[rn]=t,this.payload=n};wo.prototype=So;var To=function(){return this.payload},Eo=function(e){let t=this.payload;return to(Xt(()=>t(e)))},Do=function(e){let t=this.payload;return Xt(()=>t(e))},Oo=Ee(2,(e,t)=>new wo(e,un(t)?To:Do,t)),ko=e=>new wo(e,To,Lo),Ao=Ee(2,(e,t)=>new Co(e,t.length===1?t:e=>t(e))),jo=e=>e[Qt]!==void 0,Mo=Ee(2,(e,t)=>jo(e)?e._tag===`Success`?t(e.value):e:Ao(e,t)),No=Ee(2,(e,t)=>new wo(e,Eo,t)),Po=Ee(2,(e,t)=>jo(e)?Ro(e,t):No(e,t)),Fo=e=>e._tag===`Success`,Io=e=>e._tag===`Failure`,Lo=Mn(void 0),Ro=Ee(2,(e,t)=>e._tag===`Success`?Mn(t(e.value)):e),zo=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?Lo:Fn(bn(t))},Bo=Ee(2,(e,t)=>Rn(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),hs(e,()=>{n.setContext(r)}))})),Vo=e=>Rn(t=>e(t.context)),Ho=Ee(2,(e,t)=>jo(e)?e:Bo(e,Ii(t))),Uo=function(){return arguments.length===1?Ee(2,(e,t)=>Wo(e,arguments[0],t)):Ee(3,(e,t,n)=>Wo(e,t,n)).apply(this,arguments)},Wo=(e,t,n)=>Bo(e,ki(t,n)),Go=Ee(e=>un(e[0]),(e,t)=>ys({while:ke,body:Oe(t?.disableYield?e:Ao(e,e=>oo)),step:je})),Ko=Ee(2,(e,t)=>new Jo(e,t.length===1?t:e=>t(e))),qo=kn({op:`OnFailure`,[nn]:xo}),Jo=function(e,t){this[tn]=e,this[an]=t};Jo.prototype=qo;var Yo=Ee(3,(e,t,n)=>Ko(e,e=>{let r=t(e);return Ar(r)?no(r.failure):Xt(()=>n(r.success,e))})),Xo=Ee(3,(e,t,n)=>Ko(e,e=>{let r=t(e);return Ar(r)?no(e):Oo(Xt(()=>n(r.success,e)),no(e))})),Zo=Ee(2,(e,t)=>Xo(e,Pa,e=>t(e))),Qo=e=>jo(e)?Mn(e):$o(e),$o=An({op:`Exit`,[nn](e){return e._stack.push(this),this[tn]},[rn](e,t,n){return to(n??Mn(e))},[an](e,t,n){return to(n??Fn(e))}}),es=`~effect/Scope`,ts=`~effect/Scope/Closeable`,ns=ci(`effect/Scope`),rs=(e,t)=>ao(()=>is(e,t)??lo),is=(e,t)=>{if(e.state._tag===`Closed`)return;let n={_tag:`Closed`,exit:t};if(e.state._tag===`Empty`){e.state=n;return}let r=e.state;if(e.state=n,r.finalizer!==void 0)return r.finalizer(t);let i=r.finalizers;if(i!==void 0&&i.size!==0)return i.size===1?i.values().next().value(t):os(e,i,t)},as=(e,t)=>Fo(e)?t:Ko(t,t=>no(La(e.cause,t))),os=go(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=Wa();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*Qo(s(n))):i.push(ws(o,s(n),!0,!0,`inherit`))}return i.length>0&&(r=yield*Za(i)),yield*zo(r)}),ss=(e,t)=>ao(()=>e.state._tag===`Closed`?t(e.state.exit):(cs(e,{},t),lo)),cs=(e,t,n)=>{if(e.state._tag===`Empty`)e.state={_tag:`Open`,finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag===`Open`){let r=e.state;r.finalizer===void 0?r.finalizers===void 0?(r.finalizerKey=t,r.finalizer=n):r.finalizers.set(t,n):(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n))}},ls=(e=`sequential`)=>({[ts]:ts,[es]:es,strategy:e,state:us}),us={_tag:`Empty`},ds=e=>io(()=>ls(e)),fs=ns,ps=Uo(ns),ms=e=>Ao(fs,t=>Vo(n=>ss(t,t=>Ho(e(t),n)))),hs=function(){let e=kn({op:`OnExit`,[nn](e){return e._stack.push(this),this.effect},[on](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(vs),e.interruptible=!1)},[rn](e,t,n){n??=Mn(e);let r=this.onExit(n);return r?Ao(r,e=>n):n},[an](e,t,n){n??=Fn(e);let r=this.onExit(n);return r?Ao(as(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,function(e,n,r){return new t(e,n,r)}}(),gs=Ee(2,hs),_s=e=>Rn(t=>t.interruptible?(t.interruptible=!1,t._stack.push(vs),e):e),vs=An({op:`SetInterruptible`,[on](e){if(e.interruptible=this[tn],e._interruptedCause&&e.interruptible)return()=>no(e._interruptedCause)}})(!0),ys=An({op:`While`,[rn](e,t){return this[tn].step(e),this[tn].while()?(t._stack.push(this),this[tn].body()):Lo},[nn](e){return this[tn].while()?(e._stack.push(this),this[tn].body()):Lo}}),bs=e=>e===`unbounded`?1/0:Math.max(1,e??1),xs=()=>e=>{let t=e.onItem,n=e.step,r=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!jo(c))return Ao(Qo(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??lo);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return r},Ss=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f=!1,p,m,h=e=>{let t=Ln(e);return p=t,c=!0,f=!0,u&&u.size>0?Ao(_s(eo(Array.from(u))),()=>t):t},g=()=>{let i=!1;for(;!p&&a<o;a++){let o=r[a],_=m??t(e,o,a);if(jo(_)){if(p=n(e,o,_,a),p)break}else if(l){m=void 0;let t=ws(l,_,!0,!0,`inherit`);if(t._exit){if(p=n(e,o,t._exit,a),p)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(p){if(!f&&a._tag===`Failure`)for(let e of a.cause.reasons)if(e._tag===`Interrupt`)continue;else p._tag===`Failure`?p.cause.reasons.push(e):p=Fn(bn([e]))}else{let t=n(e,o,a,r);t&&(p=t._tag===`Failure`?Fn(bn(t.cause.reasons.slice())):t,g())}if(i){let e=g();e&&d(e)}else c&&u.size===0&&d(p??lo)}catch(e){d(h(e))}}),u.size<s)continue;i=!0,a++;return}else return mo(e=>{l=Wa(),u=new Set,m=_,d=e;let t;try{t=g()}catch(t){return e(h(t))}return t?e(t):ao(()=>(p=Lo,f=!0,u?eo(u):lo))})}if(c=!0,p){if(u&&u.size>0){let e=Ya(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||p._tag===`Failure`)return p}else if(d){if(u)u.size===0&&d(lo);else return Lo}};return g()}},Cs=()=>e=>Ss(e),ws=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Ga(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s._parent=a),s},Ts=e=>(t,n)=>{let r=new Ga(n?.scheduler?ki(e,ga,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},Es=Ts(Ei()),Ds=e=>{let t=Ts(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},Os=(e=>{let t=Ds(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw Ba(e.cause);return e.value})})(Ei()),ks=(e=>{let t=Ts(e);return e=>{if(jo(e))return e;let n=new xa(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Ln(new Ns(r))}})(Ei()),As=`~effect/Cause/IllegalArgumentError`,js=class extends Vn(`IllegalArgumentError`){[As]=As;constructor(e){super({message:e})}},Ms=`~effect/Cause/AsyncFiberError`,Ns=class extends Vn(`AsyncFiberError`){[Ms]=Ms;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Ps=`~effect/Cause/UnknownError`,Fs=class extends Vn(`UnknownError`){[Ps]=Ps;constructor(e,t){super({message:t,cause:e})}},Is={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Is.gray,Is.blue,Is.green,Is.yellow,Is.red,Is.bgBrightRed,Is.black;var Ls=Tn,Rs=bn,zs=Cn,Bs=Ra,Vs=Un,Hs=qn,Us=js,Ws=Mn,Gs=Fn,Ks=In,qs=Lo,Js=Fo,Ys=Io,Xs=ds,Zs=ls,Qs=ps,$s=rs,ec=`~effect/DateTime`,tc=`~effect/DateTime/TimeZone`,nc={[ec]:ec,pipe(){return Ce(this,arguments)},[Gt](){return this.toString()},toJSON(){return pc(this).toJSON()}},rc={...nc,_tag:`Utc`,[Ke](){return Qe(this.epochMilliseconds)},[ut](e){return ac(e)&&e._tag===`Utc`&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${pc(this).toJSON()})`}};({...nc});var ic={[tc]:tc,[Gt](){return this.toString()}};({...ic}),{...ic};var ac=e=>Ge(e,ec),oc=e=>e._tag===`Utc`,sc=e=>{let t=Object.create(rc);return t.epochMilliseconds=e,Object.defineProperty(t,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),t},cc=e=>{let t=e.getTime();if(Number.isNaN(t))throw new Us(`Invalid date`);return sc(t)},lc=e=>{if(ac(e))return e;if(e instanceof Date)return cc(e);if(typeof e==`object`){if(`epochMilliseconds`in e)return cc(new Date(e.epochMilliseconds));let t=new Date(0);return hc(t,e),cc(t)}return typeof e==`string`&&!uc(e)?cc(new Date(e+`Z`)):cc(new Date(e))},uc=e=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e),dc=Dr(lc),fc=e=>sc(e.epochMilliseconds),pc=e=>new Date(e.epochMilliseconds),mc=e=>e.epochMilliseconds,hc=(e,t)=>{if((t.year!==void 0||t.month!==void 0||t.day!==void 0)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),t.month===void 0?e.getUTCMonth():t.month-1,t.day??e.getUTCDate()),t.weekDay!==void 0){let n=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+n)}t.hour!==void 0&&e.setUTCHours(t.hour),t.minute!==void 0&&e.setUTCMinutes(t.minute),t.second!==void 0&&e.setUTCSeconds(t.second),t.millisecond!==void 0&&e.setUTCMilliseconds(t.millisecond)},gc=e=>pc(e).toISOString(),_c=Ee(2,(e,t)=>Yo(e,xc,e=>t(e))),vc=e=>e.reasons.some(yc),yc=e=>e._tag===`Fail`&&Vs(e.error),bc=e=>{let t,n=!1;for(let r of e.reasons)yc(r)?t??=r.error:r._tag!==`Interrupt`&&(n=!0);return t===void 0?kr(e):n?kr(Rs(e.reasons.filter(e=>!yc(e)))):Or(t)},xc=e=>{let t=bc(e);return Ar(t)?t:Or(t.success.value)},Sc=ys,Cc=uo,wc=to,Tc=ao,Ec=io,Dc=lo,Oc=mo,kc=ho,Ac=ro,jc=no,Mc=so,Nc=co,Pc=Ao,Fc=Oo,Ic=Qo,Lc=No,Rc=Ko,zc=Zo,Bc=ms,Vc=gs,Hc=Go,Uc=Es,Wc=Os,Gc=ks,Kc=Po,qc=Mo,Jc=vo,Yc=`~structural`,Xc=`~sentinels`,Zc=`~constructor`,Qc=Symbol(),$c=Ws,el=$c(Qc),tl=$c(Qc),nl=e=>e===Qc?Sr():Cr(e),rl=e=>e._tag===`None`?el:$c(e.value),il=`~effect/SchemaIssue/Issue`;function al(e){return Ge(e,il)&&e[il]===il}var ol=class{[il]=il;constructor(e,t){t?.reportInput===!0&&e!==Qc&&(this.input=e)}},sl=class extends ol{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},cl=class extends ol{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},ll=class extends ol{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},ul=class extends ol{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},dl=class extends ol{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},fl=class extends ol{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},pl=class extends ol{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},ml=class extends ol{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},hl=class extends ol{_tag=`Forbidden`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},gl=class extends ol{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},_l=class extends ol{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function vl(e,t,n){if(al(e))return e;if(typeof e==`string`)return new ml({message:e},t,n);let r=typeof e.issue==`string`?new ml({message:e.issue},t,n):e.issue;return new ll(e.path,r)}function yl(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new ml(void 0,t,n):vl(e,t,n)}function bl(e,t,n,r){return Array.isArray(t)?Pr(t)?t.length===1?vl(t[0],n,r):new fl(e,Ir(t,e=>vl(e,n,r)),n,r):void 0:yl(t,n,r)}function xl(e){let t;for(let n of e.reasons){if(!Ls(n)||!al(n.error))return;t??=n.error}return t}function Sl(e,t){let n=xl(e);if(n===void 0)throw Error(t,{cause:e});return n}var Cl=ac,wl=oc,Tl=lc,El=dc,Dl=fc,Ol=mc,kl=gc,Al=e=>Object.assign(Object.create(we),e);function jl(e){return Rl((t,n)=>Ac(e(t,n)))}function Ml(e){return jl((t,n)=>{let r={message:e(t)};return Tr(t)?new hl(r,t.value,n):new hl(r)})}var Nl=Ml(()=>`Encoding is not supported`),Pl=Al({_tag:`Passthrough`});function Fl(){return Pl}function Il(e){return Al({_tag:`Transform`,transform:e})}function Ll(e){return Al({_tag:`TransformEffect`,transform:e})}function Rl(e){return Al({_tag:`TransformOptionalEffect`,transform:e})}function zl(){return Il(globalThis.String)}function Bl(){return Il(globalThis.Number)}function Vl(){return Il(e=>new globalThis.Date(e))}var Hl=class extends Te{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Hl(this.encode,this.decode)}},Ul=`~effect/SchemaTransformation/Transformation`,Wl=class extends Te{[Ul]=Ul;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Wl(this.encode,this.decode)}};function Gl(e){return Ge(e,Ul)&&e[Ul]===Ul}var Kl=e=>Gl(e)?e:new Wl(e.decode,e.encode);function ql(e){return new Wl(Ll(e.decode),Ll(e.encode))}var Jl=new Wl(Fl(),Fl());function Yl(){return Jl}var Xl=new Wl(Bl(),zl()),Zl=new Wl(Vl(),Il(Ht));function Ql(e){return t=>t._tag===e}var $l=Ql(`Declaration`),eu=Ql(`Never`),tu=Ql(`Literal`),nu=Ql(`UniqueSymbol`),ru=Ql(`Arrays`),iu=Ql(`Objects`),au=Ql(`Suspend`),ou=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},su={},cu=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},lu=`~effect/Schema`,uu=class{[lu]=lu;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},du=class extends uu{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===Qc?el:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=Dd(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new du(a,r,this.annotations,t,void 0,this.context,n,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},fu=new class extends uu{_tag=`Null`;getParser(){return Wd(this,null)}getExpected(){return`null`}},pu=class extends uu{_tag=`Undefined`;getParser(){return Wd(this,void 0)}toCodecJson(){return gd(this,[mu])}getExpected(){return`undefined`}},mu=new ou(fu,new Wl(Il(()=>void 0),Il(()=>null))),hu=new pu,gu=new class extends uu{_tag=`Unknown`;getParser(){return Gd(this,Ue)}getExpected(){return`unknown`}},_u=class extends uu{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${zt(e)}`);this.literal=e}getParser(){return Wd(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?vu(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:vu(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function vu(e){let t=globalThis.String(e.literal);return gd(e,[new ou(new _u(t),new Wl(Il(()=>e.literal),Il(()=>t)))])}var yu=new class extends uu{_tag=`String`;getParser(){return Gd(this,Ie)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&$d(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},bu=class extends uu{_tag=`Number`;getParser(){return Gd(this,Le)}matchKey(e,t){return this._match(Jd,e,t)}matchPart(e,t){return this._match(qd,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:$d(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(xu(this.checks,`effect/schema/isFinite`)||xu(this.checks,`effect/schema/isInt`))?this:gd(this,[dd])}toCodecStringTree(){return this.toCodecJson()===this?gd(this,[Zd]):gd(this,[Qd])}getExpected(){return`number`}};function xu(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&xu(e.checks,t))}var Su=new bu,Cu=new class extends uu{_tag=`Boolean`;getParser(){return Gd(this,Re)}getExpected(){return`boolean`}},wu=class extends uu{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Id(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Id(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return Jc(function*(e,c){if(e===Qc)return Qc;if(!Array.isArray(e))return yield*Ac(new pl(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=n.rest.length===0?a:Math.max(l,a+o),f=c.concurrency===void 0?1:bs(c.concurrency),p=f===1?Du(u,e,0,d):Ou(u,e,{concurrency:f,end:d});if(p&&(yield*p),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new dl(n,e[t],c),i=new ll([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*Ac(new fl(n,[i],e,c))}return u.issues?yield*Ac(new fl(n,u.issues,e,c)):u.output})}_rebuild(e,t,n){let r=Dd(this.elements,e),i=Dd(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new wu(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function Tu(e,t,n,r){if(n._tag===`Failure`)return ku(e,e.ast,r,n);let i=n===tl?t:n[tn];if(i!==Qc)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Id(t.ast))return;let n=new ll([r],new ul(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Ks(new fl(e.ast,[n],e.input,e.options))}}var Eu={onItem(e,t,n){let r=n<e.len?t:Qc;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:Tu},Du=xs()(Eu),Ou=Cs()(Eu),ku=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=xl(r.cause);if(i===void 0)return Gs(Bs(r.cause,r=>new fl(t,[new ll([n],r)],e.input,e.options)));let a=new ll([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Ks(new fl(t,[a],e.input,e.options))},Au=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function ju(e,t,n=su){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(Kd(Bd(t)))}var Mu=class{name;type;constructor(e,t){this.name=e,this.type=t}};function Nu(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(Nu);default:return!1}}function Pu(e){let t=vd(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(Pu);default:return!1}}function Fu(e){return Nu(e)&&Pu(e)}var Iu=class{parameter;type;constructor(e,t){if(!Fu(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Id(t)&&!Ud(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Lu=class extends uu{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=new Set,c=[];for(let t of e){let e=t.name;s.has(e)?c.push(e):s.add(e)}if(c.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(c)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(typeof e.name==`number`?globalThis.String(e.name):e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return Gd(n,He);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return ku(e,n,t,s)??qs;let c=s===tl?a:s[tn];if(r!==Qc&&c!==Qc){if(i&&(o.has(t)||o.has(typeof r==`number`?globalThis.String(r):r)))return qs;At(e.out,r,c)}return qs},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!jo(n))return Pc(Ic(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return ku(e,n,t,i)??qs;let a=i===tl?t:i[tn],o=e.input[t],s=r.parserValue(o,e.options);return jo(s)?l(e,t,a,o,s):Pc(Ic(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return jo(i)?l(e,t,t,r,i):Pc(Ic(i),n=>l(e,t,t,r,n))},f=a?Cs()({onItem:(e,[t,n])=>n.is.parameter===yu?d(e,t,n):u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0,p=()=>(s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e(Kd(n.parameter)),parserValue:t(n.type)})):void 0),s),m=Jc(function*(e,t){if(e===Qc)return Qc;if(typeof e!=`object`||!e||Array.isArray(e))return yield*Ac(new pl(n,e,t));p();let l=e,m={},h={ast:n,input:l,out:m,issues:void 0,options:t},g=t.errors===`all`,_=t.onExcessProperty===`error`,v=t.concurrency===void 0?1:bs(t.concurrency),y=a&&_?n.indexSignatures.map(e=>ju(l,e.parameter,t)):void 0;if(_){o??=new Set(r);let i=y?new Set(o):o;if(y)for(let e of y)for(let t of e)i.add(t);let a=Reflect.ownKeys(l);for(let r=0;r<a.length;r++){let o=a[r];if(!i.has(o)){let r=new dl(n,l[o],t),i=new ll([o],r);if(g){h.issues?h.issues.push(i):h.issues=[i];continue}return yield*Ac(new fl(n,[i],e,t))}}}if(i){let e=v===1?Bu(h,s):Vu(h,s,{concurrency:v});e&&(yield*e)}if(a&&v===1)for(let e=0;e<a;e++){let n=c[e],r=n.is.parameter===yu?d:u,i=y?.[e]??(n.is.parameter===yu?Object.keys(l):ju(l,n.is.parameter,t));for(let e=0;e<i.length;e++){let t=r(h,i[e],n);if(!jo(t))yield*t;else if(t._tag===`Failure`)return yield*t}}else if(f){let e=Fr();for(let n=0;n<a;n++){let r=c[n],i=y?.[n]??(r.is.parameter===yu?Object.keys(l):ju(l,r.is.parameter,t));for(let t=0;t<i.length;t++)e.push([i[t],r])}let n=f(h,e,{concurrency:v});n&&(yield*n)}return h.issues?yield*Ac(new fl(n,h.issues,e,t)):m});if(a)return m;let h=(e,t,n)=>{let r=s[t];return Pc(Ic(n),n=>{let i=Ru(e,r,n);if(i)return i;let a=()=>$c(e.out),o=Bu(e,s.slice(t+1));return o?qc(o,a):a()})};return(e,t)=>{if(e===Qc)return el;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&bs(t.concurrency)!==1)return m(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return Ac(new pl(n,e,t));let r=p(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=Zu(i,s),l=c?i[s]:Qc,u=n.parser(l,t);if(!jo(u))return h(o,e,u);if(u===tl){c&&At(a,s,l);continue}let d=Ru(o,n,u);if(d)return d}}catch(e){return Nc(e)}return $c(a)}}_rebuild(e,t,n,r){let i=Dd(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new Mu(t.name,n)}),a=Dd(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new Iu(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new Lu(i,a,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function Ru(e,t,n){if(n._tag===`Failure`)return ku(e,e.ast,t.name,n);if(n===tl)return;let r=n[tn];if(r!==Qc){At(e.out,t.name,r);return}if(delete e.out[t.name],!Id(t.type)){let n=new ll([t.name],new ul(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return Ks(new fl(e.ast,[n],e.input,e.options))}}var zu={onItem(e,t){if(!Zu(e.input,t.name))return t.parser(Qc,e.options);let n=e.input[t.name];return At(e.out,t.name,n),t.parser(n,e.options)},step:Ru},Bu=xs()(zu),Vu=Cs()(zu);function Hu(e,t){return e?t?[...e,...t]:e:t}function Uu(e,t,n){return new Lu(Reflect.ownKeys(e).map(t=>new Mu(t,e[t].ast)),[],n,t)}function Wu(e){return e.ast}function Gu(e,t,n){return new td(e.map(Wu),t,void 0,n)}var Ku=Ne(e=>{for(;;){if(au(e))return gu;let t=e.encoding;if(!t)return e.recur?.(Ku,De)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==De))return gu;e=t[t.length-1].to}});function qu(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(qu)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Ju(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[Xc];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Id(t)){if(tu(t))return[{key:e.name,literal:t.literal}];if(nu(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Id(e)){if(tu(e))return[{key:t,literal:e.literal}];if(nu(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Ju(Ku(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Ju(e.thunk())}}var Yu=new WeakMap,Xu=Object.freeze([]),Zu=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function Qu(e){let t=Yu.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Ku(s);if(eu(c))continue;if(o){if(tu(c)||nu(c)){a??=new Map;let e=tu(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Ju(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=qu(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Xu;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(We(t)){let i=Zu(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Xu;if(n)return e}return Xu}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Xu;if(!We(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Zu(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Zu(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Zu(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Xu).map(t=>e[t]).filter($u(t));return Yu.set(e,t),t}function $u(e){return t=>{let n=Ku(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function ed(e,t,n=!1){return Qu(t)(e,n)}var td=class extends uu{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===Qc)return el;let a=ed(r,n.types,t!==void 0);if(a.length===0)return Ac(new gl(n,[],r,i));if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:jo(t)?nd(n,t.cause,r,i):Rc(t,e=>nd(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=rd(o,a);return s?qc(s,e=>o.out===tl?wc(r):o.out?o.out:Ac(new gl(n,o.issues??[],r,i))):o.out?o.out:Ac(new gl(n,o.issues??[],r,i))}}_rebuild(e,t,n){let r=Dd(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new td(r,this.options,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=Bd(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(tu);if(t.length>0)return`${ad(n.isMutable)}[ ${t.map(t=>e(t)+od(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>tu(e.type));if(t.length>0)return`{ ${t.map(t=>`${ad(t.type.context?.isMutable)}${Vt(t.name)}${od(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function nd(e,t,n,r){let i=xl(t);return i?Ks(new gl(e,[i],n,r)):Gs(t)}var rd=xs()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=xl(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),Ks(new _l(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return qs}}}),id=new td([new _u(`Infinity`),new _u(`-Infinity`),new _u(`NaN`)]);function ad(e){return e?``:`readonly `}function od(e){return e?`?`:``}var sd=class extends Te{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new sd(this.run,{...this.annotations,...e},this.aborted)}abort(){return new sd(this.run,this.annotations,!0)}and(e,t){return new cd([this,e],t)}},cd=class extends Te{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new cd(this.checks,{...this.annotations,...e})}and(e,t){return new cd([this,e],t)}};function ld(e,t,n=!1){return new sd((t,n,r)=>bl(n,e(t,n,r),t,r),t,n)}function ud(e){return ld(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitraryConstraint:{number:`finite`},...e})}var dd=new ou(new td([xd(Su,[ud()]),id]),new Wl(Bl(),Il(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function fd(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return ld(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitraryConstraint:{patterns:[{source:e.source,flags:e.flags}]},...t})}function pd(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var md=new WeakMap;function hd(e){return md.get(e)??e}function gd(e,t){return e.encoding===t?e:pd(e,e=>{e.encoding.value=t})}function _d(e,t){if(e.context===t)return e;let n=hd(e);if(n.context===t)return n;let r=pd(e,e=>{e.context.value=t});return md.set(r,n),r}function vd(e){return e.encoding?vd(e.encoding[e.encoding.length-1].to):e}function yd(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return bd(e,Mr(e.checks.slice(0,-1),n.annotate(t)))}return pd(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function bd(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:pd(e,e=>{e.checks.value=t})}function xd(e,t){return bd(e,Hu(e.checks,t))}function Sd(e,t){let n=t(e.to);return n===e.to?e:new ou(n,e.transformation)}function Cd(e,t){let n=e,r=n[n.length-1],i=Sd(r,t);return i===r?e:Mr(e.slice(0,e.length-1),i)}function wd(e){return t=>t.encoding?gd(t,Cd(t.encoding,e)):t}function Td(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:gd(r,Cd(r.encoding,n))}return e(r)}return Ne(n)}function Ed(e,t,n){let r=new ou(e,t);return gd(n,n.encoding?[...n.encoding,r]:[r])}function Dd(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function Od(e,t){return _d(e,e.context?new cu(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new cu(!1,!1,void 0,t))}var kd=Ne(e=>Ad(_d(e,e.context?e.context.isOptional===!1?new cu(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new cu(!0,!1)))),Ad=wd(kd),jd=Me(e=>kd(new td([e,hu])));function Md(e,t){return _d(e,e.context?new cu(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new cu(!1,!1,t))}function Nd(e,t,n){return Ed(e,n,t)}function Pd(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Be(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Fd(e,t){let{literals:n,parameters:r}=Pd(e);return new Lu(n.map(e=>new Mu(e,t)),r.map(e=>new Iu(e,t)))}function Id(e){return e.context?.isOptional??!1}function Ld(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Ld)}function Rd(e){function t(e){return Ld(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Nr(n)?n:void 0}var zd=Ne(e=>{if(e.encoding)return zd(gd(e,void 0));let t=e,n=t.recur?.(zd)??t,r=n.encodingChecks;if(r){let t=n===e?r:ru(n)||iu(n)||$l(n)&&n.typeParameters.length>0?Rd(r):void 0;return pd(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Hu(n.checks,t)})}return n}),Bd=Ne(e=>zd(Hd(e)));function Vd(e,t){let n=t,r=n.length,i=n[r-1],a=[new ou(Hd(gd(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new ou(Hd(n[e-1].to),n[e].transformation.flip()));let o=Hd(i.to);return o.encoding?gd(o,[...o.encoding,...a]):gd(o,a)}var Hd=Me(e=>{if(e.encoding)return Vd(e,e.encoding);let t=e;return t.flip?.(Hd)??t.recur?.(Hd)??t});function Ud(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Ud);default:return!1}}function Wd(e,t){let n=t===0?tl:$c(t);return(r,i)=>r===Qc?el:r===t?n:Ac(new pl(e,r,i))}function Gd(e,t){return(n,r)=>n===Qc?el:t(n)?tl:Ac(new pl(e,n,r))}var Kd=Td(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(Kd)}}),qd=new globalThis.RegExp(`^${Au}$`),Jd=new globalThis.RegExp(`^(?:${Au}|Infinity|-Infinity|NaN)$`);function Yd(e){return fd(qd,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:qd.source}),...e})}var Xd=xd(yu,[Yd()]),Zd=new ou(Xd,Xl),Qd=new ou(new td([Xd,id]),Xl);function $d(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=$d(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new sl(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function ef(e){if(!$l(e))return;let t=e.annotations?.[Zc];return Ve(t)?t(e.typeParameters):void 0}var tf=Qa,nf=Symbol.for(`effect/MutableList/Empty`),rf=()=>({head:void 0,tail:void 0,length:0}),af=()=>({array:[],mutable:!0,offset:0,next:void 0}),of=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=af(),e.tail=e.tail.next):e.head=e.tail=af(),e.tail.array.push(t),e.length++},sf=e=>{e.head=e.tail=void 0,e.length=0},cf=(e,t)=>{if(t=kt(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return sf(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i,e.length-=t,e.length===0&&sf(e),n;i=i.next}return sf(e),n},lf=e=>{if(!e.head)return nf;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:sf(e)),t},uf=`~effect/Queue`,df=`~effect/Queue/Enqueue`,ff=`~effect/Queue/Dequeue`,pf={_A:De,_E:De},mf={[uf]:pf,[df]:pf,[ff]:pf,...cn,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:bf(this)}}},hf=e=>Rn(t=>{let n=Object.create(mf);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=rf(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},to(n)}),gf=()=>hf(),_f=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(lf(e.messages),of(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(of(e.messages,t),Sf(e),!0):(of(e.messages,t),Cf(e),!0):!1,vf=e=>yf(e,1,1/0),yf=(e,t,n)=>(t=kt(t),n=kt(n),ao(()=>wf(e,t,n)??Oo(Df(e),yf(e,1,n)))),bf=e=>e.state._tag===`Done`?0:e.messages.length,xf=Mn(!0),Sf=e=>{if(e.state._tag!==`Done`&&e.state.takers.size!==0){for(let t of e.state.takers)if(e.state.takers.delete(t),t(Lo),e.messages.length===0)break}},Cf=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,Sf(e)},0))},wf=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return Mn([]);if(e.capacity<=0&&e.messages.length===0&&e.state.offers.size>0){let t=[Tf(e.state.offers)];return Ef(e),Mn(t)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let t=cf(e.messages,n);return Ef(e),Mn(t)}},Tf=e=>{let t=e.values().next().value;if(t._tag===`Single`)return e.delete(t),t.resume(xf),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(Mn([]))),n},Ef=e=>{if(e.state._tag===`Done`)return vc(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(Of(e,e.state.exit),vc(e.state.exit.cause));for(let t of e.state.offers){let n=e.capacity-e.messages.length;if(n<=0)break;if(t._tag===`Single`)of(e.messages,t.message),e.state.offers.delete(t),t.resume(xf);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;of(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume(Mn([]))}}return!1},Df=e=>mo(t=>e.state._tag===`Done`?t(e.state.exit):(e.state.takers.add(t),io(()=>{e.state._tag!==`Done`&&e.state.takers.delete(t)}))),Of=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},kf={"~effect/Channel":{_Env:De,_InErr:De,_InElem:De,_OutErr:De,_OutElem:De},pipe(){return Ce(this,arguments)}},Af=e=>{let t=Object.create(kf);return t.transform=(t,n)=>Rc(e(t,n),e=>wc(jc(e))),t},jf=e=>Af((t,n)=>e),Mf=e=>e.transform,Nf=e=>jf(wc(vf(e))),Pf=(e,t,n)=>Tc(()=>{let r=Zs();return _c(Pc(Mf(e)(Hs(),r),t),n||wc).pipe(Vc(e=>$s(r,e)))}),Ff=Ee(2,(e,t)=>Pf(e,e=>Hc(Pc(e,t),{disableYield:!0}))),If=(e,t,n)=>e===tl?n(t):qc(e,n);function Lf(e){if(e._tag===`Middleware`)return(t,n,r)=>Rf(t===tl?e.decode($c(nl(n)),r):e.decode(Kc(t,nl),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===tl?$c(t):e;case`Transform`:{let e=e=>e===Qc?el:$c(t.transform(e));return(t,n)=>If(t,n,e)}case`TransformOptional`:{let e=e=>rl(t.transform(nl(e)));return(t,n)=>If(t,n,e)}case`TransformEffect`:return(e,n,r)=>If(e,n,e=>e===Qc?el:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>If(e,n,e=>Rf(t.transform(nl(e),r)))}}var Rf=e=>qc(e,rl),zf=(e,t,n,r)=>Rc(r,r=>Mc(()=>Bs(r,r=>new cl(e,r,t,n))));function Bf(e,t){let n=Lf(e.link.transformation),r;return(i,a)=>{if(i===Qc)return el;if(e.isConstructed(i))return tl;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function Vf(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==Qc&&r!==void 0)return t(r,i);let a=n;if(jo(a)&&a._tag===`Success`){let e=t(a[tn],i);return e===tl?a:e}return qc(zf(e,r,i,a),e=>{let n=t(e,i);return n===tl?$c(e):n})}}function Hf(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:Vf(e,n)}function Uf(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?ef(e):void 0,o=a?Bf(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>Lf(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(jo(r)){if(r._tag===`Success`){let i=r===tl?t:r[tn];if(t!==Qc&&i!==Qc){let i=$d(u,t,void 0,e,n);i&&(r=Ac(new fl(e,i,t,n)))}}}else r=Pc(r,r=>{if(t!==Qc&&r!==Qc){let r=$d(u,t,void 0,e,n);if(r)return Ac(new fl(e,r,t,n))}return wc(r)})}if(s&&!n.disableChecks){if(jo(r)){if(r._tag===`Success`){let i=r===tl?t:r[tn];if(i===Qc)return r;let a=$d(s,i,void 0,e,n);a&&(r=Ac(new fl(e,a,i,n)))}}else r=Pc(r,t=>{if(t!==Qc){let r=$d(s,t,void 0,e,n);if(r)return Ac(new fl(e,r,t,n))}return wc(t)})}return r},p=i===void 0?f:i(f);return c?(n,r)=>{let i=d??=c.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=c.length-1;e>=0;e--)if(o=l[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[tn],o=t(a,r)):o=qc(o,e=>{let n=t(e,r);return n===tl?$c(e):n})}if(o._tag===`Success`){let e=o[tn],t=p(e,r);return t===tl?o:t}return o=zf(e,n,r,o),qc(o,e=>{let t=p(e,r);return t===tl?$c(e):t})}:p}var Wf=Symbol(),Gf=new WeakMap,Kf=e=>Xf(e).parser,qf=e=>Xf(e).makeEffect,Jf=e=>Hf(e,qf),Yf=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=Uf(this.ast,Kf)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=Uf(this.ast,qf,Jf)}};function Xf(e){let t=Gf.get(e);if(t!==void 0)return t;let n=new Yf(e);return Gf.set(e,n),n}function Zf(e){let t=e.ast,n;return(e,r)=>(n??=op(dp,zd(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function Qf(e){let t=Zf(e);return(e,n)=>{let r=Gc(t(e,n));return Js(r)?Cr(r.value):(Sl(r.cause,`Option adapter can only return none for schema issues`),Sr())}}function $f(e){return lp(zd(e.ast))}function ep(e){return np(e.ast)}function tp(e){{let t=sp(ip(e));return e=>{let n=t(e,su);return Js(n)?!0:(Sl(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}}function np(e){let t=zd(e),n=e=>(n=tp(t),n(e));return e=>n(e)}var rp=e=>e===Qc?Ac(new ml):wc(e);function ip(e){return op(up,e)}function ap(e,t){return e===tl?wc(t):jo(e)?e[tn]===Qc?rp(Qc):e:qc(e,rp)}function op(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??su);return a===tl?wc(r):jo(a)?a[tn]===Qc?rp(Qc):a:qc(a,rp)}}function sp(e){return(t,n)=>Gc(e(t,n))}function cp(e,t){let n=Gc(e);if(Js(n))return n.value;let r=Sl(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function lp(e){let t,n;return(r,i)=>{t??=Xf(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??su,o=t.make;if(o!==void 0&&r!==Qc){let e;try{e=o(r,a)}catch(e){throw Sl(zs(e),`Constructor adapter can only throw schema issues`),e}if(e!==Wf&&e!==Qc)return e}return cp(ap((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var up=e=>Xf(e).parser,dp=e=>Xf(e).makeEffect,fp=`~effect/Schema/Schema`,pp={[fp]:fp,pipe(){return Ce(this,arguments)},annotate(e){return this.rebuild(yd(this.ast,e))},annotateKey(e){return this.rebuild(Od(this.ast,e))},check(...e){return this.rebuild(xd(this.ast,e))}};function mp(e,t){function n(){}let r=Object.setPrototypeOf(n,pp);return t&&(Object.hasOwn(t,`name`)||Object.hasOwn(t,`length`)||Object.hasOwn(t,`__proto__`))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r.ast=e,r.rebuild=e=>mp(e,t),r.makeEffect=Zf(r),r.make=$f(r),r.makeOption=Qf(r),r}var hp=e=>e;({...qt}),{...qt},{...cn};var gp=fp;function _p(){return(e,t,n)=>bp(new du(e.map(Wu),e=>t(e.map(e=>bp(e))),n))}function vp(e,t){return _p()([],()=>(t,n,r)=>e(t)?wc(t):Ac(new pl(n,t,r)),t)}var yp=ep,bp=mp;function xp(e){return Ge(e,gp)&&e[gp]===gp}var Sp=hp(e=>bp(kd(e.ast),{schema:e})),Cp=hp(e=>{let t=Rp(e);return bp(jd(e.ast),{schema:t})});function wp(e){let t=bp(new _u(e),{literal:e,transform(n){return t.pipe(zp(wp(n),{decode:Il(()=>n),encode:Il(()=>e)}))}});return t}var Tp=bp(gu),Ep=bp(fu),Dp=bp(hu),W=bp(yu),Op=bp(Su),kp=bp(Cu);function Ap(e,t){return bp(e,{fields:t,mapFields(e,t){let n=e(this.fields);return Ap(Uu(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function jp(e){return Ap(Uu(e,void 0),e)}function Mp(e,t){return bp(Fd(e.ast,t.ast),{key:e,value:t})}var Np=hp(e=>bp(new wu(!1,[],[e.ast]),{value:e}));function Pp(e,t){return bp(e,{members:t,mapMembers(e,t){let n=e(this.members);return Pp(Gu(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Fp(e,t){return Pp(Gu(e,t,void 0),e)}function Ip(e){let t=e.map(wp);return bp(Gu(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return Fp(e(this.members))},pick(e){return Ip(e)},transform(e){return Fp(t.map((t,n)=>t.transform(e[n])))}})}var Lp=hp(e=>Fp([e,Ep])),Rp=hp(e=>Fp([e,Dp]));function zp(e,t){return n=>bp(Nd(n.ast,e.ast,t?Kl(t):Yl()),{from:n,to:e})}function Bp(){return(e,t)=>Wp()(e,{decode:t,encode:Nl})}function Vp(e){return t=>bp(Md(t.ast,e),{schema:t})}function Hp(e){return wp(e).pipe(Vp(wc(e)))}function Up(e,t){return jp({_tag:Hp(e),...t})}function Wp(){return(e,t)=>new ou(e.ast,Kl(t))}var Gp=ld;function Kp(e,t){let n=e.source,r=e.flags,i=r===``?`new RegExp(${zt(n)})`:`new RegExp(${zt(n)}, ${zt(r)})`;return fd(e,{toCode:()=>({runtime:`Schema.isPattern(${i})`}),...t})}function qp(e){let t=xr(e.order),n=e.formatter??zt;return(r,i)=>Gp(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r},...e.annotate?.(r),...i})}function Jp(e){let t=xr(e.order),n=yr(e.order),r=br(e.order),i=vr(e.order),a=e.formatter??zt;return(o,s)=>{let c=o.exclusiveMinimum?n:t,l=o.exclusiveMaximum?i:r;return Gp(e=>c(e,o.minimum)&&l(e,o.maximum),{expected:`a value between ${a(o.minimum)}${o.exclusiveMinimum?` (excluded)`:``} and ${a(o.maximum)}${o.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:o.minimum,maximum:o.maximum,...o.exclusiveMinimum&&{exclusiveMinimum:!0},...o.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(o),...s})}}function Yp(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${zt(e)}`);return e}var Xp=qp({order:_r,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:Yp(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${zt(e)})`})})}),Zp=Jp({order:_r,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:Yp(e.minimum),maximum:Yp(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${zt(e.minimum)}, maximum: ${zt(e.maximum)}, exclusiveMinimum: ${zt(t)}, exclusiveMaximum: ${zt(n)} })`})}}});function Qp(e){return Gp(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>({type:`integer`}),toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var $p=Op.check(Qp());function em(e,t){return e=Math.max(0,Math.floor(e)),Gp(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Yc]:!0,arbitraryConstraint:{minLength:e},...t})}function tm(e,t){return e=Math.max(0,Math.floor(e)),Gp(t=>t.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:`effect/schema/isMaxLength`,payload:{maxLength:e}},toJsonSchema:({type:t})=>t===`array`?{maxItems:e}:{maxLength:e},toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[Yc]:!0,arbitraryConstraint:{maxLength:e},...t})}globalThis.RegExp,globalThis.URL;var nm=W.annotate({expected:`a string that will be decoded as a Date`}),rm=vp(e=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:`effect/schema/Date`,payload:null},toCode:()=>({runtime:`Schema.Date`,Type:`globalThis.Date`}),expected:`a valid Date`,toCodecJson:()=>Wp()(nm,Zl)}),im=nm.pipe(zp(rm,Zl));globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var am=ql({decode:(e,t)=>Er(El(e),{onNone:()=>Ac(new ml({expected:`a valid UTC DateTime string`},e,t)),onSome:e=>wc(Dl(e))}),encode:e=>wc(kl(e))}),om=-864e13,sm=864e13;function cm(e,t,n){let r=Math.max(t,e?.minimum===void 0?t:e.minimum.epochMilliseconds+ +(e.exclusiveMinimum===!0)),i=Math.min(n,e?.maximum===void 0?n:e.maximum.epochMilliseconds-+(e.exclusiveMaximum===!0));return r<=i?[r,i]:[t,n]}function lm(e,t){return $p.check(Zp({minimum:e,maximum:t}))}var um=vp(e=>Cl(e)&&wl(e),{representation:{id:`effect/schema/DateTimeUtc`,payload:null},toCode:()=>({runtime:`Schema.DateTimeUtc`,Type:`DateTime.Utc`,importDeclarations:[`import * as DateTime from "effect/DateTime"`]}),expected:`DateTime.Utc`,toCodecArbitrary:({constraint:e})=>{let[t,n]=cm(e,om,sm);return Bp()(lm(t,n),Il(Tl))},toCodecJson:()=>Wp()(W,am),toFormatter:()=>e=>e.toString()}),dm=W.annotate({expected:`a string that will be decoded as a DateTime.Utc`}).pipe(zp(um,am)),fm=globalThis.Symbol.for(`immer-draftable`),pm={};function mm(e,t,n,r,i){let a=_m(n,t,r),o=gm(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===pm?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:pm,value:i}})}static[gp]=gp;get[o](){return o}static[fm]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return Ce(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return $f(a(this))(e??{},t)}static makeOption(e,t){return Qf(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(yd(this.ast,e))}static annotateKey(e){return this.rebuild(Od(this.ast,e))}static check(...e){return this.rebuild(xd(this.ast,e))}static extend(e){return(t,r)=>{let a=vm(t)?t:jp(t),o={...n.fields,...a.fields},s=Uu(o,n.ast.checks,{identifier:e});return mm(this,e,Ap(xd(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function hm(e){return new Wl(Il(t=>new e(t,{"~payload":{token:pm,value:t}})),Fl())}function gm(e){return`~effect/Schema/Class/${e}`}function _m(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=gm(t),o=e=>e instanceof i||Ge(e,a),s=hm(i);return r=zp(bp(new du([e.ast],()=>(e,t,n)=>o(e)?wc(e):Ac(new pl(t,e,n)),{identifier:t,[Zc]:([e])=>({isConstructed:o,link:new ou(e,s)}),toCodec:([e])=>new ou(e.ast,s),toEquivalence:([e])=>e,toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[Xc]:Ju(e.ast),...n})),s)(e)}}function vm(e){return xp(e)}var ym=e=>(t,n)=>mm(Bn,e,vm(t)?t:jp(t),n,e=>({name:e})),bm=e=>(t,n,r)=>{let i=vm(n)?n.mapFields(e=>({_tag:Hp(t),...e}),{unsafePreserveChecks:!0}):Up(t,n);return ym(e??t)(i,r)},xm=`~effect/Stream`,Sm={_R:De,_E:De,_A:De},Cm=function(e){this.channel=e};Cm.prototype={[xm]:Sm,pipe(){return Ce(this,arguments)}};var wm=e=>new Cm(e),Tm=e=>wm(Nf(e)),Em=Ee(2,(e,t)=>Ff(e.channel,e=>{let n=0;return Sc({while:()=>n<e.length,body:()=>t(e[n++]),step:je})})),Dm=g(),Om=(e,t)=>e.status===`ready`?{status:`ready`,api:t(e.api)}:e,km=e=>({open:async(t,n,r)=>{let i=await Wc(Xs()),a=await Wc(Qs(e.open,i).pipe(Vc(e=>Ys(e)?$s(i,e):Dc))),o=!1,s=Em(a.changes,e=>Ec(()=>{o||t(e)})),c=Uc((n?s.pipe(zc(e=>Ec(()=>{o||n(e)}))):s).pipe(Fc(Ec(()=>{!o&&r&&r()})),Vc(e=>$s(i,e))));return{initial:a.initial,close:()=>{o=!0,Uc(tf(c))}}}});function Am(e){let t=e.telemetry,n={contractVersion:e.contractVersion,sourceAccess:e.sourceAccess,metadataAccess:e.metadataAccess,send:e.send&&Om(e.send,e=>({sendTest:t=>Wc(e.sendTest(t)),send:t=>Wc(e.send(t)),testRecipient:e.testRecipient})),assets:e.assets&&Om(e.assets,e=>({uploadImage:t=>Wc(e.uploadImage(t)),fonts:{catalog:()=>Wc(e.fonts.catalog)}})),fixtures:e.fixtures&&Om(e.fixtures,e=>({view:t=>Wc(e.view(t))})),lifecycle:e.lifecycle&&Om(e.lifecycle,e=>({inspect:()=>Wc(e.inspect),publish:t=>Wc(e.publish(t)),restore:t=>Wc(e.restore(t)),resolveConflict:t=>Wc(e.resolveConflict(t)),updateFile:t=>Wc(e.updateFile(t)),putAsset:t=>Wc(e.putAsset(t))})),telemetry:t&&(e=>{Uc(t(e))})};return e.access===`readonly`?{...n,access:`readonly`,document:km(e.document)}:{...n,access:`editable`,document:km(e.document),writer:{save:t=>Wc(e.writer.save(t))}}}var jm=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},Mm=(e=>e?jm(e):jm),Nm=e=>e;function Pm(e,t=Nm){let n=T.useSyncExternalStore(e.subscribe,T.useCallback(()=>t(e.getState()),[e,t]),T.useCallback(()=>t(e.getInitialState()),[e,t]));return T.useDebugValue(n),n}var Fm=(0,T.createContext)(null);function Im(){let e=(0,T.useContext)(Fm);if(e===null)throw Error(`useEditorBundle must be used within an EditorProvider`);return e}function G(e){return Pm(Im().store,e)}function Lm(){return Im().store}var Rm=e=>typeof e==`object`&&!!e&&!Array.isArray(e),zm=(e,t)=>typeof e==`object`&&e||typeof e==`function`?t in e:!1,Bm=e=>{let t=[0];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===10||r===13&&e.charCodeAt(n+1)!==10||r===8232||r===8233)&&t.push(n+1)}return t},Vm=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return{line:n+1,column:t-e[n]+1}};function Hm(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Hm(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Hm(e[r],t[r]))return!1;return!0}return e===t}function Um(e){return encodeURI(Wm(e))}function Wm(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Gm={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Km={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},qm={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Jm=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function Ym(e,t=Object.create(null),n=Jm,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:Ym(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(qm[i])continue;let a=`${r}/${Um(i)}`,o=e[i];if(Array.isArray(o)){if(Gm[i]){let e=o.length;for(let r=0;r<e;r++)Ym(o[r],t,n,`${a}/${r}`)}}else if(Km[i])for(let e in o)Ym(o[e],t,n,`${a}/${Um(e)}`);else Ym(o,t,n,a)}return t}var Xm=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Zm=[0,31,28,31,30,31,30,31,31,30,31,30,31],Qm=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,$m=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,eh=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,th=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,nh=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,rh=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,ih=/^(?:\/(?:[^~/]|~0|~1)*)*$/,ah=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,oh=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,sh=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},ch=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,lh=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,uh=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function dh(e){return e.test.bind(e)}var fh={date:mh,time:hh.bind(void 0,!1),"date-time":_h,duration:uh,uri:bh,"uri-reference":dh(eh),"uri-template":dh(th),url:dh(nh),email:sh,hostname:dh($m),ipv4:dh(ch),ipv6:dh(lh),regex:Sh,uuid:dh(rh),"json-pointer":dh(ih),"json-pointer-uri-fragment":dh(ah),"relative-json-pointer":dh(oh)};function ph(e){return e%4==0&&(e%100!=0||e%400==0)}function mh(e){let t=e.match(Xm);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&ph(n)?29:Zm[r])}function hh(e,t){let n=t.match(Qm);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var gh=/t|\s/i;function _h(e){let t=e.split(gh);return t.length==2&&mh(t[0])&&hh(!0,t[1])}var vh=/\/|:/,yh=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function bh(e){return vh.test(e)&&yh.test(e)}var xh=/[^\\]\\Z/;function Sh(e){if(xh.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function Ch(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function wh(e,t,n=`2019-09`,r=Ym(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:E,patternProperties:D,additionalProperties:O,unevaluatedProperties:k,minProperties:A,maxProperties:j,propertyNames:M,dependentRequired:N,dependentSchemas:P,dependencies:F,prefixItems:I,items:L,additionalItems:R,unevaluatedItems:z,contains:ee,minContains:B,maxContains:te,minItems:ne,maxItems:re,uniqueItems:V,minimum:ie,maximum:ae,exclusiveMinimum:oe,exclusiveMaximum:se,multipleOf:ce,minLength:H,maxLength:le,pattern:ue,__absolute_ref__:de,__absolute_recursive_ref__:fe}=t,U=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[fe]:a,u=`${s}/$recursiveRef`,d=wh(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||U.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[de||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw de&&de!==d&&(e+=` Absolute URI "${de}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
14
- - `)}`,Error(e)}let l=`${s}/$ref`,u=wh(e,t,n,r,i,a,o,l,c);if(u.valid||U.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:U.length===0,errors:U}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||U.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&U.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&U.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?Hm(e,h)||U.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&U.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>Hm(e,t))||U.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||U.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;wh(e,v,n,r,i,a,o,t).valid&&U.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let pe=[];if(y!==void 0){let t=`${s}/anyOf`,l=U.length,u=!1;for(let s=0;s<y.length;s++){let l=y[s],d=Object.create(c),f=wh(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);U.push(...f.errors),u||=f.valid,f.valid&&pe.push(d)}u?U.length=l:U.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=U.length,u=!0;for(let s=0;s<b.length;s++){let l=b[s],d=Object.create(c),f=wh(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);U.push(...f.errors),u&&=f.valid,f.valid&&pe.push(d)}u?U.length=l:U.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=U.length,u=x.filter((s,l)=>{let u=Object.create(c),d=wh(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return U.push(...d.errors),d.valid&&pe.push(u),d.valid}).length;u===1?U.length=l:U.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...pe),S!==void 0){let t=`${s}/if`;if(wh(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=wh(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||U.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=wh(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||U.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||U.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(A!==void 0&&t.length<A&&U.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${A} properties.`}),j!==void 0&&t.length>j&&U.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${j} properties.`}),M!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${Um(s)}`,c=wh(s,M,n,r,i,a,e,t);c.valid||U.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(N!==void 0){let t=`${s}/dependantRequired`;for(let n in N)if(n in e){let r=N[n];for(let i of r)i in e||U.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(P!==void 0)for(let t in P){let l=`${s}/dependentSchemas`;if(t in e){let s=wh(e,P[t],n,r,i,a,o,`${l}/${Um(t)}`,c);s.valid||U.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(F!==void 0){let t=`${s}/dependencies`;for(let s in F)if(s in e){let c=F[s];if(Array.isArray(c))for(let n of c)n in e||U.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=wh(e,c,n,r,i,a,o,`${t}/${Um(s)}`);l.valid||U.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(E!==void 0){let t=`${s}/properties`;for(let s in E){if(!(s in e))continue;let d=`${o}/${Um(s)}`,f=wh(e[s],E[s],n,r,i,a,d,`${t}/${Um(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,U.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&D!==void 0){let t=`${s}/patternProperties`;for(let s in D){let d=new RegExp(s,`u`),f=D[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${Um(p)}`,h=wh(e[p],f,n,r,i,a,m,`${t}/${Um(s)}`);h.valid?c[p]=l[p]=!0:(u=i,U.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&O!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${Um(s)}`,f=wh(e[s],O,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,U.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&k!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${Um(s)}`,u=wh(e[s],k,n,r,i,a,l,t);u.valid?c[s]=!0:U.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){re!==void 0&&e.length>re&&U.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${re}).`}),ne!==void 0&&e.length<ne&&U.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${ne}).`});let t=e.length,l=0,u=!1;if(I!==void 0){let d=`${s}/prefixItems`,f=Math.min(I.length,t);for(;l<f;l++){let t=wh(e[l],I[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,U.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(L!==void 0){let d=`${s}/items`;if(Array.isArray(L)){let s=Math.min(L.length,t);for(;l<s;l++){let t=wh(e[l],L[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,U.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=wh(e[l],L,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,U.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&R!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=wh(e[l],R,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,U.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(ee!==void 0){if(t===0&&B===void 0)U.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(B!==void 0&&t<B)U.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${B}).`});else{let l=`${s}/contains`,u=U.length,d=0;for(let s=0;s<t;s++){let t=wh(e[s],ee,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):U.push(...t.errors)}d>=(B||0)&&(U.length=u),B===void 0&&te===void 0&&d===0?U.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):B!==void 0&&d<B?U.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${B} items matching schema. Only ${d} items were found.`}):te!==void 0&&d>te&&U.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${te} items matching schema. ${d} items were found.`})}}if(!u&&z!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=wh(e[l],z,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||U.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(V)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&Hm(r,t))&&(U.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`){if(n===`4`?(ie!==void 0&&(oe===!0&&e<=ie||e<ie)&&U.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${oe?`or equal to `:``} ${ie}.`}),ae!==void 0&&(se===!0&&e>=ae||e>ae)&&U.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${se?`or equal to `:``} ${ae}.`})):(ie!==void 0&&e<ie&&U.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${ie}.`}),ae!==void 0&&e>ae&&U.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ae}.`}),oe!==void 0&&e<=oe&&U.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${oe}.`}),se!==void 0&&e>=se&&U.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${se}.`})),ce!==void 0){let t=e%ce;Math.abs(0-t)>=1.1920929e-7&&Math.abs(ce-t)>=1.1920929e-7&&U.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${ce}.`})}}else if(u===`string`){let t=H===void 0&&le===void 0?0:Ch(e);H!==void 0&&t<H&&U.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${H}).`}),le!==void 0&&t>le&&U.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${le}).`}),ue!==void 0&&!new RegExp(ue,`u`).test(e)&&U.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&fh[T]&&!fh[T](e)&&U.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:U.length===0,errors:U}}var Th=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Ym(e)}validate(e){return wh(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Ym(e,this.lookup)}},Eh={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}},Dh={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}},Oh={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}},kh={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}},Ah={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}},jh={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}},Mh={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}},Nh=new Th({$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}},`2020-12`,!1);for(let e of[Eh,Dh,Oh,kh,Ah,jh,Mh])Nh.addSchema(e);var Ph=e=>Array.isArray(e)?e.map(Ph):Rm(e)?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>[e,Ph(t)])):e,Fh=new Set([`title`,`description`,`default`,`examples`,`deprecated`,`readOnly`,`writeOnly`,`$comment`]),Ih=new Set([`$schema`,`$ref`,`type`,`enum`,`const`,`required`,`minProperties`,`maxProperties`,`minItems`,`maxItems`,`uniqueItems`,`minLength`,`maxLength`,`pattern`,`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`]),Lh=new Set([`properties`,`$defs`,`patternProperties`,`dependentSchemas`]),Rh=new Set([`additionalProperties`,`items`,`contains`,`not`,`if`,`then`,`else`,`propertyNames`]),zh=new Set([`allOf`,`anyOf`,`oneOf`,`prefixItems`]),Bh=(e,t=`#`)=>{if(typeof e==`boolean`)return e;if(!Rm(e))throw TypeError(`Invalid schema at ${t}`);let n=Nh.validate(e);if(!n.valid)throw TypeError(`Invalid JSON Schema at ${t}: ${JSON.stringify(n.errors)}`);let r={};for(let[n,i]of Object.entries(e).sort(([e],[t])=>e<t?-1:+(e>t)))if(!Fh.has(n)){if(Lh.has(n)){if(!Rm(i))throw TypeError(`Invalid ${t}/${n}`);r[n]=Object.fromEntries(Object.entries(i).sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,r])=>[e,Bh(r,`${t}/${n}/${e}`)]))}else if(Rh.has(n))r[n]=Bh(i,`${t}/${n}`);else if(zh.has(n)){if(!Array.isArray(i))throw TypeError(`Invalid ${t}/${n}`);r[n]=i.map((e,r)=>Bh(e,`${t}/${n}/${r}`))}else if(Ih.has(n)){if(n===`$ref`&&(typeof i!=`string`||!(i===`#`||i.startsWith(`#/`))))throw TypeError(`Only local JSON Pointer references are supported at ${t}/$ref`);if(n===`$schema`&&i!==`https://json-schema.org/draft/2020-12/schema`)throw TypeError(`Expected JSON Schema 2020-12 at ${t}`);r[n]=Ph(i)}else throw TypeError(`Unsupported input schema keyword ${t}/${n}`)}return r},Vh=e=>({"~standard":{version:1,vendor:`samva-json-schema`,jsonSchema:{input:()=>e,output:()=>e}}}),Hh=e=>{let t=e[`~standard`].vendor;if(t!==`effect`&&t!==`zod`)return;let n=new WeakSet,r=e=>{if(Array.isArray(e)){for(let t of e)r(t);return}if(Rm(e)&&!n.has(e)){if(n.add(e),t===`zod`&&Rm(e._zod)){r(e._zod.def);return}if(t===`effect`&&e.encoding!==void 0)throw TypeError(`Nonportable Effect transform; use a JSON input schema without decoding transforms`);if(t===`effect`&&e._tag===`Suspend`)throw TypeError(`Unsupported suspended Effect converter; use local JSON Schema references`);if(t===`zod`&&e.type===`lazy`)throw TypeError(`Unsupported lazy Zod converter; author recursive input with local JSON Schema references`);if(t===`zod`&&(e.check===`custom`||e.check===`overwrite`||[`transform`,`default`,`prefault`,`catch`].includes(String(e.type))))throw TypeError(`Nonportable Zod refinement/transform; express constraints in JSON Schema`);if(t===`effect`&&e._tag===`Filter`&&(!Rm(e.annotations)||typeof e.annotations.toJsonSchema!=`function`))throw TypeError(`Nonportable Effect refinement; provide a JSON Schema constraint`);for(let[t,n]of Object.entries(e))t!==`~standard`&&t!==`annotations`&&r(n)}};t===`effect`&&zm(e,`ast`)?r(e.ast):r(e)},Uh=e=>{Hh(e);let t=e[`~standard`].jsonSchema,n=structuredClone(t.input({target:`draft-2020-12`})),r=Bh(n),i=Bh(t.output({target:`draft-2020-12`}));if(JSON.stringify(r)!==JSON.stringify(i))throw TypeError(`Template schemas must preserve JSON input; input/output conversion differs`);let a=new Th(n,`2020-12`,!1),o=e=>{let t=a.validate(e);return o.errors=t.errors,t.valid};return o.errors=[],{schema:n,validationIdentity:JSON.stringify(r),validate:o}},Wh=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/,Gh=/^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$/,Kh=[`money`,`number`,`date`,`time`,`plural`,`list`],qh={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".avif":`image/avif`,".svg":`image/svg+xml`,".ico":`image/x-icon`,".woff":`font/woff`,".woff2":`font/woff2`,".ttf":`font/ttf`,".otf":`font/otf`,".pdf":`application/pdf`,".txt":`text/plain`},Jh=e=>{let t=e.lastIndexOf(`.`);return t<0?``:e.slice(t).toLowerCase()},Yh=e=>Object.hasOwn(qh,Jh(e)),Xh=Symbol(`samva.unsubscribe-link`),Zh=`%samva:unsubscribe-url%`,Qh=Symbol(`samva.brand-footer-marker`),$h=new Set([`data-samva-footer`,`data-samva-unsubscribe`]),eg=`__samva_source_location`,tg=e=>{if(e?.fileName!==void 0&&e.lineNumber!==void 0&&e.columnNumber!==void 0)return Object.freeze({fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber})},ng={Text:e=>({type:`Text`,...e}),Element:e=>({type:`Element`,...e}),Fragment:e=>({type:`Fragment`,...e}),Raw:e=>({type:`Raw`,...e})},rg=new Set([`Text`,`Element`,`Fragment`,`Raw`]),ig=e=>zm(e,`type`)&&typeof e.type==`string`&&rg.has(e.type),ag=Symbol.for(`@samva/markup/email/Fragment`),og=[],sg=()=>[...og].reverse(),cg=[],lg=e=>{cg.push({...e,origins:sg()})},ug=()=>cg.splice(0),dg=e=>{if(e==null||typeof e==`boolean`)return[];if(typeof e==`string`)return[ng.Text({value:e})];if(typeof e==`number`&&Number.isFinite(e))return[ng.Text({value:String(e)})];if(Array.isArray(e))return e.flatMap(dg);if(ig(e))return[e];throw TypeError(`Email children must be synchronous text, finite numbers, elements, or arrays`)},fg=(e,t=``)=>ng.Raw({html:e,text:t,origins:sg()}),pg=(e,t)=>{let{children:n,[eg]:r,...i}=t??{},a=tg(r);if(e===ag)return ng.Fragment({children:dg(n)});if(typeof e==`string`)return ng.Element({tag:e,props:i,children:dg(n),origins:a===void 0?sg():[a,...sg()],authored:a!==void 0});a!==void 0&&og.push(a);try{return ng.Fragment({children:dg(e({...i,children:n}))})}finally{a!==void 0&&og.pop()}},mg=`data-samva-footer`,hg=`data-samva-unsubscribe`,gg=e=>[e.street1,e.street2,[e.city,e.region,e.postalCode].filter(e=>e.trim()!==``).join(`, `),e.country].filter(e=>e!==void 0&&e.trim()!==``),_g=(...e)=>{let t=e.filter(e=>e!==void 0&&e!==``).join(` `);return t===``?void 0:t},vg=(e,t={})=>pg(`tr`,{...t,children:pg(`td`,{style:{padding:`0 0 8px 0`},children:e})}),yg=e=>{let t=e.assets??{},n=e.footer??{};return{BrandLogo:({width:e=120,alt:r,align:i,className:a})=>{if(t.logoUrl===void 0)return null;let o=r??n.companyName??``,s=(t,n,r)=>pg(`img`,{src:t,alt:r,width:e,border:0,...i===void 0?{}:{align:i},className:_g(n,a),style:{display:`block`,outline:`none`,border:`none`,height:`auto`}});return t.logoDarkUrl===void 0?s(t.logoUrl,void 0,o):pg(ag,{children:[s(t.logoUrl,`dark:hidden!`,o),pg(`div`,{className:`hidden dark:block!`,style:{msoHide:`all`,maxHeight:0,overflow:`hidden`},children:s(t.logoDarkUrl,void 0,``)})]})},BrandFooter:({unsubscribeLabel:e=`Unsubscribe`,className:t})=>{let r=[];if(n.companyName!==void 0&&n.companyName.trim()!==``&&r.push(vg(pg(`span`,{className:`font-semibold`,children:n.companyName}))),n.address!==void 0){let e=gg(n.address);e.length>0&&r.push(vg(e.flatMap((e,t)=>t===0?[e]:[pg(`br`,{}),e])))}let i=n.socialLinks??[];return i.length>0&&r.push(vg(i.flatMap((e,t)=>[...t===0?[]:[` · `],pg(`a`,{href:e.url,className:`text-gray-500 underline`,children:e.label})]))),r.push(vg(bg(e),{[hg]:``,[Qh]:!0})),pg(`table`,{role:`presentation`,width:`100%`,border:0,cellpadding:0,cellspacing:0,[mg]:``,[Qh]:!0,children:pg(`tbody`,{children:pg(`tr`,{children:pg(`td`,{align:`center`,className:_g(`text-xs text-gray-500 text-center`,t),style:{padding:`32px 16px`},children:pg(`table`,{role:`presentation`,border:0,cellpadding:0,cellspacing:0,children:pg(`tbody`,{children:r})})})})})})}}},bg=e=>pg(`a`,{href:Zh,className:`text-gray-500 underline`,[Xh]:!0,children:e});RegExp(`<tr ${hg}=""[^>]*>[\\s\\S]*?</tr>`,`g`),`${Zh}`;var xg={id:{type:`string`},title:{type:`string`},lang:{type:`string`},dir:{type:`string`,values:[`ltr`,`rtl`,`auto`]},role:{type:`string`}},Sg={type:`string`,values:[`left`,`center`,`right`]},Cg={type:`string`,values:[`top`,`middle`,`bottom`]},wg={align:Sg},Tg={align:Sg,valign:Cg,width:{type:`measure`},height:{type:`measure`},bgcolor:{type:`string`},colspan:{type:`number`},rowspan:{type:`number`}},Eg=e=>({content:`flow`,layout:`block`,attributes:e}),Dg=()=>({content:`flow`,layout:`inline`,attributes:{}}),Og={html:{content:`flow`,layout:`document`,attributes:{xmlns:{type:`string`},"xmlns:o":{type:`string`},"xmlns:v":{type:`string`},"xmlns:w":{type:`string`}},childElements:[`head`,`body`]},head:{content:`flow`,layout:`metadata`,attributes:{},childElements:[`title`,`meta`,`style`]},title:{content:`text`,layout:`metadata`,attributes:{}},style:{content:`raw`,layout:`metadata`,attributes:{type:{type:`string`}}},meta:{content:`void`,layout:`metadata`,attributes:{name:{type:`string`},content:{type:`string`},charset:{type:`string`},"http-equiv":{type:`string`}}},body:{content:`flow`,layout:`block`,attributes:{bgcolor:{type:`string`}}},div:Eg(wg),section:Eg(wg),article:Eg(wg),header:Eg(wg),footer:Eg(wg),main:Eg(wg),center:Eg({}),p:Eg(wg),blockquote:Eg(wg),pre:{content:`flow`,layout:`preformatted`,attributes:{}},h1:Eg(wg),h2:Eg(wg),h3:Eg(wg),h4:Eg(wg),h5:Eg(wg),h6:Eg(wg),span:Dg(),strong:Dg(),b:Dg(),em:Dg(),i:Dg(),u:Dg(),s:Dg(),small:Dg(),code:Dg(),a:{content:`flow`,layout:`link`,attributes:{href:{type:`url`,required:!0},target:{type:`string`},rel:{type:`string`},name:{type:`string`}}},img:{content:`void`,layout:`image`,attributes:{src:{type:`url`,required:!0},alt:{type:`string`,required:!0},width:{type:`measure`},height:{type:`measure`},border:{type:`measure`},align:Sg}},table:{content:`flow`,layout:`table`,attributes:{width:{type:`measure`},height:{type:`measure`},border:{type:`measure`},cellpadding:{type:`measure`},cellspacing:{type:`measure`},align:Sg,bgcolor:{type:`string`}},childElements:[`caption`,`colgroup`,`thead`,`tbody`,`tfoot`,`tr`]},caption:{content:`flow`,layout:`block`,attributes:wg},colgroup:{content:`flow`,layout:`table-section`,attributes:{span:{type:`number`},width:{type:`measure`}},childElements:[`col`]},col:{content:`void`,layout:`table-section`,attributes:{span:{type:`number`},width:{type:`measure`}}},thead:{content:`flow`,layout:`table-section`,attributes:{align:Sg,valign:Cg,bgcolor:{type:`string`}},childElements:[`tr`]},tbody:{content:`flow`,layout:`table-section`,attributes:{align:Sg,valign:Cg,bgcolor:{type:`string`}},childElements:[`tr`]},tfoot:{content:`flow`,layout:`table-section`,attributes:{align:Sg,valign:Cg,bgcolor:{type:`string`}},childElements:[`tr`]},tr:{content:`flow`,layout:`row`,attributes:{align:Sg,valign:Cg,bgcolor:{type:`string`},height:{type:`measure`}},childElements:[`td`,`th`]},td:{content:`flow`,layout:`cell`,attributes:Tg},th:{content:`flow`,layout:`cell`,attributes:Tg},ul:{content:`flow`,layout:`list`,attributes:{},childElements:[`li`]},ol:{content:`flow`,layout:`list`,attributes:{start:{type:`number`},type:{type:`string`}},childElements:[`li`]},li:{content:`flow`,layout:`list-item`,attributes:{}},br:{content:`void`,layout:`break`,attributes:{}},hr:{content:`void`,layout:`rule`,attributes:{width:{type:`measure`},size:{type:`number`},align:Sg}}},kg=e=>Object.hasOwn(Og,e)?Og[e]:void 0,Ag=`data-samva-instance`,jg=e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`,Mg=e=>`${e.tag}\u0000${e.origins.map(jg).join(`\0`)}`,Ng=e=>new Map(e.map(e=>[e.instancePath,e])),Pg=(e,t)=>{let n=Mg(t);return e.filter(e=>Mg(e)===n)},Fg=(e,t)=>{let n=t.origins[0],r=`${t.tag}\u0000${n===void 0?``:jg(n)}`;return e.filter(e=>{let t=e.origins[0];return`${e.tag}\u0000${t===void 0?``:jg(t)}`===r})},Ig=e=>e.replace(/[&<>]/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`})[e]??e),Lg=e=>e.replace(/[&<>"']/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`})[e]??e),Rg=/[\u0000-\u001f\u007f]/,zg=/^(https:\/\/|mailto:|tel:|cid:|#)/i,Bg=/^(\.{1,2}\/|\/(?!\/))/,Vg=(e,t)=>!/^[\u0000-\u0020]/.test(e)&&!Rg.test(e)&&!e.includes(`\\`)&&(zg.test(e)||t&&Bg.test(e)),Hg=/^(--[a-zA-Z0-9-]+|[a-zA-Z][a-zA-Z0-9-]*)$/,Ug=/[;{}<>\\]|expression\s*\(|@import|\/\*/i,Wg=/url\(\s*(['"]?)([^'")]*)\1\s*\)/gi,Gg=e=>e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Kg=new Set([`opacity`,`zIndex`,`fontWeight`,`lineHeight`,`order`,`flexGrow`,`flexShrink`,`columnCount`,`orphans`,`widows`,`zoom`,`fillOpacity`,`strokeOpacity`]),qg=(e,t)=>typeof t==`number`&&t!==0&&!Kg.has(e)&&!e.startsWith(`--`)?`${t}px`:String(t),Jg=(e,t,n,r,i=`error`)=>{e.diagnostics.push({code:t,severity:i,message:n,origins:r})},Yg=(e,t,n)=>{let r=[];for(let[i,a]of Object.entries(t)){if(a==null)continue;if(!Hg.test(i)){Jg(e,`unsupported-style-property`,`Style property ${JSON.stringify(i)} is not a CSS property name; write it in camelCase (backgroundColor) or as a custom property (--brand).`,n);continue}if(typeof a!=`string`&&typeof a!=`number`){Jg(e,`invalid-style-value`,`Style ${i} must be a string or number, not ${typeof a}.`,n);continue}let t=qg(i,a);if(Ug.test(t)||Rg.test(t)){Jg(e,`unsafe-style-value`,`Style ${i} contains CSS that could break out of the declaration; remove ${JSON.stringify(t)}.`,n);continue}let o;for(let n of t.matchAll(Wg))Vg(n[2]??``,e.relativeUrls)||(o=n[2]??``);if(o!==void 0){Jg(e,`unsafe-url`,`Style ${i} points at ${JSON.stringify(o)}; email URLs must use https:, mailto:, tel:, cid: or a fragment${e.relativeUrls?`, or a relative path`:``}.`,n);continue}r.push(`${Gg(i)}:${t}`)}return r.join(`;`)},Xg=(e,t,n,r,i,a)=>{if(i==null||i===!1)return;if(i===!0)return``;if(typeof i!=`string`&&typeof i!=`number`){Jg(e,`invalid-attribute-value`,`<${t} ${n}> must be a string or number, not ${typeof i}.`,a);return}let o=String(i);if(Rg.test(o)){Jg(e,`invalid-attribute-value`,`<${t} ${n}> contains control characters.`,a);return}if(r.values!==void 0&&!r.values.includes(o)){Jg(e,`invalid-attribute-value`,`<${t} ${n}> accepts ${r.values.join(`, `)}; received ${JSON.stringify(o)}.`,a);return}if(r.type===`number`&&!/^-?\d+$/.test(o)){Jg(e,`invalid-attribute-value`,`<${t} ${n}> must be an integer.`,a);return}if(r.type===`measure`&&!/^\d+(\.\d+)?%?$/.test(o)){Jg(e,`invalid-attribute-value`,`<${t} ${n}> must be a pixel count or a percentage.`,a);return}if(r.type===`url`&&!Vg(o,e.relativeUrls)){Jg(e,`unsafe-url`,e.relativeUrls?`<${t} ${n}> must use https:, mailto:, tel:, cid:, a fragment, or a relative path; received ${JSON.stringify(o)}.`:`<${t} ${n}> must use https:, mailto:, tel:, cid: or a fragment; received ${JSON.stringify(o)}. A relative path resolves only in an export, never in a delivered message.`,a);return}return o},Zg=(e,t)=>{let n={diagnostics:[],positions:[],written:0,relativeUrls:!1,instancePaths:!1};return{css:Yg(n,e,t),diagnostics:n.diagnostics}},Qg=(e,t,n,r)=>{let i={diagnostics:[],positions:[],written:0,relativeUrls:!1,instancePaths:!1},a=kg(e),o=xg,s=(()=>{if(/^(data|aria)-[a-z0-9-]+$/.test(t))return{type:`string`};if(Object.hasOwn(o,t))return o[t];if(a!==void 0&&Object.hasOwn(a.attributes,t))return a.attributes[t]})();return s===void 0?{text:void 0,diagnostics:i.diagnostics}:{text:Xg(i,e,t,s,n,r),diagnostics:i.diagnostics}},$g=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`]),e_=e=>{let t=e.trim(),n=t[0];return(n===`"`||n===`'`)&&t.endsWith(n)&&t.length>=2?t.slice(1,-1):t.replace(/\s+/g,` `)},t_=e=>{let t=[],n=0,r;for(let i=0;i<e.length;i++){let a=e[i];r===void 0?a===`'`||a===`"`?r=a:a===`,`&&(t.push(e_(e.slice(n,i))),n=i+1):a===r&&(r=void 0)}return t.push(e_(e.slice(n))),t.filter(e=>e!==``)},n_=/^(?:xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large|larger|smaller|[+-]?(?:\d+\.?\d*|\.\d+)(?:[a-z]+|%)|(?:calc|clamp|min|max|var)\(.*\))$/i,r_=e=>{let t=[],n=``,r=0,i;for(let a of e.trim()){if(i!==void 0)a===i&&(i=void 0);else if(a===`'`||a===`"`)i=a;else if(a===`(`)r++;else if(a===`)`)r--;else if(/\s/.test(a)&&r===0){n!==``&&t.push(n),n=``;continue}n+=a}return n!==``&&t.push(n),t},i_=e=>{let t=r_(e),n=t.findIndex(e=>n_.test(e.replace(/\/.*$/,``)));if(n<0)return;let r=n+1,i=t[n];i.endsWith(`/`)?r+=1:!i.includes(`/`)&&t[r]?.startsWith(`/`)&&(r+=t[r]===`/`?2:1);let a=t.slice(r).join(` `);return a===``?void 0:a},a_=(e,t)=>{let n=e.replace(/\s*!important\s*$/i,``);if(!t_(n).some(e=>t.has(e.toLowerCase())))return!1;let r=n.slice(n.lastIndexOf(`,`)+1).trim();return!$g.has(r.toLowerCase())},o_=e=>({code:`email-font-fallback`,severity:`error`,message:`font-family ${JSON.stringify(e)} uses a project font without a generic fallback. Clients that drop webfonts (Gmail, classic Outlook) render this stack as written, so end it with sans-serif, serif or monospace.`}),s_=65536,c_=262144,l_=(e,t,n,r,i)=>{if(e.length>i.remaining||(i.remaining-=e.length,e.length>r))return;if(n>8||!e.includes(`var(`))return e;let a=[],o=0,s=e=>(o+=e.length,o>r?!1:(a.push(e),!0)),c=0;for(;c<e.length;){let a=e.indexOf(`var(`,c);if(a<0){if(!s(e.slice(c)))return;break}if(!s(e.slice(c,a)))return;let l=0,u=-1;for(let t=a+3;t<e.length;t++)if(e[t]===`(`)l+=1;else if(e[t]===`)`&&(--l,l===0)){u=t;break}if(u<0){if(!s(e.slice(a)))return;break}let d=e.slice(a+4,u),f=d.indexOf(`,`),p=(f<0?d:d.slice(0,f)).trim(),m=f<0?void 0:d.slice(f+1).trim(),h=t[p]??m,g=h===void 0?e.slice(a,u+1):l_(h,t,n+1,r-o,i);if(g===void 0||!s(g))return;c=u+1}return a.join(``)},u_=(e,t,n=0)=>l_(e,t,n,s_,{remaining:c_})??e,d_=e=>{if(!e.includes(`calc(`))return e;let t=``,n=e;for(;n.length>0;){let e=n.indexOf(`calc(`);if(e<0){t+=n;break}t+=n.slice(0,e);let r=0,i=-1;for(let t=e+4;t<n.length;t++)if(n[t]===`(`)r+=1;else if(n[t]===`)`&&(--r,r===0)){i=t;break}if(i<0){t+=n.slice(e);break}let a=p_(n.slice(e+5,i));t+=a===void 0?n.slice(e,i+1):f_(a),n=n.slice(i+1)}return t},f_=e=>`${Math.round(e.n*1e6)/1e6}${e.n===0&&e.unit!==`%`?``:e.unit}`,p_=e=>{let t=e.match(/\(|\)|[+-]\s|[*/]|[^\s()*/]+/g);if(t===null)return;let n=0,r=()=>t[n]?.trim(),i=()=>{let e=a();for(;e!==void 0&&(r()===`+`||r()===`-`);){let t=r();n+=1;let i=a();if(i===void 0||e.unit!==i.unit)return;e={n:t===`+`?e.n+i.n:e.n-i.n,unit:e.unit}}return e},a=()=>{let e=o();for(;e!==void 0&&(r()===`*`||r()===`/`);){let t=r();n+=1;let i=o();if(i===void 0)return;if(t===`*`){if(e.unit!==``&&i.unit!==``)return;e={n:e.n*i.n,unit:e.unit===``?i.unit:e.unit}}else{if(i.unit!==``||i.n===0)return;e={n:e.n/i.n,unit:e.unit}}}return e},o=()=>{let e=t[n];if(e===void 0)return;if(e===`(`){n+=1;let e=i();return r()===`)`?(n+=1,e):void 0}let a=/^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(e.trim());if(a!==null)return n+=1,{n:Number.parseFloat(a[1]),unit:(a[2]??``).toLowerCase()}},s=i();return n===t.length?s:void 0},m_=(e,t)=>d_(u_(e,t)),h_=/\(\s*([a-z-]+)\s*(<=|>=|<|>)\s*([^)]+?)\s*\)/gi,g_=e=>e.replace(h_,(e,t,n,r)=>`(${n.startsWith(`>`)?`min-`:`max-`}${t}:${r})`),__=(e,t,n)=>{let r=[...t],i=new Map;for(let t of e){let e=t.conditions.map(g_),n=e.join(`\0`),r=i.get(n);r===void 0?i.set(n,{conditions:e,rules:[t]}):r.rules.push(t)}for(let{conditions:e,rules:t}of i.values()){let i=t.map(e=>{let t=e.declarations.filter(e=>!e.property.startsWith(`--`)).map(e=>`${e.property}:${m_(e.value,n)}!important`).join(`;`);return t===``?``:`${e.selector}{${t}}`}).filter(e=>e!==``).join(``);i!==``&&r.push(e.reduceRight((e,t)=>`${t}{${e}}`,i))}return r.join(``)},v_=e=>{let t=e.props.class??e.props.className;return typeof t==`string`?t.split(/\s+/).filter(e=>e!==``):[]},y_=(e,t)=>{let n=e.props[t];if(n!=null&&n!==!1)return n===!0?``:typeof n==`string`||typeof n==`number`?String(n):void 0},b_=(e,t)=>{let n=t.name===`class`?v_(e).join(` `):y_(e,t.name);if(n===void 0)return!1;if(t.operator===void 0||t.value===void 0)return!0;switch(t.operator){case`=`:return n===t.value;case`~=`:return n.split(/\s+/).includes(t.value);case`^=`:return n.startsWith(t.value);case`$=`:return n.endsWith(t.value);case`*=`:return n.includes(t.value);case`|=`:return n===t.value||n.startsWith(`${t.value}-`);default:return!1}},x_=(e,t)=>{if(t.opaque||t.tag!==void 0&&t.tag!==e.tag||t.id!==void 0&&y_(e,`id`)!==t.id)return!1;if(t.classes.length>0){let n=v_(e);if(!t.classes.every(e=>n.includes(e)))return!1}return t.attributes.every(t=>b_(e,t))},S_=(e,t,n)=>{if(n===void 0)return!1;let r=e.parts[t];if(r===void 0||!x_(n.element,r.compound))return!1;let i=e.parts[t-1];if(i===void 0)return!0;switch(i.after??`descendant`){case`child`:return S_(e,t-1,n.parent);case`descendant`:for(let r=n.parent;r!==void 0;r=r.parent)if(S_(e,t-1,r))return!0;return!1;case`adjacent`:{let r=n.previous.at(-1);return r!==void 0&&S_(e,t-1,{element:r,parent:n.parent,previous:n.previous.slice(0,-1)})}case`sibling`:for(let r=n.previous.length-1;r>=0;r--)if(S_(e,t-1,{element:n.previous[r],parent:n.parent,previous:n.previous.slice(0,r)}))return!0;return!1}},C_=(e,t)=>e===void 0||e.parts.length===0?!1:S_(e,e.parts.length-1,t),w_=/var\(\s*--[\w-]+\s*(?:,[^()]*)?\)/g,T_=(e,t)=>e.replace(w_,e=>{let n=m_(e,t);return n===e?e:Lg(n)}),E_=(e,t,n,r,i,a)=>[+!!e,+!!t,e?-n:n,r[0],r[1],r[2],i,a],D_=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){let r=e[n]??0,i=t[n]??0;if(r!==i)return r-i}return 0},O_=(e,t)=>D_(e,t)>=0,k_=e=>{if(!Rm(e)||Array.isArray(e))return[];let t=[];for(let[n,r]of Object.entries(e)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let e=qg(n,r),i=/!important\s*$/i.test(e);t.push({property:Gg(n),value:i?e.replace(/\s*!important\s*$/i,``):e,important:i})}return t},A_={direction:`ltr`,writingMode:`horizontal-tb`},j_=e=>{let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:/\s/.test(a)&&n===0&&(i>r&&t.push(e.slice(r,i)),r=i+1)}return r<e.length&&t.push(e.slice(r)),t},M_=(e,t,n)=>{let r=[[e,t]],i=/^padding-(inline|block)(?:-(start|end))?$/.exec(e);if(i===null||n.writingMode!==`horizontal-tb`||![`ltr`,`rtl`].includes(n.direction)||/^(inherit|revert|revert-layer)$/.test(t)||t.includes(`var(`))return r;let a=j_(t.trim());if(a.length<1||a.length>(i[2]===void 0?2:1))return r;let o=i[1]===`block`?[`top`,`bottom`]:n.direction===`rtl`?[`right`,`left`]:[`left`,`right`];return i[2]===void 0?[[`padding-${o[0]}`,a[0]],[`padding-${o[1]}`,a[1]??a[0]]]:[[`padding-${o[i[2]===`start`?0:1]}`,a[0]]]},N_=(e,t,n={})=>{let r=[...t.diagnostics],i=[],a=[],o=new Set;for(let e of t.rules){(e.inlinable?i:a).push(e);for(let t of e.classes)o.add(t)}let s=a.filter(e=>e.declarations.some(e=>e.property===`direction`||e.property===`writing-mode`||e.property===`all`)),c=new Map,l=new Set(t.fontFaces.map(e=>e.family.toLowerCase())),u=new Map,d=(e,t,n)=>{if(l.size===0)return;let r=e===`font-family`?t:e===`font`?i_(t):void 0;r===void 0||u.has(r)||a_(r,l)&&u.set(r,n)},f=(e,t,n,r)=>{let i=[],a=e=>e.map(e=>{if(e.type===`Element`){let a=p(e,{element:e,parent:t,previous:[...i]},n,r);return i.push(e),a}return e.type===`Fragment`?ng.Fragment({children:a(e.children)}):e.type===`Raw`&&e.html.includes(`var(`)?ng.Raw({...e,html:T_(e.html,n)}):e});return a(e)},p=(e,t,r,a)=>{let l=s.some(e=>{if(e.matcher===void 0||e.matcher.parts.length===0||e.matcher.parts.some(e=>e.compound.opaque))return!0;for(let n=t;n!==void 0;n=n.parent)if(C_(e.matcher,n))return!0;return!1}),u=new Map,p=(e,t)=>{let n=u.get(e.property);(n===void 0||O_(t,n.key))&&u.set(e.property,{value:e.value,key:t})};for(let e of i)if(C_(e.matcher,t))for(let[t,n]of e.declarations.entries())p(n,E_(n.important,!1,e.layer,e.specificity,e.order,t));for(let[t,n]of k_(e.props.style).entries())p(n,E_(n.important,!0,0,[0,0,0],0,t));for(let t of v_(e))!o.has(t)&&n.knownClasses?.has(t)!==!0&&c.set(t,[...c.get(t)??[],...e.origins]);let m={};for(let[e,t]of u)e.startsWith(`--`)&&(m[e]=t.value);let h=Object.keys(m).length===0?r:{...r,...m},g=(e,t,n,r=t)=>{let i=u.get(e)?.value;if(i===void 0)return r;let a=m_(i,h);return a===`inherit`||a===`unset`?t:a===`initial`?n:a},_={direction:g(`direction`,a.direction,`ltr`,typeof e.props.dir==`string`?e.props.dir:e.tag===`bdi`?`auto`:a.direction),writingMode:u.has(`all`)?`unknown`:g(`writing-mode`,a.writingMode,`horizontal-tb`)},v=[...u].filter(([e])=>!e.startsWith(`--`)).sort(([,e],[,t])=>D_(e.key,t.key)).map(([e,t])=>[e,m_(t.value,h)]);for(let[t,n]of v)d(t,n,e.origins.slice(0,1));let y=new Map;for(let[e,t]of v)for(let[n,r]of l?[[e,t]]:M_(e,t,_))y.delete(n),y.set(n,r);let b=e.props.bgcolor,x=typeof b==`string`&&b.includes(`var(`)?{...e.props,bgcolor:m_(b,h)}:e.props;return ng.Element({...e,props:v.length===0?x:{...x,style:Object.fromEntries(y)},children:f(e.children,t,h,_)})},m=e.type===`Element`?p(e,{element:e,parent:void 0,previous:[]},t.variables,A_):e.type===`Fragment`?ng.Fragment({children:f(e.children,void 0,t.variables,A_)}):e;for(let e of a)for(let n of e.declarations)d(n.property,m_(n.value,t.variables),[]);for(let[e,t]of u)r.push({...o_(e),origins:t});for(let[e,t]of c)r.push({code:`unmatched-class`,severity:`warning`,message:`Class ${JSON.stringify(e)} produced no styles. If it is composed at run time, the compiler cannot discover it; list it in the template's declared classes or write the style inline.`,origins:t.slice(0,1)});return{tree:m,headCss:__(a,t.headAtRules,t.variables),fontFaceCss:t.fontFaces.map(e=>e.css).join(``),diagnostics:r}},P_=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``,F_=(e,t)=>{let n=t.startsWith(`/`)||e===``?[]:e.split(`/`);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){if(n.length===0)return;n.pop()}else n.push(e)}return n.length===0?void 0:n.join(`/`)},I_=[`transactional`,`promotional`,`service_implicit`],L_=[`marketing`,`utility`,`authentication`],R_=[`text`,`image`,`video`,`document`],z_=[`category`],B_=[`name`,`language`,`category`],V_=(e,t,n={})=>pg(`table`,{role:`presentation`,border:0,cellpadding:0,cellspacing:0,...e,children:pg(`tbody`,{children:pg(`tr`,{...n,children:t})})}),H_=({className:e,lang:t=`en`,dir:n=`ltr`,title:r,backgroundColor:i,style:a,children:o})=>pg(`html`,{lang:t,dir:n,xmlns:`http://www.w3.org/1999/xhtml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,children:[pg(`head`,{children:[pg(`meta`,{charset:`utf-8`}),pg(`meta`,{"http-equiv":`Content-Type`,content:`text/html; charset=UTF-8`}),pg(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),pg(`meta`,{name:`x-apple-disable-message-reformatting`}),pg(`meta`,{name:`color-scheme`,content:`light dark`}),pg(`meta`,{name:`supported-color-schemes`,content:`light dark`}),r===void 0?null:pg(`title`,{children:r}),fg(`<!--[if mso]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]-->`)]}),pg(`body`,{style:{margin:0,padding:0,...i===void 0?{}:{backgroundColor:i}},children:[V_({align:`center`,width:`100%`,...i===void 0?{}:{bgcolor:i}},pg(`td`,{className:e,...a===void 0?{}:{style:a},children:o}))]})]}),U_=({className:e,align:t=`center`,width:n=`100%`,bgcolor:r,style:i,tableStyle:a,children:o})=>V_({align:t,width:n,...r===void 0?{}:{bgcolor:r},...a===void 0?{}:{style:a}},pg(`td`,{className:e,...i===void 0?{}:{style:i},children:o})),W_=e=>`${Math.floor(100/e)}%`,G_=(e,t)=>{if(e.type===`Fragment`)return ng.Fragment({children:e.children.map(e=>G_(e,t))});if(e.type!==`Element`||e.tag!==`td`||e.props.width!==void 0)return e;let n={};for(let[r,i]of Object.entries(e.props))r===`style`&&(n.width=t),n[r]=i;return n.width===void 0&&(n.width=t),ng.Element({...e,props:n})},K_=({className:e,align:t=`center`,width:n=`100%`,style:r,each:i,per:a,children:o})=>{let s={className:e,align:t,width:n,...r===void 0?{}:{style:r}};if(i===void 0||typeof o!=`function`)return V_(s,o,{style:{width:`100%`}});a!==void 0&&(!Number.isInteger(a)||a<1)&&lg({code:`invalid-columns-per`,severity:`error`,message:`<Columns per> must be a positive integer.`});let c=a!==void 0&&Number.isInteger(a)&&a>=1?a:void 0,l=[];if(c===void 0)l.push(i);else for(let e=0;e<i.length;e+=c)l.push(i.slice(e,e+c));let u=W_(c??Math.max(i.length,1));return pg(ag,{children:l.map(e=>V_(s,e.flatMap((e,t)=>dg(o(e,t)).map(e=>G_(e,u))),{style:{width:`100%`}}))})},q_=({className:e,align:t,valign:n,width:r,style:i,children:a})=>pg(`td`,{className:e,...t===void 0?{}:{align:t},...n===void 0?{}:{valign:n},...r===void 0?{}:{width:r},...i===void 0?{}:{style:i},children:a}),J_=`Helvetica, Arial, sans-serif`,Y_=.6,X_=e=>lg({code:`invalid-button-number`,severity:`error`,message:`<Button ${e}> must be a finite number.`}),Z_=(e,t,n)=>typeof t==`number`&&Number.isFinite(t)?t:(X_(e),n),Q_=(e,t)=>{if(t!==void 0){if(typeof t==`number`&&Number.isFinite(t))return t;X_(e)}},$_=(e,t)=>{if(t!==void 0){if(typeof t==`number`&&Number.isFinite(t)&&t>0)return t;lg({code:`invalid-button-number`,severity:`error`,message:`<Button ${e}> must be a positive finite number.`})}},ev=({className:e,href:t,width:n,height:r,paddingX:i=16,backgroundColor:a=`#000000`,color:o=`#ffffff`,borderRadius:s=0,borderColor:c,borderWidth:l=0,fontSize:u=16,fontFamily:d=J_,align:f=`left`,style:p,children:m})=>{let h=Q_(`width`,n),g=$_(`height`,r),_=Z_(`paddingX`,i,16),v=Z_(`borderRadius`,s,0),y=Z_(`borderWidth`,l,0),b=Z_(`fontSize`,u,16),x=typeof m==`string`?m:void 0,S=g!==void 0&&x!==void 0;S||lg({code:`button-outlook-fallback`,severity:`warning`,message:`<Button> draws its classic Outlook shape from VML, which needs a height and a plain string label. Without both, classic Windows Outlook shows an unstyled link.`,clients:[`outlook-windows`]});let C=g===void 0?0:Math.round(v/g*100),w=h??Math.ceil((x?.length??0)*b*Y_)+2*_;return V_({width:`100%`,style:{borderCollapse:`collapse`}},pg(`td`,{align:f,children:[S?fg(`<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${Lg(t)}" style="height:${g}px;v-text-anchor:middle;width:${w}px;" arcsize="${C}%" ${c===void 0?`stroke="false"`:`strokecolor="${Lg(c)}" strokeweight="${y}px"`} fillcolor="${Lg(a)}"><w:anchorlock/><center style="color:${Lg(o)};font-family:${Lg(d)};font-size:${b}px;font-weight:bold;">${Ig(x)}</center></v:roundrect><![endif]-->`):null,pg(`a`,{className:e,href:t,target:`_blank`,rel:`noopener noreferrer`,style:{backgroundColor:a,color:o,borderRadius:`${v}px`,display:`inline-block`,fontFamily:d,fontSize:`${b}px`,fontWeight:`bold`,lineHeight:g===void 0?`120%`:`${g-2*y}px`,textAlign:`center`,textDecoration:`none`,...h===void 0?{padding:`0 ${_}px`}:{width:`${h}px`,maxWidth:`100%`},...c===void 0?{}:{border:`${y}px solid ${c}`},...S?{msoHide:`all`}:{},...p},children:m})]}))},tv=({height:e})=>V_({width:`100%`},pg(`td`,{height:e,style:{height:`${e}px`,lineHeight:`${e}px`,fontSize:`1px`},children:`​`})),nv=({className:e,color:t=`#e5e7eb`,thickness:n=1,style:r})=>V_({width:`100%`},pg(`td`,{className:e,style:{borderTop:`${n}px solid ${t}`,fontSize:`1px`,lineHeight:`1px`,...r},children:`​`})),rv=({className:e,src:t,alt:n,width:r,height:i,align:a,style:o})=>pg(`img`,{className:e,src:t,alt:n,border:0,...r===void 0?{}:{width:r},...i===void 0?{}:{height:i},...a===void 0?{}:{align:a},style:{display:`block`,outline:`none`,border:`none`,textDecoration:`none`,maxWidth:`100%`,...o}}),iv=({className:e,href:t,target:n=`_blank`,rel:r=`noopener noreferrer`,style:i,children:a})=>pg(`a`,{className:e,href:t,target:n,rel:r,style:{color:`#067df7`,textDecoration:`none`,...i},children:a}),av=class{constructor(e,t,n){this.line=void 0,this.column=void 0,n!==void 0&&(this.index=void 0),this.line=e,this.column=t,n!==void 0&&(this.index=n)}},ov=class{start;end;filename;identifierName;constructor(e,t){this.start=e,this.end=t}};function sv(e,t){let{line:n,column:r,index:i}=e;return new av(n,r+t,i+t)}var cv=`BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED`,lv={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:cv},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:cv}},uv={ArrayPattern:`array destructuring pattern`,AssignmentExpression:`assignment expression`,AssignmentPattern:`assignment expression`,ArrowFunctionExpression:`arrow function expression`,ConditionalExpression:`conditional expression`,CatchClause:`catch clause`,ForOfStatement:`for-of statement`,ForInStatement:`for-in statement`,ForStatement:`for-loop`,FormalParameters:`function parameter list`,Identifier:`identifier`,ImportSpecifier:`import specifier`,ImportDefaultSpecifier:`import default specifier`,ImportNamespaceSpecifier:`import namespace specifier`,ObjectPattern:`object destructuring pattern`,ParenthesizedExpression:`parenthesized expression`,RestElement:`rest element`,UpdateExpression:{true:`prefix operation`,false:`postfix operation`},VariableDeclarator:`variable declaration`,YieldExpression:`yield expression`},dv=e=>e.type===`UpdateExpression`?uv.UpdateExpression[`${e.prefix}`]:uv[e.type],fv={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:`'arguments' is only allowed in functions and class methods.`,AsyncFunctionInSingleStatementContext:`Async functions can only be declared at the top level or inside a block.`,AwaitBindingIdentifier:`Can not use 'await' as identifier inside an async function.`,AwaitBindingIdentifierInStaticBlock:`Can not use 'await' as identifier inside a static block.`,AwaitExpressionFormalParameter:`'await' is not allowed in async function parameters.`,AwaitUsingNotInAsyncContext:`'await using' is only allowed within async functions and at the top levels of modules.`,AwaitNotInAsyncContext:`'await' is only allowed within async functions and at the top levels of modules.`,BadGetterArity:`A 'get' accessor must not have any formal parameters.`,BadSetterArity:`A 'set' accessor must have exactly one formal parameter.`,BadSetterRestParameter:`A 'set' accessor function argument must not be a rest parameter.`,ConstructorClassField:`Classes may not have a field named 'constructor'.`,ConstructorClassPrivateField:`Classes may not have a private field named '#constructor'.`,ConstructorIsAccessor:`Class constructor may not be an accessor.`,ConstructorIsAsync:`Constructor can't be an async function.`,ConstructorIsGenerator:`Constructor can't be a generator.`,DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:`Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.`,DecoratorsBeforeAfterExport:`Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.`,DecoratorConstructor:`Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?`,DecoratorSemicolon:`Decorators must not be followed by a semicolon.`,DecoratorStaticBlock:`Decorators can't be used with a static block.`,DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:`Deleting a private field is not allowed.`,DestructureNamedImport:`ES2015 named imports do not destructure. Use another statement for destructuring after the import.`,DuplicateConstructor:`Duplicate constructor in the same class.`,DuplicateDefaultExport:`Only one default export allowed per module.`,DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:`Redefinition of __proto__ property.`,DuplicateRegExpFlags:`Duplicate regular expression flag.`,ElementAfterRest:`Rest element must be last element.`,EscapedCharNotAnIdentifier:`Invalid Unicode escape.`,ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:`'from' is not allowed as an identifier after 'export default'.`,ForInOfLoopInitializer:({type:e})=>`'${e===`ForInStatement`?`for-in`:`for-of`}' loop variable declaration may not have an initializer.`,ForInUsing:`For-in loop may not start with 'using' declaration.`,ForOfAsync:`The left-hand side of a for-of loop may not be 'async'.`,ForOfLet:`The left-hand side of a for-of loop may not start with 'let'.`,GeneratorInSingleStatementContext:`Generators can only be declared at the top level or inside a block.`,IllegalBreakContinue:({type:e})=>`Unsyntactic ${e===`BreakStatement`?`break`:`continue`}.`,IllegalLanguageModeDirective:`Illegal 'use strict' directive in function with non-simple parameter list.`,IllegalReturn:`'return' outside of function.`,ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:({phase:e})=>`\`import${e?`.${e}`:``}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:e})=>`Cannot use new with import${e?`.${e}`:``}().`,ImportCallSpreadArgument:({phase:e})=>`\`...\` is not allowed in \`import${e?`.${e}`:``}()\`.`,IncompatibleRegExpUVFlags:`The 'u' and 'v' regular expression flags cannot be enabled at the same time.`,InvalidBigIntLiteral:`Invalid BigIntLiteral.`,InvalidCodePoint:`Code point out of bounds.`,InvalidCoverDiscardElement:`'void' must be followed by an expression when not used in a binding position.`,InvalidCoverInitializedName:`Invalid shorthand property initializer.`,InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:`Bad character escape sequence.`,InvalidEscapeSequenceTemplate:`Invalid escape sequence in template.`,InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${dv(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${dv(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${dv(e)}.`,InvalidNumber:`Invalid number.`,InvalidOrMissingExponent:`Floating-point numbers require a valid exponent after the 'e'.`,InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:`Invalid parenthesized assignment pattern.`,InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:`Binding member expression.`,InvalidRestAssignmentPattern:`Invalid rest operator's argument.`,LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:`'let' is disallowed as a lexically bound name.`,LineTerminatorBeforeArrow:`No line break is allowed before '=>'.`,MalformedRegExpFlags:`Invalid regular expression flag.`,MissingClassName:`A class name is required.`,MissingEqInAssignment:`Only '=' operator can be used for specifying default value.`,MissingSemicolon:`Missing semicolon.`,MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingUnicodeEscape:`Expecting Unicode escape sequence \\uXXXX.`,MixingCoalesceWithLogical:`Nullish coalescing operator(??) requires parens when mixing with logical operators.`,ModuleAttributeInvalidValue:`Only string literals are allowed as module attribute values.`,ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:`Multiple default clauses.`,NewlineAfterThrow:`Illegal newline after throw.`,NoCatchOrFinally:`Missing catch or finally clause.`,NumberIdentifier:`Identifier directly after number.`,NumericSeparatorInEscapeSequence:`Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.`,ObsoleteAwaitStar:`'await*' has been removed from the async functions proposal. Use Promise.all() instead.`,OptionalChainingNoNew:`Constructors in/after an Optional Chain are not allowed.`,OptionalChainingNoTemplate:`Tagged Template Literals are not allowed in optionalChain.`,OverrideOnConstructor:`'override' modifier cannot appear on a constructor declaration.`,ParamDupe:`Argument name clash.`,PatternHasAccessor:`Object pattern can't contain getter or setter.`,PatternHasMethod:`Object pattern can't contain methods.`,PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RestTrailingComma:`Unexpected trailing comma after rest element.`,SloppyFunction:`In non-strict mode code, functions can only be declared at top level or inside a block.`,SloppyFunctionAnnexB:`In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.`,SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:`Classes may not have static property named prototype.`,SuperCallNotNewExpression:`Cannot use new with super(...).`,SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:`Private fields can't be accessed on super.`,TrailingDecorator:`Decorators must be attached to a class element.`,UnexpectedArgumentPlaceholder:`Unexpected argument placeholder.`,UnexpectedDigitAfterHash:`Unexpected digit after hash token.`,UnexpectedImportExport:`'import' and 'export' may only appear at the top level.`,UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:`Leading decorators must be attached to a class declaration.`,UnexpectedLexicalDeclaration:`Lexical declaration cannot appear in a single-statement context.`,UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:`A numeric separator is only allowed between two digits.`,UnexpectedPrivateField:`Unexpected private name.`,UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:`'super' is only allowed in object methods and classes.`,UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:``}${e?`, expected "${e}"`:``}`,UnexpectedTokenUnaryExponentiation:`Illegal expression. Wrap left hand side or entire exponentiation in parentheses.`,UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:`Unexpected void binding.`,UnsupportedDecoratorExport:`A decorated export must export a class declaration.`,UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:`Decorators cannot be used to decorate parameters.`,UnsupportedPropertyDecorator:`Decorators cannot be used to decorate object literal properties.`,UnsupportedSuper:`'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).`,UnterminatedComment:`Unterminated comment.`,UnterminatedRegExp:`Unterminated regular expression.`,UnterminatedString:`Unterminated string constant.`,UnterminatedTemplate:`Unterminated template.`,UsingDeclarationExport:`Using declaration cannot be exported.`,UsingDeclarationHasBindingPattern:`Using declaration cannot have destructuring patterns.`,VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:`A void binding may not have an initializer.`,YieldBindingIdentifier:`Can not use 'yield' as identifier inside a generator.`,YieldInParameter:`Yield expression is not allowed in formal parameters.`,YieldNotInGeneratorFunction:`'yield' is only allowed within generator functions.`,ZeroDigitNumericSeparator:`Numeric separator can not be used after leading 0.`},pv={StrictDelete:`Deleting local variable in strict mode.`,StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:`In strict mode code, functions can only be declared at top level or inside a block.`,StrictNumericEscape:`The only valid numeric escape in strict mode is '\\0'.`,StrictOctalLiteral:`Legacy octal literals are not allowed in strict mode.`,StrictWith:`'with' in strict mode.`},mv={ParseExpressionEmptyInput:`Unexpected parseExpression() input: The input is empty or contains only comments.`,ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},hv=new Set([`ArrowFunctionExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),gv={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:`Topic reference is unbound; it must be inside a pipe body.`,PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:`Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.`,PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${dv({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:`Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses.`},_v={UnsupportedBind:`Binding should be performed on object property.`,UnsupportedBindRHS:`The right-hand side of binding can not be super or import.`};function vv(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function yv({toMessage:e,code:t,reasonCode:n,syntaxPlugin:r}){let i=n===`MissingPlugin`||n===`MissingOneOfPlugins`;return function a(o,s,c){let l=SyntaxError();return l.code=t,l.reasonCode=n,l.loc=o,l.pos=s,l.syntaxPlugin=r,i&&(l.missingPlugin=c.missingPlugin),vv(l,`clone`,function(e={}){let{line:t,column:n,index:r=s}=e.loc??o;return a(new av(t,n),r,{...c,...e.details})}),vv(l,`details`,c),Object.defineProperty(l,"message",{configurable:!0,get(){let t=`${e(c)} (${o.line}:${o.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),l}}function bv(e,t){if(Array.isArray(e))return t=>bv(t,e[0]);let n={};for(let r of Object.keys(e)){let i=e[r],{message:a,...o}=typeof i==`string`?{message:()=>i}:typeof i==`function`?{message:i}:i;n[r]=yv({code:`BABEL_PARSER_SYNTAX_ERROR`,reasonCode:r,toMessage:typeof a==`string`?()=>a:a,...t?{syntaxPlugin:t}:{},...o})}return n}var K={...bv(lv),...bv(fv),...bv(pv),...bv(mv),...bv`pipelineOperator`(gv),...bv`functionBind`(_v)};function xv(){return{sourceType:`script`,sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,locations:!0,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Sv(e){let t=xv();if(e==null)return t;if(e.annexB!=null&&e.annexB!==!1)throw Error("The `annexB` option can only be set to `false`.");for(let n of Object.keys(t))e[n]!=null&&(t[n]=e[n]);if(t.startLine===1)e.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:e.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if(e.startColumn==null||e.startIndex==null)throw Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType===`commonjs`){if(e.allowAwaitOutsideFunction!=null)throw Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(e.allowReturnOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(e.allowNewTargetOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}function Cv(e){let{start:t,end:n}=e.loc;return e.loc.start=new av(t.line,t.column),e.loc.end=new av(n.line,n.column),e}var wv=e=>class extends e{createPosition(e){return new av(e.line,e.column)}parse(){let e=super.parse();return this.optionFlags&512&&(e.tokens=e.tokens.map(Cv)),Cv(e)}parseRegExpLiteral({pattern:e,flags:t}){let n=null;try{n=new RegExp(e,t)}catch{}let r=this.estreeParseLiteral(n);return r.regex={pattern:e,flags:t},r}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let n=this.estreeParseLiteral(t);return n.bigint=n.value===null?e:String(n.value),n}estreeParseLiteral(e){return this.parseLiteral(e,`Literal`)}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,t){let n=this.startNodeAtNode(e);return n.expression=e,this.finishNodeAtNode(n,`ChainExpression`,t)}directiveToStmt(e){let t=e.value;delete e.value,this.castNodeTo(t,`Literal`),t.raw=t.extra.raw,t.value=t.extra.expressionValue;let n=this.castNodeTo(e,`ExpressionStatement`);return n.expression=t,n.directive=t.extra.rawValue,delete t.extra,n}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:t,end:n,loc:r,range:i,raw:a,value:o}=e,s=Object.create(e.constructor.prototype);return s.type=`Literal`,s.start=t,s.end=n,s.loc=r,s.range=i,s.raw=a,s.value=o,s}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&!e.expression.extra?.parenthesized}parseBlockBody(e,t,n,r,i){super.parseBlockBody(e,t,n,r,i),e.body=e.directives.map(e=>this.directiveToStmt(e)).concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(e)}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return delete e.id,e.name=t,this.castNodeTo(e,`PrivateIdentifier`)}isPrivateName(e){return e.type===`PrivateIdentifier`}getPrivateNameSV(e){return e.name}parseLiteral(e,t){let n=super.parseLiteral(e,t);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,t,n=!1){super.parseFunctionBody(e,t,n),e.expression=e.body.type!==`BlockStatement`}parseMethod(e,t,n,r,i,a,o=!1){let s=this.startNode();s.kind=e.kind,s=super.parseMethod(s,t,n,r,i,a,o),delete s.kind;let{typeParameters:c}=e;return c&&(delete e.typeParameters,s.typeParameters=c,this.resetStartLocationFromNode(s,c)),e.value=this.castNodeTo(s,this.hasPlugin(`typescript`)&&!s.body?`TSEmptyBodyFunctionExpression`:`FunctionExpression`),a===`ClassPrivateMethod`&&(e.computed=!1),this.hasPlugin(`typescript`)&&e.abstract?(delete e.abstract,this.finishNode(e,`TSAbstractMethodDefinition`)):a===`ObjectMethod`?(e.kind===`method`&&(e.kind=`init`),e.shorthand=!1,this.finishNode(e,`Property`)):this.finishNode(e,`MethodDefinition`)}nameIsConstructor(e){return e.type===`Literal`?e.value===`constructor`:super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractPropertyDefinition`)):this.castNodeTo(t,`PropertyDefinition`),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?this.castNodeTo(t,`TSAbstractPropertyDefinition`):this.castNodeTo(t,`PropertyDefinition`),t.computed=!1,t}parseClassAccessorProperty(e){let t=super.parseClassAccessorProperty(e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractAccessorProperty`)):this.castNodeTo(t,`AccessorProperty`),t}parseObjectProperty(e,t,n,r){let i=super.parseObjectProperty(e,t,n,r);return i&&(i.kind=`init`,this.castNodeTo(i,`Property`)),i}finishObjectProperty(e){return e.kind=`init`,this.finishNode(e,`Property`)}isValidLVal(e,t,n,r){return e===`Property`?`value`:super.isValidLVal(e,t,n,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,n){e.type===`Property`&&(e.kind===`get`||e.kind===`set`)?this.raise(K.PatternHasAccessor,e.key):e.type===`Property`&&e.method?this.raise(K.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,n)}finishCallExpression(e,t){let n=super.finishCallExpression(e,t);return n.callee.type===`Import`?(this.castNodeTo(n,`ImportExpression`),n.source=n.arguments[0],n.options=n.arguments[1]??null,delete n.arguments,delete n.callee):n.type===`OptionalCallExpression`?this.castNodeTo(n,`CallExpression`):n.optional=!1,n}parseExport(e,t){let n=this.state.lastTokStartLoc,r=super.parseExport(e,t);switch(r.type){case`ExportAllDeclaration`:r.exported=null;break;case`ExportNamedDeclaration`:r.specifiers.length===1&&r.specifiers[0].type===`ExportNamespaceSpecifier`&&(this.castNodeTo(r,`ExportAllDeclaration`),r.exported=r.specifiers[0].exported,delete r.specifiers);case`ExportDefaultDeclaration`:{let{declaration:e}=r;e?.type===`ClassDeclaration`&&e.decorators?.length>0&&e.start===r.start&&this.resetStartLocation(r,n)}}return r}stopParseSubscript(e,t){let n=super.stopParseSubscript(e,t);return t.optionalChainMember?this.estreeParseChainExpression(n,e):n}parseMember(e,t,n,r,i){let a=super.parseMember(e,t,n,r,i);return a.type===`OptionalMemberExpression`?this.castNodeTo(a,`MemberExpression`):a.optional=!1,a}isOptionalMemberExpression(e){return e.type===`ChainExpression`?e.expression.type===`MemberExpression`:super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type===`ChainExpression`&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type===`Property`&&e.kind===`init`&&!e.method}isObjectMethod(e){return e.type===`Property`&&(e.method||e.kind===`get`||e.kind===`set`)}castNodeTo(e,t){let n=super.castNodeTo(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}cloneIdentifier(e){let t=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(t),t}cloneStringLiteral(e){return e.type===`Literal`?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,t,n){return Cv(super.finishNodeAt(e,t,n))}finishNodeAtNode(e,t,n){return Cv(super.finishNodeAtNode(e,t,n))}finishNode(e,t){let n=super.finishNode(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}resetStartLocation(e,t){super.resetStartLocation(e,t),Cv(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),Cv(e)}},Tv=!0,q=!0,Ev=!0,Dv=!0,Ov=!0,kv=!0,Av=class{label;keyword;beforeExpr;startsExpr;rightAssociative;isLoop;isAssign;prefix;postfix;binop;constructor(e,t={}){this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop==null?null:t.binop}},jv=new Map;function Mv(e,t={}){t.keyword=e;let n=Vv(e,t);return jv.set(e,n),n}function Nv(e,t){return Vv(e,{beforeExpr:Tv,binop:t})}var Pv=-1,Fv=[],Iv=[],Lv=[],Rv=[],zv=[],Bv=[];function Vv(e,t={}){return++Pv,Iv.push(e),Lv.push(t.binop??-1),Rv.push(t.beforeExpr??!1),zv.push(t.startsExpr??!1),Bv.push(t.prefix??!1),Fv.push(new Av(e,t)),Pv}function Hv(e,t={}){return++Pv,jv.set(e,Pv),Iv.push(e),Lv.push(t.binop??-1),Rv.push(t.beforeExpr??!1),zv.push(t.startsExpr??!1),Bv.push(t.prefix??!1),Fv.push(new Av(`name`,t)),Pv}var Uv={bracketL:Vv(`[`,{beforeExpr:Tv,startsExpr:q}),bracketR:Vv(`]`),braceL:Vv(`{`,{beforeExpr:Tv,startsExpr:q}),braceBarL:Vv(`{|`,{beforeExpr:Tv,startsExpr:q}),braceR:Vv(`}`),braceBarR:Vv(`|}`),parenL:Vv(`(`,{beforeExpr:Tv,startsExpr:q}),parenR:Vv(`)`),comma:Vv(`,`,{beforeExpr:Tv}),semi:Vv(`;`,{beforeExpr:Tv}),colon:Vv(`:`,{beforeExpr:Tv}),doubleColon:Vv(`::`,{beforeExpr:Tv}),dot:Vv(`.`),question:Vv(`?`,{beforeExpr:Tv}),questionDot:Vv(`?.`),arrow:Vv(`=>`,{beforeExpr:Tv}),template:Vv(`template`),ellipsis:Vv(`...`,{beforeExpr:Tv}),backQuote:Vv("`",{startsExpr:q}),dollarBraceL:Vv("${",{beforeExpr:Tv,startsExpr:q}),templateTail:Vv("...`",{startsExpr:q}),templateNonTail:Vv("...${",{beforeExpr:Tv,startsExpr:q}),at:Vv(`@`),hash:Vv(`#`,{startsExpr:q}),interpreterDirective:Vv(`#!...`),eq:Vv(`=`,{beforeExpr:Tv,isAssign:Dv}),assign:Vv(`_=`,{beforeExpr:Tv,isAssign:Dv}),slashAssign:Vv(`_=`,{beforeExpr:Tv,isAssign:Dv}),xorAssign:Vv(`_=`,{beforeExpr:Tv,isAssign:Dv}),moduloAssign:Vv(`_=`,{beforeExpr:Tv,isAssign:Dv}),incDec:Vv(`++/--`,{prefix:Ov,postfix:kv,startsExpr:q}),bang:Vv(`!`,{beforeExpr:Tv,prefix:Ov,startsExpr:q}),tilde:Vv(`~`,{beforeExpr:Tv,prefix:Ov,startsExpr:q}),doubleCaret:Vv(`^^`,{startsExpr:q}),doubleAt:Vv(`@@`,{startsExpr:q}),pipeline:Nv(`|>`,0),nullishCoalescing:Nv(`??`,1),logicalOR:Nv(`||`,1),logicalAND:Nv(`&&`,2),bitwiseOR:Nv(`|`,3),bitwiseXOR:Nv(`^`,4),bitwiseAND:Nv(`&`,5),equality:Nv(`==/!=/===/!==`,6),lt:Nv(`</>/<=/>=`,7),gt:Nv(`</>/<=/>=`,7),relational:Nv(`</>/<=/>=`,7),bitShift:Nv(`<</>>/>>>`,8),bitShiftL:Nv(`<</>>/>>>`,8),bitShiftR:Nv(`<</>>/>>>`,8),plusMin:Vv(`+/-`,{beforeExpr:Tv,binop:9,prefix:Ov,startsExpr:q}),modulo:Vv(`%`,{binop:10,startsExpr:q}),star:Vv(`*`,{binop:10}),slash:Nv(`/`,10),exponent:Vv(`**`,{beforeExpr:Tv,binop:11,rightAssociative:!0}),_in:Mv(`in`,{beforeExpr:Tv,binop:7}),_instanceof:Mv(`instanceof`,{beforeExpr:Tv,binop:7}),_break:Mv(`break`),_case:Mv(`case`,{beforeExpr:Tv}),_catch:Mv(`catch`),_continue:Mv(`continue`),_debugger:Mv(`debugger`),_default:Mv(`default`,{beforeExpr:Tv}),_else:Mv(`else`,{beforeExpr:Tv}),_finally:Mv(`finally`),_function:Mv(`function`,{startsExpr:q}),_if:Mv(`if`),_return:Mv(`return`,{beforeExpr:Tv}),_switch:Mv(`switch`),_throw:Mv(`throw`,{beforeExpr:Tv,prefix:Ov,startsExpr:q}),_try:Mv(`try`),_var:Mv(`var`),_const:Mv(`const`),_with:Mv(`with`),_new:Mv(`new`,{beforeExpr:Tv,startsExpr:q}),_this:Mv(`this`,{startsExpr:q}),_super:Mv(`super`,{startsExpr:q}),_class:Mv(`class`,{startsExpr:q}),_extends:Mv(`extends`,{beforeExpr:Tv}),_export:Mv(`export`),_import:Mv(`import`,{startsExpr:q}),_null:Mv(`null`,{startsExpr:q}),_true:Mv(`true`,{startsExpr:q}),_false:Mv(`false`,{startsExpr:q}),_typeof:Mv(`typeof`,{beforeExpr:Tv,prefix:Ov,startsExpr:q}),_void:Mv(`void`,{beforeExpr:Tv,prefix:Ov,startsExpr:q}),_delete:Mv(`delete`,{beforeExpr:Tv,prefix:Ov,startsExpr:q}),_do:Mv(`do`,{isLoop:Ev,beforeExpr:Tv}),_for:Mv(`for`,{isLoop:Ev}),_while:Mv(`while`,{isLoop:Ev}),_as:Hv(`as`,{startsExpr:q}),_assert:Hv(`assert`,{startsExpr:q}),_async:Hv(`async`,{startsExpr:q}),_await:Hv(`await`,{startsExpr:q}),_defer:Hv(`defer`,{startsExpr:q}),_from:Hv(`from`,{startsExpr:q}),_get:Hv(`get`,{startsExpr:q}),_let:Hv(`let`,{startsExpr:q}),_meta:Hv(`meta`,{startsExpr:q}),_of:Hv(`of`,{startsExpr:q}),_sent:Hv(`sent`,{startsExpr:q}),_set:Hv(`set`,{startsExpr:q}),_source:Hv(`source`,{startsExpr:q}),_static:Hv(`static`,{startsExpr:q}),_using:Hv(`using`,{startsExpr:q}),_yield:Hv(`yield`,{startsExpr:q}),_asserts:Hv(`asserts`,{startsExpr:q}),_checks:Hv(`checks`,{startsExpr:q}),_exports:Hv(`exports`,{startsExpr:q}),_global:Hv(`global`,{startsExpr:q}),_implements:Hv(`implements`,{startsExpr:q}),_intrinsic:Hv(`intrinsic`,{startsExpr:q}),_infer:Hv(`infer`,{startsExpr:q}),_is:Hv(`is`,{startsExpr:q}),_mixins:Hv(`mixins`,{startsExpr:q}),_proto:Hv(`proto`,{startsExpr:q}),_require:Hv(`require`,{startsExpr:q}),_satisfies:Hv(`satisfies`,{startsExpr:q}),_keyof:Hv(`keyof`,{startsExpr:q}),_readonly:Hv(`readonly`,{startsExpr:q}),_unique:Hv(`unique`,{startsExpr:q}),_abstract:Hv(`abstract`,{startsExpr:q}),_declare:Hv(`declare`,{startsExpr:q}),_enum:Hv(`enum`,{startsExpr:q}),_module:Hv(`module`,{startsExpr:q}),_namespace:Hv(`namespace`,{startsExpr:q}),_interface:Hv(`interface`,{startsExpr:q}),_type:Hv(`type`,{startsExpr:q}),_opaque:Hv(`opaque`,{startsExpr:q}),name:Vv(`name`,{startsExpr:q}),placeholder:Vv(`%%`,{startsExpr:q}),string:Vv(`string`,{startsExpr:q}),num:Vv(`num`,{startsExpr:q}),bigint:Vv(`bigint`,{startsExpr:q}),regexp:Vv(`regexp`,{startsExpr:q}),privateName:Vv(`#name`,{startsExpr:q}),eof:Vv(`eof`),jsxName:Vv(`jsxName`),jsxText:Vv(`jsxText`,{beforeExpr:Tv}),jsxTagStart:Vv(`jsxTagStart`,{startsExpr:q}),jsxTagEnd:Vv(`jsxTagEnd`)};function Wv(e){return e>=89&&e<=129}function Gv(e){return e<=88}function Kv(e){return e>=54&&e<=129}function qv(e){return e>=54&&e<=132}function Jv(e){return Rv[e]}function Yv(e){return zv[e]}function Xv(e){return e>=25&&e<=29}function Zv(e){return e>=125&&e<=127}function Qv(e){return e>=86&&e<=88}function $v(e){return e>=54&&e<=88}function ey(e){return e>=35&&e<=55}function ty(e){return e===30}function ny(e){return Bv[e]}function ry(e){return e>=117&&e<=119}function iy(e){return e>=120&&e<=126}function ay(e){return Iv[e]}function oy(e){return Lv[e]}function sy(e){return e===53}function cy(e){return e>=20&&e<=21}function ly(e){return Fv[e]}var uy=class{constructor(e,t){this.token=e,this.preserveSpace=!!t}token;preserveSpace},dy={brace:new uy(`{`),j_oTag:new uy(`<tag`),j_cTag:new uy(`</tag`),j_expr:new uy(`<tag>...</tag>`,!0)},fy=/[\p{ID_Start}\u0558\u058b\u058c\u088f\u0c5c\u0cdc\u208f\u209d-\u209f\ua7ce\ua7cf\ua7d2\ua7d4\ua7dd\ua7e2\ua7f1\uab6c\uab6d]/u,py=/[\p{ID_Continue}\u0558\u058b\u058c\u088f\u0c5c\u0cdc\u208f\u209d-\u209f\ua7ce\ua7cf\ua7d2\ua7d4\ua7dd\ua7e2\ua7f1\uab6c\uab6d\u05c8\u05c9\u0b53\u0b54\u1acf-\u1af0]/u,my=[1979,4,385,25,1388,2,18,21,3100,0,678,43,22,0,1662,0,6,10,209,310,18458,24,3,24,287,4,6146,7,1239,4,47,23,96,114,14,913,15,50,8017,5,64,0,9534,0,2169,5,7,86,15,6,55,50,1729,30,2,2,2,1,2,6,3,4,10,1,53307,5,223,0,5764,11,21763,4297,39815,11327],hy=[3787,4,33,11,3173,7,633,9,7,0,45879,1,296,2,9,1,3,0,33,1,5218,0,3,0,8,1,6,0];function gy(e,t){let n=65536;for(let r=0,i=t.length;r<i;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function _y(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&fy.test(String.fromCharCode(e)):!isNaN(e)&&e<=1114111&&(fy.test(String.fromCodePoint(e))||gy(e,my))}function vy(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&py.test(String.fromCharCode(e)):!isNaN(e)&&e<=1114111&&(py.test(String.fromCodePoint(e))||gy(e,my)||gy(e,hy))}var yy={keyword:`break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]},by=new Set(yy.keyword),xy=new Set(yy.strict),Sy=new Set(yy.strictBind);function Cy(e,t){return t&&e===`await`||e===`enum`}function wy(e,t){return Cy(e,t)||xy.has(e)}function Ty(e){return Sy.has(e)}function Ey(e,t){return wy(e,t)||Ty(e)}function Dy(e){return by.has(e)}function Oy(e,t,n){return e===64&&t===64&&_y(n)}var ky=new Set(`break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete.implements.interface.let.package.private.protected.public.static.yield.eval.arguments.enum.await`.split(`.`));function Ay(e){return ky.has(e)}var jy=class{flags=0;names=new Map;firstLexicalName=``;constructor(e){this.flags=e}},My=class{parser;scopeStack=[];inModule;undefinedExports=new Map;constructor(e,t){this.parser=e,this.inModule=t}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&!(e&2)}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&128)return!0;if(t&3779)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new jy(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,t,n){let r=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(r,e,t,n);let i=r.names.get(e)||0;t&16?i|=4:(r.firstLexicalName||(r.firstLexicalName=e),i|=2),r.names.set(e,i),t&8&&this.maybeExportDefined(r,e)}else if(t&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,e,t,n),r.names.set(e,(r.names.get(e)||0)|1),this.maybeExportDefined(r,e),!(r.flags&3715));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,n,r){this.isRedeclaredInScope(e,t,n)&&this.parser.raise(K.VarRedeclaration,r,{identifierName:t})}isRedeclaredInScope(e,t,n){if(!(n&1))return!1;if(n&8)return e.names.has(t);let r=e.names.get(t)||0;return n&16?(r&2)>0||!this.treatFunctionsAsVarInScope(e)&&(r&1)>0:(r&2)>0&&!(e.flags&8&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(r&4)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3715)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3779&&!(t&4))return t}}},Ny=class extends jy{declareFunctions=new Set},Py=class extends My{createScope(e){return new Ny(e)}declareName(e,t,n){let r=this.currentScope();if(t&2048){this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,t,n)}isRedeclaredInScope(e,t,n){if(super.isRedeclaredInScope(e,t,n))return!0;if(n&2048&&!e.declareFunctions.has(t)){let n=e.names.get(t);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},Fy=new Set([`_`,`any`,`bool`,`boolean`,`empty`,`extends`,`false`,`interface`,`mixed`,`null`,`number`,`static`,`string`,`true`,`typeof`,`void`]),Iy=bv`flow`({AmbiguousConditionalArrow:`Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.`,AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:n})=>`Enum \`${e}\` has type \`${n}\`, so the initializer of \`${t}\` needs to be a ${n} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:n})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${n}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:`Explicit inexact syntax cannot appear inside an explicit exact object type.`,InexactInsideNonObject:`Explicit inexact syntax cannot appear in class or interface definitions.`,InexactVariance:`Explicit inexact syntax cannot have variance.`,InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:`Type parameter declaration needs a default, since a preceding type parameter declaration has a default.`,NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:`Cannot have a flow comment inside another flow comment.`,PatternIsOptional:{message:`A binding pattern parameter cannot be optional in an implementation signature.`},SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:`Spread properties cannot have variance.`,ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:`The type cast expression is expected to be wrapped with parenthesis.`,UnexpectedExplicitInexactInObject:`Explicit inexact syntax must appear at the end of an inexact object.`,UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:`Spread operator cannot appear in class or interface definitions.`,UnexpectedSubtractionOperand:`Unexpected token, expected "number" or "bigint".`,UnexpectedTokenAfterTypeParameter:`Expected an arrow function after this type parameter declaration.`,UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:`Only declares and type imports are allowed inside declare module.`,UnterminatedFlowComment:`Unterminated flow-comment.`});function Ly(e){return e.type===`DeclareExportAllDeclaration`||e.type===`DeclareExportDeclaration`&&(!e.declaration||e.declaration.type!==`TypeAlias`&&e.declaration.type!==`InterfaceDeclaration`)}function Ry(e){return e.importKind===`type`||e.importKind===`typeof`}var zy={const:`declare export var`,let:`declare export var`,type:`export type`,interface:`export interface`};function By(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)(t(e[i],i,e)?n:r).push(e[i]);return[n,r]}var Vy=/\*?\s*@((?:no)?flow)\b/,Hy=e=>class extends e{flowPragma=void 0;getScopeHandler(){return Py}shouldParseTypes(){return this.getPluginOption(`flow`,`all`)||this.flowPragma===`flow`}finishToken(e,t){e!==130&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=Vy.exec(e.value);if(t){if(t[1]===`flow`)this.flowPragma=`flow`;else if(t[1]===`noflow`)this.flowPragma=`noflow`;else throw Error(`Unexpected flow pragma`)}}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||10);let n=this.flowParseType();return this.state.inType=t,n}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(106),this.state.lastTokStartLoc.index>t.index+1&&this.raise(Iy.UnexpectedSpaceBetweenModuloChecks,t),this.eat(6)?(e.value=super.parseExpression(),this.expect(7),this.finishNode(e,`DeclaredPredicate`)):this.finishNode(e,`InferredPredicate`)}flowParseTypeAndPredicateInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(10);let n=null,r=null;return e&&this.match(50)?(this.state.inType=t,r=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=t,this.match(50)&&(r=this.flowParsePredicate())),[n,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,`DeclareClass`)}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();n.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,this.expect(6);let i=this.flowParseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,n.this=i._this,this.expect(7),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!1),r.typeAnnotation=this.finishNode(n,`FunctionTypeAnnotation`),t.typeAnnotation=this.finishNode(r,`TypeAnnotation`),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.start),this.finishNode(e,`DeclareFunction`)}flowParseDeclare(e,t){if(this.match(76))return this.flowParseDeclareClass(e);if(this.match(64))return this.flowParseDeclareFunction(e);if(this.match(70))return this.flowParseDeclareVariable(e);if(this.eatContextual(123))return this.match(12)?this.flowParseDeclareModuleExports(e):(t&&this.raise(Iy.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(126))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(127))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(125))return this.flowParseDeclareInterface(e);if(this.match(78))return this.flowParseDeclareExportDeclaration(e,t);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.start),this.semicolon(),this.finishNode(e,`DeclareVariable`)}flowParseDeclareModule(e){this.scope.enter(0),e.id=this.match(130)?super.parseExprAtom():this.parseIdentifier();let t=this.startNode(),n=t.body=[];for(this.expect(2);!this.match(4);){let e=this.startNode();this.match(79)?(this.next(),!this.isContextual(126)&&!this.match(83)&&this.raise(Iy.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),n.push(super.parseImport(e))):(this.expectContextual(121,Iy.UnsupportedStatementInDeclareModule),n.push(this.flowParseDeclare(e,!0)))}this.scope.exit(),this.expect(4),e.body=this.finishNode(t,`BlockStatement`);let r=null,i=!1;return n.forEach(e=>{Ly(e)?(r===`CommonJS`&&this.raise(Iy.AmbiguousDeclareModuleKind,e),r=`ES`):e.type===`DeclareModuleExports`&&(i&&this.raise(Iy.DuplicateDeclareModuleExports,e),r===`ES`&&this.raise(Iy.AmbiguousDeclareModuleKind,e),r=`CommonJS`,i=!0)}),e.kind=r||`CommonJS`,this.finishNode(e,`DeclareModule`)}flowParseDeclareExportDeclaration(e,t){if(this.expect(78),this.eat(61))return this.match(64)||this.match(76)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(71)||this.isLet()||(this.isContextual(126)||this.isContextual(125))&&!t){let e=this.state.value;throw this.raise(Iy.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:zy[e]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(127))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(51)||this.match(2)||this.isContextual(125)||this.isContextual(126)||this.isContextual(127)){let t=this.parseExport(e,null);return t.type===`ExportNamedDeclaration`?(t.default=!1,delete t.exportKind,this.castNodeTo(t,`DeclareExportDeclaration`)):this.castNodeTo(t,`DeclareExportAllDeclaration`)}throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(107),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,`DeclareModuleExports`)}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return this.castNodeTo(t,`DeclareTypeAlias`),t}flowParseDeclareOpaqueType(e){return this.next(),this.flowParseOpaqueType(e,!0)}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,`DeclareInterface`)}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(!t&&this.eat(8));if(t){let t=[],n=[];if(this.eatContextual(113))do n.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(109))do t.push(this.flowParseClassImplements());while(this.eat(8));e.implements=t,e.mixins=n}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),e.typeParameters=this.match(43)?this.flowParseTypeParameterInstantiation():null,this.finishNode(e,`InterfaceExtends`)}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,`InterfaceDeclaration`)}checkNotUnderscore(e){e===`_`&&this.raise(Iy.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,n){Fy.has(e)&&this.raise(n?Iy.AssignReservedType:Iy.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifierName(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,t){let n=this.startNode(),r=this.flowParseRestrictedIdentifierName(e,t);return this.createIdentifier(n,r)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.right=this.flowParseTypeInitialiser(25),this.semicolon(),this.finishNode(e,`TypeAlias`)}flowParseOpaqueType(e,t){return this.expectContextual(126),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.supertype=null,this.match(10)&&(e.supertype=this.flowParseTypeInitialiser(10)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(25)),this.semicolon(),this.finishNode(e,t?`DeclareOpaqueType`:`OpaqueType`)}flowParseTypeParameterBound(){if(this.match(10)||this.isContextual(77)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,`TypeAnnotation`)}}flowParseTypeParameter(e=!1){let t=this.state.startLoc,n=this.startNode(),r=this.flowParseVariance();return n.name=this.flowParseRestrictedIdentifierName(),n.variance=r,n.bound=this.flowParseTypeParameterBound(),this.match(25)?(this.eat(25),n.default=this.flowParseType()):e&&this.raise(Iy.MissingTypeParamDefault,t),this.finishNode(n,`TypeParameter`)}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(43)||this.match(138)?this.next():this.unexpected();let n=!1;do{let e=this.flowParseTypeParameter(n);t.params.push(e),e.default&&(n=!0),this.match(44)||this.expect(8)}while(!this.match(44));return this.expect(44),this.state.inType=e,this.finishNode(t,`TypeParameterDeclaration`)}flowInTopLevelContext(e){if(this.curContext()!==dy.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===43)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(43);let t=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(44);)e.params.push(this.flowParseType()),this.match(44)||this.expect(8);this.state.noAnonFunctionType=t}),this.state.inType=t,!this.state.inType&&this.curContext()===dy.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TypeParameterInstantiation`)}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==43)return null;let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(43);!this.match(44);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(44)||this.expect(8);return this.expect(44),this.state.inType=t,this.finishNode(e,`TypeParameterInstantiation`)}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(125),e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(8));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,`InterfaceTypeAnnotation`)}flowParseObjectPropertyKey(){return this.match(131)||this.match(130)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,n){return e.static=t,this.lookahead().type===10?(e.id=this.parseIdentifier(!0),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(1),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,`ObjectTypeIndexer`)}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.parseIdentifier(!0),this.expect(1),this.expect(1),this.match(43)||this.match(6)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e))):(e.method=!1,this.eat(13)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,`ObjectTypeInternalSlot`)}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(6),this.match(74)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(7),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,`FunctionTypeAnnotation`)}flowParseObjectTypeCallProperty(e,t){let n=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,`ObjectTypeCallProperty`)}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:n,allowProto:r,allowInexact:i}){let a=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let s,c,l=!1;for(t&&this.match(3)?(this.expect(3),s=5,c=!0):(this.expect(2),s=4,c=!1),o.exact=c;!this.match(s);){let t=!1,a=null,s=null,u=this.startNode();if(r&&this.isContextual(114)){let t=this.lookahead();t.type!==10&&t.type!==13&&(this.next(),a=this.state.startLoc,e=!1)}if(e&&this.isContextual(102)){let e=this.lookahead();e.type!==10&&e.type!==13&&(this.next(),t=!0)}let d=this.flowParseVariance();if(this.eat(0))a!=null&&this.unexpected(a),this.eat(0)?(d&&this.unexpected(d.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(u,t))):o.indexers.push(this.flowParseObjectTypeIndexer(u,t,d));else if(this.match(6)||this.match(43))a!=null&&this.unexpected(a),d&&this.unexpected(d.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(u,t));else{let e=`init`;(this.isContextual(95)||this.isContextual(100))&&qv(this.lookahead().type)&&(e=this.state.value,this.next());let r=this.flowParseObjectTypeProperty(u,t,a,d,e,n,i??!c);r===null?(l=!0,s=this.state.lastTokStartLoc):o.properties.push(r)}this.flowObjectTypeSemicolon(),s&&!this.match(4)&&!this.match(5)&&this.raise(Iy.UnexpectedExplicitInexactInObject,s)}this.expect(s),n&&(o.inexact=l);let u=this.finishNode(o,`ObjectTypeAnnotation`);return this.state.inType=a,u}flowParseObjectTypeProperty(e,t,n,r,i,a,o){if(this.eat(17))return this.match(8)||this.match(9)||this.match(4)||this.match(5)?(a?o||this.raise(Iy.InexactInsideExact,this.state.lastTokStartLoc):this.raise(Iy.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(Iy.InexactVariance,r),null):(a||this.raise(Iy.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),r&&this.raise(Iy.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,`ObjectTypeSpreadProperty`));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=n!=null,e.kind=i;let o=!1;return this.match(43)||this.match(6)?(e.method=!0,n!=null&&this.unexpected(n),r&&this.unexpected(r.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)),i===`get`||i===`set`?this.flowCheckGetterSetterParams(e):!t&&!a&&e.key.name===`constructor`&&e.value.this&&this.raise(Iy.ThisParamBannedInConstructor,e.value.this)):(i!==`init`&&this.unexpected(),e.method=!1,this.eat(13)&&(o=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=o,this.finishNode(e,`ObjectTypeProperty`)}}flowCheckGetterSetterParams(e){let t=e.kind===`get`?0:1,n=e.value,r=n.params.length+ +!!n.rest;n.this&&this.raise(e.kind===`get`?Iy.GetterMayNotHaveThisParam:Iy.SetterMayNotHaveThisParam,n.this),r!==t&&this.raise(e.kind===`get`?K.BadGetterArity:K.BadSetterArity,e),e.kind===`set`&&n.rest&&this.raise(K.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(9)&&!this.eat(8)&&!this.match(4)&&!this.match(5)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){e??=this.state.startLoc;let n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(12);){let t=this.startNodeAt(e);t.qualification=n,t.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(t,`QualifiedTypeIdentifier`)}return n}flowParseGenericType(e,t){let n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(43)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,`GenericTypeAnnotation`)}flowParseTypeofType(){let e=this.startNode();return this.expect(83),e.argument=this.flowParsePrimaryType(),this.finishNode(e,`TypeofTypeAnnotation`)}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(1)&&(e.types.push(this.flowParseType()),!this.match(1));)this.expect(8);return this.expect(1),this.finishNode(e,`TupleTypeAnnotation`)}flowParseFunctionTypeParam(e){let t=null,n=!1,r,i=this.startNode(),a=this.lookahead(),o=this.state.type===74;return a.type===10||a.type===13?(o&&!e&&this.raise(Iy.ThisParamMustBeFirst,i),t=this.parseIdentifier(o),this.eat(13)&&(n=!0,o&&this.raise(Iy.ThisParamMayNotBeOptional,i)),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),i.name=t,i.optional=n,i.typeAnnotation=r,this.finishNode(i,`FunctionTypeParam`)}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAtNode(e);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,`FunctionTypeParam`)}flowParseFunctionTypeParams(e=[]){let t=null,n=null;for(this.match(74)&&(n=this.flowParseFunctionTypeParam(!0),n.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:n}}flowIdentToTypeAnnotation(e,t,n){switch(n.name){case`any`:return this.finishNode(t,`AnyTypeAnnotation`);case`bool`:case`boolean`:return this.finishNode(t,`BooleanTypeAnnotation`);case`mixed`:return this.finishNode(t,`MixedTypeAnnotation`);case`empty`:return this.finishNode(t,`EmptyTypeAnnotation`);case`number`:return this.finishNode(t,`NumberTypeAnnotation`);case`string`:return this.finishNode(t,`StringTypeAnnotation`);case`symbol`:return this.finishNode(t,`SymbolTypeAnnotation`);default:return this.checkNotUnderscore(n.name),this.flowParseGenericType(e,n)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),n,r,i=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case 2:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 3:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,r=this.flowParseTupleType(),this.state.noAnonFunctionType=a,r;case 43:{let e=this.startNode();return e.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(6),n=this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),this.finishNode(e,`FunctionTypeAnnotation`)}case 6:{let e=this.startNode();if(this.next(),!this.match(7)&&!this.match(17)){if(Wv(this.state.type)||this.match(74)){let e=this.lookahead().type;i=e!==13&&e!==10}else i=!0}if(i){if(this.state.noAnonFunctionType=!1,r=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(8)||this.match(7)&&this.lookahead().type===15))return this.expect(7),r;this.eat(8)}return n=r?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(r)]):this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),e.typeParameters=null,this.finishNode(e,`FunctionTypeAnnotation`)}case 130:return this.parseLiteral(this.state.value,`StringLiteralTypeAnnotation`);case 81:case 82:return t.value=this.match(81),this.next(),this.finishNode(t,`BooleanLiteralTypeAnnotation`);case 49:if(this.state.value===`-`){if(this.next(),this.match(131))return this.parseLiteralAtNode(-this.state.value,`NumberLiteralTypeAnnotation`,t);if(this.match(132))return this.parseLiteralAtNode(-this.state.value,`BigIntLiteralTypeAnnotation`,t);throw this.raise(Iy.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 131:return this.parseLiteral(this.state.value,`NumberLiteralTypeAnnotation`);case 132:return this.parseLiteral(this.state.value,`BigIntLiteralTypeAnnotation`);case 84:return this.next(),this.finishNode(t,`VoidTypeAnnotation`);case 80:return this.next(),this.finishNode(t,`NullLiteralTypeAnnotation`);case 74:return this.next(),this.finishNode(t,`ThisTypeAnnotation`);case 51:return this.next(),this.finishNode(t,`ExistsTypeAnnotation`);case 83:return this.flowParseTypeofType();default:if($v(this.state.type)){let e=ay(this.state.type);return this.next(),super.createIdentifier(t,e)}if(Wv(this.state.type))return this.isContextual(125)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),n=!1;for(;(this.match(0)||this.match(14))&&!this.canInsertSemicolon();){let r=this.startNodeAt(e),i=this.eat(14);n||=i,this.expect(0),!i&&this.match(1)?(r.elementType=t,this.next(),t=this.finishNode(r,`ArrayTypeAnnotation`)):(r.objectType=t,r.indexType=this.flowParseType(),this.expect(1),n?(r.optional=i,t=this.finishNode(r,`OptionalIndexedAccessType`)):t=this.finishNode(r,`IndexedAccessType`))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(13)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,`NullableTypeAnnotation`)):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(15)){let t=this.startNodeAtNode(e);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,`FunctionTypeAnnotation`)}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(41);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(41);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,`IntersectionTypeAnnotation`)}flowParseUnionType(){let e=this.startNode();this.eat(39);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(39);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,`UnionTypeAnnotation`)}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===128&&this.state.value===`_`){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,`TypeAnnotation`)}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),t=this.parseIdentifierName();return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,t)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}flowParseVariance(){let e=null;return this.match(49)?(e=this.startNode(),this.state.value===`+`?e.kind=`plus`:e.kind=`minus`,this.next(),this.finishNode(e,`Variance`)):e}parseFunctionBody(e,t,n=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,t,n=!1){if(this.match(10)){let n=this.startNode();t===`FunctionDeclaration`||t===`FunctionExpression`||t===`ArrowFunctionExpression`?[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0):n.typeAnnotation=this.flowParseTypeInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,`TypeAnnotation`):null}return super.parseFunctionBodyAndFinish(e,t,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(125)){if(Kv(this.lookahead().type)){let e=this.startNode();return this.next(),this.flowParseInterface(e)}}else if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t){if(t.type===`Identifier`){if(t.name===`declare`){if(this.match(76)||Wv(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(Wv(this.state.type)){if(t.name===`interface`)return this.flowParseInterface(e);if(t.name===`type`)return this.flowParseTypeAlias(e);if(t.name===`opaque`)return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===122||Zv(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||Zv(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.expect(13);let r=this.state.clone(),i=this.state.noArrowAt,a=this.startNodeAt(t),{consequent:o,failed:s}=this.tryParseConditionalConsequent(),c=this.getArrowLikeExpressions(o),l=c[0],u=c[1];if(s||u.length>0){let e=[...i];if(u.length>0){this.state=r,this.state.noArrowAt=e;for(let t=0;t<u.length;t++)e.push(u[t].start);({consequent:o,failed:s}=this.tryParseConditionalConsequent()),[l]=this.getArrowLikeExpressions(o)}s&&l.length>1&&this.raise(Iy.AmbiguousConditionalArrow,r.startLoc),s&&l.length===1&&(this.state=r,e.push(l[0].start),this.state.noArrowAt=e,{consequent:o}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=i,this.expect(10),a.test=e,a.consequent=o,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign()),this.finishNode(a,`ConditionalExpression`)}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(10);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let n=[e],r=[];for(;n.length!==0;){let e=n.pop();e.type===`ArrowFunctionExpression`?(e.typeParameters||!e.returnType?this.finishArrowValidation(e):r.push(e),e.body.type!==`BlockStatement`&&n.push(e.body)):e.type===`ConditionalExpression`&&(n.push(e.consequent),n.push(e.alternate))}return t?(r.forEach(e=>this.finishArrowValidation(e)),[r,[]]):By(r,e=>e.params.every(e=>this.isAssignable(e,!0)))}finishArrowValidation(e){this.toAssignableList(e.params,e.extra?.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let n;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),n=t(),this.state.noArrowParamsConversionAt.pop()):n=t(),n}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let e=this.startNodeAt(t);return e.expression=n,e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,`TypeCastExpression`)}return n}assertModuleNodeAllowed(e){e.type===`ImportDeclaration`&&(e.importKind===`type`||e.importKind===`typeof`)||e.type===`ExportNamedDeclaration`&&e.exportKind===`type`||e.type===`ExportAllDeclaration`&&e.exportKind===`type`||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(126)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.match(2)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}if(this.isContextual(127)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}if(this.isContextual(125)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseInterface(t)}if(this.isContextual(122)){e.exportKind=`value`;let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(126)&&this.lookahead().type===51?(e.exportKind=`type`,this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind===`type`&&this.unexpected(t),n}parseClassId(e,t,n){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n),this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,n){let{startLoc:r}=this.state;if(this.isContextual(121)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,n),t.declare&&(t.type!==`ClassProperty`&&t.type!==`ClassPrivateProperty`&&t.type!==`PropertyDefinition`?this.raise(Iy.DeclareClassElement,r):t.value&&this.raise(Iy.DeclareClassFieldInitializer,t.value))}isIterator(e){return e===`iterator`||e===`asyncIterator`}readIterator(){let e=super.readWord1(),t=`@@`+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(K.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(128,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(3,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?44:43,1):this.state.inType&&e===63?t===46?this.finishOp(14,2):this.finishOp(13,1):Oy(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type===`TypeCastExpression`?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type===`AssignmentExpression`&&e.left.type===`TypeCastExpression`&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableListItem(e,t,n){let r=e[t];r.type===`TypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}toReferencedList(e,t){for(let n=0;n<e.length;n++){let r=e[n];r?.type===`TypeCastExpression`&&!r.extra?.parenthesized&&(e.length>1||!t)&&this.raise(Iy.TypeCastInPattern,r.typeAnnotation)}return e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.toReferencedList(n.elements),n}isValidLVal(e,t,n,r){return e===`TypeCastExpression`||super.isValidLVal(e,t,n,r)}parseClassProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(10)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(10)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,n,r,i,a){if(t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,n,r,i,a),t.params&&i){let e=t.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Iy.ThisParamBannedInConstructor,t)}else if(t.type===`MethodDefinition`&&i&&t.value.params){let e=t.value.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Iy.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,n,r){t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,n,r)}flowParseClassImplements(){let e=this.startNode();return e.id=this.flowParseRestrictedIdentifier(!0),e.typeParameters=this.match(43)?this.flowParseTypeParameterInstantiation():null,this.finishNode(e,`ClassImplements`)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(43)||this.match(47))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.eatContextual(109)){let t=e.implements=[];do t.push(this.flowParseClassImplements());while(this.eat(8))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let n=t[0];this.isThisParam(n)&&e.kind===`get`?this.raise(Iy.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(Iy.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,n,r,i,a,o){e.variance&&this.unexpected(e.variance.start),delete e.variance;let s;this.match(43)&&!a&&(s=this.flowParseTypeParameterDeclaration(),this.match(6)||this.unexpected());let c=super.parseObjPropValue(e,t,n,r,i,a,o);return s&&((c.value||c).typeParameters=s),c}parseFunctionParamType(e){return this.eat(13)&&(e.type!==`Identifier`&&this.raise(Iy.PatternIsOptional,e),this.isThisParam(e)&&this.raise(Iy.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(Iy.ThisParamAnnotationRequired,e),this.match(25)&&this.isThisParam(e)&&this.raise(Iy.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(Iy.TypeBeforeInitializer,n.typeAnnotation),n}parseImportSpecifierLocal(e,t,n){t.local=Ry(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){if(super.applyImportPhase(e,t,n,r),t){if(!n&&this.match(61))return;e.exportKind=n===`type`?n:`value`}else n===`type`&&this.match(51)&&this.unexpected(),e.importKind=n===`type`||n===`typeof`?n:`value`}parseImportSpecifier(e,t,n,r,i){let a=e.imported,o=null;a.type===`Identifier`&&(a.name===`type`?o=`type`:a.name===`typeof`&&(o=`typeof`));let s=!1;if(this.isContextual(89)&&!this.isLookaheadContextual(`as`)){let t=this.parseIdentifier(!0);o!==null&&!Kv(this.state.type)?(e.imported=t,e.importKind=o,e.local=this.cloneIdentifier(t)):(e.imported=a,e.importKind=null,e.local=this.parseIdentifier())}else{if(o!==null&&Kv(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=o;else{if(t)throw this.raise(K.ImportBindingIsString,e,{importName:a.value});e.imported=a,e.importKind=null}this.eatContextual(89)?e.local=this.parseIdentifier():(s=!0,e.local=this.cloneIdentifier(e.imported))}let c=Ry(e);return n&&c&&this.raise(Iy.ImportTypeShorthandOnlyInPureImport,e),(n||c)&&this.checkReservedType(e.local.name,e.local.start,!0),s&&!n&&!c&&this.checkReservedWord(e.local.name,e.start,!0,!0),this.finishImportSpecifier(e,`ImportSpecifier`)}parseBindingAtom(){switch(this.state.type){case 74:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let n=e.kind;n!==`get`&&n!==`set`&&this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(10)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(10)){let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=t}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(10)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){let n=null,r;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===dy.j_oTag||a===dy.j_expr)&&i.pop()}if(r?.error||this.match(43)){n||=this.state.clone();let i,a=this.tryParse(n=>{i=this.flowParseTypeParameterDeclaration();let r=this.forwardNoArrowParamsConversionAt(i,()=>{let n=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(n,i),n});r.extra?.parenthesized&&n();let a=this.maybeUnwrapTypeCastExpression(r);return a.type!==`ArrowFunctionExpression`&&n(),a.typeParameters=i,this.resetStartLocationFromNode(a,i),r},n),o=null;if(a.node&&this.maybeUnwrapTypeCastExpression(a.node).type===`ArrowFunctionExpression`){if(!a.error&&!a.aborted)return a.node.async&&this.raise(Iy.UnexpectedTypeParameterBeforeAsyncArrowFunction,i),a.node;o=a.node}if(r?.node)return this.state=r.failState,r.node;if(o)return this.state=a.failState,o;throw r?.thrown?r.error:a.thrown?a.error:this.raise(Iy.UnexpectedTokenAfterTypeParameter,i)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(()=>{let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0),this.state.noAnonFunctionType=t,this.canInsertSemicolon()&&this.unexpected(),this.match(15)||this.unexpected(),n});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,`TypeAnnotation`):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(10)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,n,r=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let t=0;t<e.params.length;t++)this.isThisParam(e.params[t])&&t>0&&this.raise(Iy.ThisParamMustBeFirst,e.params[t]);super.checkParams(e,t,n,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,t,n){if(e.type===`Identifier`&&e.name===`async`&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);n.callee=e,n.arguments=super.parseCallExpressionArguments(),e=this.finishNode(n,`CallExpression`)}else if(e.type===`Identifier`&&e.name===`async`&&this.match(43)){let r=this.state.clone(),i=this.tryParse(e=>this.parseAsyncArrowWithTypeParameters(t)||e(),r);if(!i.error&&!i.aborted)return i.node;let a=this.tryParse(()=>super.parseSubscripts(e,t,n),r);if(a.node&&!a.error)return a.node;if(i.node)return this.state=i.failState,i.node;if(a.node)return this.state=a.failState,a.node;throw i.error||a.error}return super.parseSubscripts(e,t,n)}parseSubscript(e,t,n,r){if(this.match(14)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,n)return r.stop=!0,e;this.next();let i=this.startNodeAt(t);return i.callee=e,i.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(6),i.arguments=this.parseCallExpressionArguments(),i.optional=!0,this.finishCallExpression(i,!0)}if(!n&&this.shouldParseTypes()&&(this.match(43)||this.match(47))){let n=this.startNodeAt(t);n.callee=e;let i=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(6),n.arguments=super.parseCallExpressionArguments(),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(i.node)return i.error&&(this.state=i.failState),i.node}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(43)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(5,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let n=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(Iy.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin(`flowComments`)&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(Iy.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?`*-/`:`*/`)}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let n=this.input.charCodeAt(t+e),r=this.input.charCodeAt(t+e+1);return n===58&&r===58?t+2:this.input.slice(t+e,t+e+12)===`flow-include`?t+12:n===58&&r!==58&&t}hasFlowCommentCompletion(){if(this.input.indexOf(`*/`,this.state.pos)===-1)throw this.raise(K.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,t){this.raise(Iy.EnumBooleanMemberNotInitialized,e,t)}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType===`symbol`?Iy.EnumInvalidMemberInitializerSymbolType:Iy.EnumInvalidMemberInitializerPrimaryType:Iy.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(Iy.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(Iy.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(8)||this.match(4);switch(this.state.type){case 131:{let e=this.parseNumericLiteral(this.state.value);if(t())return{type:`number`,loc:e.start,value:e};break}case 130:{let e=this.parseStringLiteral(this.state.value);if(t())return{type:`string`,loc:e.start,value:e};break}case 81:case 82:{let e=this.parseBooleanLiteral(this.match(81));if(t())return{type:`boolean`,loc:e.start,value:e}}}return{type:`invalid`,loc:e}}flowEnumMemberRaw(){let e=this.state.startLoc;return{id:this.parseIdentifier(!0),init:this.eat(25)?this.flowEnumMemberInit():{type:`none`,loc:e}}}flowEnumCheckExplicitTypeMismatch(e,t,n){let{explicitType:r}=t;r!==null&&r!==n&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let n=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},i=!1;for(;!this.match(4);){if(this.eat(17)){i=!0;break}let a=this.startNode(),{id:o,init:s}=this.flowEnumMemberRaw(),c=o.name;if(c===``)continue;/^[a-z]/.test(c)&&this.raise(Iy.EnumInvalidMemberName,o,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),n.has(c)&&this.raise(Iy.EnumDuplicateMemberName,o,{memberName:c,enumName:e}),n.add(c);let l={enumName:e,explicitType:t,memberName:c};switch(a.id=o,s.type){case`boolean`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`boolean`),a.init=s.value,r.booleanMembers.push(this.finishNode(a,`EnumBooleanMember`));break;case`number`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`number`),a.init=s.value,r.numberMembers.push(this.finishNode(a,`EnumNumberMember`));break;case`string`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`string`),a.init=s.value,r.stringMembers.push(this.finishNode(a,`EnumStringMember`));break;case`invalid`:throw this.flowEnumErrorInvalidMemberInitializer(s.loc,l);case`none`:switch(t){case`boolean`:this.flowEnumErrorBooleanMemberNotInitialized(s.loc,l);break;case`number`:this.flowEnumErrorNumberMemberNotInitialized(s.loc,l);break;default:r.defaultedMembers.push(this.finishNode(a,`EnumDefaultedMember`))}}this.match(4)||this.expect(8)}return{members:r,hasUnknownMembers:i}}flowEnumStringMembers(e,t,{enumName:n}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let t of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(t,{enumName:n});return t}for(let e of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:n});return e}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(98))return null;if(!Wv(this.state.type))throw this.raise(Iy.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!==`boolean`&&t!==`number`&&t!==`string`&&t!==`symbol`&&this.raise(Iy.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let n=t.name,r=t.start,i=this.flowEnumParseExplicitType({enumName:n});this.expect(2);let{members:a,hasUnknownMembers:o}=this.flowEnumMembers({enumName:n,explicitType:i});switch(e.hasUnknownMembers=o,i){case`boolean`:return e.explicitType=!0,e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`);case`number`:return e.explicitType=!0,e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`);case`string`:return e.explicitType=!0,e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);case`symbol`:return e.members=a.defaultedMembers,this.expect(4),this.finishNode(e,`EnumSymbolBody`);default:{let t=()=>(e.members=[],this.expect(4),this.finishNode(e,`EnumStringBody`));e.explicitType=!1;let i=a.booleanMembers.length,o=a.numberMembers.length,s=a.stringMembers.length,c=a.defaultedMembers.length;if(!i&&!o&&!s&&!c)return t();if(!i&&!o)return e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);if(!o&&!s&&i>=c){for(let e of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`)}if(!i&&!s&&o>=c){for(let e of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`)}return this.raise(Iy.EnumInconsistentMemberValues,r,{enumName:n}),t()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,`EnumDeclaration`)}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(43)||this.match(47))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}maybeUnwrapTypeCastExpression(e){return e.type===`TypeCastExpression`?e.expression:e}},Uy={__proto__:null,quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`},Wy=/\r\n|[\r\n\u2028\u2029]/g;function Gy(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Ky(e,t,n){for(let r=t;r<n;r++)if(Gy(e.charCodeAt(r)))return!0;return!1}var qy=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Jy=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function Yy(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var Xy=bv`jsx`({AttributeIsEmpty:`JSX attributes must only be assigned a non-empty expression.`,MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:`Expected corresponding JSX closing tag for <>.`,UnexpectedSequenceExpression:`Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?`,UnexpectedToken:({unexpected:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:`JSX value should be either an expression or a quoted JSX text.`,UnterminatedJsxContent:`Unterminated JSX contents.`,UnwrappedAdjacentJSXElements:`Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?`});function Zy(e){return e?e.type===`JSXOpeningFragment`||e.type===`JSXClosingFragment`:!1}function Qy(e){if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return Qy(e.object)+`.`+Qy(e.property);throw Error(`Node had unexpected type: `+e.type)}var $y=e=>class extends e{jsxReadToken(){let e=``,t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Xy.UnterminatedJsxContent,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(138)):super.getTokenFromCode(n);return}e+=this.input.slice(t,this.state.pos),this.finishToken(137,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:this.raise(Xy.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:n===125?`&rbrace;`:`&gt;`});default:Gy(n)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),n;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?`
15
- `:`\r
16
- `):n=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let t=``,n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(K.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos):Gy(r)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}t+=this.input.slice(n,this.state.pos++),this.finishToken(130,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let e=10;this.codePointAtPos(this.state.pos)===120&&(e=16,++this.state.pos);let t=this.readInt(e,void 0,!1,`bail`);if(t!==null&&t<=1114111&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(t)}else{let t=0,n=!1;for(;t++<10&&this.state.pos<this.length&&!(n=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(n){let t=Uy[this.input.slice(e,this.state.pos)];if(++this.state.pos,t)return t}}return this.state.pos=e,`&`}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(vy(e)||e===45);this.finishToken(136,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(136)?e.name=this.state.value:$v(this.state.type)?e.name=ay(this.state.type):this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(10))return t;let n=this.startNodeAt(e);return n.namespace=t,n.name=this.jsxParseIdentifier(),this.finishNode(n,`JSXNamespacedName`)}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type===`JSXNamespacedName`)return t;for(;this.eat(12);){let n=this.startNodeAt(e);n.object=t,n.property=this.jsxParseIdentifier(),t=this.finishNode(n,`JSXMemberExpression`)}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 2:return e=this.startNode(),this.setContext(dy.brace),this.next(),e=this.jsxParseExpressionContainer(e,dy.j_oTag),e.expression.type===`JSXEmptyExpression`&&this.raise(Xy.AttributeIsEmpty,e),e;case 138:case 130:return this.parseExprAtom();default:throw this.raise(Xy.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(dy.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadChild`)}jsxParseExpressionContainer(e,t){if(this.match(4))e.expression=this.jsxParseEmptyExpression();else{let t=this.parseExpression();t.type===`SequenceExpression`&&!t.extra?.parenthesized&&this.raise(Xy.UnexpectedSequenceExpression,t.expressions[1]),e.expression=t}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXExpressionContainer`)}jsxParseAttribute(){if(this.match(2)){let e=this.startNode();return this.setContext(dy.brace),this.next(),this.expect(17),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(dy.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadAttribute`)}let e=this.startNode();return e.name=this.jsxParseNamespacedName(),e.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(e,`JSXAttribute`)}jsxParseOpeningElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXOpeningFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t)}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(52)&&!this.match(139);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(52),this.expect(139),this.finishNode(e,`JSXOpeningElement`)}jsxParseClosingElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXClosingFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.expect(139),this.finishNode(t,`JSXClosingElement`)}jsxParseElementAt(e){let t=this.startNodeAt(e),n=[],r=this.jsxParseOpeningElementAt(e),i=null;if(!r.selfClosing){contents:for(;;)switch(this.state.type){case 138:if(e=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(e),i=this.jsxParseClosingElementAt(e);break contents}n.push(this.jsxParseElementAt(e));break;case 137:n.push(this.parseLiteral(this.state.value,`JSXText`));break;case 2:{let e=this.startNode();this.setContext(dy.brace),this.next(),this.match(17)?n.push(this.jsxParseSpreadChild(e)):n.push(this.jsxParseExpressionContainer(e,dy.j_expr));break}default:this.unexpected()}Zy(r)&&!Zy(i)&&i!==null?this.raise(Xy.MissingClosingTagFragment,i):(!Zy(r)&&Zy(i)||!Zy(r)&&!Zy(i)&&Qy(i.name)!==Qy(r.name))&&this.raise(Xy.MissingClosingTagElement,i,{openingTagName:Qy(r.name)})}if(Zy(r)?(t.openingFragment=r,t.closingFragment=i):(t.openingElement=r,t.closingElement=i),t.children=n,this.match(43))throw this.raise(Xy.UnwrappedAdjacentJSXElements,this.state.startLoc);return Zy(r)?this.finishNode(t,`JSXFragment`):this.finishNode(t,`JSXElement`)}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(138)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(138),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===dy.j_expr){this.jsxReadToken();return}if(t===dy.j_oTag||t===dy.j_cTag){if(_y(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(139);return}if((e===34||e===39)&&t===dy.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(138);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:n}=this.state;if(n===52&&e===138)t.splice(-2,2,dy.j_cTag),this.state.canStartJSXElement=!1;else if(n===138)t.push(dy.j_oTag);else if(n===139){let n=t[t.length-1];n===dy.j_oTag&&e===52||n===dy.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===dy.j_expr):(this.setContext(dy.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Jv(n)}},eb=class extends jy{tsNames=new Map},tb=class extends My{get inTSNamespace(){let e=this.scopeStack;return e.length>=2&&e[e.length-1].flags===0&&(e[e.length-2].flags&2048)>0}importsStack=[];createScope(e){return this.importsStack.push(new Set),new eb(e)}enter(e){e&3072&&this.importsStack.push(new Set),super.enter(e)}exit(){let e=super.exit();return e&3072&&this.importsStack.pop(),e}hasImport(e,t){let n=this.importsStack.length;if(this.importsStack[n-1].has(e))return!0;if(!t&&n>1){for(let t=0;t<n-1;t++)if(this.importsStack[t].has(e))return!0}return!1}declareName(e,t,n){if(t&4096){this.hasImport(e,!0)&&this.parser.raise(K.VarRedeclaration,n,{identifierName:e}),this.importsStack[this.importsStack.length-1].add(e);return}let r=this.currentScope(),i=r.tsNames.get(e)||0;if(t&1024){this.maybeExportDefined(r,e),r.tsNames.set(e,i|16);return}super.declareName(e,t,n),t&2&&(t&1||(this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e)),i|=1),t&256&&(i|=2),t&512&&(i|=4),t&128&&(i|=8),i&&r.tsNames.set(e,i)}isRedeclaredInScope(e,t,n){let r=e.tsNames.get(t);return(r&2)>0?n&256?(n&512)>0!=(r&4)>0:!0:n&128&&(r&8)>0?e.names.get(t)&2?!!(n&1):!1:n&2&&(r&1)>0?!0:super.isRedeclaredInScope(e,t,n)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let n=this.scopeStack.length;for(let e=n-1;e>=0;e--){let n=this.scopeStack[e].tsNames.get(t);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(e)}},nb=class{sawUnambiguousESM=!1;ambiguousScriptDifferentAst=!1;sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if(typeof e==`string`)return this.plugins.has(e);{let[t,n]=e;if(!this.hasPlugin(t))return!1;let r=this.plugins.get(t);for(let e of Object.keys(n))if(r?.[e]!==n[e])return!1;return!0}}getPluginOption(e,t){return this.plugins.get(e)?.[t]}};function rb(e,t){e.trailingComments===void 0?e.trailingComments=t:e.trailingComments.unshift(...t)}function ib(e,t){e.leadingComments===void 0?e.leadingComments=t:e.leadingComments.unshift(...t)}function ab(e,t){e.innerComments===void 0?e.innerComments=t:e.innerComments.unshift(...t)}function ob(e,t,n){let r=null,i=t.length;for(;r===null&&i>0;)r=t[--i];r===null||r.start>n.start?ab(e,n.comments):rb(r,n.comments)}var sb=class extends nb{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,n=t.length;if(n===0)return;let r=n-1,i=t[r];i.start===e.end&&(i.leadingNode=e,r--);let a=e.start;for(;r>=0;r--){let n=t[r],i=n.end;if(i>a)n.containingNode=e,this.finalizeComment(n),t.splice(r,1);else{i===a&&(n.trailingNode=e);break}}}finalizeComment(e){let{comments:t}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&rb(e.leadingNode,t),e.trailingNode!==null&&ib(e.trailingNode,t);else{let n=e.containingNode,r=e.start;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(n.type){case`ObjectExpression`:case`ObjectPattern`:ob(n,n.properties,e);break;case`CallExpression`:case`NewExpression`:case`OptionalCallExpression`:ob(n,n.arguments,e);break;case`ImportExpression`:ob(n,[n.source,n.options??null],e);break;case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`ObjectMethod`:case`ClassMethod`:case`ClassPrivateMethod`:case`TSTypeParameterDeclaration`:ob(n,n.params,e);break;case`ArrayExpression`:case`ArrayPattern`:ob(n,n.elements,e);break;case`ExportNamedDeclaration`:case`ImportDeclaration`:ob(n,n.specifiers,e);break;case`TSEnumBody`:ob(n,n.members,e);break;case`TSInterfaceBody`:ob(n,n.body,e);break;default:ab(n,t)}else ab(n,t)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:n}=t;if(n===0)return;let r=t[n-1];r.leadingNode===e&&(r.leadingNode=null)}takeSurroundingComments(e,t,n){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let i=r[a],o=i.end;if(i.start===n)i.leadingNode=e;else if(o===t)i.trailingNode=e;else if(o<t)break}}},cb=class e{flags=2048;get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}startIndex;curLine;lineStart;startLoc;endLoc;init({strictMode:e,sourceType:t,startIndex:n,startLine:r,startColumn:i}){this.strict=e===!1?!1:e===!0||t===`module`,this.startIndex=n,this.curLine=r,this.lineStart=-i,this.startLoc=this.endLoc=new av(r,i,n)}errors=[];noArrowAt=[];noArrowParamsConversionAt=[];get canStartArrow(){return(this.flags&2)>0}set canStartArrow(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get inConditionalConsequent(){return(this.flags&256)>0}set inConditionalConsequent(e){e?this.flags|=256:this.flags&=-257}get inHackPipelineBody(){return(this.flags&512)>0}set inHackPipelineBody(e){e?this.flags|=512:this.flags&=-513}get seenTopicReference(){return(this.flags&1024)>0}set seenTopicReference(e){e?this.flags|=1024:this.flags&=-1025}labels=[];commentsLen=0;commentStack=[];pos=0;type=135;value=null;start=0;end=0;lastTokEndLoc=null;lastTokStartLoc=null;context=[dy.brace];get canStartJSXElement(){return(this.flags&2048)>0}set canStartJSXElement(e){e?this.flags|=2048:this.flags&=-2049}get containsEsc(){return(this.flags&4096)>0}set containsEsc(e){e?this.flags|=4096:this.flags&=-4097}firstInvalidTemplateEscapePos=null;get hasTopLevelAwait(){return(this.flags&8192)>0}set hasTopLevelAwait(e){e?this.flags|=8192:this.flags&=-8193}strictErrors=new Map;tokensLength=0;curPosition(){return new av(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new e;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},lb=function(e){return e>=48&&e<=57},ub={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},db={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function fb(e,t,n,r,i,a){let o=n,s=r,c=i,l=``,u=null,d=n,{length:f}=t;for(;;){if(n>=f){a.unterminated(o,s,c),l+=t.slice(d,n);break}let p=t.charCodeAt(n);if(pb(e,p,t,n)){l+=t.slice(d,n);break}if(p===92){l+=t.slice(d,n);let o=mb(t,n,r,i,e===`template`,a);o.ch===null&&!u?u={pos:n,lineStart:r,curLine:i}:l+=o.ch,{pos:n,lineStart:r,curLine:i}=o,d=n}else p===8232||p===8233?(++n,++i,r=n):p===10||p===13?e===`template`?(l+=t.slice(d,n)+`
17
- `,++n,p===13&&t.charCodeAt(n)===10&&++n,++i,d=r=n):a.unterminated(o,s,c):++n}return{pos:n,str:l,firstInvalidLoc:u,lineStart:r,curLine:i}}function pb(e,t,n,r){return e===`template`?t===96||t===36&&n.charCodeAt(r+1)===123:t===(e===`double`?34:39)}function mb(e,t,n,r,i,a){let o=!i;t++;let s=e=>({pos:t,ch:e,lineStart:n,curLine:r}),c=e.charCodeAt(t++);switch(c){case 110:return s(`
18
- `);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=hb(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=_b(e,t,n,r,o,a),s(i===null?null:String.fromCodePoint(i))}case 116:return s(` `);case 98:return s(`\b`);case 118:return s(`\v`);case 102:return s(`\f`);case 13:e.charCodeAt(t)===10&&++t;case 10:n=t,++r;case 8232:case 8233:return s(``);case 56:case 57:if(i)return s(null);a.strictNumericEscape(t-1,n,r);default:if(c>=48&&c<=55){let o=t-1,c=/^[0-7]+/.exec(e.slice(o,t+2))[0],l=parseInt(c,8);l>255&&(c=c.slice(0,-1),l=parseInt(c,8)),t+=c.length-1;let u=e.charCodeAt(t);if(c!==`0`||u===56||u===57){if(i)return s(null);a.strictNumericEscape(o,n,r)}return s(String.fromCharCode(l))}return s(String.fromCharCode(c))}}function hb(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=gb(e,t,n,r,16,i,a,!1,s,!o),l===null&&(o?s.invalidEscapeSequence(c,n,r):t=c-1),{code:l,pos:t}}function gb(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?ub.hex:ub.decBinOct,f=i===16?db.hex:i===10?db.dec:i===8?db.oct:db.bin,p=!1,m=0;for(let u=0,h=a??1/0;u<h;++u){let a=e.charCodeAt(t),u;if(a===95&&s!==`bail`){let i=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(!s){if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,n,r)}else if(Number.isNaN(a)||!f(a)||d.has(i)||d.has(a)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,n,r)}++t;continue}if(u=a>=97?a-97+10:a>=65?a-65+10:lb(a)?a-48:1/0,u>=i){if(u<=9){if(l)return{n:null,pos:t};c.invalidDigit(t,n,r,i),u=0}else if(o)u=0,p=!0;else break}++t,m=m*i+u}return t===u||a!=null&&t-u!==a||p?{n:null,pos:t}:{n:m,pos:t}}function _b(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=hb(e,t,n,r,e.indexOf(`}`,t)-t,!0,i,a),++t,s!==null&&s>1114111){if(i)a.invalidCodePoint(t,n,r);else return{code:null,pos:t}}}else({code:s,pos:t}=hb(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function vb(e,t,n){return new av(n,e-t,e)}var yb=new Set([103,109,115,105,121,117,100,118]),bb=class{constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new ov(e.startLoc,e.endLoc)}},xb,Sb=class extends sb{isLookahead;tokens=[];constructor(e,t){super(),this.state=new cb,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1,(!xb||xb.length<(this.length+1)*2)&&(xb=new Uint32Array((this.length+1)*2)),this.locData=xb}setLoc(e){let t=this.offsetToSourcePos(e.index);this.locData[t*2]=e.line,this.locData[t*2+1]=e.column}getLoc(e){let t=this.offsetToSourcePos(e);return new av(this.locData[t*2],this.locData[t*2+1],e)}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&512&&this.pushToken(new bb(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return qy.lastIndex=e,qy.test(this.input)?qy.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return Jy.lastIndex=e,Jy.test(this.input)?Jy.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if((t&64512)==55296&&++e<this.input.length){let n=this.input.charCodeAt(e);(n&64512)==56320&&(t=65536+((t&1023)<<10)+(n&1023))}return t}setStrict(e){this.state.strict=e,e&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,t)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(135);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let n=this.state.pos,r=this.input.indexOf(e,n+2);if(r===-1)throw this.raise(K.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+e.length,Wy.lastIndex=n+2;Wy.test(this.input)&&Wy.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Wy.lastIndex;if(this.isLookahead)return;let i={type:`CommentBlock`,value:this.input.slice(n+2,r),start:this.sourceToOffsetPos(n),end:this.sourceToOffsetPos(r+e.length),loc:new ov(t,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(i),i}skipLineComment(e){let t=this.state.pos,n;this.isLookahead||(n=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=e);if(this.state.pos<this.length)for(;!Gy(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,a={type:`CommentLine`,value:this.input.slice(t+e,i),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(i),loc:new ov(n,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(a),a}skipSpace(){let e=this.state.pos,t=(this.optionFlags&8192)>0,n;loop:for(;this.state.pos<this.length;){let r=this.input.charCodeAt(this.state.pos);switch(r){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let e=this.skipBlockComment(`*/`);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e));break}case 47:{let e=this.skipLineComment(2);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e));break}default:break loop}break;default:if(Yy(r))++this.state.pos;else if(r===45&&!this.inModule&&this.optionFlags&16384){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(e===0||this.state.lineStart>e)){let e=this.skipLineComment(3);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e))}else break loop}else if(r===60&&!this.inModule&&this.optionFlags&16384){let e=this.state.pos;if(this.input.charCodeAt(e+1)===33&&this.input.charCodeAt(e+2)===45&&this.input.charCodeAt(e+3)===45){let e=this.skipLineComment(4);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e))}else break loop}else break loop}}if(n?.length){let t=this.state.pos,r={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(t),comments:n,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let n=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(n)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(K.UnexpectedDigitAfterHash,this.state.curPosition());_y(t)?(++this.state.pos,this.finishToken(134,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(134,this.readWord1())):this.finishOp(23,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(17)):(++this.state.pos,this.finishToken(12))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(27,2):this.finishOp(52,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!Gy(e)&&++this.state.pos<this.length;)e=this.input.charCodeAt(this.state.pos);let n=this.input.slice(t+2,this.state.pos);return this.finishToken(24,n),!0}readToken_mult_modulo(e){let t=e===42?51:50,n=1,r=this.input.charCodeAt(this.state.pos+1);e===42&&r===42&&(n++,r=this.input.charCodeAt(this.state.pos+2),t=53),r===61&&!this.state.inType&&(n++,t=e===37?29:26),this.finishOp(t,n)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(26,3):this.finishOp(e===124?37:38,2);return}if(e===124&&t===62){this.finishOp(35,2);return}if(t===61){this.finishOp(26,2);return}this.finishOp(e===124?39:41,1)}readToken_caret(){let e=this.input.charCodeAt(this.state.pos+1);e===61&&!this.state.inType?this.finishOp(28,2):e===94&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`^^`}])?(this.finishOp(33,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(40,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`@@`}])?this.finishOp(34,2):this.finishOp(22,1)}readToken_plus_min(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.finishOp(30,2);return}t===61?this.finishOp(26,2):this.finishOp(49,1)}readToken_lt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===60){if(this.input.charCodeAt(e+2)===61){this.finishOp(26,3);return}this.finishOp(47,2);return}if(t===61){this.finishOp(45,2);return}this.finishOp(43,1)}readToken_gt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===62){let t=this.input.charCodeAt(e+2)===62?3:2;if(this.input.charCodeAt(e+t)===61){this.finishOp(26,t+1);return}this.finishOp(48,t);return}if(t===61){this.finishOp(45,2);return}this.finishOp(44,1)}readToken_eq_excl(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(42,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(e===61&&t===62){this.state.pos+=2,this.finishToken(15);return}this.finishOp(e===61?25:31,1)}readToken_question(){let e=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);e===63?t===61?this.finishOp(26,3):this.finishOp(36,2):e===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(14)):(++this.state.pos,this.finishToken(13))}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(6);return;case 41:++this.state.pos,this.finishToken(7);return;case 59:++this.state.pos,this.finishToken(9);return;case 44:++this.state.pos,this.finishToken(8);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(1);return;case 123:++this.state.pos,this.finishToken(2);return;case 125:++this.state.pos,this.finishToken(4);return;case 58:this.hasPlugin(`functionBind`)&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(11,2):(++this.state.pos,this.finishToken(10));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(32,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(_y(e)){this.readWord(e);return}}throw this.raise(K.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let n=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,n)}readRegexp(){let e=this.state.startLoc,t=this.state.start+1,n,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(K.UnterminatedRegExp,sv(e,1));let t=this.input.charCodeAt(i);if(Gy(t))throw this.raise(K.UnterminatedRegExp,sv(e,1));if(n)n=!1;else{if(t===91)r=!0;else if(t===93&&r)r=!1;else if(t===47&&!r)break;n=t===92}}let a=this.input.slice(t,i);++i;let o=``,s=()=>sv(e,i+2-t);for(;i<this.length;){let e=this.codePointAtPos(i),t=String.fromCharCode(e);if(yb.has(e))e===118?o.includes(`u`)&&this.raise(K.IncompatibleRegExpUVFlags,s()):e===117&&o.includes(`v`)&&this.raise(K.IncompatibleRegExpUVFlags,s()),o.includes(t)&&this.raise(K.DuplicateRegExpFlags,s());else if(vy(e)||e===92)this.raise(K.MalformedRegExpFlags,s());else break;++i,o+=t}this.state.pos=i,this.finishToken(133,{pattern:a,flags:o})}readInt(e,t,n=!1,r=!0){let{n:i,pos:a}=gb(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,t,n,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1;this.state.pos+=2;let i=this.readInt(e);if(i??this.raise(K.InvalidDigit,sv(n,2),{radix:e}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,r=!0),_y(this.codePointAtPos(this.state.pos)))throw this.raise(K.NumberIdentifier,this.state.curPosition());if(r){let e=this.input.slice(t,this.state.pos).replace(/[_n]/g,``);this.finishToken(132,e);return}this.finishToken(131,i)}readNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1,i=!1,a=!1;!e&&this.readInt(10)===null&&this.raise(K.InvalidNumber,this.state.curPosition());let o=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(o){let e=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(K.StrictOctalLiteral,n),!this.state.strict){let t=e.indexOf(`_`);t>0&&this.raise(K.ZeroDigitNumericSeparator,sv(n,t))}a=o&&!/[89]/.test(e)}let s=this.input.charCodeAt(this.state.pos);s===46&&!a&&(++this.state.pos,this.readInt(10),r=!0,s=this.input.charCodeAt(this.state.pos)),(s===69||s===101)&&!a&&(s=this.input.charCodeAt(++this.state.pos),(s===43||s===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(K.InvalidOrMissingExponent,n),r=!0,s=this.input.charCodeAt(this.state.pos));let c=this.input.slice(t,this.state.pos).replaceAll(`_`,``);if(s===110&&((r||o)&&this.raise(K.InvalidBigIntLiteral,n),++this.state.pos,i=!0),_y(this.codePointAtPos(this.state.pos)))throw this.raise(K.NumberIdentifier,this.state.curPosition());if(i){this.finishToken(132,c);return}let l=a?parseInt(c,8):parseFloat(c);this.finishToken(131,l)}readCodePoint(e){let{code:t,pos:n}=_b(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=n,t}readString(e){let{str:t,pos:n,curLine:r,lineStart:i}=fb(e===34?`double`:`single`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=n+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(130,t)}readTemplateContinuation(){this.match(4)||this.unexpected(null,4),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:n,pos:r,curLine:i,lineStart:a}=fb(`template`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,n&&(this.state.firstInvalidTemplateEscapePos=new av(n.curLine,n.pos-n.lineStart,this.sourceToOffsetPos(n.pos))),this.input.codePointAt(r)===96?this.finishToken(20,n?null:e+t+"`"):(this.state.pos++,this.finishToken(21,n?null:e+t+"${"))}recordStrictModeErrors(e,t){let n=t.index;this.state.strict&&!this.state.strictErrors.has(n)?this.raise(e,t):this.state.strictErrors.set(n,[e,t])}readWord1(e){this.state.containsEsc=!1;let t=``,n=this.state.pos,r=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos<this.length;){let e=this.codePointAtPos(this.state.pos);if(vy(e))this.state.pos+=e<=65535?1:2;else if(e===92){this.state.containsEsc=!0,t+=this.input.slice(r,this.state.pos);let e=this.state.curPosition(),i=this.state.pos===n?_y:vy;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(K.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let a=this.readCodePoint(!0);a!==null&&(i(a)||this.raise(K.EscapedCharNotAnIdentifier,e),t+=String.fromCodePoint(a)),r=this.state.pos}else break}return t+this.input.slice(r,this.state.pos)}readWord(e){let t=this.readWord1(e),n=jv.get(t);n===void 0?this.finishToken(128,t):this.finishToken(n,ay(n))}checkKeywordEscapes(){let{type:e}=this.state;$v(e)&&this.state.containsEsc&&this.raise(K.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:ay(e)})}raise(e,t,n={}){let r=t instanceof av?t:typeof t==`number`?this.getLoc(t):this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=e(r,t instanceof av?r.index:typeof t==`number`?t:t.start,n);if(!(this.optionFlags&4096))throw i;return this.isLookahead||this.state.errors.push(i),i}raiseOverwrite(e,t,n={}){let r=t instanceof av?t:this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=t instanceof av?r.index:t.start,a=this.state.errors;for(let t=a.length-1;t>=0;t--){let o=a[t];if(o.pos===i)return a[t]=e(r,i,n);if(o.pos<i)break}return this.raise(e,r,n)}updateContext(e){}unexpected(e,t){throw this.raise(K.UnexpectedToken,e??this.state.startLoc,{expected:t?ay(t):null})}expectPlugin(e,t){if(this.hasPlugin(e))return!0;throw this.raise(K.MissingPlugin,t??this.state.startLoc,{missingPlugin:[e]})}expectOnePlugin(e){if(!e.some(e=>this.hasPlugin(e)))throw this.raise(K.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,n,r)=>{this.raise(e,vb(t,n,r))}}errorHandlers_readInt={invalidDigit:(e,t,n,r)=>{this.raise(K.InvalidDigit,vb(e,t,n),{radix:r})},numericSeparatorInEscapeSequence:this.errorBuilder(K.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(K.UnexpectedNumericSeparator)};errorHandlers_readCodePoint={...this.errorHandlers_readInt,invalidEscapeSequence:this.errorBuilder(K.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(K.InvalidCodePoint)};errorHandlers_readStringContents_string={...this.errorHandlers_readCodePoint,strictNumericEscape:(e,t,n)=>{this.recordStrictModeErrors(K.StrictNumericEscape,vb(e,t,n))},unterminated:(e,t,n)=>{throw this.raise(K.UnterminatedString,vb(e-1,t,n))}};errorHandlers_readStringContents_template={...this.errorHandlers_readCodePoint,strictNumericEscape:this.errorBuilder(K.StrictNumericEscape),unterminated:(e,t,n)=>{throw this.raise(K.UnterminatedTemplate,vb(e,t,n))}}},Cb=class{privateNames=new Set;loneAccessors=new Map;undefinedPrivateNames=new Map},wb=class{parser;stack=[];constructor(e){this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Cb)}exit(){let e=this.stack.pop(),t=this.current();for(let[n,r]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(n)||t.undefinedPrivateNames.set(n,r):this.parser.raise(K.InvalidPrivateFieldResolution,r,{identifierName:n})}declarePrivateName(e,t,n){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=r.has(e);if(t&3){let n=o&&i.get(e);if(n){let r=n&4,a=t&4;o=(n&3)==(t&3)||r!==a,o||i.delete(e)}else o||i.set(e,t)}o&&this.parser.raise(K.PrivateNameRedeclaration,n,{identifierName:e}),r.add(e),a.delete(e)}usePrivateName(e,t){let n;for(n of this.stack)if(n.privateNames.has(e))return;n?n.undefinedPrivateNames.set(e,t):this.parser.raise(K.InvalidPrivateFieldResolution,t,{identifierName:e})}},Tb=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Eb=class extends Tb{declarationErrors=new Map;constructor(e){super(e)}recordDeclarationError(e,t){this.declarationErrors.set(t,e)}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},Db=class{parser;stack=[new Tb];constructor(e){this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let{stack:n}=this,r=n.length-1,i=n[r];for(;!i.isCertainlyParameterDeclaration();){if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(e,t);else return;i=n[--r]}this.parser.raise(e,t)}recordArrowParameterBindingError(e,t){let{stack:n}=this,r=n[n.length-1],i=t.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(e,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(e,i);else return}recordAsyncArrowParametersError(e){let{stack:t}=this,n=t.length-1,r=t[n];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(K.AwaitBindingIdentifier,e),r=t[--n]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors((t,n)=>{this.parser.raise(t,n);let r=e.length-2,i=e[r];for(;i.canBeArrowParameterDeclaration();)i.clearDeclarationError(n),i=e[--r]})}};function Ob(){return new Tb(3)}function kb(){return new Eb(1)}function Ab(){return new Eb(2)}function jb(){return new Tb}var Mb=class{stacks=[];enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}get inFSharpPipelineDirectBody(){return!(this.currentFlags()&16)}};function Nb(e,t){return(e?2:0)|!!t}var Pb=class extends Sb{addExtra(e,t,n,r=!0){if(!e)return;let{extra:i}=e;i??(i={},e.extra=i),r?i[t]=n:Object.defineProperty(i,t,{enumerable:r,value:n})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let n=this.input.charCodeAt(e+t.length);return!(vy(n)||(n&64512)==55296)}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,t){if(!this.eatContextual(e)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(135)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ky(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Ky(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(9)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(9))||this.raise(K.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let n={node:null};try{let r=e((e=null)=>{throw n.node=e,n});if(this.state.errors.length>t.errors.length){let e=this.state;return this.state=t,this.state.tokensLength=e.tokensLength,{node:r,error:e.errors[t.errors.length],thrown:!1,aborted:!1,failState:e}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let r=this.state;if(this.state=t,e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:r};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:r};throw e}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:n,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a,voidPatternLoc:o}=e,s=!!n||!!r||!!a||!!i||!!o;if(!t)return s;n!=null&&this.raise(K.InvalidCoverInitializedName,n),r!=null&&this.raise(K.DuplicateProto,r),i!=null&&this.raise(K.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),o!=null&&this.raise(K.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return qv(this.state.type)}isPrivateName(e){return e.type===`PrivateName`}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type===`ObjectProperty`}isObjectMethod(e){return e.type===`ObjectMethod`}initializeScopes(e=this.options.sourceType===`module`){let t=this.state.labels;this.state.labels=[];let n=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=e;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,e);let o=this.prodParam;this.prodParam=new Mb;let s=this.classScope;this.classScope=new wb(this);let c=this.expressionScope;return this.expressionScope=new Db(this),()=>{this.state.labels=t,this.exportedIdentifiers=n,this.inModule=r,this.scope=i,this.prodParam=o,this.classScope=s,this.expressionScope=c}}enterInitialScopes(){let e=0;(this.inModule||this.optionFlags&1)&&(e|=2),this.optionFlags&32&&(e|=1);let t=!this.inModule&&this.options.sourceType===`commonjs`;(t||this.optionFlags&2)&&(e|=4),this.prodParam.enter(e);let n=t?514:1;this.optionFlags&4&&(n|=512),this.optionFlags&16&&(n|=48),this.scope.enter(n)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;t!==null&&this.expectPlugin(`destructuringPrivate`,t)}},Fb=class{shorthandAssignLoc=null;doubleProtoLoc=null;privateKeyLoc=null;optionalParametersLoc=null;voidPatternLoc=null},Ib=class{constructor(e,t,n,r){this.start=n,this.end=0,r!==void 0&&(this.loc=new ov(r)),e&128&&(this.range=[n,0]),r!==void 0&&t&&(this.loc.filename=t)}type=``},Lb=Ib.prototype,Rb=class extends Pb{createPosition(e){return e}startNode(){let{startLoc:e}=this.state;return this.setLoc(e),this.startNodeAt(e)}startNodeAt(e){let{optionFlags:t,filename:n}=this;return t&256?new Ib(t,n,e.index,this.createPosition(e)):new Ib(t,n,e.index)}startNodeAtNode(e){let{optionFlags:t,filename:n}=this;return t&256?new Ib(t,n,e.start,e.loc.start):new Ib(t,n,e.start)}finishNode(e,t){return this.finishNodeAt(e,t,this.state.lastTokEndLoc)}finishNodeAt(e,t,n){e.type=t,e.end=n.index;let{optionFlags:r}=this;return r&256&&(e.loc.end=this.createPosition(n)),r&128&&(e.range[1]=n.index),r&8192&&this.processComment(e),e}finishNodeAtNode(e,t,n){e.type=t,e.end=n.end;let{optionFlags:r}=this;return r&256&&(e.loc.end=n.loc.end),r&128&&(e.range[1]=e.end),r&8192&&this.processComment(e),e}resetStartLocation(e,t){e.start=t.index;let{optionFlags:n}=this;n&256&&(e.loc.start=this.createPosition(t)),n&128&&(e.range[0]=t.index)}resetEndLocation(e,t=this.state.lastTokEndLoc){e.end=t.index;let{optionFlags:n}=this;n&256&&(e.loc.end=this.createPosition(t)),n&128&&(e.range[1]=t.index)}resetStartLocationFromNode(e,t){e.start=t.start;let{optionFlags:n}=this;n&256&&(e.loc.start=t.loc.start),n&128&&(e.range[0]=t.start)}resetEndLocationFromNode(e,t){e.end=t.end;let{optionFlags:n}=this;n&256&&(e.loc.end=t.loc.end),n&128&&(e.range[1]=t.end)}castNodeTo(e,t){return e.type=t,e}cloneIdentifier(e){let{type:t,start:n,end:r,loc:i,range:a,name:o}=e,s=Object.create(Lb);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.name=o,e.extra&&(s.extra=e.extra),s}cloneStringLiteral(e){let{type:t,start:n,end:r,loc:i,range:a,extra:o}=e,s=Object.create(Lb);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.extra=o,s.value=e.value,s}},zb=e=>e.type===`ParenthesizedExpression`?zb(e.expression):e,Bb=class extends Rb{toAssignable(e,t=!1){let n;switch((e.type===`ParenthesizedExpression`||e.extra?.parenthesized)&&(n=zb(e),t?n.type===`Identifier`?this.expressionScope.recordArrowParameterBindingError(K.InvalidParenthesizedAssignment,e):n.type!==`CallExpression`&&n.type!==`MemberExpression`&&!this.isOptionalMemberExpression(n)&&this.raise(K.InvalidParenthesizedAssignment,e):this.raise(K.InvalidParenthesizedAssignment,e)),e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:break;case`ObjectExpression`:this.castNodeTo(e,`ObjectPattern`);for(let n=0,r=e.properties.length,i=r-1;n<r;n++){let r=e.properties[n],a=n===i;this.toAssignableObjectExpressionProp(r,a,t),a&&r.type===`RestElement`&&e.extra?.trailingCommaLoc&&this.raise(K.RestTrailingComma,e.extra.trailingCommaLoc)}break;case`ObjectProperty`:{let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t);break}case`SpreadElement`:throw Error(`Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.`);case`ArrayExpression`:this.castNodeTo(e,`ArrayPattern`),this.toAssignableList(e.elements,e.extra?.trailingCommaLoc,t);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(K.MissingEqInAssignment,this.optionFlags&256?e.left.loc.end:e.left),this.castNodeTo(e,`AssignmentPattern`),delete e.operator,e.left.type===`VoidPattern`&&this.raise(K.VoidPatternInitializer,e.left),this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(n,t)}}toAssignableObjectExpressionProp(e,t,n){if(e.type===`ObjectMethod`)this.raise(e.kind===`get`||e.kind===`set`?K.PatternHasAccessor:K.PatternHasMethod,e.key);else if(e.type===`SpreadElement`){this.castNodeTo(e,`RestElement`);let r=e.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,n),t||this.raise(K.RestTrailingComma,e)}else this.toAssignable(e,n)}toAssignableList(e,t,n){let r=e.length-1;for(let i=0;i<=r;i++){let a=e[i];a&&(this.toAssignableListItem(e,i,n),a.type===`RestElement`&&(i<r?this.raise(K.RestTrailingComma,a):t&&this.raise(K.RestTrailingComma,t)))}}toAssignableListItem(e,t,n){let r=e[t];if(r.type===`SpreadElement`){this.castNodeTo(r,`RestElement`);let e=r.argument;this.checkToRestConversion(e,!0),this.toAssignable(e,n)}else this.toAssignable(r,n)}isAssignable(e,t){switch(e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:return!0;case`ObjectExpression`:{let t=e.properties.length-1;return e.properties.every((e,n)=>e.type!==`ObjectMethod`&&(n===t||e.type!==`SpreadElement`)&&this.isAssignable(e))}case`ObjectProperty`:return this.isAssignable(e.value);case`SpreadElement`:return this.isAssignable(e.argument);case`ArrayExpression`:return e.elements.every(e=>e===null||this.isAssignable(e));case`AssignmentExpression`:return e.operator===`=`;case`ParenthesizedExpression`:return this.isAssignable(e.expression);case`MemberExpression`:case`OptionalMemberExpression`:return!t;default:return!1}}toReferencedList(e,t){return e}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e),this.finishNode(t,`SpreadElement`)}parseRestBinding(){let e=this.startNode();this.next();let t=this.parseBindingAtom();return t.type===`VoidPattern`&&this.raise(K.UnexpectedVoidPattern,t),e.argument=t,this.finishNode(e,`RestElement`)}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(1,93,1),this.finishNode(e,`ArrayPattern`)}case 2:return this.parseObjectLike(4,!0);case 84:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(e,t,n){let r=n&1,i=[],a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(8),r&&this.match(8))i.push(null);else if(this.eat(e))break;else if(this.match(17)){let r=this.parseRestBinding();if(n&2&&(r=this.parseFunctionParamType(r)),i.push(r),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let e=[];if(n&2)for(this.match(22)&&this.hasPlugin(`decorators`)&&this.raise(K.UnsupportedParameterDecorator,this.state.startLoc);this.match(22);)e.push(this.parseDecorator());i.push(this.parseBindingElement(n,e))}return i}parseBindingRestProperty(e){return this.next(),this.hasPlugin(`discardBinding`)&&this.match(84)?(e.argument=this.parseVoidPattern(null),this.raise(K.UnexpectedVoidPattern,e.argument)):e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,`RestElement`)}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(e===17)return this.parseBindingRestProperty(this.startNode());let n=this.startNode();return e===134?(this.expectPlugin(`destructuringPrivate`,t),this.classScope.usePrivateName(this.state.value,t),n.key=this.parsePrivateName()):this.parsePropertyName(n),n.method=!1,this.parseObjPropValue(n,t,!1,!1,!0,!1)}parseBindingElement(e,t){let{startLoc:n}=this.state,r=this.parseMaybeDefault();return e&2&&this.parseFunctionParamType(r),t.length&&(r.decorators=t,this.resetStartLocationFromNode(r,t[0])),this.parseMaybeDefault(n,r)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){if(e??=this.state.startLoc,t??=this.parseBindingAtom(),!this.eat(25))return t;let n=this.startNodeAt(e);return t.type===`VoidPattern`&&this.raise(K.VoidPatternInitializer,t),n.left=t,n.right=this.parseMaybeAssignAllowIn(),this.finishNode(n,`AssignmentPattern`)}isValidLVal(e,t,n,r){switch(e){case`AssignmentPattern`:return`left`;case`RestElement`:return`argument`;case`ObjectProperty`:return`value`;case`ParenthesizedExpression`:return`expression`;case`ArrayPattern`:return`elements`;case`ObjectPattern`:return`properties`;case`VoidPattern`:return!0;case`CallExpression`:if(!t&&!this.state.strict&&this.optionFlags&16384)return!0}return!1}isOptionalMemberExpression(e){return e.type===`OptionalMemberExpression`}checkLVal(e,t,n=64,r=!1,i=!1,a=!1,o=!1){let s=e.type;if(this.isObjectMethod(e))return;let c=this.isOptionalMemberExpression(e);if(c||s===`MemberExpression`){c&&(this.expectPlugin(`optionalChainingAssign`,e.start),t.type!==`AssignmentExpression`&&this.raise(K.InvalidLhsOptionalChaining,e,{ancestor:t})),n!==64&&this.raise(K.InvalidPropertyBindingPattern,e);return}if(s===`Identifier`){this.checkIdentifier(e,n,i);let{name:t}=e;r&&(r.has(t)?this.raise(K.ParamDupe,e):r.add(t));return}s===`VoidPattern`&&t.type===`CatchClause`&&this.raise(K.VoidPatternCatchClauseParam,e);let l=zb(e);o||=l.type===`CallExpression`&&(l.callee.type===`Import`||l.callee.type===`Super`);let u=this.isValidLVal(s,o,!(a||e.extra?.parenthesized)&&t.type===`AssignmentExpression`,n);if(u===!0)return;if(u===!1){let r=n===64?K.InvalidLhs:K.InvalidLhsBinding;this.raise(r,e,{ancestor:t});return}let d,f;typeof u==`string`?(d=u,f=s===`ParenthesizedExpression`):[d,f]=u;let p=s===`ArrayPattern`||s===`ObjectPattern`?{type:s}:t,m=e[d];if(Array.isArray(m))for(let e of m)e&&this.checkLVal(e,p,n,r,i,f,!0);else m&&this.checkLVal(m,p,n,r,i,f,o)}checkIdentifier(e,t,n=!1){this.state.strict&&(n?Ey(e.name,this.inModule):Ty(e.name))&&(t===64?this.raise(K.StrictEvalArguments,e,{referenceName:e.name}):this.raise(K.StrictEvalArgumentsBinding,e,{bindingName:e.name})),t&8192&&e.name===`let`&&this.raise(K.LetInLexicalBinding,e),t&64||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.start)}checkToRestConversion(e,t){switch(e.type){case`ParenthesizedExpression`:this.checkToRestConversion(e.expression,t);break;case`Identifier`:case`MemberExpression`:break;case`ArrayExpression`:case`ObjectExpression`:if(t)break;default:this.raise(K.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return this.match(8)?(this.raise(this.lookaheadCharCode()===e?K.RestTrailingComma:K.ElementAfterRest,this.state.startLoc),!0):!1}},Vb=class extends Bb{checkProto(e,t,n){if(e.type===`SpreadElement`||this.isObjectMethod(e)||e.computed||e.shorthand)return t;let r=e.key;return(r.type===`Identifier`?r.name:r.value)===`__proto__`?(t&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=this.getLoc(r.start)):this.raise(K.DuplicateProto,r)),!0):t}shouldExitDescending(e){return e.type===`ArrowFunctionExpression`&&!e.extra?.parenthesized}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(135))throw this.raise(K.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(135))throw this.raise(K.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,this.optionFlags&512&&(e.tokens=Kb(this.tokens)),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,n=this.parseMaybeAssign(e);if(this.match(8)){let r=this.startNodeAt(t);for(r.expressions=[n];this.eat(8);)r.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(r.expressions),this.finishNode(r,`SequenceExpression`)}return n}parseMaybeAssignDisallowIn(e){return this.disallowInAnd(()=>this.parseMaybeAssign(e))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let n=this.state.startLoc,r=this.isContextual(104);if(r&&this.prodParam.hasYield){this.next();let e=this.parseYield(n);return t&&(e=this.parseParenItem(e,n)),e}let i;e?i=!1:(e=new Fb,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(e);if(t&&(a=this.parseParenItem(a,n)),Xv(this.state.type)){let t=this.startNodeAt(n),r=this.state.value;if(t.operator=r,this.match(25)){this.toAssignable(a,!0),t.left=a;let r=n.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=r&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=r&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=r&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null),e.voidPatternLoc!=null&&e.voidPatternLoc.index>=r&&(e.voidPatternLoc=null)}else t.left=a;return this.next(),t.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(t,`AssignmentExpression`),void 0,void 0,void 0,void 0,r===`||=`||r===`&&=`||r===`??=`),t}if(i&&this.checkExpressionErrors(e,!0),r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?Yv(e):Yv(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(K.YieldNotInGeneratorFunction,n),this.parseYield(n)}return a}parseMaybeConditional(e){let t=this.state.startLoc,n=this.parseExprOps(e);return this.shouldExitDescending(n)?n:this.parseConditional(n,t,e)}parseConditional(e,t,n){if(this.eat(13)){let n=this.startNodeAt(t);return n.test=e,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(10),n.alternate=this.parseMaybeAssign(),this.finishNode(n,`ConditionalExpression`)}return e}parseMaybeUnaryOrPrivate(e){return this.match(134)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,n=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(n)?n:(this.state.canStartArrow=!1,this.parseExprOp(n,t,-1))}parseExprOp(e,t,n){if(this.isPrivateName(e)){let r=this.getPrivateNameSV(e);(n>=oy(54)||!this.prodParam.hasIn||!this.match(54))&&this.raise(K.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t)}let r=this.state.type;if(ey(r)&&(this.prodParam.hasIn||!this.match(54))){let i=oy(r);if(i>n){if(r===35&&(this.expectPlugin(`pipelineOperator`),this.prodParam.inFSharpPipelineDirectBody))return e;let a=this.startNodeAt(t);a.left=e,a.operator=this.state.value;let o=r===37||r===38,s=r===36;s&&(i=oy(38)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let c=this.finishNode(a,o||s?`LogicalExpression`:`BinaryExpression`),l=this.state.type;if(s&&(l===37||l===38)||o&&l===36)throw this.raise(K.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,t,n)}}return e}parseExprOpRightExpr(e,t){switch(e){case 35:switch(this.getPluginOption(`pipelineOperator`,`proposal`)){case`hack`:return this.withTopicBindingContext(()=>this.parseHackPipeBody());case`fsharp`:return this.parseFSharpPipelineBody(t)}default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){let n=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),n,sy(e)?t-1:t)}parseHackPipeBody(){let{startLoc:e}=this.state,t=this.parseMaybeAssign();return hv.has(t.type)&&!t.extra?.parenthesized&&this.raise(K.PipeUnparenthesizedBody,e,{type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(K.PipeTopicUnused,e),t}checkExponentialAfterUnary(e){this.match(53)&&this.raise(K.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let n=this.state.startLoc,r=this.isContextual(92);if(r&&this.recordAwaitIfAllowed()){this.next();let e=this.parseAwait(n);return t||this.checkExponentialAfterUnary(e),e}let i=this.match(30),a=this.startNode();if(ny(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.state.canStartArrow=!1,this.match(68)&&this.expectPlugin(`throwExpressions`);let n=this.match(85);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&n){let e=a.argument;e.type===`Identifier`?this.raise(K.StrictDelete,a):this.hasPropertyAsPrivateName(e)&&this.raise(K.DeletePrivateField,a)}if(!i)return t||this.checkExponentialAfterUnary(a),this.finishNode(a,`UnaryExpression`)}let o=this.parseUpdate(a,i,e);if(r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?Yv(e):Yv(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(K.AwaitNotInAsyncContext,n),this.parseAwait(n)}return o}parseUpdate(e,t,n){if(t){let t=this.finishNode(e,`UpdateExpression`);return this.checkLVal(t.argument,t),t}let r=this.state.startLoc,i=this.parseExprSubscripts(n);if(this.checkExpressionErrors(n,!1))return i;for(;ty(this.state.type)&&!this.canInsertSemicolon();){let e=this.startNodeAt(r);e.operator=this.state.value,e.prefix=!1,e.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(e,`UpdateExpression`))}return i}parseExprSubscripts(e){let t=this.state.startLoc;this.setLoc(t);let n=this.parseExprAtom(e);return this.shouldExitDescending(n)?n:this.parseSubscripts(n,t)}parseSubscripts(e,t,n){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,t,n,r),r.maybeAsyncArrow=!1;while(!r.stop);return e}parseSubscript(e,t,n,r){let{type:i}=this.state;if(!n&&i===11)return this.parseBind(e,t,r);if(cy(i))return this.parseTaggedTemplateExpression(e,t,r);let a=!1;if(i===14){if(n&&(this.raise(K.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(e,r);r.optionalChainMember=a=!0,this.next()}if(!n&&this.match(6))return this.parseCoverCallAndAsyncArrowHead(e,t,r,a);{let n=this.eat(0);return n||a||this.eat(12)?this.parseMember(e,t,r,n,a):this.stopParseSubscript(e,r)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,n,r,i){let a=this.startNodeAt(t);return a.object=e,a.computed=r,r?(a.property=this.parseExpression(),this.expect(1)):this.match(134)?(e.type===`Super`&&this.raise(K.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),n.optionalChainMember?(a.optional=i,this.finishNode(a,`OptionalMemberExpression`)):this.finishNode(a,`MemberExpression`)}parseBind(e,t,n){let r=this.startNodeAt(t);r.object=e,this.next();let i=this.parseNoCallExpr(e=>{throw this.raise(K.UnsupportedBindRHS,e)});if(i.type===`Super`||i.type===`Import`)throw this.raise(K.UnsupportedBindRHS,i);return r.callee=i,n.stop=!0,this.parseSubscripts(this.finishNode(r,`BindExpression`),t,!1)}parseCoverCallAndAsyncArrowHead(e,t,n,r){let i=null;this.next();let a=this.startNodeAt(t);a.callee=e;let{maybeAsyncArrow:o,optionalChainMember:s}=n;o&&(this.expressionScope.enter(Ab()),i=new Fb),s&&(a.optional=r),a.arguments=r?this.parseCallExpressionArguments():this.parseCallExpressionArguments(e.type!==`Super`,a,i);let c=this.finishCallExpression(a,s);return o&&this.shouldParseAsyncArrow()&&!r?(n.stop=!0,this.checkDestructuringPrivate(i),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),c)):(o&&(this.checkExpressionErrors(i,!0),this.expressionScope.exit()),this.toReferencedList(a.arguments)),c}parseTaggedTemplateExpression(e,t,n){let r=this.startNodeAt(t);return r.tag=e,r.quasi=this.parseTemplate(!0),n.optionalChainMember&&this.raise(K.OptionalChainingNoTemplate,t),this.finishNode(r,`TaggedTemplateExpression`)}atPossibleAsyncArrow(e){return e.type===`Identifier`&&e.name===`async`&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.state.canStartArrow}finishCallExpression(e,t){if(e.callee.type===`Import`){if(e.arguments.length===0||e.arguments.length>2)this.raise(K.ImportCallArity,e);else for(let t of e.arguments)t.type===`SpreadElement`&&this.raise(K.ImportCallSpreadArgument,t)}return this.finishNode(e,t?`OptionalCallExpression`:`CallExpression`)}parseCallExpressionArguments(e,t,n){let r=[],i=!0;for(;!this.eat(7);){if(i)i=!1;else if(this.expect(8),this.match(7)){t&&this.addTrailingCommaExtraToNode(t),this.next();break}r.push(this.parseExprListItem(7,!1,n,e))}return r}shouldParseAsyncArrow(){return this.match(15)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){return this.resetPreviousNodeTrailingComments(t),this.expect(15),this.parseArrowExpression(e,t.arguments,!0,t.extra?.trailingCommaLoc),t.innerComments&&ab(e,t.innerComments),t.callee.trailingComments&&ab(e,t.callee.trailingComments),e}parseNoCallExpr(e){let t=this.state.startLoc,n=this.match(79),r=this.parseExprAtom();return n&&r.type===`ImportExpression`&&e(r),this.parseSubscripts(r,t,!0)}parseExprAtom(e){let t,n=null,{type:r}=this.state;switch(r){case 75:return this.parseSuper();case 79:return t=this.startNode(),this.next(),this.match(12)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(6)?this.optionFlags&1024?this.parseImportCall(t):this.finishNode(t,`Import`):(this.raise(K.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,`Import`));case 74:return t=this.startNode(),this.next(),this.finishNode(t,`ThisExpression`);case 86:return this.parseDo(this.startNode(),!1);case 52:case 27:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 131:return this.parseNumericLiteral(this.state.value);case 132:return this.parseBigIntLiteral(this.state.value);case 130:return this.parseStringLiteral(this.state.value);case 80:return this.parseNullLiteral();case 81:return this.parseBooleanLiteral(!0);case 82:return this.parseBooleanLiteral(!1);case 6:return this.parseParenAndDistinguishExpression(this.state.canStartArrow);case 0:return this.parseArrayLike(1,e);case 2:return this.parseObjectLike(4,!1,e);case 64:return this.parseFunctionOrFunctionSent();case 22:n=this.parseDecorators();case 76:return this.parseClass(this.maybeTakeDecorators(n,this.startNode()),!1);case 73:return this.parseNewOrNewTarget();case 21:case 20:return this.parseTemplate(!1);case 11:{t=this.startNode(),this.next(),t.object=null;let e=t.callee=this.parseNoCallExpr(e=>{throw this.raise(K.UnsupportedBind,e)});if(e.type===`MemberExpression`)return this.finishNode(t,`BindExpression`);throw this.raise(K.UnsupportedBind,e)}case 134:return this.raise(K.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 29:return this.parseTopicReferenceThenEqualsSign(50,`%`);case 28:return this.parseTopicReferenceThenEqualsSign(40,`^`);case 33:case 34:return this.parseTopicReference(`hack`);case 40:case 50:case 23:{let e=this.getPluginOption(`pipelineOperator`,`proposal`);if(e)return this.parseTopicReference(e);throw this.unexpected()}case 43:{let e=this.input.codePointAt(this.nextTokenStart());throw _y(e)||e===62?this.expectOnePlugin([`jsx`,`flow`,`typescript`]):this.unexpected()}default:if(Wv(r)){if(this.isContextual(123)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let{canStartArrow:e,containsEsc:t}=this.state,n=this.parseIdentifier();if(!t&&n.name===`async`&&!this.canInsertSemicolon()){let{type:t}=this.state;if(t===64)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(Wv(t))return e&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(t===86)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return e&&this.match(15)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}throw this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let n=this.getPluginOption(`pipelineOperator`,`proposal`);if(n)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=sv(this.state.endLoc,-1),this.parseTopicReference(n);throw this.unexpected()}parseTopicReference(e){let t=this.startNode(),n=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(t,n,e,r)}finishTopicReference(e,t,n,r){if(this.testTopicReferenceConfiguration(n,t,r))return this.topicReferenceIsAllowedInCurrentContext()||this.raise(K.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,`TopicReference`);throw this.raise(K.PipeTopicUnconfiguredToken,t,{token:ay(r)})}testTopicReferenceConfiguration(e,t,n){switch(e){case`hack`:return this.hasPlugin([`pipelineOperator`,{topicToken:ay(n)}]);default:throw this.raise(K.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(Nb(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(K.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(15),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin(`doExpressions`),t&&this.expectPlugin(`asyncDoExpressions`),e.async=t,this.next();let n=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=n,this.finishNode(e,`DoExpression`)}parseSuper(){let e=this.startNode();return this.next(),this.match(6)&&!this.scope.allowDirectSuper?this.raise(K.SuperNotAllowed,e):this.scope.allowSuper||this.raise(K.UnexpectedSuper,e),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(K.UnsupportedSuper,e),this.finishNode(e,`Super`)}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(sv(this.state.startLoc,1)),n=this.state.value;return this.next(),e.id=this.createIdentifier(t,n),this.finishNode(e,`PrivateName`)}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`function`);return this.next(),this.match(99)?this.expectPlugin(`functionSent`):this.hasPlugin(`functionSent`)||this.unexpected(),this.parseMetaProperty(e,t,`sent`)}return this.parseFunction(e)}parseMetaProperty(e,t,n){e.meta=t;let r=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==n||r)&&this.raise(K.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:n}),this.finishNode(e,`MetaProperty`)}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(101)||this.isContextual(93)){let t=this.isContextual(101);return this.expectPlugin(t?`sourcePhaseImports`:`deferredImportEvaluation`),this.next(),e.phase=t?`source`:`defer`,this.parseImportCall(e)}{let t=this.createIdentifierAt(this.startNodeAtNode(e),`import`,this.state.lastTokStartLoc);return this.isContextual(97)&&(this.inModule||this.raise(K.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,`meta`)}}parseLiteralAtNode(e,t,n){return this.addExtra(n,`rawValue`,e),this.addExtra(n,`raw`,this.input.slice(this.offsetToSourcePos(n.start),this.state.end)),n.value=e,this.next(),this.finishNode(n,t)}parseLiteral(e,t){let n=this.startNode();return this.parseLiteralAtNode(e,t,n)}parseStringLiteral(e){return this.parseLiteral(e,`StringLiteral`)}parseNumericLiteral(e){return this.parseLiteral(e,`NumericLiteral`)}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}return this.parseLiteral(t,`BigIntLiteral`)}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,`raw`,this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,`RegExpLiteral`)}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,`BooleanLiteral`)}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,`NullLiteral`)}parseParenAndDistinguishExpression(e){let t=this.state.startLoc,n;this.next(),this.expressionScope.enter(kb());let r=this.state.startLoc,i=[],a=new Fb,o=!0,s,c;for(;!this.match(7);){if(o)o=!1;else if(this.expect(8,a.optionalParametersLoc===null?null:a.optionalParametersLoc),this.match(7)){c=this.state.startLoc;break}if(this.match(17)){let e=this.state.startLoc;if(s=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),e)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,!0))}let l=this.state.lastTokEndLoc;this.expect(7);let u=this.startNodeAt(t);return e&&this.shouldParseArrow(i)&&(u=this.parseArrow(u))?(this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(u,i,!1),u):(this.expressionScope.exit(),i.length||this.unexpected(this.state.lastTokStartLoc),c&&this.unexpected(c),s&&this.unexpected(s),this.checkExpressionErrors(a,!0),this.toReferencedList(i,!0),i.length>1?(n=this.startNodeAt(r),n.expressions=i,this.finishNode(n,`SequenceExpression`),this.resetEndLocation(n,l)):n=i[0],this.wrapParenthesis(t,n))}wrapParenthesis(e,t){if(!(this.optionFlags&2048))return this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let n=this.startNodeAt(e);return n.expression=t,this.finishNode(n,`ParenthesizedExpression`)}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(15))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`new`);this.next();let n=this.parseMetaProperty(e,t,`target`);return this.scope.allowNewTarget||this.raise(K.UnexpectedNewTarget,n),n}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(6)){let t=this.parseExprList(7);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,`NewExpression`)}parseNewCallee(e){let t=this.parseNoCallExpr(e=>{this.raise(K.ImportCallNotNewExpression,e,e)});e.callee=t,t.type===`Import`&&this.raise(K.ImportCallNotNewExpression,t),t.type===`Super`&&this.raise(K.SuperCallNotNewExpression,t)}parseTemplateElement(e){let{start:t,startLoc:n,end:r,value:i}=this.state,a=t+1,o=this.startNodeAt(sv(n,1));i===null&&(e||this.raise(K.InvalidEscapeSequenceTemplate,sv(this.state.firstInvalidTemplateEscapePos,1)));let s=this.match(20),c=s?-1:-2,l=r+c;o.value={raw:this.input.slice(a,l).replace(/\r\n?/g,`
19
- `),cooked:i===null?null:i.slice(1,c)},o.tail=s,this.next();let u=this.finishNode(o,`TemplateElement`);return this.resetEndLocation(u,sv(this.state.lastTokEndLoc,c)),u}parseTemplate(e){let t=this.startNode(),n=this.parseTemplateElement(e),r=[n],i=[];for(;!n.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(n=this.parseTemplateElement(e));return t.expressions=i,t.quasis=r,this.finishNode(t,`TemplateLiteral`)}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,n){let r=!1,i=!0,a=this.startNode();for(a.properties=[],this.next();!this.match(e);){if(i)i=!1;else if(this.expect(8),this.match(e)){this.addTrailingCommaExtraToNode(a);break}let o;t?o=this.parseBindingProperty():(o=this.parsePropertyDefinition(n),r=this.checkProto(o,r,n)),a.properties.push(o)}this.next();let o=t?`ObjectPattern`:`ObjectExpression`;return this.finishNode(a,o)}addTrailingCommaExtraToNode(e){this.addExtra(e,`trailingComma`,this.state.lastTokStartLoc.index),this.addExtra(e,`trailingCommaLoc`,this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type===`Identifier`&&(this.isLiteralPropertyName()||this.match(0)||this.match(51))}parsePropertyDefinition(e){let t=[];if(this.match(22))for(this.hasPlugin(`decorators`)&&this.raise(K.UnsupportedPropertyDecorator,this.state.startLoc);this.match(22);)t.push(this.parseDecorator());let n=this.startNode(),r=!1,i=!1,a;if(this.match(17))return t.length&&this.unexpected(),this.parseSpread();t.length&&(n.decorators=t),n.method=!1,e&&(a=this.state.startLoc);let o=this.eat(51);this.parsePropertyNamePrefixOperator(n);let s=this.state.containsEsc;if(this.parsePropertyName(n,e),!o&&!s&&this.maybeAsyncOrAccessorProp(n)){let{key:e}=n,t=e.name;t===`async`&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(e),o=this.eat(51),this.parsePropertyName(n)),(t===`get`||t===`set`)&&(i=!0,this.resetPreviousNodeTrailingComments(e),n.kind=t,this.match(51)&&(o=!0,this.raise(K.AccessorIsGenerator,this.state.curPosition(),{kind:t}),this.next()),this.parsePropertyName(n))}return this.parseObjPropValue(n,a,o,r,!1,i,e)}getGetterSetterExpectedParamCount(e){return e.kind===`get`?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){let t=this.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e);n.length!==t&&this.raise(e.kind===`get`?K.BadGetterArity:K.BadSetterArity,e),e.kind===`set`&&n[n.length-1]?.type===`RestElement`&&this.raise(K.BadSetterRestParameter,e)}parseObjectMethod(e,t,n,r,i){if(i){let n=this.parseMethod(e,t,!1,!1,!1,`ObjectMethod`);return this.checkGetterSetterParams(n),n}if(n||t||this.match(6))return r&&this.unexpected(),e.kind=`method`,e.method=!0,this.parseMethod(e,t,n,!1,!1,`ObjectMethod`)}parseObjectProperty(e,t,n,r){if(e.shorthand=!1,this.eat(10))return e.value=n?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(4,r),this.finishObjectProperty(e);if(!e.computed&&e.key.type===`Identifier`){if(this.checkReservedWord(e.key.name,e.key.start,!0,!1),n)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(25)){let n=this.state.startLoc;r==null?this.raise(K.InvalidCoverInitializedName,n):r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,`ObjectProperty`)}parseObjPropValue(e,t,n,r,i,a,o){let s=this.parseObjectMethod(e,n,r,i,a)||this.parseObjectProperty(e,t,i,o);return s||this.unexpected(),s}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(1);else{let{type:n,value:r}=this.state,i;if(Kv(n))i=this.parseIdentifier(!0);else switch(n){case 131:i=this.parseNumericLiteral(r);break;case 130:i=this.parseStringLiteral(r);break;case 132:i=this.parseBigIntLiteral(r);break;case 134:{let e=this.state.startLoc;t==null?this.raise(K.UnexpectedPrivateField,e):t.privateKeyLoc===null&&(t.privateKeyLoc=e),i=this.parsePrivateName();break}default:throw this.unexpected()}e.key=i,n!==134&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,n,r,i,a,o=!1){this.initFunction(e,n),e.generator=t,this.scope.enter(530|(o?576:0)|(i?32:0)),this.prodParam.enter(Nb(n,e.generator)),this.parseFunctionParams(e,r);let s=this.parseFunctionBodyAndFinish(e,a,!0);return this.prodParam.exit(),this.scope.exit(),s}parseArrayLike(e,t){let n=this.startNode();return this.next(),n.elements=this.parseExprList(e,!0,t,n),this.finishNode(n,`ArrayExpression`)}parseArrowExpression(e,t,n,r){this.scope.enter(518);let i=Nb(n,!1);return this.match(2)||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(e,n),t&&this.setArrowFunctionParameters(e,t,r),this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`ArrowFunctionExpression`)}setArrowFunctionParameters(e,t,n){this.toAssignableList(t,n,!1),e.params=t}parseFunctionBodyAndFinish(e,t,n=!1){return this.parseFunctionBody(e,!1,n),this.finishNode(e,t)}parseFunctionBody(e,t,n=!1){let r=t&&!this.match(2);if(this.expressionScope.enter(jb()),r)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let r=this.state.strict,i=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,i=>{let a=!this.isSimpleParamList(e.params);i&&a&&this.raise(K.IllegalLanguageModeDirective,(e.kind===`method`||e.kind===`constructor`)&&e.key?this.optionFlags&256?e.key.loc.end:e.key:e);let o=!r&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!n&&!a,t,o),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,o)}),this.prodParam.exit(),this.state.labels=i}this.expressionScope.exit()}isSimpleParameter(e){return e.type===`Identifier`}isSimpleParamList(e){for(let t=0,n=e.length;t<n;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,n,r=!0){let i=!t&&new Set,a={type:`FormalParameters`};for(let t of e.params)this.checkLVal(t,a,5,i,r)}parseExprList(e,t,n,r){let i=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(8),this.match(e)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(e,t,n))}return i}parseExprListItem(e,t,n,r){let i;if(this.match(8))t||this.raise(K.UnexpectedToken,this.state.curPosition(),{unexpected:`,`}),i=null;else if(this.match(17)){let e=this.state.startLoc;i=this.parseParenItem(this.parseSpread(n),e)}else if(this.match(13)){this.expectPlugin(`partialApplication`),r||this.raise(K.UnexpectedArgumentPlaceholder,this.state.startLoc);let e=this.startNode();this.next(),i=this.finishNode(e,`ArgumentPlaceholder`)}else i=this.parseMaybeAssignAllowInOrVoidPattern(e,n,!0);return i}parseIdentifier(e){let t=this.startNode(),n=this.parseIdentifierName(e);return this.createIdentifier(t,n)}createIdentifier(e,t){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNode(e,`Identifier`)}createIdentifierAt(e,t,n){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNodeAt(e,`Identifier`,n)}parseIdentifierName(e){let t,{start:n,type:r}=this.state;Kv(r)?t=this.state.value:this.unexpected();let i=Gv(r);return e?i&&this.replaceToken(128):this.checkReservedWord(t,this.sourceToOffsetPos(n),i,!1),this.next(),t}checkReservedWord(e,t,n,r){if(!(e.length>10)&&Ay(e)){if(n&&Dy(e)){this.raise(K.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?r?Ey:wy:Cy)(e,this.inModule)){this.raise(K.UnexpectedReservedWord,t,{reservedWord:e});return}if(e===`yield`){if(this.prodParam.hasYield){this.raise(K.YieldBindingIdentifier,t);return}}else if(e===`await`){if(this.prodParam.hasAwait){this.raise(K.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(K.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e===`arguments`&&this.scope.inClassAndNotInNonArrowFunction){this.raise(K.ArgumentsInClass,t);return}}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e,t){let n=e.index;this.setLoc(e);let r=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(K.AwaitExpressionFormalParameter,n),this.eat(51)&&this.raise(K.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),t||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,`AwaitExpression`)}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===49||e===6||e===0||cy(e)||e===98&&!this.state.containsEsc||e===133||e===52||this.hasPlugin(`v8intrinsic`)&&e===50}parseYield(e){this.setLoc(e);let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(K.YieldInParameter,e.index);let n=!1,r=null;if(!this.hasPrecedingLineBreak())switch(n=this.eat(51),this.state.type){case 9:case 135:case 4:case 7:case 1:case 5:case 10:case 8:if(!n)break;default:r=this.parseMaybeAssign()}return t.delegate=n,t.argument=r,this.finishNode(t,`YieldExpression`)}parseImportCall(e){this.next();let t=this.parseCallExpressionArguments();if(t.length===0||t.length>2)this.raise(K.ImportCallArity,e,e);else for(let n of t)n.type===`SpreadElement`&&this.raise(K.ImportCallSpreadArgument,n,e);return e.source=t[0],e.options=t[1]??null,this.finishNode(e,`ImportExpression`)}withTopicBindingContext(e){let t=this.state.inHackPipelineBody;this.state.inHackPipelineBody=!0;let n=this.state.seenTopicReference;this.state.seenTopicReference=!1;try{return e()}finally{this.state.inHackPipelineBody=t,this.state.seenTopicReference=n}}allowInAnd(e){let t=this.prodParam.currentFlags();if(24&~t){this.prodParam.enter(t|24);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags(),n=8&t,r=16&~t;if(n||r){this.prodParam.enter(t&-9|16);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.seenTopicReference=!0}topicReferenceIsAllowedInCurrentContext(){return this.state.inHackPipelineBody}topicReferenceWasUsedInCurrentContext(){return this.state.seenTopicReference}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.prodParam.enter(this.prodParam.currentFlags()&-17);let n;if(this.isContextual(92)&&this.recordAwaitIfAllowed()){this.next(),n=this.parseAwait(t,!0);let e=this.state.type;ey(e)&&e!==35&&(this.prodParam.hasIn||e!==54)&&this.raise(K.PipelineUnparenthesized,t)}else this.state.canStartArrow=!0,n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.prodParam.exit(),n}parseModuleExpression(){this.expectPlugin(`moduleBlocks`);let e=this.startNode();this.next(),this.match(2)||this.unexpected(null,2);let t=this.startNodeAt(this.state.endLoc);this.next();let n=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,4,`module`)}finally{n()}return this.finishNode(e,`ModuleExpression`)}parseVoidPattern(e){this.expectPlugin(`discardBinding`);let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,`VoidPattern`)}parseMaybeAssignAllowInOrVoidPattern(e,t,n){if(t!=null&&this.match(84)){let n=this.lookaheadCharCode();if(n===44||n===(e===1?93:e===4?125:41)||n===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,n)}parsePropertyNamePrefixOperator(e){}},Hb={kind:1},Ub={kind:2},Wb=/[\uD800-\uDFFF]/u,Gb=/in(?:stanceof)?/y;function Kb(e){for(let t=0;t<e.length;t++){let n=e[t],{type:r}=n;typeof r==`number`&&(n.type=ly(r))}return e}var qb=class extends Vb{parseTopLevel(e,t){return e.program=this.parseProgram(t,135,this.options.sourceType===`module`?`module`:`script`),e.comments=this.comments,this.optionFlags&512&&(e.tokens=Kb(this.tokens)),this.finishNode(e,`File`)}parseProgram(e,t,n){if(e.sourceType=n,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[e,t]of Array.from(this.scope.undefinedExports))this.raise(K.ModuleExportUndefined,t,{localName:e});this.addExtra(e,`topLevelAwait`,this.state.hasTopLevelAwait)}let r;return r=t===135?this.finishNode(e,`Program`):this.finishNodeAt(e,`Program`,sv(this.state.startLoc,-1)),r}stmtToDirective(e){let t=this.castNodeTo(e,`Directive`),n=this.castNodeTo(e.expression,`DirectiveLiteral`),r=n.value,i=this.input.slice(this.offsetToSourcePos(n.start),this.offsetToSourcePos(n.end)),a=n.value=i.slice(1,-1);return this.addExtra(n,`raw`,i),this.addExtra(n,`rawValue`,a),this.addExtra(n,`expressionValue`,r),t.value=n,delete e.expression,t}parseInterpreterDirective(){if(!this.match(24))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,`InterpreterDirective`)}isLet(){return this.isContextual(96)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(103)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(103))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,`of`)){let t=this.lookaheadCharCodeSince(e+2);if(t!==61&&t!==58&&t!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,`void`))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(92))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,`using`)){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(_y(e)){if(Gb.lastIndex=t,Gb.test(this.input)){let e=this.codePointAtPos(Gb.lastIndex);if(!vy(e)&&e!==92)return!1}return!0}return e===92}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(22)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let n=this.state.type,r=this.startNode(),i=!!(e&2),a=!!(e&4),o=e&1;switch(n){case 56:return this.parseBreakContinueStatement(r,!0);case 59:return this.parseBreakContinueStatement(r,!1);case 60:return this.parseDebuggerStatement(r);case 86:return this.parseDoWhileStatement(r);case 87:return this.parseForStatement(r);case 64:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?K.StrictFunction:this.options.annexB?K.SloppyFunctionAnnexB:K.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,r),!0);case 65:return this.parseIfStatement(r);case 66:return this.parseReturnStatement(r);case 67:return this.parseSwitchStatement(r);case 68:return this.parseThrowStatement(r);case 69:return this.parseTryStatement(r);case 92:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(K.AwaitUsingNotInAsyncContext,r):this.raise(K.UnexpectedLexicalDeclaration,r):this.raise(K.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,`await using`);break;case 103:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(K.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(K.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,`using`);case 96:{if(this.state.containsEsc)break;let e=this.nextTokenStart(),t=this.codePointAtPos(e);if(t!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(t,e)&&t!==123))break}case 71:i||this.raise(K.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let e=this.state.value;return this.parseVarStatement(r,e)}case 88:return this.parseWhileStatement(r);case 72:return this.parseWithStatement(r);case 2:return this.parseBlock();case 9:return this.parseEmptyStatement(r);case 79:{let e=this.lookaheadCharCode();if(e===40||e===46)break}case 78:{!(this.optionFlags&8)&&!o&&this.raise(K.UnexpectedImportExport,this.state.startLoc),this.next();let e;return e=n===79?this.parseImport(r):this.parseExport(r,t),this.assertModuleNodeAllowed(e),e}default:if(this.isAsyncFunction())return i||this.raise(K.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let s=this.state.value,c=this.parseExpression();return Wv(n)&&c.type===`Identifier`&&this.eat(10)?this.parseLabeledStatement(r,s,c,e):this.parseExpressionStatement(r,c)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(K.ImportOutsideModule,e)}maybeTakeDecorators(e,t,n){return e&&(t.decorators?.length?(this.raise(K.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),n&&this.resetStartLocationFromNode(n,t)),t}canHaveLeadingDecorator(){return this.match(76)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(22));if(this.match(78))e||this.unexpected();else if(!this.canHaveLeadingDecorator())throw this.raise(K.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin([`decorators`,`decorators-legacy`]);let e=this.startNode();if(this.next(),this.hasPlugin(`decorators`)){let t=this.state.startLoc,n;if(this.match(6)){let t=this.state.startLoc;this.next(),n=this.parseExpression(),this.expect(7),n=this.wrapParenthesis(t,n);let r=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(n,t),e.expression!==n&&this.raise(K.DecoratorArgumentsOutsideParentheses,r)}else{for(n=this.parseIdentifier(!1);this.eat(12);){let e=this.startNodeAt(t);e.object=n,this.match(134)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),e.property=this.parsePrivateName()):e.property=this.parseIdentifier(!0),e.computed=!1,n=this.finishNode(e,`MemberExpression`)}e.expression=this.parseMaybeDecoratorArguments(n,t)}}else this.state.canStartArrow=!1,e.expression=this.parseExprSubscripts();return this.finishNode(e,`Decorator`)}parseMaybeDecoratorArguments(e,t){if(this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.toReferencedList(n.arguments),this.finishNode(n,`CallExpression`)}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?`BreakStatement`:`ContinueStatement`)}verifyBreakContinue(e,t){let n=0;for(;n<this.state.labels.length;++n){let r=this.state.labels[n];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(t||r.kind===1)||e.label&&t))break}if(n===this.state.labels.length){let n=t?`BreakStatement`:`ContinueStatement`;this.raise(K.IllegalBreakContinue,e,{type:n})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)}parseHeaderExpression(){this.expect(6);let e=this.parseExpression();return this.expect(7),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(Hb),e.body=this.parseStatement(),this.state.labels.pop(),this.expect(88),e.test=this.parseHeaderExpression(),this.eat(9),this.finishNode(e,`DoWhileStatement`)}parseForStatement(e){this.next(),this.state.labels.push(Hb);let t=null;if(this.isContextual(92)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(6),this.match(9))return t!==null&&this.unexpected(t),this.parseFor(e,null);let n=this.isContextual(96);{let r=this.isAwaitUsing(),i=r||this.isForUsing(),a=n&&this.hasFollowingBindingAtom()||i;if(this.match(70)||this.match(71)||a){let n=this.startNode(),a;r?(a=`await using`,this.recordAwaitIfAllowed()||this.raise(K.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):a=this.state.value,this.next(),this.parseVar(n,!0,a);let o=this.finishNode(n,`VariableDeclaration`),s=this.match(54);return s&&i&&this.raise(K.ForInUsing,o),(s||this.isContextual(98))&&o.declarations.length===1?this.parseForX(e,o,t):(t!==null&&this.unexpected(t),this.parseFor(e,o))}}let r=this.isContextual(91),i=new Fb,a=this.parseExpression(!0,i),o=this.isContextual(98);if(o&&(n&&this.raise(K.ForOfLet,a),t===null&&r&&a.type===`Identifier`&&this.raise(K.ForOfAsync,a)),o||this.match(54)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let n=o?`ForOfStatement`:`ForInStatement`;return this.checkLVal(a,{type:n}),this.parseForX(e,a,t)}return this.checkExpressionErrors(i,!0),t!==null&&this.unexpected(t),this.parseFor(e,a)}parseFunctionStatement(e,t,n){return this.next(),this.parseFunction(e,1|(n?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(62)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,`IfStatement`)}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(K.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(2),this.state.labels.push(Ub),this.scope.enter(256);let n;for(let e;!this.match(4);)if(this.match(57)||this.match(61)){let r=this.match(57);n&&this.finishNode(n,`SwitchCase`),t.push(n=this.startNode()),n.consequent=[],this.next(),r?n.test=this.parseExpression():(e&&this.raise(K.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),e=!0,n.test=null),this.expect(10)}else n?n.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),n&&this.finishNode(n,`SwitchCase`),this.next(),this.state.labels.pop(),this.finishNode(e,`SwitchStatement`)}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(K.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type===`Identifier`?8:0),this.checkLVal(e,{type:`CatchClause`},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(58)){let t=this.startNode();this.next(),this.match(6)?(this.expect(6),t.param=this.parseCatchClauseParam(),this.expect(7)):(t.param=null,this.scope.enter(0)),t.body=this.parseBlock(!1,!1),this.scope.exit(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(63)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(K.NoCatchOrFinally,e),this.finishNode(e,`TryStatement`)}parseVarStatement(e,t,n=!1){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(Hb),e.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(e,`WhileStatement`)}parseWithStatement(e){return this.state.strict&&this.raise(K.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.parseStatement(),this.finishNode(e,`WithStatement`)}parseEmptyStatement(e){return this.next(),this.finishNode(e,`EmptyStatement`)}parseLabeledStatement(e,t,n,r){for(let e of this.state.labels)e.name===t&&this.raise(K.LabelRedeclaration,n,{labelName:t});let i=Qv(this.state.type)?1:this.match(67)?2:null;for(let t=this.state.labels.length-1;t>=0;t--){let n=this.state.labels[t];if(n.statementStart===e.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:t,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)}parseExpressionStatement(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)}parseBlock(e=!1,t=!0,n){let r=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(2),t&&this.scope.enter(0),this.parseBlockBody(r,e,!1,4,n),t&&this.scope.exit(),this.finishNode(r,`BlockStatement`)}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`StringLiteral`&&!e.expression.extra.parenthesized}parseBlockBody(e,t,n,r,i){let a=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(a,t?o:void 0,n,r,i)}parseBlockOrModuleBlockBody(e,t,n,r,i){let a=this.state.strict,o=!1,s=!1;for(;!this.match(r);){let r=n?this.parseModuleItem():this.parseStatementListItem();if(t&&!s){if(this.isValidDirective(r)){let e=this.stmtToDirective(r);t.push(e),!o&&e.value.value===`use strict`&&(o=!0,this.setStrict(!0));continue}s=!0,this.state.strictErrors.clear()}e.push(r)}i?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(9)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(7)?null:this.parseExpression(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,`ForStatement`)}parseForX(e,t,n){let r=this.match(54);return this.next(),r?n!==null&&this.unexpected(n):e.await=n!==null,t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(K.ForInOfLoopInitializer,t,{type:r?`ForInStatement`:`ForOfStatement`}),t.type===`AssignmentPattern`&&this.raise(K.InvalidLhs,t,{ancestor:{type:`ForStatement`}}),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,r?`ForInStatement`:`ForOfStatement`)}parseVar(e,t,n,r=!1){let i=e.declarations=[];for(e.kind=n;;){let e=this.startNode();if(this.parseVarId(e,n),e.init=this.eat(25)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,e.init===null&&!r&&(e.id.type!==`Identifier`&&!(t&&(this.match(54)||this.isContextual(98)))?this.raise(K.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:`destructuring`}):(n===`const`||n===`using`||n===`await using`)&&!(this.match(54)||this.isContextual(98))&&this.raise(K.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:n})),i.push(this.finishNode(e,`VariableDeclarator`)),!this.eat(8))break}return e}parseVarId(e,t){let n=this.parseBindingAtom();t===`using`||t===`await using`?(n.type===`ArrayPattern`||n.type===`ObjectPattern`)&&this.raise(K.UsingDeclarationHasBindingPattern,n):n.type===`VoidPattern`&&this.raise(K.UnexpectedVoidPattern,n),this.checkLVal(n,{type:`VariableDeclarator`},t===`var`?5:8201),e.id=n}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let n=t&2,r=!!(t&1),i=r&&!(t&4),a=!!(t&8);return this.initFunction(e,a),this.match(51)&&(n&&this.raise(K.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),r&&(e.id=this.parseFunctionId(i)),this.scope.enter(514),this.prodParam.enter(Nb(a,e.generator)),r||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.parseFunctionBodyAndFinish(e,r?`FunctionDeclaration`:`FunctionExpression`),this.prodParam.exit(),this.scope.exit(),r&&!n&&this.registerFunctionStatementId(e),e}parseFunctionId(e){return e||Wv(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(6),this.expressionScope.enter(Ob()),e.params=this.parseBindingList(7,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.start)}parseClass(e,t,n){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,n),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,r),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)}isClassProperty(){return this.match(25)||this.match(9)||this.match(4)}isClassMethod(){return this.match(6)}nameIsConstructor(e){return e.type===`Identifier`&&e.name===`constructor`||e.type===`StringLiteral`&&e.value===`constructor`}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let n={hadConstructor:!1,hadSuperClass:e},r=[],i=this.startNode();for(i.body=[],this.expect(2);!this.match(4);){if(this.eat(9)){if(r.length>0)throw this.raise(K.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(22)){r.push(this.parseDecorator());continue}let e=this.startNode();r.length&&(e.decorators=r,this.resetStartLocationFromNode(e,r[0]),r=[]),this.parseClassMember(i,e,n)}if(this.state.strict=t,this.next(),r.length)throw this.raise(K.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,`ClassBody`)}parseClassMemberFromModifier(e,t){let n=this.parseIdentifier(!0);if(this.isClassMethod()){let r=t;return r.kind=`method`,r.computed=!1,r.key=n,r.static=!1,this.pushClassMethod(e,r,!1,!1,!1,!1),!0}if(this.isClassProperty()){let r=t;return r.computed=!1,r.key=n,r.static=!1,e.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(n),!1}parseClassMember(e,t,n){let r=this.isContextual(102);if(r){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(2)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,n,r)}parseClassMemberWithIsStatic(e,t,n,r){let i=t,a=t,o=t,s=t,c=t,l=i,u=i;if(t.static=r,this.parsePropertyNamePrefixOperator(t),this.eat(51)){l.kind=`method`;let t=this.match(134);if(this.parseClassElementName(l),this.parsePostMemberNameModifiers(l),t){this.pushClassPrivateMethod(e,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(K.ConstructorIsGenerator,i.key),this.pushClassMethod(e,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&Wv(this.state.type),f=this.parseClassElementName(t),p=d?f.name:null,m=this.isPrivateName(f),h=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(l.kind=`method`,m){this.pushClassPrivateMethod(e,a,!1,!1);return}let r=this.isNonstaticConstructor(i),o=!1;r&&(i.kind=`constructor`,i.decorators&&i.decorators.length>0&&this.raise(K.DecoratorConstructor,t),n.hadConstructor&&!this.hasPlugin(`typescript`)&&this.raise(K.DuplicateConstructor,f),r&&this.hasPlugin(`typescript`)&&t.override&&this.raise(K.OverrideOnConstructor,f),n.hadConstructor=!0,o=n.hadSuperClass),this.pushClassMethod(e,i,!1,!1,r,o)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o);else if(p===`async`&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);let t=this.eat(51);u.optional&&this.unexpected(h),l.kind=`method`;let n=this.match(134);this.parseClassElementName(l),this.parsePostMemberNameModifiers(u),n?this.pushClassPrivateMethod(e,a,t,!0):(this.isNonstaticConstructor(i)&&this.raise(K.ConstructorIsAsync,i.key),this.pushClassMethod(e,i,t,!0,!1,!1))}else if((p===`get`||p===`set`)&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),l.kind=p;let t=this.match(134);this.parseClassElementName(i),t?this.pushClassPrivateMethod(e,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(K.ConstructorIsAccessor,i.key),this.pushClassMethod(e,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(p===`accessor`&&!this.isLineTerminator()){this.expectPlugin(`decoratorAutoAccessors`),this.resetPreviousNodeTrailingComments(f);let t=this.match(134);this.parseClassElementName(o),this.pushClassAccessorProperty(e,c,t)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o):this.unexpected()}parseClassElementName(e){let{type:t,value:n}=this.state;if((t===128||t===130)&&e.static&&n===`prototype`&&this.raise(K.StaticPrototype,this.state.startLoc),t===134){n===`constructor`&&this.raise(K.ConstructorClassPrivateField,this.state.startLoc);let t=this.parsePrivateName();return e.key=t,t}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){this.scope.enter(720);let n=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=t.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,4),this.prodParam.exit(),this.scope.exit(),this.state.labels=n,e.body.push(this.finishNode(t,`StaticBlock`)),t.decorators?.length&&this.raise(K.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(K.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let n=this.parseClassPrivateProperty(t);e.body.push(n),this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.start)}pushClassAccessorProperty(e,t,n){!n&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(K.ConstructorClassField,t.key);let r=this.parseClassAccessorProperty(t);e.body.push(r),n&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.start)}pushClassMethod(e,t,n,r,i,a){e.body.push(this.parseMethod(t,n,r,i,a,`ClassMethod`,!0))}pushClassPrivateMethod(e,t,n,r){let i=this.parseMethod(t,n,r,!1,!1,`ClassPrivateMethod`,!0);e.body.push(i);let a=i.kind===`get`?i.static?6:2:i.kind===`set`?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassPrivateProperty`)}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassProperty`)}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassAccessorProperty`)}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(jb()),this.prodParam.enter(0),e.value=this.eat(25)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,n,r=8331){if(Wv(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,r);else if(n||!t)e.id=null;else throw this.raise(K.MissingClassName,this.state.startLoc)}parseClassSuper(e){this.eat(77)?(this.state.canStartArrow=!1,e.superClass=this.parseExprSubscripts()):e.superClass=null}parseExport(e,t){let n=this.parseMaybeImportPhase(e,!0),r=this.maybeParseExportDefaultSpecifier(e,n),i=!r||this.eat(8),a=i&&this.eatExportStar(e),o=a&&this.maybeParseExportNamespaceSpecifier(e),s=i&&(!o||this.eat(8)),c=r||a;if(a&&!o){if(r&&this.unexpected(),t)throw this.raise(K.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,`ExportAllDeclaration`)}let l=this.maybeParseExportNamedSpecifiers(e);r&&i&&!a&&!l&&this.unexpected(null,2),o&&s&&this.unexpected(null,94);let u;if(c||l){if(u=!1,t)throw this.raise(K.UnsupportedDecoratorExport,e);this.parseExportFrom(e,c)}else u=this.maybeParseExportDeclaration(e);if(c||l||u){let n=e;if(this.checkNamedExport(n,!!n.source),n.declaration?.type===`ClassDeclaration`)this.maybeTakeDecorators(t,n.declaration,n);else if(t)throw this.raise(K.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(n,`ExportNamedDeclaration`)}if(this.eat(61)){let n=e,r=this.parseExportDefaultExpression();if(n.declaration=r,r.type===`ClassDeclaration`)this.maybeTakeDecorators(t,r,n);else if(t)throw this.raise(K.UnsupportedDecoratorExport,e);return this.checkDuplicateExports(e,`default`),this.hasPlugin(`exportDefaultFrom`)&&r.type===`Identifier`&&r.name===`from`&&r.end-r.start===4&&!r.extra?.parenthesized&&this.raise(K.ExportDefaultFromAsIdentifier,r),this.sawUnambiguousESM=!0,this.finishNode(n,`ExportDefaultDeclaration`)}throw this.unexpected(null,2)}eatExportStar(e){return this.eat(51)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin(`exportDefaultFrom`,t?.start);let n=t||this.parseIdentifier(!0),r=this.startNodeAtNode(n);return r.exported=n,e.specifiers=[this.finishNode(r,`ExportDefaultSpecifier`)],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(89)){e.specifiers??=[];let t=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),t.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(t,`ExportNamespaceSpecifier`)),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(2)){let t=e;t.specifiers||=[];let n=t.exportKind===`type`;return t.specifiers.push(...this.parseExportSpecifiers(n)),t.source=null,t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(91))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,`function`)}parseExportDefaultExpression(){let e=this.startNode();if(this.match(64))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(76))return this.parseClass(e,!0,!0);if(this.match(22))return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(71)||this.match(70)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(K.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(76)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(Wv(e)){if(e===91&&!this.state.containsEsc||e===96)return!1;if((e===126||e===125)&&!this.state.containsEsc){let e=this.nextTokenStart(),t=this.input.charCodeAt(e);if(t===123||this.chStartsBindingIdentifier(t,e)&&!this.input.startsWith(`from`,e))return this.expectOnePlugin([`flow`,`typescript`]),!1}}else if(!this.match(61))return!1;let t=this.nextTokenStart(),n=this.isUnparsedContextual(t,`from`);if(this.input.charCodeAt(t)===44||Wv(this.state.type)&&n)return!0;if(this.match(61)&&n){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return e===34||e===39}return!1}parseExportFrom(e,t){this.eatContextual(94)?(e.source=this.parseImportSource(),this.maybeParseImportAttributes(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===22&&(this.expectOnePlugin([`decorators`,`decorators-legacy`]),this.hasPlugin(`decorators`))?!0:this.isUsing()||this.isAwaitUsing()?(this.raise(K.UsingDeclarationExport,this.state.startLoc),!0):e===70||e===71||e===64||e===76||this.isLet()||this.isAsyncFunction()}checkNamedExport(e,t){if(e.specifiers?.length)for(let n of e.specifiers){let{exported:e}=n,r=e.type===`Identifier`?e.name:e.value;if(this.checkDuplicateExports(n,r),!t&&n.type===`ExportSpecifier`){let{local:e}=n;e.type===`Identifier`?(this.checkReservedWord(e.name,e.start,!0,!1),this.scope.checkLocalExport(e)):this.raise(K.ExportBindingIsString,n,{localName:e.value,exportName:r})}}else if(e.declaration){let t=e.declaration;if(t.type===`FunctionDeclaration`||t.type===`ClassDeclaration`){let{id:n}=t;if(!n)throw Error(`Assertion failure`);this.checkDuplicateExports(e,n.name)}else if(t.type===`VariableDeclaration`)for(let e of t.declarations)this.checkDeclaration(e.id)}}checkDeclaration(e){if(e.type===`Identifier`)this.checkDuplicateExports(e,e.name);else if(e.type===`ObjectPattern`)for(let t of e.properties)this.checkDeclaration(t);else if(e.type===`ArrayPattern`)for(let t of e.elements)t&&this.checkDeclaration(t);else e.type===`ObjectProperty`?this.checkDeclaration(e.value):e.type===`RestElement`?this.checkDeclaration(e.argument):e.type===`AssignmentPattern`&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(K.DuplicateDefaultExport,e):this.raise(K.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],n=!0;for(this.expect(2);!this.eat(4);){if(n)n=!1;else if(this.expect(8),this.eat(4))break;let r=this.isContextual(126),i=this.match(130),a=this.startNode();a.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(a,i,e,r))}return t}parseExportSpecifier(e,t,n,r){return this.eatContextual(89)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||=this.cloneIdentifier(e.local),this.finishNode(e,`ExportSpecifier`)}parseModuleExportName(){if(this.match(130)){let e=this.parseStringLiteral(this.state.value),t=Wb.exec(e.value);return t&&this.raise(K.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}checkImportPhase(e){let{specifiers:t}=e,n=t.length===1?t[0].type:null;e.phase===`source`?n!==`ImportDefaultSpecifier`&&this.raise(K.SourcePhaseImportRequiresDefault,t[0]):e.phase===`defer`&&n!==`ImportNamespaceSpecifier`&&this.raise(K.DeferImportRequiresNamespace,t[0])}isPotentialImportPhase(e){return e?!1:this.isContextual(101)||this.isContextual(93)}applyImportPhase(e,t,n,r){t||(n===`source`?(this.expectPlugin(`sourcePhaseImports`,r),e.phase=`source`):n===`defer`?(this.expectPlugin(`deferredImportEvaluation`,r),e.phase=`defer`):this.hasPlugin(`sourcePhaseImports`)&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let n=this.startNode(),r=this.parseIdentifierName(!0),{type:i}=this.state;return(Kv(i)?i!==94||this.lookaheadCharCode()===102:i!==8)?(this.applyImportPhase(e,t,r,n.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(n,r))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return Wv(t)?t!==94||this.lookaheadCharCode()===102:t!==8}parseImport(e){return this.match(130)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(8),r=n&&this.maybeParseStarImportSpecifier(e);return n&&!r&&this.parseNamedImportSpecifiers(e),this.expectContextual(94),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return e.specifiers??=[],e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportPhase(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.match(130)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,n){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}finishImportSpecifier(e,t,n=8201){return this.checkLVal(e.local,{type:t},n),this.finishNode(e,t)}parseImportAttributes(){this.expect(2);let e=[],t=new Set;do{if(this.match(4))break;let n=this.startNode(),r=this.state.value;if(t.has(r)&&this.raise(K.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),t.add(r),n.key=this.match(130)?this.parseStringLiteral(r):this.parseIdentifier(!0),this.expect(10),!this.match(130))throw this.raise(K.ModuleAttributeInvalidValue,this.state.startLoc);n.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(n,`ImportAttribute`))}while(this.eat(8));return this.expect(4),e}maybeParseImportAttributes(e){let t;if(this.match(72)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),t=this.parseImportAttributes()}else t=[];e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishImportSpecifier(n,`ImportDefaultSpecifier`)),!0}return Kv(this.state.type)?(this.parseImportSpecifierLocal(e,this.startNode(),`ImportDefaultSpecifier`),!0):!1}maybeParseStarImportSpecifier(e){if(this.match(51)){let t=this.startNode();return this.next(),this.expectContextual(89),this.parseImportSpecifierLocal(e,t,`ImportNamespaceSpecifier`),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(2);!this.eat(4);){if(t)t=!1;else{if(this.eat(10))throw this.raise(K.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let n=this.startNode(),r=this.match(130),i=this.isContextual(126);n.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(n,r,e.importKind===`type`||e.importKind===`typeof`,i,void 0);e.specifiers.push(a)}}parseImportSpecifier(e,t,n,r,i){if(this.eatContextual(89))e.local=this.parseIdentifier();else{let{imported:n}=e;if(t)throw this.raise(K.ImportBindingIsString,e,{importName:n.value});this.checkReservedWord(n.name,e.start,!0,!0),e.local||=this.cloneIdentifier(n)}return this.finishImportSpecifier(e,`ImportSpecifier`,i)}isThisParam(e){return e.type===`Identifier`&&e.name===`this`}},Jb=/in(?:stanceof)?|as|satisfies/y;function Yb(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function Xb(e){if(!e)throw Error(`Assert fail`)}var J=bv`typescript`({AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:`An 'accessor' property cannot be declared optional.`,AccessorCannotDeclareThisParameter:`'get' and 'set' accessors cannot declare 'this' parameters.`,AccessorCannotHaveTypeParameters:`An accessor cannot have type parameters.`,ClassMethodHasDeclare:`Class methods cannot have the 'declare' modifier.`,ClassMethodHasReadonly:`Class methods cannot have the 'readonly' modifier.`,ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:`A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.`,ConstructorHasTypeParameters:`Type parameters cannot appear on a constructor declaration.`,DeclaratorDefiniteAssertionRequiresTypeAnnotation:`Declarations with definite assignment assertions must also have type annotations.`,DeclaratorDefiniteAssertionWithInitializer:`Declarations with initializers cannot also have definite assignment assertions.`,DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:`Initializers are not allowed in ambient contexts.`,DeclareFunctionHasImplementation:`An implementation cannot be declared in ambient contexts.`,DecoratorAbstractMethod:({kind:e})=>`Decorators can't be used with ${e.startsWith(`a`)?`an`:`a`} ${e}.`,DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyNamespaceName:`Namespace must be given a name.`,EmptyTypeArguments:`Type argument list cannot be empty.`,EmptyTypeParameters:`Type parameter list cannot be empty.`,ExpectedAmbientAfterExportDeclare:`'export declare' must be followed by an ambient declaration.`,ExportAssignmentInTSNamespace:`An export assignment cannot be used in a namespace.`,ExportInTSNamespace:`Export declarations are not permitted in a namespace.`,ImportAliasHasImportType:`An import alias can not use 'import type'.`,ImportInTSNamespace:`Import declarations in a namespace cannot reference a module.`,IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:`Index signatures cannot have the 'abstract' modifier.`,IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:`Index signatures cannot have the 'declare' modifier.`,IndexSignatureHasOverride:`'override' modifier cannot appear on an index signature.`,IndexSignatureHasStatic:`Index signatures cannot have the 'static' modifier.`,InitializerNotAllowedInAmbientContext:`Initializers are not allowed in ambient contexts.`,InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:e=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:e=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidNamespaceName:e=>`Namespace name cannot be '${e}'.`,InvalidPropertyAccessAfterInstantiationExpression:`Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.`,InvalidTupleMemberLabel:`Tuple members must be labeled with a simple identifier.`,MissingInterfaceName:`'interface' declarations must be followed by an identifier.`,NamespaceExportInTSNamespace:`Global module exports may only appear at top level.`,NonAbstractClassHasAbstractMethod:`Abstract methods can only appear within an abstract class.`,NonClassMethodPropertyHasAbstractModifier:`'abstract' modifier can only appear on a class, method, or property declaration.`,OptionalTypeBeforeRequired:`A required element cannot follow an optional element.`,OverrideNotInSubClass:`This member cannot have an 'override' modifier because its containing class does not extend another class.`,PatternIsOptional:`A binding pattern parameter cannot be optional in an implementation signature.`,PrivateElementHasAbstract:`Private elements cannot have the 'abstract' modifier.`,PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:`'readonly' modifier can only appear on a property declaration or index signature.`,ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:`A 'set' accessor cannot have an optional parameter.`,SetAccessorCannotHaveRestParameter:`A 'set' accessor cannot have rest parameter.`,SetAccessorCannotHaveReturnType:`A 'set' accessor cannot have a return type annotation.`,SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:`Static class blocks cannot have any modifier.`,TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:`A type-only import can specify a default import or named bindings, but not both.`,TypeModifierIsUsedInTypeExports:`The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.`,TypeModifierIsUsedInTypeImports:`The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.`,UnexpectedParameterInitializer:`A parameter initializer is only allowed in a function or constructor implementation.`,UnexpectedParameterModifier:`A parameter property is only allowed in a constructor implementation.`,UnexpectedReadonly:`'readonly' type modifier is only permitted on array and tuple literal types.`,UnexpectedTypeAnnotation:`Did not expect a type annotation here.`,UnexpectedTypeCastInParameter:`Unexpected type cast in parameter position.`,UnexpectedTypeDeclaration:e=>`'${e}' declarations can only be declared inside a block.`,UnsupportedImportTypeArgument:`Argument in a type import must be a string literal.`,UnsupportedParameterPropertyKind:`A parameter property may not be declared using a binding pattern.`,UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:e=>`'${e}' declarations are not allowed in ambient contexts.`});function Zb(e){switch(e){case`any`:return`TSAnyKeyword`;case`boolean`:return`TSBooleanKeyword`;case`bigint`:return`TSBigIntKeyword`;case`never`:return`TSNeverKeyword`;case`number`:return`TSNumberKeyword`;case`object`:return`TSObjectKeyword`;case`string`:return`TSStringKeyword`;case`symbol`:return`TSSymbolKeyword`;case`undefined`:return`TSUndefinedKeyword`;case`unknown`:return`TSUnknownKeyword`;default:return}}function Qb(e){return e===`private`||e===`public`||e===`protected`}function $b(e){return e===`in`||e===`out`}function ex(e){if(e.extra?.parenthesized)return!1;switch(e.type){case`Identifier`:return!0;case`MemberExpression`:return!e.computed&&ex(e.object);case`TSInstantiationExpression`:return ex(e.expression);default:return!1}}var tx=dx([`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`],[`in`,`out`]),nx=dx([`readonly`],[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]),rx=dx([`public`,`private`,`protected`,`override`,`readonly`]),ix=dx([`private`,`public`,`protected`]),ax=e=>class extends e{getScopeHandler(){return tb}tsIsIdentifier(){return Wv(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),!this.hasPrecedingLineBreak()&&this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(102)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t,n){if(!Wv(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let r=this.state.value;if(e.has(r)){if(n&&this.match(102)||t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers(e,t=J.InvalidModifierOnTypeMember,n,r=!1){let i=(e,t,r,i)=>{t===r&&n[i]&&this.raise(J.InvalidModifiersOrder,e,{orderedModifiers:[r,i]})},a=(e,t,r,i)=>{(n[r]&&t===i||n[i]&&t===r)&&this.raise(J.IncompatibleModifiers,e,{modifiers:[r,i]})};for(;;){let{startLoc:o}=this.state,s=this.tsParseModifier(e,r,n.static);if(!s)break;Qb(s)?n.accessibility?this.raise(J.DuplicateAccessibilityModifier,o,{modifier:s}):(i(o,s,s,`override`),i(o,s,s,`static`),i(o,s,s,`readonly`),n.accessibility=s):$b(s)?(n[s]&&this.raise(J.DuplicateModifier,o,{modifier:s}),n[s]=!0,i(o,s,`in`,`out`)):(Object.hasOwn(n,s)?this.raise(J.DuplicateModifier,o,{modifier:s}):(i(o,s,`static`,`readonly`),i(o,s,`static`,`override`),i(o,s,`override`,`readonly`),i(o,s,`abstract`,`override`),a(o,s,`declare`,`override`),a(o,s,`static`,`abstract`)),n[s]=!0),e.get(s)||this.raise(t,o,{modifier:s})}}tsIsListTerminator(e){switch(e){case`EnumMembers`:case`TypeMembers`:return this.match(4);case`HeritageClauseElement`:return this.match(2);case`TupleElementTypes`:return this.match(1);case`TypeParametersOrArguments`:return this.match(44)}}tsParseList(e,t){let n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseDelimitedList(e,t,n){return Yb(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseDelimitedListWorker(e,t,n,r){let i=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let r=t();if(r==null)return;if(i.push(r),this.eat(8)){a=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(8);return}return r&&(r.value=a),i}tsParseBracketedList(e,t,n,r,i){r||(n?this.expect(0):this.expect(43));let a=this.tsParseDelimitedList(e,t,i);return n?this.expect(1):this.expect(44),a}tsParseImportType(){let e=this.startNode();return this.expect(79),this.expect(6),this.match(130)?e.source=this.parseStringLiteral(this.state.value):(this.raise(J.UnsupportedImportTypeArgument,this.state.startLoc),e.source=this.tsParseNonConditionalType()),e.options=this.eat(8)?this.tsParseImportTypeOptions():null,this.expect(7),this.eat(12)&&(e.qualifier=this.tsParseEntityName(3)),this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSImportType`)}tsParseImportTypeOptions(){let e=this.startNode();this.expect(2);let t=this.startNode();return this.isContextual(72)?(t.method=!1,t.key=this.parseIdentifier(!0),t.computed=!1,t.shorthand=!1):this.unexpected(null,72),this.expect(10),t.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(t)],this.eat(8),this.expect(4),this.finishNode(e,`ObjectExpression`)}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),t=[];for(this.expect(2);!this.match(4);){let e=this.state.type;Wv(e)||e===130?t.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(8)}return e.properties=t,this.next(),this.finishNode(e,`ObjectExpression`)}tsParseEntityName(e){let t;if(e&1&&this.match(74)){if(e&2)t=this.parseIdentifier(!0);else{let e=this.startNode();this.next(),t=this.finishNode(e,`ThisExpression`)}}else t=this.parseIdentifier(!!(e&1));for(;this.eat(12);){let n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdentifier(!!(e&1)),t=this.finishNode(n,`TSQualifiedName`)}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeReference`)}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,`TSTypePredicate`)}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,`TSThisType`)}tsParseTypeQuery(){let e=this.startNode();return this.expect(83),e.exprName=this.match(79)?this.tsParseImportType():this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeQuery`)}tsParseInOutModifiers=this.tsParseModifiers.bind(this,dx([`in`,`out`],[`const`,`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`]),J.InvalidModifierOnTypeParameter);tsParseConstModifier=this.tsParseModifiers.bind(this,dx([`const`],[`in`,`out`]),J.InvalidModifierOnTypeParameterPositions);tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,dx([`in`,`out`,`const`],[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`]),J.InvalidModifierOnTypeParameter);tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(77),t.default=this.tsEatThenParseType(25),this.finishNode(t,`TSTypeParameter`)}tsTryParseTypeParameters(e){if(this.match(43))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(43)||this.match(138)?this.next():this.unexpected();let n={value:-1};return t.params=this.tsParseBracketedList(`TypeParametersOrArguments`,this.tsParseTypeParameter.bind(this,e),!1,!0,n),t.params.length===0&&this.raise(J.EmptyTypeParameters,t),n.value!==-1&&this.addExtra(t,`trailingComma`,n.value),this.finishNode(t,`TSTypeParameterDeclaration`)}tsFillSignature(e,t){let n=e===15;t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),t.params=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t.returnType=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(7,41,2);for(let t of e){let{type:e}=t;(e===`AssignmentPattern`||e===`TSParameterProperty`)&&this.raise(J.UnsupportedSignatureParameterKind,t,{type:e})}return e}tsParseTypeMemberSemicolon(){!this.eat(8)&&!this.isLineTerminator()&&this.expect(9)}tsParseSignatureMember(e,t){return this.tsFillSignature(10,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),Wv(this.state.type)?(this.next(),this.match(10)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(1),e.parameters=[t];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSIndexSignature`)}tsParsePropertyOrMethodSignature(e,t){if(this.eat(13)&&(e.optional=!0),this.match(6)||this.match(43)){t&&this.raise(J.ReadonlyForMethodSignature,e);let n=e;if(n.kind&&this.match(43)&&this.raise(J.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,n),this.tsParseTypeMemberSemicolon(),n.kind===`get`)n.params.length>0&&(this.raise(K.BadGetterArity,this.state.curPosition()),this.isThisParam(n.params[0])&&this.raise(J.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind===`set`){if(n.params.length!==1)this.raise(K.BadSetterArity,this.state.curPosition());else{let e=n.params[0];this.isThisParam(e)&&this.raise(J.AccessorCannotDeclareThisParameter,this.state.curPosition()),e.type===`Identifier`&&e.optional&&this.raise(J.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),e.type===`RestElement`&&this.raise(J.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n.returnType&&this.raise(J.SetAccessorCannotHaveReturnType,n.returnType)}else n.kind=`method`;return this.finishNode(n,`TSMethodSignature`)}{let n=e;t&&(n.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(n.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(n,`TSPropertySignature`)}}tsParseTypeMember(){let e=this.startNode();if(this.match(6)||this.match(43))return this.tsParseSignatureMember(`TSCallSignatureDeclaration`,e);if(this.match(73)){let t=this.startNode();return this.next(),this.match(6)||this.match(43)?this.tsParseSignatureMember(`TSConstructSignatureDeclaration`,e):(e.key=this.createIdentifier(t,`new`),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers(nx,void 0,e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(6)&&!this.match(43)&&this.unexpected(null,6)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,`TSTypeLiteral`)}tsParseObjectTypeMembers(){this.expect(2);let e=this.tsParseList(`TypeMembers`,this.tsParseTypeMember.bind(this));return this.expect(4),e}tsIsStartOfMappedType(){return this.next(),this.eat(49)?this.isContextual(118):(this.isContextual(118)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(54)))}tsParseMappedType(){let e=this.startNode();return this.expect(2),this.match(49)?(e.readonly=this.state.value,this.next(),this.expectContextual(118)):this.eatContextual(118)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49)?(e.optional=this.state.value,this.next(),this.expect(13)):this.eat(13)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),this.finishNode(e,`TSMappedType`)}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList(`TupleElementTypes`,this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{let{type:n}=e;t&&n!==`TSRestType`&&n!==`TSOptionalType`&&!(n===`TSNamedTupleMember`&&e.optional)&&this.raise(J.OptionalTypeBeforeRequired,e),t||=n===`TSNamedTupleMember`&&e.optional||n===`TSOptionalType`}),this.finishNode(e,`TSTupleType`)}tsParseTupleElementType(){let e=this.state.startLoc,t=this.eat(17),{startLoc:n}=this.state,r,i,a,o,s=Kv(this.state.type)?this.lookaheadCharCode():null;if(s===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(10),o=this.tsParseType();else if(s===63){a=!0;let e=this.state.value,t=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(n),e),this.expect(13),this.expect(10),o=this.tsParseType()):(r=!1,o=t,this.expect(13))}else o=this.tsParseType(),a=this.eat(13),r=this.eat(10);if(r){let e;i?(e=this.startNodeAt(n),e.optional=a,e.label=i,e.elementType=o,this.eat(13)&&(e.optional=!0,this.raise(J.TupleOptionalAfterType,this.state.lastTokStartLoc))):(e=this.startNodeAt(n),e.optional=a,this.raise(J.InvalidTupleMemberLabel,o),e.label=o,e.elementType=this.tsParseType()),o=this.finishNode(e,`TSNamedTupleMember`)}else if(a){let e=this.startNodeAt(n);e.typeAnnotation=o,o=this.finishNode(e,`TSOptionalType`)}if(t){let t=this.startNodeAt(e);t.typeAnnotation=o,o=this.finishNode(t,`TSRestType`)}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(6),e.typeAnnotation=this.tsParseType(),this.expect(7),this.finishNode(e,`TSParenthesizedType`)}tsParseFunctionOrConstructorType(e,t){let n=this.startNode();return e===`TSConstructorType`&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(15,n)),this.finishNode(n,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,`TSLiteralType`)}tsParseTemplateLiteralType(){let e=this.state.startLoc,t=this.parseTemplateElement(!1),n=[t];if(t.tail){let t=this.startNodeAt(e),r=this.startNodeAt(e);return r.expressions=[],r.quasis=n,t.literal=this.finishNode(r,`TemplateLiteral`),this.finishNode(t,`TSLiteralType`)}{let r=[];for(;!t.tail;)r.push(this.tsParseType()),this.readTemplateContinuation(),n.push(t=this.parseTemplateElement(!1));let i=this.startNodeAt(e);return i.types=r,i.quasis=n,this.finishNode(i,`TSTemplateLiteralType`)}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(112)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value===`-`){let e=this.startNode(),t=this.lookahead();return t.type!==131&&t.type!==132&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,`TSLiteralType`)}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let e=this.state.startLoc;this.next();let t=this.tsParseType();return this.expect(7),this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),t}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(Wv(e)||e===84||e===80){let t=e===84?`TSVoidKeyword`:e===80?`TSNullKeyword`:Zb(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(1)){let n=this.startNodeAt(e);n.elementType=t,this.expect(1),t=this.finishNode(n,`TSArrayType`)}else{let n=this.startNodeAt(e);n.objectType=t,n.indexType=this.tsParseType(),this.expect(1),t=this.finishNode(n,`TSIndexedAccessType`)}return t}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t===`readonly`&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,`TSTypeOperator`)}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case`TSTupleType`:case`TSArrayType`:return;default:this.raise(J.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(111);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,`TSTypeParameter`),this.finishNode(e,`TSInferType`)}tsParseConstraintForInferType(){if(this.eat(77)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return e}}tsParseTypeOperatorOrHigher(){return ry(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,n){let r=this.startNode(),i=this.eat(n),a=[];do a.push(t());while(this.eat(n));return a.length===1&&!i?a[0]:(r.types=a,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSIntersectionType`,this.tsParseTypeOperatorOrHigher.bind(this),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSUnionType`,this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){return this.match(43)?!0:this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(Wv(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(4,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(1,93,1),e.length===t}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(7)||this.match(17)||this.tsSkipParameterStart()&&(this.match(10)||this.match(8)||this.match(13)||this.match(25)||this.match(7)&&(this.next(),this.match(15))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(74)){let e=this.tsParseThisTypeOrThisTypePredicate();return e.type===`TSThisType`?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,`TSTypePredicate`)):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,`TSTypeAnnotation`)}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return r?(n.parameterName=this.parseIdentifier(),n.asserts=r,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)):this.tsParseTypeAnnotation(!1,t);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=i,n.typeAnnotation=a,n.asserts=r,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let e=this.state.containsEsc;return this.next(),!Wv(this.state.type)&&!this.match(74)?!1:(e&&this.raise(K.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:`asserts`}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(10),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,`TSTypeAnnotation`)}tsParseType(){Xb(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,`TSConditionalType`)}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual(`new`)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType(`TSFunctionType`):this.match(73)?this.tsParseFunctionOrConstructorType(`TSConstructorType`):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType(`TSConstructorType`,!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(J.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),e.expression=this.parseMaybeUnary(),this.finishNode(e,`TSTypeAssertion`)}tsParseHeritageClause(e){let t=this.state.startLoc,n=this.tsParseDelimitedList(`HeritageClauseElement`,()=>{let t=(this.state.canStartArrow=!1,super.parseExprSubscripts());ex(t)||this.raise(J.InvalidHeritageClauseType,t.start,{token:e});let n=e===`extends`?`TSInterfaceHeritage`:`TSClassImplements`;if(t.type===`TSInstantiationExpression`)return t.type=n,t;let r=this.startNodeAtNode(t);return r.expression=t,(this.match(43)||this.match(47))&&(r.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(r,n)});return n.length||this.raise(J.EmptyHeritageClauseType,t,{token:e}),n}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),t.declare&&(e.declare=!0),Wv(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(J.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77)&&(e.extends=this.tsParseHeritageClause(`extends`));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,`TSInterfaceBody`),this.finishNode(e,`TSInterfaceDeclaration`)}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(25),this.isContextual(110)&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,`TSIntrinsicKeyword`)}return this.tsParseType()}),this.semicolon(),this.finishNode(e,`TSTypeAliasDeclaration`)}tsInTopLevelContext(e){if(this.curContext()!==dy.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,`TSEnumMember`)}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(122),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),e.body=this.tsParseEnumBody(),this.finishNode(e,`TSEnumDeclaration`)}tsParseEnumBody(){let e=this.startNode();return this.expect(2),e.members=this.tsParseDelimitedList(`EnumMembers`,this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(e,`TSEnumBody`)}tsParseModuleBlock(e){let t=this.startNode();return e||this.scope.enter(0),this.expect(2),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,4),e||this.scope.exit(),this.finishNode(t,`TSModuleBlock`)}tsParseNamespaceDeclaration(e){return e.id=this.tsParseEntityName(0),e.id.type===`Identifier`&&this.checkIdentifier(e.id,1024),this.scope.enter(2048),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`TSModuleDeclaration`)}tsParseAmbientExternalModuleDeclaration(e){let t=this.isContextual(108);if(t)e.kind=`global`,e.id=this.parseIdentifier();else{e.kind=`module`;let{type:t,value:n}=this.state;t===130?e.id=super.parseStringLiteral(n):Wv(t)?(this.raise(J.InlineModuleDeclarationMustUseString,this.state.startLoc),e.id=this.tsParseEntityName(0)):t===2?this.raise(J.EmptyNamespaceName,this.state.startLoc):(this.raise(J.InvalidNamespaceName,this.state.startLoc,n),e.id=super.parseExprAtom())}return this.match(2)?(t||this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(t),this.prodParam.exit(),t||this.scope.exit()):this.semicolon(),this.finishNode(e,`TSModuleDeclaration`)}tsParseImportEqualsDeclaration(e,t){e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(25);let n=this.tsParseModuleReference();return e.importKind===`type`&&n.type!==`TSExternalModuleReference`&&this.raise(J.ImportAliasHasImportType,n),e.moduleReference=n,this.semicolon(),this.finishNode(e,`TSImportEqualsDeclaration`)}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(115),this.expect(6),this.match(130)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(7),this.sawUnambiguousESM=!0,this.finishNode(e,`TSExternalModuleReference`)}tsLookAhead(e){let t=this.state.clone(),n=e();return this.state=t,n}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!t.aborted&&t.node)return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type;return this.tsInAmbientContext(()=>{switch(t){case 64:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 122:return this.tsParseEnumDeclaration(e,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(e);case 96:if(this.state.containsEsc)return;case 71:case 70:return!this.match(71)||!this.isLookaheadContextual(`enum`)?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(71),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 103:if(this.isUsing())return this.raise(J.InvalidModifierOnUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.parseVarStatement(e,`using`,!0);break;case 92:if(this.isAwaitUsing())return this.raise(J.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.next(),this.parseVarStatement(e,`await using`,!0);break;case 125:{let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}default:if(Wv(t))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,t,n,r){switch(t){case 120:if(this.tsCheckLineTerminator(n)&&(this.match(76)||Wv(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case 123:if(this.tsCheckLineTerminator(n))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 124:if(this.tsCheckLineTerminator(n)&&Wv(this.state.type))return e.kind=`namespace`,this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(n)&&Wv(this.state.type))return this.tsParseTypeAliasDeclaration(e)}}tsCheckLineTerminator(e){return e?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(43))return;let t=this.tsTryParseAndCatch(()=>{let t=this.startNodeAt(e);return t.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(t),t.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),t});if(t)return super.parseArrowExpression(t,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===43)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList(`TypeParametersOrArguments`,this.tsParseType.bind(this))))),e.params.length===0?this.raise(J.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===dy.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TSTypeParameterInstantiation`)}tsIsDeclarationStart(){return iy(this.state.type)}isExportDefaultSpecifier(){return!this.tsIsDeclarationStart()&&super.isExportDefaultSpecifier()}parseBindingElement(e,t){let n=t.length?null:this.state.startLoc,r={};this.tsParseModifiers(rx,void 0,r);let i=r.accessibility,a=r.override,o=r.readonly;!(e&4)&&(i||o||a)&&this.raise(J.UnexpectedParameterModifier,n||t[0]);let s=this.state.startLoc,c=this.parseMaybeDefault(s);e&2&&this.parseFunctionParamType(c);let l=this.parseMaybeDefault(s,c);if(i||o||a){let e=n?this.startNodeAt(n):this.startNodeAtNode(t[0]);return t.length?e.decorators=t:this.setLoc(n),i&&(e.accessibility=i),o&&(e.readonly=o),a&&(e.override=a),l.type!==`Identifier`&&l.type!==`AssignmentPattern`&&this.raise(J.UnsupportedParameterPropertyKind,n||t[0]),e.parameter=l,this.finishNode(e,`TSParameterProperty`)}return t.length&&(c.decorators=t),l}isSimpleParameter(e){return e.type===`TSParameterProperty`&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!==`Identifier`&&t.optional&&!this.state.isAmbientContext&&this.raise(J.PatternIsOptional,t)}setArrowFunctionParameters(e,t,n){super.setArrowFunctionParameters(e,t,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,n=!1){this.match(10)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(10));let r=t===`FunctionDeclaration`?`TSDeclareFunction`:t===`ClassMethod`||t===`ClassPrivateMethod`?`TSDeclareMethod`:void 0;if(r&&!this.match(2)&&this.isLineTerminator()){if(r===`TSDeclareMethod`&&e.kind===`constructor`)for(let t of e.params)t.type===`TSParameterProperty`?this.raise(J.UnexpectedParameterModifier,t):t.type===`AssignmentPattern`&&this.raise(J.UnexpectedParameterInitializer,t);else for(let t of e.params)t.type===`AssignmentPattern`&&this.raise(J.UnexpectedParameterInitializer,t);return this.finishNode(e,r)}return r&&this.state.isAmbientContext&&(this.raise(J.DeclareFunctionHasImplementation,this.state.startLoc),r===`TSDeclareFunction`&&e.declare)?super.parseFunctionBodyAndFinish(e,r,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{e?.type===`TSTypeCastExpression`&&this.raise(J.UnexpectedTypeAnnotation,e.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,t,n,r){if(!this.hasPrecedingLineBreak()&&this.match(31)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(t);return n.expression=e,this.finishNode(n,`TSNonNullExpression`)}let i=!1;if(this.match(14)&&this.lookaheadCharCode()===60){if(n)return r.stop=!0,e;r.optionalChainMember=i=!0,this.next()}if(this.match(43)||this.match(47)){let a,o=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){let e=this.tsTryParseGenericAsyncArrowFunction(t);if(e)return r.stop=!0,e}let o=this.tsParseTypeArgumentsInExpression();if(!o)return;if(i&&!this.match(6)){a=this.state.curPosition();return}if(cy(this.state.type)){let n=super.parseTaggedTemplateExpression(e,t,r);return n.typeArguments=o,n}if(!n&&this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(n.arguments),n.typeArguments=o,r.optionalChainMember&&(n.optional=i),this.finishCallExpression(n,r.optionalChainMember)}let s=this.state.type;if(s===44||s===48||s!==6&&s!==89&&s!==116&&Yv(s)&&!this.hasPrecedingLineBreak())return;let c=this.startNodeAt(t);return c.expression=e,c.typeArguments=o,this.finishNode(c,`TSInstantiationExpression`)});if(a&&this.unexpected(a,6),o)return o.type===`TSInstantiationExpression`&&((this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)&&this.raise(J.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(12)&&!this.match(14)&&(o.expression=super.stopParseSubscript(e,r))),o}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let{callee:t}=e;t.type===`TSInstantiationExpression`&&!t.extra?.parenthesized&&(e.typeArguments=t.typeArguments,e.callee=t.expression)}parseExprOp(e,t,n){let r;if(oy(54)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(r=this.isContextual(116)))){let i=this.startNodeAt(t);i.expression=e,i.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(r&&this.raise(K.UnexpectedKeyword,this.state.startLoc,{keyword:`const`}),this.tsParseTypeReference()):this.tsParseType()));let a=this.finishNode(i,r?`TSSatisfiesExpression`:`TSAsExpression`);return this.reScan_lt_gt(),this.parseExprOp(a,t,n)}return super.parseExprOp(e,t,n)}checkReservedWord(e,t,n,r){this.state.isAmbientContext||super.checkReservedWord(e,t,n,r)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){super.applyImportPhase(e,t,n,r),t?e.exportKind=n===`type`?`type`:`value`:e.importKind=n===`type`||n===`typeof`?n:`value`}parseImport(e){if(this.match(130))return e.importKind=`value`,this.scope.inTSNamespace&&this.raise(J.ImportInTSNamespace,e),super.parseImport(e);let t;if(Wv(this.state.type)&&this.lookaheadCharCode()===61){e.importKind=`value`;let t=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&t.moduleReference.type===`TSExternalModuleReference`&&this.raise(J.ImportInTSNamespace,e),t}if(this.isContextual(126)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(J.ImportInTSNamespace,e),this.tsParseImportEqualsDeclaration(e,n);t=super.parseImportSpecifiersAndAfter(e,n)}else t=super.parseImport(e);return t.importKind===`type`&&t.specifiers.length>1&&t.specifiers[0].type===`ImportDefaultSpecifier`?this.raise(J.TypeImportCannotSpecifyDefaultAndNamed,t):this.scope.inTSNamespace&&this.raise(J.ImportInTSNamespace,t),t}parseExport(e,t){if(this.match(79)){let t=this.startNode();this.next();let n=null;this.isContextual(126)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(t,!1):t.importKind=`value`;let r=this.tsParseImportEqualsDeclaration(t,n);return e.attributes=[],e.declaration=r,e.exportKind=`value`,e.source=null,e.specifiers=[],this.finishNode(e,`ExportNamedDeclaration`)}if(this.eat(25)){let t=e;return t.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace&&this.raise(J.ExportAssignmentInTSNamespace,t),this.finishNode(t,`TSExportAssignment`)}if(this.eatContextual(89)){let t=e;return this.expectContextual(124),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(J.NamespaceExportInTSNamespace,t),this.finishNode(t,`TSNamespaceExportDeclaration`)}{let n=super.parseExport(e,t);return this.scope.inTSNamespace&&(n.type!==`ExportNamedDeclaration`||n.source||!n.declaration&&!this.state.isAmbientContext)&&this.raise(J.ExportInTSNamespace,n),n}}isAbstractClass(){return this.isContextual(120)&&this.isLookaheadContextual(`class`)}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(125)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,n=!1){let{isAmbientContext:r}=this.state,i=super.parseVarStatement(e,t,n||r);if(r&&!e.declare&&(t===`using`||t===`await using`))return this.raiseOverwrite(J.UsingDeclarationInAmbientContext,e,t),i;for(let e of i.declarations){let{id:n,init:i,definite:a}=e;a&&(i?this.raise(J.DeclaratorDefiniteAssertionWithInitializer,n):n.typeAnnotation||this.raise(J.DeclaratorDefiniteAssertionRequiresTypeAnnotation,n)),r&&i&&(t===`var`||t===`let`||n.typeAnnotation?this.raise(J.InitializerNotAllowedInAmbientContext,i):sx(i,this.hasPlugin(`estree`))||this.raise(J.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,i))}return i}parseStatementContent(e,t){let n=!!(e&2);if(!this.state.containsEsc)switch(this.state.type){case 71:if(this.isLookaheadContextual(`enum`)){let e=this.startNode();return this.next(),this.tsParseEnumDeclaration(e,{const:!0})}break;case 120:case 121:if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let e=this.state.type,n=this.startNode();this.next();let r=e===121?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,t);return r?(e===121&&(r.declare=!0),r):(n.expression=this.createIdentifier(this.startNodeAtNode(n),e===121?`declare`:`abstract`),this.semicolon(!1),this.finishNode(n,`ExpressionStatement`))}break;case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:if(this.lookaheadCharCode()===123){let e=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(e)}break;case 125:{let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return n||this.raise(J.UnexpectedTypeDeclaration,e,`interface`),e;break}case 123:if(this.nextTokenIsStringLiteralOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,123,!1,t)}if(this.nextTokenIsIdentifierOnSameLine()){this.raise(J.InlineModuleDeclarationMustUseString,this.state.startLoc);let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 124:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 126:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return n||this.raise(J.UnexpectedTypeDeclaration,e,`type`),this.next(),this.tsParseTypeAliasDeclaration(e)}}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(ix)}tsHasSomeModifiers(e,t){return t.some(t=>Qb(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(e,t,n){this.tsParseModifiers(tx,J.InvalidModifierOnTypeParameterPositions,t,!0);let r=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,[`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`])&&this.raise(J.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,n,!!t.static)};t.declare?this.tsInAmbientContext(r):r(),t.decorators&&t.decorators.length>0&&!this.hasPlugin(`decorators-legacy`)&&(t.type===`TSAbstractMethodDefinition`||t.type===`TSDeclareMethod`?this.raise(J.DecoratorAbstractMethod,t,{kind:`abstract method`}):(t.type===`ClassProperty`&&t.abstract||t.type===`ClassProperty`&&t.declare||t.type===`TSAbstractPropertyDefinition`||t.type===`PropertyDefinition`&&t.declare)&&this.raise(J.DecoratorAbstractMethod,t,{kind:t.declare?`declare field`:`abstract field`}))}parseClassMemberWithIsStatic(e,t,n,r){let i=this.tsTryParseIndexSignature(t);if(i){e.body.push(i),t.abstract&&this.raise(J.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(J.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(J.IndexSignatureHasDeclare,t),t.override&&this.raise(J.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(J.NonAbstractClassHasAbstractMethod,t),t.override&&(n.hadSuperClass||this.raise(J.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,n,r)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(J.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(J.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.next();let r=this.startNodeAt(t);r.test=e;let i=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,r.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=i,this.expect(10),r.alternate=this.parseMaybeAssign(),this.finishNode(r,`ConditionalExpression`)}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let n=this.startNodeAt(t);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,`TSTypeCastExpression`)}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,n=this.eatContextual(121);if(n&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(J.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let r=Wv(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return r?((r.type===`TSInterfaceDeclaration`||r.type===`TSTypeAliasDeclaration`||n)&&(e.exportKind=`type`),n&&r.type!==`TSImportEqualsDeclaration`&&(this.resetStartLocation(r,t),r.declare=!0),r):null}parseClassId(e,t,n,r){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n,e.declare?1024:8331);let i=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);i&&(e.typeParameters=i)}parseClassPropertyAnnotation(e){e.optional||(this.eat(31)?e.definite=!0:this.eat(13)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t),e.definite&&(this.match(25)?this.raise(J.DeclaratorDefiniteAssertionWithInitializer,e):t||this.raise(J.DeclaratorDefiniteAssertionRequiresTypeAnnotation,e))}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&(!e.readonly||e.typeAnnotation)&&this.match(25)&&this.raise(J.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:t}=e;this.raise(J.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type===`Identifier`&&!e.computed?t.name:`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(J.PrivateElementHasAbstract,e),e.accessibility&&this.raise(J.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(J.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,n,r,i,a){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&i&&this.raise(J.ConstructorHasTypeParameters,o);let{declare:s=!1,kind:c}=t;s&&(c===`get`||c===`set`)&&this.raise(J.DeclareAccessor,t,{kind:c}),o&&(t.typeParameters=o),super.pushClassMethod(e,t,n,r,i,a)}pushClassPrivateMethod(e,t,n,r){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(t.typeParameters=i),super.pushClassPrivateMethod(e,t,n,r)}declareClassPrivateMethodInScope(e,t){e.type!==`TSDeclareMethod`&&(e.type!==`MethodDefinition`||e.value.body!=null)&&super.declareClassPrivateMethodInScope(e,t)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass){if(e.superClass.type===`TSInstantiationExpression`){let t=e.superClass,n=t.expression;this.takeSurroundingComments(n,n.start,n.end);let r=t.typeArguments;this.takeSurroundingComments(r,r.start,r.end),e.superClass=n,e.superTypeArguments=r}else(this.match(43)||this.match(47))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression())}this.eatContextual(109)&&(e.implements=this.tsParseHeritageClause(`implements`))}parseObjPropValue(e,t,n,r,i,a,o){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);return s&&(e.typeParameters=s),super.parseObjPropValue(e,t,n,r,i,a,o)}parseFunctionParams(e,t){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type===`Identifier`&&!this.hasPrecedingLineBreak()&&this.eat(31)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(10)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){let n,r,i;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===dy.j_oTag||a===dy.j_expr)&&i.pop()}if(!r?.error&&!this.match(43))return super.parseMaybeAssign(e,t);(!n||n===this.state)&&(n=this.state.clone());let a,o=this.tryParse(n=>{a=this.tsParseTypeParameters(this.tsParseConstModifier);let r=super.parseMaybeAssign(e,t);if((r.type!==`ArrowFunctionExpression`||r.extra?.parenthesized)&&n(),a?.params.length!==0&&this.resetStartLocationFromNode(r,a),r.typeParameters=a,this.hasPlugin(`jsx`)&&r.typeParameters.params.length===1&&!r.typeParameters.extra?.trailingComma){let e=r.typeParameters.params[0];e.constraint||this.raise(J.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?sv(e.loc.end,1):e,{typeParameterName:e.name.name})}return r},n);if(!o.error&&!o.aborted)return a&&this.reportReservedArrowTypeParam(a),o.node;if(!r&&(Xb(!this.hasPlugin(`jsx`)),i=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!i.error))return i.node;if(r?.node)return this.state=r.failState,r.node;if(o.node)return this.state=o.failState,a&&this.reportReservedArrowTypeParam(a),o.node;if(i?.node)return this.state=i.failState,i.node;throw r?.error||o.error||i?.error}reportReservedArrowTypeParam(e){e.params.length===1&&!e.params[0].constraint&&!e.extra?.trailingComma&&this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(J.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin(`jsx`)&&this.match(43)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(10);return(this.canInsertSemicolon()||!this.match(15))&&e(),t});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(13)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case`TSTypeCastExpression`:return this.isAssignable(e.expression,t);case`TSParameterProperty`:return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case`ParenthesizedExpression`:this.toAssignableParenthesizedExpression(e,t);break;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:t?this.expressionScope.recordArrowParameterBindingError(J.UnexpectedTypeCastInParameter,e):this.raise(J.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case`AssignmentExpression`:!t&&e.left.type===`TSTypeCastExpression`&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:case`ParenthesizedExpression`:this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,n,r){switch(e){case`TSTypeCastExpression`:return!0;case`TSParameterProperty`:return`parameter`;case`TSNonNullExpression`:return`expression`;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:return(r!==64||!n)&&[`expression`,!0];default:return super.isValidLVal(e,t,n,r)}}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,t){if(this.match(43)||this.match(47)){let n=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let r=super.parseMaybeDecoratorArguments(e,t);return r.typeArguments=n,r}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(e,t)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||super.isClassProperty()}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(J.TypeAnnotationAfterAssign,n.typeAnnotation),n}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(44,1);return}if(e===60){this.finishOp(43,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}toAssignableListItem(e,t,n){let r=e[t];r.type===`TSTypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}shouldParseArrow(e){return this.match(10)?e.every(e=>this.isAssignable(e,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(10)?!this.state.inConditionalConsequent:super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(e){let t=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let n=super.parseParenAndDistinguishExpression(e);return this.state.inConditionalConsequent=t,n}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(43)||this.match(47)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeArguments=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=n}}parseClass(e,t,n){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,n)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,t){if(this.match(76))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(125))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(J.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,76)}parseMethod(e,t,n,r,i,a,o){let s=super.parseMethod(e,t,n,r,i,a,o);if((s.abstract||s.type===`TSAbstractMethodDefinition`)&&(this.hasPlugin(`estree`)?s.value:s).body){let{key:e}=s;this.raise(J.AbstractMethodHasImplementation,s,{methodName:e.type===`Identifier`&&!s.computed?e.name:`[${this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end))}]`})}return s}tsParseTypeParameterName(){return this.parseIdentifier()}shouldParseAsAmbientContext(){return!!this.getPluginOption(`typescript`,`dts`)}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,t,n,r){return!t&&r?(this.parseTypeOnlyExportSpecifier(e,n),this.finishNode(e,`ExportSpecifier`)):(e.exportKind=`value`,super.parseExportSpecifier(e,t,n,r))}parseImportSpecifier(e,t,n,r,i){return!t&&r?(this.parseTypeOnlyImportSpecifier(e,n),this.finishNode(e,`ImportSpecifier`)):(e.importKind=`value`,super.parseImportSpecifier(e,t,n,r,n?4098:4096))}parseTypeOnlyImportSpecifier(e,t){let n=e.imported,r=!1;if(this.isContextual(89)){let t=this.parseIdentifier();if(this.isContextual(89)){let i=this.parseIdentifier();Kv(this.state.type)?(r=!0,n=t,e.local=this.parseIdentifier()):e.local=i}else Kv(this.state.type)?e.local=this.parseIdentifier():(r=!0,n=t)}else Kv(this.state.type)&&(r=!0,n=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(n.name,n.start,!0,!0));r&&t&&this.raise(J.TypeModifierIsUsedInTypeImports,e.imported),e.imported=n,e.importKind=r?`type`:`value`,this.checkIdentifier(e.local??=this.eatContextual(89)?this.parseIdentifier():this.cloneIdentifier(e.imported),r?4098:4096)}parseTypeOnlyExportSpecifier(e,t){let n=e.local,r=!1;if(this.isContextual(89)){let t=this.parseIdentifier();if(this.isContextual(89)){let n=this.parseIdentifier();Kv(this.state.type)?(r=!0,e.local=t,e.exported=this.parseModuleExportName()):e.exported=n}else Kv(this.state.type)?e.exported=this.parseModuleExportName():(r=!0,e.local=t)}else Kv(this.state.type)&&(r=!0,e.local=this.parseModuleExportName());r&&t&&this.raise(J.TypeModifierIsUsedInTypeExports,n),e.exportKind=r?`type`:`value`,e.exported??=this.eatContextual(89)?this.parseModuleExportName():this.cloneIdentifier(e.local)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case`ImportDeclaration`:e.phase??=null;return;case`ExpressionStatement`:e.directive??=void 0;return;case`RestElement`:e.value=void 0;case`Identifier`:case`ArrayPattern`:case`AssignmentPattern`:case`ObjectPattern`:e.decorators??=[],e.optional??=!1,e.typeAnnotation??=void 0;return;case`TSParameterProperty`:e.accessibility??=void 0,e.decorators??=[],e.override??=!1,e.readonly??=!1,e.static??=!1;return;case`TSEmptyBodyFunctionExpression`:e.body=null;case`TSDeclareFunction`:case`FunctionDeclaration`:case`FunctionExpression`:case`ClassMethod`:case`ClassPrivateMethod`:e.declare??=!1,e.returnType??=void 0,e.typeParameters??=void 0;return;case`Property`:e.optional??=!1;return;case`TSMethodSignature`:case`TSPropertySignature`:e.optional??=!1;case`TSIndexSignature`:e.accessibility??=void 0,e.readonly??=!1,e.static??=!1;return;case`TSAbstractPropertyDefinition`:case`PropertyDefinition`:case`TSAbstractAccessorProperty`:case`AccessorProperty`:e.declare??=!1,e.definite??=!1,e.readonly??=!1,e.typeAnnotation??=void 0;case`TSAbstractMethodDefinition`:case`MethodDefinition`:e.accessibility??=void 0,e.decorators??=[],e.override??=!1,e.optional??=!1;return;case`ClassExpression`:e.id??=null;case`ClassDeclaration`:e.abstract??=!1,e.declare??=!1,e.decorators??=[],e.implements??=[],e.superTypeArguments??=void 0,e.typeParameters??=void 0;return;case`TSTypeAliasDeclaration`:case`VariableDeclaration`:e.declare??=!1;return;case`VariableDeclarator`:e.definite??=!1;return;case`TSEnumDeclaration`:e.const??=!1,e.declare??=!1;return;case`TSEnumMember`:e.computed??=!1;return;case`TSImportType`:e.qualifier??=null,e.options??=null,e.typeArguments??=null;return;case`TSInterfaceDeclaration`:e.declare??=!1,e.extends??=[];return;case`TSMappedType`:e.optional??=!1,e.readonly??=void 0;return;case`TSModuleDeclaration`:e.declare??=!1,e.global??=e.kind===`global`;return;case`TSTypeParameter`:e.const??=!1,e.in??=!1,e.out??=!1;return}}chStartsBindingIdentifierAndNotRelationalOperator(e,t){if(_y(e)){if(Jb.lastIndex=t,Jb.test(this.input)){let e=this.codePointAtPos(Jb.lastIndex);if(!vy(e)&&e!==92)return!1}return!0}return e===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(t,e)}nextTokenIsStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===34||t===39}};function ox(e){if(e.type!==`MemberExpression`)return!1;let{computed:t,property:n}=e;return t&&n.type!==`StringLiteral`&&(n.type!==`TemplateLiteral`||n.expressions.length>0)?!1:ux(e.object)}function sx(e,t){let{type:n}=e;if(e.extra?.parenthesized)return!1;if(t){if(n===`Literal`){let{value:t}=e;if(typeof t==`string`||typeof t==`boolean`)return!0}}else if(n===`StringLiteral`||n===`BooleanLiteral`)return!0;return!!(cx(e,t)||lx(e,t)||n===`TemplateLiteral`&&e.expressions.length===0||ox(e))}function cx(e,t){return t?e.type===`Literal`&&(typeof e.value==`number`||`bigint`in e):e.type===`NumericLiteral`||e.type===`BigIntLiteral`}function lx(e,t){if(e.type===`UnaryExpression`){let{operator:n,argument:r}=e;if(n===`-`&&cx(r,t))return!0}return!1}function ux(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:ux(e.object)}function dx(e,t=[]){let n=new Map;for(let t of e)n.set(t,!0);for(let e of t)n.set(e,!1);return n}var fx=bv`placeholders`({ClassNameIsRequired:`A class name is required.`,UnexpectedSpace:`Unexpected space in placeholder.`}),px=e=>class extends e{parsePlaceholder(e){if(this.match(129)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,`Placeholder`)),n.expectedNode=t,n}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(129,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder(`Expression`)||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder(`Identifier`)||super.parseIdentifier(e)}checkReservedWord(e,t,n,r){e!==void 0&&super.checkReservedWord(e,t,n,r)}cloneIdentifier(e){let t=super.cloneIdentifier(e);return t.type===`Placeholder`&&(t.expectedNode=e.expectedNode),t}cloneStringLiteral(e){return e.type===`Placeholder`?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder(`Pattern`)||super.parseBindingAtom()}isValidLVal(e,t,n,r){return e===`Placeholder`||super.isValidLVal(e,t,n,r)}toAssignable(e,t){e&&e.type===`Placeholder`&&e.expectedNode===`Expression`?e.expectedNode=`Pattern`:super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){if(super.chStartsBindingIdentifier(e,t))return!0;let n=this.nextTokenStart();return this.input.charCodeAt(n)===37&&this.input.charCodeAt(n+1)===37}verifyBreakContinue(e,t){e.label?.type!==`Placeholder`&&super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){if(t.type!==`Placeholder`||t.extra?.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(10)){let n=e;return n.label=this.finishPlaceholder(t,`Identifier`),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,`LabeledStatement`)}this.semicolon();let n=e;return n.name=t.name,this.finishPlaceholder(n,`Statement`)}parseBlock(e,t,n){return this.parsePlaceholder(`BlockStatement`)||super.parseBlock(e,t,n)}parseFunctionId(e){return this.parsePlaceholder(`Identifier`)||super.parseFunctionId(e)}parseClass(e,t,n){let r=t?`ClassDeclaration`:`ClassExpression`;this.next();let i=this.state.strict,a=this.parsePlaceholder(`Identifier`);if(a){if(this.match(77)||this.match(129)||this.match(2))e.id=a;else if(n||!t)return e.id=null,e.body=this.finishPlaceholder(a,`ClassBody`),this.finishNode(e,r);else throw this.raise(fx.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,t,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder(`ClassBody`)||super.parseClassBody(!!e.superClass,i),this.finishNode(e,r)}parseExport(e,t){let n=this.parsePlaceholder(`Identifier`);if(!n)return super.parseExport(e,t);let r=e;if(!this.isContextual(94)&&!this.match(8))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(n,`Declaration`),this.finishNode(r,`ExportNamedDeclaration`);this.expectPlugin(`exportDefaultFrom`);let i=this.startNode();return i.exported=n,r.specifiers=[this.finishNode(i,`ExportDefaultSpecifier`)],super.parseExport(r,t)}isExportDefaultSpecifier(){if(this.match(61)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,`from`)&&this.input.startsWith(ay(129),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){return e.specifiers?.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkNamedExport(){}parseImport(e){let t=this.parsePlaceholder(`Identifier`);if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(94)&&!this.match(8))return e.source=this.finishPlaceholder(t,`StringLiteral`),this.semicolon(),this.finishNode(e,`ImportDeclaration`);let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishNode(n,`ImportDefaultSpecifier`)),this.eat(8)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(94),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.parsePlaceholder(`StringLiteral`)||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(fx.UnexpectedSpace,this.state.lastTokEndLoc)}},mx=e=>class extends e{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,t=this.startNode();if(this.next(),Wv(this.state.type)){let e=this.parseIdentifierName(),n=this.createIdentifier(t,e);if(this.castNodeTo(n,`V8IntrinsicIdentifier`),this.match(6))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},hx=[`fsharp`,`hack`],gx=[`^^`,`@@`,`^`,`%`,`#`];function _x(e){if(e.has(`decorators`)&&e.has(`decorators-legacy`))throw Error(`Cannot use the decorators and decorators-legacy plugin together`);if(e.has(`flow`)&&e.has(`typescript`))throw Error(`Cannot combine flow and typescript plugins.`);if(e.has(`placeholders`)&&e.has(`v8intrinsic`))throw Error(`Cannot combine placeholders and v8intrinsic plugins.`);if(e.has(`pipelineOperator`)){let t=e.get(`pipelineOperator`).proposal;if(!hx.includes(t)){let e=hx.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}if(t===`hack`){if(e.has(`placeholders`))throw Error(`Cannot combine placeholders plugin and Hack-style pipes.`);if(e.has(`v8intrinsic`))throw Error(`Cannot combine v8intrinsic plugin and Hack-style pipes.`);let t=e.get(`pipelineOperator`).topicToken;if(!gx.includes(t)){let e=gx.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`)}}}if(e.has(`moduleAttributes`))throw Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.");if(e.has(`importAssertions`))throw Error("`importAssertions` has been removed in Babel 8, please use import attributes instead.");if(e.has(`deprecatedImportAssert`)?console.warn("`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead."):e.has(`importAttributes`)&&e.get(`importAttributes`).deprecatedAssertSyntax&&console.warn("The 'importAttributes' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`."),e.has(`recordAndTuple`))throw Error(`The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`asyncDoExpressions`)&&!e.has(`doExpressions`)){let e=Error(`'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.`);throw e.missingPlugins=`doExpressions`,e}if(e.has(`optionalChainingAssign`)&&e.get(`optionalChainingAssign`).version!==`2023-07`)throw Error(`The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.`);if(e.has(`discardBinding`)&&e.get(`discardBinding`).syntaxType!==`void`)throw Error(`The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.`);if(e.has(`decimal`))throw Error(`The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`importReflection`))throw Error(`The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.`)}var vx={estree:wv,jsx:$y,flow:Hy,typescript:ax,v8intrinsic:mx,placeholders:px},yx=Object.keys(vx),bx=class extends qb{constructor(e,t,n){let r=Sv(e);super(r,t),this.options=r,this.initializeScopes(),this.plugins=n,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let i=0;r.allowAwaitOutsideFunction&&(i|=1),r.allowReturnOutsideFunction&&(i|=2),r.allowImportExportEverywhere&&(i|=8),r.allowSuperOutsideMethod&&(i|=16),r.allowUndeclaredExports&&(i|=64),r.allowNewTargetOutsideFunction&&(i|=4),r.allowYieldOutsideFunction&&(i|=32),r.ranges&&(i|=128),r.locations===!0&&(i|=256),r.tokens&&(i|=512),r.createImportExpressions&&(i|=1024),r.createParenthesizedExpressions&&(i|=2048),r.errorRecovery&&(i|=4096),r.attachComment&&(i|=8192),r.annexB&&(i|=16384),this.optionFlags=i}getScopeHandler(){return My}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=[];let n=this.parseTopLevel(e,t);return n.errors=this.state.errors,n.comments.length=this.state.commentsLen,n}};function xx(e,t){if(t?.sourceType===`unambiguous`){t={...t};try{t.sourceType=`module`;let n=Cx(t,e),r=n.parse();if(n.sawUnambiguousESM)return r;if(n.ambiguousScriptDifferentAst)try{return t.sourceType=`script`,Cx(t,e).parse()}catch{}else r.program.sourceType=`script`;return r}catch(n){try{return t.sourceType=`script`,Cx(t,e).parse()}catch{}throw n}}return Cx(t,e).parse()}function Sx(e){let t={};for(let n of Object.keys(e))t[n]=ly(e[n]);return t}Sx(Uv);function Cx(e,t){let n=bx,r=new Map;if(e?.plugins){for(let t of e.plugins){let e,n;typeof t==`string`?e=t:[e,n]=t,r.has(e)||r.set(e,n||{})}_x(r),n=Tx(r)}return new n(e,t,r)}var wx=new Map;function Tx(e){let t=[];for(let n of yx)e.has(n)&&t.push(n);let n=t.join(`|`),r=wx.get(n);if(!r){r=bx;for(let e of t)r=vx[e](r);wx.set(n,r)}return r}var Ex=class{items=[];locate(e,t){let n=e.position(t.start);return{fileName:e.path,lineNumber:n.line,columnNumber:n.column}}add(e,t,n,r,i,a=`error`){this.items.push({code:n,severity:a,message:r,...i===void 0?{}:{fix:i},origins:[this.locate(e,t)]})}get blocking(){return this.items.some(e=>e.severity===`error`)}},Dx=e=>{let t=0,n=e.flatMap(e=>{let n=t;return t+=e.rules.length+1,e.rules.map(e=>({...e,order:n+e.order}))}),r={},i=[],a=new Map,o=e.flatMap(e=>e.diagnostics);for(let t of e){Object.assign(r,t.variables),i.push(...t.headAtRules);for(let e of t.fontFaces)a.set(e.css,e)}return{rules:n,headAtRules:i,fontFaces:[...a.values()],variables:r,diagnostics:o}},Ox=e=>Rm(e)&&typeof e.type==`string`&&typeof e.start==`number`&&typeof e.end==`number`,Y=(e,t)=>{let n=e[t];return Ox(n)?n:void 0},kx=(e,t)=>{let n=e[t];return Array.isArray(n)?n.filter(Ox):[]},X=(e,t)=>{let n=e[t];return typeof n==`string`?n:void 0},Ax=e=>{if(e!==void 0){if(e.type===`Identifier`)return X(e,`name`);if(e.type===`StringLiteral`)return X(e,`value`)}},jx=e=>{let t=e;for(;;){if(t.type===`ParenthesizedExpression`||t.type===`TSAsExpression`||t.type===`TSSatisfiesExpression`||t.type===`TSNonNullExpression`||t.type===`TSTypeAssertion`||t.type===`TypeCastExpression`){let e=Y(t,`expression`);if(e===void 0)return t;t=e;continue}return t}},Mx=class extends Error{path;line;column;constructor(e,t,n,r){super(t),this.name=`SourceSyntaxError`,this.path=e,this.line=n,this.column=r}},Nx=(e,t)=>{let n=Bm(t),r=e=>Vm(n,e),i;try{i=xx(t,{plugins:[`typescript`,`jsx`],sourceType:`module`}).program}catch(t){let n=Rm(t)&&Rm(t.loc)?t.loc:void 0,r=typeof n?.line==`number`?n.line:1,i=typeof n?.column==`number`?n.column+1:1;throw new Mx(e,t instanceof Error?t.message.replace(/\s*\(\d+:\d+\)\s*$/,``):``,r,i)}if(!Ox(i))throw new Mx(e,`The file did not parse to a program.`,1,1);return{path:e,source:t,program:i,position:r}},Px=(e,t)=>e===``?t:`${e}.${t}`,Fx=e=>{switch(e.k){case`path`:return e.path===``?void 0:{bind:e.path};case`value`:return e.value;default:return}},Ix=e=>e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`,Lx=e=>typeof e!=`object`||!e||!(`el`in e||`each`in e||`raw`in e||`preheader`in e||`if`in e&&Array.isArray(e.then)),Rx=e=>typeof e==`object`&&!!e&&`concat`in e,zx=e=>{let t=[],n=[],r=``,i=e=>{if(e===null||typeof e==`boolean`)return;if(typeof e==`string`){r+=e;return}if(typeof e==`number`){r+=String(e);return}if(typeof e==`object`&&Rx(e)){for(let t of e.concat)i(t);return}if(typeof e==`object`&&(`el`in e||`each`in e||`raw`in e))throw TypeError(`A WhatsApp text part holds text and values only.`);if(typeof e==`object`&&`if`in e&&Array.isArray(e.then))throw TypeError(`A WhatsApp text part cannot branch.`);let a=e,o=JSON.stringify(a),s=n.indexOf(o);s<0&&(s=n.length,n.push(o),t.push(a)),r+=`{{${s+1}}}`};for(let t of e)i(t);return{template:r,params:t}},Bx=(e,t,n)=>{if(Math.abs(e.length-t.length)>n)return n+1;let r=Array.from({length:t.length+1},(e,t)=>t);for(let n=1;n<=e.length;n++){let i=[n];for(let a=1;a<=t.length;a++)i[a]=Math.min(i[a-1]+1,r[a]+1,r[a-1]+(e[n-1]===t[a-1]?0:1));r=i}return r[t.length]},Vx=(e,t)=>{let n=e.toLowerCase(),r=t.find(e=>e.toLowerCase()===n);if(r!==void 0&&r!==e)return r;let i=Math.max(1,Math.min(3,Math.floor(e.length/3))),a,o=i+1;for(let e of t){let t=Bx(n,e.toLowerCase(),i);t<o&&(a=e,o=t)}return a},Hx=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ux=(e,t,n=0)=>{let r=t.$ref;if(typeof r!=`string`||n>16)return t;if(r===`#`)return e;let i=e;for(let e of r.replace(/^#\//,``).split(`/`)){if(!Hx(i))return t;i=i[e.replace(/~1/g,`/`).replace(/~0/g,`~`)]}return Hx(i)?Ux(e,i,n+1):t},Wx=(e,t)=>{let n=Ux(e,t);return[n,...[n.anyOf,n.oneOf,n.allOf].flatMap(t=>Array.isArray(t)?t.filter(Hx).flatMap(t=>Wx(e,t)):[])]},Gx=(e,t)=>{if(t===void 0)return`unknown`;let n=new Set;for(let r of Wx(e,t)){let e=r.type;if(typeof e==`string`)n.add(e);else if(Array.isArray(e))for(let t of e)typeof t==`string`&&n.add(t);if(r.const!==void 0&&n.add(typeof r.const),Array.isArray(r.enum))for(let e of r.enum)n.add(typeof e)}if(n.delete(`null`),n.size!==1)return`unknown`;let[r]=n;switch(r){case`string`:return`string`;case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`unknown`}},Kx=(e,t,n)=>{let r=[],i=!0,a;for(let o of Wx(e,t)){if(Hx(o.properties)&&(i=!1,r.push(...Object.keys(o.properties)),Object.hasOwn(o.properties,n))){let e=o.properties[n],t=Array.isArray(o.required)&&o.required.includes(n);a={schema:Hx(e)?e:void 0,required:a?.required===!0||t}}if(o.type===`object`&&!Hx(o.properties)&&o.additionalProperties===!1&&(i=!1),(Array.isArray(o.items)||Hx(o.items))&&/^\d+$/.test(n))return i=!1,{found:!0,schema:Hx(o.items)?o.items:void 0,required:!0,names:r,open:!1};Hx(o.additionalProperties)&&a===void 0&&(a={schema:o.additionalProperties,required:!1},i=!1)}return a===void 0?{found:!1,schema:void 0,required:!1,names:r,open:i}:{found:!0,schema:a.schema,required:a.required,names:r,open:!1}},qx=(e,t)=>t.size===0?e:{...e,guards:new Set([...e.guards,...t])},Jx=e=>{let t=e.split(`.`);return t.map((e,n)=>t.slice(0,n+1).join(`.`))},Yx=e=>typeof e==`object`&&e&&`bind`in e?e.bind:void 0,Xx=(e,t)=>{let n=e=>e===void 0?new Set:new Set(Jx(e));if(`present`in e)return t?n(e.present):new Set;if(`truthy`in e){let r=e.truthy,i=Yx(r)??(typeof r==`object`&&r&&`length`in r?Yx(r.length):void 0);return t?n(i):new Set}if(`not`in e)return Xx(e.not,!t);if(`and`in e||`or`in e){let n=`and`in e?e.and:e.or,r=`and`in e?t:!t,i=n.map(e=>Xx(e,t));if(r)return new Set(i.flatMap(e=>[...e]));let[a,...o]=i;return new Set([...a??[]].filter(e=>o.every(t=>t.has(e))))}let[r,i]=e.args,a=Yx(r)??Yx(i),o=Yx(r)===void 0?r:i;if(a===void 0)return new Set;let s=o===null,c=typeof o!=`object`||!o||`concat`in o||`format`in o||`op`in o||`length`in o||`count`in o;return e.cmp===`eq`?!c||t===s?new Set:n(a):e.cmp===`ne`?!c||t!==s?new Set:n(a):t?n(a):new Set},Zx=(e,t,n)=>{let r=[],i=new Set,a=e=>{let t=`${e.code}\0${e.message}\0${e.src?.join(`,`)??``}`;i.has(t)||(i.add(t),r.push(e))},o=e=>e.startsWith(`$`)?e.slice(1):`input.${e}`,s=(t,n,r)=>{let i=t.split(`.`),a=i[0],o;if(a.startsWith(`$`)){if(!n.variables.has(a.slice(1)))return;o=n.variables.get(a.slice(1))}else{let i=Kx(e,e,a);if(!i.found)return c(a,i,``,r,t);!i.required&&!n.guards.has(a)&&l(a,r),o=i.schema}for(let a=1;a<i.length;a++){if(o===void 0)return;let s=i[a],u=Kx(e,o,s),d=i.slice(0,a).join(`.`);if(!u.found)return u.open?void 0:c(s,u,d,r,t);let f=i.slice(0,a+1).join(`.`);!u.required&&!n.guards.has(f)&&l(f,r),o=u.schema}return o},c=(e,t,n,r,i)=>{if(t.open)return;let s=Vx(e,t.names),c=n===``?`input`:o(n);a({code:`unknown-field`,message:`\`${n===``?`input`:o(n)}.${e}\` is not in the schema${t.names.length===0?``:` (${c} has ${t.names.map(e=>`\`${e}\``).join(`, `)})`}.`,...s===void 0?{fix:`Add \`${e}\` to the schema, or bind a field it declares.`}:{fix:`Did you mean \`${n===``?`input`:o(n)}.${s}\`?`},src:r})},l=(e,t)=>{a({code:`unguarded-optional`,message:`\`${o(e)}\` is optional and is read outside a guard, so a send without it would render a blank.`,fix:`Guard it: {${o(e)} && …}, or make the field required in the schema.`,src:t})},u=(t,n,r)=>{if(typeof t==`string`)return`string`;if(typeof t==`number`)return`number`;if(typeof t==`boolean`)return`boolean`;if(t===null)return`unknown`;if(`bind`in t)return Gx(e,s(t.bind,n,r));if(`lit`in t)return`unknown`;if(`concat`in t){for(let e of t.concat)u(e,n,r);return`string`}if(`format`in t)return f(t.format,t.args,n,r),`string`;if(`if`in t){p(t.if,n,r);let e=u(t.then,qx(n,Xx(t.if,!0)),r);return u(t.else,qx(n,Xx(t.if,!1)),r),e}if(`op`in t){for(let e of t.args)d(e,`number`,n,r,`arithmetic`);return`number`}if(`length`in t)return u(t.length,n,r),`number`;if(`count`in t){let i=Yx(t.count),a;if(i===void 0)u(t.count,n,r);else{let t=s(i,n,r);if(t!==void 0)for(let n of Wx(e,t))Hx(n.items)&&(a=Ux(e,n.items))}let o=new Map(n.variables).set(t.as.replace(/^\$/,``),a);return p(t.where,{...n,variables:o},r),`number`}return`unknown`},d=(e,t,n,r,i)=>{let s=u(e,n,r);if(s===`unknown`||s===t)return;let c=Yx(e);a({code:`invalid-binding-type`,message:`${c===void 0?`This value`:`\`${o(c)}\``} is ${s===`array`?`an array`:`a ${s}`}, and ${i} needs ${t===`array`?`an array`:`a ${t}`}.`,fix:t===`number`?`Bind a number field, or send the number in the payload.`:`Bind a ${t} field.`,src:r})},f=(e,t,n,r)=>{let i={money:[`number`,`string`,`string`],number:[`number`,void 0,`string`],date:[`string`,`string`,`string`],time:[`string`,`string`,`string`],plural:[`number`,void 0,`string`],list:[`array`,`string`]};for(let[a,o]of t.entries()){let t=i[e]?.[a];t===void 0?u(o,n,r):d(o,t,n,r,`\`fmt.${e}\``)}},p=(e,t,n)=>{if(`present`in e){m(e.present,t,n);return}if(`truthy`in e){let r=e.truthy,i=Yx(r);i===void 0?h(r,t,n):m(i,t,n);return}if(`not`in e){p(e.not,t,n);return}if(`and`in e){let r=t;for(let t of e.and)p(t,r,n),r=qx(r,Xx(t,!0));return}if(`or`in e){let r=t;for(let t of e.or)p(t,r,n),r=qx(r,Xx(t,!1));return}let r=e.cmp===`lt`||e.cmp===`gt`||e.cmp===`le`||e.cmp===`ge`,i=r&&e.args.every(e=>u(e,t,n)===`string`);for(let a of e.args){let e=Yx(a);i||(e!==void 0&&!r?m(e,t,n):r?d(a,`number`,t,n,`a comparison`):h(a,t,n))}},m=(e,t,n)=>{s(e,{...t,guards:new Set([...t.guards,...Jx(e)])},n)},h=(e,t,n)=>{if(typeof e==`object`&&e&&`length`in e){let r=Yx(e.length);if(r!==void 0){m(r,t,n);return}}u(e,t,n)},g=(e,t,n,r)=>{let i=u(e,t,n);if(i===`array`||i===`object`){let t=Yx(e);a({code:`invalid-binding-type`,message:`${t===void 0?`This value`:`\`${o(t)}\``} is ${i===`array`?`an array`:`an object`}, and ${r} takes a string or a number.`,fix:i===`array`?`Render the items with .map, or bind one of their fields.`:`Bind one of its fields.`,src:n})}},_=(e,t,n)=>{if(e===void 0||typeof e==`string`)return;if(Array.isArray(e)){for(let[,r]of e)g(r,t,n,`a style value`);return}let r=e;p(r.if,t,n),_(r.then,qx(t,Xx(r.if,!0)),n),_(r.else,qx(t,Xx(r.if,!1)),n)},v=(t,n,r)=>{for(let i of t){if(Lx(i)){g(i,n,r,`text`);continue}if(`el`in i){for(let e of Object.values(i.attrs??{}))g(e,n,i.src,`an attribute`);_(i.style,n,i.src),v(i.children??[],n,i.src)}else if(`if`in i)p(i.if,n,i.src),v(i.then,qx(n,Xx(i.if,!0)),i.src??r),v(i.else??[],qx(n,Xx(i.if,!1)),i.src??r);else if(`each`in i){let t=Yx(i.each),c;if(t!==void 0){c=s(t,n,i.src);let r=Gx(e,c);r!==`array`&&r!==`unknown`&&a({code:`invalid-binding-type`,message:`\`${o(t)}\` is ${r===`object`?`an object`:`a ${r}`}, and a loop needs an array.`,fix:`Loop over an array field.`,src:i.src})}else u(i.each,n,i.src);let l;if(c!==void 0)for(let t of Wx(e,c))Hx(t.items)&&(l=Ux(e,t.items));let d=i.as.replace(/^\$/,``);i.where!==void 0&&p(i.where,{...n,variables:new Map(n.variables).set(d,l)},i.src??r);let f=new Map(n.variables);f.set(d,i.chunk===void 0||l===void 0?l:{type:`array`,items:l}),i.index!==void 0&&f.set(i.index.replace(/^\$/,``),{type:`integer`});let m=i.where===void 0?n:qx(n,Xx(i.where,!0));v(i.children,{...m,variables:f},i.src??r)}else if(`raw`in i)for(let e of i.raw)typeof e!=`string`&&g(`attr`in e?e.attr:e.text,n,i.src,`markup`)}},y={variables:new Map,guards:new Set};v(t,y);for(let e of n)g(e,y,void 0,`the subject or preheader`);return r},Qx=(e,t)=>{let n=e=>e.flatMap(e=>Lx(e)?[e]:`if`in e?[...n(e.then),...n(e.else??[])]:`each`in e?n(e.children):[e]),r=e=>{for(let t of e)Lx(t)||(`el`in t?i(t):`if`in t?(r(t.then),r(t.else??[])):`each`in t&&r(t.children))},i=e=>{let i=kg(e.el),a=n(e.children??[]);if(i!==void 0){if(i.content===`void`&&a.length>0)t({code:`void-element-children`,message:`<${e.el}> cannot have children.`,src:e.src});else if(i.content===`text`||i.content===`raw`)for(let n of a)!Lx(n)&&!(`raw`in n)&&t({code:`invalid-content`,message:`<${e.el}> accepts text only.`,src:e.src});else if(i.childElements!==void 0)for(let n of a)if(Lx(n)){if(typeof n==`string`&&n.trim()===``)continue;t({code:`invalid-content`,message:`<${e.el}> cannot contain text directly; put it inside <${i.childElements[0]}>.`,src:e.src})}else`el`in n&&!i.childElements.includes(n.el)&&t({code:`invalid-content`,message:`<${e.el}> accepts only ${i.childElements.map(e=>`<${e}>`).join(`, `)}; found <${n.el}>.`,src:n.src??e.src});r(e.children??[])}};r(e)},$x=``,eS=``,tS=/(\d+)/g,nS=class{entries=[];value(e){return typeof e==`string`?e:(this.entries.push({value:e}),`${$x}${this.entries.length-1}${eS}`)}nodes(e){return this.entries.push({nodes:e}),`${$x}${this.entries.length-1}${eS}`}parse(e){let t=[],n=0;for(let r of e.matchAll(tS)){r.index>n&&t.push(e.slice(n,r.index));let i=this.entries[Number(r[1])];i!==void 0&&t.push(i),n=r.index+r[0].length}return n<e.length&&t.push(e.slice(n)),t}toValue(e){let t=this.parse(e);if(t.length===0)return``;let n=[];for(let e of t)if(typeof e==`string`)n.push(e);else if(`value`in e)n.push(e.value);else return;return n.length===1?n[0]:{concat:n}}},rS=(e,t)=>Ix(t)?t:e.value(t),iS=e=>e===void 0?{}:{src:e},aS=(e,t)=>{let n=[],r=!1,i,a=``,o=()=>{a!==``&&n.push(a),a=``};for(let s=0;s<t.length;s++){let c=t[s];if(c===$x){let i=t.indexOf(eS,s),a=e.parse(t.slice(s,i+1))[0];if(i>s&&a!==void 0&&typeof a!=`string`&&`value`in a){o(),n.push(r?{attr:a.value}:{text:a.value}),s=i;continue}}!r&&c===`<`?r=!0:r&&i===void 0&&(c===`"`||c===`'`)?i=c:r&&i===c?i=void 0:r&&i===void 0&&c===`>`&&(r=!1),a+=c}return o(),n},oS=(e,t)=>{if(!Rm(t))return;let n=[];for(let[r,i]of Object.entries(t))if(i!=null){if(typeof i==`number`)n.push([r,i]);else if(typeof i==`string`){let t=e.toValue(i);t!==void 0&&n.push([r,t])}}return n},sS=(e,t,n)=>{if(e===null)return[];switch(e.type){case`Text`:{let n=[];for(let r of t.parse(e.value))typeof r==`string`?n.push(r):`value`in r?n.push(r.value):n.push(...r.nodes);return n}case`Fragment`:return e.children.flatMap(e=>sS(e,t,n));case`Raw`:return[{raw:aS(t,e.html),...e.text===``?{}:{text:e.text},...iS(n)}];case`Element`:{let r={},i;for(let[n,a]of Object.entries(e.props)){if(n===`key`||a==null||a===!1)continue;if(n===`style`){i=oS(t,a);continue}let e=n===`className`?`class`:n;typeof a==`string`?r[e]=t.toValue(a)??a:(typeof a==`number`||a===!0)&&(r[e]=a)}let a=e.props[Qh]===!0;return[{el:e.tag,...Object.keys(r).length===0?{}:{attrs:r},...i===void 0||Array.isArray(i)&&i.length===0?{}:{style:i},...e.children.length===0?{}:{children:e.children.flatMap(e=>sS(e,t,n))},...a?{reserved:!0}:{},...iS(n)}]}}},cS={Button:[`height`,`paddingX`,`borderRadius`,`borderWidth`,`fontSize`,`width`],Spacer:[`height`],Divider:[`thickness`],BrandLogo:[`width`]},lS={Email:H_,Section:U_,Columns:K_,Column:q_,Button:ev,Spacer:tv,Divider:nv,Image:rv,Link:iv},uS=(e,t,n,r)=>{switch(r.k){case`object`:{let n={};for(let[i,a]of r.fields)n[i]=uS(e,t,i,a);return n}case`nodes`:e.lowerer.error(e.ctx,e.node,`dynamic-expression`,`<${e.name} ${n}> takes text, not markup.`);return;default:{let i=Fx(r);if(i===void 0){e.lowerer.error(e.ctx,e.node,`dynamic-expression`,`<${e.name} ${n}> cannot be the input as a whole.`,`Bind one field.`);return}return rS(t,i)}}},dS=(e,t)=>{let n=t.length===1?t[0]:void 0;return n!==void 0&&Lx(n)&&n!==null&&typeof n!=`boolean`?typeof n==`string`?n:e.value(n):t.map(t=>Lx(t)?typeof t==`string`?t:e.value(t):e.nodes([t]))},fS=(e,t)=>{if(e!==void 0)return W_(e);let n={length:t};return{concat:[{op:`/`,args:[{op:`-`,args:[100,{op:`%`,args:[100,n]}]},n]},`%`]}},pS=(e,t)=>{let{lowerer:n,ctx:r,node:i}=e,a=t.get(`each`),o=a===void 0?void 0:Fx(a);if(o===void 0){n.error(r,i,`invalid-columns-each`,`<Columns each> takes a list from the input.`,`Write each={input.items}.`);return}let s=t.get(`per`),c=s?.k===`value`?s.value:void 0;if(s!==void 0&&!(typeof c==`number`&&Number.isInteger(c)&&c>=1)){n.error(r,i,`invalid-columns-per`,`<Columns per> is a whole number of cells, one or more.`,`Write per={2}.`);return}let l=typeof c==`number`?c:void 0,u=kx(i,`children`).filter(e=>e.type!==`JSXText`||(X(e,`value`)??``).trim()!==``),d=u.length===1?u[0]:void 0,f=d?.type===`JSXExpressionContainer`?Y(d,`expression`):void 0,p=f===void 0?void 0:jx(f);if(p===void 0||!/Function/.test(p.type)){n.error(r,i,`invalid-columns-each`,`<Columns each> takes a function of one item as its only child.`,`Write {(item) => <Column>…</Column>}.`);return}let m=l===void 0?void 0:n.freshName(r,`row`),h={...r,loops:m===void 0?r.loops:[...r.loops,m],columnWidth:fS(l,o)},g=n.eachOver(h,i,m===void 0?o:{bind:`$${m}`},p);if(g!==void 0)return{cells:g,wrap:e=>m===void 0||l===void 0?e:[{each:o,as:m,chunk:l,children:e,src:n.src(r.module,i)}]}},mS=e=>{let{lowerer:t,ctx:n,node:r,binding:i}=e,a=i.kind===`markup`?i.specifier:`samva:brand`;if(i.kind===`markup`&&(a===`@samva/markup/sms`||a===`@samva/markup/whatsapp`)){let i=e.channel?.(e);return i===void 0?(t.error(n,r,`wrong-channel`,`<${e.name}> belongs in the ${a.split(`/`).pop()} body of a template.`,"Write it in the `sms` or `whatsapp` function of defineTemplate."),[]):i}let o=i.imported,s=i.kind===`markup`&&a===`@samva/markup/email/components`,c=i.kind===`brand`;if(!(s||c))return t.error(n,r,`unknown-component`,`<${e.name}> is not a component the profile can read.`,`Import components from @samva/markup/email/components, samva:brand, or the project.`),[];let l;if(s)l=lS[o];else{if(e.brand===void 0)return t.error(n,r,`brand-unavailable`,`<${e.name}> comes from samva:brand, and this build has no brand to resolve it.`,`Compile with a brand, or remove the brand components.`),[];let i=yg(e.brand);l=o===`BrandLogo`?i.BrandLogo:o===`BrandFooter`?i.BrandFooter:void 0}if(l===void 0||!Object.hasOwn(lS,o)&&s)return t.error(n,r,`unknown-component`,`\`${o}\` is not an email component.`,`Use one of ${Object.keys(lS).join(`, `)}, BrandLogo or BrandFooter.`),[];let u=t.attributeBindings(n,e.attributes);if(u===void 0)return[];let d=u,f=e=>e,p,m={...n,columnWidth:void 0};if(o===`Columns`&&u.has(`each`)){let t=pS(e,u);if(t===void 0)return[];d=new Map([...u].filter(([e])=>e!==`each`&&e!==`per`)),p=[t.cells],f=t.wrap}else p=t.jsxChildren(m,r);let h=new nS,g={};for(let[t,n]of d)g[t]=uS(e,h,t,n);for(let i of cS[o]??[]){let a=g[i];if(typeof a==`string`&&!/^-?\d+(\.\d+)?$/.test(a)&&a!==void 0)return t.error(n,r,`dynamic-numeric-prop`,`<${e.name} ${i}> sizes the layout at compile time, so it must be a number literal.`,`Write ${i}={44}.`),[]}if(o===`Column`&&g.width===void 0&&n.columnWidth!==void 0&&(g.width=rS(h,n.columnWidth)),p.length>0&&(g.children=dS(h,p)),o===`Button`&&typeof g.children==`string`&&g.children!==``&&g.width===void 0&&g.height!==void 0&&h.toValue(g.children)!==g.children)return t.error(n,r,`button-dynamic-label`,`Classic Outlook draws the button from a fixed box, and a label read at render time cannot size it.`,`Give the button a width: <Button width={200} …>.`),[];ug();let _=l(g),v=t.findings.locate(n.module.parsed,r);for(let e of ug())t.findings.items.push({...e,origins:[v]});return _!==null&&(!Rm(_)||typeof _.type!=`string`)?[]:f([...sS(_,h,t.src(n.module,r))])},hS=(e,t,n)=>({ok:!1,node:t,module:e,reason:n}),gS=e=>{if(e.type===`ObjectProperty`&&e.computed!==!0){let t=Y(e,`key`);if(t===void 0)return;if(t.type===`Identifier`)return X(t,`name`);if(t.type===`StringLiteral`)return X(t,`value`);if(t.type===`NumericLiteral`)return String(t.value)}},_S=(e,t,n,r=new Set)=>{let i=`${t.path}\0${n}`;if(r.has(i))return;r.add(i);let a=t.declarations.get(n);if(a!==void 0)return{module:t,value:a.value};let o=t.imports.get(n);if(o===void 0)return;if(o.kind===`asset`)return{asset:o.path};if(o.kind!==`project`)return;let s=e.project.modules.get(o.path);if(s===void 0)return;if(o.imported==="default"){let e=s.defaultExport;return e===void 0?void 0:{module:s,value:e}}let c=s.exports.get(o.imported);return c===void 0?void 0:_S(e,s,c,r)},vS=(e,t,n,r=new Set)=>{let i=jx(n);switch(i.type){case`StringLiteral`:return{ok:!0,value:i.value};case`NumericLiteral`:return{ok:!0,value:i.value};case`BooleanLiteral`:return{ok:!0,value:i.value};case`NullLiteral`:return{ok:!0,value:null};case`TemplateLiteral`:{if(kx(i,`expressions`).length>0)return hS(t,i,"a template string with a `${}` part is computed at run time");let e=kx(i,`quasis`)[0]?.value,n=e?.cooked??e?.raw;return{ok:!0,value:typeof n==`string`?n:``}}case`UnaryExpression`:{let e=Y(i,`argument`);return X(i,`operator`)===`-`&&e!==void 0&&e.type===`NumericLiteral`&&typeof e.value==`number`?{ok:!0,value:-e.value}:hS(t,i,`only a negative number literal is data`)}case`Identifier`:{let n=X(i,`name`)??``;if(n===`undefined`)return{ok:!0,value:void 0};let a=_S(e,t,n);if(a===void 0)return hS(t,i,`\`${n}\` is not a constant in the project`);if(`asset`in a){let r=e.assetUrl(a.asset);return r===void 0?hS(t,i,`\`${n}\` names an asset the build did not address`):{ok:!0,value:r}}let o=`${a.module.path}\0${n}\0${a.value.start}`;if(r.has(o))return hS(t,i,`\`${n}\` refers to itself`);r.add(o);let s=vS(e,a.module,a.value,r);return r.delete(o),s}case`ArrayExpression`:{let n=[];for(let a of Array.isArray(i.elements)?i.elements:[]){if(typeof a!=`object`||!a)return hS(t,i,`an array hole`);let o=a;if(o.type===`SpreadElement`){let i=Y(o,`argument`);if(i===void 0)return hS(t,o,`an empty spread`);let a=vS(e,t,i,r);if(!a.ok)return a;if(!Array.isArray(a.value))return hS(t,o,`a spread of a non-array`);n.push(...a.value);continue}let s=vS(e,t,o,r);if(!s.ok)return s;n.push(s.value)}return{ok:!0,value:n}}case`ObjectExpression`:{let n={};for(let a of kx(i,`properties`)){if(a.type===`SpreadElement`){let i=Y(a,`argument`);if(i===void 0)return hS(t,a,`an empty spread`);let o=vS(e,t,i,r);if(!o.ok)return o;if(typeof o.value!=`object`||o.value===null||Array.isArray(o.value))return hS(t,a,`a spread of a non-object`);Object.assign(n,o.value);continue}let i=gS(a);if(i===void 0)return hS(t,a,`a computed or method property`);let o=Y(a,`value`);if(o===void 0)return hS(t,a,`a property without a value`);let s=vS(e,t,o,r);if(!s.ok)return s;s.value!==void 0&&(n[i]=s.value)}return{ok:!0,value:n}}case`CallExpression`:{let n=Y(i,`callee`),a=kx(i,`arguments`)[0];return n?.type===`Identifier`&&X(n,`name`)===`jsonSchema`&&a!==void 0?vS(e,t,a,r):hS(t,i,`a call is computed at run time`)}default:return hS(t,i,`${i.type} is not data`)}},yS=40,bS={"+":`+`,"-":`-`,"*":`*`,"/":`/`,"%":`%`},xS={"===":`eq`,"!==":`ne`,"<":`lt`,">":`gt`,"<=":`le`,">=":`ge`},SS={money:[2,3],number:[1,3],date:[1,3],time:[1,3],plural:[2,3],list:[1,2]},CS=new Set([`reduce`,`filter`,`slice`,`join`,`sort`,`concat`,`flatMap`,`find`,`some`,`every`,`toFixed`,`toLocaleString`,`toLocaleDateString`,`toUpperCase`,`toLowerCase`,`trim`,`split`,`replace`,`padStart`,`includes`,`indexOf`,`at`]),wS=e=>{let t=e.split(/\r\n|\n|\r/),n=0;for(let[e,r]of t.entries())/[^ \t]/.test(r)&&(n=e);let r=``;for(let[e,i]of t.entries()){let a=i.replace(/\t/g,` `);e!==0&&(a=a.replace(/^ +/,``)),e!==t.length-1&&(a=a.replace(/ +$/,``)),a!==``&&(e!==n&&(a+=` `),r+=a)}return r},TS=e=>e.type===`JSXIdentifier`?X(e,`name`)??``:e.type===`JSXNamespacedName`?`${X(Y(e,`namespace`)??e,`name`)??``}:${X(Y(e,`name`)??e,`name`)??``}`:e.type===`JSXMemberExpression`?`${TS(Y(e,`object`)??e)}.${X(Y(e,`property`)??e,`name`)??``}`:``,ES=e=>e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`,DS=e=>e===`VariableDeclaration`?"`const`":e===`IfStatement`?"`if`":/For|While/.test(e)?`a loop`:`a statement`,OS=class{options;sources=[];uniqueId=0;constructor(e){this.options=e}get findings(){return this.options.findings}src(e,t){let n=e.parsed.position(t.start);if(e.path===this.options.project.entry.path)return[n.line,n.column];let r=this.sources.indexOf(e.path);return r<0&&(r=this.sources.length,this.sources.push(e.path)),[n.line,n.column,r+1]}error(e,t,n,r,i){this.findings.add(e.module.parsed,t,n,r,i)}dynamic(e,t,n,r){this.error(e,t,`dynamic-expression`,`${n} runs code, and templates render without running code.`,r)}functionExpression(e,t){let n=Y(t,`body`);if(n===void 0)return;if(n.type!==`BlockStatement`)return n;let r=kx(n,`body`),i=r[0];if(r.length===1&&i?.type===`ReturnStatement`){let e=Y(i,`argument`);if(e!==void 0)return e}let a=r.find(e=>e.type!==`ReturnStatement`)??n,o=DS(a.type);this.error(e,a,`statement-in-body`,`A body is one expression, and ${o} is a statement.`,"Write the value where it is used: `cond && <X />` or `cond ? <A /> : <B />` for branches, `.map` for lists. Compute anything else in the caller and send it in the payload.")}bindPattern(e,t,n,r,i){switch(t.type){case`Identifier`:{let e=X(t,`name`)??``;r.set(e,n??{k:`value`,value:null});return}case`AssignmentPattern`:{let a=Y(t,`left`),o=Y(t,`right`);if(a===void 0||o===void 0)return;if(!i){this.error(e,t,`unsupported-pattern`,`A default value on the input is never inserted, so it is not part of the profile.`,`Remove the default; declare the field as required or guard it where it is read.`);return}let s=n;if(s===void 0){let t=vS(this.options.staticContext,e.module,o);if(!t.ok){this.error(e,o,`dynamic-expression`,`A default prop value must be a literal.`,`Use a string, number or boolean literal.`);return}s={k:`value`,value:t.value}}this.bindPattern(e,a,s,r,i);return}case`ObjectPattern`:for(let a of kx(t,`properties`)){if(a.type===`RestElement`){this.error(e,a,`unsupported-pattern`,`A rest element gathers props at run time.`,`Name each prop you use.`);continue}let t=Y(a,`key`),o=Y(a,`value`),s=Ax(t);if(s===void 0||o===void 0||a.computed===!0){this.error(e,a,`unsupported-pattern`,`A computed key cannot be read statically.`);continue}let c=n===void 0?void 0:this.field(e,n,s,a);this.bindPattern(e,o,c,r,i)}return;default:this.error(e,t,`unsupported-pattern`,`A parameter is a name or an object pattern of names.`,"Write `(input) =>` or `({ name, items }) =>`.")}}field(e,t,n,r){switch(t.k){case`path`:return n===`length`&&t.path!==``?{k:`value`,value:{length:{bind:t.path}}}:{k:`path`,path:Px(t.path,n)};case`object`:return t.fields.get(n);case`value`:if(n===`length`)return{k:`value`,value:{length:t.value}};if(t.value===null)return{k:`value`,value:null};this.error(e,r,`dynamic-expression`,`\`.${n}\` reads a property of a computed value.`,`Read fields of the input directly.`);return;case`nodes`:this.error(e,r,`dynamic-expression`,"`children` has no fields.","Render `{children}` as is.");return}}binding(e,t){let n=jx(t);if(n.type===`Identifier`){let t=X(n,`name`)??``;if(t===`undefined`)return{k:`value`,value:null};let r=e.env.get(t);if(r!==void 0)return r;let i=e.module.imports.get(t);if(i?.kind===`asset`){let e=this.options.assetUrl(i.path);if(e!==void 0)return{k:`value`,value:e}}this.error(e,n,`dynamic-expression`,`\`${t}\` is not a binding the template declared.`,"Read the input through the function's parameter, for example `input.name`.");return}if(n.type===`MemberExpression`){let t=Y(n,`object`),r=Y(n,`property`);if(t===void 0||r===void 0)return;if(n.computed!==!0&&X(r,`name`)===`length`&&this.filterChain(e,t)!==void 0){let n=this.filterChain(e,t);if(n.list===void 0)return;let r=n.filters[0],i=r===void 0?void 0:kx(r,`params`)[0],a=this.uniqueName(e,i?.type===`Identifier`?X(i,`name`)??`item`:`item`),o=this.whereClause({...e,loops:[...e.loops,a]},a,n.filters);return o===void 0?void 0:{k:`value`,value:{count:n.list,as:a,where:o}}}let i=this.binding(e,t);if(i===void 0)return;let a;if(n.computed===!0){if(r.type===`StringLiteral`?a=X(r,`value`):r.type===`NumericLiteral`&&(a=String(r.value)),a===void 0){this.dynamic(e,n,`A computed property`,"Use `.name`, or a numeric index such as `[0]`.");return}}else a=X(r,`name`);return a===void 0?void 0:this.field(e,i,a,n)}if(n.type===`OptionalMemberExpression`||n.type===`OptionalCallExpression`){this.dynamic(e,n,`Optional chaining`,"Guard the field: `input.discount && <p>{input.discount.label}</p>`.");return}let r=this.value(e,n,!1);return r===void 0?void 0:{k:`value`,value:r}}value(e,t,n){let r=jx(t);switch(r.type){case`StringLiteral`:return this.checkedText(e,r,X(r,`value`)??``);case`NumericLiteral`:return typeof r.value==`number`?r.value:void 0;case`BooleanLiteral`:return r.value===!0;case`NullLiteral`:return null;case`Identifier`:case`MemberExpression`:case`OptionalMemberExpression`:{let t=this.binding(e,r);if(t===void 0)return;let n=Fx(t);if(n!==void 0)return n;this.error(e,r,`dynamic-expression`,t.k===`path`?`The input as a whole is not a value.`:"An object or `children` is not text.",t.k===`path`?"Read one field: `input.name`.":"Render `{children}` as content, or read one field.");return}case`TemplateLiteral`:return this.template(e,r,n);case`ConditionalExpression`:{let t=Y(r,`test`),i=Y(r,`consequent`),a=Y(r,`alternate`);if(t===void 0||i===void 0||a===void 0)return;let o=this.predicate(e,t),s=this.value(e,i,n),c=this.value(e,a,n);return o===void 0||s===void 0||c===void 0?void 0:{if:o,then:s,else:c}}case`LogicalExpression`:{let t=X(r,`operator`),i=Y(r,`left`),a=Y(r,`right`);if(i===void 0||a===void 0)return;if(t===`||`){let t=this.value(e,i,n),r=this.value(e,a,n);return t===void 0||r===void 0?void 0:{if:{truthy:t},then:t,else:r}}if(t===`??`){this.error(e,r,`dynamic-expression`,"`??` is not one of the conditions the profile reads.",'Write the condition out: `input.name === null ? "there" : input.name`, or `input.name || "there"`.');return}this.error(e,r,`dynamic-expression`,"`&&` in a value position yields its left operand when that is falsy.","Use a conditional: `cond ? value : fallback`, or `cond && <X />` in content.");return}case`CallExpression`:return this.call(e,r);case`BinaryExpression`:{let t=X(r,`operator`)??``,i=bS[t],a=Y(r,`left`),o=Y(r,`right`);if(i===void 0||a===void 0||o===void 0){this.error(e,r,`dynamic-expression`,`\`${t}\` produces a condition, not a value.`,"Use it as the test of `&&`, `? :` or `||`.");return}if(!n){this.error(e,r,`dynamic-expression`,"Arithmetic runs code, and it is allowed only inside a `fmt.*` argument or a condition.","Wrap it: `fmt.number(item.price * item.qty)`, or send the computed value in the payload.");return}if(i===`+`&&[a,o].some(e=>/StringLiteral|TemplateLiteral/.test(jx(e).type))){this.error(e,r,`dynamic-expression`,"`+` with a string joins text at run time.","Use a template string: `${a} ${b}`.");return}let s=this.value(e,a,!0),c=this.value(e,o,!0);return s===void 0||c===void 0?void 0:{op:i,args:[s,c]}}case`UnaryExpression`:{let t=X(r,`operator`),i=Y(r,`argument`);if(t===`-`&&i!==void 0){let t=jx(i);if(t.type===`NumericLiteral`&&typeof t.value==`number`)return-t.value;if(n){let t=this.value(e,i,!0);return t===void 0?void 0:{op:`-`,args:[0,t]}}}if(t===`!`){this.error(e,r,`dynamic-expression`,"`!` produces a condition, not a value.","Use it as the test of `&&`, `? :` or `||`.");return}return this.dynamic(e,r,`\`${t??`?`}\``,`Send the computed value in the payload.`)}case`JSXElement`:case`JSXFragment`:this.error(e,r,`dynamic-expression`,`Markup is not a text value.`,`Use it as content.`);return;case`ArrowFunctionExpression`:case`FunctionExpression`:return this.dynamic(e,r,`A function`,`Write the value directly.`);case`NewExpression`:case`AwaitExpression`:case`AssignmentExpression`:case`UpdateExpression`:case`SequenceExpression`:case`ObjectExpression`:case`ArrayExpression`:case`SpreadElement`:return this.dynamic(e,r,`\`${r.type}\``,`Send the computed value in the payload.`);default:return this.dynamic(e,r,`\`${r.type}\``,`Send the computed value in the payload.`)}}checkedText(e,t,n){return/[-]/.test(n)&&this.error(e,t,`reserved-character`,`This text contains a private-use character the compiler reserves.`,`Remove the characters U+E000 to U+E003.`),n}template(e,t,n){let r=kx(t,`quasis`),i=kx(t,`expressions`),a=[],o=!0;for(let[t,s]of r.entries()){let r=jS(s);r!==``&&a.push(this.checkedText(e,s,r));let c=i[t];if(c!==void 0){let t=this.value(e,c,n);t===void 0?o=!1:a.push(t)}}if(o)return MS(a)}call(e,t){let n=Y(t,`callee`),r=kx(t,`arguments`);if(n===void 0)return;let i=jx(n);if(i.type===`MemberExpression`&&i.computed!==!0){let n=Y(i,`object`),a=Y(i,`property`),o=a===void 0?void 0:X(a,`name`);if(n!==void 0&&o!==void 0&&this.isFmt(e,n)){if(!Kh.includes(o)){this.error(e,t,`unknown-formatter`,`\`fmt.${o}\` is not a formatter.`,`Use one of ${Kh.map(e=>`fmt.${e}`).join(`, `)}.`);return}let n=o,[i,a]=SS[n];if(r.length<i||r.length>a){this.error(e,t,`formatter-arguments`,`\`fmt.${n}\` takes ${i===a?i:`${i} to ${a}`} arguments.`,`Check the formatter table in the reference.`);return}let s=[];for(let t of r){let n=jx(t);if(n.type===`ObjectExpression`){let t=vS(this.options.staticContext,e.module,n);if(!t.ok){this.error(e,n,`dynamic-expression`,`Formatter options are literal.`,`Write plain string and number values.`);return}s.push({lit:t.value});continue}if(n.type===`ArrayExpression`){let t=vS(this.options.staticContext,e.module,n);if(t.ok){s.push({lit:t.value});continue}}let r=this.value(e,t,!0);if(r===void 0)return;s.push(r)}return{format:n,args:s}}if(o!==void 0&&CS.has(o))return this.dynamic(e,t,`\`.${o}(…)\``,"Send the computed value in the payload and bind it, or format with `fmt.*`.")}if(i.type===`Identifier`&&/^use[A-Z]/.test(X(i,`name`)??``)){this.error(e,t,`hook-call`,`\`${X(i,`name`)}\` is a hook, and a template has no state, effects or context.`,`Read the input through the function's parameter; send anything else in the payload.`);return}let a=i.type===`Identifier`?X(i,`name`)??``:i.type===`MemberExpression`?`${kS(Y(i,`object`))}.${X(Y(i,`property`)??i,`name`)??``}`:`a call`;return this.dynamic(e,t,`\`${a}(…)\``,"Send the computed value in the payload and bind it, or format with `fmt.money`, `fmt.number`, `fmt.date`, `fmt.time`, `fmt.plural` or `fmt.list`.")}isFmt(e,t){let n=jx(t);if(n.type!==`Identifier`)return!1;let r=e.module.imports.get(X(n,`name`)??``);return r?.kind===`markup`&&r.specifier===`@samva/markup/fmt`}predicate(e,t){let n=jx(t);if(n.type===`LogicalExpression`){let t=X(n,`operator`),r=Y(n,`left`),i=Y(n,`right`);if(r!==void 0&&i!==void 0&&(t===`&&`||t===`||`)){let n=this.predicate(e,r),a=this.predicate(e,i);if(n===void 0||a===void 0)return;if(t===`&&`){let e=e=>`and`in e?e.and:[e];return{and:[...e(n),...e(a)]}}let o=e=>`or`in e?e.or:[e];return{or:[...o(n),...o(a)]}}}if(n.type===`UnaryExpression`&&X(n,`operator`)===`!`){let t=Y(n,`argument`),r=t===void 0?void 0:this.predicate(e,t);return r===void 0?void 0:{not:r}}if(n.type===`BinaryExpression`){let t=X(n,`operator`)??``,r=xS[t],i=Y(n,`left`),a=Y(n,`right`);if(r===void 0||i===void 0||a===void 0){this.error(e,n,`dynamic-expression`,t===`==`||t===`!=`?`\`${t}\` coerces types at run time.`:`\`${t}\` is not a comparison the profile reads.`,"Use `===`, `!==`, `<`, `>`, `<=` or `>=`.");return}let o=this.value(e,i,!0),s=this.value(e,a,!0);return o===void 0||s===void 0?void 0:{cmp:r,args:[o,s]}}let r=this.value(e,n,!0);if(r!==void 0)return typeof r==`object`&&r&&`bind`in r?{present:r.bind}:{truthy:r}}jsxChildren(e,t){let n=[];for(let r of kx(t,`children`))switch(r.type){case`JSXText`:{let t=wS(X(r,`value`)??``);t!==``&&n.push(this.checkedText(e,r,t));break}case`JSXExpressionContainer`:{let t=Y(r,`expression`);if(t===void 0||t.type===`JSXEmptyExpression`)break;n.push(...this.content(e,t));break}case`JSXElement`:case`JSXFragment`:n.push(...this.element(e,r));break;case`JSXSpreadChild`:this.dynamic(e,r,`A spread child`,`List the children.`)}return n}content(e,t){if(e.depth>yS)return this.error(e,t,`nesting-limit`,`The template nests too deeply.`,`Flatten it.`),[];let n=jx(t);switch(n.type){case`JSXElement`:case`JSXFragment`:return this.element(e,n);case`StringLiteral`:{let t=X(n,`value`)??``;return t===``?[]:[this.checkedText(e,n,t)]}case`NumericLiteral`:return typeof n.value==`number`?[n.value]:[];case`BooleanLiteral`:case`NullLiteral`:return[];case`Identifier`:{let t=X(n,`name`)??``;if(t===`undefined`)return[];let r=e.env.get(t);if(r?.k===`nodes`)return[...r.nodes];break}case`LogicalExpression`:{let t=X(n,`operator`),r=Y(n,`left`),i=Y(n,`right`);if(t===`&&`&&r!==void 0&&i!==void 0){let t=this.predicate(e,r),a=this.content(e,i);return t===void 0?[]:[{if:t,then:a,src:this.src(e.module,n)}]}break}case`ConditionalExpression`:{let t=Y(n,`test`),r=Y(n,`consequent`),i=Y(n,`alternate`);if(t===void 0||r===void 0||i===void 0)return[];let a=this.predicate(e,t),o=this.content(e,r),s=this.content(e,i);return a===void 0?[]:[{if:a,then:o,...s.length===0?{}:{else:s},src:this.src(e.module,n)}]}case`CallExpression`:{let t=Y(n,`callee`),r=t===void 0?void 0:jx(t),i=r===void 0?void 0:Y(r,`property`);if(r?.type===`MemberExpression`&&r.computed!==!0&&i!==void 0&&X(i,`name`)===`map`)return this.each(e,n,r);break}}let r=this.value(e,n,!1);return r===void 0?[]:[r]}freshName(e,t){return this.uniqueName(e,t)}uniqueName(e,t){return e.loops.includes(t)?(this.uniqueId+=1,`${t}_${this.uniqueId}`):t}each(e,t,n){let r=Y(n,`object`),i=kx(t,`arguments`)[0];if(r===void 0||i===void 0)return[];let a=this.filterChain(e,r),o=a===void 0?this.value(e,r,!1):a.list,s=jx(i);if(s.type!==`ArrowFunctionExpression`&&s.type!==`FunctionExpression`)return this.dynamic(e,i,`A callback that is not an inline function`,"Write `.map((item) => <Row item={item} />)`."),[];if(o===void 0)return[];let c=this.eachOver(e,t,o,s,a?.filters??[]);return c===void 0?[]:[c]}filterChain(e,t){let n=[],r=jx(t);for(;r.type===`CallExpression`;){let e=Y(r,`callee`),t=e===void 0?void 0:jx(e),i=t===void 0?void 0:Y(t,`property`);if(t?.type!==`MemberExpression`||t.computed===!0||i===void 0||X(i,`name`)!==`filter`)break;let a=kx(r,`arguments`)[0],o=Y(t,`object`);if(a===void 0||o===void 0)return;n.unshift(jx(a)),r=jx(o)}if(n.length!==0)return{list:this.value(e,r,!1),filters:n}}whereClause(e,t,n){let r=[];for(let i of n){if(!/Function/.test(i.type)){this.dynamic(e,i,"A `.filter` callback that is not an inline function","Write `.filter((item) => item.done)`.");return}let n=kx(i,`params`);if(n.length>1){this.error(e,i,`dynamic-expression`,"A `.filter` callback reads the item; its index and the array are not part of the profile.",`Remove the extra parameters.`);return}let a=new Map(e.env);n[0]!==void 0&&this.bindPattern(e,n[0],{k:`path`,path:`$${t}`},a,!1);let o={...e,env:a},s=this.functionExpression(o,i),c=s===void 0?void 0:this.predicate(o,s);if(c===void 0)return;r.push(c)}if(r.length!==0)return r.length===1?r[0]:{and:r}}eachOver(e,t,n,r,i=[],a={}){let o=kx(r,`params`);if(o.length>2){this.error(e,r,`dynamic-expression`,"`.map` callbacks read the item and its index; a third parameter is the whole array.",`Remove the third parameter.`);return}let s=new Map(e.env),c=[...e.loops],l=``,u,d=o[0];if(d!==void 0){let t=d.type===`Identifier`?X(d,`name`)??`item`:`item`;l=this.uniqueName({...e,loops:c},a.name??t),c.push(l),this.bindPattern({...e,loops:c},d,{k:`path`,path:`$${l}`},s,!1)}else l=this.uniqueName(e,a.name??`item`),c.push(l);let f=o[1];f!==void 0&&(f.type===`Identifier`?(u=this.uniqueName({...e,loops:c},X(f,`name`)??`index`),c.push(u),s.set(X(f,`name`)??`index`,{k:`value`,value:{bind:`$${u}`}})):this.error(e,f,`unsupported-pattern`,`The index is a plain name.`));let p=i.length===0?void 0:this.whereClause(e,l,i);if(i.length>0&&p===void 0)return;let m={...e,env:s,loops:c,depth:e.depth+1},h=this.functionExpression(m,r);if(h===void 0)return;let g=this.content(m,h);return{each:n,as:l,...u===void 0?{}:{index:u},...p===void 0?{}:{where:p},...a.chunk===void 0?{}:{chunk:a.chunk},children:g,src:this.src(e.module,t)}}element(e,t){if(t.type===`JSXFragment`)return this.jsxChildren({...e,depth:e.depth+1},t);let n=Y(t,`openingElement`),r=n===void 0?void 0:Y(n,`name`);if(n===void 0||r===void 0)return[];let i=TS(r),a={...e,depth:e.depth+1};return a.depth>yS?(this.error(e,t,`nesting-limit`,`The template nests too deeply.`,`Flatten it.`),[]):/^[a-z]/.test(i)&&!i.includes(`.`)?this.intrinsic(a,t,n,i):this.component(a,t,n,i)}attributeName(e){let t=Y(e,`name`);return t===void 0?``:TS(t)}intrinsic(e,t,n,r){let i=kg(r);if(i===void 0){let n=Vx(r,Object.keys(Og));return this.error(e,t,`unsupported-element`,`<${r}> is not part of the supported email vocabulary.`,n===void 0?`Use one of: ${Object.keys(Og).join(`, `)}.`:`Did you mean <${n}>? Supported elements: ${Object.keys(Og).join(`, `)}.`),[]}let a={},o,s=[this.findings.locate(e.module.parsed,t)];for(let t of kx(n,`attributes`)){if(t.type===`JSXSpreadAttribute`){this.dynamic(e,t,`A spread attribute`,`Write each attribute.`);continue}let n=this.attributeName(t),c=Y(t,`value`);if(n===`key`)continue;if(n===`ref`||n===`dangerouslySetInnerHTML`||/^on[A-Z]/.test(n)){let r=n===`dangerouslySetInnerHTML`;this.error(e,t,r?`dangerous-html`:n===`ref`?`unsupported-attribute`:`event-handler`,r?"`dangerouslySetInnerHTML` injects unescaped markup.":n===`ref`?"A `ref` needs a running component.":`\`${n}\` is an event handler; email clients strip scripting and Samva refuses it.`,r?`Write the markup as elements.`:`Remove it.`);continue}if($h.has(n)){this.error(e,t,`reserved-attribute`,`\`${n}\` is written only by BrandFooter from samva:brand.`,`Render <BrandFooter /> instead of marking an element as the footer.`);continue}if(n===`className`||n===`class`){let t=c===void 0?``:this.classValue(e,c);t!==void 0&&t!==``&&(a.class=t);continue}if(n===`style`){o=this.styleAttribute(e,c);continue}let l;if(c===void 0)l=!0;else if(c.type===`StringLiteral`)l=this.checkedText(e,c,X(c,`value`)??``);else if(c.type===`JSXExpressionContainer`){let t=Y(c,`expression`);l=t===void 0?void 0:this.value(e,t,!1)}else{this.error(e,c,`dynamic-expression`,`An attribute value is text, a number or a binding.`);continue}if(l!==void 0&&l!==!1&&l!==null){if(l===`%samva:unsubscribe-url%`){this.error(e,t,`reserved-url`,`That URL is the unsubscribe placeholder only BrandFooter can write.`,`Render <BrandFooter /> instead.`);continue}if(ES(l)){let a=Qg(r,n,l,s);if(a.text===void 0&&a.diagnostics.length===0){let a=Vx(n,Object.keys({...i.attributes,id:0,title:0,lang:0,dir:0,role:0}));this.error(e,t,`unsupported-attribute`,`<${r}> does not support the ${n} attribute.`,a===void 0?`Supported: ${Object.keys(i.attributes).join(`, `)||`none`}, plus id, title, lang, dir, role, class, style, data-* and aria-*.`:`Did you mean \`${a}\`?`);continue}this.findings.items.push(...a.diagnostics)}a[n]=l}}let c=i.content===`void`?[]:this.jsxChildren(e,t);return[{el:r,...Object.keys(a).length===0?{}:{attrs:a},...o===void 0?{}:{style:o},...c.length===0?{}:{children:c},src:this.src(e.module,t)}]}classValue(e,t){let n=t.type===`JSXExpressionContainer`?Y(t,`expression`):t;if(n===void 0)return;let r=this.classExpression(e,n);return r===void 0&&this.error(e,t,`dynamic-class`,`This class is built at run time, and Tailwind cannot see class names it does not read.`,'Write the classes literally, or choose between literal classes: `input.vip ? "bg-amber-100" : "bg-white"`.'),r}classExpression(e,t){let n=jx(t);switch(n.type){case`StringLiteral`:return X(n,`value`)??``;case`NullLiteral`:return``;case`BooleanLiteral`:return``;case`Identifier`:case`MemberExpression`:{if(n.type===`Identifier`&&X(n,`name`)===`undefined`)return``;let t=this.binding(e,n);return t?.k===`value`&&AS(t.value)?t.value:void 0}case`TemplateLiteral`:{let t=kx(n,`quasis`),r=kx(n,`expressions`),i=[];for(let[n,a]of t.entries()){let t=jS(a);t!==``&&i.push(t);let o=r[n];if(o!==void 0){let t=this.classExpression(e,o);if(t===void 0)return;i.push(t)}}return MS(i)}case`ConditionalExpression`:{let t=Y(n,`test`),r=Y(n,`consequent`),i=Y(n,`alternate`);if(t===void 0||r===void 0||i===void 0)return;let a=this.predicate(e,t),o=this.classExpression(e,r),s=this.classExpression(e,i);return a===void 0||o===void 0||s===void 0?void 0:{if:a,then:o,else:s}}case`LogicalExpression`:{let t=Y(n,`left`),r=Y(n,`right`);if(X(n,`operator`)!==`&&`||t===void 0||r===void 0)return;let i=this.predicate(e,t),a=this.classExpression(e,r);return i===void 0||a===void 0?void 0:{if:i,then:a,else:``}}case`BinaryExpression`:{let t=Y(n,`left`),r=Y(n,`right`);if(X(n,`operator`)!==`+`||t===void 0||r===void 0)return;let i=this.classExpression(e,t),a=this.classExpression(e,r);return i===void 0||a===void 0?void 0:MS([i,a])}default:return}}styleAttribute(e,t){let n=t===void 0?void 0:Y(t,`expression`),r=n===void 0?void 0:jx(n);if(r===void 0||r.type!==`ObjectExpression`){t!==void 0&&this.error(e,t,`invalid-style`,"`style` is an object literal of CSS properties.",`Write style={{ backgroundColor: "#fff" }}, or use Tailwind classes.`);return}return this.styleObject(e,r)}styleObject(e,t){let n=[];for(let r of kx(t,`properties`)){if(r.type!==`ObjectProperty`||r.computed===!0){this.dynamic(e,r,`A spread or computed style entry`,`Write each property.`);continue}let t=Y(r,`key`),i=Y(r,`value`),a=Ax(t);if(a===void 0||i===void 0)continue;let o=this.value(e,i,!1);o!=null&&n.push([a,o])}return n}component(e,t,n,r){let i=r.split(`.`)[0]??r,a=e.module.imports.get(i),o=e.module.declarations.get(i),s=kx(n,`attributes`);if(a?.kind===`markup`||a?.kind===`brand`)return mS({lowerer:this,ctx:e,node:t,attributes:s,name:r,binding:a,brand:this.options.brand,channel:this.options.channel});let c;if(a?.kind===`project`){let e=this.options.project.modules.get(a.path);e!==void 0&&(c=this.exportedFunction(e,a.imported,new Set))}else o!==void 0&&(c={module:e.module,value:o.value});return c===void 0||!/Function|Arrow/.test(c.value.type)?(this.error(e,t,`unknown-component`,`<${r}> is not a component the profile can read.`,`Import it from @samva/markup/email/components, or from a project file that exports it as a function.`),[]):this.partial(e,t,s,r,c.module,c.value)}exportedFunction(e,t,n){let r=`${e.path}\0${t}`;if(n.has(r))return;if(n.add(r),t==="default"){let t=e.defaultExport;if(t===void 0)return;if(t.type===`Identifier`){let n=e.declarations.get(X(t,`name`)??``);return n===void 0?void 0:{module:e,value:n.value}}return{module:e,value:t}}let i=e.exports.get(t);if(i===void 0)return;let a=e.declarations.get(i);if(a!==void 0)return{module:e,value:a.value};let o=e.imports.get(i);if(o?.kind===`project`){let e=this.options.project.modules.get(o.path);return e===void 0?void 0:this.exportedFunction(e,o.imported,n)}}attributeBindings(e,t){let n=new Map,r=!0;for(let i of t){if(i.type===`JSXSpreadAttribute`){this.dynamic(e,i,`A spread attribute`,`Write each prop.`),r=!1;continue}let t=this.attributeName(i);if(t===`key`)continue;let a=Y(i,`value`);if(a===void 0){n.set(t,{k:`value`,value:!0});continue}if(a.type===`StringLiteral`){n.set(t,{k:`value`,value:this.checkedText(e,a,X(a,`value`)??``)});continue}let o=a.type===`JSXExpressionContainer`?Y(a,`expression`):void 0;if(o===void 0){this.error(e,a,`dynamic-expression`,`A prop value is text, a number, a binding or an object.`),r=!1;continue}let s=this.propBinding(e,o);s===void 0?r=!1:n.set(t,s)}return r?n:void 0}propBinding(e,t){let n=jx(t);if(n.type===`ObjectExpression`){let t=new Map;for(let r of kx(n,`properties`)){if(r.type!==`ObjectProperty`||r.computed===!0){this.dynamic(e,r,`A spread or computed entry`,`Write each field.`);return}let n=Y(r,`key`),i=Y(r,`value`),a=n===void 0?void 0:n.type===`Identifier`?X(n,`name`):X(n,`value`);if(a===void 0||i===void 0)return;let o=this.propBinding(e,i);if(o===void 0)return;t.set(a,o)}return{k:`object`,fields:t}}if(n.type===`Identifier`||n.type===`MemberExpression`)return this.binding(e,n);if(n.type===`JSXElement`||n.type===`JSXFragment`)return{k:`nodes`,nodes:this.element(e,n)};let r=this.value(e,n,!1);return r===void 0?void 0:{k:`value`,value:r}}partial(e,t,n,r,i,a){let o=`${i.path}#${a.start}`;if(e.stack.includes(o))return this.error(e,t,`recursive-partial`,`<${r}> renders itself, and the compiler inlines partials.`,"Flatten the recursion, or repeat the structure with `.map`."),[];let s=this.attributeBindings(e,n);if(s===void 0)return[];let c=this.jsxChildren(e,t);c.length>0&&s.set(`children`,{k:`nodes`,nodes:c});let l={module:i,env:new Map,stack:[...e.stack,o],loops:e.loops,depth:e.depth+1},u=new Map,d=kx(a,`params`)[0];if(d!==void 0){let e={k:`object`,fields:s};d.type===`Identifier`?u.set(X(d,`name`)??`props`,e):this.bindPattern(l,d,e,u,!0)}let f={...l,env:u},p=this.functionExpression(f,a);return p===void 0?[]:this.content(f,p)}},kS=e=>e===void 0?``:e.type===`Identifier`?X(e,`name`)??``:`…`,AS=e=>typeof e==`string`?!0:typeof e!=`object`||!e?!1:`if`in e?AS(e.then)&&AS(e.else):`concat`in e&&e.concat.every(AS),jS=e=>{let t=e.value;if(typeof t!=`object`||!t)return``;let n=t.cooked,r=t.raw;return typeof n==`string`?n:typeof r==`string`?r:``},MS=e=>{let t=[];for(let n of e){let e=t[t.length-1];if(typeof n==`string`&&typeof e==`string`)t[t.length-1]=e+n;else if(typeof n==`object`&&n&&`concat`in n)for(let e of n.concat){let n=t[t.length-1];typeof e==`string`&&typeof n==`string`?t[t.length-1]=n+e:t.push(e)}else t.push(n)}return t.length===0?``:t.length===1?t[0]:{concat:t}},NS=()=>void 0,PS=60,FS=60,IS=1024,LS=25,RS=2,zS=1,BS=10,VS=10,HS=e=>e.type===`JSXIdentifier`?X(e,`name`)??``:e.type===`JSXMemberExpression`?`${HS(Y(e,`object`)??e)}.${X(Y(e,`property`)??e,`name`)??``}`:``,US=e=>{let t=Y(e,`openingElement`),n=t===void 0?void 0:Y(t,`name`);return n===void 0?``:HS(n)},WS=e=>{let t=Y(e,`openingElement`);return t===void 0?[]:kx(t,`attributes`)},GS=(e,t,n,r)=>{let i=e.openFunction(t);if(i===void 0)return;let{ctx:a,body:o}=i,s=jx(o),c=s.type===`JSXElement`?US(s):``,l=a.module.imports.get(c);if(s.type!==`JSXElement`||l?.kind!==`markup`||l.specifier!==r||l.imported!==n){e.lowerer.error(a,s,`wrong-channel`,`The ${n===`Sms`?`sms`:`whatsapp`} channel returns one <${n}> element imported from ${r}.`,`Write \`import { ${n} } from "${r}"\` and return <${n}>…</${n}>.`);return}return{ctx:a,node:s,local:c}},KS=(e,t,n)=>{let r=new Map;for(let i of WS(t.node)){if(i.type===`JSXSpreadAttribute`){e.lowerer.error(t.ctx,i,`dynamic-expression`,`A spread attribute runs code, and templates render without running code.`,`Write each attribute as a string literal.`);continue}let a=Y(i,`name`),o=a===void 0?``:HS(a);if(o===`key`)continue;if(!n.includes(o)){e.lowerer.error(t.ctx,i,`unknown-attribute`,`\`${o}\` is not an attribute of this component.`,`The attributes are ${n.join(`, `)}.`);continue}let s=Y(i,`value`),c=s?.type===`JSXExpressionContainer`?Y(s,`expression`):s;if(c?.type!==`StringLiteral`){e.lowerer.error(t.ctx,i,`dynamic-expression`,`\`${o}\` is fixed when the template is compiled, so it is a string literal.`,`Write ${o}="…".`);continue}r.set(o,X(c,`value`)??``)}return r},qS=(e,t,n,r,i,a)=>a.includes(i)?!0:(e.lowerer.error(t.ctx,n,`invalid-attribute`,`\`${i}\` is not a ${r} this channel accepts.`,`Use one of ${a.join(`, `)}.`),!1),JS=e=>e.every(e=>Lx(e)),YS=e=>e.some(e=>Lx(e)?!1:`el`in e||`raw`in e?!0:`if`in e?YS(e.then)||YS(e.else??[]):`each`in e&&YS(e.children)),XS=(e,t)=>{let n=GS(e,t,`Sms`,`@samva/markup/sms`);if(n===void 0)return;let r=KS(e,n,z_),i=WS(n.node).find(e=>X(Y(e,`name`)??e,`name`)===`category`),a=r.get(`category`);if(a!==void 0&&i!==void 0&&!qS(e,n,i,`category`,a,I_))return;let o=e.lowerer.jsxChildren(n.ctx,n.node);return YS(o)&&e.lowerer.error(n.ctx,n.node,`sms-markup`,`An SMS body is plain text, and this one contains an element.`,`Write the message as text and bindings; use a newline in the text for a line break.`),e.schema!==void 0&&e.checks.push(...Zx(e.schema,o,[])),{...a===void 0?{}:{category:a},body:o}},ZS=e=>typeof e==`string`?e.length:typeof e==`number`?String(e).length:typeof e==`object`&&e&&`concat`in e?e.concat.reduce((e,t)=>e+ZS(t),0):0,QS={url:0,phone:0,quickReply:0,total:0},$S=e=>{let t=QS;for(let n of e){let e;if(`if`in n){let t=$S(n.then),r=$S(n.else??[]);e={url:Math.max(t.url,r.url),phone:Math.max(t.phone,r.phone),quickReply:Math.max(t.quickReply,r.quickReply),total:Math.max(t.total,r.total)}}else e={url:+(n.type===`url`),phone:+(n.type===`phone`),quickReply:+(n.type===`quick-reply`),total:1};t={url:t.url+e.url,phone:t.phone+e.phone,quickReply:t.quickReply+e.quickReply,total:t.total+e.total}}return t},eC=e=>e.flatMap(e=>{if(`if`in e)return[{if:e.if,then:eC(e.then),...e.else===void 0?{}:{else:eC(e.else)},...e.src===void 0?{}:{src:e.src}}];switch(e.type){case`quick-reply`:return[e.text];case`url`:return[e.text,e.url];case`phone`:return[e.text,e.phone];case`copy-code`:return[e.code]}}),tC=(e,t)=>{let n=GS(e,t,`WhatsApp`,`@samva/markup/whatsapp`);if(n===void 0)return;let{lowerer:r}=e,{ctx:i}=n,a=KS(e,n,B_);for(let e of[`category`,`language`])a.has(e)||r.error(i,n.node,`missing-attribute`,`<WhatsApp> needs \`${e}\`.`,e===`category`?`Write category="utility" (${L_.join(`, `)}).`:`Write language="en_US".`);let o=a.get(`category`),s=WS(n.node).find(e=>X(Y(e,`name`)??e,`name`)===`category`);if(o!==void 0&&s!==void 0&&!qS(e,n,s,`category`,o,L_))return;let c=new Map;for(let e of kx(n.node,`children`)){if(e.type===`JSXText`){(X(e,`value`)??``).trim()!==``&&r.error(i,e,`whatsapp-structure`,`Text sits inside Header, Body, Footer or Buttons, not directly in <WhatsApp>.`,`Move it into <WhatsApp.Body>.`);continue}let t=e.type===`JSXElement`?US(e):``,a=t.startsWith(`${n.local}.`)?t.slice(n.local.length+1):``;if(![`Header`,`Body`,`Footer`,`Buttons`].includes(a)){r.error(i,e,`whatsapp-structure`,`<WhatsApp> holds <WhatsApp.Header>, <WhatsApp.Body>, <WhatsApp.Footer> and <WhatsApp.Buttons>.`,`Wrap the content in one of them.`);continue}if(c.has(a)){r.error(i,e,`whatsapp-structure`,`<WhatsApp.${a}> appears twice.`,`A WhatsApp template has at most one of each part.`);continue}c.set(a,e)}let l=[],u=(e,t,n,a)=>{n>a&&r.findings.add(i.module.parsed,t,`whatsapp-length`,`The ${e} is at least ${n} characters, and Meta allows ${a}.`,`Shorten the ${e}.`,`warning`)},d=(e,t,n)=>{let a=r.jsxChildren(i,t);if(!JS(a)){r.error(i,t,`whatsapp-conditional`,`A WhatsApp ${e} cannot branch or contain elements: Meta registers its text once.`,`Choose the wording as a parameter in the payload, or write separate templates.`);return}return u(e,t,a.reduce((e,t)=>e+(Lx(t)?ZS(t):0),0),n),l.push(...a),a},f,p=c.get(`Header`);if(p!==void 0){let e=WS(p).find(e=>X(Y(e,`name`)??e,`name`)===`type`),t=e===void 0?void 0:Y(e,`value`),n=t?.type===`JSXExpressionContainer`?Y(t,`expression`):t,a=n?.type===`StringLiteral`?X(n,`value`)??`text`:`text`;if(e!==void 0&&n?.type!==`StringLiteral`)r.error(i,e,`dynamic-expression`,"`type` is fixed when the template is compiled, so it is a string literal.",`Write type="image".`);else if(e!==void 0&&!R_.includes(a))r.error(i,e,`invalid-attribute`,`\`${a}\` is not a header type.`,`Use one of ${R_.join(`, `)}.`);else{let e=a,t=d(`header`,p,e===`text`?PS:1/0);t!==void 0&&(e===`text`?zx(t).params.length>1&&r.error(i,p,`whatsapp-header-variables`,`A WhatsApp header text takes at most one variable.`,`Keep one binding in the header and move the rest to the body.`):t.length!==1&&r.error(i,p,`whatsapp-header-media`,`A ${e} header is one URL.`,`Write the media URL as the only child: a literal or one binding.`),f={type:e,content:t})}}let m=[],h=c.get(`Body`);if(h===void 0)r.error(i,n.node,`whatsapp-body-required`,`A WhatsApp template needs a body.`,`Add <WhatsApp.Body>…</WhatsApp.Body>.`);else{let e=d(`body`,h,IS);m=e??[],e!==void 0&&e.length===0&&r.error(i,h,`whatsapp-body-required`,`The WhatsApp body is empty.`,`Write the message text.`)}let g=c.get(`Footer`),_=g===void 0?void 0:d(`footer`,g,FS),v=c.get(`Buttons`),y=v===void 0?void 0:rC(e,i,n.local,v);if(y!==void 0){let e=$S(y),t=(e,t,n)=>{t>n&&r.error(i,v,`whatsapp-button-limit`,`A WhatsApp template allows ${n} ${e}, and these conditions can produce ${t}.`,`Remove ${t-n}, or split the template.`)};t(`URL buttons`,e.url,RS),t(`phone buttons`,e.phone,zS),t(`quick-reply buttons`,e.quickReply,BS),t(`buttons in all`,e.total,VS),l.push(...eC(y))}if(e.schema!==void 0&&e.checks.push(...Zx(e.schema,l,[])),o===void 0||!a.has(`language`))return;let b=a.get(`name`);return{...b===void 0?{}:{name:b},category:o,language:a.get(`language`),...f===void 0?{}:{header:f},body:m,..._===void 0?{}:{footer:_},...y===void 0?{}:{buttons:y}}},nC=[`UrlButton`,`QuickReplyButton`,`PhoneButton`,`CopyCodeButton`],rC=(e,t,n,r)=>{let{lowerer:i}=e,a=(e,n)=>{let r=i.jsxChildren(t,e);if(!JS(r)||r.length===0){i.error(t,e,r.length===0?`whatsapp-button-text`:`whatsapp-conditional`,r.length===0?`A button needs its ${n}.`:`A button ${n} cannot branch or contain elements.`,`Write the ${n} as text between the tags.`);return}let a=MS(r);return n===`label`&&ZS(a)>LS&&i.findings.add(t.module.parsed,e,`whatsapp-length`,`The button label is at least ${ZS(a)} characters, and Meta allows ${LS}.`,`Shorten the label.`,`warning`),a},o=(e,n)=>{let r=i.attributeBindings(t,WS(e));if(r===void 0)return;let a=WS(e).map(e=>X(Y(e,`name`)??e,`name`));for(let r of a)r!==void 0&&r!==n&&r!==`key`&&i.error(t,e,`unknown-attribute`,`\`${r}\` is not an attribute of this button.`,n===void 0?`Remove it.`:`The attribute is ${n}.`);if(n===void 0)return;let o=r.get(n),s=o===void 0?void 0:Fx(o);return s===void 0&&i.error(t,e,`missing-attribute`,`This button needs \`${n}\`.`,`Write ${n}="…" or ${n}={input.field}.`),s},s=e=>{let r=US(e);switch(r.startsWith(`${n}.`)?r.slice(n.length+1):``){case`UrlButton`:{let t=o(e,`url`),n=a(e,`label`);return t===void 0||n===void 0?void 0:{type:`url`,text:n,url:t}}case`PhoneButton`:{let t=o(e,`phone`),n=a(e,`label`);return t===void 0||n===void 0?void 0:{type:`phone`,text:n,phone:t}}case`QuickReplyButton`:{o(e,void 0);let t=a(e,`label`);return t===void 0?void 0:{type:`quick-reply`,text:t}}case`CopyCodeButton`:{let t=a(e,`code`);return t===void 0?void 0:{type:`copy-code`,code:t}}default:i.error(t,e,`whatsapp-structure`,`<WhatsApp.Buttons> holds ${nC.map(e=>`<WhatsApp.${e}>`).join(`, `)}.`,`Use one of the button components.`);return}},c=e=>{let n=jx(e);switch(n.type){case`JSXElement`:{let e=s(n);return e===void 0?[]:[e]}case`JSXFragment`:return l(n);case`NullLiteral`:case`BooleanLiteral`:return[];case`LogicalExpression`:{let e=Y(n,`left`),r=Y(n,`right`);if(X(n,`operator`)===`&&`&&e!==void 0&&r!==void 0){let a=i.predicate(t,e),o=c(r);return a===void 0?[]:[{if:a,then:o,src:i.src(t.module,n)}]}break}case`ConditionalExpression`:{let e=Y(n,`test`),r=Y(n,`consequent`),a=Y(n,`alternate`);if(e===void 0||r===void 0||a===void 0)return[];let o=i.predicate(t,e),s=c(r),l=c(a);return o===void 0?[]:[{if:o,then:s,...l.length===0?{}:{else:l},src:i.src(t.module,n)}]}}return i.error(t,n,`dynamic-expression`,`Buttons are fixed by the template, and this expression builds them at render time.`,"List each button; wrap one in `condition && <WhatsApp.UrlButton … />` to make it optional."),[]},l=e=>{let n=[];for(let r of kx(e,`children`))if(r.type===`JSXText`)(X(r,`value`)??``).trim()!==``&&i.error(t,r,`whatsapp-structure`,`Text cannot sit between buttons.`,`Put the label inside the button.`);else if(r.type===`JSXExpressionContainer`){let e=Y(r,`expression`);e!==void 0&&e.type!==`JSXEmptyExpression`&&n.push(...c(e))}else n.push(...c(r));return n};return l(r)},iC=e=>{let t=e.fields.get(`sms`),n=e.fields.get(`whatsapp`),r=t===void 0?void 0:XS(e,t),i=n===void 0?void 0:tC(e,n);return{...r===void 0?{}:{sms:r},...i===void 0?{}:{whatsapp:i}}},aC=8,oC=(e,t)=>{if(`leaf`in e){let n=e.leaf,r=e=>`leaf`in e?{leaf:n+e.leaf}:{pred:e.pred,then:r(e.then),else:r(e.else)};return r(t)}return{pred:e.pred,then:oC(e.then,t),else:oC(e.else,t)}},sC=e=>{if(typeof e==`string`)return{leaf:e};if(typeof e==`object`&&e){if(`if`in e){let t=sC(e.then),n=sC(e.else);return t===void 0||n===void 0?void 0:{pred:e.if,then:t,else:n}}if(`concat`in e){let t={leaf:``};for(let n of e.concat){let e=sC(n);if(e===void 0)return;t=oC(t,e)}return t}}},cC=e=>`leaf`in e?[e.leaf]:[...cC(e.then),...cC(e.else)],lC=(e,t,n={next:0})=>{if(`leaf`in e)return t(n.next++);let r=lC(e.then,t,n),i=lC(e.else,t,n);return JSON.stringify(r)===JSON.stringify(i)?r:{if:e.pred,then:r,else:i}},uC=(e,t)=>{for(let n of e)Lx(n)||(`el`in n?(t.push({kind:`el`,el:n}),uC(n.children??[],t)):`if`in n?(uC(n.then,t),uC(n.else??[],t)):`each`in n?uC(n.children,t):`raw`in n&&t.push({kind:`raw`,raw:n}))},dC=(e,t)=>t.map(t=>typeof t==`string`?t:e.value(`attr`in t?t.attr:t.text)).join(``),fC=(e,t,n)=>{let r=[];uC([e],r);let i=new nS,a=r.map(e=>{if(e.kind!==`el`)return;let t=e.el.attrs?.class;if(t===void 0)return;let n=sC(t);if(n!==void 0)return n}),o=a.map(e=>e===void 0?1:cC(e).length);for(let[t,i]of o.entries())if(i>aC){let a=r[t],o=a?.kind===`el`?n.locate(a.el.src):void 0;return n.report({code:`too-many-class-variants`,severity:`error`,message:`This class list chooses between ${i} literal lists; the compiler resolves at most ${aC}.`,fix:`Split the choice into fewer conditions, or move part of it to a partial.`,origins:o===void 0?[]:[o]}),{root:e,headCss:``,fontFaceCss:``}}let s=Math.max(1,...o),c=(e,t,r)=>e.flatMap(e=>{if(Lx(e))return[];if(`el`in e){let o=r.next++,s=a[o],l=s===void 0?void 0:cC(s),u={};for(let[t,n]of Object.entries(e.attrs??{}))t!==`class`&&(typeof n==`string`||typeof n==`number`?u[t]=n:typeof n==`object`&&n&&(u[t]=i.value(n)));l===void 0?e.attrs?.class!==void 0&&(u.class=i.value(e.attrs.class)):u.class=l[Math.min(t,l.length-1)];let d=e.style;if(Array.isArray(d)){let e={};for(let[t,n]of d)n!==null&&typeof n!=`boolean`&&(e[t]=typeof n==`number`?n:i.value(n));u.style=e}else if(typeof d==`string`&&d!==``){let e={};for(let t of d.split(`;`)){let n=t.indexOf(`:`);n>0&&(e[t.slice(0,n)]=t.slice(n+1))}u.style=e}let f=n.locate(e.src);return[ng.Element({tag:e.el,props:u,children:c(e.children??[],t,r),origins:f===void 0?[]:[f],authored:!0})]}return`if`in e?[ng.Fragment({children:[...c(e.then,t,r),...c(e.else??[],t,r)]})]:`each`in e?[ng.Fragment({children:c(e.children,t,r)})]:`raw`in e?(r.next++,[ng.Raw({html:dC(i,e.raw),text:``,origins:[]})]):[]}),l=(e,t)=>{for(let n of e)n.type===`Fragment`?l(n.children,t):n.type===`Raw`?t.raws.push(n.html):n.type===`Element`&&(t.styles.push(n.props.style===void 0?void 0:n.props.style),t.bgcolors.push(typeof n.props.bgcolor==`string`?n.props.bgcolor:void 0),l(n.children,t))},u=[],d=``,f=``,p=new Set;for(let r=0;r<s;r++){let i=N_(c([e],r,{next:0})[0]??ng.Fragment({children:[]}),t);r===0&&(d=i.headCss,f=i.fontFaceCss);for(let e of i.diagnostics){let t=`${e.code}\0${e.message}`;p.has(t)||(p.add(t),n.report(e))}let a={styles:[],bgcolors:[],raws:[]};l([i.tree],a),u.push(a)}let m=(e,t)=>{if(e===void 0)return``;let r=Object.entries(e);if(r.length===0)return``;let a=n.locate(t.src),o=r.some(([,e])=>e.includes(``)),s=Zg(Object.fromEntries(r.filter(([,e])=>!e.includes(``))),a===void 0?[]:[a]);for(let e of s.diagnostics)n.report(e);return o?r.map(([e,t])=>[e,i.toValue(t)??t]):s.css},h=0,g=0,_=0,v=e=>e.map(e=>{if(Lx(e))return e;if(`el`in e){let t=h++,n=g++,r=a[t],o=u[0],s=o?.styles[n],c=r!==void 0&&cC(r).length>1?lC(r,t=>m(u[Math.min(t,u.length-1)]?.styles[n],e)):m(s,e),l=o?.bgcolors[n],d=typeof e.attrs?.bgcolor==`string`&&l!==void 0&&l!==e.attrs.bgcolor?{...e.attrs,bgcolor:i.toValue(l)??l}:e.attrs,f=v(e.children??[]),{style:p,children:_,attrs:y,...b}=e;return{...b,...d===void 0?{}:{attrs:d},...c===``?{}:{style:c},...f.length===0?{}:{children:f}}}if(`if`in e){let t=v(e.then),n=v(e.else??[]);return{...e,then:t,...e.else===void 0?{}:{else:n}}}if(`each`in e)return{...e,children:v(e.children)};if(`raw`in e){h++;let t=u[0]?.raws[_++];return t===void 0?e:{...e,raw:aS(i,t)}}return e});return{root:v([e])[0]??e,headCss:d,fontFaceCss:f}},pC=`defineTemplate`,mC=[`email`,`sms`,`whatsapp`],hC=(e,t)=>{let n=e.entry,r=n.defaultExport;r?.type===`Identifier`&&(r=n.declarations.get(X(r,`name`)??``)?.value);let i=(e,i,a=`no-template`)=>{t.add(n.parsed,r??n.parsed.program,a,e,i)};if(r===void 0||r.type!==`CallExpression`)return i(`The entry must default-export defineTemplate({ ... }).`,"Write `export default defineTemplate({ id, schema, fixtures, email })`.");let a=Y(r,`callee`),o=a===void 0?void 0:X(a,`name`),s=o===void 0?void 0:n.imports.get(o);if(o===`defineEmail`)return i("`defineEmail` runs a render function, which the static profile does not read.","Use `defineTemplate` from @samva/markup with `email: { subject, preheader, body }`.",`legacy-definition`);if(s?.kind!==`markup`||s.imported!==pC)return i(`The entry must default-export defineTemplate({ ... }) imported from @samva/markup.`,'Add `import { defineTemplate } from "@samva/markup";`.');let c=kx(r,`arguments`)[0],l=c===void 0?void 0:jx(c);if(l===void 0||l.type!==`ObjectExpression`)return i(`defineTemplate takes one object literal.`,`Write defineTemplate({ id, schema, fixtures, email }).`);let u=new Map;for(let e of kx(l,`properties`)){let r=gS(e),i=Y(e,`value`);if(r===void 0||i===void 0){t.add(n.parsed,e,`dynamic-definition`,`A definition field is written out, not spread or computed.`,"Write each field as `name: value`.");continue}u.set(r,i)}return{module:n,call:r,fields:u}},gC=(e,t,n)=>{let r=jx(n);if(/Function/.test(r.type))return{module:t,fn:r};if(r.type===`Identifier`){let n=X(r,`name`)??``,i=t.declarations.get(n);if(i!==void 0)return gC(e,t,i.value);let a=t.imports.get(n);if(a?.kind===`project`){let t=e.modules.get(a.path);if(t===void 0)return;let n=a.imported==="default"?void 0:t.exports.get(a.imported);if(a.imported==="default"&&t.defaultExport!==void 0)return gC(e,t,t.defaultExport);let r=n===void 0?void 0:t.declarations.get(n);return r===void 0?void 0:gC(e,t,r.value)}}},_C=e=>{let t=[],n=new Set,r=i=>{if(!n.has(i.path)){n.add(i.path);for(let n of i.ordered)if(n.kind===`css`)t.includes(n.path)||t.push(n.path);else{let t=e.modules.get(n.path);t!==void 0&&r(t)}}};return r(e.entry),t},vC=(e,t,n)=>{let r=!1,i=e=>e.map(e=>{if(r||Lx(e))return e;if(`el`in e)return t(e)?(r=!0,n(e)):{...e,...e.children===void 0?{}:{children:i(e.children)}};if(`if`in e){let t=i(e.then),n=i(e.else??[]);return{...e,then:t,...e.else===void 0?{}:{else:n}}}return`each`in e?{...e,children:i(e.children)}:e});return{nodes:i(e),done:r}},yC={raw:[`<!--[if !mso]><!-->`]},bC={raw:[`<!--<![endif]-->`]},xC=(e,t,n={},r=[])=>({ir:e.blocking?void 0:t,fixtures:n,assets:r,diagnostics:e.items}),SC=(e,t,n,r)=>{let i=(e,t={},i=r.assets)=>xC(n,e,t,i),a=r.urlFor,o={project:t,assetUrl:a},s=hC(t,n);if(s===void 0)return i(void 0);let{module:c,fields:l}=s,u=e=>l.get(e)??s.call,d=l.has(`id`)?vS(o,c,l.get(`id`)):void 0;d===void 0||!d.ok||typeof d.value!=`string`?n.add(c.parsed,u(`id`),`invalid-template-id`,`The template id is a string literal.`,`Write id: "order-shipped".`):Gh.test(d.value)||n.add(c.parsed,u(`id`),`invalid-template-id`,`Template id ${JSON.stringify(d.value)} is not lowercase kebab-case.`,`Write lowercase letters and digits joined by single hyphens, for example "order-shipped".`);let f=d!==void 0&&d.ok&&typeof d.value==`string`?d.value:``,p,m=l.get(`schema`);if(m===void 0)n.add(c.parsed,s.call,`missing-schema`,`The template declares no schema.`,"Add `schema: jsonSchema<Input>({ ... })`.");else{let t=vS(o,c,m);t.ok&&typeof t.value==`object`&&t.value!==null?p=t.value:e.schema===void 0?n.add(t.ok?c.parsed:t.module.parsed,t.ok?m:t.node,`schema-not-static`,`The schema cannot be read without running it${t.ok?``:` (${t.reason})`}.`,'Write the schema as a literal: `jsonSchema<Input>({ type: "object", properties: { … } })`, or compile with the schema a library already converted.'):p={...e.schema}}let h=()=>!0;if(p!==void 0)try{let e=Uh(Vh(p));h=e.validate,p=e.schema}catch(e){if(!(e instanceof TypeError))throw e;n.add(c.parsed,u(`schema`),`invalid-schema`,e.message,`Use only the JSON Schema keywords the README lists.`),p=void 0}let g={},_=l.get(`fixtures`);if(_===void 0)n.add(c.parsed,s.call,`missing-fixtures`,`The template declares no fixtures.`,"Add `fixtures: { default: { … } }`.");else{let e=vS(o,c,_);if(!e.ok)n.add(e.module.parsed,e.node,`fixtures-not-static`,`Fixtures are data, and this one is computed (${e.reason}).`,`Write each fixture as a literal object; an imported asset is allowed.`);else if(typeof e.value!=`object`||e.value===null||Object.keys(e.value).length===0)n.add(c.parsed,_,`missing-fixtures`,`The template declares no fixtures.`,"Declare at least one: `fixtures: { default: { … } }`.");else{let t=jx(_),r=new Map;if(t.type===`ObjectExpression`)for(let e of kx(t,`properties`)){let t=gS(e);t!==void 0&&r.set(t,Y(e,`key`)??e)}for(let[t,i]of Object.entries(e.value)){if(!Wh.test(t)){n.add(c.parsed,r.get(t)??_,`invalid-fixture-name`,`Fixture key ${JSON.stringify(t)} is not one path segment.`,"Use letters, digits, `.`, `_` and `-`, starting with a letter or digit.");continue}if(g[t]=i,p!==void 0&&!h(i)){let e=h.errors?.at(-1)??h.errors?.[0];n.add(c.parsed,r.get(t)??_,`fixture-invalid`,`Fixture ${JSON.stringify(t)} does not match the schema${e===void 0?``:`: ${e.instanceLocation===`#`||e.instanceLocation===void 0?``:`${e.instanceLocation.replace(/^#/,``)} `}${e.error??`is invalid`}`}.`,`Change the fixture, or the schema, so a fixture is a payload a send could make.`)}}}}let v=l.has(`locale`)?vS(o,c,l.get(`locale`)):void 0,y=v?.ok===!0&&typeof v.value==`string`?v.value:void 0;l.has(`locale`)&&y===void 0&&n.add(c.parsed,u(`locale`),`invalid-locale`,`The locale is a string literal.`,`Write locale: "en-US".`);let b=new OS({project:t,findings:n,staticContext:o,assetUrl:a,brand:e.brand,brand:e.brand,channel:NS}),x=e=>({module:e,env:new Map,stack:[],loops:[],depth:0}),S=e=>{let r=gC(t,c,e);if(r===void 0){n.add(c.parsed,e,`not-a-function`,`A channel field is a function of the input, written in place or declared in the project.`,"Write `(input) => …`.");return}let i=x(r.module),a=new Map,o=kx(r.fn,`params`)[0];o!==void 0&&b.bindPattern(i,o,{k:`path`,path:``},a,!1);let s={...i,env:a},l=b.functionExpression(s,r.fn);return l===void 0?void 0:{ctx:s,body:l}};for(let e of l.keys())[`id`,`schema`,`fixtures`,`locale`,...mC].includes(e)||n.add(c.parsed,u(e),`unknown-field`,`\`${e}\` is not a defineTemplate field.`,`The fields are id, schema, fixtures, locale, email, sms and whatsapp.`);let C,w=[],T=l.get(`email`),E;if(T!==void 0){let i=jx(T),a=new Map;if(i.type===`ObjectExpression`)for(let e of kx(i,`properties`)){let t=gS(e),n=Y(e,`value`);t!==void 0&&n!==void 0&&a.set(t,n)}else n.add(c.parsed,T,`invalid-channel`,"The email channel is an object: `{ subject, preheader, body }`.",`Write email: { subject: …, body: … }.`);for(let e of a.keys())[`subject`,`preheader`,`body`].includes(e)||n.add(c.parsed,a.get(e),`unknown-field`,`\`${e}\` is not an email field.`,`The fields are subject, preheader and body.`);let o=e=>{let t=a.get(e);if(t===void 0)return;let n=S(t);return n===void 0?void 0:b.value(n.ctx,n.body,!1)},s=a.has(`subject`)?o(`subject`):void 0;!a.has(`subject`)&&i.type===`ObjectExpression`&&n.add(c.parsed,T,`missing-subject`,`The email channel needs a subject.`,"Add `subject: (input) => …`.");let l=o(`preheader`),d,f=a.get(`body`);if(f===void 0&&i.type===`ObjectExpression`)n.add(c.parsed,T,`missing-body`,`The email channel needs a body.`,"Add `body: (input) => (<Email>…</Email>)`.");else if(f!==void 0){let e=S(f);if(e!==void 0){let t=b.content(e.ctx,e.body);t.length===1?d=t[0]:n.blocking||n.add(e.ctx.module.parsed,e.body,`multiple-roots`,t.length===0?`The email body renders nothing.`:`The email body renders more than one root.`,`Wrap the body in a single element such as <Email>.`)}}if(s!==void 0&&d!==void 0){let i=[];r.tailwindSheet!==void 0&&i.push(r.tailwindSheet);for(let e of _C(t)){let t=r.stylesheets.get(e);t!==void 0&&i.push(t)}let a=[e.entry,...b.sources],o=fC(d,Dx(i),{locate:t=>{if(t!==void 0)return{fileName:a[t[2]??0]??e.entry,lineNumber:t[0],columnNumber:t[1]}},report:e=>{n.items.push(e)}}),f=o.root;if(o.headCss!==``||o.fontFaceCss!==``){let e=[...o.headCss===``?[]:[{el:`style`,children:[o.headCss]}],...o.fontFaceCss===``?[]:[yC,{el:`style`,children:[o.fontFaceCss]},bC]],t=vC([f],e=>e.el===`head`,t=>({...t,children:[...t.children??[],...e]}));t.done?f=t.nodes[0]??f:n.items.push({code:`missing-head`,severity:`error`,message:`Styles that cannot be inlined — media queries, dark-scheme rules and pseudo-selectors — need a <head> to live in.`,fix:`Wrap the message in <Email>, or write those declarations as inline styles.`,origins:[]})}if(l!==void 0){let e=vC([f],e=>e.el===`body`,e=>({...e,children:[{preheader:!0},...e.children??[]]}));e.done?f=e.nodes[0]??f:n.add(c.parsed,u(`email`),`preheader-without-shell`,`A preheader is the hidden inbox preview inside <body>, and this body has no <Email> shell.`,`Wrap the body in <Email>.`)}Qx([f],e=>w.push(e)),p!==void 0&&w.push(...Zx(p,[f],[s,...l===void 0?[]:[l]])),E={subject:s,...l===void 0?{}:{preheader:l},body:f}}}let D=iC({lowerer:b,findings:n,fields:l,module:c,openFunction:S,checks:w,schema:p}),O=[e.entry,...b.sources];for(let t of w){let r=t.src,i=O[r?.[2]??0]??e.entry;n.items.push({code:t.code,severity:`error`,message:t.message,...t.fix===void 0?{}:{fix:t.fix},origins:r===void 0?[{fileName:e.entry,lineNumber:1,columnNumber:1}]:[{fileName:i,lineNumber:r[0],columnNumber:r[1]}]})}return p!==void 0&&f!==``&&(E!==void 0||D.sms!==void 0||D.whatsapp!==void 0)?C={sml:1,template:f,...y===void 0?{}:{locale:y},sources:O,...E===void 0?{}:{email:E},...D.sms===void 0?{}:{sms:D.sms},...D.whatsapp===void 0?{}:{whatsapp:D.whatsapp},schema:p}:T===void 0&&!l.has(`sms`)&&!l.has(`whatsapp`)&&n.add(c.parsed,s.call,`no-channel`,`The template declares no channel.`,"Add `email`, `sms` or `whatsapp`."),i(C,g)},CC=`@samva/markup`,wC=`@samva/markup/`,TC=[`.tsx`,`.ts`],EC=(e,t,n)=>{let r=F_(P_(e),t.replace(/[?#].*$/,``));if(r!==void 0){if(Object.hasOwn(n,r))return r;for(let e of TC)if(Object.hasOwn(n,`${r}${e}`))return`${r}${e}`;for(let e of TC)if(Object.hasOwn(n,`${r}/index${e}`))return`${r}/index${e}`}},DC=e=>/\.[cm]?[jt]sx?$/.test(e),OC=e=>e.type===`Identifier`?[X(e,`name`)??``]:[],kC=(e,t,n,r={})=>{let i=new Map,a=new Set,o=new Set,s=!1,c=t=>{let l=i.get(t);if(l!==void 0)return l;if(o.has(t))return;let u=e[t];if(u===void 0)return;let d=typeof u==`string`?u:new TextDecoder().decode(u),f;try{f=Nx(t,d)}catch(e){if(!(e instanceof Mx))throw e;n.items.push({code:`syntax-error`,severity:`error`,message:e.message,origins:[{fileName:t,lineNumber:e.line,columnNumber:e.column}]}),s=!0;return}o.add(t);let p=new Map,m=[],h=new Map,g=new Map,_,v=e=>{if(e.type===`VariableDeclaration`)for(let t of kx(e,`declarations`)){let n=Y(t,`id`),r=Y(t,`init`);if(n!==void 0&&r!==void 0)for(let t of OC(n))h.set(t,{value:jx(r),node:e})}else if(e.type===`FunctionDeclaration`){let t=X(Y(e,`id`)??e,`name`);t!==void 0&&h.set(t,{value:e,node:e})}};for(let i of kx(f.program,`body`))switch(i.type){case`ImportDeclaration`:{let o=X(Y(i,`source`)??i,`value`)??``,c=X(i,`importKind`)===`type`,l=kx(i,`specifiers`);if(c)break;let u=e=>X(Y(e,`local`)??e,`name`)??``,d=e=>{if(e.type===`ImportDefaultSpecifier`)return`default`;if(e.type===`ImportNamespaceSpecifier`)return`*`;let t=Y(e,`imported`);return t===void 0?u(e):X(t,`name`)??X(t,`value`)??u(e)};if(o===CC||o.startsWith(wC)){for(let e of l)X(e,`importKind`)!==`type`&&p.set(u(e),{kind:`markup`,specifier:o,imported:d(e),node:e});break}if(/^samva:brand(\/|$)/.test(o)){for(let e of l)X(e,`importKind`)!==`type`&&p.set(u(e),{kind:`brand`,specifier:o,imported:d(e),node:e});break}if(!/^\.{0,2}\//.test(o)){n.add(f,i,`non-project-import`,`\`${o}\` is not part of the project; templates import only @samva/markup and files inside the project.`,`Remove the import, or copy the code you need into a project file.`),s=!0;break}let h=EC(t,o,e);if(h===void 0&&r.lenient===!0){let e=F_(P_(t),o.replace(/[?#].*$/,``)),n=e!==void 0&&Yh(e),r=e!==void 0&&(DC(e)||!/\.[a-z0-9]+$/i.test(e));if(e!==void 0&&(e.endsWith(`.css`)||n||r)){if(!e.endsWith(`.css`))for(let t of l)n?p.set(u(t),{kind:`asset`,path:e,node:t}):(a.add(u(t)),p.set(u(t),{kind:`project`,path:e,imported:d(t),node:t}));break}}if(h===void 0){n.add(f,i,`unresolved-import`,`\`${o}\` names no file in the project.`,`Check the path and the file extension.`),s=!0;break}if(h.endsWith(`.css`)){m.push({kind:`css`,path:h});break}if(Yh(h)){for(let e of l)p.set(u(e),{kind:`asset`,path:h,node:e});break}if(DC(h)){m.push({kind:`script`,path:h});for(let e of l)p.set(u(e),{kind:`project`,path:h,imported:d(e),node:e});break}n.add(f,i,`unresolved-import`,`\`${o}\` is a file type templates cannot import.`,`Import a script, a stylesheet or an asset such as .png or .woff2.`),s=!0;break}case`ExportNamedDeclaration`:{let e=Y(i,`declaration`);if(e!==void 0){if(v(e),e.type===`VariableDeclaration`)for(let t of kx(e,`declarations`))for(let e of OC(Y(t,`id`)??t))g.set(e,e);else if(e.type===`FunctionDeclaration`){let t=X(Y(e,`id`)??e,`name`);t!==void 0&&g.set(t,t)}}else for(let e of kx(i,`specifiers`)){let t=Y(e,`exported`),n=Y(e,`local`),r=t===void 0?void 0:X(t,`name`)??X(t,`value`),i=n===void 0?void 0:X(n,`name`);r!==void 0&&i!==void 0&&g.set(r,i)}break}case`ExportDefaultDeclaration`:{let e=Y(i,`declaration`);e!==void 0&&(_=jx(e));break}case`VariableDeclaration`:case`FunctionDeclaration`:v(i)}let y={path:t,parsed:f,imports:p,ordered:m,declarations:h,exports:g,defaultExport:_};i.set(t,y),o.delete(t);for(let e of m)e.kind===`script`&&c(e.path);return y},l=c(t);if(!(l===void 0||s))return{modules:i,entry:l,unresolved:a}},AC=`template.tsx`,jC=new Set([`brand-unavailable`,`unmatched-class`]),MC=(e,t)=>typeof e==`string`?{[t]:e}:e,NC=(e,t=AC)=>{let n=new Ex,r=kC(MC(e,t),t,n,{lenient:!0});if(r===void 0)return n.items;SC({entry:t,brand:void 0},r,n,{assets:[],stylesheets:new Map,tailwindSheet:void 0,urlFor:e=>`https://assets.invalid/${e}`});let i=[...r.unresolved];return n.items.filter(e=>!jC.has(e.code)&&!e.code.startsWith(`tailwind-`)&&!i.some(t=>e.message.includes(`<${t}`)||e.message.includes(`\`${t}\``)))},PC=e=>`${e.code}\0${e.message}`,FC=(e,t)=>{let n=new Map;for(let t of e)t.severity===`error`&&n.set(PC(t),(n.get(PC(t))??0)+1);let r=[];for(let e of t){if(e.severity!==`error`)continue;let t=n.get(PC(e))??0;t>0?n.set(PC(e),t-1):r.push(e)}return r},IC=e=>Rm(e)&&`type`in e&&typeof e.type==`string`&&`start`in e&&typeof e.start==`number`&&`end`in e&&typeof e.end==`number`,LC=e=>Array.isArray(e)?e.filter(IC):[],RC=(e,t,n=null)=>{if(Array.isArray(e)){for(let r of e)RC(r,t,n);return}if(IC(e)){t(e,n);for(let[n,r]of Object.entries(e))n!==`loc`&&n!==`extra`&&n!==`comments`&&RC(r,t,e)}},zC=e=>{try{let t=xx(e,{sourceType:`module`,plugins:[`typescript`,`jsx`]});return IC(t)?t:null}catch{return null}},BC=e=>e.type===`Identifier`||e.type===`MemberExpression`&&e.computed===!1&&IC(e.object)&&BC(e.object),VC=e=>e.split(/\r\n|\n|\r|\u2028|\u2029/).map(e=>e.trim()).filter(e=>e!==``).join(` `),HC=(e,t,n,r)=>{let i=t.type===`JSXExpressionContainer`&&IC(t.expression)?t.expression:t,a=i.type===`StringLiteral`||i.type===`NumericLiteral`||i.type===`BooleanLiteral`||i.type===`JSXText`,o=n.slice(i.start,i.end),s=i.type===`JSXText`?{start:i.start+(o.length-o.trimStart().length),end:i.end-(o.length-o.trimEnd().length)}:{start:t.start,end:t.end};return{name:e,literalType:i.type===`NumericLiteral`?`number`:i.type===`BooleanLiteral`?`boolean`:`string`,kind:a?`literal`:BC(i)?`binding`:`computed`,value:a&&i.type===`JSXText`&&typeof i.value==`string`?VC(i.value):a&&(typeof i.value==`string`||typeof i.value==`number`||typeof i.value==`boolean`)?String(i.value):n.slice(i.start,i.end),start:s.start,end:s.end,syntax:r}},UC=(e,t,n)=>{if(t?.type!==`JSXElement`&&t?.type!==`JSXFragment`)return{previous:null,next:null};let r=LC(t.children).filter(e=>e.type!==`JSXText`||n.slice(e.start,e.end).trim()!==``),i=r.findIndex(t=>t.start===e.start),a=e=>e?.type===`JSXElement`?{start:e.start,end:e.end}:null;return{previous:a(r[i-1]),next:a(r[i+1])}},WC=(e,t,n)=>{if(t!==n.fileName)return null;let r=zC(e);if(r===null)return null;let i=Bm(e),a=i[n.lineNumber-1];if(a===void 0||!Number.isInteger(n.columnNumber)||n.columnNumber<1)return null;let o=a+n.columnNumber-1;if(o>=(i[n.lineNumber]??e.length))return null;let s=null;return RC(r,(t,n)=>{if(t.type!==`JSXElement`||t.start!==o||!IC(t.openingElement))return;let r=t.openingElement,i=[];for(let t of LC(r.attributes))if(t.type===`JSXAttribute`&&IC(t.name)&&typeof t.name.name==`string`&&IC(t.value)){let n=t.value,r=n.type===`JSXExpressionContainer`&&IC(n.expression)?n.expression:null;if(t.name.name===`style`&&r?.type===`ObjectExpression`&&!LC(r.properties).some(e=>e.type===`SpreadElement`))for(let t of LC(r.properties)){if(t.type!==`ObjectProperty`||t.computed===!0||!IC(t.key)||!IC(t.value))continue;let n=t.key.type===`Identifier`?t.key.name:t.key.value;typeof n==`string`&&i.push(HC(`style.${n}`,t.value,e,`value`))}else i.push(HC(t.name.name,n,e,`attribute`))}let a=LC(t.children).filter(t=>t.type!==`JSXText`||e.slice(t.start,t.end).trim()!==``);if(a.length===1&&a[0]!==void 0&&a[0].type!==`JSXElement`&&a[0].type!==`JSXFragment`)i.unshift(HC(`children`,a[0],e,`child`));else if(a.length>1){let t=a.flatMap((t,n)=>t.type===`JSXText`?[HC(`text.${n}`,t,e,`child`)]:[]);i.unshift(...t)}s={start:t.start,end:t.end,contentStart:r.selfClosing===!0?null:r.end,contentEnd:IC(t.closingElement)?t.closingElement.start:null,tag:IC(r.name)?e.slice(r.name.start,r.name.end):`element`,properties:i,attributeInsertion:(()=>{let e=LC(r.attributes).at(-1);return e===void 0?IC(r.name)?r.name.end:r.end-1:e.end})(),hasSpread:LC(r.attributes).some(e=>e.type===`JSXSpreadAttribute`),structural:n?.type===`JSXElement`||n?.type===`JSXFragment`,...UC(t,n,e)}}),s},GC=/^[^\s{}<>&](?:[^{}<>&\r\n\u2028\u2029]*[^\s{}<>&])?$/,KC=(e,t,n)=>{if(t.kind!==`literal`||t.literalType===`number`&&(n.trim()===``||!Number.isFinite(Number(n)))||t.literalType===`boolean`&&n!==`true`&&n!==`false`)return null;let r=t.literalType===`string`?JSON.stringify(n):t.literalType===`number`?String(Number(n)):n,i=e.slice(t.start,t.end),a=t.syntax===`child`&&!i.startsWith(`{`)&&GC.test(n);return{start:t.start,end:t.end,before:i,after:a?n:t.syntax===`child`||t.syntax===`attribute`&&t.literalType!==`string`?`{${r}}`:r}},qC=(e,t,n)=>({start:t.start,end:t.end,before:e.slice(t.start,t.end),after:t.syntax===`value`?n:`{${n}}`}),JC=(e,t,n)=>{let r=n.file??n.entry,i=e=>({...n.files,[r]:e}),a=FC(NC(i(e),n.entry),NC(i(t),n.entry)),o=a[0];if(o===void 0)return null;let s=a.length>1?` (and ${a.length-1} more)`:``;return`This change leaves the static profile: ${o.message}${o.fix===void 0?``:` ${o.fix}`}${s}`},YC=(e,t,n={})=>{let r=[...t].sort((e,t)=>t.start-e.start),i=e.length,a=e;for(let t of r){if(t.start<0||t.end<t.start||t.end>i||e.slice(t.start,t.end)!==t.before)return{ok:!1,reason:`Source changed at this target. Select it again before applying the edit.`};a=a.slice(0,t.start)+t.after+a.slice(t.end),i=t.start}if(zC(a)===null)return{ok:!1,reason:`This change is not valid TSX. Review it in Source.`};if(n.profile!==void 0&&a!==e){let t=JC(e,a,n.profile);if(t!==null)return{ok:!1,reason:t}}return{ok:!0,source:a}},XC=(e,t)=>{let n=Math.max(e.lastIndexOf(`
20
- `,t-1),e.lastIndexOf(`\r`,t-1)),r=e.slice(n+1,t);return/^[ \t]*$/.test(r)?r:null},ZC=(e,t)=>{if(XC(e,t.start)===null)return t;let n=/^[ \t]*(\r\n|\n|\r)/.exec(e.slice(t.end));return n===null?t:{start:t.start-(XC(e,t.start)??``).length,end:t.end+n[0].length}},QC=(e,t,n)=>{if(n.kind===`insert`)return t.contentEnd===null?null:[{start:t.contentEnd,end:t.contentEnd,before:``,after:n.tsx}];if(!t.structural)return null;let r=e.slice(t.start,t.end);if(n.kind===`duplicate`){let n=XC(e,t.start);return[{start:t.end,end:t.end,before:``,after:n===null?r:`\n${n}${r}`}]}if(n.kind===`reorder`){let i=n.direction===`before`?t.previous:t.next;return i===null?null:[{start:i.start,end:i.end,before:e.slice(i.start,i.end),after:r},{start:t.start,end:t.end,before:r,after:e.slice(i.start,i.end)}]}let i=ZC(e,t),a={start:i.start,end:i.end,before:e.slice(i.start,i.end),after:``};if(n.kind===`delete`)return[a];let o=n.destination.contentEnd;return o===null||o>=t.start&&o<=t.end?null:[a,{start:o,end:o,before:``,after:r}]},$C=(e,t)=>{let n=e.program;if(!IC(n))return null;for(let e of LC(n.body)){let n=e.type===`ExportNamedDeclaration`&&IC(e.declaration)?e.declaration:e;if(n.type===`VariableDeclaration`){for(let e of LC(n.declarations))if(IC(e.id)&&e.id.name===t&&IC(e.init)&&e.init.type===`ObjectExpression`)return e.init}}return null},ew=e=>{let t=zC(e);if(t===null)return[];let n=[];return RC(t,r=>{if(r.type!==`CallExpression`||!IC(r.callee)||r.callee.type!==`Identifier`||r.callee.name!==`defineTemplate`)return;let i=LC(r.arguments)[0];if(i?.type!==`ObjectExpression`)return;let a=LC(i.properties).find(e=>e.type===`ObjectProperty`&&IC(e.key)&&e.key.name===`fixtures`&&e.computed!==!0);if(a!==void 0&&IC(a.value)&&a.value.type===`ObjectExpression`)for(let r of LC(a.value.properties)){if(r.type!==`ObjectProperty`||r.computed===!0||!IC(r.key)||!IC(r.value))continue;let i=r.key.type===`Identifier`?r.key.name:r.key.value,a=r.value.type===`Identifier`&&typeof r.value.name==`string`?$C(t,r.value.name)??r.value:r.value;typeof i==`string`&&n.push({name:i,start:a.start,end:a.end,source:e.slice(a.start,a.end)})}}),n},tw=e=>e.split(/\s+/).filter(e=>e!==``),nw=(e,t,n)=>{let r=t.properties.find(e=>e.name===`className`),i=e=>{if(n.kind===`set`)return tw(n.value).join(` `);let t=tw(n.tokens);return n.kind===`add`?[...e,...t.filter(t=>!e.includes(t))].join(` `):e.filter(e=>!t.includes(e)).join(` `)};if(r===void 0){if(t.hasSpread)return{ok:!1,reason:`A spread attribute can supply className here, so a class list cannot be added safely. Edit it in Source.`};if(n.kind===`remove`)return{ok:!0,edits:[]};let e=i([]);return e===``?{ok:!0,edits:[]}:{ok:!0,edits:[{start:t.attributeInsertion,end:t.attributeInsertion,before:``,after:` className=${JSON.stringify(e)}`}]}}if(r.kind!==`literal`||r.literalType!==`string`)return{ok:!1,reason:`className is ${r.kind===`binding`?`bound to`:`computed from`} \`${r.value}\`, so editing it would discard that choice. Change the literal classes inside it in Source.`};let a=i(tw(r.value));return{ok:!0,edits:[{start:r.start,end:r.end,before:e.slice(r.start,r.end),after:JSON.stringify(a)}]}},rw=e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`,iw=e=>e.occurrences>1?`${e.tag} ${e.occurrence} of ${e.occurrences}`:e.tag,aw=(e,t)=>{let n=e.origins[0];if(n===void 0)return iw(e);let r=t.split(`
21
- `)[n.lineNumber-1];return r===void 0?iw(e):r.slice(Math.max(0,n.columnNumber-1)).match(/<([A-Za-z][A-Za-z0-9_.:-]*)/)?.[1]??iw(e)},ow=(e,t)=>{let n=t.slice(e.start,e.end).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,` `).replace(/<[^>]+>/g,` `).replace(/&nbsp;/gi,` `).replace(/&amp;/gi,`&`).replace(/&lt;/gi,`<`).replace(/&gt;/gi,`>`).replace(/&quot;/gi,`"`).replace(/&#39;/gi,`'`).replace(/\s+/g,` `).trim();if(n!==``)return n.length>72?`${n.slice(0,69).trimEnd()}…`:n},sw=e=>{let t=[],n=(e,r)=>{t.push({depth:r,node:e});for(let t of e.children)n(t,r+1)};for(let t of e.roots)n(t,0);return t},cw=e=>{let t=Ng(e),n=new Map,r=new Map,i=[];for(let t of e){let e=[];n.set(t.instancePath,e);let a={instancePath:t.instancePath,selection:t,children:e};r.set(t.instancePath,a);let o=t.parentPath===void 0?void 0:n.get(t.parentPath);o===void 0?i.push(a):o.push(a)}return{roots:i,index:t,nodes:r}},lw=(e,t)=>{let n=[],r=e.index.get(t)?.parentPath;for(;r!==void 0;)n.unshift(r),r=e.index.get(r)?.parentPath;return n},uw=(e,t)=>[...lw(e,t),t].flatMap(t=>{let n=e.index.get(t);return n===void 0?[]:[{instancePath:t,label:iw(n)}]}),dw=e=>{let t=new Set;if(e===null)return t;for(let n of e.roots){t.add(n.instancePath);for(let e of n.children)e.children.length>0&&t.add(e.instancePath)}return t},fw={kind:`document`},pw={kind:`envelope`},mw=e=>new TextEncoder().encode(e).length,hw=e=>Math.max(1,Math.round(e/1024)),gw=e=>e.render===null?0:e.channel===`email`?hw(mw(e.render.html)):e.channel===`sms`?hw(mw(e.render.text)):hw(mw(JSON.stringify(e.render))),_w=(e,t)=>({outline:e.channel===`email`&&e.render!==null?cw(e.render.selections):null,sizeKb:gw(e),checks:kw(e,t)}),vw=(e,t)=>e.origins.length===t.origins.length&&e.origins.every((e,n)=>{let r=t.origins[n];return r!==void 0&&r.fileName===e.fileName&&r.lineNumber===e.lineNumber&&r.columnNumber===e.columnNumber}),yw=(e,t)=>e.tag===t.tag&&e.authored===t.authored&&e.occurrence===t.occurrence&&e.occurrences===t.occurrences&&vw(e,t),bw=(e,t,n)=>{if(e.kind!==`element`)return e;if(t===null||t.channel!==`email`)return fw;let{render:r,fixture:i}=t;if(r===null||i===null)return fw;let a=r.selections.find(t=>t.instancePath===e.instancePath);if(a===void 0)return fw;if(e.revision===r.revision&&e.fixture===i)return e;let o=n?.index.get(e.instancePath);return o===void 0||!yw(o,a)?fw:{kind:`element`,instancePath:e.instancePath,revision:r.revision,fixture:i}},xw=(e,t,n)=>{let r=t.authoredSource!==void 0&&(n===null||n===t.authoredSource)?t.authoredSource:e.origin.authoredSource,i={...e.origin,authoredSource:r};if(t.channel!==e.channel)throw Error(`Host sent a ${t.channel} change for a ${e.channel} document`);return{...e,rev:t.rev,origin:i,fixtures:t.fixtures,fixture:t.fixture,preview:t.preview,render:t.render,diagnostics:t.diagnostics,...t.channel===`email`?{incompatibilities:t.incompatibilities}:{}}},Sw=104448,Cw=e=>e.severity===`error`?`error`:e.severity===`warning`?`warn`:`info`,ww=e=>e===`caniemail/system-ui-ui-serif-ui-sans-serif-ui-rounded-ui-monospace`?`System fonts`:e===`caniemail/media`?`Media queries`:e===`caniemail/color-scheme-meta-tag`?`Color scheme metadata`:e.startsWith(`caniemail/`)?e.slice(10).replace(/-property$/,``).replace(/-attribute$/,` attribute`).replace(/-element$/,` element`):e.replaceAll(`-`,` `),Tw=(e,t)=>{let n=new Map;for(let t of e){let e=n.get(t.code)??new Map,r=JSON.stringify([t.severity,t.compatibility?.assessment,t.compatibility?.title,t.message,[...t.clients??[]].sort(),t.notes,t.provenance]),i=e.get(r),a=new Map;for(let e of i===void 0?[t]:[i,t])for(let t of e.occurrences??[e.origins])t.length>0&&a.set(JSON.stringify(t),t);e.set(r,{...t,origins:i?.origins??t.origins,fixtures:[...new Set([...i?.fixtures??[],...t.fixtures??[]])].sort(),occurrences:[...a.values()]}),n.set(t.code,e)}return[...n].map(([e,n])=>Ew(`${t}:${e}`,[...n.values()]))},Ew=(e,t)=>{let n=e=>e.compatibility?.assessment===`unverified`?0:e.compatibility?.assessment===`degradation`?1:2,r=[...t].sort((e,t)=>n(e)-n(t)),i=r.find(e=>e.severity===`error`)??r.find(e=>e.severity===`warning`)??r[0],a=new Set(r.flatMap(e=>e.fixtures??[])),o=new Set(r.flatMap(e=>e.clients??[]));return{id:e,severity:Cw(i),label:i.compatibility?.title??ww(i.code),detail:[`${r.length} finding${r.length===1?``:`s`}`,...o.size===0?[]:[`${o.size} client${o.size===1?``:`s`}`],...a.size===0?[]:[`${a.size} fixture${a.size===1?``:`s`}`]].join(` · `),diagnostics:r}},Dw=e=>{let t=mw(e.html);return t<=Sw?{id:`size:gmail-clip`,severity:`ok`,label:`Gmail clipping`,detail:`HTML is ${Math.ceil(t/1024)} KB, under Gmail's 102 KB clipping threshold.`}:{id:`size:gmail-clip`,severity:`warn`,label:`Gmail clipping risk`,detail:`HTML is ${Math.ceil(t/1024)} KB, above Gmail's 102 KB clipping threshold.`}},Ow={id:`build:no-render`,severity:`error`,label:`No render`,detail:`The template entry did not produce a render at this revision.`},kw=(e,t)=>{let n=[...Tw(e.diagnostics,`diagnostic`),...e.channel===`email`?Tw(e.incompatibilities,`compat`):[]];return e.render===null?[...n.length===0?[Ow]:n,...t]:e.channel===`email`?[...n,Dw(e.render),...t]:[...n,...t]},Aw=e=>{let t=[],n=[],r=[],i=[];for(let a of e)a.severity===`error`?t.push(a):a.severity===`warn`?n.push(a):a.severity===`info`?r.push(a):i.push(a);return{actionable:[...t,...n],info:r,ok:i,errorCount:t.length,warnCount:n.length,badgeCount:t.length+n.length}},jw=e=>Ge(e,`_tag`)&&e._tag===`DocumentUnavailable`&&Ge(e,`reason`)&&typeof e.reason==`string`,Mw=e=>jw(e)?e.reason:e instanceof Error?e.message:`The document session failed.`,Nw=(e,t)=>{let n=``,r=[],i=!1,a,o=!1,s=!1,c,l=[],u=0,d=()=>{let e=l;l=[];for(let t of e)t.resolve(n)},f=e=>{let t=l;l=[];for(let n of t)n.reject(e)},p=()=>{if(a!==void 0&&(clearTimeout(a),a=void 0),e.access!==`editable`)return;let s=e.writer;if(i)return;i=!0;let c=u;(async()=>{for(;r.length>0&&!o;){let e=r[0],a={kind:`authoredSource`,baseRev:n,authoredSource:e.authoredSource};try{let e=await s.save(a);if(u!==c)return;n=e.rev,t.onPersistedRevision(n),r.shift(),t.onStorageError(null)}catch(e){if(u!==c)return;if(jw(e)){t.onStorageError(e.reason),i=!1,f(e);return}r=[],o=!0,t.onConflict();break}}u===c&&(i=!1,d())})()},m=()=>{u+=1,i=!1,s=!1;let a=u,l=!1,d=[],f=e=>{if(u!==a)return;if(e.origin===`self`){t.onSelfAck(e);return}let i=r.length>0;i&&(o=!0),n=e.rev,t.onForeignChange(e,i)};e.document.open(e=>{l?f(e):d.push(e)},e=>{u===a&&(s=!1,t.onSessionError(Mw(e)))}).then(({initial:e,close:i})=>{if(u!==a){i();return}c=i,l=!0,s=!0,n=e.rev,t.onInitial(e);for(let e of d)f(e);d.length=0,r.length>0&&p()}).catch(e=>{u===a&&t.onSessionError(Mw(e))})};return{open:m,dispose:()=>{u+=1,a!==void 0&&clearTimeout(a),a=void 0,s=!1,c?.(),c=void 0},reload:()=>{o=!1,r=[],i=!1,a!==void 0&&clearTimeout(a),a=void 0,d(),c?.(),c=void 0,m()},enqueueAuthoredSource:(t,n)=>{if(e.access!==`editable`)return;let o={kind:`authoredSource`,authoredSource:t,coalesceKey:n?.coalesceKey},s=r.length-1,c=r[s],l=s>=+!!i;o.coalesceKey!==void 0&&l&&c?.kind===`authoredSource`&&c.coalesceKey===o.coalesceKey?r[s]=o:r.push(o),a!==void 0&&clearTimeout(a),a=setTimeout(p,300)},flushSaves:()=>(a!==void 0&&p(),r.length===0&&!i?Promise.resolve(n):new Promise((e,t)=>{l.push({resolve:e,reject:t})})),retrySave:()=>{if(e.access===`editable`){if(t.onStorageError(null),!s){c?.(),c=void 0,m();return}p()}},adoptRev:e=>{n=e,o=!1}}},Pw={desktop:600,mobile:375},Fw=`samva.editor.leftWidth`,Iw=`samva.editor.assistantWidth`,Lw=`samva.editor.rightWidth`,Rw=260,zw=360,Bw=320,Vw=200,Hw=420,Uw=300,Ww=520,Gw=260,Kw=440,qw=(e,t)=>{try{let n=localStorage.getItem(e);if(n===null)return t;let r=Number(n);return Number.isFinite(r)?r:t}catch{return t}},Jw=(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},Yw=e=>e!==null&&e.channel===`email`?e.render:null,Xw=(e,t)=>{let n,r=t=>e.access!==`editable`||t.doc?.access.kind===`readonly`||t.lifecycleBusy,i=t=>t!==null&&e.access===`editable`&&e.sourceAccess===`editable`&&t.access.kind!==`readonly`,a=(e,t,n)=>{let r=_w(t,e.hostChecks),i=!e.layersSeeded&&r.outline!==null;return{doc:t,pendingAuthoredSource:n,...r,render:Yw(t),expandedLayers:i?dw(r.outline):e.expandedLayers,layersSeeded:e.layersSeeded||i,selection:bw(e.selection,t,e.outline)}},o=Mm((o,s)=>{let c=(e,t)=>{let r=s();r.doc!==null&&(o({doc:{...r.doc,origin:{...r.doc.origin,authoredSource:e}},pendingAuthoredSource:e,sourceEditError:null}),n.enqueueAuthoredSource(e,{coalesceKey:t?.coalesceKey??`authored-source`}))},l=e=>{let t=s();if(r(t)||!t.sourceEditable||t.conflict||t.doc===null)return;let n=e===`undo`?t.undoHistory:t.redoHistory,i=n.at(-1);if(i!==void 0){if(t.doc.origin.authoredSource!==(e===`undo`?i.after:i.before)){o({sourceEditError:`History conflicts with a newer change. Your current work is kept. Review the saved versions.`});return}o(e===`undo`?{undoHistory:n.slice(0,-1),redoHistory:[...t.redoHistory,i]}:{redoHistory:n.slice(0,-1),undoHistory:[...t.undoHistory,i]}),c(e===`undo`?i.before:i.after)}};return{sourceEditError:null,agentOriginIndex:0,undoHistory:[],redoHistory:[],workspaceView:`visual`,doc:null,pendingAuthoredSource:null,editable:e.access===`editable`,sourceEditable:e.access===`editable`&&e.sourceAccess===`editable`,metadataEditable:e.access===`editable`&&e.metadataAccess!==`readonly`,readonlyReason:null,render:null,outline:null,sizeKb:0,checks:t.hostChecks,hostChecks:t.hostChecks,sendCapability:e.send,lifecycleCapability:e.lifecycle,assetsCapability:e.assets,fixtureCapability:e.fixtures,fixtureBusy:!1,fixtureError:null,diagnosticAssistance:null,selection:fw,renameActive:!1,expandedLayers:new Set,layersSeeded:!1,leftCollapsed:!1,rightCollapsed:!1,rightMode:`agent`,designView:`layers`,focusedPane:`assistant`,leftWidth:qw(Fw,Rw),assistantWidth:Math.min(Ww,Math.max(Uw,qw(Iw,zw))),rightWidth:qw(Lw,Bw),previewDevice:`desktop`,canvasZoom:`100`,layoutMode:`wide`,metadataSaving:!1,metadataError:null,lifecycleBusy:!1,conflict:!1,storageError:null,hoveredCandidatePath:null,actions:{requestSourceAssistance:e=>o({agentOriginIndex:e,rightMode:`agent`,rightCollapsed:!1}),requestDiagnosticAssistance:e=>{let t=s();t.doc===null||r(t)||t.pendingAuthoredSource!==null||t.conflict||o({diagnosticAssistance:{id:(t.diagnosticAssistance?.id??0)+1,revision:t.doc.rev,check:e},rightMode:`agent`,rightCollapsed:!1})},openSource:()=>o({workspaceView:`source`}),undo:()=>l(`undo`),redo:()=>l(`redo`),applySourceEdit:e=>{let t=s();if(r(t)||!t.sourceEditable||t.conflict||t.doc===null)return;if(t.doc.rev!==e.revision||t.doc.origin.authoredSource!==e.source||t.pendingAuthoredSource!==null&&e.coalesceKey===void 0){o({sourceEditError:`That edit is stale. The preview moved on. Reselect the element and try again.`});return}let n=YC(e.source,e.edits,{profile:{entry:t.doc.origin.file}});if(!n.ok){o({sourceEditError:n.reason});return}if(n.source===e.source)return;let i=t.undoHistory.at(-1);o({undoHistory:e.coalesceKey!==void 0&&i?.key===e.coalesceKey&&i.after===e.source?[...t.undoHistory.slice(0,-1),{before:i.before,after:n.source,key:e.coalesceKey}]:[...t.undoHistory,{before:e.source,after:n.source,key:e.coalesceKey}],redoHistory:[]}),c(n.source,{coalesceKey:e.coalesceKey})},replaceAuthoredSource:e=>{let t=s();r(t)||!t.sourceEditable||t.doc===null||e===t.doc.origin.authoredSource||t.conflict||(o({undoHistory:[...t.undoHistory,{before:t.doc.origin.authoredSource,after:e}],redoHistory:[]}),c(e))},viewFixture:e=>{let t=s(),n=t.fixtureCapability;n?.status===`ready`&&t.doc!==null&&!t.fixtureBusy&&t.doc.fixtures.includes(e)&&t.doc.fixture!==e&&(o({fixtureBusy:!0,fixtureError:null}),n.api.view(e).then(()=>o({fixtureBusy:!1}),()=>o({fixtureBusy:!1,fixtureError:`Couldn't render the ${e} fixture.`})))},reload:()=>{s().lifecycleBusy||(o({conflict:!1,storageError:null,fixtureError:null}),n.reload())},flushSaves:()=>n.flushSaves(),beginLifecycle:()=>{let t=s();return t.lifecycleBusy||t.doc===null||e.access!==`editable`||t.doc.access.kind===`readonly`?!1:(o({lifecycleBusy:!0}),!0)},endLifecycle:()=>o({lifecycleBusy:!1}),adoptLifecycleSnapshot:e=>{n.adoptRev(e.rev),o(t=>{if(t.doc===null)return{conflict:!1};let n={...t.doc,rev:e.rev,origin:{...t.doc.origin,authoredSource:e.authoredSource}};return{...a(t,n,null),sourceEditable:i(n),conflict:!1}})},retrySave:()=>{r(s())||n.retrySave()},select:e=>o(t=>{if(e===null)return{selection:fw};let{render:n,doc:r}=t;if(n===null||r?.channel!==`email`||r.fixture===null||!n.selections.some(t=>t.instancePath===e))return{selection:fw};let i=new Set(t.expandedLayers);if(t.outline!==null)for(let n of lw(t.outline,e))i.add(n);return{agentOriginIndex:0,selection:{kind:`element`,instancePath:e,revision:n.revision,fixture:r.fixture},expandedLayers:i}}),selectDocument:()=>o({selection:fw}),selectEnvelope:()=>o({selection:pw}),toggleLeft:()=>o(e=>({leftCollapsed:!e.leftCollapsed})),toggleRight:()=>o(e=>({rightCollapsed:!e.rightCollapsed})),setRightMode:e=>o({rightMode:e}),openAgentPanel:()=>o({rightMode:`agent`,rightCollapsed:!1}),setDesignView:e=>{s().designView!==e&&o({designView:e})},setFocusedPane:e=>{s().focusedPane!==e&&o({focusedPane:e})},openReview:()=>o(e=>({designView:`review`,focusedPane:e.layoutMode===`narrow`?`assistant`:`design`})),setWorkspaceView:e=>o({workspaceView:e}),setLeftWidth:e=>{let t=Math.min(Hw,Math.max(Vw,Math.round(e)));Jw(Fw,t),o({leftWidth:t})},setAssistantWidth:e=>{let t=Math.min(Ww,Math.max(Uw,Math.round(e)));Jw(Iw,t),o({assistantWidth:t})},setRightWidth:e=>{let t=Math.min(Kw,Math.max(Gw,Math.round(e)));Jw(Lw,t),o({rightWidth:t})},setPreviewDevice:e=>o({previewDevice:e}),setCanvasZoom:e=>o({canvasZoom:e}),setLayoutMode:e=>{if(s().layoutMode!==e){if(e===`wide`){o({layoutMode:e,leftCollapsed:!1,rightCollapsed:!1,canvasZoom:`100`});return}if(e===`standard`){o({layoutMode:e,leftCollapsed:!1,rightCollapsed:!0,canvasZoom:`fit`});return}o({layoutMode:e,leftCollapsed:!0,rightCollapsed:!0,canvasZoom:`fit`})}},setRenameActive:e=>o({renameActive:e}),rename:t=>{let n=s();if(r(n)||e.access!==`editable`||e.metadataAccess===`readonly`)return;let i=e.writer,a=n.doc;if(a===null)return;let c=t.trim()||`Untitled template`;c!==a.name&&(o(e=>e.doc===null?e:{doc:{...e.doc,name:c},metadataSaving:!0,metadataError:null}),i.save({kind:`metadata`,patch:{name:c}}).then(()=>o({metadataSaving:!1}),()=>{o(e=>({doc:e.doc===null?e.doc:{...e.doc,name:a.name},metadataSaving:!1,metadataError:`Couldn't save the template name.`}))}))},saveMetadata:t=>{let n=s();if(r(n)||e.access!==`editable`||e.metadataAccess===`readonly`)return;let i=e.writer,a=n.doc;a!==null&&(o(e=>e.doc===null?e:{doc:{...e.doc,metadata:{fromDefault:t.fromDefault===void 0?e.doc.metadata.fromDefault:t.fromDefault??void 0,replyToDefault:t.replyToDefault===void 0?e.doc.metadata.replyToDefault:t.replyToDefault??void 0}},metadataSaving:!0,metadataError:null}),i.save({kind:`metadata`,patch:t}).then(()=>o({metadataSaving:!1}),()=>{o(e=>({doc:e.doc===null?e.doc:{...e.doc,metadata:a.metadata},metadataSaving:!1,metadataError:`Couldn't save the sender defaults.`}))}))},toggleLayerExpand:e=>o(t=>{let n=new Set(t.expandedLayers);return n.has(e)?n.delete(e):n.add(e),{expandedLayers:n}}),ancestryOf:e=>{let{outline:t}=s();return t===null?[]:lw(t,e)},breadcrumbOf:e=>{let{outline:t}=s();return t===null?[]:uw(t,e)},setHovered:e=>o({hoveredCandidatePath:e}),setHostChecks:e=>{Object.is(s().hostChecks,e)||o(t=>({hostChecks:e,checks:t.doc===null?e:kw(t.doc,e)}))}}}}),s=(e,t)=>{o.setState(n=>{if(n.doc===null)return n;let r=t?n.pendingAuthoredSource:null,i=xw(n.doc,e,r),o=e.authoredSource!==void 0&&e.authoredSource===i.origin.authoredSource;return a(n,i,o?null:r)})};return n=Nw(e,{onInitial:t=>{o.setState(n=>({...a(n,t,null),editable:e.access===`editable`&&t.access.kind!==`readonly`,sourceEditable:i(t),readonlyReason:t.access.kind===`readonly`?t.access.reason:null}))},onPersistedRevision:e=>{o.setState(t=>t.doc===null?t:{doc:{...t.doc,rev:e}})},onSelfAck:e=>s(e,!0),onForeignChange:(e,t)=>{if(t){o.setState(t=>t.doc===null?t:{doc:{...t.doc,rev:e.rev},sourceEditable:!1,conflict:!0});return}s(e,!1),o.setState(e=>({sourceEditable:i(e.doc)}))},onConflict:()=>o.setState({conflict:!0,sourceEditable:!1}),onStorageError:e=>o.setState({storageError:e}),onSessionError:e=>o.setState({storageError:e})}),{host:e,store:o,spine:n}},Zw=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})),Z=o(((e,t)=>{t.exports=Zw()}))(),Qw=[];function $w({host:e,checks:t=Qw,children:n}){let[r,i]=(0,T.useState)(()=>Xw(e,{hostChecks:t}));return r.host!==e&&i(Xw(e,{hostChecks:t})),(0,T.useEffect)(()=>(r.spine.open(),()=>r.spine.dispose()),[r]),(0,T.useEffect)(()=>{r.store.getState().actions.setHostChecks(t)},[r,t]),(0,Z.jsx)(Fm.Provider,{value:r,children:n})}var eT={};function tT(e,t){let n=T.useRef(eT);return n.current===eT&&(n.current=e(t)),n}var nT=[],rT=void 0;function iT(){return rT}function aT(e){nT.push(e)}function oT(e){let t=(t,n)=>{let r=tT(cT).current,i;try{rT=r;for(let e of nT)e.before(r);i=e(t,n);for(let e of nT)e.after(r);r.didInitialize=!0}finally{rT=void 0}return i};return t.displayName=e.displayName||e.name,t}function sT(e){return T.forwardRef(oT(e))}function cT(){return{didInitialize:!1}}function lT(){}var uT=Object.freeze([]),dT=Object.freeze({}),Q=typeof document<`u`?T.useLayoutEffect:()=>{};function fT(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 pT=fT(`https://base-ui.com/production-error`,`Base UI`),mT=T.createContext(void 0);function hT(e){let t=T.useContext(mT);if(t===void 0&&!e)throw Error(pT(72));return t}function gT(e){T.useEffect(e,uT)}var _T=0,vT=class e{static create(){return new e}currentId=_T;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=_T,t()},e)}isStarted(){return this.currentId!==_T}clear=()=>{this.currentId!==_T&&(clearTimeout(this.currentId),this.currentId=_T)};disposeEffect=()=>this.clear};function yT(){let e=tT(vT.create).current;return gT(e.disposeEffect),e}function bT(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:xT,platform:ST,maxTouchPoints:CT}=bT(),wT=xT.toLowerCase(),TT=ST.toLowerCase(),ET=/^i(os$|p)/.test(TT)||TT===`macintel`&&CT>1,DT=`android`,OT=TT===DT||wT.includes(DT),kT=!ET&&TT.startsWith(`mac`);TT.startsWith(`win`),!OT&&/^(linux|chrome os)/.test(TT);var AT=kT||ET,jT=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!jT&&wT.includes(`firefox`),!jT&&wT.includes(`chrom`);var MT=AT,NT=/jsdom|happydom/.test(wT);function PT(e){e.preventDefault(),e.stopPropagation()}function FT(e){return`nativeEvent`in e}function IT(e){return e.pointerType===``&&e.isTrusted?!0:OT&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function LT(e){return NT?!1:!OT&&e.width===0&&e.height===0||OT&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function RT(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function zT(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function BT(){return typeof window<`u`}function VT(e){return WT(e)?(e.nodeName||``).toLowerCase():`#document`}function HT(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function UT(e){return((WT(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function WT(e){return BT()?e instanceof Node||e instanceof HT(e).Node:!1}function GT(e){return BT()?e instanceof Element||e instanceof HT(e).Element:!1}function KT(e){return BT()?e instanceof HTMLElement||e instanceof HT(e).HTMLElement:!1}function qT(e){return!BT()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof HT(e).ShadowRoot}function JT(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=aE(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function YT(e){return/^(table|td|th)$/.test(VT(e))}function XT(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ZT=/transform|translate|scale|rotate|perspective|filter/,QT=/paint|layout|strict|content/,$T=e=>!!e&&e!==`none`,eE;function tE(e){let t=GT(e)?aE(e):e;return $T(t.transform)||$T(t.translate)||$T(t.scale)||$T(t.rotate)||$T(t.perspective)||!rE()&&($T(t.backdropFilter)||$T(t.filter))||ZT.test(t.willChange||``)||QT.test(t.contain||``)}function nE(e){let t=sE(e);for(;KT(t)&&!iE(t);){if(tE(t))return t;if(XT(t))return null;t=sE(t)}return null}function rE(){return eE??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),eE}function iE(e){return/^(html|body|#document)$/.test(VT(e))}function aE(e){return HT(e).getComputedStyle(e)}function oE(e){return GT(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sE(e){if(VT(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||qT(e)&&e.host||UT(e);return qT(t)?t.host:t}function cE(e){let t=sE(e);return iE(t)?(e.ownerDocument||e).body:KT(t)&&JT(t)?t:cE(t)}function lE(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cE(e),i=r===e.ownerDocument?.body,a=HT(r);if(i){let e=uE(a);return t.concat(a,a.visualViewport||[],JT(r)?r:[],e&&n?lE(e):[])}return t.concat(r,lE(r,[],n))}function uE(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dE(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function fE(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&qT(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function pE(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var mE=`data-base-ui-focusable`,hE=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,gE=`ArrowLeft`,_E=`ArrowRight`,vE=`ArrowUp`,yE=`ArrowDown`,bE=`data-starting-style`,xE=`data-ending-style`,SE={[bE]:``},CE={[xE]:``},wE={transitionStatus(e){return e===`starting`?SE:e===`ending`?CE:null}},TE=`data-open`,EE=`data-closed`,DE=`data-anchor-hidden`,OE=`data-popup-open`,kE=`data-pressed`,AE={[OE]:``},jE={[OE]:``,[kE]:``},ME={[TE]:``},NE={[EE]:``},PE={[DE]:``},FE={open(e){return e?AE:null}},IE={open(e){return e?jE:null}},LE={open(e){return e?ME:NE},anchorHidden(e){return e?PE:null}},RE={...LE,...wE},zE=`data-trigger-disabled`;function BE(e,t){if(!GT(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(zE);for(let[,e]of t.entries())if(fE(e,n))return!e.hasAttribute(zE);return!1}function VE(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 HE(e){return e.matches(`html,body`)}function UE(e){return KT(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function WE(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${hE}`)!=null}function GE(e){return e?e.getAttribute(`role`)===`combobox`&&UE(e):!1}function KE(e){if(!e||NT)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function qE(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function JE(e,t){return t!=null&&!RT(t)?0:typeof e==`function`?e():e}function YE(e,t,n){let r=JE(e,n);return typeof r==`number`?r:r?.[t]}function XE(e){return typeof e==`function`?e():e}function ZE(e,t){return t||e===`click`||e===`mousedown`}function QE(e){return e?.includes(`mouse`)&&e!==`mousedown`}var $E=`none`,eD=`trigger-press`,tD=`trigger-hover`,nD=`trigger-focus`,rD=`outside-press`,iD=`item-press`,aD=`close-press`,oD=`focus-out`,sD=`escape-key`,cD=`close-watcher`,lD=`list-navigation`,uD=`cancel-open`,dD=`sibling-open`,fD=`disabled`,pD=`imperative-action`,mD=`swipe`,hD=`window-resize`;function gD(e,t,n,r){let i=!1,a=!1,o=r??dT;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}}var _D=T.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new vT,currentIdRef:{current:null},currentContextRef:{current:null}});function vD(e,t){e.current=t.current}function yD(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=T.useContext(_D),[f,p]=T.useState(!1),m=T.useRef(n);return Q(()=>{m.current=n},[n]),Q(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),Q(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:YE(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,gD($E))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),Q(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,vD(o,c),d.clear()}},[l,a,o,i,c,d]),T.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}function bD(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function xD(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function SD(e,t,n,r){let i=tT(wD).current;return TD(i,e,t,n,r)&&DD(i,[e,t,n,r]),i.callback}function CD(e){let t=tT(wD).current;return ED(t,e)&&DD(t,e),t.callback}function wD(){return{callback:null,cleanup:null,refs:[]}}function TD(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ED(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function DD(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function OD(e){let t=tT(kD,e).current;return t.next=e,Q(t.effect),t}function kD(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var AD={...T},jD=AD.useInsertionEffect,MD=jD&&jD!==AD.useLayoutEffect?jD:e=>e();function $(e){let t=tT(ND).current;return t.next=e,MD(t.effect),t.trampoline}function ND(){let e={next:void 0,callback:PD,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function PD(){}var FD=null;globalThis.requestAnimationFrame;var ID=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)}},LD=class e{static create(){return new e}static request(e){return ID.request(e)}static cancel(e){return ID.cancel(e)}currentId=FD;request(e){this.cancel(),this.currentId=ID.request(()=>{this.currentId=FD,e()})}cancel=()=>{this.currentId!==FD&&(ID.cancel(this.currentId),this.currentId=FD)};disposeEffect=()=>this.cancel};function RD(){let e=tT(LD.create).current;return gT(e.disposeEffect),e}function zD(e){return e?.ownerDocument||document}var BD={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},VD={...BD,position:`fixed`,top:0,left:0},HD={...BD,position:`absolute`},UD=T.forwardRef(function(e,t){let[n,r]=T.useState();Q(()=>{MT&&jT&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:VD,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),WD=Math.min,GD=Math.max,KD=Math.round,qD=Math.floor,JD=e=>({x:e,y:e}),YD={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function XD(e,t,n){return GD(e,WD(t,n))}function ZD(e,t){return typeof e==`function`?e(t):e}function QD(e){return e.split(`-`)[0]}function $D(e){return e.split(`-`)[1]}function eO(e){return e===`x`?`y`:`x`}function tO(e){return e===`y`?`height`:`width`}function nO(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function rO(e){return eO(nO(e))}function iO(e,t,n){n===void 0&&(n=!1);let r=$D(e),i=rO(e),a=tO(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pO(o)),[o,pO(o)]}function aO(e){let t=pO(e);return[oO(e),t,oO(t)]}function oO(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var sO=[`left`,`right`],cO=[`right`,`left`],lO=[`top`,`bottom`],uO=[`bottom`,`top`];function dO(e,t,n){switch(e){case`top`:case`bottom`:return n?t?cO:sO:t?sO:cO;case`left`:case`right`:return t?lO:uO;default:return[]}}function fO(e,t,n,r){let i=$D(e),a=dO(QD(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oO)))),a}function pO(e){let t=QD(e);return YD[t]+e.slice(t.length)}function mO(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function hO(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:mO(e)}function gO(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 _O(e,t){return t<0||t>=e.length}function vO(e,t){return bO(e.current,{disabledIndices:t})}function yO(e,t){return bO(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function bO(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&&xO(e,a,r));return a}function xO(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!CO(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function SO(e){return e.visibility===`hidden`||e.visibility===`collapse`}function CO(e,t=e?aE(e):null){return!e||!e.isConnected||!t||SO(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var wO=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function TO(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return qT(n)?n.host:null}function EO(e){for(let t of Array.from(e.children))if(VT(t)===`summary`)return t;return null}function DO(e,t){let n=EO(t);return!!n&&(e===n||fE(n,e))}function OO(e){let t=e?VT(e):``;return e!=null&&e.matches(wO)&&(t!==`summary`||e.parentElement!=null&&VT(e.parentElement)===`details`&&EO(e.parentElement)===e)&&(t!==`details`||EO(e)==null)&&(t!==`input`||e.type!==`hidden`)}function kO(e){if(!OO(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=TO(t)){let n=t!==e,r=VT(t)===`slot`;if(t.hasAttribute(`inert`)||n&&VT(t)===`details`&&!t.open&&!DO(e,t)||t.hasAttribute(`hidden`)||!r&&!AO(t,n))return!1}return!0}function AO(e,t){let n=aE(e);return t?n.display!==`none`:CO(e,n)}function jO(e){let t=e.tabIndex;if(t<0){let t=VT(e);if(t===`details`||t===`audio`||t===`video`||KT(e)&&e.isContentEditable)return 0}return t}function MO(e){if(VT(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function NO(e,t){let n=MO(e);if(!n)return!0;let r=t.find(e=>{let t=MO(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=MO(e);return t?.name===n.name&&t.form===n.form})===n}function PO(e){if(KT(e)&&VT(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return KT(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function FO(e,t){PO(e).forEach(e=>{OO(e)&&t.push(e),FO(e,t)})}function IO(e,t,n){PO(e).forEach(e=>{KT(e)&&e.matches(t)&&n.push(e),IO(e,t,n)})}function LO(e){return kO(e)&&jO(e)>=0}function RO(e){let t=[];return FO(e,t),t.filter(kO)}function zO(e){let t=RO(e);return t.filter(e=>jO(e)>=0&&NO(e,t))}function BO(e,t){let n=zO(e),r=n.length;if(r===0)return;let i=dE(zD(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function VO(e){return BO(zD(e).body,1)||e}function HO(e){return BO(zD(e).body,-1)||e}function UO(e,t){if(!e)return null;let n=zO(zD(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function WO(e){return UO(e,1)}function GO(e){return UO(e,-1)}function KO(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!fE(n,r)}function qO(e){zO(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function JO(e){let t=[];IO(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 YO(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...YO(e,t.id,n)])}function XO(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 ZO(e){return`data-base-ui-${e}`}var QO=0;function $O(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(QO);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),lT;let o=requestAnimationFrame(a);return QO=o,()=>{QO===o&&(cancelAnimationFrame(o),QO=0)}}var ek={inert:new WeakMap,"aria-hidden":new WeakMap},tk=`data-base-ui-inert`,nk={inert:new WeakSet,"aria-hidden":new WeakSet},rk=new WeakMap,ik=0;function ak(e){return nk[e]}function ok(e){return e?qT(e)?e.host:ok(e.parentNode):null}var sk=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ok(t);return e.contains(n)?n:null}).filter(e=>e!=null),ck=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},lk=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{VT(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function uk(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=sk(t,e),l=i?lk(t,ck(c),new Set(c)):[],u=[],d=[];if(a){let e=ek[a],n=ak(a);s=n,o=e;let r=sk(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);lk(t,ck(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(rk.get(e)||0)+1;rk.set(e,t),d.push(e),t===1&&e.setAttribute(tk,``)}),ik+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(rk.get(e)||0)-1;rk.set(e,t),t||e.removeAttribute(tk)}),--ik,ik||(ek.inert=new WeakMap,ek[`aria-hidden`]=new WeakMap,nk.inert=new WeakSet,nk[`aria-hidden`]=new WeakSet,rk=new WeakMap)}}function dk(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=zD(e[0]).body;return uk(e,a,n,r,{mark:i})}var fk=0;function pk(e,t=`mui`){let[n,r]=T.useState(e),i=e||n;return T.useEffect(()=>{n??(fk+=1,r(`${t}-${fk}`))},[n,t]),i}var mk=AD.useId;function hk(e,t){if(mk!==void 0){let n=mk();return e??(t?`${t}-${n}`:n)}return pk(e,t)}var gk=19;function _k(e){return gk>=e}function vk(e){if(!T.isValidElement(e))return null;let t=e,n=t.props;return(_k(19)?n?.ref:t.ref)??null}function yk(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function bk(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function xk(e,t){return typeof e==`function`?e(t):e}function Sk(e,t){return typeof e==`function`?e(t):e}var Ck={};function wk(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ek(t);let a=Ek(e);return t&&(a=Dk(a,t)),n&&(a=Dk(a,n)),r&&(a=Dk(a,r)),i&&(a=Dk(a,i)),a}function Tk(e){if(e.length===0)return Ck;if(e.length===1)return Ek(e[0]);let t=Ek(e[0]);for(let n=1;n<e.length;n+=1)t=Dk(t,e[n]);return t}function Ek(e){return jk(e)?{...Mk(e,Ck)}:Ok(e)}function Dk(e,t){return jk(t)?Mk(t,e):kk(e,t)}function Ok(e){let t={...e};for(let e in t){let n=t[e];Ak(e,n)&&(t[e]=Pk(n))}return t}function kk(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=yk(e.style,r);break;case`className`:e[n]=Ik(e.className,r);break;default:e[n]=Ak(n,r)?Nk(e[n],r):r}}return e}function Ak(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 jk(e){return typeof e==`function`}function Mk(e,t){return jk(e)?e(t):e??Ck}function Nk(e,t){return t?e?(...n)=>{let r=n[0];if(Lk(r)){let i=r;Fk(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Pk(t):e}function Pk(e){return e&&((...t)=>{let n=t[0];return Lk(n)&&Fk(n),e(...t)})}function Fk(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ik(e,t){return t?e?t+` `+e:t:e}function Lk(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Rk(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Hk(r));let i=zk(t,n,r);if(n.enabled===!1)return null;let a=n.state??dT;return Uk(e,r,i,a)}function zk(e,t,n){let{className:r,style:i}=e,{state:a=dT,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?xk(r,a):void 0,d=l?Sk(i,a):void 0,f=l?bk(a,c):dT,p=l&&s?Bk(s):void 0,m=l?yk(f,p)??{}:dT;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?CD([m.ref,vk(n),...o]):SD(m.ref,vk(n),o):SD(null,null)),l?(u!==void 0&&(m.className=Ik(m.className,u)),d!==void 0&&(m.style=yk(m.style,d)),m):dT}function Bk(e){return Array.isArray(e)?Tk(e):wk(void 0,e)}var Vk=Symbol.for(`react.lazy`);function Hk(e){if(e?.$$typeof!==Vk)return e;let t=T.Children.toArray(e)[0];return T.isValidElement(t)?t:e}function Uk(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=wk(n,t.props);return e.ref=n.ref,T.cloneElement(t,e)}if(e&&typeof e==`string`)return Wk(e,n);throw Error(pT(8))}function Wk(e,t){return e===`button`?(0,T.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,T.createElement)(`img`,{alt:``,...t,key:t.key}):T.createElement(e,t)}var Gk={style:{transition:`none`}},Kk=`data-base-ui-click-trigger`,qk=`data-base-ui-swipe-ignore`,Jk=`data-swipe-ignore`,Yk=`[${qk}]`;`${Jk}`;var Xk={fallbackAxisSide:`none`},Zk={fallbackAxisSide:`end`},Qk={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},$k=c(m(),1),eA=T.createContext(null),tA=()=>T.useContext(eA),nA=ZO(`portal`);function rA(e={}){let{ref:t,container:n,componentProps:r=dT,elementProps:i}=e,a=hk(),o=tA()?.portalNode,[s,c]=T.useState(null),[l,u]=T.useState(null),d=$(e=>{e!==null&&u(e)}),f=T.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(WT(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Rk(`div`,r,{ref:[t,d],props:[{id:a,[nA]:``},i]}),m=s&&p?$k.createPortal(p,s):null;return{node:l,nodeId:T.isValidElement(p)?p.props.id:void 0,subtree:m}}var iA=T.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}=rA({container:o,ref:t,componentProps:e,elementProps:c}),f=T.useRef(null),p=T.useRef(null),m=T.useRef(null),h=T.useRef(null),[g,_]=T.useState(null),v=T.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;T.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&KO(e)&&(e.type===`focusin`?v.current&&=(JO(l),!1):(qO(l),v.current=!0))}return xD(bD(l,`focusin`,e,!0),bD(l,`focusout`,e,!0))},[l,y]),Q(()=>{l&&b===!0&&v.current&&(JO(l),v.current=!1)},[b,l]);let S=T.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Z.jsxs)(T.Fragment,{children:[d,(0,Z.jsxs)(eA.Provider,{value:S,children:[x&&l&&(0,Z.jsx)(UD,{"data-type":`outside`,ref:f,onFocus:e=>{KO(e,l)?m.current?.focus():HO(g?g.domReference:null)?.focus()}}),x&&l&&(0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:Qk}),l&&$k.createPortal(a,l),x&&l&&(0,Z.jsx)(UD,{"data-type":`outside`,ref:p,onFocus:e=>{KO(e,l)?h.current?.focus():(VO(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,gD(`focus-out`,e.nativeEvent)))}})]})]})});function aA(){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 oA=class{nodesRef={current:[]};events=aA();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)}},sA=T.createContext(null),cA=T.createContext(null),lA=()=>T.useContext(sA)?.id||null,uA=e=>{let t=T.useContext(cA);return e??t};function dA(e){let t=hk(),n=uA(e),r=lA();return Q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fA(e){let{children:t,id:n}=e,r=lA();return(0,Z.jsx)(sA.Provider,{value:T.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pA(e){let{children:t,externalTree:n}=e,r=tT(()=>n??new oA).current;return(0,Z.jsx)(cA.Provider,{value:r,children:t})}function mA(e){return e==null?e:`current`in e?e.current:e}function hA(e,t){let n=HT(pE(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var gA=20,_A=[];function vA(){_A=_A.filter(e=>e.deref()?.isConnected)}function yA(e){vA(),e&&VT(e)!==`body`&&(_A.push(new WeakRef(e)),_A.length>gA&&(_A=_A.slice(-20)))}function bA(){return vA(),_A[_A.length-1]?.deref()}function xA(e){return e?LO(e)?e:zO(e)[0]||e:null}function SA(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=RO(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return LO(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 CA(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=$(()=>b.current.floatingContext?.nodeId),S=i===!1,C=GE(_)&&S,w=OD(i),E=OD(a),D=OD(l),O=OD(g),k=uA(p),A=tA(),j=T.useRef(!1),M=T.useRef(!1),N=T.useRef(!1),P=T.useRef(null),F=T.useRef(``),I=T.useRef(``),L=T.useRef(null),R=T.useRef(null),z=SD(L,f,A?.beforeInsideRef),ee=SD(R,A?.afterInsideRef),B=yT(),te=yT(),ne=RD(),re=A!=null,V=qE(v),ie=$((e=V)=>e?zO(e):[]),ae=$(()=>m?.().filter(e=>e!=null)??[]);T.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&fE(V,dE(zD(V)))&&ie().length===0&&!C&&PT(e)}return bD(zD(V),`keydown`,e)},[r,V,s,C,ie]),T.useEffect(()=>{if(r||!g)return;let e=zD(V);function t(){N.current=!1}function n(e){let t=pE(e),n=ae(),r=fE(v,t)||fE(_,t)||fE(A?.portalNode,t)||n.some(e=>e===t||fE(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,te.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return xD(bD(e,`pointerdown`,n,!0),bD(e,`pointerup`,t,!0),bD(e,`pointercancel`,t,!0),bD(e,`keydown`,i,!0),t)},[r,v,_,V,g,A,te,ae]),T.useEffect(()=>{if(r||!c)return;let e=zD(V);function t(){M.current=!0,te.start(0,()=>{M.current=!1})}function n(e){let t=pE(e);LO(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=pE(t);s&&n==null&&i!=null&&fE(v,i)&&yA(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ae(),f=n?.hasAttribute(ZO(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,mA(d),mA(u)].includes(n),p=!(fE(_,n)||fE(v,n)||fE(n,v)||fE(A?.portalNode,n)||l.some(e=>e===n||fE(e,n))||c.hasMatchingElement(e=>fE(e,n))||f||k&&(YO(k.nodesRef.current,a).find(e=>fE(e.context?.elements.floating,n)||fE(e.context?.elements.domReference,n))||XO(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,qE(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&V&&SA(V),o&&r!==_&&!CO(i)&&dE(e)===e.body){if(KT(V)&&(V.focus(),o===`popup`)){ne.request(()=>{V.focus()});return}let e=ie(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||V;KT(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!M.current&&(C||n!==bA())&&(j.current=!0,h.setOpen(!1,gD(oD,t)))})}function a(){N.current||(b.current.insideReactTree=!0,B.start(0,()=>{b.current.insideReactTree=!1}))}let l=KT(_)?_:null;if(v||l)return xD(l&&bD(l,`focusout`,i),l&&bD(l,`pointerdown`,t),v&&bD(v,`focusin`,n),v&&bD(v,`focusout`,i),v&&A&&bD(v,`focusout`,a,!0))},[r,_,v,V,s,k,A,h,c,o,ie,C,x,b,B,te,ne,u,d,ae]),T.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${ZO(`portal`)}]`)||[]),t=(k?XO(k.nodesRef.current,x()):[]).find(e=>GE(e.context?.elements.domReference||null))?.context?.elements.domReference,n=dk([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ae(),t,mA(d),mA(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=dk([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,A,C,k,x,u,d,ae]),Q(()=>{if(!g||r||!KT(V))return;F.current=``,I.current=``;let e=zD(V),t=dE(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||fE(V,t))return;let i=null,a=()=>(i??=ie(V),i[0]||V),o;o=r===!0||r===null?a():mA(r),o||=a();let s=fE(V,dE(e));$O(o,{preventScroll:o===V,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=dE(e);return!(t!==o&&fE(V,t))}})})},[r,g,V,ie,w,D,O]),Q(()=>{if(r||!V)return;let e=zD(V),t=dE(e),n=D.current==null;yA(t);function i(e){if(e.open||(F.current=hA(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(IT(e.nativeEvent)||LT(e.nativeEvent))j.current=!1;else{let e=!1;zD(V).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&VT(t)!==`body`?t:null,s=n?o||a:a||o;return s||=bA()||null,typeof i==`boolean`?s:mA(i)||s||null}return()=>{y.off(`openchange`,i);let t=dE(e),n=ae(),r=fE(v,t)||n.some(e=>e===t||fE(e,t))||k&&YO(k.nodesRef.current,x(),!1).some(e=>fE(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=xA(c),i=typeof o!=`boolean`;if(o&&!j.current&&KT(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,V,E,D,y,k,_,x,ae]),Q(()=>{if(!jT||g||!v)return;let e=dE(zD(v));KT(e)&&UE(e)&&fE(v,e)&&e.blur()},[g,v]),Q(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),Q(()=>{if(!r&&V)return SA(V),()=>{queueMicrotask(vA)}},[r,V]);let oe=!r&&(!s||!C)&&(re||s);return(0,Z.jsxs)(T.Fragment,{children:[oe&&(0,Z.jsx)(UD,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=ie();$O(e[e.length-1])}else A?.portalNode&&(j.current=!1,KO(e,A.portalNode)?VO(_)?.focus():mA(d??A.beforeOutsideRef)?.focus())}}),n,oe&&(0,Z.jsx)(UD,{"data-type":`inside`,ref:ee,onFocus:e=>{s?$O(ie()[0]):A?.portalNode&&(c&&(j.current=!0),KO(e,A.portalNode)?HO(_)?.focus():mA(u??A.afterOutsideRef)?.focus())}})]})}function wA(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=eD}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=T.useRef(void 0),f=RD(),p=yT(),m=T.useMemo(()=>{function e(e,t,n,r){let i=gD(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=RT(e.pointerType,!0)&&LT(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||RT(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=pE(o);if(UE(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}RT(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return T.useMemo(()=>n?{reference:m}:dT,[n,m])}function TA(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function EA(e){return e!=null&&e.clientX!=null}function DA(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=T.useRef(!1),u=T.useRef(null),[d,f]=T.useState(),[p,m]=T.useState([]),h=$(e=>{i.set(`positionReference`,e)}),g=$((e,t,n)=>{l.current||(!c.current.openEvent||EA(c.current.openEvent))&&i.set(`positionReference`,TA(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=$(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=RT(d)?o:a;T.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=HT(o);function r(t){let n=pE(t);fE(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||EA(c.current.openEvent)?u.current=bD(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),T.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),T.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),T.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=T.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return T.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function OA(){return!1}function kA(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function AA(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=OA,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=uA(c),h=$(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=$(()=>a),{escapeKey:y,outsidePress:b}=kA(s),x=T.useRef(!1),S=T.useRef(!1),C=T.useRef(!1),w=T.useRef(!1),E=T.useRef(!1),D=T.useRef(``),O=T.useRef(null),k=yT(),A=yT(),j=$(()=>{A.clear(),f.current.insideReactTree=!1}),M=$(e=>{let t=f.current.floatingContext?.nodeId;return(m?YO(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=$(e=>VE(e,l.select(`floatingElement`))||VE(e,l.select(`domReferenceElement`))),P=$(e=>{o()&&l.setOpen(!1,gD(eD,e.nativeEvent))}),F=$(e=>{if(!u||!n||!r||e.key!==`Escape`||E.current||!y&&M(`__escapeKeyBubbles`))return;let t=gD(sD,FT(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=$(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=$(e=>{if(!u||!n||e.button!==0)return;let t=pE(e.nativeEvent);fE(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),R=$(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});T.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),T.useEffect(()=>{if(!u||!n)return u||(w.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new vT,t=new vT,i=zD(d);function a(){e.clear(),E.current=!0}function o(){e.start(jT?5:0,()=>{E.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function T(e){let t=f.current.floatingContext?.nodeId,n=m&&YO(m.nodesRef.current,t).some(t=>VE(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=pE(e),r=`[${ZO(`inert`)}]`,i=GT(n)?n.getRootNode():null,a=Array.from((qT(i)?i:zD(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>fE(e,n))))return;let s=GT(n)?n:null;for(;s&&!iE(s);){let e=sE(s);if(iE(e)||!GT(e))break;s=e}if(!(a.length&&GT(n)&&!HE(n)&&!fE(n,l.select(`floatingElement`))&&a.every(e=>!fE(s,e)))){if(KT(n)&&!(`touches`in e)){let t=iE(n),r=aE(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!T(e)){if(p()===`intentional`){if(e.detail!==0&&!IT(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,gD(rD,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=pE(e);if(!n)return;let r=bD(n,e.type,()=>{t(e),r()})}function R(e){D.current=`touch`,L(e,I)}function z(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),D.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function ee(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!T(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())}}}function B(e){if(p()!==`sloppy`||!O.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),O.current=null)}function te(e){L(e,B)}function ne(e){p()===`sloppy`&&O.current&&!N(e)&&(O.current.dismissOnTouchEnd&&A(e),k.clear(),O.current=null)}function re(e){L(e,ne)}let V=xD(r&&xD(bD(i,`keydown`,F),bD(i,`compositionstart`,a),bD(i,`compositionend`,o)),_&&xD(bD(i,`click`,z,!0),bD(i,`pointerdown`,z,!0),bD(i,`pointerup`,ee,!0),bD(i,`pointercancel`,ee,!0),bD(i,`mousedown`,z,!0),bD(i,`mouseup`,ee,!0),bD(i,`touchstart`,R,{capture:!0,passive:!0}),bD(i,`touchmove`,te,{capture:!0,passive:!0}),bD(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{V(),e.clear(),t.clear(),c(),C.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,k]);let z=T.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=T.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 T.useMemo(()=>n?{reference:z,floating:ee,trigger:z}:{},[n,z,ee])}function jA(e,t,n){let{reference:r,floating:i}=e,a=nO(t),o=rO(t),s=tO(o),c=QD(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=$D(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function MA(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}=ZD(t,e),p=hO(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=gO(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=gO(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 NA=50,PA=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:MA},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=jA(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<NA&&(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}=jA(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},FA=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}=ZD(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=QD(r),_=nO(o),v=QD(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pO(o)]:aO(o)),x=p!==`none`;!d&&x&&b.push(...fO(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=iO(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`||_===nO(t)||T.every(e=>nO(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=nO(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{}}}},IA=new Set([`left`,`top`]);async function LA(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=QD(n),s=$D(n),c=nO(n)===`y`,l=IA.has(o)?-1:1,u=a&&c?-1:1,d=ZD(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 RA=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 LA(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}}}}},zA=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}=ZD(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=nO(i),p=eO(f),m=u[p],h=u[f],g=(e,t)=>XD(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}}}}}},BA=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}=ZD(e,t),u={x:n,y:r},d=nO(i),f=eO(d),p=u[f],m=u[d],h=ZD(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=IA.has(QD(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}}}},VA=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}=ZD(e,t),c=await i.detectOverflow(t,s),l=QD(n),u=$D(n),d=nO(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=WD(p-c[m],g),y=WD(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*GD(c.left,c.right):S=p-2*GD(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 HA(e){let t=aE(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=KT(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=KD(n)!==a||KD(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function UA(e){return GT(e)?e:e.contextElement}function WA(e){let t=UA(e);if(!KT(t))return JD(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=HA(t),o=(a?KD(n.width):n.width)/r,s=(a?KD(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var GA=JD(0);function KA(e){let t=HT(e);return!rE()||!t.visualViewport?GA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qA(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===HT(e)}function JA(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=UA(e),o=JD(1);t&&(r?GT(r)&&(o=WA(r)):o=WA(e));let s=qA(a,n,r)?KA(a):JD(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=HT(a),t=GT(r)?HT(r):r,n=e,i=uE(n);for(;i&&t!==n;){let e=WA(i),t=i.getBoundingClientRect(),r=aE(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=HT(i),i=uE(n)}}return gO({width:u,height:d,x:c,y:l})}function YA(e,t){let n=oE(e).scrollLeft;return t?t.left+n:JA(UT(e)).left+n}function XA(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-YA(e,n),y:n.top+t.scrollTop}}function ZA(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=UT(r),s=t?XT(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=JD(1),u=JD(0),d=KT(r);if((d||!a)&&((VT(r)!==`body`||JT(o))&&(c=oE(r)),d)){let e=JA(r);l=WA(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?XA(o,c):JD(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 QA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function $A(e){let t=oE(e),n=e.ownerDocument.body,r=GD(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=GD(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+YA(e),o=-t.scrollTop;return aE(n).direction===`rtl`&&(a+=GD(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ej=25;function tj(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=HT(e),a=UT(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!rE()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(YA(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<=ej&&(s-=o)}return{width:s,height:c,x:l,y:u}}function nj(e,t){let n=JA(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=WA(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function rj(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=tj(e,n,t);else if(t===`document`)r=$A(UT(e));else if(GT(t))r=nj(t,n);else{let n=KA(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return gO(r)}function ij(e,t){let n=t.get(e);if(n)return n;let r=lE(e,[],!1).filter(e=>GT(e)&&VT(e)!==`body`),i=null,a=aE(e).position===`fixed`,o=a?sE(e):e;for(;GT(o)&&!iE(o);){let e=aE(o),t=tE(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=sE(o)}return t.set(e,r),r}function aj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?XT(t)?[]:ij(t,this._c):[].concat(n),r],o=rj(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=rj(t,a[e],i);s=GD(n.top,s),c=WD(n.right,c),l=WD(n.bottom,l),u=GD(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function oj(e){let{width:t,height:n}=HA(e);return{width:t,height:n}}function sj(e,t,n){let r=KT(t),i=UT(t),a=n===`fixed`,o=JA(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=JD(0);if((r||!a)&&((VT(t)!==`body`||JT(i))&&(s=oE(t)),r)){let e=JA(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=YA(i));let l=i&&!r&&!a?XA(i,s):JD(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 cj(e){return aE(e).position===`static`}function lj(e,t){if(!KT(e)||aE(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return UT(e)===n&&(n=n.ownerDocument.body),n}function uj(e,t){let n=HT(e);if(XT(e))return n;if(!KT(e)){let t=sE(e);for(;t&&!iE(t);){if(GT(t)&&!cj(t))return t;t=sE(t)}return n}let r=lj(e,t);for(;r&&YT(r)&&cj(r);)r=lj(r,t);return r&&iE(r)&&cj(r)&&!tE(r)?n:r||nE(e)||n}var dj=async function(e){let t=this.getOffsetParent||uj,n=this.getDimensions,r=await n(e.floating);return{reference:sj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fj(e){return aE(e).direction===`rtl`}var pj={convertOffsetParentRelativeRectToViewportRelativeRect:ZA,getDocumentElement:UT,getClippingRect:aj,getOffsetParent:uj,getElementRects:dj,getClientRects:QA,getDimensions:oj,getScale:WA,isElement:GT,isRTL:fj};function mj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hj(e,t,n){let r=null,i,a=UT(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=qD(d),h=qD(a.clientWidth-(u+f)),g=qD(a.clientHeight-(d+p)),_=qD(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:GD(0,WD(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!mj(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=HT(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function gj(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=UA(e),u=i||a?[...l?lE(l):[],...t?lE(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?hj(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?JA(e):null;c&&g();function g(){let t=JA(e);h&&!mj(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 _j=RA,vj=zA,yj=FA,bj=VA,xj=BA,Sj=(e,t,n)=>{let r=new Map,i=n??{},a={...pj,...i.platform,_c:r};return PA(e,t,{...i,platform:a})},Cj=typeof document<`u`?T.useLayoutEffect:function(){};function wj(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(!wj(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)&&!wj(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Tj(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ej(e,t){let n=Tj(e);return Math.round(t*n)/n}function Dj(e){let t=T.useRef(e);return Cj(()=>{t.current=e}),t}function Oj(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]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=T.useState(r);wj(f,r)||p(r);let[m,h]=T.useState(null),[g,_]=T.useState(null),v=T.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=T.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=T.useRef(null),C=T.useRef(null),w=T.useRef(u),E=c!=null,D=Dj(c),O=Dj(i),k=Dj(l),A=T.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Sj(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!wj(w.current,t)&&(w.current=t,$k.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Cj(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=T.useRef(!1);Cj(()=>(j.current=!0,()=>{j.current=!1}),[]),Cj(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,E]);let M=T.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=T.useMemo(()=>({reference:b,floating:x}),[b,x]),P=T.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Ej(N.floating,u.x),r=Ej(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Tj(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return T.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var kj=(e,t)=>{let n=_j(e);return{name:n.name,fn:n.fn,options:[e,t]}},Aj=(e,t)=>{let n=vj(e);return{name:n.name,fn:n.fn,options:[e,t]}},jj=(e,t)=>({fn:xj(e).fn,options:[e,t]}),Mj=(e,t)=>{let n=yj(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nj=(e,t)=>{let n=bj(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pj=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})),Fj=o(((e,t)=>{t.exports=Pj()})),Ij=o((e=>{var t=u(),n=Fj();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}})),Lj=o(((e,t)=>{t.exports=Ij()})),Rj=Fj(),zj=Lj(),Bj=_k(19)?Uj:Wj;function Vj(e,t,n,r,i){return Bj(e,t,n,r,i)}function Hj(e,t,n,r,i){let a=T.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Rj.useSyncExternalStore)(e.subscribe,a,a)}aT({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,Rj.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Uj(e,t,n,r,i){let a=iT();if(!a)return Hj(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 Wj(e,t,n,r,i){return(0,zj.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Gj=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 Vj(this,e,t,n,r)}},Kj=class extends Gj{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){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){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 T.useDebugValue(e),Vj(this,this.selectors[e],t,n,r)}useContextCallback(e,t){T.useDebugValue(e);let n=$(t??lT);this.context[e]=n}useStateSetter(e){let t=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)}})}},qj={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},Jj=class extends Kj{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:aA(),nested:n,triggerElements:i},qj),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&zT(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Yj(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=T.useRef(null);r===void 0&&f.current===null&&(f.current=new Jj({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};GT(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Xj(e,t=!1,n=!1,r=!1){let[i,a]=T.useState(e&&t?`idle`:void 0),[o,s]=T.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=LD.request(()=>{a(`ending`)});return()=>{LD.cancel(e)}}},[e,o,i,n]),Q(()=>{if(!e||t)return;let n=LD.request(()=>{a(void 0)});return()=>{LD.cancel(n)}},[t,e]),Q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=LD.request(()=>{a(`idle`)});return()=>{LD.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var Zj=null;function Qj(e){if(!Zj){let e=[];Zj=e,queueMicrotask(()=>{Zj=null,$k.flushSync(()=>{for(let t of e)t()})})}Zj.push(e)}function $j(e,t=!1,n=!1){let r=RD();return $((i,a=null)=>{r.cancel();let o=mA(e);if(o==null)return;let s=o,c=()=>{if(!n){$k.flushSync(i);return}Qj(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=bE;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function eM(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=$(a),s=$j(r,n,i);T.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var tM={tabIndex:-1,[mE]:``};function nM(e){return t=>t!==`touch`||e.current}function rM(e,t=!1){let n=hk(),r=lA()!=null,i=tT(()=>e(n,r)).current;return Yj({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function iM({handle:e,store:t}){return Q(()=>e.attachStore(t),[e,t]),null}function aM(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function oM(e,t){let n=T.useRef(null);return $(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),aM(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),aM(t))})}function sM(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function cM(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function lM(e,t,n,r={}){let i=n.reason,a=i===tD,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=cM(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=sM(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?$k.flushSync(l):l()}function uM(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=oM(e,n),o=$(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=$(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 dM(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=T.useRef(null),i=e.useState(`open`);Q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=gD($E);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 fM(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=Xj(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=$(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return eM({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function pM(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:dT,inactiveTriggerProps:dT,popupProps:dT})},[e])}function mM(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 hM=class{constructor(){this.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}};function gM(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Jj({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:dT,inactiveTriggerProps:dT,popupProps:dT}}var _M=e=>e.triggerIdProp??e.activeTriggerId,vM=e=>e.openProp??e.open,yM=e=>(e.popupElement?.id??e.floatingId)||void 0;function bM(e,t){return t!==void 0&&vM(e)&&_M(e)===t}function xM(e,t){return bM(e,t)?!0:t!==void 0&&vM(e)&&_M(e)==null&&e.triggerCount===1}var SM={open:vM,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:_M,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:yM,isTriggerActive:(e,t)=>t!==void 0&&_M(e)===t,isOpenedByTrigger:(e,t)=>bM(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&_M(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>xM(e,t)?yM(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function CM(e){let t=T.useCallback(t=>e===void 0?lT:e.subscribeStore(t),[e]),n=T.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Rj.useSyncExternalStore)(t,n,()=>e?.serverStore)}function wM(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=hk(),a=lA()!=null,o=tT(()=>new Jj({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new hM,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=GT(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function TM(e){return EM(e,e.rootContext)}function EM(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=T.useState(null),[d,f]=T.useState(void 0),[p,m]=T.useState(void 0),h=T.useRef(null),g=uA(r),_=T.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=Oj({...e,elements:{..._,...l&&{reference:l}}}),y=GT(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=T.useCallback(e=>{let t=GT(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=T.useCallback(e=>{(GT(e)||e===null)&&(h.current=e,f(e)),(GT(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!GT(e))&&v.refs.setReference(e)},[v.refs,f]),C=T.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=T.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),E=T.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),D=T.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:E,nodeId:n,rootStore:t}),[v,w,E,n,t,s,c]);return Q(()=>{o&&(h.current=o)},[o]),Q(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),T.useMemo(()=>({...v,context:D,refs:w,elements:E,rootStore:t}),[v,w,E,D,t])}var DM=kT&&jT;function OM(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=T.useRef(!1),c=T.useRef(null),l=T.useRef(!0),u=yT();T.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=HT(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&KT(e)&&e===dE(zD(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return xD(bD(t,`blur`,r),DM&&bD(t,`keydown`,a,!0),DM&&bD(t,`pointerdown`,o,!0))},[i,n]),T.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);GT(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=T.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=pE(t.nativeEvent);if(GT(a)){if(DM&&!t.relatedTarget){if(!l.current&&!UE(a))return}else if(!KE(a))return}let o=BE(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,gD(nD,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,gD(nD,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=GT(n)&&n.hasAttribute(ZO(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=dE(zD(e));(n||t!==e)&&(fE(o.current.floatingContext?.refs.floating.current,t)||fE(e,t)||a||BE(n??t,i.context.triggerElements)||i.setOpen(!1,gD(nD,r)))})}}},[o,r,i,u]);return T.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var kM=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new vT,this.restTimeout=new vT,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},AM=new WeakMap;function jM(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&AM.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),AM.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function MM(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=AM.get(n);a&&a!==e&&jM(a),jM(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,AM.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function NM(e){let t=e.context.dataRef.current,n=tT(()=>t.hoverInteractionState??kM.create()).current;return t.hoverInteractionState||=n,gT(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function PM(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=uA(),d=lA(),f=NM(a),p=yT(),m=$(()=>ZE(l.current.openEvent?.type,f.interactedInside)),h=$(()=>QE(l.current.openEvent?.type)),g=$(()=>{jM(f)});Q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),T.useEffect(()=>g,[g]),Q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&GT(c)&&s){let e=c,t=s,n=zD(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return MM(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),T.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&YO(u.nodesRef.current,d).length>0)}function t(e){let t=YE(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,gD(tD,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=pE(e);if(!WE(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(BE(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&GT(o)&&YO(u.nodesRef.current,r,!1).some(e=>fE(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,gD(tD,t)),u.events.emit(`floating.closed`,t)})}let y=s;return xD(y&&bD(y,`mouseenter`,c),y&&bD(y,`mouseleave`,_),y&&bD(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var FM={current:null};function IM(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=FM,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=uA(l),y=NM(h),b=T.useRef(!1),x=OD(i),S=OD(r),C=OD(o),w=OD(n),E=OD(p),D=OD(f),O=$(()=>ZE(g.current.openEvent?.type,y.interactedInside)),k=$(()=>E.current?.()!==!1),A=$((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!fE(e,t);if(!GT(n))return!1;let i=n;return r.hasMatchingElement(e=>fE(e,i))&&(!e||!fE(e,i))}),j=$(()=>{y.handler&&=(zD(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=$(()=>{jM(y)});return u&&(y.handleCloseOptions=i?.__options),T.useEffect(()=>j,[j]),T.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===tD,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),T.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=YE(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,gD(tD,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,gD(tD,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!GT(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!RT(y.pointerType))return;let t=XE(C.current),n=YE(S.current,`open`,y.pointerType),r=pE(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(GT(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(fE(e,r)){s=e;break}}GT(i)&&GT(o)&&!h.context.triggerElements.hasElement(i)&&fE(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&GT(s)&&GT(o)&&fE(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,gD(tD,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,gD(tD,e,s))}):g&&k()&&h.setOpen(!0,gD(tD,e,s)))}function i(t){if(O()){M();return}j();let n=zD(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!BE(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),w.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!fE(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){fE(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?bD(t,`mouseout`,o):void 0;return s?xD(bD(t,`mousemove`,r,{once:!0}),bD(t,`mouseenter`,r),bD(t,`mouseleave`,i),l):xD(bD(t,`mouseenter`,r),bD(t,`mouseleave`,i),l)},[j,M,g,S,h,n,x,y,u,A,O,a,s,C,c,v,w,d,D,k,m]),T.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!RT(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;MM(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=XE(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,O())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,gD(tD,t,n))}y.pointerType===`touch`?$k.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,O,A,a,h,C,k])}var LM=`Escape`;function RM(e){return jT&&e.movementX===0&&e.movementY===0}function zM(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function BM(e,t){return zM(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function VM(e,t,n){return zM(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function HM(e,t,n){return zM(t,n?e===gE:e===_E,e===yE)}function UM(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===LM:zM(t,n?e===_E:e===gE,e===vE)}function WM(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),E=C.useState(`floatingElement`),D=C.useState(`domReferenceElement`),O=C.context.dataRef,k=qE(E),A=GE(D),j=OD(k),M=lA(),N=uA(b),P=T.useRef(f),F=T.useRef(o??-1),I=T.useRef(null),L=T.useRef(!0),R=$(e=>{i(F.current===-1?null:F.current,e)}),z=T.useRef(!!E),ee=T.useRef(w),B=T.useRef(!1),te=T.useRef(!1),ne=T.useRef(null),re=OD(h),V=OD(w),ie=OD(o),ae=OD(y),oe=RD(),se=RD(),ce=$(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):ne.current=$O(e,{sync:B.current,preventScroll:!0})}let t=n.current[F.current],r=te.current;t&&e(t),(B.current?e=>e():e=>oe.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),U&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{O.current.orientation=g},[O,g]),Q(()=>{a&&(w&&E?(F.current=o??-1,P.current&&o!=null&&(te.current=!0,R())):z.current&&(F.current=-1,R()))},[a,w,E,o,R]),Q(()=>{if(a){if(!w){B.current=!1;return}if(E){if(r==null){if(B.current=!1,ie.current!=null)return;if(z.current&&(F.current=-1,ce()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>se.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||VM(I.current,g,u)||l?vO(n):yO(n),I.current=null,R())};t()}}else _O(n.current,r)||(F.current=r,ce(),te.current=!1)}}},[a,w,E,r,ie,l,n,g,u,R,ce,se]),Q(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=dE(zD(D??t??null)),r=e.some(e=>e.context&&fE(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Q(()=>{ee.current=w,z.current=!!E}),Q(()=>{w||(I.current=null,P.current=f)},[w,f]);let H=r!=null,le=$(e=>{if(!V.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ue=$(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=$(()=>vO(n,re.current)),fe=$(e=>{if(L.current=!1,B.current=!0,e.which===229||!V.current&&e.currentTarget===j.current)return;if(l&&UM(e.key,g,u,S)){BM(e.key,ue())||PT(e),C.setOpen(!1,gD(lD,e.nativeEvent)),KT(D)&&(d?N?.events.emit(`virtualfocus`,D):D.focus());return}let t=F.current,r=vO(n,h),i=yO(n,h);if(A||(e.key===`Home`&&(PT(e),F.current=r,R(e)),e.key===`End`&&(PT(e),F.current=i,R(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,R(e)),g===`both`)return}if(BM(e.key,g)){if(PT(e),w&&!d&&dE(e.currentTarget.ownerDocument)===e.currentTarget){F.current=VM(e.key,g,u)?r:i,R(e);return}VM(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(B.current=!1,F.current=r):F.current=bO(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,bO(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(B.current=!1,F.current=i):F.current=bO(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,bO(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),_O(n.current,F.current)&&(F.current=-1),R(e)}}),U=T.useMemo(()=>({onFocus(e){B.current=!0,le(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){RM(e)||(B.current=!0,te.current=!1,p&&le(e))},onPointerLeave(e){if(!V.current||!L.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ae.current&&(ne.current?.(),ne.current=null,F.current=-1,R(e),!d)){let e=j.current,t=dE(zD(e));e&&fE(e,t)&&e.focus({preventScroll:!0})}}}),[le,V,j,p,n,R,ae,d]),pe=T.useMemo(()=>d&&w&&H&&{"aria-activedescendant":`${v}-${r}`},[d,w,H,v,r]),me=T.useMemo(()=>({...A?{}:pe,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=pE(e.nativeEvent);if(t&&!fE(j.current,t))return;PT(e),C.setOpen(!1,gD(oD,e.nativeEvent)),KT(D)&&D.focus();return}fe(e)},onPointerMove(e){RM(e)||(L.current=!0)}}),[pe,fe,j,A,C,w,d,D]),he=T.useMemo(()=>{function e(e){C.setOpen(!0,gD(lD,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&IT(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&LT(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=C.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=HM(t.key,ue(),u),a=BM(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return fe(t);if(n||m||!r){if(o){let e=BM(t.key,ue());I.current=l&&e?null:t.key}if(l){i&&(PT(t),n?(F.current=de(),R(t)):e(t));return}a&&(ie.current!=null&&(F.current=ie.current),PT(t),!n&&m?e(t):fe(t),n&&R(t))}},onFocus(e){C.select(`open`)&&!d&&(F.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[fe,f,de,l,R,C,m,g,ue,u,ie,d]),ge=T.useMemo(()=>({...pe,...he}),[pe,he]);return T.useMemo(()=>a?{reference:ge,floating:me,item:U,trigger:he}:{},[a,ge,me,he,U])}function GM(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=yT(),m=T.useRef(``),h=T.useRef(u??i??-1),g=T.useRef(null),_=$(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!CO(n)||n?.matches(`:disabled`)?!1:o==null||!xO(uT,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(PT(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(PT(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=$(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);fE(n,t)||fE(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=T.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return T.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var KM=.1,qM=KM*KM,JM=.5;function YM(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function XM(e,t,n,r,i,a,o,s,c,l){let u=!1;return YM(e,t,n,r,i,a)&&(u=!u),YM(e,t,i,a,o,s)&&(u=!u),YM(e,t,o,s,c,l)&&(u=!u),YM(e,t,c,l,n,r)&&(u=!u),u}function ZM(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function QM(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 $M(e={}){let{blockPointerEvents:t=!1}=e,n=new vT,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*qM;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=pE(r),g=r.type===`mouseleave`,_=fE(u,h),v=fE(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&GT(r.relatedTarget)&&fE(u,r.relatedTarget))return;function y(){return!!(s&&YO(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=QM(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=QM(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=QM(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=QM(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!ZM(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?JM/2:JM*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+JM+1,o=C||T?S.bottom-JM:S.top,s=C?T?S.bottom-JM:S.top:S.bottom-JM;M=XM(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?JM/2:JM*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-JM,o=C||T?S.top+JM:S.bottom,s=C?T?S.top+JM:S.bottom:S.top+JM;M=XM(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?JM/2:JM*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+JM+1,o=w||E?S.right-JM:S.left,s=w?E?S.right-JM:S.left:S.right-JM;M=XM(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?JM/2:JM*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-JM,o=w||E?S.left+JM:S.right,s=w?E?S.left+JM:S.right:S.left+JM;M=XM(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}var eN={...SM,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,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},tN=class extends Kj{constructor(e,t,n){let r=new hM;super(nN(e,r,t,n),rN(r),eN)}setOpen=(e,t)=>{lM(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,gD(eD,e))}};function nN(e,t,n,r=!1){return{...gM(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 rN(e){return{popupRef:T.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var iN=oT(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=rM((e,t)=>new tN({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`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),dM(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=fM(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=T.useRef(null);Q(()=>{m&&t&&p.setOpen(!1,gD(fD))},[m,t,p]),Q(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),T.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,gD(pD))}),[y,p]);let E=h||_||!t&&a!==`none`;return(0,Z.jsxs)(mT.Provider,{value:p,children:[l&&(0,Z.jsx)(iM,{handle:l,store:p}),E&&(0,Z.jsx)(aN,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function aN({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=AA(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=DA(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=T.useMemo(()=>wk(a.reference,i.reference),[a.reference,i.reference]);return pM(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??dT}),null}function oN(e){return hk(e,`base-ui`)}var sN=T.createContext(void 0);function cN(){return T.useContext(sN)}var lN=`data-base-ui-tooltip-trigger`;function uN(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(GT(n))return n}}let t=e.target;return GT(t)?t:null}function dN(e){let t=e;for(;t;){let e=t.closest(`[${lN}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&GT(n.host)?n.host:null}return null}var fN=sT(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=hT(!0),m=CM(a)??p;if(!m)throw Error(pT(82));let h=oN(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=T.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=uM(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=cN(),{activeIdRef:w,delayRef:E,isInstantPhase:D,hasProvider:O}=yD(v,{open:_}),k=NM(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=OD(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=T.useRef(!1),I=yT(),L=T.useRef(void 0);function R(){return O&&w.current!=null?0:c??C??600}function z(e){let t=y.current;if(!t||!e)return!1;let n=dN(e);return n!==null&&n!==t&&fE(t,n)}function ee(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let B=IM(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?$M():null,restMs:R,delay(){return u==null&&O?{close:YE(E.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),te=OM(v,{enabled:!j}).reference,ne=e=>{let t=F.current,n=uN(e),r=ee(n),i=y.current,a=i&&n&&fE(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,gD(tD,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&RT(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,gD(tD,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},re=m.useState(`triggerProps`,S);return Rk(`button`,e,{state:{open:_},ref:[t,x,y],props:[B,te,S||N!==`none`?re:void 0,{onMouseOver(e){ne(e.nativeEvent)},onFocus(e){z(uN(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,[zE]:j?``:void 0,[lN]:j?void 0:``},f],stateAttributesMapping:FE})}),pN=T.createContext(void 0);function mN(){let e=T.useContext(pN);if(e===void 0)throw Error(pT(70));return e}var hN=T.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=rA({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Z.jsxs)(T.Fragment,{children:[l,c&&$k.createPortal(n,c)]})}),gN=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return hT().useState(`mounted`)||n?(0,Z.jsx)(pN.Provider,{value:n,children:(0,Z.jsx)(hN,{ref:t,...r})}):null}),_N=T.createContext(void 0);function vN(){let e=T.useContext(_N);if(e===void 0)throw Error(pT(71));return e}var yN=T.createContext(void 0);function bN(){return T.useContext(yN)?.direction??`ltr`}var xN=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=ZD(e,t)||{};if(l==null)return{};let f=hO(u),p={x:n,y:r},m=rO(i),h=tO(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=XD(k,j,A),N=!c.arrow&&$D(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),SN=(e,t)=>{let{name:n,fn:r}=xN(e);return{name:n,fn:r,options:[e,t]}},CN={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}}}},wN={sideX:`left`,sideY:`top`},TN=`--available-width`,EN=`--available-height`,DN=`--anchor-width`,ON=`--anchor-height`,kN=`--transform-origin`,AN=TN,jN=EN;function MN(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 NN(e,t,n){let{rects:r,placement:i}=e;return{side:MN(t,QD(i),n),align:$D(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function PN(e){return FN(e,TM)}function FN(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=T.useState(null);!g&&C!==null&&w(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=$(j),N=j?M:n,P=OD(n),F=OD(g),I=bN()===`rtl`,L=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let ee=+(i===`bottom`),B=+(i===`top`),te=+(i===`right`),ne=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},V=T.useRef(null),ie=OD(a),ae=OD(s),oe=typeof a==`function`?0:a,se=typeof s==`function`?0:s,ce=[];p&&ce.push(p),ce.push(kj(e=>{let t=NN(e,i,I),n=typeof ie.current==`function`?ie.current(t):ie.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,se,I,i]));let H=D===`none`&&E!==`shift`,le=!H&&(u||k||E===`shift`),ue=E===`none`?null:Mj({...re,padding:{top:z.top+1+ee,right:z.right+1+ne,bottom:z.bottom+1+B,left:z.left+1+te},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),de=H?null:Aj({...re,rootBoundary:A,mainAxis:D!==`none`,crossAxis:le,limiter:u||k?void 0:jj(e=>{if(!V.current)return{};let{width:t,height:n}=V.current.getBoundingClientRect(),r=nO(QD(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[re,u,k,A,z,D]);E===`shift`||D===`shift`||o===`center`?ce.push(de,ue):ce.push(ue,de),ce.push(Nj({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(AN,`${t}px`),i.setProperty(jN,`${n}px`);let a=HT(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(DN,`${u}px`),i.setProperty(ON,`${d}px`)}}),SN(e=>({element:V.current||zD(e.elements.floating).createElement(`div`),padding:V.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=QD(r),u=$D(r),d=nO(l)===`y`,f=V.current,p=typeof a==`function`?a(NN(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return le&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(kN,d?`${m} ${h}`:`${h} ${m}`),{}}},CN,b),Q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=T.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:U,elements:pe,x:me,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:ce,strategy:r,whileElementsMounted:m?void 0:(...e)=>gj(...e,fe),nodeId:y,externalTree:S}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||wN,we=be?r:`fixed`,Te=T.useMemo(()=>{let e;return e=be?b?{position:we,[Se]:me,[Ce]:he}:{...xe,position:we}:{position:we,top:0,left:0},e[AN]=`100vw`,e[jN]=`100vh`,be||(e.opacity=0),e},[b,we,Se,me,Ce,he,xe,be]),Ee=T.useRef(null);Q(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(IN(t)?t.current:t)||null;n!==Ee.current&&(U.setPositionReference(n),Ee.current=n)},[g,U,N,P]),T.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&IN(e)&&e.current!==Ee.current&&(U.setPositionReference(e.current),Ee.current=e.current)},[g,U,N,P]),T.useEffect(()=>{if(m&&g&&pe.reference&&pe.floating)return gj(pe.reference,pe.floating,_e,fe)},[m,g,pe,_e,fe]);let De=QD(ve),Oe=MN(i,De,I),ke=$D(ve)||`center`,Ae=!!ge.hide?.referenceHidden;Q(()=>{x&&g&&be&&De!==L&&w(De)},[x,g,be,De,L]);let je=T.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return T.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:V,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:U,context:ye,isPositioned:be,update:_e}),[Te,je,V,Me,Oe,ke,De,Ae,U,ye,be,_e])}function IN(e){return e!=null&&`current`in e}function LN(e){return e===`starting`?Gk:dT}function RN(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Rk(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},LN(r),i],stateAttributesMapping:LE})}var zN=T.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=Zk,style:g,..._}=e,v=hT(),y=mN(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),E=v.useState(`instantType`),D=v.useState(`transitionStatus`),O=PN({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),k=RN(e,T.useMemo(()=>({open:b,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:S===`none`?E:`tracking-cursor`}),[b,O.side,O.align,O.anchorHidden,S,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Z.jsx)(_N.Provider,{value:O,children:k})}),BN=T.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=hT(),{side:s,align:c}=vN(),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`);eM({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),PM(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Rk(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[tM,f,LN(d),a],stateAttributesMapping:RE})});function VN(e){return _k(19)?e:e?`true`:void 0}function HN(e){let[t,n]=T.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function UN(e){let t=T.useRef(!0);t.current&&(t.current=!1,e())}function WN(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function GN({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=T.useRef(e!==void 0),[a,o]=T.useState(t);return[i&&e!==void 0?e:a,T.useCallback(e=>{i||o(e)},[])]}var KN=T.createContext(void 0),qN=T.createContext(void 0),JN=T.createContext(void 0);function YN(){let e=T.useContext(KN);if(e===void 0)throw Error(pT(60));return e}function XN(){let e=T.useContext(qN);if(e===void 0)throw Error(pT(101));return e}function ZN(){let e=T.useContext(JN);if(e===void 0)throw Error(pT(61));return e}var QN=`data-valid`,$N=`data-invalid`,eP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},tP={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},nP={valid(e){return e===null?null:e?{[QN]:``}:{[$N]:``}}},rP={invalid:void 0,name:void 0,validityData:{state:eP,errors:[],error:``,value:``,initialValue:null},setValidityData:lT,disabled:void 0,setTouched:lT,setDirty:lT,setFilled:lT,setFocused:lT,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:tP,registerFieldControl:lT,validation:{getValidationProps:(e,t=dT)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:lT,getInputControl:()=>null,commit:async()=>{},change:lT}},iP=T.createContext(rP);function aP(e=!0){let t=T.useContext(iP);if(t.setValidityData===lT&&!e)throw Error(pT(28));return t}function oP(e,t,n,r,i=!0,a){let{registerFieldControl:o}=aP(),s=tT(()=>Symbol());Q(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var sP=T.createContext({controlId:void 0,registerControlId:lT,resetControlId:lT,labelId:void 0,setLabelId:lT,messageIds:[],setMessageIds:lT,getDescriptionProps:e=>e});function cP(){return T.useContext(sP)}function lP(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=cP(),o=oN(),s=tT(()=>Symbol()),c=T.useRef(!1),l=T.useRef(!1),u=$(()=>{c.current&&i!==lT&&(c.current=!1,i(s.current,void 0))});return Q(()=>{if(!n||i===lT){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),Q(()=>u,[u]),(n?r:void 0)??t??o}function uP(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}var dP=(e,t)=>Object.is(e,t);function fP(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function pP(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!uP(e,t,(e,t)=>fP(e,t,n)):e!==t}function mP(e,t,n){return e?e.some(e=>e!==void 0&&fP(t,e,n)):!1}function hP(e,t,n){return e?e.findIndex(e=>e!==void 0&&fP(e,t,n)):-1}function gP(e,t){if(t!==dP)return n=>mP(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function _P(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(gP(t,n)):hP(e,t,n);return i===-1?null:i}function vP(e,t,n,r,i,a){return mP(r,t,i)?a!=null&&e>a&&mP(r,n[a],i)?a:e:e===a?_P(n,r,i,!0):a}function yP(e,t,n){return e.filter(e=>!fP(t,e,n))}function bP(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function xP(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function SP(e){return xP(e?.[0])}function CP(e){return SP(e)?e.flatMap(e=>e.items):e}function wP(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(SP(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function TP(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return bP(e)}function EP(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?bP(e.value):bP(e)}function DP(e,t,n){function r(){return TP(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=CP(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function OP(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Z.jsx)(T.Fragment,{children:DP(r,t,n)},i)),e),[])}var kP={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:EP(t,r)!==``},hasNullItemLabel:(e,t)=>t?wP(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>fP(t,e,n)):fP(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},AP=T.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:lT,validationMode:`onSubmit`,submitCountRef:{current:0}});function jP(){return T.useContext(AP)}function MP(e,t){let n=T.useRef(e),r=$(t);Q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function NP(e){let t=T.useRef(``),n=T.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:T.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function PP(e,t){let{onClick:n,onPointerDown:r}=NP($((n,r)=>{(typeof e==`function`?e():e)||t(r||(ET?`touch`:``))}));return T.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function FP(e){let[t,n]=T.useState(null),r=PP(e,n);return MP(e,t=>{t&&!e&&n(null)}),T.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function IP(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function LP(e,t){return Math.max(0,e-t)}function RP(e,t){if(t<=0)return 0;let n=IP(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function zP(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=dP,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:E}=jP(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=aP(),I=lP({id:t}),L=N||d,R=M??c,[z,ee]=GN({controlled:n,default:y?r??uT:r,name:`Select`,state:`value`}),[B,te]=GN({controlled:a,default:o,name:`Select`,state:`open`}),ne=T.useRef([]),re=T.useRef([]),V=T.useRef(null),ie=T.useRef(null),ae=T.useRef(0),oe=T.useRef(null),se=T.useRef([]),ce=T.useRef(!1),H=T.useRef(null),le=T.useRef(null),ue=T.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=T.useRef(!1),fe=T.useRef(z),{mounted:U,setMounted:pe,transitionStatus:me}=Xj(B),{openMethod:he,triggerProps:ge}=FP(B),_e=tT(()=>new Kj({id:I,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:z,open:B,mounted:U,transitionStatus:me,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:dT,triggerProps:dT,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:lT,setOpen:lT,handleScrollArrowVisibility:lT,onOpenChangeComplete:lT,listRef:ne,popupRef:V,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:oe,valuesRef:se,labelsRef:re,typingRef:ce,selectionRef:ue,firstItemTextRef:H,selectedItemTextRef:le,alignItemWithTriggerActiveRef:de,initialValueRef:fe},kP)).current,ve=_e.useState(`activeIndex`),ye=_e.useState(`selectedIndex`),be=_e.useState(`triggerElement`),xe=_e.useState(`positionerElement`),Se=HN(he),Ce=he??Se,we=T.useMemo(()=>y?``:EP(z,x),[y,z,x]),Te=T.useMemo(()=>y&&Array.isArray(z)?z.map(e=>EP(e,x)):EP(z,x),[y,z,x]);oP(OD(be),I,z,$(()=>Te),!L,c);let Ee=y?Array.isArray(z)&&z.length>0:z!=null&&we!==``;Q(()=>{j(Ee)},[Ee,j]),Q(function(){let e=_P(se.current,z,S,y);e===null&&(le.current=null),!B&&_e.set(`selectedIndex`,e)},[y,B,z,S,_e]),MP(z,()=>{E(R),D(pP(z,A.initialValue,S)),P.change(z)});let De=$((e,t)=>{s?.(e,t),!t.isCanceled&&(te(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))}),Oe=$(()=>{pe(!1),_e.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});eM({enabled:!h,open:B,ref:V,onComplete(){B||Oe()}}),T.useImperativeHandle(h,()=>({unmount:Oe}),[Oe]);let ke=$((e,t)=>{i?.(e,t),!t.isCanceled&&ee(e)}),Ae=$(e=>{let t=LP(e.scrollHeight,e.clientHeight),n=RP(e.scrollTop,t),r=n>0,i=n<t;_e.set(`scrollUpArrowVisible`,r),_e.set(`scrollDownArrowVisible`,i)}),je=wM({open:B,onOpenChange:De,elements:{reference:be,floating:xe}}),Me=wA(je,{enabled:!L,event:`mousedown`}),Ne=AA(je),Pe=WM(je,{enabled:!L,listRef:ne,activeIndex:ve,selectedIndex:ye,disabledIndices:uT,onNavigate(e){(e!==null||B)&&_e.set(`activeIndex`,e)},focusItemOnHover:C}),Fe=GM(je,{enabled:!L&&(B||!f&&!y),listRef:re,activeIndex:ve,selectedIndex:ye,disabledIndices:e=>WN(ne.current[e]),onMatch(e){B?_e.set(`activeIndex`,e):ke(se.current[e],gD($E))},onTyping(e){ce.current=e}}),Ie=T.useMemo(()=>wk(Fe.reference,Pe.reference,Ne.reference,Me.reference,ge),[Me.reference,Fe.reference,Pe.reference,Ne.reference,ge]),Le=T.useMemo(()=>wk(tM,Fe.floating,Pe.floating,Ne.floating),[Fe.floating,Pe.floating,Ne.floating]),Re=Pe.item??dT;_e.useContextCallback(`setValue`,ke),_e.useContextCallback(`setOpen`,De),_e.useContextCallback(`handleScrollArrowVisibility`,Ae),_e.useContextCallback(`onOpenChangeComplete`,_),UN(()=>{_e.update({popupProps:Le,triggerProps:Ie})}),_e.useSyncedValues({id:I,modal:m,multiple:y,value:z,open:B,mounted:U,transitionStatus:me,popupProps:Le,triggerProps:Ie,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Ce});let ze=T.useMemo(()=>({disabled:L,readOnly:f,required:p,multiple:y,highlightItemOnHover:C,itemProps:Re}),[L,f,p,y,C,Re]),Be=SD(g,P.inputRef),Ve=y?void 0:R,He=T.useMemo(()=>!y||!Array.isArray(z)||!R?null:z.map(e=>{let t=EP(e,x);return(0,Z.jsx)(`input`,{type:`hidden`,form:l,name:R,value:t,disabled:L},t)}),[y,z,l,R,x,L]);return(0,Z.jsxs)(KN.Provider,{value:_e,children:[(0,Z.jsx)(qN.Provider,{value:ze,children:(0,Z.jsx)(JN.Provider,{value:je,children:w})}),(0,Z.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){_e.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||f)return;let t=e.currentTarget.value,n=gD($E,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=se.current.findIndex(t=>EP(t,x).toLowerCase()===e||TP(t,b).toLowerCase()===e);r===-1&&(r=se.current.findIndex((t,n)=>{let r=re.current[n];return r!=null&&r.toLowerCase()===e}));let i=se.current[r];i!=null&&ke(i,n)}_e.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Ve==null?`${I}-hidden-input`:void 0,form:l,name:Ve,autoComplete:u,value:we,disabled:L,required:p&&!(y&&Ee),readOnly:f,ref:Be,style:R?HD:VD,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),He]})}function BP(e,t){return e??t}var VP=5;function HP(e,t){let n=UP(t);return e.clientX>=n.left-VP&&e.clientX<=n.right+VP&&e.clientY>=n.top-VP&&e.clientY<=n.bottom+VP}function UP(e){let t=e.getBoundingClientRect(),n=HT(e);if(NT)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}}var WP=T.createContext(void 0);function GP(e=!1){let t=T.useContext(WP);if(t===void 0&&!e)throw Error(pT(16));return t}function KP(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:T.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 qP(e,t,{detail:n=0}={}){e.dispatchEvent(new(HT(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function JP(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=T.useRef(null),s=GP(!0),c=a??s!==void 0,{props:l}=KP({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=T.useCallback(()=>{let e=o.current;YP(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:T.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return wk({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Fk(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=YP(r),s=!i&&XP(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(),qP(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),qP(r,e)))},onKeyUp(e){if(!t){if(Fk(e),a?.(e),e.target===e.currentTarget&&i&&c&&YP(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),qP(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:$(e=>{o.current=e,u()})}}function YP(e){return KT(e)&&e.tagName===`BUTTON`}function XP(e){return KT(e)&&e.tagName===`A`&&!!e.href}var ZP=`data-popup-side`,QP=400,$P={...IE,...nP,popupSide:e=>e?{[ZP]:e}:null,value:()=>null},eF=T.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,validation:f,state:p,disabled:m}=aP(),{labelId:h}=cP(),g=YN(),{readOnly:_,required:v,disabled:y}=XN(),b=m||y||a,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),E=g.useState(`positionerElement`),D=g.useState(`listElement`),O=g.useState(`popupSide`),k=g.useState(`id`),A=g.useState(`labelId`),j=g.useState(`hasSelectedValue`),M=S&&E?O:null,N=i??k,P=BP(h,A);lP({id:i});let F=OD(E),I=T.useRef(null),{getButtonProps:L,buttonRef:R}=JP({disabled:b,native:o}),z=g.useStateSetter(`triggerElement`),ee=yT(),B=yT(),te=yT();T.useEffect(()=>{if(x)return te.start(QP,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{te.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[x,g,B,te]);let ne=wk(w,{id:N,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?D?.id??qE(E)?.id:void 0,"aria-labelledby":P,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){u(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,gD($E,e.nativeEvent)),ee.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){fE(E,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=zD(e.currentTarget);function n(e){if(!I.current)return;let t=e.target;fE(I.current,t)||fE(F.current,t)||HP(e,I.current)||g.context.setOpen(!1,gD(uD,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),re=f.getValidationProps(b,ne);re.role=`combobox`;let V={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:M,placeholder:!j};return Rk(`button`,e,{ref:[t,I,R,z],state:V,stateAttributesMapping:$P,props:re})}),tF={value:()=>null},nF=T.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=YN(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?OP(l,u,d):DP(l,u,d)),Rk(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:tF})}),rF=T.forwardRef(function(e,t){let n=YN(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Z.jsx)(iA,{ref:t,...e}):null}),iF=T.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function aF(){return T.useContext(iF)}function oF(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=$(i),[,o]=T.useState(!1),s=tT(cF).current,c=tT(sF).current,l=T.useRef(0),u=T.useRef(!0),d=T.useRef(null),f=T.useRef(null),p=$(()=>{u.current||(u.current=!0,o(e=>!e))}),m=$((e,t)=>{c.set(e,t),p()}),h=$(e=>{c.delete(e),p()}),g=$(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 _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!dF(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&fF(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=uF(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=$(()=>{let[e,t]=lF(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Q(()=>{u.current&&v()}),Q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=$(e=>(s.add(e),()=>{s.delete(e)})),b=T.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Z.jsx)(iF.Provider,{value:b,children:t})}function sF(){return new Map}function cF(){return new Set}function lF(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)=>fF(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 uF(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function dF(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 fF(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var pF=T.createContext(void 0);function mF(){let e=T.useContext(pF);if(!e)throw Error(pT(59));return e}var hF=T.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,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function gF(e,t){e&&Object.assign(e.style,t)}var _F={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},vF={},yF={},bF=``;function xF(e,t){return JT(e)?e:t}function SF(e,t,n){return/hidden|clip/.test(e.getComputedStyle(xF(t,n)).overflowY)}function CF(e){if(typeof document>`u`)return!1;let t=zD(e);return HT(t).innerWidth-t.documentElement.clientWidth>0}function wF(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=zD(e),n=t.documentElement,r=t.body,i=xF(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 TF(e){let t=zD(e),n=t.documentElement,r=t.body,i=xF(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 EF(e){let t=zD(e),n=t.documentElement,r=t.body,i=HT(n),a=0,o=0,s=!1,c=LD.create();if(jT&&(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,vF={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},bF=n.style.scrollBehavior,yF={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=xF(n,r);if(s=wF(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,vF),Object.assign(r.style,yF),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=bF)}function d(){u(),c.request(l)}l();let f=bD(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var DF=new class{lockCount=0;restore=null;timeoutLock=vT.create();timeoutUnlock=vT.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=zD(e),n=t.documentElement,r=t.body,i=HT(n);if(SF(i,n,r)){let t=new i.MutationObserver(()=>{SF(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=ET||!CF(e);this.restore=a?TF(e):EF(e)}};function OF(e=!0,t=null){Q(()=>{if(e)return DF.acquire(t)},[e,t])}var kF=20;function AF(e,t,n,r){let[i,a]=T.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=zD(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-kF)},[e,t,n]),OF(e&&(!t||i),r)}var jF={position:`fixed`},MF=T.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Xk,style:_,...v}=e,y=YN(),b=ZN(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),E=y.useState(`openMethod`),D=y.useState(`positionerElement`),O=y.useState(`triggerElement`),k=y.useState(`isItemEqualToValue`),A=y.useState(`transitionStatus`),j=T.useRef(null),M=T.useRef(null),[N,P]=T.useState(h),F=S&&N&&E!==`touch`;!S&&N!==h&&P(h),T.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>F),AF((F||C)&&x,E===`touch`,D,O);let I=PN({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??F,collisionAvoidance:g,keepMounted:!0}),L=F?`none`:I.side,R=F?jF:I.positionerStyles,z={open:x,side:L,align:I.align,anchorHidden:I.anchorHidden};Q(()=>{y.set(`popupSide`,I.side)},[y,I.side]);let ee=RN(e,z,{styles:R,transitionStatus:A,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=T.useRef(0),te=$(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=gD($E);if(t!==0&&!y.state.multiple&&w!==null&&hP(y.context.valuesRef.current,w,k)===-1){let e=y.context.initialValueRef.current,t=e!=null&&hP(y.context.valuesRef.current,e,k)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>hP(y.context.valuesRef.current,e,k)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&F){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};gF(D,e),gF(y.context.popupRef.current,e)}}),ne=T.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,Z.jsx)(oF,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:te,children:(0,Z.jsxs)(pF.Provider,{value:ne,children:[S&&C&&(0,Z.jsx)(hF,{inert:VN(!x),cutout:O}),ee]})})}),NF=`base-ui-disable-scrollbar`,PF={className:NF,getElement(e){return(0,Z.jsx)(`style`,{nonce:e,href:NF,precedence:`base-ui:low`,children:`.${NF}{scrollbar-width:none}.${NF}::-webkit-scrollbar{display:none}`})}},FF=T.createContext(void 0);function IF(e){let t=T.useContext(FF);if(t===void 0&&!e)throw Error(pT(69));return t}var LF=`ArrowUp`,RF=`ArrowDown`,zF=`ArrowLeft`,BF=`ArrowRight`,VF=new Set([LF,RF,zF,BF,`Home`,`End`]),HF=[`Shift`,`Control`,`Alt`,`Meta`];function UF(e){return KT(e)&&e.tagName===`INPUT`}function WF(e){return!!(UF(e)&&e.selectionStart!=null||KT(e)&&e.tagName===`TEXTAREA`)}function GF(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=KF(e,t,`left`),a=qF(e),o=qF(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=KF(e,t,`top`),r=qF(e),i=qF(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 KF(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 qF(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 JF=T.createContext(void 0),YF={disableStyleElements:!1};function XF(){return T.useContext(JF)??YF}var ZF=`--transform-origin`,QF={...LE,...wE},$F=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=YN(),{multiple:c,readOnly:l,highlightItemOnHover:u}=XN(),d=ZN(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=mF(),_=IF(!0)!=null,v=bN(),{nonce:y,disableStyleElements:b}=XF(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),E=s.useState(`popupProps`),D=s.useState(`transitionStatus`),O=s.useState(`triggerElement`),k=s.useState(`positionerElement`),A=s.useState(`listElement`),j=T.useRef(!1),M=T.useRef(!1),N=T.useRef({}),P=RD(),F=$(e=>{if(!k||!s.context.popupRef.current||!M.current)return;let t=k.style.top===`0px`,n=k.style.bottom===`0px`;if(j.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=nI(k),i=rI(k.getBoundingClientRect().height,`y`,r),a=zD(k),o=HT(k),c=o.getComputedStyle(k),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=eI(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=tI(e),g=null,_=e=>{k.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=IP(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(j.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=IP(g,0,tI(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(j.current=!0),s.context.handleScrollArrowVisibility(e)});T.useImperativeHandle(s.context.scrollHandlerRef,()=>F,[F]),eM({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let I={open:S,transitionStatus:D,side:f,align:p};Q(()=>{k&&s.context.popupRef.current&&!Object.keys(N.current).length&&(N.current={top:k.style.top||`0`,left:k.style.left||`0`,right:k.style.right,height:k.style.height,bottom:k.style.bottom,minHeight:k.style.minHeight,maxHeight:k.style.maxHeight,marginTop:k.style.marginTop,marginBottom:k.style.marginBottom})},[s,k]),Q(()=>{S||m||(M.current=!1,j.current=!1,gF(k,N.current))},[S,m,k]),Q(()=>{let e=s.context.popupRef.current;if(!S||!O||!k||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(M.current=!0,e.style.removeProperty(ZF),!m){P.request(()=>s.context.handleScrollArrowVisibility(A||e));return}let t=oI(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=HT(k),i=r.getComputedStyle(k),a=r.getComputedStyle(e),o=zD(O),c=nI(O),l=iI(O.getBoundingClientRect(),c),d=iI(k.getBoundingClientRect(),c),f=l.height,p=A||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=eI(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=iI(n.getBoundingClientRect(),c);T=iI(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let M=w+D+y+h,P=Math.min(S,M),F=S-_-y,I=M-P,L=C-5;k.style.left=`${IP(E,5,L-d.width)}px`,k.style.height=`${P}px`,k.style.maxHeight=`none`,k.style.marginTop=`${_}px`,k.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=tI(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let ee=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),B=(r.visualViewport?.scale??1)!==1&&jT;if(ee||B){gF(k,N.current),g(!1);return}let te=Math.max(b,P);if(z){let e=Math.max(0,S-M);k.style.top=d.height>=F?`0`:`${e}px`,k.style.height=`${P}px`,p.scrollTop=tI(p)}else k.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=IP(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(ZF,`50% ${i}%`)}(te===S||P>=x)&&(j.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,k,O,m,g,P,A,u,v,h]),T.useEffect(()=>{if(!m||!k||!S)return;let e=HT(k);function t(e){s.context.setOpen(!1,gD(hD,e))}return bD(e,`resize`,t)},[s,m,k,S]);let L={...A?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&VF.has(e.key)&&e.stopPropagation()},onScroll(e){A||F(e.currentTarget)},...m&&{style:A?{height:`100%`}:_F},className:!A&&m?PF.className:void 0},R=Rk(`div`,e,{ref:[t,s.context.popupRef],state:I,stateAttributesMapping:QF,props:[E,L,LN(D),o]});return(0,Z.jsxs)(T.Fragment,{children:[!b&&PF.getElement(y),(0,Z.jsx)(CA,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:R})]})});function eI(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function tI(e){return LP(e.scrollHeight,e.clientHeight)}function nI(e){return pj.getScale(e)}function rI(e,t,n){return e/n[t]}function iI(e,t){return gO({x:rI(e.x,`x`,t),y:rI(e.y,`y`,t),width:rI(e.width,`x`,t),height:rI(e.height,`y`,t)})}var aI=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function oI(e){let{style:t}=e,n={};for(let[e,r]of aI)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of aI){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}function sI(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=aF(),u=T.useRef(-1),[d,f]=T.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=T.useRef(null),h=T.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 cI=T.createContext(void 0);function lI(){let e=T.useContext(cI);if(!e)throw Error(pT(57));return e}var uI=T.memo(T.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=T.useRef(null),d=sI({guess:!0,label:o,textRef:u}),f=YN(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=XN(),_=h||s,v=f.useState(`isActive`,d.index),y=f.useState(`open`),b=f.useState(`isSelected`,a),x=f.useState(`isSelectedByFocus`,d.index),S=f.useState(`isItemEqualToValue`),C=d.index,w=T.useRef(null);Q(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Q(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=vP(C,a,f.context.valuesRef.current,e,S,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&fP(a,e,S),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,S,f,a]);let E=T.useRef(`mouse`),D=T.useRef(!1),{getButtonProps:O,buttonRef:k}=JP({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),A={disabled:_,selected:b,highlighted:v};function j(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=b?yP(n,a,S):[...n,a];f.context.setValue(r,gD(iD,e))}else f.context.setValue(a,gD(iD,e)),f.context.setOpen(!1,gD(iD,e))}function M(){f.context.selectionRef.current.dragY=0}let N={role:`option`,"aria-selected":b,tabIndex:y&&v?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&IT(e.nativeEvent)&&(n!==void 0||v),i=t&&!r&&!D.current;D.current=!1,!(_||i)&&j(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,M()},onMouseUp(){if(M(),_||E.current===`touch`||D.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&b,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!b;e||t||(D.current=!0,w.current?.click(),D.current=!1)}},P=Rk(`div`,e,{ref:[k,t,d.ref,w],state:A,props:[p,N,l,O]}),F=T.useMemo(()=>({selected:b,index:C,textRef:u,selectedByFocus:x}),[b,C,u,x]);return(0,Z.jsx)(cI.Provider,{value:F,children:P})})),dI=T.memo(T.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=lI(),a=YN(),{render:o,className:s,style:c,...l}=e;return Rk(`div`,e,{ref:[T.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),fI=e=>Rm(e)&&typeof e.type==`string`&&typeof e.start==`number`&&typeof e.end==`number`,pI=e=>Array.isArray(e)?e.filter(fI):[],mI=(e,t)=>{let n=e[t];return fI(n)?n:null},hI=e=>{try{let t=xx(e,{sourceType:`module`,plugins:[`typescript`,`jsx`]});return fI(t)?t:null}catch{return null}},gI=(e,t)=>{if(Array.isArray(e)){for(let n of e)gI(n,t);return}if(fI(e)&&t(e)!==!1)for(let[n,r]of Object.entries(e))n!==`loc`&&n!==`extra`&&n!==`comments`&&gI(r,t)},_I=e=>e===null?``:e.type===`JSXIdentifier`?typeof e.name==`string`?e.name:``:e.type===`JSXMemberExpression`?`${_I(mI(e,`object`))}.${_I(mI(e,`property`))}`:``,vI=e=>{if(e.type!==`JSXElement`)return null;let t=mI(e,`openingElement`);if(t===null)return null;let n=mI(e,`closingElement`);return{node:e,opening:t,closing:n,tag:_I(mI(t,`name`)),children:pI(e.children),attributes:pI(t.attributes),selfClosing:t.selfClosing===!0,contentStart:t.end,contentEnd:n===null?t.end:n.start}},yI=e=>{let t=mI(e,`body`);if(t===null)return null;if(t.type===`JSXElement`)return t;if(t.type!==`BlockStatement`)return null;let n=pI(t.body).filter(e=>e.type!==`EmptyStatement`),r=n.length===1?n[0]:void 0,i=r?.type===`ReturnStatement`&&r!==void 0?mI(r,`argument`):null;return i!==null&&i.type===`JSXElement`?i:null},bI=e=>{if(e.computed===!0)return null;let t=mI(e,`key`);return t===null?null:t.type===`Identifier`?typeof t.name==`string`?t.name:null:t.type===`StringLiteral`&&typeof t.value==`string`?t.value:null},xI=(e,t)=>{let n=null;return gI(e,e=>{if(n!==null)return!1;if(e.type!==`CallExpression`)return;let r=mI(e,`callee`);if(r?.type!==`Identifier`||r.name!==`defineTemplate`)return;let i=pI(e.arguments)[0];if(i?.type!==`ObjectExpression`)return!1;for(let e of pI(i.properties)){if(bI(e)!==t)continue;let r=e.type===`ObjectMethod`?e:e.type===`ObjectProperty`?mI(e,`value`):null;if(r===null||r.type!==`ArrowFunctionExpression`&&r.type!==`FunctionExpression`&&r.type!==`ObjectMethod`)return!1;let i=yI(r),a=i===null?null:vI(i);return a!==null&&(n={root:a,parameter:pI(r.params)[0]??null}),!1}return!1}),n},SI=(e,t,n)=>{let r=n;return gI(e,e=>{if(e.type===`ImportDeclaration`){if(mI(e,`source`)?.value!==t)return!1;for(let t of pI(e.specifiers)){let e=mI(t,`imported`),i=mI(t,`local`);t.type===`ImportSpecifier`&&(e?.name===n||e?.value===n)&&(r=typeof i?.name==`string`?i.name:n)}return!1}}),r},CI=e=>{let t=e.split(/\r\n|\n|\r/),n=0;t.forEach((e,t)=>{/[^ \t]/.test(e)&&(n=t)});let r=``;return t.forEach((e,i)=>{let a=e.replace(/\t/g,` `);i!==0&&(a=a.replace(/^ +/,``)),i!==t.length-1&&(a=a.replace(/ +$/,``)),a!==``&&(r+=i===n?a:`${a} `)}),r},wI=e=>{let t=mI(e,`expression`);if(t===null)return null;if(t.type===`StringLiteral`&&typeof t.value==`string`)return t.value;if(t.type===`TemplateLiteral`&&pI(t.expressions).length===0){let e=pI(t.quasis)[0]?.value;return Rm(e)&&typeof e.cooked==`string`?e.cooked:null}return null},TI=(e,t)=>{let n=e.slice(t.start,t.end).replace(/\s+/g,` `).trim();return n.length>60?`${n.slice(0,59)}…`:n},EI=(e,t)=>{let n=[],r=t.contentStart,i=``,a=e=>{n.push({kind:`text`,text:i,start:r,end:e}),i=``};for(let o of t.children){if(o.type===`JSXText`){i+=CI(typeof o.value==`string`?o.value:``);continue}if(o.type===`JSXExpressionContainer`){let e=wI(o);if(e!==null){i+=e;continue}}a(o.start),n.push({kind:`locked`,summary:TI(e,o),start:o.start,end:o.end}),r=o.end}return a(t.contentEnd),n},DI=e=>!/[{}<>&\r\n\t]/.test(e),OI=(e,t,n)=>{let r=[...e],i=r.map(e=>!DI(e));if(t)for(let e=0;e<r.length&&/\s/.test(r[e]);e++)i[e]=!0;if(n)for(let e=r.length-1;e>=0&&/\s/.test(r[e]);e--)i[e]=!0;let a=``,o=``,s=!1,c=()=>{o!==``&&(a+=s?`{${JSON.stringify(o)}}`:o,o=``)};return r.forEach((e,t)=>{o!==``&&i[t]!==s&&c(),s=i[t],o+=e}),c(),a},kI=(e,t,n,r,i)=>{let a=n[r];if(a?.kind!==`text`)return{ok:!1,reason:`That part of the body is locked.`};if(a.text===i)return{ok:!0,edits:[]};if(t.selfClosing){let n=t.opening,r=n.end-2;for(;r>n.start&&/\s/.test(e[r-1]);)r--;return{ok:!0,edits:[{start:r,end:n.end,before:e.slice(r,n.end),after:`>${OI(i,!1,!1)}</${t.tag}>`}]}}let o=e.slice(a.start,a.end),s=/^\s*/.exec(o)?.[0]??``,c=/[\r\n]/.test(s)?s:``,l=o.slice(c.length),u=/\s*$/.exec(l)?.[0]??``,d=/[\r\n]/.test(u)?u:``,f=a.start+c.length,p=a.end-d.length;return{ok:!0,edits:[{start:f,end:p,before:e.slice(f,p),after:OI(i,c!==``,d!==``)}]}},AI=(e,t)=>e.attributes.find(e=>e.type===`JSXAttribute`&&_I(mI(e,`name`))===t)??null,jI=(e,t,n)=>{let r=AI(t,n);if(r===null)return{kind:`absent`};let i=mI(r,`value`);if(i?.type===`StringLiteral`&&typeof i.value==`string`)return{kind:`literal`,value:i.value};if(i?.type===`JSXExpressionContainer`){let e=wI(i);if(e!==null)return{kind:`literal`,value:e}}return{kind:`expression`,source:TI(e,i??r)}},MI=e=>/["&\\\r\n]/.test(e)?`{${JSON.stringify(e)}}`:`"${e}"`,NI=(e,t,n,r)=>({start:t,end:n,before:e.slice(t,n),after:r}),PI=(e,t,n,r)=>{let i=AI(t,n);if(i===null){if(r===void 0)return{ok:!0,edits:[]};let i=t.attributes.at(-1)?.end??mI(t.opening,`name`)?.end??t.opening.end;return{ok:!0,edits:[NI(e,i,i,` ${n}=${MI(r)}`)]}}if(jI(e,t,n).kind===`expression`)return{ok:!1,reason:`\`${n}\` reads the input. Edit it in Source.`};if(r===void 0){let n=i.start;for(;n>t.opening.start&&/\s/.test(e[n-1]);)n--;return{ok:!0,edits:[NI(e,n,i.end,``)]}}let a=mI(i,`value`);return{ok:!0,edits:a===null?[NI(e,i.end,i.end,`=${MI(r)}`)]:[NI(e,a.start,a.end,MI(r))]}},FI=` `,II=(e,t)=>{let n=e.lastIndexOf(`
22
- `,t-1)+1,r=e.slice(n,t);return/^[ \t]*$/.test(r)?r:null},LI=(e,t)=>{let n=II(e,t.start),r=/^[ \t]*(\r?\n)/.exec(e.slice(t.end));return n===null||r===null?NI(e,t.start,t.end,``):NI(e,t.start-n.length,t.end+r[0].length,``)},RI=(e,t,n,r)=>{let i=II(e,t.start);return n===`before`?NI(e,t.start,t.start,i===null?r:`${r}\n${i}`):NI(e,t.end,t.end,i===null?r:`\n${i}${r}`)},zI=(e,t,n)=>{let r=new Set,i=e=>{if(n?.type===`Identifier`&&typeof n.name==`string`){let t=RegExp(`\\b${n.name}((?:\\??\\.[A-Za-z_$][\\w$]*)+)`,`g`);for(let n of e.matchAll(t))r.add(n[1].replace(/\?/g,``).slice(1))}else if(n?.type===`ObjectPattern`)for(let t of pI(n.properties)){let n=mI(t,`key`);n?.type===`Identifier`&&typeof n.name==`string`&&RegExp(`\\b${n.name}\\b`).test(e)&&r.add(n.name)}};return gI(t.node,t=>{t.type===`JSXExpressionContainer`&&wI(t)===null&&i(e.slice(t.start,t.end))}),[...r].sort()},BI=e=>{let t=hI(e);if(t===null)return null;let n=xI(t,`sms`);return n===null||n.root.tag!==SI(t,`@samva/markup/sms`,`Sms`)?null:{...n,tree:t}},VI=e=>{let t=BI(e);return t===null?null:{category:jI(e,t.root,`category`),segments:EI(e,t.root),variables:zI(e,t.root,t.parameter)}},HI=(e,t)=>{let n=BI(e);return n===null?{ok:!1,reason:`The SMS body is not editable here.`}:t.kind===`category`?t.value!==void 0&&!I_.includes(t.value)?{ok:!1,reason:`\`${t.value}\` is not an SMS category.`}:PI(e,n.root,`category`,t.value):kI(e,n.root,EI(e,n.root),t.segment,t.text)},UI={"quick-reply":`QuickReplyButton`,url:`UrlButton`,phone:`PhoneButton`,"copy-code":`CopyCodeButton`},WI={"quick-reply":`Reply`,url:`Visit site`,phone:`Call us`,"copy-code":`CODE`},GI=(e,t)=>{if(!e.startsWith(`${t}.`))return null;let n=e.slice(t.length+1);return Object.keys(UI).find(e=>UI[e]===n)??null},KI=e=>{let t=hI(e);if(t===null)return null;let n=xI(t,`whatsapp`),r=SI(t,`@samva/markup/whatsapp`,`WhatsApp`);if(n===null||n.root.tag!==r)return null;let i=e=>{for(let t of n.root.children){let n=vI(t);if(n?.tag===`${r}.${e}`)return n}return null};return{...n,local:r,header:i(`Header`),body:i(`Body`),footer:i(`Footer`),buttons:i(`Buttons`)}},qI=(e,t)=>{if(t.buttons===null)return[];let n=[];for(let r of t.buttons.children){if(r.type===`JSXText`&&CI(String(r.value??``))===``)continue;let i=vI(r),a=i===null?null:GI(i.tag,t.local);if(i===null||a===null){n.push({row:{kind:`locked`,summary:TI(e,r)},node:r});continue}let o=EI(e,i),s=o[0];n.push({node:r,row:o.length===1&&s?.kind===`text`?{kind:`editable`,type:a,text:s.text,url:jI(e,i,`url`),phone:jI(e,i,`phone`)}:{kind:`locked`,summary:TI(e,r)}})}return n},JI=e=>{let t=KI(e);if(t===null||t.body===null)return null;let{root:n}=t;return{name:jI(e,n,`name`),language:jI(e,n,`language`),category:jI(e,n,`category`),header:t.header===null?null:EI(e,t.header),headerType:t.header===null?{kind:`absent`}:jI(e,t.header,`type`),body:EI(e,t.body),footer:t.footer===null?null:EI(e,t.footer),buttons:qI(e,t).map(({row:e})=>e),variables:zI(e,n,t.parameter)}},YI=(e,t,n,r)=>{let i=`${e}.${UI[t]}`;return`<${i}${t===`url`&&r.url!==void 0?` url=${MI(r.url)}`:t===`phone`&&r.phone!==void 0?` phone=${MI(r.phone)}`:``}>${OI(n,!1,!1)}</${i}>`},XI=(e,t)=>YI(e,t,WI[t],{url:`https://example.com`,phone:`+15555550100`}),ZI=(e,t,n,r,i)=>{let a=t[n];if(a===null){if(n===`body`||i===``||r!==0)return{ok:!0,edits:[]};let a=`${t.local}.${n===`header`?`Header`:`Footer`}`,o=`<${a}>${OI(i,!1,!1)}</${a}>`;return{ok:!0,edits:[RI(e,n===`header`?t.body.node:t.buttons?.node??t.body.node,n===`header`?`before`:`after`,o)]}}let o=EI(e,a);return n!==`body`&&i===``&&o.length===1?{ok:!0,edits:[LI(e,a.node)]}:kI(e,a,o,r,i)},QI=(e,t)=>{let n=KI(e);if(n===null||n.body===null)return{ok:!1,reason:`The WhatsApp body is not editable here.`};let{root:r,local:i}=n;switch(t.kind){case`attribute`:{if(t.name===`category`&&!L_.includes(t.value??``))return{ok:!1,reason:`Choose a WhatsApp category.`};let n=t.name===`name`&&t.value===``?void 0:t.value??``;return PI(e,r,t.name,n)}case`headerType`:return n.header===null?{ok:!1,reason:`Add the header text before choosing its type.`}:R_.includes(t.value)?PI(e,n.header,`type`,t.value===`text`?void 0:t.value):{ok:!1,reason:`\`${t.value}\` is not a header type.`};case`text`:return ZI(e,n,t.part,t.segment,t.text);case`buttonAdd`:{let r=XI(i,t.type),a=n.buttons;if(a===null){let t=n.footer??n.body,a=`${i}.Buttons`,o=II(e,t.node.start),s=o===null?`<${a}>${r}</${a}>`:`<${a}>\n${o}${FI}${r}\n${o}</${a}>`;return{ok:!0,edits:[RI(e,t.node,`after`,s)]}}if(a.selfClosing){let t=`${i}.Buttons`,n=II(e,a.node.start),o=n===null?`<${t}>${r}</${t}>`:`<${t}>\n${n}${FI}${r}\n${n}</${t}>`;return{ok:!0,edits:[NI(e,a.node.start,a.node.end,o)]}}let o=a.children.findLast(e=>e.type!==`JSXText`||CI(String(e.value??``))!==``);if(o!==void 0)return{ok:!0,edits:[RI(e,o,`after`,r)]};let s=II(e,a.node.start);return{ok:!0,edits:[NI(e,a.contentStart,a.contentEnd,s===null?r:`\n${s}${FI}${r}\n${s}`)]}}}let a=qI(e,n),o=a[t.button];if(o===void 0||n.buttons===null)return{ok:!1,reason:`That button no longer exists.`};if(t.kind===`buttonRemove`)return{ok:!0,edits:[LI(e,a.length===1?n.buttons.node:o.node)]};let s=vI(o.node);if(o.row.kind===`locked`||s===null)return{ok:!1,reason:`That button is locked. Edit it in Source.`};switch(t.kind){case`buttonText`:return kI(e,s,EI(e,s),0,t.text);case`buttonAttribute`:return PI(e,s,t.name,t.value);default:{let{row:n}=o,r=e=>e.kind===`literal`?e.value:void 0,a=YI(i,t.type,n.text,{url:r(n.url)??`https://example.com`,phone:r(n.phone)??`+15555550100`});return{ok:!0,edits:[NI(e,o.node.start,o.node.end,a)]}}}},$I=e=>Symbol.iterator in e,eL=e=>`entries`in e,tL=(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},nL=(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 rL(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)?eL(e)&&eL(t)?tL(e,t):nL(e,t):tL({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function iL(e){let t=T.useRef(void 0);return n=>{let r=e(n);return rL(t.current,r)?t.current:t.current=r}}var aL=`bg-[var(--tactile-base,var(--primary))] text-primary-foreground shadow-[0_1px_2px_0_oklch(0_0_0/0.2),0_0_0_1px_color-mix(in_oklab,var(--tactile-base,var(--primary)),black_35%),inset_0_3px_5px_0_oklch(1_0_0/0.16),inset_0_0_0_1px_oklch(1_0_0/0.12),inset_0_-6px_10px_0_oklch(0_0_0/0.2)] hover:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),white_8%)] aria-expanded:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),white_8%)] data-popup-open:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),white_8%)] active:translate-y-px active:shadow-[0_0_0_1px_color-mix(in_oklab,var(--tactile-base,var(--primary)),black_35%),inset_0_2px_4px_0_oklch(0_0_0/0.35)] disabled:shadow-none data-disabled:shadow-none dark:shadow-[0_1px_2px_0_oklch(0_0_0/0.35),0_0_0_1px_oklch(0_0_0/0.4),inset_0_3px_5px_0_oklch(0_0_0/0.1),inset_0_0_0_1px_oklch(1_0_0/0.25),inset_0_-6px_10px_0_oklch(1_0_0/0.22)] dark:hover:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),black_8%)] dark:active:shadow-[0_0_0_1px_oklch(0_0_0/0.4),inset_0_2px_4px_0_oklch(0_0_0/0.25)]`,oL=`border border-input bg-[color-mix(in_oklab,var(--surface-inset)_55%,transparent)] dark:bg-input/20 shadow-[inset_0_1px_2px_0_oklch(0_0_0/0.05)] dark:shadow-[inset_0_1px_2px_0_oklch(0_0_0/0.35)]`,sL=`aria-pressed:bg-[color-mix(in_oklab,var(--accent),black_3%)] aria-pressed:shadow-[inset_0_1px_3px_0_oklch(0_0_0/0.12)] dark:aria-pressed:bg-[color-mix(in_oklab,var(--accent),white_12%)] dark:aria-pressed:shadow-[inset_0_1px_3px_0_oklch(0_0_0/0.45)]`,cL=[`data-[pressed]:border-border data-[pressed]:bg-background data-[pressed]:text-foreground data-[pressed]:shadow-[var(--shadow-md)]`,`data-active:border-border data-active:bg-background data-active:text-foreground data-active:shadow-[var(--shadow-md)]`,`aria-pressed:border-border aria-pressed:bg-background aria-pressed:text-foreground aria-pressed:shadow-[var(--shadow-md)]`].join(` `);function lL(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=lL(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function uL(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=lL(e))&&(r&&(r+=` `),r+=t);return r}function dL(...e){return uL(e)}var fL=`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,pL=dL(`inline-flex items-center justify-center gap-1.5 rounded-[7px] font-medium transition-all outline-none disabled:pointer-events-none disabled:opacity-50`,aL,fL),mL=dL(`inline-flex items-center justify-center gap-1.5 rounded-md border border-transparent font-medium whitespace-nowrap text-muted-foreground outline-none`,`hover:bg-muted hover:text-foreground`,`transition-[color,background-color,border-color,box-shadow] duration-150 ease-out`,fL,cL),hL=dL(`min-h-9 w-full rounded-lg border border-border bg-background px-2.5 text-[13px] text-foreground outline-none disabled:cursor-not-allowed disabled:bg-surface-inset disabled:text-muted-foreground`,fL),gL=(0,T.createContext)(null),_L=gL.Provider;function vL(){return(0,T.useContext)(gL)}function yL(){return(0,T.useContext)(gL)!==null}var bL=(0,T.createContext)(null),xL=bL.Provider;function SL(){return(0,T.useContext)(bL)}var CL=(0,T.createContext)(null),wL=CL.Provider;function TL(){return(0,T.useContext)(CL)}var EL=(0,T.createContext)(null),DL=EL.Provider;function OL(){return(0,T.useContext)(EL)}function kL({hidden:e=!1}){let t=vL(),n=SL(),r=G(e=>e.assistantWidth),i=G(e=>e.layoutMode),a=i===`compact`||i===`narrow`;return t===null?null:(0,Z.jsx)(`aside`,{"aria-label":`Assistant`,hidden:e,"data-editor-rail":`left`,"data-editor-rail-mode":`agent`,"data-testid":`agent-column`,style:a?void 0:{width:r},className:dL(`min-h-0 min-w-0 flex-col overflow-hidden bg-background`,e?`hidden`:`flex`,a&&`h-full w-full flex-1`,!a&&`h-full shrink-0 border-r border-border`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,style:a?void 0:{width:r,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex min-h-11 shrink-0 items-center gap-2 border-b px-3 py-2`,children:[(0,Z.jsx)(ye,{className:`text-accent-orange size-[15px] shrink-0`}),(0,Z.jsx)(`p`,{className:`text-foreground truncate text-[13px] leading-none font-semibold`,children:`Assistant`}),n!==null&&(0,Z.jsx)(`div`,{className:`ml-auto shrink-0`,children:n})]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t})]})})}function AL({children:e}){let{rightCollapsed:t,rightWidth:n,layoutMode:r}=G(iL(e=>({rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth,layoutMode:e.layoutMode}))),i=r===`compact`||r===`narrow`;return(0,Z.jsx)(`aside`,{"aria-label":`Assistant`,"aria-hidden":t||void 0,inert:t||void 0,"data-editor-rail":`right`,"data-editor-rail-mode":`agent`,style:{width:t?0:n,maxWidth:i?`calc(100% - 48px)`:void 0},className:dL(`flex h-full shrink-0 flex-col overflow-hidden border-l border-border bg-background transition-[width,transform,box-shadow] duration-180 ease-out`,i&&`absolute inset-y-0 right-0 z-40 shadow-[var(--shadow-floating)]`,t&&`border-l-0`),children:(0,Z.jsx)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:n,maxWidth:`100%`},children:(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:e})})})}var jL=T.createContext(void 0);function ML(){let e=T.useContext(jL);if(e===void 0)throw Error(pT(53));return e}function NL(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var PL=`data-has-overflow-x`,FL=`data-has-overflow-y`,IL=`data-overflow-x-start`,LL=`data-overflow-x-end`,RL=`data-overflow-y-start`,zL=`data-overflow-y-end`,BL=e=>t=>t?{[e]:``}:null,VL={hasOverflowX:BL(PL),hasOverflowY:BL(FL),overflowXStart:BL(IL),overflowXEnd:BL(LL),overflowYStart:BL(RL),overflowYEnd:BL(zL),cornerHidden:()=>null},HL=`--scroll-area-corner-height`,UL=`--scroll-area-corner-width`,WL=`data-orientation`,GL={x:0,y:0},KL={width:0,height:0},qL={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},JL={x:!0,y:!0,corner:!0},YL=T.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=XL(i),d=oN(),f=yT(),p=yT(),{nonce:m,disableStyleElements:h}=XF(),[g,_]=T.useState(!1),[v,y]=T.useState(!1),[b,x]=T.useState(!1),[S,C]=T.useState(!1),[w,E]=T.useState(!1),[D,O]=T.useState(KL),[k,A]=T.useState(KL),[j,M]=T.useState(qL),[N,P]=T.useState(JL),F=T.useRef(null),I=T.useRef(null),L=T.useRef(null),R=T.useRef(null),z=T.useRef(null),ee=T.useRef(null),B=T.useRef(null),te=T.useRef(null),ne=T.useRef(0),re=T.useRef(0),V=T.useRef(0),ie=T.useRef(0),ae=T.useRef(`vertical`),oe=T.useRef(GL),se=T.useRef(null);function ce(e){let t=e?x:y,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let H=$(e=>{let t=e.x-oe.current.x,n=e.y-oe.current.y;oe.current=e,n!==0&&ce(!0),t!==0&&ce(!1)}),le=$(()=>{let e=I.current;e&&se.current===null&&(se.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),ue=$(e=>{if(e.button!==0||te.current!==null&&(ae.current===`vertical`?z.current:ee.current)?.hasPointerCapture(te.current))return;te.current=e.pointerId,ne.current=e.clientY,re.current=e.clientX,ae.current=e.currentTarget.getAttribute(WL);let t=I.current;t&&(V.current=t.scrollTop,ie.current=t.scrollLeft,le()),(ae.current===`vertical`?z.current:ee.current)?.setPointerCapture(e.pointerId)}),de=$(e=>{if(e.pointerId!==te.current)return;te.current=null,(ae.current===`vertical`?x:y)(!1),se.current!==null&&(I.current&&(I.current.style.scrollSnapType=se.current),se.current=null);let t=ae.current===`vertical`?z.current:ee.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),fe=$(e=>{if(e.pointerId!==te.current)return;if(e.buttons%2==0){de(e);return}let t=I.current;if(!t)return;let n=ae.current===`vertical`,r=n?z.current:ee.current,i=n?L.current:R.current;if(!r||!i)return;let a=n?`y`:`x`,o=NL(i,`padding`,a),s=NL(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-ne.current:e.clientX-re.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?V.current:ie.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),ce(n)});function U(e){C(e.pointerType===`touch`)}function pe(e){if(U(e),e.pointerType!==`touch`){let t=fE(F.current,e.target);_(t)}}let me=T.useMemo(()=>({scrolling:v||b,hasOverflowX:!N.x,hasOverflowY:!N.y,overflowXStart:j.xStart,overflowXEnd:j.xEnd,overflowYStart:j.yStart,overflowYEnd:j.yEnd,cornerHidden:N.corner}),[v,b,N.x,N.y,N.corner,j]),he={role:`presentation`,onPointerEnter:pe,onPointerMove:pe,onPointerDown:U,onPointerLeave(){_(!1)},style:{position:`relative`,[HL]:`${D.height}px`,[UL]:`${D.width}px`}},ge=Rk(`div`,e,{state:me,ref:[t,F],props:[he,o],stateAttributesMapping:VL}),_e=T.useMemo(()=>({handlePointerDown:ue,handlePointerMove:fe,handlePointerUp:de,handleScroll:H,disableViewportSnap:le,cornerSize:D,setCornerSize:O,thumbSize:k,setThumbSize:A,hasMeasuredScrollbar:w,setHasMeasuredScrollbar:E,touchModality:S,cornerRef:B,scrollingX:v,scrollingY:b,hovering:g,setHovering:_,viewportRef:I,scrollbarYRef:L,scrollbarXRef:R,thumbYRef:z,thumbXRef:ee,rootId:d,hiddenState:N,setHiddenState:P,overflowEdges:j,setOverflowEdges:M,viewportState:me,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[ue,fe,de,H,le,D,k,w,S,v,b,g,d,N,j,me,s,c,l,u]);return(0,Z.jsxs)(jL.Provider,{value:_e,children:[!h&&PF.getElement(m),ge]})});function XL(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}var ZL=T.createContext(void 0),QL=`--scroll-area-overflow-x-start`,$L=`--scroll-area-overflow-x-end`,eR=`--scroll-area-overflow-y-start`,tR=`--scroll-area-overflow-y-end`,nR=`--scroll-area-thumb-height`,rR=`--scroll-area-thumb-width`,iR=[QL,$L,eR,tR],aR=!1;function oR(){aR||jT||(typeof CSS<`u`&&`registerProperty`in CSS&&iR.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),aR=!0)}var sR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{viewportRef:o,scrollbarYRef:s,scrollbarXRef:c,thumbYRef:l,thumbXRef:u,cornerRef:d,cornerSize:f,setCornerSize:p,setThumbSize:m,rootId:h,setHiddenState:g,hiddenState:_,setHasMeasuredScrollbar:v,handleScroll:y,touchModality:b,setHovering:x,setOverflowEdges:S,overflowEdgeThreshold:C,viewportState:w}=ML(),E=bN(),D=T.useRef(!0),O=T.useRef([NaN,NaN,NaN,NaN]),k=yT(),A=yT(),j=$(()=>{let e=o.current,t=s.current,n=c.current,r=l.current,i=u.current,a=d.current;if(!e)return;let h=e.scrollHeight,_=e.scrollWidth,y=e.clientHeight,b=e.clientWidth,x=e.scrollTop,w=e.scrollLeft,T=O.current,D=Number.isNaN(T[0]);if(T[0]=y,T[1]=h,T[2]=b,T[3]=_,D&&v(!0),h===0||_===0)return;let k=cR(e),A=k.y,j=k.x,M=b/_,N=y/h,P=Math.max(0,_-b),F=Math.max(0,h-y),I=0,L=0;j||(I=RP(E===`rtl`?-w:w,P),L=P-I);let R=A?0:RP(x,F),z=A?0:F-R,ee=j?0:b,B=A?0:y,te=0,ne=0;!j&&!A&&(te=t?.offsetWidth||0,ne=n?.offsetHeight||0);let re=f.width===0&&f.height===0,V=re?te:0,ie=re?ne:0,ae=NL(n,`padding`,`x`),oe=NL(t,`padding`,`y`),se=NL(i,`margin`,`x`),ce=NL(r,`margin`,`y`),H=ee-ae-se,le=B-oe-ce,ue=n?Math.min(n.offsetWidth-V,H):H,de=t?Math.min(t.offsetHeight-ie,le):le,fe=Math.max(16,ue*M),U=Math.max(16,de*N);if(m(e=>lR(e,{width:fe,height:U})),t&&r){let e=uR(r,nR,x,F,h,U,t.offsetHeight-U-oe-ce);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-fe-ae-se,t=uR(i,rR,E===`rtl`?-w:w,P,_,fe,e);i.style.transform=`translate3d(${E===`rtl`?-t:t}px,0,0)`}let pe=[I,L,R,z];iR.forEach((t,n)=>{e.style.setProperty(t,`${pe[n]}px`)}),a&&p(e=>lR(e,{width:te,height:ne})),g(e=>lR(e,k));let me={xStart:!j&&I>C.xStart,xEnd:!j&&L>C.xEnd,yStart:!A&&R>C.yStart,yEnd:!A&&z>C.yEnd};S(e=>lR(e,me))});Q(()=>{oR()},[]),Q(()=>{queueMicrotask(j)},[j,_,E,C.xStart,C.xEnd,C.yStart,C.yEnd]),Q(()=>{o.current?.matches(`:hover`)&&x(!0)},[o,x]),Q(()=>{let e=o.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=O.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}j()});return n.observe(e),A.start(0,()=>{let t=e.getAnimations({subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished)).then(j).catch(()=>{})}),()=>{n.disconnect(),A.clear()}},[j,o,A]);function M(){D.current=!1}let N={role:`presentation`,...h&&{"data-id":`${h}-viewport`},tabIndex:_.x&&_.y?-1:0,className:PF.className,style:{overflow:`scroll`},onScroll(){o.current&&(j(),(b||!D.current)&&y({x:o.current.scrollLeft,y:o.current.scrollTop}),k.start(100,()=>{D.current=!0}))},onWheel:M,onPointerMove:M,onPointerEnter:M,onKeyDown:M},P=Rk(`div`,e,{ref:[t,o],state:w,props:[N,a],stateAttributesMapping:VL}),F=T.useMemo(()=>({computeThumbPosition:j}),[j]);return(0,Z.jsx)(ZL.Provider,{value:F,children:P})});function cR(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function lR(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function uR(e,t,n,r,i,a,o){let s=IP(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}var dR=T.createContext(void 0);function fR(){let e=T.useContext(dR);if(e===void 0)throw Error(pT(54));return e}var pR=T.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,handleScroll:y,disableViewportSnap:b,rootId:x,thumbSize:S,hasMeasuredScrollbar:C,viewportState:w}=ML(),E=i===`vertical`,D={...w,hovering:c,scrolling:E?u:l,orientation:i},O=bN(),k=!C&&!a,A=E?d.y:d.x,j=a||!A;T.useEffect(()=>{if(!j)return;let e=m.current,t=E?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!E,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&O===`rtl`?-a:0,s=n&&O===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),y({x:e.scrollLeft,y:e.scrollTop}))}return bD(t,`wheel`,n,{passive:!1})},[O,y,E,p,f,j,m]);let M={...x&&{"data-id":`${x}-scrollbar`},"aria-hidden":!0,onPointerDown(e){if(e.button!==0)return;let t=pE(e.nativeEvent),n=E?h.current:g.current;if(n&&fE(n,t))return;let r=m.current;if(!r)return;let i=E?f.current:p.current;if(!n||!i)return;let a=E?`y`:`x`,o=NL(n,`margin`,a),s=NL(i,`padding`,a),c=E?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=E?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=E?r.scrollHeight:r.scrollWidth,v=E?r.clientHeight:r.clientWidth,x=(E?i.offsetHeight:i.offsetWidth)-c-s-o;if(x<=0)return;let S=u/x,C=d-v;b(),E?r.scrollTop=S*C:r.scrollLeft=O===`rtl`?-(1-S)*C:S*C,y({x:r.scrollLeft,y:r.scrollTop}),_(e)},onMouseDown(e){e.preventDefault()},onPointerUp:v,onPointerCancel:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:k?`hidden`:void 0,...E?{top:0,bottom:`var(${HL})`,insetInlineEnd:0,[nR]:`${S.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${UL})`,bottom:0,[rR]:`${S.width}px`}}},N=Rk(`div`,e,{ref:[t,E?f:p],state:D,props:[M,s],stateAttributesMapping:VL});return j?(0,Z.jsx)(dR.Provider,{value:i,children:N}):null}),mR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=ML(),m=fR(),h=m===`vertical`;return Rk(`div`,e,{ref:[t,h?o:s],state:{scrolling:h?f:d,orientation:m},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...h?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),hR=T.createContext(void 0);function gR(e){let t=T.useContext(hR);if(!e&&t===void 0)throw Error(pT(27));return t}var _R=T.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=gR(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Rk(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:RE,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),vR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=gR(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=JP({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,gD(aD,e.nativeEvent))}return Rk(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),yR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=gR(),c=oN(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Rk(`p`,e,{ref:t,props:[{id:c},o]})}),bR=T.createContext(void 0);function xR(){let e=T.useContext(bR);if(e===void 0)throw Error(pT(26));return e}var SR=`--nested-dialogs`,CR=`data-nested-dialog-open`,wR={...LE,...wE,nestedDialogOpen(e){return e?{[CR]:``}:null}},TR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=gR(),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`);xR(),eM({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?nM(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Rk(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...tM,hidden:!m,onKeyDown(e){VF.has(e.key)&&e.stopPropagation()},style:{[SR]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:wR});return(0,Z.jsx)(CA,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),ER=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=gR(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Z.jsx)(bR.Provider,{value:n,children:(0,Z.jsxs)(iA,{ref:t,...r,children:[a&&o===!0&&(0,Z.jsx)(hF,{ref:i.context.internalBackdropRef,inert:VN(!s)}),e.children]})}):null});function DR({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=T.useState(0),[u,d]=T.useState(0),f=c===0,p=AA(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`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=pE(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||fE(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return OF(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Q(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),pM(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var OR={...SM,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},kR=class extends Kj{constructor(e,t,n){let r=new hM,i=AR(e,r,t,n);super(i,jR(r),OR)}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(sM(this.state,e,t.trigger)))}};function AR(e,t,n,r=!1){return{...gM(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 jR(e){return{popupRef:T.createRef(),backdropRef:T.createRef(),internalBackdropRef:T.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function MR(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,_=m?`alertdialog`:`dialog`,v=gR(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=rM((e,t)=>new kR({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);mM(b,x),dM(b);let{forceUnmount:w}=fM(x,b);T.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,gD(pD))}),[w,b]);let E=x||S;return(0,Z.jsxs)(hR.Provider,{value:b,children:[u&&(0,Z.jsx)(iM,{handle:u,store:b}),E&&(0,Z.jsx)(DR,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var NR=oT(function(e){return MR(`dialog`,e)}),PR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=xR(),c=gR(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return Rk(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:wR,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),FR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=gR(),c=oN(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Rk(`h2`,e,{ref:t,props:[{id:c},o]})}),IR=sT(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=gR(!0),f=CM(l)??d;if(!f)throw Error(pT(79));let p=oN(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=T.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=uM(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=JP({disabled:a,native:o}),S=wA(m),C=PP(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},E=f.useState(`triggerProps`,y);return Rk(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,E,C,{[Kk]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:FE})}),LR={risk:`Known risk`,unverified:`Needs verification`,degradation:`Expected differences`,"not-applicable":`Not affected`},RR=(e=>e)({"no-template":{summary:`The entry does not default-export a template.`,fix:`Default-export defineTemplate({ ... }) imported from @samva/markup.`},"legacy-definition":{summary:`The entry default-exports something other than defineTemplate.`,fix:`Import { defineTemplate } from "@samva/markup" and default-export defineTemplate({ ... }).`,upgrade:[`Read the entry and its imports without executing them. For a default-exported defineEmail definition, import defineTemplate from "@samva/markup" and replace the definition call.`,`Preserve the entry path, template id, schema, named fixtures, content, design, bindings, conditions, project partials, assets, theme and brand imports. Replace render(input) returning { subject, preheader?, body } with email: { subject: (input) => ..., preheader: (input) => ..., body: (input) => ... }, retaining its parameter bindings and each returned expression; omit preheader when absent.`,`Inline module constants only when they are literal strings, numbers or booleans and their bindings are unambiguous; never substitute a fixture value for an input binding. Keep each channel function a single static-profile expression, and keep subject and preheader off <Email>.`,"Helper calls, `Math.*`, general arithmetic, render statements, spreads, computed properties and runtime clock or seed have no direct conversion. Rewrite with static-profile bindings, conditions, .map, .filter, project partials or `fmt.*` where equivalent; arithmetic is allowed only in formatter arguments and conditions. Otherwise compute the value in the sender, declare a payload field in the schema and every fixture, and explain the required sender change. Never guess time, randomness or computed data.",`Explicit text has no email-channel field: plain text is derived from the body. If deriving it changes intended content, or another construct cannot be preserved, explain the tradeoff and ask rather than silently discard it. Do not drop fixtures, weaken validation or hide diagnostics.`,`Convert every affected entry in the project at its existing path, including emails/ entries. Compile each entry, render every declared fixture and inspect the affected output. Resolve errors before requesting one saved version for the whole project, approved by the user; do not publish.`].join(`
23
-
24
- `)},"dynamic-definition":{summary:`A definition field is spread or computed instead of written out.`,fix:`Write each field as name: value.`},"invalid-template-id":{summary:`The template id is not a lowercase kebab-case string literal.`,fix:`Write id: "order-shipped".`},"missing-schema":{summary:`The template declares no input schema.`,fix:`Add schema: jsonSchema<Input>({ ... }).`},"schema-not-static":{summary:`The schema cannot be read without running code.`,fix:`Write the schema as a literal jsonSchema<Input>({ type: 'object', ... }).`},"invalid-schema":{summary:`The schema uses JSON Schema keywords the compiler cannot validate against.`,fix:`Use only the JSON Schema keywords the package README lists.`},"missing-fixtures":{summary:`The template declares no fixtures.`,fix:`Add fixtures: { default: { ... } } with at least one valid payload.`},"fixtures-not-static":{summary:`A fixture is computed instead of written as data.`,fix:`Write each fixture as a literal object; an imported asset is allowed.`},"invalid-fixture-name":{summary:`A fixture key is not a single path segment.`,fix:`Use letters, digits, '.', '_' and '-', starting with a letter or digit.`},"fixture-invalid":{summary:`A fixture does not match the schema.`,fix:`Change the fixture, or the schema, so every fixture is a payload a send could carry.`},"invalid-locale":{summary:`The template's default locale is not a string literal.`,fix:`Write locale: "en-US".`},"no-channel":{summary:`The template declares no channel body.`,fix:`Add an email body.`},"invalid-channel":{summary:`A channel field is not shaped as the channel requires.`,fix:`Write email: { subject, preheader?, body } with each a function of the input.`},"not-a-function":{summary:`A channel field is not a function of the input.`,fix:`Write (input) => ... in place or declare the function in the project.`},"missing-subject":{summary:`The email channel has no subject.`,fix:`Add subject: (input) => ....`},"missing-body":{summary:`The email channel has no body.`,fix:`Add body: (input) => (<Email>...</Email>).`},"multiple-roots":{summary:`The body renders nothing or more than one root.`,fix:`Wrap the body in a single element such as <Email>.`},"preheader-without-shell":{summary:`A preheader is set but the body has no <Email> shell to hold it.`,fix:`Wrap the body in <Email>.`},"wrong-channel":{summary:`A channel body does not return its own channel component.`,fix:`Return one element imported from the channel package.`,channelOnly:!0},"syntax-error":{summary:`A project file does not parse as TSX.`,fix:`Fix the syntax at the reported location.`},"non-project-import":{summary:`The file imports something other than @samva/markup or a project file.`,fix:`Remove the import, or copy the code you need into a project file.`},"unresolved-import":{summary:`An import names no file in the project.`,fix:`Check the path and the file extension.`},"recursive-partial":{summary:`A partial renders itself; partials are inlined at compile time.`,fix:`Flatten the recursion, or repeat the structure with .map.`},"nesting-limit":{summary:`The template nests deeper than the compiler reads.`,fix:`Flatten the structure.`},"dynamic-expression":{summary:`An expression outside the static profile: a call other than fmt.* and .map, a computed value, or a spread.`,fix:`Compute the value where the message is sent and bind it from the payload.`},"statement-in-body":{summary:`A body contains a statement (const, if, a loop); a body is one expression.`,fix:`Use cond && <X />, cond ? <A /> : <B /> and .map, or send the computed value in the payload.`},"unsupported-pattern":{summary:`A parameter pattern or default value the profile cannot bind.`,fix:`Use plain names or destructuring without defaults; declare the field required or guard it.`},"hook-call":{summary:`A hook was called; templates have no state, effects or context.`,fix:`Read the input through the function's parameter and send anything else in the payload.`},"unknown-formatter":{summary:`fmt.<name> is not a formatter.`,fix:`Use fmt.money, number, date, time, plural or list.`},"formatter-arguments":{summary:`A formatter got the wrong number of arguments.`,fix:`Match the formatter's signature in the contract.`},"reserved-character":{summary:`Text contains a private-use character the compiler reserves.`,fix:`Remove the characters U+E000 to U+E003.`},"reserved-url":{summary:`A URL is the unsubscribe placeholder only BrandFooter can write.`,fix:`Render <BrandFooter /> instead.`},"reserved-attribute":{summary:`An attribute is written only by a brand component.`,fix:`Render BrandFooter from samva:brand instead of marking an element as the footer.`},"dynamic-class":{summary:`A class name is built at run time, and Tailwind cannot see it.`,fix:`Write classes literally, or choose between literal lists: input.vip ? "bg-amber-100" : "bg-white".`},"too-many-class-variants":{summary:`A class list chooses between more literal lists than the compiler resolves.`,fix:`Split the choice into fewer conditions, or move part of it to a partial.`},"invalid-style":{summary:`A style prop is not a static property object.`,fix:`Write style={{ backgroundColor: "#fff" }} with literal values, or use classes.`},"unknown-field":{summary:`A binding names a field the schema does not declare.`,fix:`Add the field to the schema, or bind a field it declares (the message suggests the nearest).`},"unguarded-optional":{summary:`An optional field is read outside a guard, so a send without it would render a blank.`,fix:`Guard it with {input.field && ...}, or make the field required.`},"invalid-binding-type":{summary:`A binding has the wrong type for where it is used.`,fix:`Bind a field of the type the position needs, or send it in that type.`},"unknown-component":{summary:`A component the profile cannot read.`,fix:`Import components from @samva/markup/email/components, samva:brand, or the project.`},"dynamic-numeric-prop":{summary:`A prop that sizes layout at compile time is not a number literal.`,fix:`Write the number literally, for example height={44}.`},"button-dynamic-label":{summary:`A Button label is read at render time, so classic Outlook cannot size it.`,fix:`Give the button a width: <Button width={200}>.`},"invalid-columns-each":{summary:`<Columns each> is not a list from the input.`,fix:`Write each={input.items} with a callback returning <Column>.`},"invalid-columns-per":{summary:`<Columns per> is not a positive integer literal.`,fix:`Write per={2}.`},"invalid-button-number":{summary:`A Button size prop is not a finite number.`,fix:`Pass a finite number.`},"unsupported-element":{summary:`An element outside the supported email vocabulary.`,fix:`Use an element from the contract's element table.`},"unsupported-attribute":{summary:`An attribute the element does not support.`,fix:`Use a supported attribute, or data-* and aria-*.`},"missing-attribute":{summary:`An element is missing a required attribute.`,fix:`Add the attribute, for example alt on img.`},"invalid-attribute-value":{summary:`An attribute value is not a string or number, or contains control characters.`,fix:`Pass plain text.`},"duplicate-attribute":{summary:`An attribute is written twice.`,fix:`Keep one.`},"invalid-content":{summary:`An element holds content its content model does not allow.`,fix:`Move the child to a parent that accepts it.`},"void-element-children":{summary:`A void element has children.`,fix:`Remove the children.`},"event-handler":{summary:`An event handler; email clients strip scripting.`,fix:`Remove the handler; use a link for interaction.`},"dangerous-html":{summary:`dangerouslySetInnerHTML; there is no raw-HTML escape hatch.`,fix:`Write the markup as JSX.`},"unsafe-url":{summary:`A URL uses a scheme email cannot send safely.`,fix:`Use an https URL, a mailto: or tel: link, or a bound URL.`},"unsafe-raw-text":{summary:`Raw text content contains markup that could end its element.`,fix:`Remove the offending sequence.`},"unsupported-style-property":{summary:`A style property name is not a CSS property.`,fix:`Write camelCase (backgroundColor) or a custom property (--brand).`},"invalid-style-value":{summary:`A style value is not a string or number.`,fix:`Pass a string or number.`},"unsafe-style-value":{summary:`A style value contains CSS that could break out of its declaration.`,fix:`Remove the offending characters.`},"missing-head":{summary:`Styles that cannot be inlined need a <head> to live in.`,fix:`Wrap the message in <Email>, or write those declarations inline.`},"invalid-subject":{summary:`The subject is not one line of text.`,fix:`Return a single-line string.`},"invalid-preheader":{summary:`The preheader is not a string.`,fix:`Return a string.`},"invalid-text":{summary:`The plain-text body is not a string.`,fix:`Return a string.`},"button-outlook-fallback":{summary:`Classic Outlook needs a height and a plain string label to draw the button.`,fix:`Give <Button> a height and a string label.`},"unmatched-class":{summary:`A class produced no styles.`,fix:`Use a class the theme or Tailwind defines, or write the style inline.`},"tailwind-dynamic-class":{summary:`A class list is assembled at run time.`,fix:`Write the classes literally.`},"css-parse-error":{summary:`A stylesheet does not parse.`,fix:`Fix the CSS at the reported location.`},"css-import-unresolved":{summary:`A stylesheet @import cannot be resolved.`,fix:`Import the stylesheet from the template module, or use the theme.css layers.`},"css-unsupported-at-rule":{summary:`An at-rule is not applied to email output.`,fix:`Remove it or move the declarations into a class rule.`},"css-conditional-variable":{summary:`A custom property is redefined inside a conditional at-rule.`,fix:`Keep the override on a class rule.`},"email-font-fallback":{summary:`A font stack names a project font without a generic fallback.`,fix:`End the stack with sans-serif, serif or monospace.`},"email-font-family":{summary:`@font-face declares no font-family.`,fix:`Add font-family.`},"email-font-src":{summary:`@font-face declares no usable url() src.`,fix:`Add a url() pointing at a .woff2 file.`},"email-font-format":{summary:`@font-face uses a format other than WOFF2.`,fix:`Convert the file to .woff2.`},"email-font-missing":{summary:`@font-face names a file the project does not hold.`,fix:`Add the file; paths resolve from the stylesheet's directory.`},"invalid-asset-base":{summary:`The asset base is not an https URL or a path.`,fix:`Use an https URL, an absolute path, or a relative path.`},"brand-unavailable":{summary:`The build has no brand to resolve a samva:brand import.`,fix:`Create or select the brand the import names.`},"brand-import-conflict":{summary:`The project imports two different brands.`,fix:`Import one brand specifier everywhere.`},"caniemail/unknown-coverage":{summary:`A feature has no client-support data.`,fix:`Verify it in the target clients.`},"invalid-attribute":{summary:`A channel component attribute has a value the channel does not accept.`,fix:`Use one of the listed values.`,channelOnly:!0},"unknown-attribute":{summary:`A channel component attribute the component does not have.`,fix:`Use one of the listed attributes.`,channelOnly:!0},"sms-markup":{summary:`An SMS body contains an element; SMS is plain text.`,fix:`Write text and bindings, with a newline for a line break.`,channelOnly:!0},"whatsapp-structure":{summary:`WhatsApp content sits outside Header, Body, Footer or Buttons.`,fix:`Move it into <WhatsApp.Body>.`,channelOnly:!0},"whatsapp-body-required":{summary:`A WhatsApp template has no body.`,fix:`Add <WhatsApp.Body>...</WhatsApp.Body>.`,channelOnly:!0},"whatsapp-conditional":{summary:`A WhatsApp part branches or contains elements; Meta registers its text once.`,fix:`Choose the wording in the payload, or write separate templates.`,channelOnly:!0},"whatsapp-header-media":{summary:`A WhatsApp media header is not exactly one URL.`,fix:`Write the URL as the only child: a literal or one binding.`,channelOnly:!0},"whatsapp-header-variables":{summary:`A WhatsApp header text takes more than one variable.`,fix:`Keep one binding in the header and move the rest to the body.`,channelOnly:!0},"whatsapp-length":{summary:`A WhatsApp part exceeds Meta's length limit.`,fix:`Shorten the text.`,channelOnly:!0},"whatsapp-button-text":{summary:`A WhatsApp button has no label or value between its tags.`,fix:`Write the label or value as text between the tags.`,channelOnly:!0},"whatsapp-button-limit":{summary:`The conditions can produce more buttons of a kind than Meta allows.`,fix:`Remove buttons, or split the template.`,channelOnly:!0}}),zR=e=>Object.entries(RR).some(([t,n])=>t===e&&`upgrade`in n),BR=(e,t,n)=>{let r=new Map;for(let i of e.diagnostics??[])if(i.code===`caniemail/target-attribute`&&i.severity===`warning`)for(let e of i.occurrences??[i.origins]){let i=e[0];if(i===void 0)continue;let a=WC(t,n,i);if(a===null||a.tag!==`a`||a.hasSpread)continue;let o=a.properties.filter(e=>e.name===`target`),s=o[0];if(o.length!==1||s===void 0||s.kind!==`literal`||![`_self`,`_parent`,`_top`].includes(s.value))continue;let c=KC(t,s,`_blank`);c!==null&&r.set(c.start,c)}return[...r.values()].sort((e,t)=>e.start-t.start)};function VR({check:e}){let t=yL(),{doc:n,sourceEditable:r,pending:i,conflict:a,lifecycleBusy:o}=G(iL(e=>({doc:e.doc,sourceEditable:e.sourceEditable,pending:e.pendingAuthoredSource!==null,conflict:e.conflict,lifecycleBusy:e.lifecycleBusy}))),s=G(e=>e.actions.applySourceEdit),c=G(e=>e.actions.requestDiagnosticAssistance);if(n===null||!r)return null;let l=BR(e,n.origin.authoredSource,n.origin.file);if(l.length===0&&!t)return null;let u=e.diagnostics?.some(e=>zR(e.code)),d=i||a||o;return(0,Z.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[l.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:[`Set `,l.length,` local link target`,l.length===1?``:`s`,` to _blank to match these clients.`]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`check.fix-target`,disabled:d,className:`border-border hover:bg-muted rounded border px-2 py-1 text-[11.5px] disabled:opacity-50`,onClick:()=>s({revision:n.rev,source:n.origin.authoredSource,edits:l}),children:`Use new-window links`})]}),t&&(0,Z.jsx)(`button`,{type:`button`,"data-testid":u?`check.upgrade-with-assistant`:`check.fix-with-assistant`,disabled:d,className:`border-border hover:bg-muted rounded border px-2 py-1 text-[11.5px] disabled:opacity-50`,onClick:()=>c(e),children:u?`Upgrade with Assistant`:`Fix with Assistant`})]})}function HR({check:e,actions:t}){return e.diagnostics===void 0?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`text-foreground text-[12.5px]`,children:e.label}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:e.detail})]}):(0,Z.jsxs)(`details`,{className:`min-w-0 flex-1`,"data-testid":`check.${e.id}`,children:[(0,Z.jsxs)(`summary`,{className:`text-foreground cursor-pointer text-[12.5px] break-words`,children:[e.label,(0,Z.jsx)(`span`,{className:`text-muted-foreground mt-0.5 block text-[11.5px]`,children:e.detail})]}),(0,Z.jsxs)(`div`,{className:`mt-2 space-y-3 text-[11.5px] break-words`,children:[e.diagnostics.map((e,t)=>(0,Z.jsxs)(`div`,{className:`border-border-subtle border-l pl-2`,children:[e.compatibility!==void 0&&(0,Z.jsxs)(`p`,{className:`mb-1 font-medium`,children:[e.compatibility.title,` ·`,` `,LR[e.compatibility.assessment]]}),(0,Z.jsx)(`p`,{children:e.message}),e.clients!==void 0&&!e.clients.every(t=>e.message.includes(t))&&(0,Z.jsxs)(`p`,{className:`mt-1`,children:[`Clients: `,e.clients.join(`, `)]}),e.notes!==void 0&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:e.notes}),(e.fixtures?.length??0)>0&&(0,Z.jsxs)(`p`,{className:`mt-1`,children:[`Fixtures: `,e.fixtures.join(`, `)]}),(e.occurrences??[e.origins]).map((e,t)=>e.length===0?null:(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 break-all`,children:e.map(rw).join(` → `)},t)),e.provenance!==void 0&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:e.provenance})]},t)),(0,Z.jsx)(`p`,{className:`text-muted-foreground font-mono break-all`,children:e.diagnostics[0]?.code}),t]})]})}var UR=(0,T.createContext)(void 0),WR=()=>(0,T.useContext)(UR);function GR({checks:e,editable:t=!1}){let{actionable:n}=Aw(e),r=e.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===`unverified`)).length;return(0,Z.jsxs)(`section`,{className:`space-y-3`,"aria-label":`Needs attention`,children:[(0,Z.jsxs)(`h3`,{className:`text-foreground text-[13px] font-semibold`,children:[`Needs attention`,n.length>0?` · ${n.length}`:``]}),n.length===0?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.length===0?`No checks yet.`:`No known risks found.`}):n.map(e=>(0,Z.jsx)(HR,{check:e,actions:t?(0,Z.jsx)(VR,{check:e}):void 0},e.id)),(0,Z.jsx)(KR,{checks:e,editable:t}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:r>0?`${r} finding group${r===1?` needs`:`s need`} client verification.`:`These checks do not confirm rendering in every inbox.`})]})}function KR({checks:e,editable:t=!1}){let n=WR(),r=Object.fromEntries(Object.keys(LR).map(t=>[t,e.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===t)).length])),[i,a]=(0,T.useState)(`all`),[o,s]=(0,T.useState)(`all`),c=[...new Set(e.flatMap(e=>e.diagnostics?.flatMap(e=>e.clients??[])??[]))].sort(),l=e.flatMap(e=>{if(e.diagnostics===void 0)return i===`all`&&o===`all`?[e]:[];let t=e.diagnostics.filter(e=>(i===`all`||e.compatibility?.assessment===i)&&(o===`all`||e.clients?.includes(o)));return t.length===0?[]:[Ew(e.id,t)]}),u=e=>e.severity===`error`||e.severity===`warn`?0:e.diagnostics?.some(e=>e.compatibility?.assessment===`unverified`)?1:e.diagnostics?.some(e=>e.compatibility?.assessment===`degradation`)?2:3;return l.sort((e,t)=>u(e)-u(t)),(0,Z.jsxs)(NR,{onOpenChange:e=>{e&&(a(r.unverified>0?`unverified`:`all`),s(`all`))},children:[(0,Z.jsx)(IR,{"data-testid":`checks.compatibility-report`,className:`border-border text-foreground hover:bg-muted rounded-md border px-2.5 py-1.5 text-xs`,children:`Compatibility report`}),(0,Z.jsxs)(ER,{container:n,children:[(0,Z.jsx)(_R,{className:`fixed inset-0 z-[130] bg-black/30`}),(0,Z.jsxs)(TR,{"data-testid":`checks.report`,className:`samva-editor-shell border-border bg-surface-elevated text-foreground fixed top-1/2 left-1/2 z-[131] flex max-h-[85dvh] w-[min(840px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border p-5 shadow-xl`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(FR,{className:`text-lg font-semibold`,children:`Compatibility report`}),(0,Z.jsx)(vR,{"data-testid":`checks.report.close`,"aria-label":`Close compatibility report`,className:`hover:bg-muted rounded border px-2 py-1 text-xs`,children:`Close`})]}),(0,Z.jsx)(yR,{className:`text-muted-foreground mt-2 text-sm`,children:`Client verification remains. Review known risks, unverified behavior and fallbacks before testing in your recipients’ inboxes.`}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:[Object.entries(LR).map(([e,t])=>`${r[e]} ${t.toLowerCase()}`).join(` · `),`. Groups can appear in more than one category.`]}),(0,Z.jsxs)(`div`,{className:`my-4 flex flex-wrap gap-3 text-xs`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Assessment`,(0,Z.jsxs)(`select`,{"data-testid":`checks.report.assessment`,"aria-label":`Assessment`,value:i,onChange:e=>a(e.target.value),className:`border-border bg-background rounded border p-2`,children:[(0,Z.jsx)(`option`,{value:`all`,children:`All assessments`}),Object.entries(LR).map(([e,t])=>(0,Z.jsxs)(`option`,{value:e,children:[t,` (`,r[e],`)`]},e))]})]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Client`,(0,Z.jsxs)(`select`,{"data-testid":`checks.report.client`,"aria-label":`Client`,value:o,onChange:e=>s(e.target.value),className:`border-border bg-background rounded border p-2`,children:[(0,Z.jsx)(`option`,{value:`all`,children:`All clients`}),c.map(e=>(0,Z.jsx)(`option`,{children:e},e))]})]})]}),(0,Z.jsx)(`div`,{className:`samva-editor-scroll min-h-0 space-y-4 overflow-y-auto`,children:l.length===0?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No evidence matches these filters.`}):l.map(e=>(0,Z.jsx)(`div`,{className:`border-border-subtle border-t pt-3`,children:(0,Z.jsx)(HR,{check:e,actions:t?(0,Z.jsx)(VR,{check:e}):void 0})},e.id))})]})]})]})}var qR=T.createContext(void 0);function JR(){return T.useContext(qR)}function YR(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=GP(),{ref:i,index:a}=sI(e),o=n===a,s=T.useRef(null),c=SD(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 XR(e){let{render:t,className:n,style:r,state:i=dT,props:a=uT,refs:o=uT,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=YR({metadata:s});return Rk(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var ZR=T.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=oN(u||void 0),h=JR(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=GN({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:b,buttonRef:x}=JP({disabled:_,native:d}),S={disabled:_,pressed:v},C=[x,t],w=[{"aria-pressed":v,onClick(e){let t=!v,n=gD($E,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,b],E=Rk(`button`,e,{enabled:!h,state:S,ref:C,props:w}),D=T.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,Z.jsx)(XR,{tag:`button`,render:c,className:n,style:f,metadata:D,state:S,refs:C,props:w}):E});function QR(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=uT}=e,[p,m]=T.useState(0),h=r!=null,g=T.useRef(null),_=SD(g,c),v=T.useRef([]),y=T.useRef(!1),b=T.useRef(null),x=o??p,S=$((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];GF(g.current,t,a,n)}}),C=$(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||xO(e,x,d)?S($R(e,d)):b.current=t}else t!==x&&S(t);return}y.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)S(i);else if(xO(t,x,d)){let e=bO(t,{disabledIndices:d});_O(t,e)||S(e)}GF(g.current,r,a,n)});Q(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(xO(e,x,d)){let t=bO(e,{disabledIndices:d});_O(e,t)||S(t)}},[d,o,x,v,S]);let w=$((e,t,n)=>i?i(e,t,n,v):n),E=$(e=>{let o=e.key===`Home`||e.key===`End`;if(!VF.has(e.key)||!l&&o||ez(e,f)||!g.current)return;let s=a===`rtl`,c=s?zF:BF,p=s?BF:zF,m=n===`vertical`?RF:c,_=n===`vertical`?LF:p,y=pE(e.nativeEvent);if(y!=null&&WF(y)&&!WN(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=vO(v,d),T=yO(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,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=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=bO(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!_O(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=pE(e.nativeEvent);t&&n!=null&&WF(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:E}}function $R(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!xO(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function ez(e,t){for(let n of HF)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function tz(e){let{render:t,className:n,style:r,refs:i=uT,props:a=uT,state:o=dT,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=QR({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:bN(),disabledIndices:v,modifierKeys:y}),A=Rk(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),j=T.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:E,highlightItemOnHover:b,relayKeyboardEvent:k}),[w,E,b,k]);return(0,Z.jsx)(WP.Provider,{value:j,children:(0,Z.jsx)(oF,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var nz=T.createContext(void 0);function rz(){return T.useContext(nz)}var iz=T.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=IF(!0),m=rz(),h=n??uT,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=GN({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),b=$((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:_,multiple:s,orientation:o},S=T.useMemo(()=>({disabled:_,setGroupValue:b,value:v,isValueInitialized:g}),[_,b,v,g]),C={role:`group`},w=Rk(`div`,e,{enabled:!!p,state:x,ref:t,props:[C,f]});return(0,Z.jsx)(qR.Provider,{value:S,children:p?w:(0,Z.jsx)(tz,{render:u,className:l,style:d,state:x,refs:[t],props:[C,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})}),az=dL(`flex flex-1 items-center justify-center gap-1.5 px-2 text-[12px]`,mL);function oz(){let e=G(e=>e.rightMode),{setRightMode:t}=G(e=>e.actions);return(0,Z.jsx)(`div`,{className:`border-border-subtle flex shrink-0 border-b px-2 py-1.5`,children:(0,Z.jsxs)(iz,{"aria-label":`Right rail mode`,value:[e],onValueChange:e=>{let n=e[0];(n===`inspector`||n===`agent`)&&t(n)},className:`bg-muted flex flex-1 gap-0.5 rounded-lg p-0.5`,children:[(0,Z.jsxs)(ZR,{value:`inspector`,"data-testid":`rail-mode.inspector`,className:az,children:[(0,Z.jsx)(ve,{className:`size-[14px]`}),`Design`]}),(0,Z.jsxs)(ZR,{value:`agent`,"data-testid":`rail-mode.agent`,className:az,children:[(0,Z.jsx)(ye,{className:`size-[14px]`}),`AI`]})]})})}function sz({name:e,className:t}){return(0,Z.jsx)(`span`,{className:dL(`inline-flex items-baseline rounded-md bg-accent-teal/20 px-1.5 py-px font-mono text-[0.82em] font-medium text-foreground ring-1 ring-inset ring-accent-teal/20`,t),children:`{{${e}}}`})}function cz({children:e}){return(0,Z.jsx)(`div`,{className:`text-muted-foreground mb-2 flex items-center justify-between text-[10.5px] font-semibold tracking-[0.06em] uppercase`,children:e})}function lz({children:e,className:t,title:n,help:r=n,pressed:i,onClick:a,disabled:o,testId:s}){let c=WR();return(0,Z.jsxs)(iN,{disabled:o,children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":n,"aria-pressed":i,disabled:o,"data-testid":s,onClick:a,className:dL(`inline-flex h-7.5 items-center gap-1.5 rounded-[7px] px-2.5 text-muted-foreground outline-none transition-all hover:bg-muted hover:text-foreground active:translate-y-px disabled:opacity-40`,sL,`aria-pressed:text-accent-foreground`,fL,t)}),children:e}),(0,Z.jsx)(gN,{container:c,children:(0,Z.jsx)(zN,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:r})})})]})}function uz({ariaLabel:e,options:t,value:n,onChange:r,size:i=`md`,testId:a}){let o=WR();return(0,Z.jsx)(iz,{"aria-label":e,value:[n],"data-testid":a,onValueChange:e=>{let t=e[0];t!==void 0&&r(t)},className:dL(`bg-muted inline-flex gap-0.5 rounded-lg p-0.5`,i===`sm`&&`rounded-[7px]`),children:t.map(e=>{let t=(0,Z.jsx)(ZR,{type:`button`,"aria-label":e.title,"data-testid":e.testId,value:e.value,className:dL(mL,i===`sm`?`h-6 px-2 text-xs`:`h-7 px-2.5 text-xs`),children:e.label},e.value);return e.title===void 0?t:(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:t}),(0,Z.jsx)(gN,{container:o,children:(0,Z.jsx)(zN,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:e.title})})})]},e.value)})})}function dz({children:e,className:t,overridden:n,testId:r}){return(0,Z.jsxs)(`span`,{"data-testid":r,className:dL(`inline-flex h-7 max-w-[170px] items-center gap-1.5 overflow-hidden rounded-[7px] border border-border bg-background px-2.5 font-mono text-xs whitespace-nowrap text-foreground`,n&&`border-accent-email/40 bg-sel-soft ring-1 ring-accent-email/20`,t),title:n?`Overridden on mobile`:void 0,children:[e,n&&(0,Z.jsx)(`span`,{className:`text-accent-email ml-auto text-[9px] font-semibold tracking-wide uppercase`,children:`M`})]})}var fz=dL(`border-border bg-background text-foreground w-full rounded border px-2 py-1.5 text-xs`,fL),pz=dL(`border-border hover:bg-muted rounded border px-2 py-1 text-xs disabled:opacity-50`,fL);function mz({field:e,source:t,propose:n,apply:r}){let[i,a]=(0,T.useState)(e.value),[o,s]=(0,T.useState)(e.kind===`literal`&&e.literalType===`string`?JSON.stringify(e.value):e.value);return(0,Z.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[hz(e.name),` · `,e.kind,e.kind===`literal`?(0,Z.jsx)(`input`,{"aria-label":`${e.name} literal`,"data-testid":`source.property.${e.name}.literal`,type:e.literalType===`number`?`number`:`text`,className:fz,value:i,onChange:e=>a(e.target.value)}):(0,Z.jsx)(`code`,{className:`bg-muted mt-1 block rounded p-2 break-all`,children:e.value})]}),e.kind===`literal`&&(0,Z.jsx)(`button`,{"data-testid":`source.property.${e.name}.apply`,type:`button`,className:pz,disabled:KC(t,e,i)===null,onClick:()=>{let n=KC(t,e,i);n!==null&&r(n)},children:`Apply literal`}),(0,Z.jsxs)(`details`,{children:[(0,Z.jsx)(`summary`,{"data-testid":`source.property.${e.name}.expression-toggle`,className:`cursor-pointer text-xs`,children:e.kind===`literal`?`Change to a binding or expression`:`Review a binding or expression change`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground my-1 text-xs`,children:`This changes template logic. Fixture values are edited separately.`}),(0,Z.jsx)(`textarea`,{"aria-label":`${e.name} expression`,"data-testid":`source.property.${e.name}.expression`,className:fz,value:o,onChange:e=>s(e.target.value)}),(0,Z.jsx)(`button`,{"data-testid":`source.property.${e.name}.review`,type:`button`,className:pz,onClick:()=>n(qC(t,e,o)),children:`Review expression diff`})]})]})}var hz=e=>e===`children`||e.startsWith(`text.`)?`Text`:e===`className`?`Style classes`:e,gz=e=>e instanceof Error&&e.message!==``?e.message:`The host could not save this.`;function _z(e){let t=G(e=>e.lifecycleCapability),{flushSaves:n}=G(e=>e.actions),[r,i]=(0,T.useState)(null);return(0,T.useEffect)(()=>{if(e===null||t?.status!==`ready`)return;let r=!1;return n().then(()=>t.api.inspect()).then(e=>{if(r)return;let t={};for(let n of e.files)n.binary!==!0&&n.status!==`deleted`&&n.content!==null&&(t[n.path]=n.content);i(t)}).catch(()=>{r||i(`failed`)}),()=>{r=!0}},[e,t,n]),e===null?{status:`entry`}:t?.status===`ready`?r===null?{status:`loading`}:r===`failed`?{status:`unavailable`}:{status:`ready`,files:r,api:t.api}:{status:`unavailable`}}function vz(e){return e.busy?`Waiting for the latest source to render.`:e.file!==null&&e.project===`loading`?`Reading ${e.file}.`:e.file!==null&&e.project===`unavailable`?`This element is written in ${e.file}, outside the template entry, and this host cannot edit project files from here. Open Source or ask the agent.`:e.resolved?`This source is read-only.`:`This origin cannot be resolved in its file. Open its source or ask the agent.`}function yz(e,t){return`${e.occurrences>1?`This element renders ${e.occurrences} times here (a loop or a repeated component), so one edit changes all ${e.occurrences}.`:`This changes this element.`}${t?` It is written in a partial, so every template that uses the partial changes too.`:``} Fixture items remain separate data.`}function bz({selection:e}){let{doc:t,pending:n,revision:r,editable:i,storeError:a,lifecycleBusy:o}=G(iL(e=>({doc:e.doc,pending:e.pendingAuthoredSource,revision:e.render?.revision,editable:e.sourceEditable,storeError:e.sourceEditError,lifecycleBusy:e.lifecycleBusy}))),{applySourceEdit:s,openSource:c,requestSourceAssistance:l,beginLifecycle:u,endLifecycle:d}=G(e=>e.actions),{flushSaves:f}=G(e=>e.actions),p=yL(),[m,h]=(0,T.useState)(0),[g,_]=(0,T.useState)(null),[v,y]=(0,T.useState)(null),[b,x]=(0,T.useState)(!1),[S,C]=(0,T.useState)(``),[w,E]=(0,T.useState)(`<p>New content</p>`),[D,O]=(0,T.useState)(``),[k,A]=(0,T.useState)(null),[j,M]=(0,T.useState)(null),N=e.origins[m],P=t?.origin.file,F=N!==void 0&&N.fileName!==P,I=_z(F?N.fileName:null);if(t===null||P===void 0)return null;let L=t.origin.authoredSource,R=F&&N!==void 0?I.status===`ready`?I.files[N.fileName]??null:null:L,z=N===void 0||R===null?null:WC(R,N.fileName,N),ee=F?{entry:P,file:N.fileName,files:{...I.status===`ready`?I.files:{},[P]:L}}:{entry:P},B=i&&n===null&&!o&&!b&&r===t.rev&&z!==null&&R!==null,te=e=>{let t=YC(R??``,e,{profile:ee});return{edits:e,refusal:t.ok?null:t.reason}},ne=e=>{if(R===null)return;if(y(null),_(null),!F){s({revision:r??``,source:R,edits:e});return}let t=YC(R,e,{profile:ee});if(!t.ok){y(t.reason);return}I.status===`ready`&&u()&&(x(!0),f().then(e=>I.api.updateFile({path:N.fileName,baseRev:e,content:t.source})).catch(e=>y(gz(e))).finally(()=>{d(),x(!1)}))},re=e=>{ne([e]),M(null)},V=v??a,ie=z?.properties.find(e=>e.name===`className`),ae=z===null||R===null||ie?.kind===`literal`?null:(()=>{let e=nw(R,z,{kind:`add`,tokens:`x`});return e.ok?null:e.reason})(),oe=e.origins.length>1;return(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(cz,{children:`Source properties`}),oe&&(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[`Edit scope`,(0,Z.jsx)(`select`,{"aria-label":`Edit scope`,"data-testid":`source.scope`,className:fz,value:m,onChange:e=>{h(Number(e.target.value)),M(null)},children:e.origins.map((e,t)=>(0,Z.jsxs)(`option`,{value:t,children:[t===0?`Element`:`Call site ${t}`,` · `,rw(e)]},t))})]}),(0,Z.jsx)(`p`,{"data-testid":`source.scope-note`,className:`text-muted-foreground mt-2 text-xs`,children:oe&&m>0?`Changes this call site, including every loop iteration it produces. Fixture items remain separate data.`:yz(e,F)}),F&&(0,Z.jsxs)(`p`,{"data-testid":`source.partial-warning`,className:`border-border bg-muted mt-2 rounded border p-2 text-xs`,children:[`Edits apply to every template that uses this partial (`,N.fileName,`).`]}),B?(0,Z.jsxs)(Z.Fragment,{children:[z.properties.length===0&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:`No unambiguous scalar properties here. Use source or the agent for this shape.`}),z.hasSpread&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:`Spread properties can override attributes here. Edit attributes in Source or ask the agent.`}),z.properties.filter(e=>!z.hasSpread||e.syntax===`child`).map(e=>(0,Z.jsx)(mz,{field:e,source:R,apply:re,propose:e=>M(te([e]))},`${t.rev}:${R}:${m}:${e.name}`)),ae!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.class-refusal`,className:`text-muted-foreground mt-3 text-xs`,children:ae}),ae===null&&(0,Z.jsxs)(`div`,{className:`mt-3`,children:[(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[ie===void 0?`Style classes · literal`:`Add style classes`,(0,Z.jsx)(`input`,{"aria-label":`Style classes`,"data-testid":`source.classes`,className:fz,value:S,onChange:e=>C(e.target.value)})]}),(0,Z.jsx)(`button`,{"data-testid":`source.classes-add`,type:`button`,className:pz,disabled:S.trim()===``,onClick:()=>{let e=nw(R,z,{kind:`add`,tokens:S});e.ok?ne(e.edits):y(e.reason),C(``)},children:ie===void 0?`Apply styles`:`Add classes`})]}),(0,Z.jsxs)(`details`,{className:`mt-3`,children:[(0,Z.jsx)(`summary`,{"data-testid":`source.structure-toggle`,className:`cursor-pointer text-xs`,children:`Structure · authored block`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground my-2 text-xs`,children:`This changes the whole source block at the scope above. A rendered loop instance has no independent source block. Change fixture items separately; edit loop or conditional logic in Source.`}),(0,Z.jsx)(`textarea`,{"aria-label":`Insert TSX`,"data-testid":`source.insert`,value:w,className:fz,onChange:e=>E(e.target.value)}),(0,Z.jsx)(`button`,{"data-testid":`source.review-insert`,type:`button`,className:pz,disabled:z.contentEnd===null,onClick:()=>{let e=QC(R,z,{kind:`insert`,tsx:w});A(e===null?null:te(e))},children:`Review insert`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-delete`,type:`button`,className:pz,disabled:!z.structural,onClick:()=>{let e=QC(R,z,{kind:`delete`});A(e===null?null:te(e))},children:`Review delete`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-duplicate`,type:`button`,className:pz,disabled:!z.structural,onClick:()=>{let e=QC(R,z,{kind:`duplicate`});A(e===null?null:te(e))},children:`Review duplicate`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-move-up`,type:`button`,className:pz,disabled:z.previous===null,onClick:()=>{let e=QC(R,z,{kind:`reorder`,direction:`before`});A(e===null?null:te(e))},children:`Move earlier`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-move-down`,type:`button`,className:pz,disabled:z.next===null,onClick:()=>{let e=QC(R,z,{kind:`reorder`,direction:`after`});A(e===null?null:te(e))},children:`Move later`}),!F&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`label`,{className:`mt-2 block text-xs`,children:[`Move into shared source container`,(0,Z.jsxs)(`select`,{"aria-label":`Move destination`,"data-testid":`source.destination`,value:D,className:fz,onChange:e=>O(e.target.value),children:[(0,Z.jsx)(`option`,{value:``,children:`Choose destination`}),t.channel===`email`&&t.render?.selections.map(e=>(0,Z.jsxs)(`option`,{value:e.instancePath,children:[e.tag,` · `,e.instancePath,` ·`,` `,e.origins[0]===void 0?`generated`:rw(e.origins[0])]},e.instancePath))]})]}),(0,Z.jsx)(`button`,{"data-testid":`source.review-move`,type:`button`,className:pz,disabled:!z.structural||D===``,onClick:()=>{let e=(t.channel===`email`?t.render?.selections.find(e=>e.instancePath===D):void 0)?.origins[0],n=e===void 0?null:WC(R,P,e),r=n===null?null:QC(R,z,{kind:`move`,destination:n});A(r===null?null:te(r)),_(r===null?`This destination cannot accept the selected block. Choose another source container or use Source.`:null)},children:`Review move`})]}),g!==null&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-status-error text-xs`,children:g}),k!==null&&(0,Z.jsxs)(`div`,{role:`region`,"aria-label":`Structural source diff`,className:`mt-2`,children:[(0,Z.jsx)(`pre`,{className:`bg-muted overflow-auto p-2 text-xs`,children:k.edits.map(e=>`- ${e.before}\n+ ${e.after}`).join(`
25
- `)}),k.refusal!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.structure-refusal`,className:`text-status-error text-xs`,children:k.refusal}),(0,Z.jsx)(`button`,{"data-testid":`source.apply-structure`,type:`button`,className:pz,disabled:k.refusal!==null,onClick:()=>{ne(k.edits),A(null)},children:`Apply structural change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:pz,onClick:()=>A(null),children:`Cancel`})]})]}),j!==null&&(0,Z.jsxs)(`div`,{role:`region`,"aria-label":`Proposed source diff`,className:`mt-3 space-y-2`,children:[(0,Z.jsx)(`p`,{className:`text-xs`,children:`Review the exact source change`}),(0,Z.jsx)(`pre`,{className:`bg-muted overflow-auto p-2 text-xs`,children:j.edits.map(e=>`- ${e.before}\n+ ${e.after}`).join(`
26
- `)}),j.refusal!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.proposal-refusal`,className:`text-status-error text-xs`,children:j.refusal}),(0,Z.jsx)(`button`,{"data-testid":`source.apply-reviewed`,type:`button`,className:pz,disabled:j.refusal!==null,onClick:()=>{ne(j.edits),M(null)},children:`Apply reviewed change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:pz,onClick:()=>M(null),children:`Cancel`})]})]}):(0,Z.jsx)(`p`,{"data-testid":`source.unavailable`,className:`text-muted-foreground mt-2 text-xs`,children:vz({busy:n!==null||b||o,file:F?N.fileName:null,project:I.status,resolved:z!==null})}),V!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.edit-error`,className:`text-status-error mt-2 text-xs`,children:V}),(0,Z.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Z.jsx)(`button`,{type:`button`,className:pz,onClick:c,children:`Open source`}),p&&(0,Z.jsx)(`button`,{type:`button`,className:pz,onClick:()=>l(m),children:`Ask agent`})]})]})}function xz(){let{undo:e,redo:t,error:n,editable:r}=G(iL(e=>({undo:e.undoHistory.length,redo:e.redoHistory.length,error:e.sourceEditError,editable:e.sourceEditable}))),i=G(e=>e.actions);return(0,Z.jsxs)(`div`,{className:`border-border border-b px-3 py-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(`button`,{"data-testid":`source.undo`,type:`button`,className:pz,disabled:!r||e===0,onClick:i.undo,children:`Undo`}),(0,Z.jsx)(`button`,{"data-testid":`source.redo`,type:`button`,className:pz,disabled:!r||t===0,onClick:i.redo,children:`Redo`})]}),n!==null&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-status-error mt-1 text-xs`,children:n})]})}function Sz(){let e=G(e=>e.doc),t=G(e=>e.pendingAuthoredSource),n=G(e=>e.sourceEditable),{applySourceEdit:r,openSource:i}=G(e=>e.actions),[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(!1);if(e?.channel!==`email`)return null;let l=ew(e.origin.authoredSource).find(t=>t.name===e.fixture);return(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsxs)(cz,{children:[`Fixture data · `,e.fixture]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Example input for this fixture. Changes do not replace template bindings or change other fixtures.`}),l===void 0?(0,Z.jsx)(`button`,{type:`button`,className:pz,onClick:i,children:`Open fixture source`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`textarea`,{"aria-label":`Fixture data source`,"data-testid":`source.fixture-data`,className:fz,value:a??l.source,onChange:e=>{o(e.target.value),c(!1)},disabled:!n||t!==null}),(0,Z.jsx)(`button`,{"data-testid":`source.fixture-review`,type:`button`,className:pz,disabled:!n||t!==null||a===null,onClick:()=>c(!0),children:`Review fixture change`}),s&&a!==null&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`pre`,{className:`bg-muted overflow-auto p-2 text-xs`,children:`- ${l.source}\n+ ${a}`}),(0,Z.jsx)(`button`,{"data-testid":`source.fixture-apply`,type:`button`,className:pz,onClick:()=>{r({revision:e.rev,source:e.origin.authoredSource,edits:[{start:l.start,end:l.end,before:l.source,after:a}]}),o(null),c(!1)},children:`Apply fixture change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:pz,onClick:()=>{o(null),c(!1)},children:`Cancel`})]})]})]})}function Cz({selection:e}){let t=G(e=>`${e.doc?.rev}:${e.doc?.origin.authoredSource}:${e.doc?.channel===`email`?e.doc.fixture:``}`);return(0,Z.jsx)(bz,{selection:e},t)}function wz(){let e=G(e=>`${e.doc?.rev}:${e.doc?.origin.authoredSource}:${e.doc?.channel===`email`?e.doc.fixture:``}`);return(0,Z.jsx)(Sz,{},e)}var Tz=[],Ez=[],Dz=[];function Oz({label:e,title:t,children:n}){return(0,Z.jsxs)(`div`,{title:t,className:`mt-1.5 flex items-center justify-between gap-2 first:mt-0`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:e}),n]})}function kz(){let e=G(e=>e.doc?.variables??Ez);return e.length===0?null:(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(cz,{children:`Variables`}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,Z.jsx)(sz,{name:e.name,className:`shrink-0`}),(0,Z.jsx)(`span`,{className:`text-placeholder ml-auto text-[11px]`,children:e.required?`required`:`optional`})]},e.name))}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2.5 text-[11.5px]`,children:`The canvas shows the values of the fixture selected in the toolbar.`})]})}function Az(){let e=G(e=>e.checks),t=G(e=>e.sourceEditable);return(0,Z.jsx)(`div`,{className:`py-3`,children:(0,Z.jsx)(GR,{checks:e,editable:t})})}function jz(){let{deviceWidth:e,entryFile:t,fixture:n,fixtures:r}=G(iL(e=>({deviceWidth:Pw[e.previewDevice],entryFile:e.doc?.origin.file??null,fixture:e.doc?.channel===`email`?e.doc.fixture:null,fixtures:e.doc?.channel===`email`?e.doc.fixtures:Tz})));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(cz,{children:`Document`}),(0,Z.jsx)(Oz,{label:`Width`,children:(0,Z.jsxs)(dz,{children:[e,` `,(0,Z.jsx)(`span`,{className:`text-placeholder text-[10.5px]`,children:`px`})]})}),t!==null&&(0,Z.jsx)(Oz,{label:`Entry`,children:(0,Z.jsx)(dz,{children:t})}),n!==null&&(0,Z.jsx)(Oz,{label:`Fixture`,title:`${r.length} declared`,children:(0,Z.jsx)(dz,{children:n})})]}),(0,Z.jsx)(wz,{},`${n}:${t}`),(0,Z.jsx)(kz,{}),(0,Z.jsx)(Az,{})]})}function Mz({value:e,onChange:t,onCommit:n,placeholder:r,type:i=`text`,testId:a}){return(0,Z.jsx)(`input`,{type:i,value:e,placeholder:r,"data-testid":a,spellCheck:!1,onChange:e=>t(e.target.value),onBlur:n,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},className:dL(`border-border bg-background text-foreground placeholder:text-placeholder h-7 max-w-none min-w-0 flex-1 rounded-[5px] border px-2.5 text-xs outline-none`,fL)})}function Nz(){let e=G(e=>e.doc),t=G(e=>e.metadataError),{saveMetadata:n}=G(e=>e.actions),r=e?.metadata.fromDefault,[i,a]=(0,T.useState)(r?.name??``),[o,s]=(0,T.useState)(r?.email??``),[c,l]=(0,T.useState)((e?.metadata.replyToDefault??[]).join(`, `)),u=()=>{let e=o.trim();n({fromDefault:e.length===0?null:{email:e,name:i.trim()||void 0}})};return(0,Z.jsxs)(`div`,{className:`py-3`,children:[(0,Z.jsx)(cz,{children:`Defaults · per send`}),(0,Z.jsx)(Oz,{label:`From name`,children:(0,Z.jsx)(Mz,{value:i,onChange:a,onCommit:u,placeholder:`Sender name`})}),(0,Z.jsx)(Oz,{label:`From email`,children:(0,Z.jsx)(Mz,{type:`email`,value:o,onChange:s,onCommit:u,placeholder:`you@domain.com`,testId:`inspector.envelope.from-email`})}),(0,Z.jsx)(Oz,{label:`Reply-To`,children:(0,Z.jsx)(Mz,{type:`email`,value:c,onChange:l,onCommit:()=>{let e=c.split(`,`).map(e=>e.trim()).filter(e=>e.length>0);n({replyToDefault:e.length===0?null:e})},placeholder:`Comma-separated`})}),t!==null&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-status-error mt-2 text-[11.5px]`,children:t})]})}function Pz(){let e=G(e=>e.metadataEditable),t=G(e=>e.render);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`border-border-subtle text-muted-foreground border-b py-2.5 text-[11px] leading-relaxed`,children:`Subject and preview text come from the template code and the fixture on screen. From / Reply-To are template defaults, overridden per send.`}),(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(cz,{children:`Rendered`}),(0,Z.jsx)(Oz,{label:`Subject`,children:(0,Z.jsx)(dz,{children:t?.subject??`No subject`})}),(0,Z.jsx)(Oz,{label:`Preview`,children:(0,Z.jsx)(dz,{children:t?.preheader??`No preview text`})})]}),e?(0,Z.jsx)(Nz,{}):(0,Z.jsx)(`p`,{className:`text-muted-foreground py-3 text-xs`,children:`This host does not edit sender defaults.`})]})}function Fz({selection:e}){let t=G(e=>e.render?.selections??Dz),{select:n}=G(e=>e.actions),r=e.origins[0],i=e.origins.slice(1),a=Pg(t,e),o=Fg(t,e);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(cz,{children:`Element`}),(0,Z.jsx)(Oz,{label:`Tag`,children:(0,Z.jsx)(dz,{testId:`inspector.element.tag`,children:e.tag})}),(0,Z.jsx)(Oz,{label:`Source`,title:e.authored?`This element was written in the template.`:`A compiler primitive produced this element; the authoring below is the call that asked for it.`,children:(0,Z.jsx)(dz,{testId:`inspector.element.provenance`,children:e.authored?`Authored`:`Generated`})}),(0,Z.jsx)(Oz,{label:`Instance`,children:(0,Z.jsx)(dz,{testId:`inspector.element.instance`,children:e.instancePath})})]}),(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(cz,{children:`Authoring`}),r===void 0?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:`The renderer produced this element with no authoring on the stack, so nothing in the template points at it.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Oz,{label:`Written at`,children:(0,Z.jsx)(dz,{testId:`inspector.authoring.origin`,children:rw(r)})}),(0,Z.jsx)(`p`,{"data-testid":`inspector.authoring.occurrence`,className:`text-muted-foreground mt-2 text-[11.5px]`,children:e.occurrences>1?`This authoring renders ${e.occurrences} elements here; this is number ${e.occurrence}.`:`This authoring renders one element here.`}),o.length>a.length&&(0,Z.jsxs)(`p`,{"data-testid":`inspector.authoring.definition-scope`,className:`text-muted-foreground mt-1 text-[11.5px]`,children:[o.length,` elements across the whole render come from it, through more than one call site.`]})]})]}),(0,Z.jsx)(Cz,{selection:e},`${e.instancePath}:${e.start}:${e.end}`),i.length>0&&(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(cz,{children:`Call sites`}),(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1.5 p-0`,children:i.map((e,t)=>(0,Z.jsx)(`li`,{"data-testid":`inspector.call-site.${t}`,className:`text-foreground font-mono text-[11.5px] break-all`,children:rw(e)},`${rw(e)}:${t}`))}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-[11.5px]`,children:`Innermost call first.`})]}),a.length>1&&(0,Z.jsxs)(`div`,{className:`py-3`,children:[(0,Z.jsx)(cz,{children:`Iterations`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.map((t,r)=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`inspector.iteration.${t.instancePath}`,onClick:()=>n(t.instancePath),className:dL(`hover:bg-muted w-full rounded px-1.5 py-1 text-left font-mono text-[11.5px]`,t.instancePath===e.instancePath&&`bg-sel-soft text-accent-email`),children:[r+1,`. `,t.instancePath]})},t.instancePath))})]})]})}function Iz({embedded:e=!1}={}){let t=yL(),n=WR(),{outline:r,selection:i,rightCollapsed:a,rightWidth:o,layoutMode:s}=G(iL(e=>({outline:e.outline,selection:e.selection,rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth,layoutMode:e.layoutMode}))),{select:c,selectDocument:l,breadcrumbOf:u,toggleRight:d}=G(e=>e.actions),f=i.kind===`element`?r?.index.get(i.instancePath)??null:null,p=i.kind===`envelope`?`envelope`:f===null?`document`:`element`,m=f===null?[]:u(f.instancePath),h=!e&&(s===`compact`||s===`narrow`);return(0,Z.jsx)(`aside`,{"aria-label":`Inspector`,"data-testid":`inspector`,"aria-hidden":!e&&a?!0:void 0,inert:!e&&a?!0:void 0,"data-editor-rail":`right`,style:{width:e?`100%`:a?0:o,maxWidth:h?`calc(100% - 48px)`:void 0},className:dL(`flex h-full shrink-0 flex-col overflow-hidden bg-background transition-[width,transform,box-shadow] duration-180 ease-out`,!e&&`border-l border-border`,h&&`absolute inset-y-0 right-0 z-40 shadow-[var(--shadow-floating)]`,!e&&a&&`border-l-0`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:e?`100%`:o,maxWidth:`100%`},children:[!e&&t&&(0,Z.jsx)(oz,{}),(0,Z.jsx)(`div`,{className:`border-border bg-background/95 sticky top-0 z-10 border-b backdrop-blur-md`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-10 items-center gap-2 px-3 py-2`,children:[(0,Z.jsx)(`div`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center gap-0.5 overflow-hidden text-xs`,children:p===`document`?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:`Document`}):p===`envelope`?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:`Envelope`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,onClick:l,"data-testid":`inspector.document`,className:`hover:bg-muted hover:text-foreground shrink-0 rounded px-1`,children:`Email`}),m.map((e,t)=>(0,Z.jsxs)(`span`,{className:`contents`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder`,children:`/`}),t===m.length-1?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:e.label}):(0,Z.jsx)(`button`,{type:`button`,onClick:()=>c(e.instancePath),className:`hover:bg-muted hover:text-foreground max-w-[72px] truncate rounded px-1`,children:e.label})]},e.instancePath))]})}),f!==null&&(0,Z.jsx)(`span`,{"data-testid":`inspector.selection-badge`,className:`bg-muted text-muted-foreground shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase`,children:f.authored?iw(f):`${f.tag} · generated`}),!e&&(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Collapse inspector`,"data-testid":`inspector.collapse`,onClick:d,className:`text-muted-foreground hover:bg-muted hover:text-foreground shrink-0 rounded-md p-1.5`}),children:(0,Z.jsx)(_e,{className:`size-[15px]`})}),(0,Z.jsx)(gN,{container:n,children:(0,Z.jsx)(zN,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Collapse inspector`})})})]})]})}),(0,Z.jsxs)(YL,{"data-samva-scroll-area":`inspector`,className:`relative min-h-0 flex-1`,children:[(0,Z.jsx)(sR,{className:`size-full`,children:(0,Z.jsxs)(`div`,{className:`samva-inspector-content pb-4`,children:[p===`document`&&(0,Z.jsx)(jz,{}),p===`envelope`&&(0,Z.jsx)(Pz,{}),f!==null&&(0,Z.jsx)(Fz,{selection:f})]})}),(0,Z.jsx)(pR,{orientation:`vertical`,className:`absolute top-0 right-0 bottom-0 flex w-2.5 touch-none p-0.5 select-none`,children:(0,Z.jsx)(mR,{className:`relative flex-1 rounded-full bg-[var(--editor-scrollbar-thumb)] hover:bg-[var(--editor-scrollbar-thumb-hover)]`})})]})]})})}function Lz({embedded:e=!1}={}){let t=WR(),{checks:n,doc:r,readonlyReason:i,rightCollapsed:a,rightWidth:o}=G(iL(e=>({checks:e.checks,doc:e.doc,readonlyReason:e.readonlyReason,rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth}))),{toggleRight:s}=G(e=>e.actions);return!e&&a?null:(0,Z.jsxs)(`aside`,{"data-editor-rail":`right`,style:{width:e?`100%`:o},className:e?`bg-background flex h-full shrink-0 flex-col overflow-hidden`:`border-border bg-background flex h-full shrink-0 flex-col overflow-hidden border-l`,children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex h-11 items-center border-b px-3`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Template details`}),!e&&(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Collapse inspector`,onClick:s,className:`text-muted-foreground hover:bg-muted hover:text-foreground ml-auto rounded-md p-1.5`}),children:(0,Z.jsx)(_e,{className:`size-[15px]`})}),(0,Z.jsx)(gN,{container:t,children:(0,Z.jsx)(zN,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Collapse inspector`})})})]})]}),(0,Z.jsxs)(`div`,{className:`samva-editor-scroll min-h-0 flex-1 overflow-y-auto p-4 text-[12.5px]`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Read-only`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:i}),r!==null&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-3 font-mono text-[11.5px] break-all`,children:r.origin.file}),(0,Z.jsx)(`div`,{className:`border-border-subtle mt-5 border-t pt-4`,children:(0,Z.jsx)(GR,{checks:n})})]})]})}function Rz({readOnly:e=!1}){let t=vL(),n=G(e=>e.rightMode);return t!==null&&n===`agent`?(0,Z.jsx)(AL,{children:t}):e?(0,Z.jsx)(Lz,{}):(0,Z.jsx)(Iz,{})}function zz(){let e=vL(),t=G(e=>e.rightMode);return e===null||t!==`agent`?null:(0,Z.jsx)(AL,{children:e})}var Bz=[{value:`transactional`,label:`Transactional`},{value:`promotional`,label:`Promotional`},{value:`service_implicit`,label:`Service (implicit opt-in)`}],Vz=[{value:`marketing`,label:`Marketing`},{value:`utility`,label:`Utility`},{value:`authentication`,label:`Authentication`}],Hz=[{value:`text`,label:`Text`},{value:`image`,label:`Image`},{value:`video`,label:`Video`},{value:`document`,label:`Document`}],Uz=[{value:`quick-reply`,label:`Quick reply`},{value:`url`,label:`URL`},{value:`phone`,label:`Phone number`},{value:`copy-code`,label:`Copy code`}];function Wz({label:e,source:t,editable:n,onChange:r,testId:i}){return(0,Z.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground border-b px-4 py-2 font-mono text-[11px] font-medium`,children:e}),(0,Z.jsx)(`textarea`,{"aria-label":e,"data-testid":i,readOnly:!n,spellCheck:!1,value:t,onChange:e=>r?.(e.target.value),className:dL(oL,`samva-editor-scroll text-foreground min-h-0 flex-1 resize-none border-t-0 p-4 font-mono text-[12.5px] leading-5 outline-none`,`read-only:bg-muted read-only:shadow-none dark:read-only:bg-muted/40 dark:read-only:shadow-none`)})]})}function Gz(){let e=G(e=>e.doc),t=G(e=>e.sourceEditable),{replaceAuthoredSource:n}=G(e=>e.actions);return e===null?(0,Z.jsx)(`div`,{className:`text-muted-foreground grid flex-1 place-items-center text-sm`,children:`Loading…`}):(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:(0,Z.jsx)(Wz,{label:`Authored TSX · ${e.origin.file}`,source:e.origin.authoredSource,editable:t,testId:`source-workspace.authored-tsx`,onChange:t?n:void 0})})}function Kz(e){let t=Lm(),{applySourceEdit:n}=G(e=>e.actions);return(0,T.useCallback)((r,i)=>{let{doc:a}=t.getState();if(a===null)return;let o=a.origin.authoredSource,s=e(o,r);if(!s.ok){t.setState({sourceEditError:s.reason});return}s.edits.length!==0&&n({revision:a.rev,source:o,edits:s.edits,coalesceKey:i})},[n,e,t])}var qz=new Set([`[`,`]`,`{`,`}`,`\\`,`~`,`|`,`€`,`^`,`\f`]),Jz=/^[@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !"#¤%&'()*+,\-./:;<=>?¡0-9ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà]*$/,Yz=e=>{for(let t of e)if(!qz.has(t)&&!Jz.test(t))return!0;return!1},Xz=e=>{if(Yz(e)){let t=[...e].length,n=t<=70?1:Math.ceil(t/67);return{encoding:`ucs2`,characterCount:e.length,segmentCount:n}}let t=0;for(let n of e)t+=qz.has(n)?2:1;let n=t<=160?1:Math.ceil(t/153);return{encoding:`gsm7`,characterCount:e.length,segmentCount:n}};function Zz(e,t){return`${e}-view-tab-${t}`}var Qz=dL(mL,`h-7 px-2.5 text-[12px] capitalize`);function $z({value:e,onChange:t,children:n,panelId:r,idBase:i}){let a=(0,T.useId)(),o=i??a,s=`${o}-view-panel`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(iz,{role:`tablist`,"aria-label":`Workspace view`,value:[e],onValueChange:e=>{let n=e[0];(n===`visual`||n===`source`)&&t(n)},className:`border-border bg-background flex h-10 shrink-0 items-center gap-1 border-b px-3`,children:[`visual`,`source`].map(t=>(0,Z.jsx)(ZR,{id:Zz(o,t),type:`button`,role:`tab`,"aria-selected":e===t,"aria-controls":r??s,"aria-pressed":void 0,value:t,"data-testid":`workspace.tab.${t}`,className:Qz,children:t},t))}),r===void 0&&(0,Z.jsx)(`div`,{role:`tabpanel`,id:s,"aria-labelledby":Zz(o,e),className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:n})]})}function eB({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-foreground font-medium`,children:e}),t]})}function tB({summary:e}){return(0,Z.jsxs)(`div`,{className:`border-border bg-surface-inset rounded-lg border border-dashed px-3 py-2`,children:[(0,Z.jsx)(`p`,{className:`text-foreground truncate font-mono text-[11.5px]`,children:e}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-[11px]`,children:`Locked structure. Preserved as is. Edit it in Source.`})]})}function nB({summary:e}){return(0,Z.jsx)(`span`,{title:`Locked expression. Edit it in Source.`,"data-testid":`channel-workspace.locked-chip`,className:`border-border bg-surface-inset text-muted-foreground inline-flex max-w-full shrink-0 truncate rounded-md border border-dashed px-1.5 py-0.5 font-mono text-[11.5px]`,children:e})}function rB({diagnostics:e}){return e.length===0?null:(0,Z.jsx)(`ul`,{className:`grid gap-2`,children:e.map((e,t)=>(0,Z.jsx)(`li`,{className:`border-status-error/30 bg-status-error/5 text-status-error rounded-lg border px-3 py-2 text-[12px]`,children:e.message},`${e.code}-${t}`))})}function iB({variables:e}){return e.length===0?null:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,Z.jsx)(`span`,{className:`border-border-subtle bg-surface-inset rounded-full border px-2 py-0.5 font-mono text-[11px]`,children:e},e))})}function aB({text:e,className:t}){let n=Xz(e);return(0,Z.jsxs)(`p`,{"data-testid":`sms-counter`,className:dL(`text-muted-foreground`,t),children:[n.encoding.toUpperCase(),` · `,n.characterCount,` character`,n.characterCount===1?``:`s`,` · `,n.segmentCount,` segment`,n.segmentCount===1?``:`s`]})}function oB({reason:e}){return e===null?null:(0,Z.jsx)(`p`,{role:`alert`,"data-testid":`channel-workspace.edit-refusal`,className:`border-status-error/30 bg-status-error/5 text-status-error rounded-lg border px-3 py-2 text-[12px]`,children:e})}var sB=`none`;function cB({segments:e,editable:t,onChange:n}){let r=(0,T.useRef)(!1);return(0,Z.jsx)(`div`,{className:`bg-muted text-foreground rounded-[18px] px-4 py-3 text-[14px] whitespace-pre-wrap`,children:e.map((e,i)=>e.kind===`locked`?(0,Z.jsx)(`span`,{contentEditable:!1,title:`Locked structure — edit in Source`,"data-testid":`sms-workspace.locked-segment`,className:`border-border bg-surface-inset text-muted-foreground mx-0.5 inline-flex rounded-md border border-dashed px-1.5 py-0.5 font-mono text-[11.5px]`,children:e.summary},`locked-${i}`):(0,Z.jsx)(`span`,{role:`textbox`,"aria-label":`SMS message preview segment ${i+1}`,"data-testid":`sms-workspace.preview-segment.${i+1}`,"aria-multiline":`true`,contentEditable:t?`plaintext-only`:!1,suppressContentEditableWarning:!0,onCompositionStart:()=>{r.current=!0},onCompositionEnd:e=>{r.current=!1,n(i,e.currentTarget.textContent??``)},onInput:e=>{r.current||n(i,e.currentTarget.textContent??``)},className:`focus:bg-background focus-visible:ring-ring/50 rounded-sm outline-none focus-visible:ring-[3px]`,children:e.text},`text-${i}`))})}function lB({form:e,editable:t,onEdit:n}){let r=WR(),i=e.category.kind===`literal`?e.category.value:void 0;return(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(eB,{label:`Category`,children:(0,Z.jsxs)(zP,{value:i??sB,disabled:!t||e.category.kind===`expression`,onValueChange:e=>n({kind:`category`,value:Bz.find(t=>t.value===e)?.value}),children:[(0,Z.jsx)(eF,{"data-testid":`sms-workspace.category`,className:hL,children:(0,Z.jsx)(nF,{})}),(0,Z.jsx)(rF,{container:r,children:(0,Z.jsx)(MF,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsxs)($F,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:[(0,Z.jsx)(uI,{value:sB,"data-testid":`sms-workspace.category-option.none`,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(dI,{children:`Not set`})}),Bz.map(e=>(0,Z.jsx)(uI,{value:e.value,"data-testid":`sms-workspace.category-option.${e.value}`,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(dI,{children:e.label})},e.value))]})})})]})}),(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Message body`}),e.segments.map((e,r)=>e.kind===`locked`?(0,Z.jsx)(tB,{summary:e.summary},`locked-${r}`):(0,Z.jsx)(`textarea`,{"aria-label":`Message body segment ${r+1}`,"data-testid":`sms-workspace.body-segment.${r+1}`,value:e.text,disabled:!t,onChange:e=>n({kind:`text`,segment:r,text:e.target.value},`sms-${r}`),rows:5,className:`${hL} resize-y py-2`},`text-${r}`))]}),(0,Z.jsx)(iB,{variables:e.variables})]})}function uB(){let e=G(e=>e.doc),t=G(e=>e.sourceEditable),n=G(e=>e.sourceEditError),[r,i]=(0,T.useState)(`visual`),a=Kz(HI),o=e?.origin.authoredSource??``,s=(0,T.useMemo)(()=>VI(o),[o]),c=e?.channel===`sms`?e.render:null;return(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsx)($z,{value:r,onChange:i,children:r===`source`?(0,Z.jsx)(Gz,{}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsx)(`aside`,{className:`samva-editor-scroll border-border bg-background w-[380px] shrink-0 overflow-y-auto border-r p-4`,children:(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(rB,{diagnostics:e?.diagnostics??[]}),(0,Z.jsx)(oB,{reason:n}),s===null?(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-[12.5px]`,children:[`The SMS body is not a `,(0,Z.jsx)(`code`,{children:`<Sms>`}),` written in place, so it is edited in Source.`]}):(0,Z.jsx)(lB,{form:s,editable:t,onEdit:a})]})}),(0,Z.jsx)(`main`,{className:`samva-editor-workspace samva-editor-scroll min-w-0 flex-1 overflow-auto p-8`,children:(0,Z.jsxs)(`div`,{className:`border-border bg-background mx-auto max-w-[420px] rounded-[28px] border p-5 shadow-[var(--shadow-lg)]`,children:[(0,Z.jsx)(`div`,{"data-testid":`sms-workspace.preview-heading`,className:`border-border-subtle text-muted-foreground mb-5 border-b pb-3 text-center text-[12px] font-medium`,children:`SMS preview`}),s===null?(0,Z.jsx)(`div`,{className:`bg-muted text-muted-foreground rounded-[18px] px-4 py-3 text-[14px] whitespace-pre-wrap`,children:c?.text||`Message preview`}):(0,Z.jsx)(cB,{segments:s.segments,editable:t,onChange:(e,t)=>a({kind:`text`,segment:e,text:t},`sms-${e}`)}),c!==null&&(0,Z.jsx)(aB,{text:c.text,className:`mt-4 text-center text-[11.5px]`})]})}),(0,Z.jsx)(zz,{})]})})})}var dB=[{kind:`text`,text:``,start:0,end:0}],fB=e=>e.kind===`literal`?e.value:e.kind===`expression`?e.source:``;function pB({value:e,options:t,disabled:n,ariaLabel:r,onChange:i}){let a=WR();return(0,Z.jsxs)(zP,{value:e,disabled:n,onValueChange:e=>{let n=t.find(t=>t.value===e);n!==void 0&&i(n.value)},children:[(0,Z.jsx)(eF,{"aria-label":r,className:hL,children:(0,Z.jsx)(nF,{})}),(0,Z.jsx)(rF,{container:a,children:(0,Z.jsx)(MF,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsx)($F,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:t.map(e=>(0,Z.jsx)(uI,{value:e.value,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(dI,{children:e.label})},e.value))})})})]})}function mB({label:e,part:t,segments:n,editable:r,onEdit:i}){let a=n??dB,o=`whatsapp-workspace.slot.${e.toLowerCase()}`;return(0,Z.jsxs)(`div`,{className:`grid gap-1.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-foreground font-medium`,children:e}),(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:a.map((n,a)=>n.kind===`locked`?(0,Z.jsx)(nB,{summary:n.summary},`locked-${a}`):(0,Z.jsx)(`input`,{"aria-label":a===0?e:`${e} ${a+1}`,value:n.text,disabled:!r,"data-testid":a===0?o:`${o}.${a+1}`,onChange:e=>i({kind:`text`,part:t,segment:a,text:e.target.value},`whatsapp-${t}-${a}`),className:`${hL} min-w-[8ch] flex-1`},`text-${a}`))})]})}function hB({ariaLabel:e,state:t,editable:n,onChange:r,testId:i}){return(0,Z.jsx)(`input`,{"aria-label":e,"data-testid":i,value:fB(t),disabled:!n||t.kind===`expression`,title:t.kind===`expression`?`Read from the input. Edit it in Source.`:void 0,onChange:e=>r(e.target.value),className:hL})}function gB({buttons:e,editable:t,onEdit:n}){let[r,i]=(0,T.useState)(`quick-reply`);return(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Buttons`}),e.map((e,r)=>e.kind===`locked`?(0,Z.jsx)(tB,{summary:e.summary},`locked-${r}`):(0,Z.jsxs)(`div`,{className:`border-border grid gap-2 rounded-lg border p-3`,children:[(0,Z.jsx)(pB,{value:e.type,options:Uz,disabled:!t,ariaLabel:`Button ${r+1} type`,onChange:e=>n({kind:`buttonType`,button:r,type:e})}),(0,Z.jsx)(`input`,{"aria-label":`Button ${r+1} label`,value:e.text,disabled:!t,onChange:e=>n({kind:`buttonText`,button:r,text:e.target.value},`whatsapp-button-${r}-text`),className:hL}),e.type===`url`&&(0,Z.jsx)(hB,{ariaLabel:`Button ${r+1} URL`,state:e.url,editable:t,onChange:e=>n({kind:`buttonAttribute`,button:r,name:`url`,value:e},`whatsapp-button-${r}-url`)}),e.type===`phone`&&(0,Z.jsx)(hB,{ariaLabel:`Button ${r+1} phone`,state:e.phone,editable:t,onChange:e=>n({kind:`buttonAttribute`,button:r,name:`phone`,value:e},`whatsapp-button-${r}-phone`)}),t&&(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove button ${r+1}`,onClick:()=>n({kind:`buttonRemove`,button:r}),className:`text-muted-foreground hover:text-status-error justify-self-end text-[11.5px]`,children:`Remove`})]},`button-${r}`)),t&&(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(pB,{value:r,options:Uz,disabled:!1,ariaLabel:`New button type`,onChange:i}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`whatsapp-workspace.add-button`,onClick:()=>n({kind:`buttonAdd`,type:r}),className:`border-border hover:bg-muted shrink-0 rounded-lg border px-3 text-[12px]`,children:`Add`})]})]})}function _B({form:e,editable:t,onEdit:n}){let r=fB(e.category),i=e.headerType.kind===`literal`?e.headerType.value:`text`;return(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(eB,{label:`Template name`,children:(0,Z.jsx)(hB,{ariaLabel:`Template name`,testId:`whatsapp-workspace.name`,state:e.name,editable:t,onChange:e=>n({kind:`attribute`,name:`name`,value:e},`whatsapp-name`)})}),(0,Z.jsx)(eB,{label:`Language`,children:(0,Z.jsx)(hB,{ariaLabel:`Language`,state:e.language,editable:t,onChange:e=>n({kind:`attribute`,name:`language`,value:e},`whatsapp-language`)})}),(0,Z.jsx)(eB,{label:`Category`,children:(0,Z.jsx)(pB,{value:r,options:Vz,disabled:!t||e.category.kind!==`literal`,onChange:e=>n({kind:`attribute`,name:`category`,value:e})})}),(0,Z.jsx)(eB,{label:`Header type`,children:(0,Z.jsx)(pB,{value:i,options:Hz,disabled:!t||e.header===null||e.headerType.kind===`expression`,onChange:e=>n({kind:`headerType`,value:e})})}),(0,Z.jsx)(mB,{label:`Header`,part:`header`,segments:e.header,editable:t,onEdit:n}),(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Body`}),e.body.map((e,r)=>e.kind===`locked`?(0,Z.jsx)(tB,{summary:e.summary},`body-locked-${r}`):(0,Z.jsx)(`textarea`,{"aria-label":`Body segment ${r+1}`,"data-testid":`whatsapp-workspace.body.${r+1}`,value:e.text,disabled:!t,onChange:e=>n({kind:`text`,part:`body`,segment:r,text:e.target.value},`whatsapp-body-${r}`),rows:4,className:`${hL} resize-y py-2`},`body-text-${r}`))]}),(0,Z.jsx)(mB,{label:`Footer`,part:`footer`,segments:e.footer,editable:t,onEdit:n}),(0,Z.jsx)(gB,{buttons:e.buttons,editable:t,onEdit:n}),(0,Z.jsx)(iB,{variables:e.variables})]})}function vB({label:e,part:t,segments:n,editable:r,placeholder:i,className:a,onEdit:o}){return(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:(n??dB).map((n,s)=>n.kind===`locked`?(0,Z.jsx)(nB,{summary:n.summary},`locked-${s}`):(0,Z.jsx)(`input`,{"aria-label":s===0?`${e} preview`:`${e} preview ${s+1}`,"data-testid":s===0?`whatsapp-workspace.preview.${e.toLowerCase()}`:`whatsapp-workspace.preview.${e.toLowerCase()}.${s+1}`,value:n.text,readOnly:!r,placeholder:i,onChange:e=>o({kind:`text`,part:t,segment:s,text:e.target.value},`whatsapp-${t}-${s}`),className:`placeholder:text-muted-foreground/60 min-w-0 flex-1 bg-transparent outline-none ${a} ${r?`focus-visible:ring-ring/50 rounded-sm focus-visible:ring-2`:`cursor-default`}`},`text-${s}`))})}var yB=e=>e.type===`copy-code`?`Copy code`:e.text;function bB({form:e,editable:t,render:n,onEdit:r}){let i=e.headerType.kind===`literal`?e.headerType.value:`text`;return(0,Z.jsxs)(`div`,{className:`border-border mx-auto max-w-[420px] rounded-[28px] border bg-[#e9e2d8] p-5 shadow-[var(--shadow-lg)] dark:bg-[#0b141a]`,children:[(0,Z.jsx)(`div`,{"data-testid":`whatsapp-workspace.preview-heading`,className:`text-muted-foreground mb-4 text-center text-[12px] font-medium`,children:`WhatsApp business preview`}),(0,Z.jsxs)(`div`,{className:`bg-background rounded-xl px-3.5 py-3 shadow-[var(--shadow-sm)]`,children:[(0,Z.jsx)(vB,{label:`Header`,part:`header`,segments:e.header,editable:t&&i===`text`,placeholder:i===`text`?`Add header`:`${i} header`,className:`mb-1 font-semibold`,onEdit:r}),(0,Z.jsx)(`div`,{className:`grid gap-1`,children:e.body.map((e,n)=>e.kind===`locked`?(0,Z.jsx)(nB,{summary:e.summary},`body-locked-${n}`):(0,Z.jsx)(`textarea`,{"aria-label":`Body preview segment ${n+1}`,"data-testid":`whatsapp-workspace.body-preview.${n+1}`,value:e.text,readOnly:!t,placeholder:`Write your message`,rows:Math.max(1,e.text.split(`
27
- `).length),onChange:e=>r({kind:`text`,part:`body`,segment:n,text:e.target.value},`whatsapp-body-${n}`),className:`placeholder:text-muted-foreground/60 min-h-5 w-full resize-none overflow-hidden bg-transparent text-[14px] whitespace-pre-wrap outline-none ${t?`focus-visible:ring-ring/50 rounded-sm focus-visible:ring-2`:`cursor-default`}`},`body-text-${n}`))}),(0,Z.jsx)(vB,{label:`Footer`,part:`footer`,segments:e.footer,editable:t,placeholder:`Add footer`,className:`text-muted-foreground mt-2 text-[11.5px]`,onEdit:r}),(n?.buttons??[]).map((e,t)=>(0,Z.jsx)(`div`,{className:`border-border-subtle text-accent-email mt-2 border-t pt-2 text-center text-[12px]`,children:yB(e)},`${yB(e)}-${t}`))]}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-4 text-center text-[11.5px] capitalize`,children:[n?.category??(fB(e.category)||`utility`),` template`]})]})}function xB(){let e=G(e=>e.doc),t=G(e=>e.sourceEditable),n=G(e=>e.sourceEditError),[r,i]=(0,T.useState)(`visual`),a=Kz(QI),o=e?.origin.authoredSource??``,s=(0,T.useMemo)(()=>JI(o),[o]),c=e?.channel===`whatsapp`?e.render:null;return(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsx)($z,{value:r,onChange:i,children:r===`source`?(0,Z.jsx)(Gz,{}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsx)(`aside`,{className:`samva-editor-scroll border-border bg-background w-[400px] shrink-0 overflow-y-auto border-r p-4`,children:(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(rB,{diagnostics:e?.diagnostics??[]}),(0,Z.jsx)(oB,{reason:n}),s===null?(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-[12.5px]`,children:[`The WhatsApp body is not a `,(0,Z.jsx)(`code`,{children:`<WhatsApp>`}),` written in place with a body, so it is edited in Source.`]}):(0,Z.jsx)(_B,{form:s,editable:t,onEdit:a})]})}),(0,Z.jsx)(`main`,{className:`samva-editor-workspace samva-editor-scroll min-w-0 flex-1 overflow-auto p-8`,children:s!==null&&(0,Z.jsx)(bB,{form:s,editable:t,render:c,onEdit:a})}),(0,Z.jsx)(zz,{})]})})})}var SB=e=>({top:e.top,left:e.left,width:e.width,height:e.height}),CB=(e,t)=>{let n=e.querySelectorAll(`[${Ag}="${CSS.escape(t)}"]`),r=null;for(let e of n){let t=SB(e.getBoundingClientRect());if(r??=t,t.width>0&&t.height>0)return t}return r},wB=`a[href],button,input[type="button"],input[type="submit"],input[type="image"]`,TB=e=>e!==null&&`closest`in e&&typeof e.closest==`function`,EB=e=>TB(e)&&e.closest(wB)!==null,DB=e=>TB(e)?e.closest(`[data-samva-instance]`)?.getAttribute(`data-samva-instance`)??null:null,OB=`html,body{margin:0;padding:0;overflow:hidden}`,kB={"--editor-canvas-hover":`#93c5fd`,"--editor-canvas-selected":`#2563eb`,"--editor-canvas-selected-fg":`#fff`,"--editor-canvas-generated":`#a855f7`},AB=e=>`:root{${Object.entries(kB).map(([t,n])=>`${t}:${e[t]?.trim()||n}`).join(`;`)}}`,jB=e=>{let t=e.parentElement;if(t===null)return{};let n=document.createElement(`span`);n.hidden=!0,t.appendChild(n);let r=Object.fromEntries(Object.keys(kB).map(e=>(n.style.color=`var(${e})`,[e,getComputedStyle(n).color])));return n.remove(),r},MB=/@media\s*\(\s*prefers-color-scheme:\s*dark\s*\)/g,NB=(e,t)=>e.replace(MB,t===`dark`?`@media all`:`@media not all`),PB=e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.button!==0,FB=e=>{let t=e.contentDocument;if(t===null)return null;let n=t.body.getBoundingClientRect(),r=Math.max(n.height,t.body.offsetHeight),i=Math.ceil(r>0?r:Math.max(t.body.scrollHeight,t.documentElement.scrollHeight));return e.style.height=`${i}px`,i},IB=({document_:e,width:t,dark:n,overlay:r,onSelect:i,onHover:a,onContextMenu:o})=>{let s=(0,T.useRef)(null),[c,l]=(0,T.useState)(null),u=(0,T.useRef)({onSelect:i,onHover:a,onContextMenu:o});return(0,T.useLayoutEffect)(()=>{u.current={onSelect:i,onHover:a,onContextMenu:o}},[i,a,o]),(0,T.useLayoutEffect)(()=>{let t=s.current;if(t===null)return;let n=null,r=()=>{n===null&&(n=requestAnimationFrame(()=>{n=null,FB(t)}))},i=new ResizeObserver(r),a=new MutationObserver(r),o=()=>{let e=t.contentDocument;if(e===null)return;let n=e.head.querySelector(`style[data-samva-editor-chrome]`);n===null&&(n=e.createElement(`style`),n.dataset.samvaEditorChrome=``,e.head.appendChild(n)),n.textContent=`${OB}${AB(jB(t))}`},c=()=>{let n=t.contentDocument;n!==null&&(n.open(),n.write(e),n.close(),o(),l(n.body),i.disconnect(),i.observe(n.body),a.disconnect(),a.observe(n.body,{childList:!0,subtree:!0}),FB(t))},d=e=>{!PB(e)&&EB(e.target)&&e.preventDefault(),u.current.onSelect?.(DB(e.target))},f=e=>u.current.onHover?.(DB(e.target)),p=()=>u.current.onHover?.(null),m=e=>{let n=u.current.onContextMenu;if(n===void 0)return;e.preventDefault();let r=t.getBoundingClientRect(),i=t.clientWidth===0?1:r.width/t.clientWidth,a=t.clientHeight===0?1:r.height/t.clientHeight;n({instancePath:DB(e.target),clientX:r.left+e.clientX*i,clientY:r.top+e.clientY*a})},h=()=>{let e=t.contentDocument;e!==null&&(e.addEventListener(`click`,d),e.addEventListener(`mousemove`,f),e.addEventListener(`mouseleave`,p),e.addEventListener(`contextmenu`,m))},g=()=>{let e=t.contentDocument;e!==null&&(e.removeEventListener(`click`,d),e.removeEventListener(`mousemove`,f),e.removeEventListener(`mouseleave`,p),e.removeEventListener(`contextmenu`,m))};c(),h();let _=new MutationObserver(o);return _.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{g(),i.disconnect(),a.disconnect(),_.disconnect(),n!==null&&cancelAnimationFrame(n)}},[e]),(0,Z.jsx)(`iframe`,{ref:s,"data-testid":`canvas.frame`,title:`Email canvas`,sandbox:`allow-same-origin`,style:{width:t,height:0,display:`block`,border:`none`,background:n?`#0a0a0a`:`var(--editor-canvas-document-bg, #fff)`,colorScheme:n?`dark`:`light`},children:c!==null&&r!==void 0?(0,$k.createPortal)(r,c):null})},LB=({html:e,forceColorScheme:t,...n})=>{let r=t===void 0?e:NB(e,t);return(0,Z.jsx)(IB,{document_:r,dark:t===`dark`,...n},r)},RB=(e,t,n)=>({position:`fixed`,top:e.top,left:e.left,width:e.width,height:e.height,outline:`${n}px solid ${t}`,outlineOffset:-n,pointerEvents:`none`,zIndex:2147483646}),zB=({renderRevision:e,selected:t,hovered:n})=>{let r=(0,T.useRef)(null),[i,a]=(0,T.useState)(null),[o,s]=(0,T.useState)(null),c=t?.instancePath??null,l=n?.instancePath??null;return(0,T.useLayoutEffect)(()=>{let e=r.current?.ownerDocument;e!==void 0&&(a(c===null?null:CB(e,c)),s(l===null||l===c?null:CB(e,l)))},[e,c,l]),(0,Z.jsxs)(`div`,{ref:r,"data-samva-overlay":!0,style:{position:`fixed`,inset:0,pointerEvents:`none`},children:[o===null?null:(0,Z.jsx)(`div`,{style:RB(o,`var(--editor-canvas-hover)`,1)}),i!==null&&t!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{style:RB(i,t.authored?`var(--editor-canvas-selected)`:`var(--editor-canvas-generated)`,2)}),(0,Z.jsx)(`div`,{"data-samva-chip":!0,style:{position:`fixed`,top:Math.max(0,i.top-18),left:i.left,padding:`1px 6px`,borderRadius:4,background:t.authored?`var(--editor-canvas-selected)`:`var(--editor-canvas-generated)`,color:`var(--editor-canvas-selected-fg)`,font:`11px/1.4 ui-sans-serif, system-ui, sans-serif`,pointerEvents:`none`,zIndex:2147483647},children:t.authored?iw(t):`${iw(t)} · generated`})]}):null]})};function BB(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=GN({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=Xj(a,!0,!0),u=oN(),[d,f]=T.useState(),p=d===null?void 0:d??u,m=$(e=>{let t=!a,n=gD(eD,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return T.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var VB=T.createContext(void 0);function HB(){let e=T.useContext(VB);if(e===void 0)throw Error(pT(15));return e}var UB=`data-open`,WB=`data-closed`,GB=bE,KB=`data-panel-open`,qB={[UB]:``},JB={[WB]:``},YB={open(e){return e?{[KB]:``}:null}},XB={open(e){return e?qB:JB},...wE},ZB=T.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=$(o),d=BB({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=T.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=T.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=Rk(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:XB});return(0,Z.jsx)(VB.Provider,{value:p,children:m})}),QB={...YB,...wE},$B=T.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=HB(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=JP({disabled:c,focusableWhenDisabled:!0,native:u});return Rk(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:QB})}),eV={height:void 0,width:void 0};function tV(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=T.useRef(null),f=T.useRef(null),[p,m]=T.useState(eV),h=T.useRef(eV),g=T.useRef(!1),_=T.useRef(s),v=T.useRef(!1),[y,b]=T.useState(!1),x=T.useRef(null),S=SD(t,d),C=OD(s),w=$j(d),E=!s&&!a,D=y?`idle`:u,O=s&&(_.current||v.current),k=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,A=n&&E&&f.current!==`css-animation`,j=$((e,t=!0)=>{t&&(h.current=e),m(e)}),M=$(()=>{x.current?.(),x.current=null}),N=$(e=>{M(),x.current=()=>{x.current=null,e()}}),P=$(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});Q(()=>{y&&u!==`starting`&&b(!1)},[y,u]),T.useEffect(()=>()=>{P(),M()},[P,M]),Q(()=>{let e=d.current;if(!e)return;!s&&x.current&&M();let t=rV(e,O);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=nV(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){j(nV(e)),b(!0);return}if(t===`css-transition`){let t=oV(e);if(j(nV(e)),!n)return t;let r=aV(e,`transition-duration`,`0s`);return N(r),b(!0),t}j(nV(e));let r=aV(e,`animation-name`,`none`);if(!n){r();return}let i=aV(e,`animation-duration`,`0s`);r(),N(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(_.current=!1,v.current=!1,t===`none`){j(eV,!1),c(!1);return}j(nV(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=nV(e);if(!(n.height>0||n.width>0)){c(!1);return}j(n),t===`css-animation`&&aV(e,`animation-name`,`none`)()},[a,s,M,j,c,N,O,u]),eM({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&j(eV,!1)}}),T.useEffect(()=>{if(s||!a||D!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){C.current||(c(!1),j(eV,!1))}return t=LD.request(()=>{w(n,e.signal)}),()=>{LD.cancel(t),e.abort()}},[C,a,s,D,w,j,c]),Q(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),T.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=gD($E,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return bD(e,`beforematch`,t)},[o,l]);let F=i||n||a||s;return{height:k.height,props:{...A?{[GB]:``}:void 0,hidden:E,id:r},ref:S,shouldPreventOpenAnimation:O,shouldRender:F,transitionStatus:D,width:k.width}}function nV(e){return{height:e.scrollHeight,width:e.scrollWidth}}function rV(e,t){let n=HT(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&iV(n.animationDuration),i=iV(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function iV(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function aV(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function oV(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=LD.request(n);return()=>{LD.cancel(r),n()}}var sV=`--collapsible-panel-height`,cV=`--collapsible-panel-width`,lV=T.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=HB(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;Q(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=tV({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=Sk(s,k),j=Rk(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[sV]:S===void 0?`auto`:`${S}px`,[cV]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:XB});return E?j:null}),uV=e=>e===void 0?`No default sender`:e.name?`${e.name} <${e.email}>`:e.email;function dV(){return(0,Z.jsx)(`span`,{title:`Overridable per send`,className:`border-border-subtle text-placeholder shrink-0 rounded-full border px-2 py-px text-[10px]`,children:`default`})}function fV({value:e,placeholder:t,testId:n}){return(0,Z.jsx)(`span`,{"data-testid":n,className:`text-foreground min-w-0 flex-1 truncate`,children:e.length>0?e:(0,Z.jsx)(`span`,{className:`text-placeholder`,children:t})})}function pV(){let{doc:e,render:t,selected:n,layoutMode:r}=G(iL(e=>({doc:e.doc,render:e.render,selected:e.selection.kind===`envelope`,layoutMode:e.layoutMode}))),{selectEnvelope:i}=G(e=>e.actions),[a,o]=(0,T.useState)(!1),s=(0,T.useRef)(null),c=(0,T.useRef)(!1),l=e?.metadata.fromDefault,u=e?.metadata.replyToDefault??[],d=t?.subject??``,f=t?.preheader??``,p=r===`compact`||r===`narrow`;return(0,T.useEffect)(()=>{p&&!a&&c.current&&(c.current=!1,s.current?.focus())},[p,a]),(0,Z.jsxs)(ZB,{open:!p||a,onOpenChange:e=>{e||(c.current=!0),o(e)},children:[p&&!a&&(0,Z.jsxs)($B,{ref:s,"aria-label":`Expand envelope`,"data-testid":`envelope.expand`,onClick:e=>{e.stopPropagation(),i()},className:dL(`mb-4 flex h-11 w-full items-center gap-3 rounded-xl border bg-background px-3 text-left shadow-[var(--shadow-xs)] transition-[border-color,box-shadow] hover:border-sel-mid`,n&&`border-accent-email shadow-[0_0_0_1px_var(--accent-email)]`),children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground text-[10px] font-semibold tracking-[0.08em] uppercase`,children:`Envelope`}),(0,Z.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate text-[12px]`,children:d===``?`No subject`:d}),(0,Z.jsx)(P,{className:`text-muted-foreground size-4 shrink-0`})]}),(0,Z.jsx)(lV,{children:(0,Z.jsxs)(`div`,{onClick:e=>{e.stopPropagation(),i()},className:dL(`mb-6 cursor-pointer overflow-hidden rounded-2xl border transition-shadow`,n?`border-accent-email shadow-[0_0_0_1px_var(--accent-email)]`:`border-border/80 hover:border-sel-mid`),children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle bg-surface-inset/80 flex items-center justify-between border-b px-3 py-1.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Select envelope`,"data-testid":`envelope.select`,onClick:e=>{e.stopPropagation(),i()},className:`text-muted-foreground hover:bg-muted hover:text-foreground rounded px-1 py-0.5 text-[10px] font-semibold tracking-[0.08em] uppercase`,children:`Envelope`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder text-[10px]`,children:`defaults muted · subject & preview rendered`}),p&&(0,Z.jsx)($B,{"aria-label":`Collapse envelope`,"data-testid":`envelope.collapse`,onClick:e=>{e.stopPropagation()},className:`text-muted-foreground hover:bg-muted hover:text-foreground rounded p-1`,children:(0,Z.jsx)(L,{className:`size-3.5`})})]})]}),(0,Z.jsxs)(`div`,{className:`border-border-subtle bg-surface-inset/40 border-b`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`From`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate`,children:uV(l)}),(0,Z.jsx)(dV,{})]}),(0,Z.jsxs)(`div`,{"data-testid":`envelope.reply-to-row`,className:`flex items-center gap-3 px-4 py-2 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`Reply-To`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate`,children:u.length>0?u.join(`, `):`None`}),(0,Z.jsx)(dV,{})]})]}),(0,Z.jsxs)(`div`,{className:`bg-background`,children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex items-center gap-3 border-b px-4 py-2.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`Subject`}),(0,Z.jsx)(fV,{value:d,placeholder:`No subject`,testId:`envelope.subject-value`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`Preview`}),(0,Z.jsx)(fV,{value:f,placeholder:`No preview text`,testId:`envelope.preview-value`})]})]})]})})]})}var mV=T.createContext(void 0);function hV(e=!0){let t=T.useContext(mV);if(t===void 0&&!e)throw Error(pT(25));return t}var gV=T.createContext(void 0);function _V(e){let t=T.useContext(gV);if(t===void 0&&!e)throw Error(pT(33));return t}var vV=T.createContext(void 0);function yV(e){let t=T.useContext(vV);if(t===void 0&&!e)throw Error(pT(36));return t}function bV(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=hV(!0),f=d!==void 0;return T.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:iD})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!kT&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&qP(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var xV={type:`regular-item`};function SV(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=T.useRef(null),{getButtonProps:d,buttonRef:f}=JP({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=bV({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=T.useCallback(e=>wk(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=SD(u,f);return T.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var CV=T.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=sI({guess:!0,label:a}),f=_V(!0),p=oN(i),{store:m}=yV(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=SV({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:xV});return Rk(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),wV=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=yV(),{side:c,align:l}=_V(),u=IF(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;eM({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),T.useEffect(()=>{function e(e){s.setOpen(!1,gD(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),PM(b,{enabled:C&&!w&&!D&&_.type!==`menubar`,closeDelay:S});let O=s.useStateSetter(`popupElement`),k=Rk(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:RE,props:[p,{onKeyDown(e){u&&VF.has(e.key)&&e.stopPropagation()}},LN(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,Z.jsx)(CA,{context:b,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),TV=T.createContext(void 0);function EV(){let e=T.useContext(TV);if(e===void 0)throw Error(pT(32));return e}var DV=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=yV();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Z.jsx)(TV.Provider,{value:n,children:(0,Z.jsx)(iA,{ref:t,...r,portalOwnerRole:o})})}),OV=T.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=Xk,style:g,..._}=e,{store:v}=yV(),y=EV(),b=hV(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),E=v.useState(`open`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`activeTriggerElement`),A=v.useState(`transitionStatus`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),N=v.useState(`adaptiveOrigin`),P=v.useState(`lastOpenChangeReason`),F=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),L=S.useState(`domReferenceElement`),R=T.useRef(null),z=$j(j),ee=n,B=c,te=l,ne=s,re=h;x.type===`context-menu`&&(ee=n??x.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(te=e.alignOffset??2,B=e.sideOffset??-5));let V=o,ie=ne;x.type===`menu`?(V??=`inline-end`,ie??=`start`,re=e.collisionAvoidance??Zk):x.type===`menubar`&&(V??=x.context.orientation===`vertical`?`inline-end`:`bottom`,ie??=`start`);let ae=x.type===`context-menu`,oe=PN({anchor:ee,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:V,sideOffset:B,align:ie,alignOffset:te,arrowPadding:ae?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:re,shift:ae?{crossAxis:!(`side`in re&&re.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:N});T.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&v.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,gD(dD)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,F]),T.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,gD(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let se=yT();T.useEffect(()=>{E||se.clear()},[E,se]),T.useEffect(()=>{function e(e){if(E&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=v.select(`closeDelay`);e>0?se.isStarted()||se.start(e,()=>{v.setOpen(!1,gD(dD))}):v.setOpen(!1,gD(dD))}else se.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,E,k,v,se]),T.useEffect(()=>{let e={open:E,nodeId:F,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,E,v,F,I]),Q(()=>{let e=L,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return z(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,z,v]);let ce={open:E,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:x.type===`menu`,instant:M},H=x.type===`menubar`&&x.context.modal;AF(E&&(H||D&&P!==`trigger-hover`),O===`touch`,j,k);let le=RN(e,ce,{styles:oe.positionerStyles,transitionStatus:A,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!E}),ue=w&&x.type!==`menu`&&(x.type!==`menubar`&&D&&P!==`trigger-hover`||x.type===`menubar`&&x.context.modal),de=null;return x.type===`menubar`?de=x.context.contentElement:x.type===void 0&&(de=k),(0,Z.jsxs)(gV.Provider,{value:oe,children:[ue&&(0,Z.jsx)(hF,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:VN(!E),cutout:de}),(0,Z.jsx)(fA,{id:F,children:(0,Z.jsx)(oF,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:le})})]})}),kV=T.createContext(null);function AV(e){let t=T.useContext(kV);if(t===null&&!e)throw Error(pT(5));return t}var jV={...SM,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},MV=class extends Kj{constructor(e,t,n=!1){let r=new hM,i=PV(r,t,n,e);super(i,NV(r),jV),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function NV(e){return{positionerRef:T.createRef(),popupRef:T.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:T.createRef(),beforeContentFocusGuardRef:T.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function PV(e,t,n=!1,r){return{...gM(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new oA,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:dT,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var FV=T.createContext(void 0);function IV(){return T.useContext(FV)}var LV=oT(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=hV(!0),_=yV(!0),v=AV(!0),y=IV(),b=T.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=hk(),S=hk(),C=lA(),w=b.type===`menu`?b.store:void 0,E=(n??a)&&w?.state.transitionStatus===`starting`,D=tT(()=>E?w?.state.instantType:void 0).current,O=RV({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b,disabled:o,highlightItemOnHover:h,modal:b.type===void 0?s:void 0,rootId:x,instantType:D},S,C!=null);O.useControlledProp(`openProp`,n),O.useControlledProp(`triggerIdProp`,p),O.useContextCallback(`onOpenChangeComplete`,i);let k=O.useState(`floatingTreeRoot`),A=dA(k),j=O.useState(`open`),M=O.useState(`activeTriggerElement`),N=O.useState(`positionerElement`),P=O.useState(`hoverEnabled`),F=O.useState(`disabled`),I=O.useState(`lastOpenChangeReason`),L=O.useState(`parent`),R=O.useState(`activeIndex`),z=O.useState(`payload`),ee=O.useState(`floatingParentNodeId`),B=T.useRef(null),te=T.useRef(L.type!==`context-menu`),ne=yT(),re=T.useRef(!0),V=yT(),ie=ee!=null,{openMethod:ae,triggerProps:oe}=FP(j);O.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:L.type===void 0?s:void 0,openMethod:ae,rootId:x}),dM(O);let{forceUnmount:se,transitionStatus:ce}=fM(j,O,()=>{O.set(`allowMouseEnter`,!1)},E),H=$j(O.context.popupRef);T.useEffect(()=>{if(D===void 0)return;let e=()=>{O.state.instantType===D&&O.set(`instantType`,void 0)};if(!j){e();return}if(ce!==void 0)return;if(O.context.popupRef.current==null){e();return}let t=new AbortController;return H(e,t.signal),()=>{t.abort()}},[D,j,ce,H,O]),Q(()=>{g&&!_?O.update({parent:{type:`context-menu`,context:g},floatingNodeId:A,floatingParentNodeId:C}):_&&O.update({floatingNodeId:A,floatingParentNodeId:C})},[g,_,A,C,O]),T.useEffect(()=>{if(j||(B.current=null),L.type===`context-menu`){if(!j){ne.clear(),te.current=!1;return}ne.start(500,()=>{te.current=!0})}},[ne,j,L.type]),Q(()=>{!j&&!P&&O.set(`hoverEnabled`,!0)},[j,P,O]);let le=$((e,t)=>{let n=t.reason;if(!e&&!O.select(`open`)||j===e&&t.trigger===M&&I===n)return;let i=cM(t);if(!e&&t.trigger==null&&(t.trigger=M??void 0),r?.(e,t),t.isCanceled)return;O.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!re.current)return;e&&n===`trigger-focus`?(re.current=!1,V.start(300,()=>{re.current=!0})):(re.current=!0,V.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);B.current=t.event;let c=sM(O.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,O.update(c)}),ue=Yj({popupStore:O,floatingRootContext:O.state.floatingRootContext,floatingId:S,nested:C!=null,onOpenChange:le}),de=ue.context.events;Q(()=>{let e=({open:e,eventDetails:t})=>le(e,t);return de.on(`setOpen`,e),()=>{de?.off(`setOpen`,e)}},[de,le]);let fe=T.useCallback(()=>{O.setOpen(!1,gD(pD))},[O]);T.useImperativeHandle(u,()=>({unmount:se,close:fe}),[se,fe]);let U;L.type===`context-menu`&&(U=L.context),T.useImperativeHandle(U?.positionerRef,()=>N,[N]),T.useImperativeHandle(U?.actionsRef,()=>({setOpen:le}),[le]);let pe=AA(ue,{enabled:!F,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||B.current?.type===`contextmenu`||te.current},externalTree:ie?k:void 0}),me=bN(),he=T.useCallback(e=>{O.select(`activeIndex`)!==e&&O.set(`activeIndex`,e)},[O]),ge=WM(ue,{enabled:!F,listRef:O.context.itemDomElements,activeIndex:R,nested:L.type!==void 0,loopFocus:c,orientation:l,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:me===`rtl`,disabledIndices:uT,onNavigate:he,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:ie?k:void 0,focusItemOnHover:h}),_e=T.useCallback(e=>{O.context.typingRef.current=e},[O]),ve=GM(ue,{enabled:!F,listRef:O.context.itemLabels,elementsRef:O.context.itemDomElements,activeIndex:R,resetMs:500,onMatch:e=>{j&&e!==R&&O.set(`activeIndex`,e)},onTyping:_e}),ye=T.useMemo(()=>{let e=wk(ve.reference,ge.reference,pe.reference,{onMouseMove(){O.set(`allowMouseEnter`,!0)}},oe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=j,e},[O,ve.reference,ge.reference,pe.reference,oe,j]),be=T.useMemo(()=>{let e=wk(ge.trigger,pe.trigger,oe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ge.trigger,pe.trigger,oe]);tT(()=>(O.update({inactiveTriggerProps:be}),null)),pM(O,{floatingRootContext:ue,activeTriggerProps:ye,inactiveTriggerProps:be,popupProps:T.useMemo(()=>wk(tM,{id:S,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":M?.id,onMouseMove(){O.set(`allowMouseEnter`,!0),L.type===`menu`&&O.set(`hoverEnabled`,!1)},onClick(){O.select(`hoverEnabled`)&&O.set(`hoverEnabled`,!1)},onKeyDown(e){let t=O.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ve.floating,ge.floating,pe.floating),[M,S,l,L.type,O,ve.floating,ge.floating,pe.floating]),itemProps:ge.item??dT});let xe=T.useMemo(()=>({store:O,parent:b}),[O,b]),Se=(0,Z.jsxs)(vV.Provider,{value:xe,children:[f&&(0,Z.jsx)(iM,{handle:f,store:O}),typeof t==`function`?t({payload:z}):t]});return L.type===void 0||L.type===`context-menu`?(0,Z.jsx)(pA,{externalTree:k,children:Se}):Se});function RV(e,t,n){return tT(()=>new MV(e,t,n)).current}function zV(e){if(KT(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!iE(e))return zV(sE(e))}function BV(e,t){let n=T.useRef(null);function r(t){$k.flushSync(()=>{e.setOpen(!1,gD(oD,t.nativeEvent,t.currentTarget))}),GO(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&KO(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{$k.flushSync(()=>{e.setOpen(!1,gD(oD,n.nativeEvent,n.currentTarget))});let i=WO(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&fE(r,i);){let e=i;if(i=VO(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function VV(e){let[t,n]=T.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=T.useRef(null),i=T.useRef(null),a=T.useRef(null),o=T.useRef(null),s=T.useRef(!0),c=T.useRef(null),l=hk(),u=T.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,Z.jsx)(mV.Provider,{value:u,children:(0,Z.jsx)(vV.Provider,{value:void 0,children:(0,Z.jsx)(LV,{...e})})})}var HV=500,UV=T.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}=hV(!1),{store:m}=yV(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=T.useRef(null),v=T.useRef(null),y=yT(),b=yT(),x=T.useRef(!1),S=T.useRef(null);function C(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),x.current=!1,s.current?.setOpen(!0,gD(eD,n)),b.start(HV,()=>{x.current=!0})}function w(e){if(g)return;d.current=!0,PT(e),C(e.clientX,e.clientY,e.nativeEvent);let t=zD(_.current);S.current?.abort();let n=new AbortController;S.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!x.current)return;b.clear(),x.current=!1;let t=pE(e);fE(u.current,t)||p&&t&&zV(t)===p||s.current?.setOpen(!1,gD(uD,e))},{once:!0,signal:n.signal})}function E(){y.clear(),v.current=null}function D(e){if(g){E();return}if(d.current=!1,e.touches.length!==1){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(HV,()=>{C(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1){E();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&E()}}return T.useEffect(()=>()=>{S.current?.abort()},[]),T.useEffect(()=>{function e(e){if(g)return;let t=pE(e);(fE(_.current,t)||fE(c.current,t)||fE(l.current,t))&&e.preventDefault()}return bD(zD(_.current),`contextmenu`,e)},[l,g,c]),Rk(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:w,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:IE})}),WV=OV,GV=dL(`samva-editor-context-item`,`grid min-h-8 grid-cols-[1fr_auto] items-center gap-5 rounded-md px-2.5 text-[12.5px] text-foreground outline-none`,`data-[highlighted]:bg-sel-soft data-[highlighted]:text-accent-email`);function KV({children:e,ancestors:t,onSelect:n,onOpenChange:r,portalContainer:i,open:a,anchor:o}){return(0,Z.jsxs)(VV,{open:a,onOpenChange:r,children:[(0,Z.jsx)(UV,{render:e}),(0,Z.jsx)(DV,{container:i,children:(0,Z.jsx)(WV,{anchor:o,sideOffset:2,children:(0,Z.jsxs)(wV,{"aria-label":`Select element`,"data-testid":`node-context-menu.popup`,className:`samva-editor-context-popup samva-editor-shell border-border bg-surface-elevated z-50 min-w-52 rounded-lg border p-1 shadow-[var(--shadow-lg)] outline-none`,children:[(0,Z.jsx)(`div`,{className:`text-muted-foreground px-2.5 py-1 text-[11px]`,children:`Select`}),t.map(e=>(0,Z.jsxs)(CV,{className:GV,"data-testid":`node-context-menu.item.${e.instancePath}`,onClick:()=>n(e.instancePath),children:[(0,Z.jsx)(`span`,{children:e.label}),e.generated?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`generated`}):null]},e.instancePath))]})})})]})}function qV({pointing:e=!1}){let{doc:t,render:n,outline:r,selection:i,previewDevice:a,canvasZoom:o}=G(iL(e=>({doc:e.doc,render:e.render,outline:e.outline,selection:e.selection,previewDevice:e.previewDevice,canvasZoom:e.canvasZoom}))),{select:s,selectDocument:c,setHovered:l,setPreviewDevice:u,setCanvasZoom:d}=G(e=>e.actions),f=G(e=>e.hoveredCandidatePath===null?null:e.outline?.index.get(e.hoveredCandidatePath)??null),p=WR(),m=OL(),h=(0,T.useRef)(null),[g,_]=(0,T.useState)(1),[v,y]=(0,T.useState)([]),[b,x]=(0,T.useState)(!1),[S,C]=(0,T.useState)(null),w=i.kind===`element`?r?.index.get(i.instancePath)??null:null,E=a===`mobile`?375:600;(0,T.useLayoutEffect)(()=>{let e=h.current;if(e===null||typeof ResizeObserver>`u`)return;let t=()=>{let t=Math.max(240,e.clientWidth-80);_(Math.min(1,Math.max(.5,t/E)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[E]);let D=o===`fit`?g:1,O=(0,T.useCallback)(t=>{if(e||r===null||t.instancePath===null){x(!1);return}let n=[...lw(r,t.instancePath),t.instancePath].toReversed().flatMap(e=>{let t=r.index.get(e);return t===void 0?[]:[{instancePath:e,label:iw(t),generated:!t.authored}]});if(n.length===0){x(!1);return}s(t.instancePath),y(n);let{clientX:i,clientY:a}=t;C({getBoundingClientRect:()=>DOMRect.fromRect({x:i,y:a})}),queueMicrotask(()=>x(!0))},[r,e,s]),k=n===null?null:(0,Z.jsx)(LB,{html:n.html,width:E,onSelect:s,onHover:l,onContextMenu:e?void 0:O,overlay:(0,Z.jsx)(zB,{renderRevision:n.revision,selected:w,hovered:f})});return(0,Z.jsxs)(`div`,{className:`samva-editor-workspace relative flex min-w-0 flex-1 flex-col`,children:[m!==null&&(0,Z.jsx)(`div`,{"data-samva-canvas-status":!0,className:`pointer-events-none absolute inset-x-0 top-3 z-10 flex justify-center`,children:m}),(0,Z.jsx)(`div`,{ref:h,"data-samva-canvas-viewport":!0,className:`samva-editor-scroll relative flex-1 overflow-auto px-10 pt-10 pb-24 [overflow-anchor:none]`,onClick:c,children:t===null?(0,Z.jsx)(`div`,{className:`text-muted-foreground grid h-full place-items-center text-[12.5px]`,children:`Loading document…`}):(0,Z.jsxs)(`div`,{className:`mx-auto`,"data-canvas-zoom":o,style:{width:E,zoom:D},onClick:e=>e.stopPropagation(),children:[t.channel===`email`&&t.preview.status===`stale`&&(0,Z.jsxs)(`div`,{"data-testid":`canvas.preview-stale`,className:`border-warning/35 bg-warning/10 text-foreground mb-3 rounded-[9px] border px-3 py-2 text-[12px] shadow-sm`,children:[`Showing the last preview that worked. Your latest edit has a problem:`,` `,t.preview.reason]}),(0,Z.jsx)(pV,{}),k===null?(0,Z.jsx)(JV,{}):e?k:(0,Z.jsx)(KV,{ancestors:v,onSelect:s,portalContainer:p,anchor:S??void 0,open:b,onOpenChange:e=>x(e&&v.length>0),children:k})]})}),t!==null&&(0,Z.jsxs)(`div`,{className:`border-border bg-background/95 absolute bottom-3 left-1/2 z-20 flex -translate-x-1/2 items-center gap-1 rounded-[9px] border p-1 shadow-[var(--shadow-lg)] backdrop-blur-md`,children:[(0,Z.jsx)(uz,{ariaLabel:`Canvas preview width`,value:a,onChange:e=>u(e),size:`sm`,options:[{value:`desktop`,title:`Preview desktop width`,testId:`canvas.device.desktop`,label:(0,Z.jsx)(ue,{className:`size-[13px]`})},{value:`mobile`,title:`Preview mobile width`,testId:`canvas.device.mobile`,label:(0,Z.jsx)(le,{className:`size-[13px]`})}]}),(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`canvas.zoom`,title:o===`fit`?`Show canvas at 100%`:`Fit canvas to workspace`,"aria-label":o===`fit`?`Show canvas at 100%`:`Fit canvas to workspace`,onClick:()=>d(o===`fit`?`100`:`fit`),className:dL(`text-muted-foreground hover:bg-muted hover:text-foreground inline-flex h-7 items-center gap-1.5 rounded-[6px] px-2 text-[11.5px] transition-colors`,o===`fit`&&`bg-sel-soft text-accent-email`),children:[(0,Z.jsx)(A,{className:`size-[14px]`}),o===`fit`?`Fit`:`100%`]})]})]})}function JV(){let e=G(iL(e=>e.checks.filter(e=>e.severity===`error`))),t=e.length>0;return(0,Z.jsxs)(`div`,{"data-testid":`canvas.unbuilt`,"data-unbuilt-reason":t?`failed`:`not-built`,className:`border-border bg-surface-inset text-foreground rounded-xl border border-dashed p-6 text-[12.5px]`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:t?`No preview`:`No preview yet`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:t?`The current draft broke the preview. Fix the source and it will come back.`:`Nothing has run this entry yet. The next pass puts the preview here.`}),t&&(0,Z.jsx)(`ul`,{className:`mt-4 space-y-2`,children:e.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(HR,{check:e,actions:(0,Z.jsx)(VR,{check:e})})},e.id))})]})}var YV={body:te,div:V,table:ie,tbody:ie,tr:ie,td:xe,th:xe,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,p:pe,span:pe,a:M,button:M,img:oe,hr:ee,br:k,ul:j,ol:j,li:j},XV=e=>YV[e.toLowerCase()]??V;function ZV({node:e,depth:t}){let{selectedPath:n,expandedLayers:r}=G(iL(e=>({selectedPath:e.selection.kind===`element`?e.selection.instancePath:null,expandedLayers:e.expandedLayers}))),{select:i,toggleLayerExpand:a,setHovered:o}=G(e=>e.actions),s=e.children.length>0,c=r.has(e.instancePath),l=n===e.instancePath,{selection:u}=e;return(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`group relative`,style:{paddingLeft:t*12},onMouseEnter:()=>o(e.instancePath),onMouseLeave:()=>o(null),children:(0,Z.jsxs)(`div`,{className:dL(`flex h-[30px] w-full items-center gap-1.5 rounded-[7px] pr-2 pl-1.5 text-left transition-colors`,l?`bg-sel-soft text-accent-email`:`text-foreground hover:bg-muted`),children:[s?(0,Z.jsx)(`button`,{type:`button`,"aria-expanded":c,"data-testid":`left-rail.layer.toggle`,"aria-label":`${c?`Collapse`:`Expand`} ${iw(u)}`,className:dL(`grid size-3.5 shrink-0 place-items-center text-muted-foreground transition-transform`,c&&`rotate-90`),onClick:t=>{t.stopPropagation(),a(e.instancePath)},children:(0,Z.jsx)(I,{className:`size-[11px]`})}):(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,Z.jsxs)(`button`,{"data-layer-instance-path":e.instancePath,"data-testid":`layers.node.${e.instancePath}`,type:`button`,onClick:()=>i(e.instancePath),className:`flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[(0,T.createElement)(XV(u.tag),{className:dL(`size-[15px] shrink-0`,l?`text-accent-email`:`text-muted-foreground`)}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12.5px]`,children:iw(u)}),!u.authored&&(0,Z.jsx)(`span`,{className:`text-placeholder shrink-0 text-[10px]`,children:`generated`})]})]})}),s&&c&&(0,Z.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.children.map(e=>(0,Z.jsx)(ZV,{node:e,depth:t+1},e.instancePath))})]})}function QV(){let e=G(e=>e.outline);return e===null?(0,Z.jsx)(`div`,{className:`text-placeholder px-3 py-8 text-center text-xs`,children:`There is no preview yet, so there are no layers to show.`}):(0,Z.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.roots.map(e=>(0,Z.jsx)(ZV,{node:e,depth:0},e.instancePath))})}function $V(){let e=WR(),{leftCollapsed:t,leftWidth:n,layoutMode:r}=G(iL(e=>({leftCollapsed:e.leftCollapsed,leftWidth:e.leftWidth,layoutMode:e.layoutMode}))),{toggleLeft:i}=G(e=>e.actions),a=r===`compact`||r===`narrow`;return(0,Z.jsx)(`aside`,{"aria-label":`Layers`,"aria-hidden":t||void 0,inert:t||void 0,"data-editor-rail":`left`,style:{width:t?0:n,maxWidth:a?`calc(100% - 48px)`:void 0},className:dL(`flex h-full shrink-0 flex-col overflow-hidden border-r border-border bg-background transition-[width,transform,box-shadow] duration-180 ease-out`,a&&`absolute inset-y-0 left-0 z-40 shadow-[var(--shadow-floating)]`,t&&`border-r-0`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:n,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex items-center gap-0.5 border-b px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-foreground text-[12.5px] font-medium`,children:`Layers`}),(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Collapse layers`,"data-testid":`left-rail.collapse`,onClick:i,className:`text-muted-foreground hover:bg-muted hover:text-foreground ml-auto rounded-md p-1.5`}),children:(0,Z.jsx)(he,{className:`size-[15px]`})}),(0,Z.jsx)(gN,{container:e,children:(0,Z.jsx)(zN,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Collapse layers`})})})]})]}),(0,Z.jsxs)(YL,{"data-samva-scroll-area":`layers`,className:`relative min-h-0 flex-1`,children:[(0,Z.jsx)(sR,{className:`size-full`,children:(0,Z.jsx)(`div`,{className:`px-2 pt-2.5 pb-5`,children:(0,Z.jsx)(QV,{})})}),(0,Z.jsx)(pR,{orientation:`vertical`,className:`absolute top-0 right-0 bottom-0 flex w-2.5 touch-none p-0.5 select-none`,children:(0,Z.jsx)(mR,{className:`relative flex-1 rounded-full bg-[var(--editor-scrollbar-thumb)] hover:bg-[var(--editor-scrollbar-thumb-hover)]`})})]})]})})}var eH=dL(`flex flex-1 items-center justify-center gap-1.5 px-2 text-[12px]`,mL),tH={layers:{label:`Layers`,Icon:se},inspector:{label:`Inspector`,Icon:ve},review:{label:`Review`,Icon:re}},nH=[`layers`,`inspector`,`review`];function rH({view:e,sourceEditable:t,review:n}){return e===`layers`?(0,Z.jsx)(`div`,{className:`samva-editor-scroll h-full overflow-y-auto px-2 pt-2.5 pb-5`,children:(0,Z.jsx)(QV,{})}):e===`review`&&n!==null?(0,Z.jsx)(`div`,{className:`samva-editor-scroll h-full overflow-y-auto px-2 pt-2.5 pb-5`,children:n.content}):t?(0,Z.jsx)(Iz,{embedded:!0}):(0,Z.jsx)(Lz,{embedded:!0})}function iH({focused:e=!1}){let t=G(e=>e.sourceEditable),n=G(e=>e.rightWidth),r=G(e=>e.designView),i=G(e=>e.actions.setDesignView),a=TL(),o=r===`review`&&a===null?`layers`:r,s=(0,T.useId)(),c=`${s}-panel`;return(0,Z.jsxs)(`aside`,{"aria-label":`Design`,"data-testid":`design-rail`,"data-editor-rail":`right`,style:e?void 0:{width:n},className:dL(`bg-background flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,e?`w-full flex-1`:`shrink-0 border-l border-border`),children:[(0,Z.jsx)(`div`,{className:`border-border-subtle flex min-h-11 shrink-0 items-center border-b px-2 py-1.5`,children:(0,Z.jsx)(iz,{role:`tablist`,"aria-label":`Design view`,value:[o],onValueChange:e=>{let t=e[0];(t===`layers`||t===`inspector`)&&i(t),t===`review`&&a!==null&&i(`review`)},className:`bg-muted flex flex-1 gap-0.5 rounded-lg p-0.5`,children:nH.filter(e=>e!==`review`||a!==null).map(e=>{let{Icon:t,label:n}=tH[e];return(0,Z.jsxs)(ZR,{id:`${s}-tab-${e}`,type:`button`,role:`tab`,"aria-selected":o===e,"aria-controls":c,"aria-pressed":void 0,value:e,"data-testid":`design.tab.${e}`,className:eH,children:[(0,Z.jsx)(t,{className:`size-[14px]`}),n,e===`review`&&a?.badge]},e)})})}),(0,Z.jsx)(`div`,{role:`tabpanel`,id:c,"aria-labelledby":`${s}-tab-${o}`,className:`min-h-0 flex-1`,children:(0,Z.jsx)(rH,{view:o,sourceEditable:t,review:a})})]})}function aH({side:e}){let t=G(e=>e.leftWidth),n=G(e=>e.assistantWidth),r=G(e=>e.rightWidth),{setAssistantWidth:i,setLeftWidth:a,setRightWidth:o}=G(e=>e.actions),s=(0,T.useRef)(!1);return(0,T.useEffect)(()=>{let t=t=>{s.current&&(e===`assistant`?i(t.clientX):e===`assistant-end`?i(window.innerWidth-t.clientX):e===`left`?a(t.clientX):o(window.innerWidth-t.clientX))},n=()=>{s.current&&(s.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``)};return window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n),()=>{window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n)}},[e,i,a,o]),(0,Z.jsx)(`div`,{"data-editor-resize":e,role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":e===`assistant`||e===`assistant-end`?n:e===`left`?t:r,"aria-label":e===`assistant`||e===`assistant-end`?`Resize Assistant`:e===`left`?`Resize layers panel`:`Resize inspector`,"data-testid":e===`assistant`||e===`assistant-end`?`agent-column.resize`:e===`left`?`left-rail.resize`:`inspector.resize`,tabIndex:0,onMouseDown:e=>{e.preventDefault(),s.current=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},onKeyDown:s=>{let c=s.shiftKey?24:8;(s.key===`ArrowLeft`||s.key===`ArrowRight`)&&(s.preventDefault(),e===`assistant`?(s.key===`ArrowLeft`&&i(n-c),s.key===`ArrowRight`&&i(n+c)):e===`assistant-end`?(s.key===`ArrowLeft`&&i(n+c),s.key===`ArrowRight`&&i(n-c)):e===`left`?(s.key===`ArrowLeft`&&a(t-c),s.key===`ArrowRight`&&a(t+c)):(s.key===`ArrowLeft`&&o(r+c),s.key===`ArrowRight`&&o(r-c)))},className:dL(`group relative z-10 w-2 shrink-0 cursor-col-resize`,`before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-border before:transition-colors`,`hover:before:w-0.5 hover:before:bg-accent-email active:before:bg-accent-email`,`after:absolute after:top-1/2 after:left-1/2 after:h-10 after:w-1 after:-translate-x-1/2 after:-translate-y-1/2 after:rounded-full after:bg-muted-foreground/35 after:opacity-60 after:transition-opacity`,`hover:after:opacity-100 hover:after:bg-accent-email`)})}var oH={assistant:{label:`Assistant`,tip:`Show the assistant`,Icon:ye},preview:{label:`Preview`,tip:`Show the preview`,Icon:ne},design:{label:`Design`,tip:`Show designs, layers, and inspector`,Icon:se}};function sH(){let e=G(e=>e.sourceEditable),t=G(e=>e.leftCollapsed),n=G(e=>e.rightCollapsed),r=G(e=>e.layoutMode),i=yL(),a=TL(),o=G(e=>e.workspaceView),s=G(e=>e.focusedPane),c=G(e=>e.actions.setFocusedPane),l=Lm(),u=e=>l.setState({workspaceView:e}),d=(0,T.useId)(),f=i&&r===`compact`,p=i&&r===`narrow`,m=f||p,h=f?[`assistant`,`preview`,`design`]:[`assistant`,`preview`],g=o===`source`?`preview`:h.includes(s)?s:`assistant`;return i?(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)($z,{value:o,onChange:e=>{u(e),m&&c(`preview`)},idBase:d,panelId:`${d}-view-panel`}),m&&(0,Z.jsx)(iz,{role:`tablist`,value:[g],onValueChange:e=>{let t=e[0];h.some(e=>e===t)&&(c(t),t!==`preview`&&o===`source`&&u(`visual`))},"aria-label":`Editor pane`,className:`border-border bg-background flex h-11 shrink-0 items-center gap-1 border-b p-1.5`,children:h.map(e=>{let{Icon:t,label:n,tip:r}=oH[e];return(0,Z.jsxs)(ZR,{id:`${d}-tab-${e}`,type:`button`,role:`tab`,"aria-selected":g===e,"aria-controls":`${d}-pane-${e}`,"aria-pressed":void 0,value:e,title:r,"data-testid":`agent-workspace.tab.${e}`,className:dL(mL,`h-8 flex-1 px-2.5 text-[12px]`),children:[(0,Z.jsx)(t,{className:`size-3.5 shrink-0`}),n,e===`design`&&a?.badge]},e)})}),(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1`,"data-agent-workspace-layout":m?`focused`:`split`,children:[(0,Z.jsx)(`div`,{id:`${d}-pane-assistant`,role:m?`tabpanel`:void 0,"aria-labelledby":m?`${d}-tab-assistant`:void 0,hidden:m&&g!==`assistant`,className:dL(!m&&`contents`,m&&g===`assistant`&&`flex h-full min-h-0 min-w-0 flex-1`),children:(0,Z.jsx)(kL,{hidden:m&&g!==`assistant`})}),!m&&(0,Z.jsx)(aH,{side:`assistant`}),(0,Z.jsx)(`div`,{id:`${d}-pane-preview`,role:m?`tabpanel`:void 0,"aria-labelledby":m?`${d}-tab-preview`:void 0,hidden:m&&g!==`preview`,className:dL(`min-h-0 min-w-0 flex-1`,(!m||g===`preview`)&&`flex`),children:(0,Z.jsx)(`div`,{id:`${d}-view-panel`,role:`tabpanel`,"aria-labelledby":Zz(d,o),className:`flex min-h-0 min-w-0 flex-1`,children:o===`source`?(0,Z.jsx)(Gz,{}):(0,Z.jsx)(qV,{pointing:!0})})}),!m&&(0,Z.jsx)(aH,{side:`right`}),(0,Z.jsx)(`div`,{id:`${d}-pane-design`,role:f?`tabpanel`:void 0,"aria-labelledby":f?`${d}-tab-design`:void 0,hidden:m&&g!==`design`,className:dL(!m&&`contents`,m&&g===`design`&&`flex h-full min-h-0 min-w-0 flex-1`),children:p?null:(0,Z.jsx)(iH,{focused:m})})]})]}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(xz,{}),(0,Z.jsx)($z,{value:o,onChange:u,children:o===`source`?(0,Z.jsx)(Gz,{}):(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsx)($V,{}),!t&&(0,Z.jsx)(aH,{side:`left`}),(0,Z.jsx)(qV,{}),!n&&(0,Z.jsx)(aH,{side:`right`}),(0,Z.jsx)(Rz,{readOnly:!e})]})})]})}var cH=RegExp(`\\s${Ag}="[^"]*"`,`g`),lH=e=>e.replace(cH,``),uH=e=>{let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t===``?`email`:t},dH=(e,t)=>{let n=new Blob([lH(e)],{type:`text/html;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${uH(t)}.html`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)},fH=`--nested-drawers`,pH=`--drawer-height`,mH=`--drawer-frontmost-height`,hH=`--drawer-swipe-movement-x`,gH=`--drawer-swipe-movement-y`,_H=`--drawer-snap-point-offset`,vH=`--drawer-swipe-strength`,yH=`--drawer-swipe-progress`,bH=T.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=gR(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Rk(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:RE,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[yH]:`0`,[vH]:`1`}},o],enabled:a||!l})}),xH=vR,SH=`data-drawer-content`,CH=yR,wH=T.createContext(void 0);function TH(){return T.useContext(wH)}var EH=`data-expanded`,DH=`data-nested-drawer-open`,OH=`data-nested-drawer-swiping`,kH=`data-swipe-dismiss`,AH=`data-swipe-direction`,jH=`data-swiping`,MH=T.createContext(void 0);function NH(e){let t=T.useContext(MH);if(e!==!0&&t===void 0)throw Error(pT(90));return t}function PH(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function FH(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?IP(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function IH(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function LH(){let e=gR(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=NH(),a=e.useState(`viewportElement`),[o,s]=T.useState(0),[c,l]=T.useState(16),u=$(()=>{let e=zD(a).documentElement;s(a?a.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&l(t)});Q(()=>{if(u(),!a||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(u);return e.observe(a),()=>{e.disconnect()}},[u,a]);let d=T.useMemo(()=>{if(!t||t.length===0||o<=0||i<=0)return[];let e=Math.min(i,o),n=t.map(t=>{let n=FH(t,o,c);if(n===null)return null;let r=IP(n,0,e);return{value:t,height:r,offset:Math.max(0,i-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],a=[];for(let e=n.length-1;e>=0;--e){let t=n[e];a.some(e=>Math.abs(e-t.height)<=1)||(a.push(t.height),r.push(t))}return r.reverse(),r},[i,c,t,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i,viewportHeight:o,resolvedSnapPoints:d,activeSnapPointOffset:T.useMemo(()=>{if(n===null)return;let e=d.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(i,o),r=FH(n,o,c);if(r===null)return;let a=IP(r,0,t);return d[IH(d.map(e=>e.height),a)]},[n,i,d,c,o])?.offset??null}}var RH=T.createContext(null);function zH(){return T.useContext(RH)}var BH=!1;function VH(){BH||=(typeof CSS<`u`&&`registerProperty`in CSS&&([hH,gH,_H].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:yH,initialValue:`0`},{name:vH,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var HH={...RE,expanded(e){return e?{[EH]:``}:null},nestedDrawerOpen(e){return e?{[DH]:``}:null},nestedDrawerSwiping(e){return e?{[OH]:``}:null},swipeDirection(e){return{[AH]:e}},swiping(e){return e?{[jH]:``}:null}},UH=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=gR(),l=c.context.popupRef,{swipeDirection:u,frontmostHeight:d,hasNestedDrawer:f,nestedSwiping:p,nestedSwipeProgressStore:m,onPopupHeightChange:h,notifyParentFrontmostHeight:g,notifyParentHasNestedDrawer:_}=NH(),v=c.useState(`descriptionElementId`),y=c.useState(`disablePointerDismissal`),b=c.useState(`floatingRootContext`),x=c.useState(`popupProps`),S=c.useState(`modal`),C=c.useState(`mounted`),w=c.useState(`nested`),E=c.useState(`nestedOpenDrawerCount`),D=c.useState(`transitionStatus`),O=c.useState(`open`),k=c.useState(`openMethod`),A=c.useState(`titleElementId`),j=c.useState(`role`),M=b.useState(`floatingId`),N=s.id??M,P=zH();xR();let{snapPoints:F,activeSnapPoint:I,activeSnapPointOffset:L}=LH(),R=E>0,z=P?.swiping??!1,ee=P?.swipeStrength??null,[B,te]=T.useState(0),ne=T.useRef(0),re=$(()=>{let e=l.current;if(!e)return;let t=e.offsetHeight;if(ne.current>0&&d>ne.current&&t>ne.current)return;if(ne.current>0&&f){let e=ne.current;te(e),h(e);return}let n=t;n!==ne.current&&(ne.current=n,te(n),h(n))});Q(()=>{if(!C){ne.current=0,te(0),h(0);return}let e=l.current;if(!e||(VH(),re(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(re);return t.observe(e),()=>{t.disconnect()}},[re,C,R,h,l]),Q(()=>{let e=()=>{let e=l.current;if(!e)return;let t=m.getSnapshot();t>0?e.style.setProperty(yH,`${t}`):e.style.setProperty(yH,`0`)};e();let t=m.subscribe(e),n=l.current;return()=>{t(),n&&n.style.setProperty(yH,`0`)}},[m,l]),Q(()=>{if(O)return g?.(d),()=>{g?.(0)}},[d,O,g]),Q(()=>{if(_)return _(O||D===`ending`),()=>{_(!1)}},[_,O,D]),eM({open:O,ref:l,onComplete(){O&&c.context.onOpenChangeComplete?.(!0)}});let V=o===void 0?l:o,ie=c.useStateSetter(`popupElement`),ae={open:O,nested:w,transitionStatus:D,expanded:I===1,nestedDrawerOpen:R,nestedDrawerSwiping:p,swipeDirection:u,swiping:z},oe;B&&(f||D===`ending`)&&(oe=`${B}px`);let se=F&&F.length>0&&(u===`down`||u===`up`),ce=null;se&&L!==null&&(ce=u===`up`?-L:L);let H=P?P.getDragStyles():dT;if(se&&u===`down`){let e=L??0,t=Number.parseFloat(String(H[gH]));H=z&&Number.isFinite(t)?{...H,transform:void 0,[gH]:`${PH(e,t)}px`}:{...H,transform:void 0}}let le=Rk(`div`,e,{state:ae,props:[x,{id:N,"aria-labelledby":A,"aria-describedby":v,role:j,...tM,hidden:!C,onKeyDown(e){VF.has(e.key)&&e.stopPropagation()},style:{...H,[yH]:`0`,[fH]:E,[pH]:oe,[_H]:typeof ce==`number`?`${ce}px`:`0px`,[mH]:d?`${d}px`:void 0,[vH]:typeof ee==`number`&&Number.isFinite(ee)&&ee>0?`${ee}`:`1`}},s],ref:[t,l,ie],stateAttributesMapping:HH});return(0,Z.jsx)(CA,{context:b,openInteractionType:k,disabled:!C,closeOnFocusOut:!y,initialFocus:V,returnFocus:a,modal:S!==!1,restoreFocus:`popup`,children:le})}),WH=ER,GH,KH;function qH(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null,swipeDirection:f=`down`,snapToSequentialPoints:p=!1,snapPoints:m,snapPoint:h,defaultSnapPoint:g,onSnapPointChange:_}=e,v=NH(!0),y=v?.onNestedSwipeProgressChange,b=v?.onNestedFrontmostHeightChange,x=v?.onNestedSwipingChange,S=v?.onNestedDrawerPresenceChange,[C,w]=T.useState(0),[E,D]=T.useState(0),[O,k]=T.useState(!1),[A,j]=T.useState(!1),[M]=T.useState(JH),N=g===void 0?m?.[0]??null:g,P=h!==void 0,[F,I]=GN({controlled:h,default:N,name:`Drawer`,state:`snapPoint`}),L=T.useRef(!1),R=T.useRef(!1),z=$((e,t)=>{let n=t??gD(`none`);_?.(e,n),!n.isCanceled&&I(e)}),ee=T.useMemo(()=>P||!m||m.length===0?F:F===null||!m.some(e=>Object.is(e,F))?N:F,[F,P,N,m]),B=$(e=>{w(e),!L.current&&e>0&&D(e)}),te=$(e=>{if(e>0){L.current=!0,D(e);return}L.current=!1,C>0&&D(C)}),ne=$(e=>{k(e)}),re=$(e=>{M.set(e),y?.(e)}),V=$(e=>{j(e),x?.(e)}),ie=$((e,t)=>{i?.(e,t),!t.isCanceled&&!e&&m&&m.length>0&&z(N,gD(t.reason,t.event,t.trigger))}),ae=T.useMemo(()=>({swipeDirection:f,swipeAreaActiveRef:R,snapToSequentialPoints:p,snapPoints:m,activeSnapPoint:ee,setActiveSnapPoint:z,frontmostHeight:E,popupHeight:C,hasNestedDrawer:O,nestedSwiping:A,nestedSwipeProgressStore:M,onNestedDrawerPresenceChange:ne,onPopupHeightChange:B,onNestedFrontmostHeightChange:te,onNestedSwipingChange:V,onNestedSwipeProgressChange:re,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:y,notifyParentHasNestedDrawer:S}),[ee,E,O,A,M,S,y,x,b,ne,te,re,V,B,C,z,m,p,R,f]),oe=MR(`drawer`,{open:n,defaultOpen:r,onOpenChange:ie,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d,children:typeof t==`function`?e=>(0,Z.jsxs)(T.Fragment,{children:[GH||=(0,Z.jsx)(YH,{}),t(e)]}):(0,Z.jsxs)(T.Fragment,{children:[KH||=(0,Z.jsx)(YH,{}),t]})});return(0,Z.jsx)(MH.Provider,{value:ae,children:oe})}function JH(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function YH(){let e=TH(),t=gR(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,i=t.useState(`open`),a=t.useState(`nestedOpenDialogCount`),o=t.useState(`popupElement`),s=a===0;return Q(()=>{if(r)return()=>{r(t)}},[r,t]),Q(()=>{n?.(t,i)},[i,n,t]),T.useEffect(()=>{if(!i||!s||!OT)return;let e=HT(o).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,gD(cD,e))}let r=new e,a=bD(r,`close`,n);return()=>{a(),r.destroy()}},[t,s,i,o]),null}function XH(e,t=!1){let{overflowY:n}=aE(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function ZH(e,t=!1){let{overflowX:n}=aE(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function QH(e,t,n=!1){return t===`vertical`?XH(e,n):ZH(e,n)}function $H(e,t,n){let r=e;for(;KT(r)&&r!==t&&!iE(r);){for(let e of n)if(QH(r,e))return!0;r=sE(r)}return!1}function eU(e,t,n=`vertical`,r=!1){let i=KT(e)?e:null;for(;KT(i)&&i!==t&&!iE(i);){if(QH(i,n,r))return i;i=sE(i)}return QH(t,n,r)?t:null}function tU(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}function nU(e,t){let n=(t??HT(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}}var rU=40,iU=10,aU=1,oU=50,sU=16,cU=80,lU=`button,a,input,select,textarea,label,[role="button"]`;function uU(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function dU(e){return Number.isFinite(e)&&e>0?e:null}function fU(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function pU(e){return e%2==1}function mU(e,t,n){let r=e[n];if(typeof r==`function`)try{r.call(e,t)}catch(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`)return;throw e}}function hU(e){let{enabled:t,directions:n,elementRef:r,movementCssVars:i,canStart:a,ignoreSelectorWhenTouch:o=!0,ignoreScrollableAncestors:s=!1,swipeThreshold:c,onDismiss:l,onProgress:u,onCancel:d,onSwipeStart:f,onRelease:p,onSwipingChange:m,trackDrag:h=!0}=e,g=lU,_=n.length===1?n[0]:void 0,v=Math.max(0,typeof c==`number`?c:rU),y=n.includes(`left`),b=n.includes(`right`),x=n.includes(`up`),S=n.includes(`down`),C=y||b,w=x||S,E=T.useMemo(()=>{let e=[];return w&&e.push(`vertical`),C&&e.push(`horizontal`),e},[C,w]),[D,O]=T.useState(void 0),[k,A]=T.useState(!1),[j,M]=T.useState(!1),N=T.useRef({x:0,y:0}),P=T.useRef({x:0,y:0}),F=T.useRef(null),I=T.useRef({x:0,y:0,scale:1}),L=T.useRef(void 0),R=T.useRef(0),z=T.useRef(!1),ee=T.useRef({x:0,y:0}),B=T.useRef(null),te=T.useRef(!1),ne=T.useRef(!1),re=T.useRef(null),V=T.useRef(!1),ie=T.useRef(!1),ae=T.useRef({width:0,height:0}),oe=T.useRef(0),se=T.useRef(v),ce=T.useRef(null),H=T.useRef(null),le=T.useRef(null),ue=T.useRef({x:0,y:0}),de=T.useRef(null),fe=T.useRef(!1),U=T.useRef(null),pe=$(e=>{fe.current!==e&&(fe.current=e,A(e),m?.(e))});function me(e){if(!e)return;let t=r.current,n=ce.current;if(!t||!n)return;let i=n({element:t,direction:e});se.current=Math.max(0,i)}let he=$((e,t)=>{let n=Number.isFinite(e)?IP(e,0,1):0,r=n!==oe.current,i=!1;if(t){let e=de.current;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}(r||i)&&(oe.current=n,t?de.current=t:r&&(de.current=null),u?.(n,t))}),ge=$(e=>{let t=r.current;if(!h||!t){e||(U.current=null);return}let n=t.style,a=U.current;e?(a||(U.current=[n.transition,n.transform]),n.transition=`none`):a&&([n.transition,n.transform]=a,U.current=null);let o=P.current,s=I.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=fU(o,s.scale)),n.setProperty(i.x,`${c}px`),n.setProperty(i.y,`${l}px`)});function _e(e,t){if(t===null)return;let n=le.current;if(n&&t>n.time){let r=Math.max(t-n.time,sU);ue.current={x:(e.x-n.x)/r,y:(e.y-n.y)/r}}le.current={x:e.x,y:e.y,time:t}}let ve=T.useCallback(()=>{O(void 0),pe(!1),M(!1),he(0),se.current=v,ce.current=null,N.current={x:0,y:0},P.current={x:0,y:0},I.current={x:0,y:0,scale:1},L.current=void 0,R.current=0,z.current=!1,ee.current={x:0,y:0},B.current=null,te.current=!1,F.current=null,ne.current=!1,re.current=null,V.current=!1,ie.current=!1,ae.current={width:0,height:0},H.current=null,le.current=null,ue.current={x:0,y:0},de.current=null,ge(!1)},[pe,v,ge,he]);function ye(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function be(e){return`touches`in e||e.pointerType===`touch`}function xe(e,t){let n=r.current?.getRootNode();return tU(n,e.x,e.y)??pE(t)}function Se(e,t){let n=n=>{let r=eU(e,t,n),i=zD(r);return r===i.body||r===i.documentElement?null:r};return C&&!w?n(`horizontal`):w&&!C?n(`vertical`):n(`vertical`)??n(`horizontal`)}function Ce(e,t,n){V.current=!1;let i=be(e),a=xe(t,e.nativeEvent),l=zD(r.current).body,u=i&&l?Se(a,l):null,d=n?.ignoreScrollableTarget??!1;if(u&&!d||(V.current=!!(u&&d),a&&a.closest(g)&&(!i||o)))return!1;let p=r.current;if(s&&p&&a&&E.length>0&&!(n?.ignoreScrollableAncestors??!1)&&$H(a,p,E))return!1;if(z.current=!1,L.current=void 0,R.current=0,N.current=t,H.current=dU(e.timeStamp),ee.current=t,F.current=t,se.current=v,ce.current=typeof c==`function`?c:null,p){ae.current={width:p.offsetWidth,height:p.offsetHeight},me(_);let t=nU(p);I.current=t,P.current={x:t.x,y:t.y},_e({x:t.x,y:t.y},H.current),`touches`in e||mU(p,e.pointerId,`setPointerCapture`)}return f?.(e.nativeEvent),pe(!0),B.current=null,te.current=!0,he(0),ge(!0),!0}function we(){Te(),V.current=!1,F.current=null}function Te(){ne.current=!1,re.current=null}function Ee(e){if(we(),!fe.current)return;pe(!1),B.current=null;let t=I.current;P.current={x:t.x,y:t.y},O(void 0),ie.current=!1,ge(!1);let n=r.current;n&&mU(n,e.pointerId,`releasePointerCapture`),he(0,{deltaX:0,deltaY:0,direction:void 0}),d?.(e.nativeEvent)}function De(e,t){let n=e=>Math.sign(e)*Math.abs(e)**.5,r=(e,t,r)=>!t&&e<0||!r&&e>0?n(e):e;return{x:C?r(e,y,b):n(e),y:w?r(t,x,S):n(t)}}function Oe(e,t,n){let r=(e,t,n,r,i)=>e>0&&t<=0&&r||e<0&&t>=Math.max(0,n)&&i,i=Math.abs(t),a=Math.abs(n);return w&&n!==0&&(!C||a>=i)?r(n,e.scrollTop,e.scrollHeight-e.clientHeight,S,x):C&&t!==0&&(!w||i>a)?r(t,e.scrollLeft,e.scrollWidth-e.clientWidth,b,y):null}let ke=$(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=ye(e);n&&(ne.current=!0,re.current=n,V.current=!1,ie.current=!(`touches`in e),(!a||a(n,{nativeEvent:e.nativeEvent,direction:_}))&&Ce(e,n)&&Te())});function Ae(e,n,r){if(!t||!fe.current)return;let i=pE(e.nativeEvent);if(be(e)&&!V.current){let t=e.currentTarget;if(Se(i,t))return}if(`touches`in e||e.preventDefault(),te.current&&(te.current=!1,h)){N.current=n;let t=dU(e.timeStamp);t!==null&&(H.current=t)}let a=n.x,o=n.y,s=r.x,c=r.y;(c<0&&o>ee.current.y||c>0&&o<ee.current.y)&&(ee.current={x:ee.current.x,y:o}),(s<0&&a>ee.current.x||s>0&&a<ee.current.x)&&(ee.current={x:a,y:ee.current.y});let l=a-N.current.x,u=o-N.current.y,d=o-ee.current.y,f=a-ee.current.x,p=B.current;p===null&&C&&w&&Math.sqrt(l*l+u*u)>=aU&&(p=Math.abs(l)>Math.abs(u)?`horizontal`:`vertical`,B.current=p);let m;if(!L.current)p===`vertical`?u>0?m=`down`:u<0&&(m=`up`):p===`horizontal`?l>0?m=`right`:l<0&&(m=`left`):m=Math.abs(l)>=Math.abs(u)?l>0?`right`:`left`:u>0?`down`:`up`,m&&(m===`left`&&y||m===`right`&&b||m===`up`&&x||m===`down`&&S)&&(L.current=m,R.current=uU(m,l,u),O(m),me(m));else{let e=L.current,t=uU(e,f,d);t>se.current?(z.current=!1,O(e)):!(y&&b)&&!(x&&S)&&R.current-t>=iU&&(z.current=!0)}let g=De(l,u),v=I.current.x,T=I.current.y;p===`horizontal`?C&&(v+=g.x):(p===`vertical`||C&&(v+=g.x),w&&(T+=g.y));let E=P.current,D=v!==E.x||T!==E.y;P.current={x:v,y:T},D&&ge(!0),_e({x:v,y:T},dU(e.timeStamp));let k=v-I.current.x,A=T-I.current.y,j={deltaX:k,deltaY:A,direction:L.current},M=0,F=_??L.current;if(F){let e=F===`left`||F===`right`?ae.current.width:ae.current.height,t=I.current.scale||1,n=uU(F,k,A);e>0&&t>0&&n>0&&(M=n/(e*t))}he(M,j)}let je=$(e=>{if(!t)return;let i=P.current,a=I.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:L.current};if(!fe.current){we(),he(0,c);return}pe(!1),B.current=null,we(),ie.current=!1;let u=r.current;u&&(`touches`in e||mU(u,e.pointerId,`releasePointerCapture`));let d=o,f=s,m=H.current,h=dU(e.timeStamp),g=m!==null&&h!==null&&h>m?h-m:0,v=g>0?Math.max(g,oU):0,y=v>0?d/v:0,b=v>0?f/v:0,x=ue.current.x,S=ue.current.y,C=le.current;if(C&&h!==null&&h>=C.time){let e=h-C.time;if(e<=cU){let t=Math.max(e,sU),n=i.x-C.x,r=i.y-C.y,a=n/t,o=r/t;a!==0&&(x=a),o!==0&&(S=o)}else x=0,S=0}let w=p?.({event:e.nativeEvent,direction:L.current,deltaX:d,deltaY:f,velocityX:y,velocityY:b,releaseVelocityX:x,releaseVelocityY:S}),T=typeof w==`boolean`;if(z.current&&!T){P.current={x:a.x,y:a.y},O(void 0),ge(!1),he(0,c);return}let E=!1,D;if(T)E=w,D=L.current??_;else for(let e of n)if(uU(e,d,f)>se.current){E=!0,D=e;break}E&&D?(O(D),M(!0),ge(!1),l?.(e.nativeEvent,{direction:D})):(P.current={x:a.x,y:a.y},O(void 0),ge(!1),he(0,c))}),Me=$(e=>{let t=ye(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=pU(e.buttons);if(t&&(ie.current=!0),e.buttons!==0&&!t){Ee(e);return}if(e.buttons===0&&ie.current){if(!fe.current){je(e);return}n=!0}}if(!k&&ne.current){if(!be(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){we();return}if(!a||a(t,{nativeEvent:e.nativeEvent,direction:_})){let n=re.current,i=!1;if(be(e)){let a=r.current;if(n&&a){let r=xe(t,e.nativeEvent),o=zD(a).body,s=o?Se(r,o):null;if(s&&(fE(a,s)||fE(s,a))){let e=Oe(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}Ce(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(Te(),N.current=n,ee.current=n,F.current=n,te.current=!1):(Te(),V.current=!1))}}let i=F.current,o=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};F.current=t,Ae(e,t,o),n&&!(`touches`in e)&&je(e)}),Ne=$((e,t)=>{Me({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),Pe=T.useCallback(()=>{let e=fe.current,t=P.current,n=I.current,r=t.x-n.x,a=t.y-n.y;return!e&&r===0&&a===0&&!j?{[i.x]:`0px`,[i.y]:`0px`}:{transition:e?`none`:void 0,transform:e?fU(t,n.scale):void 0,[i.x]:`${r}px`,[i.y]:`${a}px`}},[j,i]);return{swiping:k,swipeDirection:D,dragDismissed:j,getPointerProps:T.useCallback(()=>t?{onPointerDown:ke,onPointerMove:Me,onPointerUp:je,onPointerCancel:je}:{},[t,je,Me,ke]),getTouchProps:T.useCallback(()=>t?{onTouchStart:ke,onTouchMove:Me,onTouchEnd:je,onTouchCancel:je}:{},[t,je,Me,ke]),moveNative:Ne,getDragStyles:Pe,reset:ve}}var gU=FR,_U=`data-nested-dialog-open`,vU=T.createContext(void 0);function yU(){return T.useContext(vU)}var bU=10,xU=.5,SU=.5,CU=300,wU=4,TU=.2,EU=4,DU=80,OU=360,kU=.1,AU=6,jU=2,MU=`[${SH}]`,NU=T.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=gR(),c=s.context.popupRef,l=s.context.backdropRef,{swipeDirection:u,notifyParentSwipingChange:d,notifyParentSwipeProgressChange:f,frontmostHeight:p,snapToSequentialPoints:m,swipeAreaActiveRef:h}=NH(),g=TH(),{snapPoints:_,resolvedSnapPoints:v,activeSnapPoint:y,activeSnapPointOffset:b,setActiveSnapPoint:x,popupHeight:S}=LH(),C=s.useState(`open`),w=s.useState(`mounted`),E=s.useState(`nested`),D=s.useState(`nestedOpenDrawerCount`),O=s.useState(`viewportElement`),k=s.useState(`popupElement`),A=g?.visualStateStore,j=D>0,M=u===`left`||u===`right`?`horizontal`:`vertical`,N=M===`vertical`,P=N?`horizontal`:`vertical`,[F,I]=T.useState(null),L=T.useRef(void 0),R=T.useRef(null),z=RD(),ee=T.useRef(!1),B=T.useRef(!1),te=T.useRef(``),ne=T.useRef(!1),re=T.useRef(!1),V=T.useRef(null),ie=yU(),ae=T.useMemo(()=>{if(!_||_.length<2||v.length<2||u!==`down`&&u!==`up`)return null;let e=v.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[v,_,u]),oe=T.useMemo(()=>!ae||b===null?null:IP((b-ae.minOffset)/ae.range,0,1),[b,ae]),se=T.useMemo(()=>_&&_.length>0&&(u===`down`||u===`up`)?u===`down`?[`down`,`up`]:[`up`,`down`]:[u],[_,u]),ce=$(e=>{c.current?.toggleAttribute(kH,e),l.current?.toggleAttribute(kH,e)}),H=$(()=>{ce(!1),c.current?.removeAttribute(xE),I(null)}),le=$(()=>{B.current&&(B.current=!1,d?.(!1))}),ue=$((e,t,n)=>{let r=C&&!E&&t,i=r?e:0,a=C&&t?e:0;n&&f&&(f(a),a<=0&&le()),A?.set({swipeProgress:i,frontmostHeight:i>0?p:0});let o=l.current;if(!o)return;let s=r&&i>0;o.style.setProperty(yH,s?`${i}`:`0`),s&&p>0?o.style.setProperty(pH,`${p}px`):o.style.removeProperty(pH)});function de(e,t,n,r,i,a,o,s){let c=LU(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&_&&_.length>0?b??0:0)+uU(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=uU(t,o,s),f=Math.abs(d)>0?d:uU(t,i,a);return f<=TU?null:kU+(IP(u/IP(f,TU,EU),DU,OU)-DU)/280*.9}function fe(e){if(B.current||!e)return;let t=uU(e.direction??u,e.deltaX,e.deltaY);Math.abs(t)<bU||(B.current=!0,d?.(!0))}let U=hU({enabled:w&&!j,directions:se,elementRef:s.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:hH,y:gH},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=c.current,n=zD(t).getSelection?.();if(!n||n.isCollapsed)return;let r=GT(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=GT(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(fE(t,r)||fE(t,i))&&n.removeAllRanges()},onSwipingChange(e){ee.current=e,PU(s.context.backdropRef.current,e),!e&&!f&&le()},swipeThreshold({element:e,direction:t}){return RU(e,t)},canStart(e,t){let n=s.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=tU(n.getRootNode(),e.x,e.y);if(!i||!fE(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&HU(r,n))},onProgress(e,t){let n=ee.current;n&&fe(t);let r=!!(_&&_.length>0);if(n&&u===`down`&&r&&t){let e=s.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(gH,`${PH(b??0,t.deltaY)}px`))}let i=e;if(ae&&S>0){let e=b??ae.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>IP((e-ae.minOffset)/ae.range,0,1))(IP(e+t.deltaY,0,S)):oe!==null&&(i=oe)}n||(f?.(0),le()),ue(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:r,velocityX:i,velocityY:a,releaseVelocityX:o,releaseVelocityY:c}){let l=s.context.popupRef.current;if(!l){H();return}let d=l;function f(e){le(),ce(!0),d.style.removeProperty(`transition`),d.setAttribute(xE,``),$k.flushSync(()=>{I(de(d,e,t,n,i,a,o,c))})}if(!_||_.length===0){if(!r){H();return}let e=uU(r,t,n);if(e<=0)return H(),!1;if(uU(r,i,a)>=xU)return f(r),!0;let o=e>RU(d,r);return o?f(r):H(),o}if(u!==`down`&&u!==`up`){H();return}if(!S)return H(),!1;if(v.length===0){H();return}let p=u===`down`?n:-n,h=Math.sign(p),g=u===`down`?c:-c,C=u===`down`?a:-a,w=g;if(h!==0&&Math.abs(p)>=bU){let e=Math.sign(w);e!==0&&e!==h&&(w=C)}let T=b??0,E=IP(T+p,0,S),D=Math.abs(w)>=SU?IP(w,-4,wU)*CU:0,O=m?E:IP(E+D,0,S),k=gD(mD,e),A=()=>(ue(0,!0,!0),H(),!1),j=e=>(x(e.value,k),A()),M=e=>r?(x(null,k),k.isCanceled?A():(L.current=y,f(u),!0)):j(e);if(m){let e=[...v].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=IH(t,T),r=e[IH(t,O)],i=Math.sign(w),a=h!==0&&i!==0&&i===h&&Math.abs(w)>=SU,o=O;if(a){let t=IP(n+h,0,e.length-1);if(t!==n){let n=e[t];(h>0?O<n.offset:O>n.offset)&&(r=n,o=n.offset)}else if(h>0)return M(r)}return Math.abs(o-S)<Math.abs(o-r.offset)?M(r):j(r)}let N=v[IH(v.map(e=>e.offset),O)];return w>=xU&&p>0||Math.abs(O-S)<Math.abs(O-N.offset)?M(N):j(N)},onDismiss(e){A?.set({swipeProgress:0,frontmostHeight:0});let t=s.context.backdropRef.current;t&&(t.style.setProperty(yH,`0`),t.style.removeProperty(pH));let n=gD(mD,e);if(s.setOpen(!1,n),n.isCanceled){let t=L.current;t!==void 0&&x(t,gD(mD,e)),L.current=void 0,R.current?.(),H();return}if(s.select(`open`)){let t=e;z.request(()=>{if(s.select(`open`)){let e=L.current;e!==void 0&&x(e,gD(mD,t)),L.current=void 0,H(),R.current?.()}else L.current=void 0});return}L.current=void 0,ce(!0)}}),pe=U.getPointerProps(),me=U.getTouchProps(),{moveNative:he,reset:ge}=U;R.current=ge,T.useEffect(()=>{let e=O??k;if(!e)return;let t=e,n=zD(t);function r(e,r,i){let a=N?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||HU(n,t)||!C||!w||j||KU(r,e,i,N))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body){e.cancelable&&e.preventDefault(),e.stopPropagation(),he(e,t);return}if(!qU(o,M)){e.cancelable&&e.preventDefault(),e.stopPropagation();return}if(a!==0){let t=XU(o,M,u,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),he(e,t))}function i(e){if(ie?.onTouchMove(e),re.current)return;let t=V.current,n=e.touches[0];n&&t&&(r(e,t,n),GU(t,n))}return bD(n,`touchmove`,i,{passive:!1,capture:!0})},[w,j,C,k,N,M,u,he,O,ie]),Q(()=>{ae&&!U.swiping&&ue(!C||E?0:oe??0,!0,!1)},[ue,p,E,f,C,oe,ae,U.swiping,s,A]),Q(()=>{if(f)return C||f(0),()=>{f(0)}},[f,C]),Q(()=>{C&&(h.current||ge(),H())},[H,C,ge,h]),Q(()=>{let e=l.current;return()=>{A?.set({swipeProgress:0,frontmostHeight:0}),PU(e,!1);let t=l.current;t!==e&&PU(t,!1),le()}},[l,le,A]);let _e=T.useMemo(()=>({swiping:U.swiping,getDragStyles:U.getDragStyles,swipeStrength:F??null,setSwipeDismissed:ce}),[ce,U.getDragStyles,U.swiping,F]);function ve(e){re.current=e,V.current=null}function ye(){ve(!1),te.current=``,ne.current=!1}function be(e){return te.current=``,e.pointerType!==`touch`}return(0,Z.jsx)(PR,{ref:t,className:r,style:i,render:n,...wk(o,{onPointerDown(e){if(te.current=e.pointerType,ne.current=e.pointerType===`pen`,!C||!w||j)return;let t=tU(e.currentTarget.getRootNode(),e.clientX,e.clientY);FU(t)||IU(t)||e.pointerType!==`touch`&&pe.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&pe.onPointerMove?.(e)},onPointerUp(e){be(e)&&pe.onPointerUp?.(e)},onPointerCancel(e){be(e)&&pe.onPointerCancel?.(e)},onTouchStart(e){if(te.current===`pen`&&ne.current){ne.current=!1,ve(!1);return}if(!C||!w||j){ve(!1);return}let t=e.touches[0];if(!t)return;if(WU(e)){ve(!1);return}let n=e.currentTarget,r=tU(n.getRootNode(),t.clientX,t.clientY),i=pE(e.nativeEvent),a=GT(i)?i:n;if(!fE(n,a)){ve(!0);return}if(ie?.onTouchStart(e),FU(r)){ve(!0);return}re.current=!1;let o=eU(a,n,M),s=eU(a,n,P)!=null,c=null;o&&(c=YU(o,M,u)?null:!1),V.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,scrollTarget:o,hasCrossAxisScrollableContent:s,allowSwipe:c,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},me.onTouchStart?.(e)},onTouchEnd(e){ie?.onTouchEnd(e),ye(),me.onTouchEnd?.(e)},onTouchCancel(e){ie?.onTouchCancel(),ye(),me.onTouchCancel?.(e)},[_U]:void 0}),children:(0,Z.jsx)(RH.Provider,{value:_e,children:a})})});function PU(e,t){e?.toggleAttribute(jH,t)}function FU(e){return!!e?.closest(Yk)}function IU(e){return!!e?.closest(MU)}function LU(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function RU(e,t){return Math.max(LU(e,t)*.5,bU)}function zU(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function BU(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function VU(e,t){let n=GT(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=GT(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||fE(t,n)||fE(t,r)}function HU(e,t){let n=dE(e);if(n&&fE(t,n)&&BU(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:VU(r,t)}function UU(e,t){return e.composedPath().some(e=>zU(e,t))}function WU(e){return UU(e.nativeEvent,HT(e.currentTarget))}function GU(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function KU(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=AU&&s>o+jU?(e.preserveNativeCrossAxisScroll=!0,!0):o>=AU?(e.drawerAxisAttributed=!0,!1):!0}function qU(e,t){return JU(e,t).max>0}function JU(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function YU(e,t,n){let r=ZU(n,t),{offset:i,max:a}=JU(e,t);return r?i<=0:i>=a}function XU(e,t,n,r){return(ZU(n,t)?r>0:r<0)&&YU(e,t,n)}function ZU(e,t){return t===`vertical`?e===`down`:e===`right`}var QU=`image/png,image/jpeg,image/gif,image/webp,.woff2`,$U=1048576,eW=(e,t)=>{let n=e?.lastIndexOf(`/`)??-1;return`${e===void 0||n<0?``:e.slice(0,n+1)}assets/${t}`},tW=e=>{let t=e.lastIndexOf(`.`);return t>e.lastIndexOf(`/`)?e.slice(t):``},nW=e=>Ge(e,`_tag`)&&e._tag===`ProjectFileExists`,rW=e=>Ge(e,`reason`)&&typeof e.reason==`string`?e.reason:`The template project operation failed.`,iW=e=>e.isPublished?`Published`:e.isHead?`Current saved version`:`Saved version`;function aW({file:e,content:t,busy:n,onChange:r,onApply:i,onReplace:a}){let o=e.status===`conflicted`;return(0,Z.jsxs)(`div`,{className:`border-border space-y-3 rounded-lg border p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h4`,{className:`truncate font-mono text-xs font-semibold`,children:e.path}),(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:e.status})]}),e.binary===!0?(0,Z.jsx)(`div`,{className:`space-y-3`,"data-testid":`lifecycle-sheet.binary-file`,children:e.status===`deleted`?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Removed from the draft. Save a version to keep this change.`}):(0,Z.jsxs)(Z.Fragment,{children:[(e.status===`added`||e.status===`modified`)&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Unsaved until you save a version.`}),(0,Z.jsx)(`button`,{type:`button`,disabled:n,"data-testid":`lifecycle-sheet.replace-file`,onClick:a,className:dL(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs disabled:opacity-50`,fL),children:`Replace file`})]})}):o?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Resolve this file below before editing its workspace source.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`textarea`,{"aria-label":`Project source for ${e.path}`,"data-testid":`lifecycle-sheet.file-source.${e.path}`,value:t,onChange:e=>r(e.target.value),disabled:n,spellCheck:!1,className:`border-border bg-surface-inset text-foreground min-h-52 w-full resize-y rounded-md border p-3 font-mono text-xs outline-none disabled:opacity-60`}),(0,Z.jsx)(`button`,{type:`button`,disabled:n||t===e.content,"data-testid":`lifecycle-sheet.apply-file.${e.path}`,onClick:()=>i(t),className:dL(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium disabled:opacity-50`,fL),children:`Apply file`})]})]})}function oW({conflict:e,busy:t,onResolve:n}){let[r,i]=(0,T.useState)(e.draft??e.main??``);return(0,Z.jsxs)(`article`,{className:`border-status-warning/45 space-y-3 rounded-lg border p-4`,children:[(0,Z.jsx)(`h4`,{className:`font-mono text-xs font-semibold`,children:e.path}),(0,Z.jsxs)(`details`,{className:`border-border rounded-md border`,children:[(0,Z.jsx)(`summary`,{className:`hover:bg-muted cursor-pointer px-3 py-2 text-xs font-medium`,children:`Compare base, draft, and main`}),(0,Z.jsx)(`div`,{className:`divide-border border-border divide-y border-t`,children:[[`Base`,e.base],[`Draft`,e.draft],[`Latest saved version`,e.main]].map(([e,t])=>(0,Z.jsxs)(`div`,{className:`space-y-1 p-3`,children:[(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11px] font-medium`,children:e}),(0,Z.jsx)(`pre`,{className:`samva-editor-scroll max-h-32 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:t??`File does not exist`})]},e))})]}),(0,Z.jsx)(`textarea`,{"aria-label":`Resolved source for ${e.path}`,"data-testid":`lifecycle-sheet.conflict-source.${e.path}`,value:r,onChange:e=>i(e.target.value),spellCheck:!1,className:`border-border bg-surface-inset text-foreground min-h-40 w-full resize-y rounded-md border p-3 font-mono text-xs outline-none`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>n(`draft`),"data-testid":`lifecycle-sheet.keep-draft`,className:dL(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,fL),children:`Keep draft`}),(0,Z.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>n(`main`),className:dL(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,fL),children:`Use saved version`}),(0,Z.jsx)(`button`,{type:`button`,disabled:t,"data-testid":`lifecycle-sheet.resolve-edited.${e.path}`,onClick:()=>n({content:r}),className:dL(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium`,fL),children:`Use edited source`})]})]})}function sW({open:e,onClose:t,onLockedAction:n}){return e?(0,Z.jsx)(cW,{onClose:t,onLockedAction:n}):null}function cW({onClose:e,onLockedAction:t}){let n=WR(),r=G(e=>e.doc),i=G(e=>e.lifecycleCapability),{beginLifecycle:a,endLifecycle:o,flushSaves:s,adoptLifecycleSnapshot:c}=G(e=>e.actions),l=r!==null&&i?.status===`ready`,[u,d]=(0,T.useState)(null),[f,p]=(0,T.useState)(null),[m,h]=(0,T.useState)(null),[g,_]=(0,T.useState)({}),[v,y]=(0,T.useState)(()=>l?`loading`:null),b=(0,T.useRef)(null),x=(0,T.useRef)(null),[S,C]=(0,T.useState)(null),[w,E]=(0,T.useState)(null),[D,O]=(0,T.useState)(null),[k,A]=(0,T.useState)(l);if(l!==k&&(A(l),l&&(y(`loading`),d(null),E(null),O(null),p(null),h(null),_({}),C(null))),(0,T.useEffect)(()=>{if(i?.status!==`ready`)return;let e=!1;return s().then(()=>i.api.inspect()).then(t=>{if(e)return;d(t);let n=r?.origin.kind===`tsx`?r.origin.file:void 0;h(e=>e!==null&&t.files.some(({path:t})=>t===e)?e:n!==void 0&&t.files.some(({path:e})=>e===n)?n:t.files[0]?.path??null)}).catch(t=>{e||E(rW(t))}).finally(()=>{e||y(null)}),()=>{e=!0}},[r,s,i]),i===void 0)return null;if(i.status===`locked`)return(0,Z.jsx)(NR,{open:!0,onOpenChange:t=>!t&&e(),children:(0,Z.jsxs)(ER,{container:n,children:[(0,Z.jsx)(_R,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(PR,{className:`fixed inset-0 z-[111] grid place-items-center p-4`,children:(0,Z.jsxs)(TR,{className:`border-border bg-popover w-full max-w-lg rounded-xl border p-5 shadow-[var(--shadow-floating)]`,children:[(0,Z.jsx)(FR,{className:`text-base font-semibold`,children:`Publishing is unavailable`}),(0,Z.jsx)(yR,{className:`text-muted-foreground mt-2 text-sm`,"data-testid":`lifecycle-sheet.locked-reason`,children:i.upsell.reason}),(0,Z.jsx)(`a`,{"data-testid":`lifecycle-sheet.upsell-cta`,className:dL(`bg-primary text-primary-foreground mt-4 inline-flex rounded-md px-3 py-2 text-sm font-medium`,fL),href:i.upsell.cta.href,onClick:e=>{t!==void 0&&(e.preventDefault(),t())},children:i.upsell.cta.label}),(0,Z.jsx)(vR,{className:dL(`border-border hover:bg-muted mt-4 ml-2 inline-flex rounded-md border px-3 py-2 text-sm font-medium`,fL),children:`Close`})]})})]})});let j=u?.commits.find(({commit:e})=>e===f),M=u?.files.find(({path:e})=>e===m),N=M?.content??``,P=M===void 0?void 0:g[M.path],F=P?.baseContent===N?P.content:N,I=u?.files.some(e=>{let t=g[e.path],n=e.content??``;return t?.baseContent===n&&t.content!==n})??!1,L=u!==null&&!u.dirty&&u.conflicts.length===0&&!I,R=u?.commits.find(({commit:e})=>e===u.baseCommit),z=L&&u?.baseCommit===u.remoteHead,ee=async()=>d(await i.api.inspect()),B=()=>{u!==null&&z&&v===null&&a()&&(y(`publish`),E(null),i.api.publish({baseRev:u.rev,commit:u.baseCommit}).then(async()=>{await ee(),O(`Published the current saved version.`)}).catch(e=>E(rW(e))).finally(()=>{o(),y(null)}))},te=()=>{u!==null&&j!==void 0&&!j.isHead&&L&&v===null&&a()&&(y(`restore`),E(null),s().then(e=>i.api.restore({commit:j.commit,baseRev:e})).then(async e=>{c(e),await ee(),p(null),O(`Restored the saved version to the draft. Save a version to keep this restore.`)}).catch(e=>E(rW(e))).finally(()=>{o(),y(null)}))},ne=(e,t)=>{u!==null&&v===null&&a()&&(y(`resolve`),E(null),s().then(n=>i.api.resolveConflict({path:e.path,baseRev:n,resolution:t})).then(t=>{d(t),O(`Resolved ${e.path}.`)}).catch(e=>E(rW(e))).finally(()=>{o(),y(null)}))},re=(e,t)=>{u!==null&&v===null&&(y(`file`),E(null),i.api.updateFile({path:e.path,baseRev:u.rev,content:t}).then(t=>{d(t),_(t=>{let{[e.path]:n,...r}=t;return r}),O(`Updated ${e.path}.`)}).catch(e=>E(rW(e))).finally(()=>y(null)))},V=(e,t,n)=>{u!==null&&v===null&&(y(`file`),E(null),O(null),C(null),i.api.putAsset({path:e,baseRev:u.rev,bytes:t,replace:n}).then(t=>{d(t),h(e),O(`${n?`Replaced`:`Added`} ${e}. Save a version to keep this change.`)}).catch(n=>{nW(n)?C({path:e,bytes:t}):E(rW(n))}).finally(()=>y(null)))},ie=e=>{let t=b.current;t!==null&&(x.current=e===null?null:{replacePath:e},t.accept=e===null?QU:tW(e),t.value=``,t.click())},ae=e=>{let t=x.current;if(x.current=null,e===void 0||u===null)return;if(e.size>$U){O(null),E(`${e.name} is larger than 1 MB. Choose a smaller file.`);return}let n=r?.origin.kind===`tsx`?r.origin.file:void 0,i=t?.replacePath??eW(n,e.name);e.arrayBuffer().then(e=>{let n=new Uint8Array(e);if(t===null&&u.files.some(e=>e.path===i)){E(null),O(null),C({path:i,bytes:n});return}V(i,n,t!==null)}).catch(e=>E(rW(e)))};return(0,Z.jsx)(qH,{open:!0,onOpenChange:t=>!t&&e(),swipeDirection:`right`,children:(0,Z.jsxs)(WH,{container:n,children:[(0,Z.jsx)(bH,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(NU,{className:`pointer-events-none fixed inset-0 z-[111] flex justify-end`,children:(0,Z.jsxs)(UH,{className:`border-border bg-popover pointer-events-auto flex h-full w-full max-w-2xl flex-col border-l shadow-[var(--shadow-floating)]`,children:[(0,Z.jsxs)(`header`,{className:`border-border flex items-center justify-between border-b px-5 py-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(gU,{className:`text-base font-semibold`,children:`Publish and saved versions`}),(0,Z.jsx)(CH,{className:`text-muted-foreground mt-0.5 text-xs`,children:`Save keeps a named version. Restore brings an older version into your draft.`})]}),(0,Z.jsx)(xH,{"data-testid":`lifecycle-sheet.close`,className:dL(`hover:bg-muted rounded-md px-2 py-1 text-sm`,fL),children:`Close`})]}),(0,Z.jsxs)(`div`,{className:`samva-editor-scroll min-h-0 flex-1 space-y-6 overflow-y-auto p-5`,children:[v===`loading`&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Loading saved versions…`}),w!==null&&(0,Z.jsx)(`p`,{className:`text-status-error text-sm`,role:`alert`,children:w}),D!==null&&(0,Z.jsx)(`p`,{className:`text-status-success text-sm`,role:`status`,"data-testid":`lifecycle-sheet.notice`,children:D}),u!==null&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{className:`border-border bg-muted/30 space-y-3 rounded-lg border p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Current saved version`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:R?.message??`Current saved version`})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:B,disabled:!z||v!==null,"data-testid":`lifecycle-sheet.confirm-publish`,className:dL(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-sm font-medium disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:v===`publish`?`Publishing…`:`Publish saved version`})]}),!L&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,"data-testid":`lifecycle-sheet.cleanliness-warning`,children:u.conflicts.length>0?`Resolve workspace conflicts before Save or Publish.`:`The draft has unsaved changes. Save a version before publishing or restoring.`}),L&&u.baseCommit!==u.remoteHead&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`The saved version changed elsewhere. Refresh before publishing.`})]}),(0,Z.jsxs)(`section`,{className:`space-y-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Project files`}),(0,Z.jsx)(`button`,{type:`button`,disabled:v!==null,"data-testid":`lifecycle-sheet.add-file`,onClick:()=>ie(null),className:dL(`border-border hover:bg-muted rounded-md border px-3 py-1.5 text-xs disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:`Add file`}),(0,Z.jsx)(`input`,{ref:b,type:`file`,accept:QU,hidden:!0,"data-testid":`lifecycle-sheet.add-file-input`,onChange:e=>ae(e.target.files?.[0])})]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Add PNG, JPEG, GIF, or WebP images and WOFF2 fonts up to 1 MB.`}),S!==null&&(0,Z.jsxs)(`div`,{className:`border-status-warning/45 space-y-3 rounded-lg border p-3`,"data-testid":`lifecycle-sheet.replace-prompt`,children:[(0,Z.jsxs)(`p`,{className:`text-xs`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:S.path}),` already exists. Replace it with the file you chose?`]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(`button`,{type:`button`,disabled:v!==null,"data-testid":`lifecycle-sheet.confirm-replace`,onClick:()=>V(S.path,S.bytes,!0),className:dL(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:`Replace file`}),(0,Z.jsx)(`button`,{type:`button`,disabled:v!==null,onClick:()=>C(null),className:dL(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:`Cancel`})]})]}),(0,Z.jsx)(`div`,{className:`border-border divide-border divide-y rounded-lg border`,children:u.files.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`lifecycle-sheet.file.${e.path}`,onClick:()=>h(e.path),className:dL(`hover:bg-muted flex w-full items-center justify-between gap-4 px-3 py-2 text-left`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,m===e.path&&`bg-muted`),children:[(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.path}),(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:e.status})]},e.path))}),M!==void 0&&(0,Z.jsx)(aW,{file:M,content:F,busy:v!==null,onChange:e=>_(t=>{if(e===N){let{[M.path]:e,...n}=t;return n}return{...t,[M.path]:{baseContent:N,content:e}}}),onApply:e=>re(M,e),onReplace:()=>ie(M.path)},`${M.path}:${M.content??``}`)]}),u.conflicts.length>0&&(0,Z.jsxs)(`section`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Resolve conflicts`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Choose either side or edit the final file. Save remains blocked until every path is resolved.`})]}),u.conflicts.map(e=>(0,Z.jsx)(oW,{conflict:e,busy:v!==null,onResolve:t=>ne(e,t)},e.path))]}),(0,Z.jsxs)(`section`,{className:`space-y-2`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Saved versions`}),(0,Z.jsx)(`div`,{className:`space-y-2`,children:u.commits.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`lifecycle-sheet.commit.${e.commit}`,onClick:()=>p(e.commit),className:dL(`border-border hover:bg-muted flex w-full items-start justify-between gap-4 rounded-lg border p-3 text-left`,f===e.commit&&`ring-primary ring-2`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:[(0,Z.jsxs)(`span`,{className:`min-w-0`,children:[(0,Z.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.message}),(0,Z.jsx)(`span`,{className:`text-muted-foreground mt-1 block text-xs`,children:e.committedAt.toLocaleString()})]}),(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:iW(e)})]},e.commit))})]}),j!==void 0&&!j.isHead&&(0,Z.jsxs)(`section`,{className:`border-border space-y-3 rounded-lg border p-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Restore saved version`}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:[`Bring “`,j.message,`” into the current draft. Save a version when you want to keep the restored draft.`]})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:te,disabled:!L||v!==null,"data-testid":`lifecycle-sheet.restore`,className:dL(`border-border hover:bg-muted rounded-md border px-3 py-2 text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:v===`restore`?`Restoring…`:`Restore this version`})]})]})]})]})})]})})}function lW({container:e,children:t}){return(0,Z.jsx)(UR,{value:e,children:t})}var uW={desktop:600,mobile:375},dW=`Copy code`;function fW({open:e,onClose:t}){return e?(0,Z.jsx)(pW,{onClose:t}):null}function pW({onClose:e}){let t=WR(),{doc:n,render:r,checks:i,previewDevice:a}=G(iL(e=>({doc:e.doc,render:e.render,checks:e.checks,previewDevice:e.previewDevice}))),[o,s]=(0,T.useState)(`preview`),[c,l]=(0,T.useState)(a),[u,d]=(0,T.useState)(`light`),[f,p]=(0,T.useState)(n?.channel);n?.channel!==f&&(p(n?.channel),s(`preview`));let[m,h]=(0,T.useState)(a);if(a!==m&&(h(a),s(`preview`),l(a),d(`light`)),n===null)return null;let g=n.metadata.fromDefault,_=(e,t)=>({value:e,label:t,testId:`preview-overlay.view.${e}`}),v=n.channel===`email`?[_(`preview`,`Preview`),_(`html`,`HTML`),_(`text`,`Text`),_(`source`,`TSX`)]:n.channel===`sms`?[_(`preview`,`Preview`),_(`text`,`Text`),_(`source`,`TSX`)]:[_(`preview`,`Preview`),_(`payload`,`Payload`),_(`source`,`TSX`)],y=o===`source`?n.origin.authoredSource:o===`html`&&r!==null?r.html:o===`text`&&r!==null?r.text:o===`text`&&n.channel===`sms`&&n.render!==null?n.render.text:o===`payload`&&n.channel===`whatsapp`&&n.render!==null?JSON.stringify(n.render,null,2):``;return(0,Z.jsx)(NR,{open:!0,onOpenChange:t=>!t&&e(),children:(0,Z.jsx)(ER,{container:t,children:(0,Z.jsxs)(TR,{className:`samva-editor-shell fixed inset-0 z-[100] flex flex-col bg-[var(--editor-canvas-bg)] outline-none`,children:[(0,Z.jsx)(FR,{className:`sr-only`,children:`Template preview`}),(0,Z.jsx)(yR,{className:`sr-only`,children:`Preview the rendered template and inspect its generated output.`}),(0,Z.jsxs)(`div`,{"data-testid":`preview-overlay.toolbar`,className:`border-border-subtle flex shrink-0 flex-wrap items-center gap-2 border-b px-3 py-2.5 sm:gap-2.5 sm:px-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-semibold`,children:`Preview`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground hidden text-xs sm:inline`,children:`rendered message, exactly what ships`}),(0,Z.jsx)(uz,{ariaLabel:`Preview format`,testId:`preview-overlay.format-group`,value:o,onChange:e=>s(e),options:v}),(0,Z.jsx)(`span`,{className:`hidden flex-1 sm:block`}),n.channel===`email`&&o===`preview`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(uz,{ariaLabel:`Preview width`,testId:`preview-overlay.width-group`,value:c,onChange:e=>l(e),options:[{value:`desktop`,label:`Desktop`,testId:`preview-overlay.device.desktop`},{value:`mobile`,label:`Mobile`,testId:`preview-overlay.device.mobile`}]}),(0,Z.jsx)(uz,{ariaLabel:`Preview color scheme`,testId:`preview-overlay.color-scheme-group`,value:u,onChange:e=>d(e),options:[{value:`light`,label:`Light`,testId:`preview-overlay.scheme.light`},{value:`dark`,label:`Dark`,testId:`preview-overlay.scheme.dark`}]}),(0,Z.jsx)(KR,{checks:i})]}),(0,Z.jsxs)(vR,{"data-testid":`preview-overlay.close`,className:`border-border text-foreground hover:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 ml-auto inline-flex h-[30px] items-center gap-1.5 rounded-[7px] border px-2.5 outline-none focus-visible:ring-[3px]`,children:[`Close`,(0,Z.jsx)(`kbd`,{className:`text-muted-foreground text-[10px]`,children:`⎋`})]})]}),o===`preview`?n.channel===`email`?(0,Z.jsxs)(`div`,{className:`samva-editor-scroll flex-1 overflow-auto px-6 pt-3 pb-12`,children:[(0,Z.jsxs)(`div`,{"data-testid":`preview-overlay.device-frame`,className:dL(`mx-auto mb-3.5 max-w-full truncate text-[12.5px] text-muted-foreground transition-[width] duration-180`,c===`mobile`?`w-[375px]`:`w-[600px]`),children:[g!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`b`,{className:`text-foreground font-semibold`,children:g.name??g.email}),g.name===void 0?null:(0,Z.jsxs)(Z.Fragment,{children:[` <`,g.email,`>`]}),` ·`,` `]}),(0,Z.jsx)(`b`,{className:`text-foreground font-semibold`,children:r?.subject??``}),r?.preheader!==void 0&&(0,Z.jsxs)(`span`,{className:`opacity-70`,children:[` — `,r.preheader]})]}),(0,Z.jsx)(`div`,{className:dL(`mx-auto h-[calc(100%-2rem)] max-w-full transition-[width] duration-180 ease-out`,c===`mobile`?`w-[375px]`:`w-[600px]`),children:r===null?(0,Z.jsx)(`pre`,{className:`border-status-error/40 bg-background text-status-error rounded-lg border p-4 font-mono text-xs whitespace-pre-wrap`,children:`The current draft did not build, so there is nothing to preview.`}):(0,Z.jsx)(LB,{html:r.html,width:uW[c],forceColorScheme:u})})]}):(0,Z.jsx)(`div`,{className:`samva-editor-scroll flex-1 overflow-auto p-8`,children:(0,Z.jsx)(`div`,{className:`border-border bg-background mx-auto max-w-[460px] rounded-[28px] border p-5 shadow-[var(--shadow-lg)]`,children:n.channel===`sms`&&n.render!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-testid":`preview-overlay.sms-body`,className:`bg-muted rounded-[18px] px-4 py-3 text-[14px] whitespace-pre-wrap`,children:n.render.text}),(0,Z.jsx)(aB,{text:n.render.text,className:`mt-4 text-center text-xs`})]}):n.channel===`whatsapp`&&n.render!==null?(0,Z.jsxs)(`div`,{className:`bg-surface-inset rounded-xl p-3.5`,children:[n.render.header!==void 0&&n.render.header.text!==``&&(0,Z.jsx)(`p`,{className:`mb-1 font-semibold`,children:n.render.header.text}),(0,Z.jsx)(`p`,{className:`whitespace-pre-wrap`,children:n.render.body}),n.render.footer!==void 0&&n.render.footer!==``&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:n.render.footer}),n.render.buttons.map((e,t)=>(0,Z.jsx)(`div`,{className:`border-border-subtle text-accent-email mt-2 border-t pt-2 text-center text-xs`,children:e.type===`copy-code`?dW:e.text},`${e.type}-${t}`))]}):(0,Z.jsx)(`pre`,{className:`text-status-error whitespace-pre-wrap`,children:`The current draft did not build, so there is nothing to preview.`})})}):(0,Z.jsx)(`div`,{className:`samva-editor-scroll flex-1 overflow-auto p-6`,children:(0,Z.jsx)(`pre`,{className:`border-border bg-background text-foreground mx-auto min-h-full max-w-[1100px] rounded-lg border p-5 font-mono text-[12px] leading-5 whitespace-pre-wrap`,children:y})})]})})})}var mW=`text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,hW=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,gW=/^\+[1-9]\d{6,14}$/,_W=(e,t)=>Ge(e,`reason`)&&typeof e.reason==`string`?e.reason:Ge(e,`_tag`)&&e._tag===`DocumentConflict`?`The template changed since you opened this. Reopen the sheet and retry.`:t,vW=()=>{let e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)},yW=e=>new Date(Ol(e)).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}),bW={idle:`Send test to me`,sending:`Sending…`,sent:`Test sent`,error:`Retry test`},xW=(e,t)=>e===`sending`?t?`Scheduling…`:`Sending…`:e===`sent`?t?`Scheduled`:`Sent`:e===`error`?`Retry`:t?`Schedule`:`Send now`;function SW({open:e,onClose:t,onLockedAction:n}){let r=WR(),i=G(e=>e.doc),a=G(e=>e.sendCapability),{flushSaves:o}=G(e=>e.actions),[s,c]=(0,T.useState)({}),[l,u]=(0,T.useState)([]),[d,f]=(0,T.useState)(``),[p,m]=(0,T.useState)(``),[h,g]=(0,T.useState)(`idle`),[_,v]=(0,T.useState)(null),[y,b]=(0,T.useState)(`idle`),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(null),E=(i?.variables??[]).map(e=>e.name).join(`\0`),D=i===null?``:[i.channel,i.id??``,i.origin.file].join(`\0`),O=(0,T.useRef)(!1),k=(0,T.useRef)(null),A=(0,T.useRef)(null);if((0,T.useEffect)(()=>{let n=e&&!O.current,r=e&&O.current&&A.current!==null&&A.current!==D,a=e&&O.current&&k.current!==E;(n||r||a)&&i!==null&&c(Object.fromEntries(i.variables.map(e=>[e.name,e.sample??``]))),(n||r)&&(u([]),f(``),m(``),g(`idle`),v(null),b(`idle`),S(null),w(null)),r&&t(),O.current=e,k.current=e?E:null,A.current=e&&i!==null?D:null},[e,E,D,i,t]),a===void 0)return null;let j=a.status===`ready`?a:null,M=i?.channel??`email`,N=M===`email`?`email address`:`E.164 phone number`,P=M===`email`?`email addresses`:`E.164 phone numbers`,F=M===`email`?hW:gW,I=j?.api.testRecipient??(M===`email`&&i?.metadata.fromDefault?.email!==void 0?{address:i.metadata.fromDefault.email}:void 0),L=()=>Object.fromEntries((i?.variables??[]).map(e=>{let t=s[e.name];return[e.name,t&&t.trim()!==``?t:e.sample??``]})),ee=e=>{let t=e.split(/[\s,]+/).map(e=>e.trim()).filter(e=>e!==``),n=[],r=[];for(let e of t)(F.test(e)?n:r).push(e);return n.length>0&&u(e=>M===`email`?[...e,...n.filter(t=>!e.includes(t))]:[n[n.length-1]]),r.join(` `)},B=e=>u(t=>t.filter(t=>t!==e)),te=e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),f(ee(d))):e.key===`Backspace`&&d===``&&l.length>0&&B(l[l.length-1])},ne=()=>{let e=d.trim(),t=e!==``&&F.test(e)&&!l.includes(e)?[e]:[];return[...l,...t]},re=p!==``,V=ne().length,ie=I??(M!==`email`&&V===1?{address:ne()[0]}:void 0),ae=i!==null&&j!==null&&ie!==void 0&&h!==`sending`,oe=i!==null&&j!==null&&(M===`email`?V>0:V===1)&&y!==`sending`;return(0,Z.jsx)(qH,{open:e,onOpenChange:e=>!e&&t(),swipeDirection:`right`,children:(0,Z.jsxs)(WH,{container:r,children:[(0,Z.jsx)(bH,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(NU,{className:`pointer-events-none fixed inset-0 z-[111] flex justify-end`,children:(0,Z.jsxs)(UH,{className:`samva-editor-shell border-border bg-background pointer-events-auto flex h-full w-[420px] max-w-[92vw] flex-col border-l shadow-[var(--shadow-floating)] outline-none`,children:[(0,Z.jsxs)(gU,{className:`sr-only`,children:[`Send `,M,` template`]}),(0,Z.jsx)(CH,{className:`sr-only`,children:`Choose recipients, template variables, and an optional schedule before sending.`}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-5 pt-4 pb-3`,children:[(0,Z.jsxs)(`span`,{className:`text-[15px] font-semibold`,children:[`Send “`,i?.name??`template`,`”`]}),(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(xH,{type:`button`,"aria-label":`Close send panel`,"data-testid":`send-sheet.close`,className:`text-muted-foreground hover:bg-muted hover:text-foreground rounded-md p-1.5`}),children:(0,Z.jsx)(Se,{className:`size-[15px]`})}),(0,Z.jsx)(gN,{container:r,children:(0,Z.jsx)(zN,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Close send panel`})})})]})]}),a.status===`locked`?(0,Z.jsx)(CW,{reason:a.upsell.reason,cta:a.upsell.cta,onAction:n}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`samva-editor-scroll min-h-0 flex-1 overflow-y-auto px-5 pb-5`,children:[(0,Z.jsx)(`div`,{className:dL(`mt-4 mb-1.5`,mW),children:`To`}),(0,Z.jsxs)(`div`,{className:`border-border focus-within:border-ring focus-within:ring-ring/50 flex min-h-[34px] flex-wrap items-center gap-2 rounded-lg border px-2.5 py-1.5 text-[13px] focus-within:ring-[3px]`,children:[l.map(e=>(0,Z.jsxs)(`span`,{className:`bg-muted inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-[12.5px]`,children:[e,(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,"data-testid":`send-sheet.recipient-remove.${e}`,onClick:()=>B(e),className:`text-muted-foreground hover:text-foreground`}),children:(0,Z.jsx)(Se,{className:`size-2.5`})}),(0,Z.jsx)(gN,{container:r,children:(0,Z.jsx)(zN,{side:`top`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Remove ${e}`})})})]})]},e)),(0,Z.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),onKeyDown:te,onBlur:()=>f(ee(d)),placeholder:l.length===0?`Add ${P}…`:``,spellCheck:!1,autoComplete:`off`,className:`text-foreground placeholder:text-placeholder min-w-[8ch] flex-1 bg-transparent text-[13px] outline-none`,"aria-label":`Add recipient ${N}`,"data-testid":`send-sheet.recipient-input`})]}),(0,Z.jsx)(`div`,{className:dL(`mt-4 mb-1.5`,mW),children:`From`}),(0,Z.jsxs)(`div`,{className:`border-border flex min-h-[34px] items-center gap-2 rounded-lg border px-2.5 py-1.5 text-[13px]`,children:[M===`email`&&i?.metadata.fromDefault?i.metadata.fromDefault.name?`${i.metadata.fromDefault.name} <${i.metadata.fromDefault.email}>`:i.metadata.fromDefault.email:M===`email`?`No default sender`:`Managed by channel settings`,(0,Z.jsx)(`span`,{className:`text-placeholder ml-auto text-[11px]`,children:M===`email`?`template default`:M})]}),(0,Z.jsx)(`div`,{className:dL(`mt-4 mb-1.5`,mW),children:`Variables`}),(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground mb-2 rounded-lg border px-2.5 py-2 text-[11.5px]`,children:`Detected from the document. Values fill per recipient at send time; blank falls back to the sample.`}),(i?.variables??[]).map(e=>(0,Z.jsxs)(`div`,{className:`mt-2 flex items-center gap-2.5`,children:[(0,Z.jsx)(sz,{name:e.name,className:`shrink-0`}),(0,Z.jsx)(`input`,{value:s[e.name]??``,onChange:t=>c(n=>({...n,[e.name]:t.target.value})),placeholder:e.sample??`value`,spellCheck:!1,"data-testid":`send-sheet.variable-input.${e.name}`,className:dL(`border-border text-foreground placeholder:text-placeholder h-[30px] min-w-0 flex-1 rounded-lg border px-2.5 text-[13px] outline-none`,fL)})]},e.name)),(0,Z.jsx)(`div`,{className:dL(`mt-4 mb-1.5`,mW),children:`Schedule`}),(0,Z.jsxs)(`div`,{className:`border-border focus-within:border-ring focus-within:ring-ring/50 flex min-h-[34px] items-center gap-2 rounded-lg border px-2.5 py-1.5 text-[13px] focus-within:ring-[3px]`,children:[(0,Z.jsx)(z,{className:`text-muted-foreground size-[14px] shrink-0`}),(0,Z.jsx)(`input`,{type:`datetime-local`,value:p,min:vW(),onChange:e=>m(e.target.value),"aria-label":`Schedule send time`,"data-testid":`send-sheet.schedule-input`,className:`text-foreground min-w-0 flex-1 bg-transparent text-[13px] [color-scheme:light] outline-none dark:[color-scheme:dark]`}),re?(0,Z.jsx)(`button`,{type:`button`,title:`Clear schedule`,onClick:()=>m(``),className:`text-muted-foreground hover:text-foreground shrink-0 text-[11px]`,children:`Send now`}):(0,Z.jsx)(`span`,{className:`text-placeholder shrink-0 text-[11px]`,children:`Sends immediately`})]}),(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground mt-2.5 rounded-lg border px-2.5 py-2 text-[11.5px]`,children:`Test send goes to you with the values above. The real send fills in each recipient.`})]}),(0,Z.jsxs)(`div`,{className:`border-border border-t px-5 py-3.5`,children:[h===`error`&&_!==null&&(0,Z.jsx)(`p`,{className:`text-status-error mb-2 text-[11.5px]`,children:_}),y===`error`&&x!==null&&(0,Z.jsx)(`p`,{className:`text-status-error mb-2 text-[11.5px]`,children:x}),y===`sent`&&C!==null&&(0,Z.jsx)(`p`,{className:`text-status-success mb-2 text-[11.5px]`,children:C}),j!==null&&ie===void 0&&(0,Z.jsxs)(`p`,{className:`text-muted-foreground mb-2 text-[11.5px]`,children:[`No `,M===`email`?`viewer email`:`viewer phone number`,` is available for a test send.`]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{ae&&i!==null&&j!==null&&(g(`sending`),v(null),o().then(e=>j.api.sendTest({channel:i.channel,to:ie,variables:L(),baseRev:e})).then(()=>g(`sent`)).catch(e=>{g(`error`),v(_W(e,`Test send failed. Try again.`))}))},disabled:!ae,"data-testid":`send-sheet.send-test`,title:ie===void 0?`No test ${N} is available`:void 0,className:dL(`inline-flex h-9 flex-1 items-center justify-center gap-1.5 rounded-[7px] border border-border transition-colors hover:bg-muted disabled:opacity-60 disabled:hover:bg-transparent`,h===`sent`&&`border-status-success/40 text-status-success`,h===`error`&&`border-status-error/40 text-status-error`),children:[h===`sending`&&(0,Z.jsx)(ce,{className:`size-[15px] animate-spin`}),h===`sent`&&(0,Z.jsx)(R,{className:`size-[15px]`}),bW[h]]}),(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{let e=ne();j!==null&&i!==null&&e.length!==0&&y!==`sending`&&(b(`sending`),S(null),w(null),o().then(t=>j.api.send({channel:i.channel,to:e.map(e=>({address:e})),variables:L(),schedule:re?new Date(p).toISOString():null,baseRev:t})).then(e=>{b(`sent`),w(e.kind===`scheduled`?`Scheduled to send ${yW(e.scheduledFor)}. Delivery status shows up in Activity.`:`Sent. Track delivery in Activity.`)}).catch(e=>{b(`error`),S(_W(e,`Send failed. Try again.`))}))},disabled:!oe,"data-testid":`send-sheet.send`,className:dL(`inline-flex h-9 flex-1 items-center justify-center gap-1.5 rounded-[7px] bg-primary font-medium text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-60`,y===`sent`&&`bg-status-success`),children:[y===`sending`&&(0,Z.jsx)(ce,{className:`size-[15px] animate-spin`}),y===`sent`&&(0,Z.jsx)(R,{className:`size-[15px]`}),xW(y,re)]})]})]})]})]})})]})})}function CW({reason:e,cta:t,onAction:n}){return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-start gap-4 px-5 pt-6 pb-8`,children:[(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground rounded-lg border px-3.5 py-3 text-[13px]`,children:e}),(0,Z.jsx)(`a`,{href:t.href,onClick:e=>{n!==void 0&&(e.preventDefault(),n())},"data-testid":`send-sheet.upsell-cta`,className:`bg-primary text-primary-foreground inline-flex h-9 items-center rounded-[7px] px-4 font-medium transition-opacity hover:opacity-90`,children:t.label})]})}var wW=T.createContext(void 0);function TW(e){let t=T.useContext(wW);if(t===void 0&&!e)throw Error(pT(47));return t}var EW={...SM,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},DW=class extends Kj{constructor(e,t,n){let r=new hM;super(OW(e,r,t,n),kW(r),EW)}setOpen=(e,t)=>{let n=t.reason===tD,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=cM(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=sM(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),$k.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function OW(e,t,n,r=!1){let i={...gM(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function kW(e){return{popupRef:T.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:T.createRef(),beforeContentFocusGuardRef:T.createRef(),stickIfOpenTimeout:new vT,triggerElements:e}}var AW=oT(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=MW(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),mM(u,d),dM(u);let{forceUnmount:m}=fM(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),T.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),T.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,gD(pD))}),[m,u]);let h=d||f;return(0,Z.jsxs)(wW.Provider,{value:u,children:[s&&(0,Z.jsx)(iM,{handle:s,store:u}),h&&(0,Z.jsx)(NW,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function jW(e){return TW(!0)?(0,Z.jsx)(AW,{props:e}):(0,Z.jsx)(pA,{children:(0,Z.jsx)(AW,{props:e})})}function MW(e,t){let n=rM((e,n)=>new DW(t,e,n));return T.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function NW({store:e,modal:t}){let n=AA(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return pM(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var PW=sT(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=TW(!0),h=CM(s)??m;if(!h)throw Error(pT(74));let g=oN(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=T.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=uM(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=IM(v,{enabled:!a&&l&&(D!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:$M(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=wA(v,{stickIfOpen:E}),j=PP(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,C),{getButtonProps:N,buttonRef:P}=JP({disabled:a,native:o}),F={open(e){return e&&w===`trigger-press`?IE.open(e):FE.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=BV(h,x),z=Rk(`button`,e,{state:{disabled:a,open:y},ref:[P,t,S,x],props:[A.reference,k,M,j,{[Kk]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,N],stateAttributesMapping:F}),ee=(0,Z.jsx)(T.Fragment,{children:z},g);return C&&!O?(0,Z.jsxs)(T.Fragment,{children:[(0,Z.jsx)(UD,{ref:I,onFocus:L}),ee,(0,Z.jsx)(UD,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):ee}),FW=T.createContext(void 0);function IW(){let e=T.useContext(FW);if(e===void 0)throw Error(pT(45));return e}var LW=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return TW().useState(`mounted`)||n?(0,Z.jsx)(FW.Provider,{value:n,children:(0,Z.jsx)(iA,{ref:t,...r})}):null}),RW=T.createContext(void 0);function zW(){let e=T.useContext(RW);if(!e)throw Error(pT(46));return e}var BW=T.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=Zk,..._}=e,v=TW(),y=IW(),b=dA(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),N=T.useRef(null),P=$j(k),F=PN({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:M}),I=x.useState(`domReferenceElement`);Q(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return P(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,v]);let L=D===!0&&w!==`trigger-hover`;AF(C&&L,O===`touch`,k,E);let R=v.useStateSetter(`positionerElement`),z=RN(e,{open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:_,refs:[t,R],hidden:!S,inert:!C});return(0,Z.jsxs)(RW.Provider,{value:F,children:[S&&L&&(0,Z.jsx)(hF,{inert:VN(!C),cutout:E}),(0,Z.jsx)(fA,{id:b,children:z})]})}),VW=T.createContext(void 0);function HW(){let[e,t]=T.useState(0),n=$(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:T.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var UW=T.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=TW(),l=zW(),u=IF(!0)!=null,{context:d,hasClosePart:f}=HW(),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`);eM({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),PM(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?nM(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Rk(`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`,...tM,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&VF.has(e.key)&&e.stopPropagation()}},LN(g),s],stateAttributesMapping:RE});return(0,Z.jsx)(CA,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:KT(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Z.jsx)(VW.Provider,{value:d,children:M})})});function WW({saveVersionStatus:e,saveVersionState:t,onSaveVersion:n,saveVersionBusy:r,saveVersionBlocked:i,guestHeadline:a}){let o=WR(),{doc:s,checks:c,sizeKb:l,deviceWidth:u,layoutMode:d}=G(iL(e=>({doc:e.doc,checks:e.checks,sizeKb:e.sizeKb,deviceWidth:Pw[e.previewDevice],layoutMode:e.layoutMode}))),{selectDocument:f}=G(e=>e.actions),p=G(e=>e.sourceEditable),m=G(e=>e.pendingAuthoredSource),h=G(iL(e=>({storageError:e.storageError,conflict:e.conflict}))),[g,_]=(0,T.useState)(!1),{errorCount:v,warnCount:y}=Aw(c),b=d===`compact`||d===`narrow`,x=c.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===`unverified`)).length,S=`No known risks found`;x>0&&(S=`No known risks · ${x} need verification`),y>0&&(S=`${y} warning${y>1?`s`:``}`),v>0&&(S=`${v} check${v>1?`s`:``} failing`),c.length===0&&(S=`No checks yet`);let C=t===`error`||h.storageError!==null||h.conflict?`Couldn't save version`:m!==null||r===!0?`Saving…`:void 0;return(0,Z.jsxs)(`footer`,{className:`border-border bg-background text-muted-foreground z-30 flex min-h-8 items-center gap-4 border-t px-3.5 py-1 text-[11.5px]`,children:[(0,Z.jsxs)(jW,{open:g,onOpenChange:_,children:[(0,Z.jsxs)(PW,{"data-testid":`statusbar.checks-trigger`,"aria-label":d===`narrow`?S:void 0,onClick:()=>f(),className:dL(`inline-flex shrink-0 items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors hover:bg-muted hover:text-foreground`,a===void 0&&(d===`narrow`?`w-6`:`w-[clamp(96px,18vw,240px)]`),g&&`bg-muted text-foreground`),children:[(0,Z.jsx)(`span`,{className:dL(`size-[7px] shrink-0 rounded-full`,v>0?`bg-status-error`:y>0?`bg-status-warning`:`bg-muted-foreground`)}),a===void 0&&d!==`narrow`?(0,Z.jsx)(`span`,{className:`truncate`,children:S}):null]}),(0,Z.jsx)(LW,{container:o,children:(0,Z.jsx)(BW,{side:`top`,align:`start`,sideOffset:8,collisionPadding:12,className:`z-[80] outline-none`,children:(0,Z.jsx)(UW,{"data-testid":`statusbar.checks-popup`,className:`samva-editor-shell border-border bg-surface-elevated max-h-[min(560px,70vh)] w-[360px] origin-[var(--transform-origin)] overflow-y-auto rounded-xl border p-3.5 shadow-[var(--shadow-xl)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0`,children:(0,Z.jsx)(GR,{checks:c,editable:p})})})})]}),a===void 0?!b&&(0,Z.jsx)(`span`,{className:`w-[52px] shrink-0`,children:s===null?`Loading…`:`Draft`}):(0,Z.jsx)(`span`,{"data-testid":`statusbar.guest`,className:`min-w-0 truncate`,children:C??a}),a===void 0?(0,Z.jsx)(`span`,{"aria-live":`polite`,"data-testid":`statusbar.save-version`,"data-save-version-state":t??`unavailable`,className:dL(`truncate`,d===`narrow`?`min-w-0 flex-1`:`w-[150px] shrink-0`),children:e??`Autosaved just now`}):(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"data-testid":`statusbar.save-version`,"data-save-version-state":t??`unavailable`,children:C??e??a}),n!==void 0&&(0,Z.jsx)(`button`,{type:`button`,onClick:n,disabled:r===!0||i===!0,"data-testid":`topbar.save-version`,"aria-label":`Save the current draft as a version`,title:`Save this draft as a version (⌘/Ctrl+S)`,className:`hover:bg-muted hover:text-foreground w-[82px] shrink-0 rounded-md px-1.5 py-0.5 text-left transition-colors`,children:r===!0?`Saving…`:e===`Couldn’t save version`?`Retry`:`Save version`}),(0,Z.jsx)(`span`,{className:`flex-1`}),!b&&(0,Z.jsxs)(`span`,{className:`w-10 shrink-0 text-right`,children:[l,` KB`]}),d!==`narrow`&&(0,Z.jsx)(`span`,{className:`w-[42px] shrink-0 text-right`,children:s?.channel===`email`?`${u}px`:s?.channel.toUpperCase()??``})]})}var GW=W.check(Kp(/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/));W.check(em(1),tm(120)),W.check(tm(32768));var KW=W.check(tm(2048),Kp(/^https:\/\/[^\s]+$/)),qW=jp({street1:W.check(em(1)),street2:Cp(W),city:W.check(em(1)),region:W,postalCode:W,country:W.check(em(1))}).annotate({identifier:`BrandAddress`}),JW=jp({label:W.check(em(1),tm(64)),url:KW}).annotate({identifier:`BrandSocialLink`}),YW=jp({logoUrl:Cp(KW),logoDarkUrl:Cp(KW),iconUrl:Cp(KW)}).annotate({identifier:`BrandAssets`}),XW=jp({companyName:Cp(W.check(tm(255))),address:Cp(qW),socialLinks:Cp(Np(JW).check(tm(12)))}).annotate({identifier:`BrandFooter`}),ZW=jp({html:W,text:W}).annotate({identifier:`BrandFooterBlock`}),QW=jp({withUnsubscribe:ZW,withoutUnsubscribe:ZW}).annotate({identifier:`BrandRenderedFooter`});bm()(`BrandAddressRequiredError`,{message:W,brand:Lp(W)},{httpApiStatus:422});var $W=jp({slug:GW,isDefault:kp,css:W,assets:YW,footer:XW,renderedFooter:Lp(QW),digest:W.check(Kp(/^[a-f0-9]{64}$/))}).annotate({identifier:`WorkspaceBrand`}),eG=524288;Np($W).check(Gp(e=>new TextEncoder().encode(JSON.stringify(e)).length<=eG,{message:`A brand set must not exceed ${eG} bytes.`})),bm()(`CampaignFooterRequiredError`,{message:W},{httpApiStatus:422});var tG=`theme.css`,nG=`starter.css`,rG=`samva:brand`,iG=`@import "./${nG}";`,aG=`@import "${rG}";`,oG=yp(GW),sG=/@import(?![\w-])/iy,cG=(e,t)=>{let n=e[t],r=t+1;for(;r<e.length;){let t=e[r];if(t===`\\`)r+=2;else if(t===n||t===`
28
- `)return r+1;else r+=1}return e.length},lG=(e,t)=>{let n=e.indexOf(`*/`,t+2);return n===-1?e.length:n+2},uG=e=>{let t=``,n=0;for(;n<e.length;)if(e.startsWith(`/*`,n))n=lG(e,n),t+=` `;else if(e[n]===`"`||e[n]===`'`){let r=cG(e,n);t+=e.slice(n,r),n=r}else t+=e[n],n+=1;return t},dG=e=>{let t=e[0];if(!(t!==`"`&&t!==`'`||e.length<2||e.at(-1)!==t))return e.slice(1,-1)},fG=e=>{let t=uG(e).trim(),n=/^url\(\s*(.*?)\s*\)$/is.exec(t);if(n!==null){let e=n[1]??``;return dG(e)??(/^[^\s"'()]+$/.test(e)?e:void 0)}return dG(t)},pG=e=>{let t=[],n=0,r=0;for(;r<e.length;){let i=e[r];if(i===`/`&&e[r+1]===`*`){r=lG(e,r);continue}if(i===`"`||i===`'`){r=cG(e,r);continue}if(i===`{`)n+=1;else if(i===`}`)n=Math.max(0,n-1);else if(i===`@`&&n===0&&(sG.lastIndex=r,sG.test(e))){let n=sG.lastIndex,i=n;for(;i<e.length&&e[i]!==`;`;)e.startsWith(`/*`,i)?i=lG(e,i):e[i]===`"`||e[i]===`'`?i=cG(e,i):i+=1;let a=Math.min(i+1,e.length);t.push({target:fG(e.slice(n,i)),end:a}),r=a;continue}r+=1}return t},mG=e=>{if(e===rG)return{slug:null};let t=`${rG}/`;if(e===void 0||!e.startsWith(t))return;let n=e.slice(t.length);return oG(n)?{slug:n}:void 0},hG=e=>{let t=e?.replace(/[?#].*$/,``);return t===`./starter.css`||t===`/starter.css`},gG=e=>{for(let{target:t}of pG(e)){let e=mG(t);if(e!==void 0)return e}return null},_G=e=>{let t=e.theme??``;if(gG(t)!==null)return t;let n=pG(t).find(({target:e})=>hG(e));if(n!==void 0)return`${t.slice(0,n.end)}\n${aG}${t.slice(n.end)}`;let r=[...e.starter?[iG]:[],aG].join(`
29
- `);return t.length===0?`${r}\n`:`${r}\n${t.startsWith(`
30
- `)?``:`
31
- `}${t}`},vG=(e,t)=>{if(e===void 0)return{kind:`pending`};let n=t?.find(({isDefault:e})=>e)??null;if(e===null)return{kind:`none`,defaultBrand:n};if(t===null)return{kind:`pending`};let r=e.slug===null?n:t.find(({slug:t})=>t===e.slug);return r==null?{kind:`missing`,slug:e.slug}:{kind:`brand`,brand:r}},yG=dL(`border-border-subtle bg-surface-inset text-muted-foreground inline-flex h-[22px] min-w-0 max-w-[180px] items-center gap-1 rounded-md border px-2 text-[11.5px] font-medium outline-none`,fL),bG=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;function xG({source:e,onUseDefault:t}){let n=G(e=>e.doc?.rev??null),r=G(e=>e.editable&&e.lifecycleCapability?.status===`ready`),i=(0,T.useRef)(e.readTheme);(0,T.useEffect)(()=>{i.current=e.readTheme});let[a,o]=(0,T.useState)(void 0),[s,c]=(0,T.useState)(`idle`);(0,T.useEffect)(()=>{if(n===null)return;let e=!1;return i.current().then(t=>{e||o(gG(t.theme??``))},()=>void 0),()=>{e=!0}},[n]);let l=vG(a,e.brands);if(l.kind===`pending`)return e.status??null;let u;if(l.kind===`brand`){let{name:t,slug:n}=l.brand,r=e.brandLink(n);u=(0,Z.jsxs)(`a`,{href:r.href,"aria-label":`Brand: ${t}`,title:`Open ${t}`,"data-testid":`topbar.brand`,onClick:e=>{r.navigate!==void 0&&bG(e)&&(e.preventDefault(),r.navigate())},className:dL(yG,`hover:bg-muted hover:text-foreground`),children:[(0,Z.jsx)(fe,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:t})]})}else if(l.kind===`missing`)u=(0,Z.jsxs)(`span`,{"data-testid":`topbar.brand-missing`,title:l.slug===null?`This organization has no default brand.`:`This organization has no brand “${l.slug}”.`,className:dL(yG,`text-status-warning`),children:[(0,Z.jsx)(fe,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:`Brand not found`})]});else{let e=l.defaultBrand,n=r&&t!==void 0&&e!==null?()=>{c(`busy`),t().then(()=>c(`idle`),()=>c(`error`))}:void 0;u=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-testid":`topbar.brand-none`,className:yG,children:[(0,Z.jsx)(fe,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:`No brand`})]}),n!==void 0&&e!==null&&(0,Z.jsx)(`button`,{type:`button`,"data-testid":`topbar.brand-use`,onClick:n,disabled:s===`busy`,"aria-busy":s===`busy`,title:`Theme this template with ${e.name}`,className:dL(`text-foreground hover:bg-muted inline-flex h-[22px] max-w-[180px] items-center rounded-md px-1.5 text-[11.5px] font-medium outline-none disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:(0,Z.jsxs)(`span`,{className:`truncate`,children:[`Use `,e.name]})}),s===`error`&&e!==null&&(0,Z.jsxs)(`span`,{role:`alert`,className:`text-status-error truncate text-[11.5px]`,children:[`Couldn’t use `,e.name]})]})}return(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink items-center gap-1`,children:[u,e.status]})}var SG=[];function CG(){let{doc:e,fixtures:t,fixture:n,busy:r,available:i}=G(iL(e=>({doc:e.doc,fixtures:e.doc?.fixtures??SG,fixture:e.doc?.fixture??null,busy:e.fixtureBusy,available:e.fixtureCapability?.status===`ready`}))),{viewFixture:a}=G(e=>e.actions);if(!i)return null;let o=n!==null&&t.length>=2;return e!==null&&!o?null:(0,Z.jsx)(`div`,{className:`w-[116px] shrink-0`,"data-testid":`topbar.fixture-slot`,children:o&&(0,Z.jsxs)(`label`,{className:`text-muted-foreground flex items-center text-[12px]`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:`Fixture`}),(0,Z.jsx)(`select`,{"data-testid":`topbar.fixture`,value:n,disabled:r,onChange:e=>a(e.target.value),title:`Render another declared fixture`,className:dL(`border-border bg-background text-foreground h-[30px] w-full rounded-[7px] border px-2 text-[12px] outline-none`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:t.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))})]})})}function wG({leading:e,extraActions:t,onBack:n,onUndo:r,onRedo:i,canUndo:a=!1,canRedo:o=!1,onPreview:s,onSend:c,onLifecycle:l,channelSwitcher:u,exportEnabled:d,onExport:f,renameEnabled:p=!0,brand:m,onUseDefaultBrand:h}){let{doc:g,render:_,pendingAuthoredSource:v,sendCapability:y,lifecycleCapability:b,editable:x,readonlyReason:S,renameActive:C,metadataError:w,layoutMode:E}=G(iL(e=>({doc:e.doc,render:e.render,pendingAuthoredSource:e.pendingAuthoredSource,sendCapability:e.sendCapability,lifecycleCapability:e.lifecycleCapability,editable:e.editable,readonlyReason:e.readonlyReason,renameActive:e.renameActive,metadataError:e.metadataError,layoutMode:e.layoutMode}))),{rename:D,setRenameActive:O}=G(e=>e.actions),k=(0,T.useRef)(null),A=g?.name??`Untitled template`;(0,T.useEffect)(()=>{if(C&&k.current){k.current.focus();let e=document.createRange();e.selectNodeContents(k.current);let t=window.getSelection();t?.removeAllRanges(),t?.addRange(e)}},[C]);let j=y!==void 0,M=y?.status===`locked`?y.upsell.reason:`Send a test`,N=d===!0&&g?.channel===`email`&&_!==null&&v===null,P=E===`compact`||E===`narrow`,I=E===`standard`,L=()=>{N&&g!==null&&_!==null&&(dH(_.html,g.name),f?.())};return(0,Z.jsxs)(`header`,{className:dL(`z-30 flex min-w-0 flex-col border-b border-border bg-background/92 px-3 backdrop-blur-md`,P?`h-[92px]`:`h-12`),children:[(0,Z.jsxs)(`div`,{className:`flex h-12 min-w-0 shrink-0 items-center gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[e!==void 0&&(0,Z.jsx)(`div`,{className:`mr-1 shrink-0`,children:e}),n!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(lz,{title:`Back to templates`,className:`gap-1.5`,onClick:n,testId:`topbar.back`,children:[(0,Z.jsx)(F,{className:`size-[15px]`}),`Templates`]}),(0,Z.jsx)(`div`,{className:`bg-border mx-1 h-[18px] w-px`})]}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(`span`,{ref:k,"data-testid":`topbar.name`,contentEditable:x&&p,suppressContentEditableWarning:!0,spellCheck:!1,title:x&&p?`Click to rename`:S??`This template name is fixed.`,className:dL(`min-w-[128px] max-w-[280px] truncate rounded-md border border-transparent px-[7px] py-[3px] text-[13.5px] font-medium outline-none`,`hover:bg-muted focus-visible:bg-background`,fL),onFocus:()=>{x&&p&&O(!0)},onBlur:e=>{x&&p&&(O(!1),D(e.currentTarget.textContent??``))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.currentTarget.blur()),e.key===`Escape`&&(e.currentTarget.textContent=A,e.currentTarget.blur())},children:A}),w!==null&&(0,Z.jsx)(`span`,{role:`alert`,className:`text-status-error truncate text-[11.5px]`,children:w}),u===void 0?(0,Z.jsx)(`span`,{className:`border-border-subtle bg-surface-inset text-muted-foreground inline-flex items-center rounded-md border px-2 py-0.5 text-[10.5px] font-medium tracking-[0.04em] uppercase`,children:g?.channel??`Template`}):(0,Z.jsx)(`div`,{className:dL(`min-w-0 shrink-0`,P&&`[&_[data-channel-button]]:px-1.5 [&_[data-channel-label]]:hidden`),children:u}),!x&&g!==null&&(0,Z.jsx)(`span`,{title:S??`This template is read-only.`,"data-testid":`topbar.readonly-badge`,className:`border-border-subtle bg-surface-inset text-muted-foreground inline-flex items-center rounded-md border px-2 py-0.5 text-[10.5px] font-medium`,children:`Read-only`}),m!==void 0&&g?.channel===`email`&&(0,Z.jsx)(xG,{source:m,onUseDefault:h})]})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-1`,children:[!P&&r!==void 0&&(0,Z.jsx)(lz,{title:`Undo`,testId:`topbar.undo`,onClick:r,disabled:!a,className:`h-[30px] px-2.5`,children:`Undo`}),!P&&i!==void 0&&(0,Z.jsx)(lz,{title:`Redo`,testId:`topbar.redo`,onClick:i,disabled:!o,className:`h-[30px] px-2.5`,children:`Redo`}),!P&&(0,Z.jsx)(CG,{}),!P&&(0,Z.jsx)(`div`,{className:`bg-border mx-1 h-[18px] w-px`}),!P&&(0,Z.jsxs)(lz,{title:`Preview template`,testId:`topbar.preview`,onClick:s,className:`h-[30px] px-2.5`,children:[(0,Z.jsx)(ne,{className:`size-[15px]`}),I?null:`Preview`]}),d===!0&&!P&&(0,Z.jsxs)(lz,{title:N?`Export rendered HTML`:`Export waits for the latest render`,testId:`topbar.export`,onClick:L,disabled:!N,className:`h-[30px] px-2.5`,children:[(0,Z.jsx)(B,{className:`size-[15px]`}),I?null:`Export HTML`]}),j&&!P&&(0,Z.jsxs)(lz,{title:`Send a test`,help:M,testId:`topbar.send`,onClick:c,className:`h-[30px] px-2.5`,children:[(0,Z.jsx)(U,{className:`size-[15px]`}),I?null:`Send`]}),!P&&t,!P&&x&&b!==void 0&&(0,Z.jsx)(`button`,{type:`button`,onClick:l,"data-testid":`topbar.publish`,title:b.status===`locked`?b.upsell.reason:`Publish and view history`,className:dL(pL,`ml-0.5 h-[30px] px-3`),children:`Publish`})]})]}),P&&(0,Z.jsxs)(`div`,{className:`samva-editor-scroll border-border-subtle flex h-11 min-w-0 items-center gap-1 overflow-x-auto border-t`,children:[t,r!==void 0&&(0,Z.jsx)(lz,{title:`Undo`,testId:`topbar.undo`,onClick:r,disabled:!a,className:`h-10 shrink-0 px-2`,children:`Undo`}),i!==void 0&&(0,Z.jsx)(lz,{title:`Redo`,testId:`topbar.redo`,onClick:i,disabled:!o,className:`h-10 shrink-0 px-2`,children:`Redo`}),(0,Z.jsx)(CG,{}),(0,Z.jsxs)(lz,{title:`Preview template`,testId:`topbar.preview`,onClick:s,className:`h-10 shrink-0 px-2`,children:[(0,Z.jsx)(ne,{className:`size-[15px]`}),`Preview`]}),d===!0&&(0,Z.jsxs)(lz,{title:N?`Export rendered HTML`:`Export waits for the latest render`,testId:`topbar.export`,onClick:L,disabled:!N,className:`h-10 shrink-0 px-2`,children:[(0,Z.jsx)(B,{className:`size-[15px]`}),`Export`]}),j&&(0,Z.jsxs)(lz,{title:`Send a test`,help:M,testId:`topbar.send`,onClick:c,className:`h-10 shrink-0 px-2`,children:[(0,Z.jsx)(U,{className:`size-[15px]`}),`Send`]}),x&&b!==void 0&&(0,Z.jsx)(`button`,{type:`button`,onClick:l,"data-testid":`topbar.publish`,title:b.status===`locked`?b.upsell.reason:`Publish and view history`,className:dL(pL,`h-10 shrink-0 px-2.5`),children:`Publish`})]})]})}var TG=e=>e>=1280?`wide`:e>=980?`standard`:e>=720?`compact`:`narrow`;function EG(){let e=G(e=>e.conflict),{reload:t}=G(e=>e.actions);return!G(e=>e.editable)||!e?null:(0,Z.jsxs)(`div`,{className:`border-border bg-surface-elevated text-foreground absolute inset-x-0 top-3 z-30 mx-auto flex w-fit items-center gap-3 rounded-lg border px-3.5 py-2 text-[13px] shadow-[var(--shadow-md)]`,children:[(0,Z.jsx)(`span`,{children:`Document changed elsewhere — your recent edits weren’t saved.`}),(0,Z.jsx)(`button`,{type:`button`,onClick:t,className:`bg-primary text-primary-foreground rounded-md px-2.5 py-1 font-medium transition-opacity hover:opacity-90`,children:`Reload`})]})}function DG(){let e=G(e=>e.storageError),t=G(e=>e.conflict),{retrySave:n}=G(e=>e.actions);return!G(e=>e.editable)||e===null||t?null:(0,Z.jsxs)(`div`,{className:`border-status-warning/45 bg-surface-elevated text-foreground absolute inset-x-0 top-3 z-30 mx-auto flex w-fit items-center gap-3 rounded-lg border px-3.5 py-2 text-[13px] shadow-[var(--shadow-md)]`,children:[(0,Z.jsxs)(`span`,{children:[e,` Your work is kept here; export a copy or retry.`]}),(0,Z.jsx)(`button`,{type:`button`,onClick:n,className:`border-border hover:bg-muted rounded-md border px-2.5 py-1 font-medium transition-colors`,children:`Retry`})]})}function OG(){let e=G(e=>e.doc);return e===null||e.channel===`email`?(0,Z.jsx)(sH,{}):e.channel===`sms`?(0,Z.jsx)(uB,{}):(0,Z.jsx)(xB,{})}function kG({height:e=`100dvh`,dashSidebar:t,toolbarLeading:n,toolbarActions:r,channelSwitcher:i,agentPanel:a,agentPanelHeader:o,designRailReview:s,guestStatus:c,canvasStatus:l,brand:u,onBack:d,exportable:f,renameEnabled:p,onPreview:m,onExport:h,onLockedSend:g,onLockedLifecycle:_,onSaveVersion:v,inspectSavedRevision:y}){let b=G(e=>e.leftCollapsed),x=G(e=>e.rightCollapsed),S=G(e=>e.rightMode),C=G(e=>e.layoutMode),w=G(e=>e.doc?.rev??null),E=G(e=>e.checks),D=G(e=>e.sourceEditable&&!e.conflict&&e.pendingAuthoredSource===null&&!e.lifecycleBusy),O=G(e=>e.agentOriginIndex),k=G(e=>e.selection),A=G(e=>e.outline),j=G(e=>e.undoHistory.length),M=G(e=>e.redoHistory.length),N=G(e=>e.sourceEditable),P=G(e=>e.doc),F=G(e=>e.render),I=G(e=>e.diagnosticAssistance),L=G(e=>e.pendingAuthoredSource),R=G(e=>e.lifecycleBusy),z=G(e=>e.conflict),ee=G(e=>e.storageError),B=a!==void 0,{flushSaves:te,beginLifecycle:ne,endLifecycle:re,adoptLifecycleSnapshot:V,toggleLeft:ie,toggleRight:ae,setLayoutMode:oe,undo:se,redo:ce}=G(e=>e.actions),[H,le]=(0,T.useState)(!1),[ue,de]=(0,T.useState)(!1),[fe,U]=(0,T.useState)(!1),[pe,he]=(0,T.useState)(`idle`),[_e,ve]=(0,T.useState)(null),[ye,be]=(0,T.useState)(null),xe=Lm();(0,T.useEffect)(()=>{if(y===void 0||w===null)return;let e=!0;return y().then(t=>{e&&be(t===w?t:null)}).catch(()=>{e&&be(null)}),()=>{e=!1}},[w,y]);let Se=(0,T.useRef)(null),Ce=(0,T.useRef)(()=>{}),we=(0,T.useRef)(null),Te=(0,T.useRef)(null),Ee=f===!0&&P?.channel===`email`&&F!==null&&L===null,De=()=>{Ee&&P!==null&&F!==null&&(dH(F.html,P.name),h?.())},Oe=()=>{if(v===void 0)return Promise.resolve();if(Se.current!==null)return Se.current;if(!ne())return Promise.resolve();let e=()=>{},t=new Promise(t=>{e=t});return Se.current=t,he(`saving`),xe.getState().actions.flushSaves().then(async e=>{let t=xe.getState().doc,n=await v(e),r=xe.getState().doc;t!==null&&(r?.rev===e||r?.rev===n)&&r.origin.authoredSource===t.origin.authoredSource&&xe.getState().actions.adoptLifecycleSnapshot({rev:n,authoredSource:t.origin.authoredSource}),ve(n),he(`idle`)}).catch(()=>he(`error`)).finally(()=>{re(),Se.current===t&&(Se.current=null),e()}),t};(0,T.useEffect)(()=>{Ce.current=Oe});let ke=u===void 0||v===void 0?void 0:async()=>{let e=xe.getState().lifecycleCapability;if(e?.status!==`ready`)return;let t=await xe.getState().actions.flushSaves(),n=await u.readTheme(),r=_G(n);r!==n.theme&&await e.api.updateFile({path:tG,baseRev:t,content:r}),await Oe()},Ae=`idle`;pe===`saving`?Ae=`saving`:pe===`error`?Ae=`error`:w!==null&&(_e===w||ye===w)&&L===null&&!z&&ee===null&&(Ae=`saved`);let je;v!==void 0&&(je=`Unsaved changes`,Ae===`saving`?je=`Saving version…`:Ae===`saved`?je=`Saved version`:Ae===`error`&&(je=`Couldn’t save version`));let Me=Aw(E),Ne=k.kind===`element`?A?.index.get(k.instancePath)??null:null,Pe=Ne===null||k.kind!==`element`?null:{originIndex:O,instancePath:Ne.instancePath,fixture:k.fixture,label:iw(Ne)},Fe=P?.channel===`email`?P.fixture:null,Ie=A===null||Fe===null||F===null||P===null?[]:sw(A).map(({depth:e,node:t})=>{let n=ow(t.selection,F.html);return{instancePath:t.instancePath,fixture:Fe,...t.selection.origins[O]===void 0?{}:{originIndex:O},label:aw(t.selection,P.origin.authoredSource),...n===void 0?{}:{detail:n},depth:e,active:k.kind===`element`&&k.instancePath===t.instancePath}}),Le=typeof a==`function`?a({flushSaves:()=>xe.getState().actions.flushSaves(),exportHtml:De,canExport:Ee,openReview:s===void 0?void 0:()=>xe.getState().actions.openReview(),workspace:{draftRevision:w,saveVersionStatus:v===void 0?`unavailable`:Ae,checks:{errors:Me.errorCount,warnings:Me.warnCount,findings:Me.actionable,canFix:D},diagnosticAssistance:I,pointedElement:Pe,availableInstancePaths:A===null?[]:[...A.index.keys()],layout:C,layers:Ie}}):a,Re={flushSaves:te,beginLifecycle:ne,endLifecycle:re,adoptLifecycleSnapshot:V,undo:se,redo:ce,canUndo:N&&j>0,canRedo:N&&M>0,preview:()=>{le(!0),m?.()},exportHtml:De,canExport:Ee},ze=typeof r==`function`?r(Re):r,Be=typeof i==`function`?i(Re):i;(0,T.useEffect)(()=>{if(v===void 0)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&e.target instanceof HTMLElement&&e.target.closest(`[data-samva-editor-theme]`)!==null&&e.target.closest(`[role="menu"], [role="dialog"], [data-base-ui-portal]`)===null&&(e.preventDefault(),Ce.current())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v]),(0,T.useLayoutEffect)(()=>{let e=we.current;if(e===null||typeof ResizeObserver>`u`)return;let t,n=e=>{let n=TG(e);n!==t&&(t=n,oe(n))};n(e.getBoundingClientRect().width);let r=new ResizeObserver(([e])=>{e!==void 0&&n(e.contentRect.width)});return r.observe(e),()=>r.disconnect()},[oe]);let Ve=(C===`compact`||C===`narrow`)&&(!b||!x);return(0,T.useEffect)(()=>{if(!Ve)return;let e=e=>{e.key===`Escape`&&(b||ie(),x||ae())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b,Ve,x,ie,ae]),(0,Z.jsx)(wL,{value:s??null,children:(0,Z.jsx)(_L,{value:Le??null,children:(0,Z.jsx)(xL,{value:o??null,children:(0,Z.jsx)(lW,{container:Te,children:(0,Z.jsxs)(`div`,{ref:we,className:`samva-editor-frame flex`,style:{height:e},children:[t,(0,Z.jsxs)(`div`,{"data-samva-editor-theme":`host`,"data-layout":C,inert:R,"aria-busy":R,className:`samva-editor-shell grid min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden`,children:[(0,Z.jsx)(wG,{leading:n,extraActions:ze,onBack:t===void 0?d:void 0,onPreview:()=>{le(!0),m?.()},onSend:()=>de(!0),onLifecycle:()=>U(!0),onUndo:se,onRedo:ce,canUndo:N&&j>0,canRedo:N&&M>0,channelSwitcher:Be,exportEnabled:f,renameEnabled:p,onExport:h,brand:u,onUseDefaultBrand:ke}),(0,Z.jsxs)(`div`,{className:`samva-editor-body relative flex min-h-0 min-w-0 overflow-hidden`,children:[Ve&&(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close editor panel`,className:`bg-background/45 absolute inset-0 z-30 cursor-default backdrop-blur-[1px]`,onClick:()=>{b||ie(),x||ae()}}),b&&!B&&(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Show layers and blocks`,"data-testid":`shell.show-left`,onClick:ie,className:`border-border bg-background/92 text-muted-foreground hover:bg-muted hover:text-foreground absolute top-3 left-3 z-20 rounded-md border p-1.5 shadow-[var(--shadow-md)] backdrop-blur-md transition-colors`}),children:(0,Z.jsx)(me,{className:`size-[15px]`})}),(0,Z.jsx)(gN,{container:Te,children:(0,Z.jsx)(zN,{side:`right`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Show layers and blocks`})})})]}),x&&!B&&(0,Z.jsxs)(iN,{children:[(0,Z.jsx)(fN,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":B&&S===`agent`?`Show assistant`:`Show inspector`,"data-testid":`shell.show-right`,onClick:ae,className:`border-border bg-background/92 text-muted-foreground hover:bg-muted hover:text-foreground absolute top-3 right-3 z-20 rounded-md border p-1.5 shadow-[var(--shadow-md)] backdrop-blur-md transition-colors`}),children:(0,Z.jsx)(ge,{className:`size-[15px]`})}),(0,Z.jsx)(gN,{container:Te,children:(0,Z.jsx)(zN,{side:`left`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(BN,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:B&&S===`agent`?`Show assistant`:`Show inspector`})})})]}),(0,Z.jsx)(DL,{value:l??null,children:(0,Z.jsx)(OG,{})}),(0,Z.jsx)(EG,{}),(0,Z.jsx)(DG,{})]}),(0,Z.jsx)(WW,{saveVersionStatus:c!==void 0&&!c.saveVersion?void 0:je,saveVersionState:v===void 0?void 0:Ae,onSaveVersion:c!==void 0&&!c.saveVersion||v===void 0?void 0:Oe,saveVersionBusy:Ae===`saving`,saveVersionBlocked:R,guestHeadline:c?.headline})]}),(0,Z.jsx)(fW,{open:H,onClose:()=>le(!1)}),(0,Z.jsx)(SW,{open:ue,onClose:()=>de(!1),onLockedAction:g}),(0,Z.jsx)(sW,{open:fe,onClose:()=>U(!1),onLockedAction:_}),(0,Z.jsx)(`div`,{ref:Te,"data-samva-editor-portal-root":!0,className:`samva-editor-shell`})]})})})})})}var AG=jp({fileName:W,lineNumber:$p.check(Xp(1)),columnNumber:$p.check(Xp(1))}),jG=Ip([`error`,`warning`,`info`]),MG=jp({assessment:Ip([`risk`,`degradation`,`unverified`,`not-applicable`]),title:W}),NG=jp({code:W,severity:jG,message:W,origins:Np(AG),clients:Cp(Np(W)),notes:Cp(W),provenance:Cp(W),fixtures:Cp(Np(W)),occurrences:Cp(Np(Np(AG))),compatibility:Cp(MG)});jp({start:$p.check(Xp(0)),end:$p.check(Xp(0)),origins:Np(AG),instancePath:W.check(em(1)),tag:W.check(em(1)),authored:kp});var PG=jp({instancePath:W.check(em(1)),tag:W.check(em(1)),origins:Np(AG),authored:kp,occurrence:$p.check(Xp(1)),occurrences:$p.check(Xp(1)),parentPath:Sp(W),start:$p.check(Xp(0)),end:$p.check(Xp(0))}),FG=`2026-09-29.2`,IG=Ip([`email`,`sms`,`whatsapp`]),LG=W;jp({reason:W,cta:jp({label:W,href:W})});var RG=jp({name:W,sample:Cp(W),required:kp}),zG=jp({email:W,name:Cp(W)}),BG=jp({fromDefault:Cp(zG),replyToDefault:Cp(Np(W))}),VG=W.check(em(1)),HG=jp({revision:LG,subject:W,preheader:Sp(W),html:W,text:W,selections:Np(PG)}),UG=Fp([jp({status:wp(`current`)}),jp({status:wp(`stale`),reason:W})]),WG=jp({kind:wp(`tsx`),file:W,authoredSource:W}),GG={id:Lp(W),name:W,rev:LG,origin:WG,variables:Np(RG),metadata:BG},KG={channel:wp(`email`),preview:UG,fixtures:Np(VG),fixture:Lp(VG),render:Lp(HG),diagnostics:Np(NG),incompatibilities:Np(NG)},qG=jp({revision:LG,text:W}),JG=Fp([jp({type:wp(`quick-reply`),text:W}),jp({type:wp(`url`),text:W,url:W}),jp({type:wp(`phone`),text:W,phone:W}),jp({type:wp(`copy-code`),code:W})]),YG=jp({revision:LG,name:Sp(W),language:W,category:W,header:Sp(jp({type:Ip([`text`,`image`,`video`,`document`]),text:W})),body:W,footer:Sp(W),buttons:Np(JG)}),XG=e=>({preview:UG,fixtures:Np(VG),fixture:Lp(VG),render:Lp(e),diagnostics:Np(NG)}),ZG={channel:wp(`sms`),...XG(qG)},QG={channel:wp(`whatsapp`),...XG(YG)},$G=jp({kind:wp(`editable`)}),eK=jp({kind:wp(`readonly`),reason:W}),tK=jp({...GG,...KG,access:$G}),nK=jp({...GG,...ZG,access:$G}),rK=jp({...GG,...QG,access:$G}),iK=jp({...GG,...KG,access:eK}),aK=jp({...GG,...ZG,access:eK}),oK=jp({...GG,...QG,access:eK});Fp([tK,nK,rK]),Fp([iK,aK,oK]),Fp([tK,nK,rK,iK,aK,oK]),Fp([jp({kind:wp(`authoredSource`),baseRev:LG,authoredSource:W}),jp({kind:wp(`metadata`),patch:jp({name:Cp(W),fromDefault:Cp(Lp(zG)),replyToDefault:Cp(Lp(Np(W)))})})]);var sK={rev:LG,origin:Ip([`self`,`agent`,`external`]),authoredSource:Cp(W)};Fp([jp({...sK,...KG}),jp({...sK,...ZG}),jp({...sK,...QG})]);var cK=class extends bm()(`DocumentConflict`,{expectedRev:LG,actualRev:LG}){},lK=class extends bm()(`DocumentUnavailable`,{reason:W}){},uK=jp({commit:W,tree:W,parentCommit:Lp(W),message:W,committedAt:im,isHead:kp,isPublished:kp}),dK=jp({path:W,binary:Sp(kp),status:Ip([`clean`,`added`,`modified`,`deleted`,`conflicted`]),content:Lp(W)}),fK=jp({path:W,base:Lp(W),draft:Lp(W),main:Lp(W)});jp({rev:LG,baseCommit:W,remoteHead:W,dirty:kp,files:Np(dK),conflicts:Np(fK),commits:Np(uK)}),jp({publicationId:W,commit:W,publishedAt:im}),bm()(`LifecycleUnavailable`,{reason:W}),bm()(`ProjectFileExists`,{path:W,reason:W}),jp({channel:IG,to:jp({address:W,name:Cp(W)}),variables:Mp(W,Tp),baseRev:LG}),jp({messageId:W,acceptedAt:dm}),jp({channel:IG,to:Np(jp({address:W,name:Cp(W)})),variables:Mp(W,Tp),schedule:Cp(Lp(W)),baseRev:LG}),Fp([jp({kind:wp(`sent`),messageId:W,acceptedAt:dm}),jp({kind:wp(`scheduled`),scheduledMessageId:W,scheduledFor:dm})]),bm()(`SendUnavailable`,{reason:W}),jp({url:W}),jp({family:W,fallback:W}),jp({name:W,data:Cp(Mp(W,Tp))});var pK=(e,t)=>{let n=new URL(`api/${e}`,window.location.href);for(let[e,r]of Object.entries(t))n.searchParams.set(e,r);return n.toString()},mK=e=>e.fixture,hK=(e,t,n,r)=>({rev:t,origin:n,...r===void 0?{}:{authoredSource:r},...e}),gK=(e,t,n)=>kc(function*(){let r=yield*gf(),i=new EventSource(pK(`events`,{id:e,client:t}));yield*Bc(()=>Ec(()=>i.close())),i.addEventListener(`samva:change`,t=>{let i=JSON.parse(t.data);i.id===e&&(n.rev=i.rev,n.fixture=mK(i),i.authoredSource!==void 0&&(n.authoredSource=i.authoredSource),_f(r,hK(i,i.rev,i.origin,i.authoredSource)))});let a=()=>fetch(pK(`document`,{id:e,client:t})).then(e=>e.ok?e.json():void 0).then(e=>{if(e===void 0)return;let t=e.origin.authoredSource;(e.rev!==n.rev||t!==n.authoredSource||mK(e)!==n.fixture)&&(n.rev=e.rev,n.authoredSource=t,n.fixture=mK(e),_f(r,hK(e,e.rev,`external`,t)))}).catch(()=>{}),o=!1,s;i.addEventListener(`open`,()=>{if(!o){o=!0,s?.(Dc);return}a()}),i.addEventListener(`error`,()=>{!o&&i.readyState!==EventSource.OPEN&&s?.(new lK({reason:`editor event stream failed to open`}))}),yield*Oc(e=>{if(i.readyState===EventSource.OPEN)return o=!0,e(Dc);s=e});let c=yield*Cc({try:()=>fetch(pK(`document`,{id:e,client:t})),catch:e=>new lK({reason:String(e)})});if(!c.ok)return yield*new lK({reason:`open failed (${c.status})`});let l=yield*Cc({try:()=>c.json(),catch:e=>new lK({reason:String(e)})});return n.rev=l.rev,n.authoredSource=l.origin.authoredSource,n.fixture=mK(l),{initial:l,changes:Tm(r)}}),_K=(e,t)=>({view:n=>kc(function*(){let r=yield*Cc({try:()=>fetch(pK(`fixture`,{id:e,client:t}),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fixture:n})}),catch:e=>new lK({reason:String(e)})});if(r.ok)return;let i=`view fixture failed (${r.status})`;return yield*new lK({reason:yield*Cc({try:()=>r.json(),catch:()=>new lK({reason:i})}).pipe(Lc(e=>e.error??i))})})}),vK=(e,t)=>({save:n=>kc(function*(){if(n.kind!==`authoredSource`)return yield*new lK({reason:`Local metadata is declared in source.`});let r=yield*Cc({try:()=>fetch(pK(`document`,{id:e,client:t}),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n)}),catch:e=>new lK({reason:String(e)})}),i=yield*Cc({try:()=>r.json(),catch:e=>new lK({reason:String(e)})});return r.status===409?yield*new cK({expectedRev:n.baseRev,actualRev:i.actualRev??n.baseRev}):!r.ok||i.rev===void 0?yield*new lK({reason:i.error??`Local source save failed.`}):{rev:i.rev}})}),yK={status:`locked`,upsell:{reason:`Test sends run against a published template on Samva. Commit and push this file, run samva templates publish --commit HEAD, then send it by its template ID.`,cta:{label:`How publishing works`,href:`https://samva.dev/docs/sml/authoring-tsx`}}},bK=({id:e,authenticated:t})=>{let n=crypto.randomUUID();return{contractVersion:FG,access:`editable`,sourceAccess:`editable`,metadataAccess:`readonly`,writer:vK(e,n),document:{open:gK(e,n,{rev:``})},fixtures:{status:`ready`,api:_K(e,n)},...t?{send:yK}:{}}},xK=e=>new URL(`api/${e}`,window.location.href).toString(),SK=async e=>{let t=await fetch(xK(e));if(!t.ok)throw Error(`${e} failed (${t.status})`);return t.json()},CK=()=>{let[e,t]=(0,T.useState)(()=>typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches);return(0,T.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,e)},[e]),()=>t(e=>!e)};function wK({onBack:e,onToggleTheme:t}){return(0,Z.jsxs)(`nav`,{"aria-label":`Samva editor`,className:`border-border bg-background z-30 flex w-12 flex-none flex-col items-center gap-1 border-r py-3`,children:[(0,Z.jsx)(`span`,{className:`bg-primary text-primary-foreground mb-2 grid size-7 place-items-center rounded-lg text-[13px] font-bold`,children:`S`}),e?(0,Z.jsx)(`button`,{type:`button`,title:`Back to templates`,onClick:e,className:`text-muted-foreground hover:bg-muted hover:text-foreground grid size-8 place-items-center rounded-lg transition-colors`,children:(0,Z.jsx)(O,{className:`size-[16px]`})}):null,(0,Z.jsx)(`div`,{className:`flex-1`}),(0,Z.jsx)(`button`,{type:`button`,title:`Toggle theme`,onClick:t,className:`text-muted-foreground hover:bg-muted hover:text-foreground grid size-8 place-items-center rounded-lg transition-colors dark:hidden`,children:(0,Z.jsx)(de,{className:`size-[16px]`})}),(0,Z.jsx)(`button`,{type:`button`,title:`Toggle theme`,onClick:t,className:`text-muted-foreground hover:bg-muted hover:text-foreground hidden size-8 place-items-center rounded-lg transition-colors dark:grid`,children:(0,Z.jsx)(be,{className:`size-[16px]`})})]})}function TK({template:e,authenticated:t,onBack:n,onToggleTheme:r}){let i=(0,T.useMemo)(()=>Am(bK({id:e.id,authenticated:t})),[t,e.id]);return(0,Z.jsx)($w,{host:i,children:(0,Z.jsx)(`div`,{className:`relative h-dvh`,children:(0,Z.jsx)(kG,{dashSidebar:(0,Z.jsx)(wK,{onBack:n,onToggleTheme:r}),onBack:n,renameEnabled:!1})})},`${e.id}:${e.channel}`)}var EK={email:{icon:te,label:`Email`,className:`bg-sel-soft text-accent-email`},sms:{icon:H,label:`SMS`,className:`bg-muted text-primary`},whatsapp:{icon:N,label:`WhatsApp`,className:`bg-status-success/10 text-status-success`}};function DK({catalog:e,authenticated:t,onOpen:n,onToggleTheme:r}){return(0,Z.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,Z.jsx)(wK,{onToggleTheme:r}),(0,Z.jsx)(`div`,{className:`bg-surface-inset min-w-0 flex-1 overflow-y-auto`,children:(0,Z.jsxs)(`div`,{className:`mx-auto max-w-[720px] px-6 py-16`,children:[(0,Z.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h1`,{className:`text-foreground text-lg font-semibold`,children:`Templates`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 text-[13px]`,children:`Preview your templates and fixtures. Source edits save to your project.`})]}),(0,Z.jsx)(`span`,{className:t?`bg-status-success/12 text-status-success rounded-full px-2.5 py-1 text-[11px] font-medium`:`bg-muted text-muted-foreground rounded-full px-2.5 py-1 text-[11px] font-medium`,title:t?`SAMVA_API_KEY is set — authenticated affordances are available.`:`No API key — local editing only.`,children:t?`API key set`:`Local only`})]}),e.diagnostics.length>0?(0,Z.jsx)(`section`,{"aria-label":`Catalog diagnostics`,className:`border-border bg-surface-elevated mt-6 overflow-hidden rounded-xl border`,children:e.diagnostics.map((e,t)=>(0,Z.jsxs)(`div`,{className:`px-4 py-3 text-[12px]`+(t>0?` border-border-subtle border-t`:``),children:[(0,Z.jsxs)(`p`,{className:e.severity===`error`?`text-status-error`:`text-status-warning`,children:[e.file,` · `,e.code]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:e.message})]},`${e.file}:${e.code}:${t}`))}):null,(0,Z.jsxs)(`ul`,{className:`border-border bg-surface-elevated mt-8 overflow-hidden rounded-xl border shadow-md`,children:[e.templates.length===0?(0,Z.jsxs)(`li`,{className:`text-muted-foreground px-4 py-10 text-center text-[13px]`,children:[`No valid templates found. Add a `,(0,Z.jsx)(`code`,{className:`text-foreground`,children:`.tsx`}),` file with a Samva template as its default export.`]}):null,e.templates.map((e,t)=>{let r=EK[e.channel],i=r.icon;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>n(e),"data-testid":`template-card.${e.id}`,className:`hover:bg-muted flex w-full items-center gap-3 px-4 py-3 text-left transition-colors`+(t>0?` border-border-subtle border-t`:``),children:[(0,Z.jsx)(`span`,{className:`grid size-8 flex-none place-items-center rounded-lg ${r.className}`,children:(0,Z.jsx)(i,{className:`size-[16px]`})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`text-foreground block truncate text-[13px] font-medium`,children:e.name}),(0,Z.jsx)(`span`,{className:`text-muted-foreground block truncate text-[12px]`,children:e.id})]}),(0,Z.jsxs)(`span`,{className:`text-muted-foreground text-right text-[11px]`,children:[(0,Z.jsx)(`span`,{className:`block`,children:r.label}),(0,Z.jsx)(`span`,{className:`block`,children:`Editable source`})]})]})},e.id)})]})]})})]})}function OK(){let e=CK(),[t,n]=(0,T.useState)(!1),[r,i]=(0,T.useState)(null),[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(null);(0,T.useEffect)(()=>{let e=!0,t=()=>SK(`templates`).then(t=>{e&&(i(t),o(null))});Promise.all([SK(`capabilities`).then(t=>{e&&n(!!t.authenticated)}),t()]).catch(t=>{e&&o(String(t))});let r=new EventSource(xK(`catalog-events`));return r.addEventListener(`samva:catalog`,()=>{t().catch(t=>{e&&o(String(t))})}),()=>{e=!1,r.close()}},[]);let l=r?.templates.find(e=>e.id===s)??null;return s!==null&&r!==null&&l===null&&c(null),a===null?r===null?(0,Z.jsx)(`div`,{className:`text-muted-foreground grid h-dvh place-items-center text-[13px]`,children:`Loading templates…`}):l===null?(0,Z.jsx)(DK,{catalog:r,authenticated:t,onOpen:e=>c(e.id),onToggleTheme:e}):(0,Z.jsx)(TK,{template:l,authenticated:t,onBack:()=>c(null),onToggleTheme:e}):(0,Z.jsxs)(`div`,{className:`text-status-error grid h-dvh place-items-center px-6 text-center text-[13px]`,children:[`Couldn’t reach the Samva editor dev server: `,a]})}(0,Dm.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(T.StrictMode,{children:(0,Z.jsx)(OK,{})}));
32
- //# sourceMappingURL=index-BtfwuWcY.js.map