@sulala/agent 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,83 @@
1
+ function RC(e,r){for(var a=0;a<r.length;a++){const l=r[a];if(typeof l!="string"&&!Array.isArray(l)){for(const o in l)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(l,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>l[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function Dc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _f={exports:{}},Wi={};var av;function MC(){if(av)return Wi;av=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(l,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:l,key:d,ref:o!==void 0?o:null,props:u}}return Wi.Fragment=r,Wi.jsx=a,Wi.jsxs=a,Wi}var lv;function OC(){return lv||(lv=1,_f.exports=MC()),_f.exports}var s=OC(),Tf={exports:{}},Pe={};var iv;function DC(){if(iv)return Pe;iv=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function b(_){return _===null||typeof _!="object"?null:(_=v&&_[v]||_["@@iterator"],typeof _=="function"?_:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function j(_,G,T){this.props=_,this.context=G,this.refs=N,this.updater=T||k}j.prototype.isReactComponent={},j.prototype.setState=function(_,G){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,G,"setState")},j.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function R(){}R.prototype=j.prototype;function M(_,G,T){this.props=_,this.context=G,this.refs=N,this.updater=T||k}var O=M.prototype=new R;O.constructor=M,C(O,j.prototype),O.isPureReactComponent=!0;var L=Array.isArray;function D(){}var I={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function V(_,G,T){var oe=T.ref;return{$$typeof:e,type:_,key:G,ref:oe!==void 0?oe:null,props:T}}function P(_,G){return V(_.type,G,_.props)}function ee(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function te(_){var G={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(T){return G[T]})}var ce=/\/+/g;function ae(_,G){return typeof _=="object"&&_!==null&&_.key!=null?te(""+_.key):G.toString(36)}function q(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(D,D):(_.status="pending",_.then(function(G){_.status==="pending"&&(_.status="fulfilled",_.value=G)},function(G){_.status==="pending"&&(_.status="rejected",_.reason=G)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function z(_,G,T,oe,me){var fe=typeof _;(fe==="undefined"||fe==="boolean")&&(_=null);var ge=!1;if(_===null)ge=!0;else switch(fe){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(_.$$typeof){case e:case r:ge=!0;break;case y:return ge=_._init,z(ge(_._payload),G,T,oe,me)}}if(ge)return me=me(_),ge=oe===""?"."+ae(_,0):oe,L(me)?(T="",ge!=null&&(T=ge.replace(ce,"$&/")+"/"),z(me,G,T,"",function(pe){return pe})):me!=null&&(ee(me)&&(me=P(me,T+(me.key==null||_&&_.key===me.key?"":(""+me.key).replace(ce,"$&/")+"/")+ge)),G.push(me)),1;ge=0;var ze=oe===""?".":oe+":";if(L(_))for(var Ee=0;Ee<_.length;Ee++)oe=_[Ee],fe=ze+ae(oe,Ee),ge+=z(oe,G,T,fe,me);else if(Ee=b(_),typeof Ee=="function")for(_=Ee.call(_),Ee=0;!(oe=_.next()).done;)oe=oe.value,fe=ze+ae(oe,Ee++),ge+=z(oe,G,T,fe,me);else if(fe==="object"){if(typeof _.then=="function")return z(q(_),G,T,oe,me);throw G=String(_),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ge}function F(_,G,T){if(_==null)return _;var oe=[],me=0;return z(_,oe,"","",function(fe){return G.call(T,fe,me++)}),oe}function J(_){if(_._status===-1){var G=_._result;G=G(),G.then(function(T){(_._status===0||_._status===-1)&&(_._status=1,_._result=T)},function(T){(_._status===0||_._status===-1)&&(_._status=2,_._result=T)}),_._status===-1&&(_._status=0,_._result=G)}if(_._status===1)return _._result.default;throw _._result}var Y=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},A={map:F,forEach:function(_,G,T){F(_,function(){G.apply(this,arguments)},T)},count:function(_){var G=0;return F(_,function(){G++}),G},toArray:function(_){return F(_,function(G){return G})||[]},only:function(_){if(!ee(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Pe.Activity=g,Pe.Children=A,Pe.Component=j,Pe.Fragment=a,Pe.Profiler=o,Pe.PureComponent=M,Pe.StrictMode=l,Pe.Suspense=h,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(_){return I.H.useMemoCache(_)}},Pe.cache=function(_){return function(){return _.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(_,G,T){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var oe=C({},_.props),me=_.key;if(G!=null)for(fe in G.key!==void 0&&(me=""+G.key),G)!B.call(G,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&G.ref===void 0||(oe[fe]=G[fe]);var fe=arguments.length-2;if(fe===1)oe.children=T;else if(1<fe){for(var ge=Array(fe),ze=0;ze<fe;ze++)ge[ze]=arguments[ze+2];oe.children=ge}return V(_.type,me,oe)},Pe.createContext=function(_){return _={$$typeof:d,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},Pe.createElement=function(_,G,T){var oe,me={},fe=null;if(G!=null)for(oe in G.key!==void 0&&(fe=""+G.key),G)B.call(G,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(me[oe]=G[oe]);var ge=arguments.length-2;if(ge===1)me.children=T;else if(1<ge){for(var ze=Array(ge),Ee=0;Ee<ge;Ee++)ze[Ee]=arguments[Ee+2];me.children=ze}if(_&&_.defaultProps)for(oe in ge=_.defaultProps,ge)me[oe]===void 0&&(me[oe]=ge[oe]);return V(_,fe,me)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(_){return{$$typeof:f,render:_}},Pe.isValidElement=ee,Pe.lazy=function(_){return{$$typeof:y,_payload:{_status:-1,_result:_},_init:J}},Pe.memo=function(_,G){return{$$typeof:p,type:_,compare:G===void 0?null:G}},Pe.startTransition=function(_){var G=I.T,T={};I.T=T;try{var oe=_(),me=I.S;me!==null&&me(T,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(D,Y)}catch(fe){Y(fe)}finally{G!==null&&T.types!==null&&(G.types=T.types),I.T=G}},Pe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Pe.use=function(_){return I.H.use(_)},Pe.useActionState=function(_,G,T){return I.H.useActionState(_,G,T)},Pe.useCallback=function(_,G){return I.H.useCallback(_,G)},Pe.useContext=function(_){return I.H.useContext(_)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(_,G){return I.H.useDeferredValue(_,G)},Pe.useEffect=function(_,G){return I.H.useEffect(_,G)},Pe.useEffectEvent=function(_){return I.H.useEffectEvent(_)},Pe.useId=function(){return I.H.useId()},Pe.useImperativeHandle=function(_,G,T){return I.H.useImperativeHandle(_,G,T)},Pe.useInsertionEffect=function(_,G){return I.H.useInsertionEffect(_,G)},Pe.useLayoutEffect=function(_,G){return I.H.useLayoutEffect(_,G)},Pe.useMemo=function(_,G){return I.H.useMemo(_,G)},Pe.useOptimistic=function(_,G){return I.H.useOptimistic(_,G)},Pe.useReducer=function(_,G,T){return I.H.useReducer(_,G,T)},Pe.useRef=function(_){return I.H.useRef(_)},Pe.useState=function(_){return I.H.useState(_)},Pe.useSyncExternalStore=function(_,G,T){return I.H.useSyncExternalStore(_,G,T)},Pe.useTransition=function(){return I.H.useTransition()},Pe.version="19.2.4",Pe}var sv;function zc(){return sv||(sv=1,Tf.exports=DC()),Tf.exports}var S=zc();const da=Dc(S),l0=RC({__proto__:null,default:da},[S]);var Rf={exports:{}},es={},Mf={exports:{}},Of={};var ov;function zC(){return ov||(ov=1,(function(e){function r(z,F){var J=z.length;z.push(F);e:for(;0<J;){var Y=J-1>>>1,A=z[Y];if(0<o(A,F))z[Y]=F,z[J]=A,J=Y;else break e}}function a(z){return z.length===0?null:z[0]}function l(z){if(z.length===0)return null;var F=z[0],J=z.pop();if(J!==F){z[0]=J;e:for(var Y=0,A=z.length,_=A>>>1;Y<_;){var G=2*(Y+1)-1,T=z[G],oe=G+1,me=z[oe];if(0>o(T,J))oe<A&&0>o(me,T)?(z[Y]=me,z[oe]=J,Y=oe):(z[Y]=T,z[G]=J,Y=G);else if(oe<A&&0>o(me,J))z[Y]=me,z[oe]=J,Y=oe;else break e}}return F}function o(z,F){var J=z.sortIndex-F.sortIndex;return J!==0?J:z.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var h=[],p=[],y=1,g=null,v=3,b=!1,k=!1,C=!1,N=!1,j=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function O(z){for(var F=a(p);F!==null;){if(F.callback===null)l(p);else if(F.startTime<=z)l(p),F.sortIndex=F.expirationTime,r(h,F);else break;F=a(p)}}function L(z){if(C=!1,O(z),!k)if(a(h)!==null)k=!0,D||(D=!0,te());else{var F=a(p);F!==null&&q(L,F.startTime-z)}}var D=!1,I=-1,B=5,V=-1;function P(){return N?!0:!(e.unstable_now()-V<B)}function ee(){if(N=!1,D){var z=e.unstable_now();V=z;var F=!0;try{e:{k=!1,C&&(C=!1,R(I),I=-1),b=!0;var J=v;try{t:{for(O(z),g=a(h);g!==null&&!(g.expirationTime>z&&P());){var Y=g.callback;if(typeof Y=="function"){g.callback=null,v=g.priorityLevel;var A=Y(g.expirationTime<=z);if(z=e.unstable_now(),typeof A=="function"){g.callback=A,O(z),F=!0;break t}g===a(h)&&l(h),O(z)}else l(h);g=a(h)}if(g!==null)F=!0;else{var _=a(p);_!==null&&q(L,_.startTime-z),F=!1}}break e}finally{g=null,v=J,b=!1}F=void 0}}finally{F?te():D=!1}}}var te;if(typeof M=="function")te=function(){M(ee)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,ae=ce.port2;ce.port1.onmessage=ee,te=function(){ae.postMessage(null)}}else te=function(){j(ee,0)};function q(z,F){I=j(function(){z(e.unstable_now())},F)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var F=3;break;default:F=v}var J=v;v=F;try{return z()}finally{v=J}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(z,F){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var J=v;v=z;try{return F()}finally{v=J}},e.unstable_scheduleCallback=function(z,F,J){var Y=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?Y+J:Y):J=Y,z){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=J+A,z={id:y++,callback:F,priorityLevel:z,startTime:J,expirationTime:A,sortIndex:-1},J>Y?(z.sortIndex=J,r(p,z),a(h)===null&&z===a(p)&&(C?(R(I),I=-1):C=!0,q(L,J-Y))):(z.sortIndex=A,r(h,z),k||b||(k=!0,D||(D=!0,te()))),z},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(z){var F=v;return function(){var J=v;v=F;try{return z.apply(this,arguments)}finally{v=J}}}})(Of)),Of}var cv;function LC(){return cv||(cv=1,Mf.exports=zC()),Mf.exports}var Df={exports:{}},Xt={};var uv;function PC(){if(uv)return Xt;uv=1;var e=zc();function r(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(h,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Xt.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return u(h,p,null,y)},Xt.flushSync=function(h){var p=d.T,y=l.p;try{if(d.T=null,l.p=2,h)return h()}finally{d.T=p,l.p=y,l.d.f()}},Xt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(h,p))},Xt.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},Xt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,g=f(y,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?l.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):y==="script"&&l.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Xt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=f(p.as,p.crossOrigin);l.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(h)},Xt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=f(y,p.crossOrigin);l.d.L(h,y,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Xt.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=f(p.as,p.crossOrigin);l.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(h)},Xt.requestFormReset=function(h){l.d.r(h)},Xt.unstable_batchedUpdates=function(h,p){return h(p)},Xt.useFormState=function(h,p,y){return d.H.useFormState(h,p,y)},Xt.useFormStatus=function(){return d.H.useHostTransitionStatus()},Xt.version="19.2.4",Xt}var dv;function i0(){if(dv)return Df.exports;dv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Df.exports=PC(),Df.exports}var fv;function UC(){if(fv)return es;fv=1;var e=LC(),r=zc(),a=i0();function l(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var n=t,i=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(i=n.return),t=n.return;while(t)}return n.tag===3?i:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(u(t)!==t)throw Error(l(188))}function p(t){var n=t.alternate;if(!n){if(n=u(t),n===null)throw Error(l(188));return n!==t?null:t}for(var i=t,c=n;;){var m=i.return;if(m===null)break;var x=m.alternate;if(x===null){if(c=m.return,c!==null){i=c;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===i)return h(m),t;if(x===c)return h(m),n;x=x.sibling}throw Error(l(188))}if(i.return!==c.return)i=m,c=x;else{for(var w=!1,E=m.child;E;){if(E===i){w=!0,i=m,c=x;break}if(E===c){w=!0,c=m,i=x;break}E=E.sibling}if(!w){for(E=x.child;E;){if(E===i){w=!0,i=x,c=m;break}if(E===c){w=!0,c=x,i=m;break}E=E.sibling}if(!w)throw Error(l(189))}}if(i.alternate!==c)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),M=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function te(t){return t===null||typeof t!="object"?null:(t=ee&&t[ee]||t["@@iterator"],typeof t=="function"?t:null)}var ce=Symbol.for("react.client.reference");function ae(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ce?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case j:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case D:return"SuspenseList";case V:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case M:return t.displayName||"Context";case R:return(t._context.displayName||"Context")+".Consumer";case O:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case I:return n=t.displayName||null,n!==null?n:ae(t.type)||"Memo";case B:n=t._payload,t=t._init;try{return ae(t(n))}catch{}}return null}var q=Array.isArray,z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},Y=[],A=-1;function _(t){return{current:t}}function G(t){0>A||(t.current=Y[A],Y[A]=null,A--)}function T(t,n){A++,Y[A]=t.current,t.current=n}var oe=_(null),me=_(null),fe=_(null),ge=_(null);function ze(t,n){switch(T(fe,n),T(me,t),T(oe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Ey(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Ey(n),t=Ay(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(oe),T(oe,t)}function Ee(){G(oe),G(me),G(fe)}function pe(t){t.memoizedState!==null&&T(ge,t);var n=oe.current,i=Ay(n,t.type);n!==i&&(T(me,t),T(oe,i))}function Oe(t){me.current===t&&(G(oe),G(me)),ge.current===t&&(G(ge),Xi._currentValue=J)}var De,Ue;function Ge(t){if(De===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);De=n&&n[1]||"",Ue=-1<i.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+De+t+Ue}var Pt=!1;function Ut(t,n){if(!t||Pt)return"";Pt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(ne){var Z=ne}Reflect.construct(t,[],ie)}else{try{ie.call()}catch(ne){Z=ne}t.call(ie.prototype)}}else{try{throw Error()}catch(ne){Z=ne}(ie=t())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(ne){if(ne&&Z&&typeof ne.stack=="string")return[ne.stack,Z.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),w=x[0],E=x[1];if(w&&E){var U=w.split(`
4
+ `),Q=E.split(`
5
+ `);for(m=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;m<Q.length&&!Q[m].includes("DetermineComponentFrameRoot");)m++;if(c===U.length||m===Q.length)for(c=U.length-1,m=Q.length-1;1<=c&&0<=m&&U[c]!==Q[m];)m--;for(;1<=c&&0<=m;c--,m--)if(U[c]!==Q[m]){if(c!==1||m!==1)do if(c--,m--,0>m||U[c]!==Q[m]){var re=`
6
+ `+U[c].replace(" at new "," at ");return t.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",t.displayName)),re}while(1<=c&&0<=m);break}}}finally{Pt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Ge(i):""}function Jn(t,n){switch(t.tag){case 26:case 27:case 5:return Ge(t.type);case 16:return Ge("Lazy");case 13:return t.child!==n&&n!==null?Ge("Suspense Fallback"):Ge("Suspense");case 19:return Ge("SuspenseList");case 0:case 15:return Ut(t.type,!1);case 11:return Ut(t.type.render,!1);case 1:return Ut(t.type,!0);case 31:return Ge("Activity");default:return""}}function Fn(t){try{var n="",i=null;do n+=Jn(t,i),i=t,t=t.return;while(t);return n}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var Ne=Object.prototype.hasOwnProperty,Le=e.unstable_scheduleCallback,he=e.unstable_cancelCallback,Qe=e.unstable_shouldYield,et=e.unstable_requestPaint,qe=e.unstable_now,Wt=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,se=e.unstable_UserBlockingPriority,be=e.unstable_NormalPriority,K=e.unstable_LowPriority,Ae=e.unstable_IdlePriority,xn=e.log,hr=e.unstable_setDisableYieldValue,en=null,Dt=null;function sn(t){if(typeof xn=="function"&&hr(t),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(en,t)}catch{}}var dt=Math.clz32?Math.clz32:xj,Pr=Math.log,Gn=Math.LN2;function xj(t){return t>>>=0,t===0?32:31-(Pr(t)/Gn|0)|0}var Os=256,Ds=262144,zs=4194304;function ba(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ls(t,n,i){var c=t.pendingLanes;if(c===0)return 0;var m=0,x=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var E=c&134217727;return E!==0?(c=E&~x,c!==0?m=ba(c):(w&=E,w!==0?m=ba(w):i||(i=E&~t,i!==0&&(m=ba(i))))):(E=c&~x,E!==0?m=ba(E):w!==0?m=ba(w):i||(i=c&~t,i!==0&&(m=ba(i)))),m===0?0:n!==0&&n!==m&&(n&x)===0&&(x=m&-m,i=n&-n,x>=i||x===32&&(i&4194048)!==0)?n:m}function oi(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function yj(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 op(){var t=zs;return zs<<=1,(zs&62914560)===0&&(zs=4194304),t}function gu(t){for(var n=[],i=0;31>i;i++)n.push(t);return n}function ci(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vj(t,n,i,c,m,x){var w=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var E=t.entanglements,U=t.expirationTimes,Q=t.hiddenUpdates;for(i=w&~i;0<i;){var re=31-dt(i),ie=1<<re;E[re]=0,U[re]=-1;var Z=Q[re];if(Z!==null)for(Q[re]=null,re=0;re<Z.length;re++){var ne=Z[re];ne!==null&&(ne.lane&=-536870913)}i&=~ie}c!==0&&cp(t,c,0),x!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=x&~(w&~n))}function cp(t,n,i){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-dt(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|i&261930}function up(t,n){var i=t.entangledLanes|=n;for(t=t.entanglements;i;){var c=31-dt(i),m=1<<c;m&n|t[c]&n&&(t[c]|=n),i&=~m}}function dp(t,n){var i=n&-n;return i=(i&42)!==0?1:xu(i),(i&(t.suspendedLanes|n))!==0?0:i}function xu(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function yu(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function fp(){var t=F.p;return t!==0?t:(t=window.event,t===void 0?32:Zy(t.type))}function hp(t,n){var i=F.p;try{return F.p=t,n()}finally{F.p=i}}var Ur=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Ur,on="__reactProps$"+Ur,Xa="__reactContainer$"+Ur,vu="__reactEvents$"+Ur,bj="__reactListeners$"+Ur,Sj="__reactHandles$"+Ur,mp="__reactResources$"+Ur,ui="__reactMarker$"+Ur;function bu(t){delete t[Ft],delete t[on],delete t[vu],delete t[bj],delete t[Sj]}function Qa(t){var n=t[Ft];if(n)return n;for(var i=t.parentNode;i;){if(n=i[Xa]||i[Ft]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(t=zy(t);t!==null;){if(i=t[Ft])return i;t=zy(t)}return n}t=i,i=t.parentNode}return null}function Za(t){if(t=t[Ft]||t[Xa]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function di(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(l(33))}function Ja(t){var n=t[mp];return n||(n=t[mp]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function It(t){t[ui]=!0}var pp=new Set,gp={};function Sa(t,n){Wa(t,n),Wa(t+"Capture",n)}function Wa(t,n){for(gp[t]=n,t=0;t<n.length;t++)pp.add(n[t])}var wj=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]*$"),xp={},yp={};function kj(t){return Ne.call(yp,t)?!0:Ne.call(xp,t)?!1:wj.test(t)?yp[t]=!0:(xp[t]=!0,!1)}function Ps(t,n,i){if(kj(n))if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+i)}}function Us(t,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+i)}}function mr(t,n,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(n,i,""+c)}}function _n(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vp(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function jj(t,n,i){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,x=c.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return m.call(this)},set:function(w){i=""+w,x.call(this,w)}}),Object.defineProperty(t,n,{enumerable:c.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Su(t){if(!t._valueTracker){var n=vp(t)?"checked":"value";t._valueTracker=jj(t,n,""+t[n])}}function bp(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var i=n.getValue(),c="";return t&&(c=vp(t)?t.checked?"true":"false":t.value),t=c,t!==i?(n.setValue(t),!0):!1}function Is(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Cj=/[\n"\\]/g;function Tn(t){return t.replace(Cj,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function wu(t,n,i,c,m,x,w,E){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),n!=null?w==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+_n(n)):t.value!==""+_n(n)&&(t.value=""+_n(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?ku(t,w,_n(n)):i!=null?ku(t,w,_n(i)):c!=null&&t.removeAttribute("value"),m==null&&x!=null&&(t.defaultChecked=!!x),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+_n(E):t.removeAttribute("name")}function Sp(t,n,i,c,m,x,w,E){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),n!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||n!=null)){Su(t);return}i=i!=null?""+_n(i):"",n=n!=null?""+_n(n):i,E||n===t.value||(t.value=n),t.defaultValue=n}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=E?t.checked:!!c,t.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),Su(t)}function ku(t,n,i){n==="number"&&Is(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function el(t,n,i,c){if(t=t.options,n){n={};for(var m=0;m<i.length;m++)n["$"+i[m]]=!0;for(i=0;i<t.length;i++)m=n.hasOwnProperty("$"+t[i].value),t[i].selected!==m&&(t[i].selected=m),m&&c&&(t[i].defaultSelected=!0)}else{for(i=""+_n(i),n=null,m=0;m<t.length;m++){if(t[m].value===i){t[m].selected=!0,c&&(t[m].defaultSelected=!0);return}n!==null||t[m].disabled||(n=t[m])}n!==null&&(n.selected=!0)}}function wp(t,n,i){if(n!=null&&(n=""+_n(n),n!==t.value&&(t.value=n),i==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=i!=null?""+_n(i):""}function kp(t,n,i,c){if(n==null){if(c!=null){if(i!=null)throw Error(l(92));if(q(c)){if(1<c.length)throw Error(l(93));c=c[0]}i=c}i==null&&(i=""),n=i}i=_n(n),t.defaultValue=i,c=t.textContent,c===i&&c!==""&&c!==null&&(t.value=c),Su(t)}function tl(t,n){if(n){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=n;return}}t.textContent=n}var Nj=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 jp(t,n,i){var c=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,i):typeof i!="number"||i===0||Nj.has(n)?n==="float"?t.cssFloat=i:t[n]=(""+i).trim():t[n]=i+"px"}function Cp(t,n,i){if(n!=null&&typeof n!="object")throw Error(l(62));if(t=t.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var m in n)c=n[m],n.hasOwnProperty(m)&&i[m]!==c&&jp(t,m,c)}else for(var x in n)n.hasOwnProperty(x)&&jp(t,x,n[x])}function ju(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Ej=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"],["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"]]),Aj=/^[\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 Bs(t){return Aj.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function pr(){}var Cu=null;function Nu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var nl=null,rl=null;function Np(t){var n=Za(t);if(n&&(t=n.stateNode)){var i=t[on]||null;e:switch(t=n.stateNode,n.type){case"input":if(wu(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Tn(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var c=i[n];if(c!==t&&c.form===t.form){var m=c[on]||null;if(!m)throw Error(l(90));wu(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<i.length;n++)c=i[n],c.form===t.form&&bp(c)}break e;case"textarea":wp(t,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&el(t,!!i.multiple,n,!1)}}}var Eu=!1;function Ep(t,n,i){if(Eu)return t(n,i);Eu=!0;try{var c=t(n);return c}finally{if(Eu=!1,(nl!==null||rl!==null)&&(Ao(),nl&&(n=nl,t=rl,rl=nl=null,Np(n),t)))for(n=0;n<t.length;n++)Np(t[n])}}function fi(t,n){var i=t.stateNode;if(i===null)return null;var c=i[on]||null;if(c===null)return null;i=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(l(231,n,typeof i));return i}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Au=!1;if(gr)try{var hi={};Object.defineProperty(hi,"passive",{get:function(){Au=!0}}),window.addEventListener("test",hi,hi),window.removeEventListener("test",hi,hi)}catch{Au=!1}var Ir=null,_u=null,Hs=null;function Ap(){if(Hs)return Hs;var t,n=_u,i=n.length,c,m="value"in Ir?Ir.value:Ir.textContent,x=m.length;for(t=0;t<i&&n[t]===m[t];t++);var w=i-t;for(c=1;c<=w&&n[i-c]===m[x-c];c++);return Hs=m.slice(t,1<c?1-c:void 0)}function qs(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Fs(){return!0}function _p(){return!1}function cn(t){function n(i,c,m,x,w){this._reactName=i,this._targetInst=m,this.type=c,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(i=t[E],this[E]=i?i(x):x[E]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Fs:_p,this.isPropagationStopped=_p,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Fs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Fs)},persist:function(){},isPersistent:Fs}),n}var wa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gs=cn(wa),mi=g({},wa,{view:0,detail:0}),_j=cn(mi),Tu,Ru,pi,$s=g({},mi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ou,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==pi&&(pi&&t.type==="mousemove"?(Tu=t.screenX-pi.screenX,Ru=t.screenY-pi.screenY):Ru=Tu=0,pi=t),Tu)},movementY:function(t){return"movementY"in t?t.movementY:Ru}}),Tp=cn($s),Tj=g({},$s,{dataTransfer:0}),Rj=cn(Tj),Mj=g({},mi,{relatedTarget:0}),Mu=cn(Mj),Oj=g({},wa,{animationName:0,elapsedTime:0,pseudoElement:0}),Dj=cn(Oj),zj=g({},wa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Lj=cn(zj),Pj=g({},wa,{data:0}),Rp=cn(Pj),Uj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ij={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"},Bj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hj(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Bj[t])?!!n[t]:!1}function Ou(){return Hj}var qj=g({},mi,{key:function(t){if(t.key){var n=Uj[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=qs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ij[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ou,charCode:function(t){return t.type==="keypress"?qs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?qs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Fj=cn(qj),Gj=g({},$s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mp=cn(Gj),$j=g({},mi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ou}),Yj=cn($j),Vj=g({},wa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kj=cn(Vj),Xj=g({},$s,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Qj=cn(Xj),Zj=g({},wa,{newState:0,oldState:0}),Jj=cn(Zj),Wj=[9,13,27,32],Du=gr&&"CompositionEvent"in window,gi=null;gr&&"documentMode"in document&&(gi=document.documentMode);var e2=gr&&"TextEvent"in window&&!gi,Op=gr&&(!Du||gi&&8<gi&&11>=gi),Dp=" ",zp=!1;function Lp(t,n){switch(t){case"keyup":return Wj.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var al=!1;function t2(t,n){switch(t){case"compositionend":return Pp(n);case"keypress":return n.which!==32?null:(zp=!0,Dp);case"textInput":return t=n.data,t===Dp&&zp?null:t;default:return null}}function n2(t,n){if(al)return t==="compositionend"||!Du&&Lp(t,n)?(t=Ap(),Hs=_u=Ir=null,al=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Op&&n.locale!=="ko"?null:n.data;default:return null}}var r2={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 Up(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!r2[t.type]:n==="textarea"}function Ip(t,n,i,c){nl?rl?rl.push(c):rl=[c]:nl=c,n=zo(n,"onChange"),0<n.length&&(i=new Gs("onChange","change",null,i,c),t.push({event:i,listeners:n}))}var xi=null,yi=null;function a2(t){Sy(t,0)}function Ys(t){var n=di(t);if(bp(n))return t}function Bp(t,n){if(t==="change")return n}var Hp=!1;if(gr){var zu;if(gr){var Lu="oninput"in document;if(!Lu){var qp=document.createElement("div");qp.setAttribute("oninput","return;"),Lu=typeof qp.oninput=="function"}zu=Lu}else zu=!1;Hp=zu&&(!document.documentMode||9<document.documentMode)}function Fp(){xi&&(xi.detachEvent("onpropertychange",Gp),yi=xi=null)}function Gp(t){if(t.propertyName==="value"&&Ys(yi)){var n=[];Ip(n,yi,t,Nu(t)),Ep(a2,n)}}function l2(t,n,i){t==="focusin"?(Fp(),xi=n,yi=i,xi.attachEvent("onpropertychange",Gp)):t==="focusout"&&Fp()}function i2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ys(yi)}function s2(t,n){if(t==="click")return Ys(n)}function o2(t,n){if(t==="input"||t==="change")return Ys(n)}function c2(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var yn=typeof Object.is=="function"?Object.is:c2;function vi(t,n){if(yn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var i=Object.keys(t),c=Object.keys(n);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var m=i[c];if(!Ne.call(n,m)||!yn(t[m],n[m]))return!1}return!0}function $p(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Yp(t,n){var i=$p(t);t=0;for(var c;i;){if(i.nodeType===3){if(c=t+i.textContent.length,t<=n&&c>=n)return{node:i,offset:n-t};t=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=$p(i)}}function Vp(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Vp(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Kp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Is(t.document);n instanceof t.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)t=n.contentWindow;else break;n=Is(t.document)}return n}function Pu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var u2=gr&&"documentMode"in document&&11>=document.documentMode,ll=null,Uu=null,bi=null,Iu=!1;function Xp(t,n,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Iu||ll==null||ll!==Is(c)||(c=ll,"selectionStart"in c&&Pu(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),bi&&vi(bi,c)||(bi=c,c=zo(Uu,"onSelect"),0<c.length&&(n=new Gs("onSelect","select",null,n,i),t.push({event:n,listeners:c}),n.target=ll)))}function ka(t,n){var i={};return i[t.toLowerCase()]=n.toLowerCase(),i["Webkit"+t]="webkit"+n,i["Moz"+t]="moz"+n,i}var il={animationend:ka("Animation","AnimationEnd"),animationiteration:ka("Animation","AnimationIteration"),animationstart:ka("Animation","AnimationStart"),transitionrun:ka("Transition","TransitionRun"),transitionstart:ka("Transition","TransitionStart"),transitioncancel:ka("Transition","TransitionCancel"),transitionend:ka("Transition","TransitionEnd")},Bu={},Qp={};gr&&(Qp=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function ja(t){if(Bu[t])return Bu[t];if(!il[t])return t;var n=il[t],i;for(i in n)if(n.hasOwnProperty(i)&&i in Qp)return Bu[t]=n[i];return t}var Zp=ja("animationend"),Jp=ja("animationiteration"),Wp=ja("animationstart"),d2=ja("transitionrun"),f2=ja("transitionstart"),h2=ja("transitioncancel"),eg=ja("transitionend"),tg=new Map,Hu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");Hu.push("scrollEnd");function $n(t,n){tg.set(t,n),Sa(n,[t])}var Vs=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Rn=[],sl=0,qu=0;function Ks(){for(var t=sl,n=qu=sl=0;n<t;){var i=Rn[n];Rn[n++]=null;var c=Rn[n];Rn[n++]=null;var m=Rn[n];Rn[n++]=null;var x=Rn[n];if(Rn[n++]=null,c!==null&&m!==null){var w=c.pending;w===null?m.next=m:(m.next=w.next,w.next=m),c.pending=m}x!==0&&ng(i,m,x)}}function Xs(t,n,i,c){Rn[sl++]=t,Rn[sl++]=n,Rn[sl++]=i,Rn[sl++]=c,qu|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Fu(t,n,i,c){return Xs(t,n,i,c),Qs(t)}function Ca(t,n){return Xs(t,null,null,n),Qs(t)}function ng(t,n,i){t.lanes|=i;var c=t.alternate;c!==null&&(c.lanes|=i);for(var m=!1,x=t.return;x!==null;)x.childLanes|=i,c=x.alternate,c!==null&&(c.childLanes|=i),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(m=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,m&&n!==null&&(m=31-dt(i),t=x.hiddenUpdates,c=t[m],c===null?t[m]=[n]:c.push(n),n.lane=i|536870912),x):null}function Qs(t){if(50<qi)throw qi=0,Jd=null,Error(l(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ol={};function m2(t,n,i,c){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vn(t,n,i,c){return new m2(t,n,i,c)}function Gu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xr(t,n){var i=t.alternate;return i===null?(i=vn(t.tag,n,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=n,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,n=t.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function rg(t,n){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,n=i.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Zs(t,n,i,c,m,x){var w=0;if(c=t,typeof t=="function")Gu(t)&&(w=1);else if(typeof t=="string")w=vC(t,i,oe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case V:return t=vn(31,i,n,m),t.elementType=V,t.lanes=x,t;case C:return Na(i.children,m,x,n);case N:w=8,m|=24;break;case j:return t=vn(12,i,n,m|2),t.elementType=j,t.lanes=x,t;case L:return t=vn(13,i,n,m),t.elementType=L,t.lanes=x,t;case D:return t=vn(19,i,n,m),t.elementType=D,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case M:w=10;break e;case R:w=9;break e;case O:w=11;break e;case I:w=14;break e;case B:w=16,c=null;break e}w=29,i=Error(l(130,t===null?"null":typeof t,"")),c=null}return n=vn(w,i,n,m),n.elementType=t,n.type=c,n.lanes=x,n}function Na(t,n,i,c){return t=vn(7,t,c,n),t.lanes=i,t}function $u(t,n,i){return t=vn(6,t,null,n),t.lanes=i,t}function ag(t){var n=vn(18,null,null,0);return n.stateNode=t,n}function Yu(t,n,i){return n=vn(4,t.children!==null?t.children:[],t.key,n),n.lanes=i,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var lg=new WeakMap;function Mn(t,n){if(typeof t=="object"&&t!==null){var i=lg.get(t);return i!==void 0?i:(n={value:t,source:n,stack:Fn(n)},lg.set(t,n),n)}return{value:t,source:n,stack:Fn(n)}}var cl=[],ul=0,Js=null,Si=0,On=[],Dn=0,Br=null,Wn=1,er="";function yr(t,n){cl[ul++]=Si,cl[ul++]=Js,Js=t,Si=n}function ig(t,n,i){On[Dn++]=Wn,On[Dn++]=er,On[Dn++]=Br,Br=t;var c=Wn;t=er;var m=32-dt(c)-1;c&=~(1<<m),i+=1;var x=32-dt(n)+m;if(30<x){var w=m-m%5;x=(c&(1<<w)-1).toString(32),c>>=w,m-=w,Wn=1<<32-dt(n)+m|i<<m|c,er=x+t}else Wn=1<<x|i<<m|c,er=t}function Vu(t){t.return!==null&&(yr(t,1),ig(t,1,0))}function Ku(t){for(;t===Js;)Js=cl[--ul],cl[ul]=null,Si=cl[--ul],cl[ul]=null;for(;t===Br;)Br=On[--Dn],On[Dn]=null,er=On[--Dn],On[Dn]=null,Wn=On[--Dn],On[Dn]=null}function sg(t,n){On[Dn++]=Wn,On[Dn++]=er,On[Dn++]=Br,Wn=n.id,er=n.overflow,Br=t}var Gt=null,pt=null,Ze=!1,Hr=null,zn=!1,Xu=Error(l(519));function qr(t){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wi(Mn(n,t)),Xu}function og(t){var n=t.stateNode,i=t.type,c=t.memoizedProps;switch(n[Ft]=t,n[on]=c,i){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(i=0;i<Gi.length;i++)Ye(Gi[i],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),Sp(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),kp(n,c.value,c.defaultValue,c.children)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||c.suppressHydrationWarning===!0||Cy(n.textContent,i)?(c.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),c.onScroll!=null&&Ye("scroll",n),c.onScrollEnd!=null&&Ye("scrollend",n),c.onClick!=null&&(n.onclick=pr),n=!0):n=!1,n||qr(t,!0)}function cg(t){for(Gt=t.return;Gt;)switch(Gt.tag){case 5:case 31:case 13:zn=!1;return;case 27:case 3:zn=!0;return;default:Gt=Gt.return}}function dl(t){if(t!==Gt)return!1;if(!Ze)return cg(t),Ze=!0,!1;var n=t.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||mf(t.type,t.memoizedProps)),i=!i),i&&pt&&qr(t),cg(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));pt=Dy(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));pt=Dy(t)}else n===27?(n=pt,na(t.type)?(t=vf,vf=null,pt=t):pt=n):pt=Gt?Pn(t.stateNode.nextSibling):null;return!0}function Ea(){pt=Gt=null,Ze=!1}function Qu(){var t=Hr;return t!==null&&(hn===null?hn=t:hn.push.apply(hn,t),Hr=null),t}function wi(t){Hr===null?Hr=[t]:Hr.push(t)}var Zu=_(null),Aa=null,vr=null;function Fr(t,n,i){T(Zu,n._currentValue),n._currentValue=i}function br(t){t._currentValue=Zu.current,G(Zu)}function Ju(t,n,i){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===i)break;t=t.return}}function Wu(t,n,i,c){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var x=m.dependencies;if(x!==null){var w=m.child;x=x.firstContext;e:for(;x!==null;){var E=x;x=m;for(var U=0;U<n.length;U++)if(E.context===n[U]){x.lanes|=i,E=x.alternate,E!==null&&(E.lanes|=i),Ju(x.return,i,t),c||(w=null);break e}x=E.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(l(341));w.lanes|=i,x=w.alternate,x!==null&&(x.lanes|=i),Ju(w,i,t),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===t){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function fl(t,n,i,c){t=null;for(var m=n,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(l(387));if(w=w.memoizedProps,w!==null){var E=m.type;yn(m.pendingProps.value,w.value)||(t!==null?t.push(E):t=[E])}}else if(m===ge.current){if(w=m.alternate,w===null)throw Error(l(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(Xi):t=[Xi])}m=m.return}t!==null&&Wu(n,t,i,c),n.flags|=262144}function Ws(t){for(t=t.firstContext;t!==null;){if(!yn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _a(t){Aa=t,vr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function $t(t){return ug(Aa,t)}function eo(t,n){return Aa===null&&_a(t),ug(t,n)}function ug(t,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},vr===null){if(t===null)throw Error(l(308));vr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else vr=vr.next=n;return i}var p2=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(i,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(i){return i()})}},g2=e.unstable_scheduleCallback,x2=e.unstable_NormalPriority,_t={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ed(){return{controller:new p2,data:new Map,refCount:0}}function ki(t){t.refCount--,t.refCount===0&&g2(x2,function(){t.controller.abort()})}var ji=null,td=0,hl=0,ml=null;function y2(t,n){if(ji===null){var i=ji=[];td=0,hl=af(),ml={status:"pending",value:void 0,then:function(c){i.push(c)}}}return td++,n.then(dg,dg),n}function dg(){if(--td===0&&ji!==null){ml!==null&&(ml.status="fulfilled");var t=ji;ji=null,hl=0,ml=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function v2(t,n){var i=[],c={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var m=0;m<i.length;m++)(0,i[m])(n)},function(m){for(c.status="rejected",c.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),c}var fg=z.S;z.S=function(t,n){Xx=qe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&y2(t,n),fg!==null&&fg(t,n)};var Ta=_(null);function nd(){var t=Ta.current;return t!==null?t:ft.pooledCache}function to(t,n){n===null?T(Ta,Ta.current):T(Ta,n.pool)}function hg(){var t=nd();return t===null?null:{parent:_t._currentValue,pool:t}}var pl=Error(l(460)),rd=Error(l(474)),no=Error(l(542)),ro={then:function(){}};function mg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function pg(t,n,i){switch(i=t[i],i===void 0?t.push(n):i!==n&&(n.then(pr,pr),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,xg(t),t;default:if(typeof n.status=="string")n.then(pr,pr);else{if(t=ft,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=c}},function(c){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,xg(t),t}throw Ma=n,pl}}function Ra(t){try{var n=t._init;return n(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ma=i,pl):i}}var Ma=null;function gg(){if(Ma===null)throw Error(l(459));var t=Ma;return Ma=null,t}function xg(t){if(t===pl||t===no)throw Error(l(483))}var gl=null,Ci=0;function ao(t){var n=Ci;return Ci+=1,gl===null&&(gl=[]),pg(gl,t,n)}function Ni(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function lo(t,n){throw n.$$typeof===v?Error(l(525)):(t=Object.prototype.toString.call(n),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function yg(t){function n($,H){if(t){var X=$.deletions;X===null?($.deletions=[H],$.flags|=16):X.push(H)}}function i($,H){if(!t)return null;for(;H!==null;)n($,H),H=H.sibling;return null}function c($){for(var H=new Map;$!==null;)$.key!==null?H.set($.key,$):H.set($.index,$),$=$.sibling;return H}function m($,H){return $=xr($,H),$.index=0,$.sibling=null,$}function x($,H,X){return $.index=X,t?(X=$.alternate,X!==null?(X=X.index,X<H?($.flags|=67108866,H):X):($.flags|=67108866,H)):($.flags|=1048576,H)}function w($){return t&&$.alternate===null&&($.flags|=67108866),$}function E($,H,X,le){return H===null||H.tag!==6?(H=$u(X,$.mode,le),H.return=$,H):(H=m(H,X),H.return=$,H)}function U($,H,X,le){var _e=X.type;return _e===C?re($,H,X.props.children,le,X.key):H!==null&&(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&Ra(_e)===H.type)?(H=m(H,X.props),Ni(H,X),H.return=$,H):(H=Zs(X.type,X.key,X.props,null,$.mode,le),Ni(H,X),H.return=$,H)}function Q($,H,X,le){return H===null||H.tag!==4||H.stateNode.containerInfo!==X.containerInfo||H.stateNode.implementation!==X.implementation?(H=Yu(X,$.mode,le),H.return=$,H):(H=m(H,X.children||[]),H.return=$,H)}function re($,H,X,le,_e){return H===null||H.tag!==7?(H=Na(X,$.mode,le,_e),H.return=$,H):(H=m(H,X),H.return=$,H)}function ie($,H,X){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=$u(""+H,$.mode,X),H.return=$,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return X=Zs(H.type,H.key,H.props,null,$.mode,X),Ni(X,H),X.return=$,X;case k:return H=Yu(H,$.mode,X),H.return=$,H;case B:return H=Ra(H),ie($,H,X)}if(q(H)||te(H))return H=Na(H,$.mode,X,null),H.return=$,H;if(typeof H.then=="function")return ie($,ao(H),X);if(H.$$typeof===M)return ie($,eo($,H),X);lo($,H)}return null}function Z($,H,X,le){var _e=H!==null?H.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return _e!==null?null:E($,H,""+X,le);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return X.key===_e?U($,H,X,le):null;case k:return X.key===_e?Q($,H,X,le):null;case B:return X=Ra(X),Z($,H,X,le)}if(q(X)||te(X))return _e!==null?null:re($,H,X,le,null);if(typeof X.then=="function")return Z($,H,ao(X),le);if(X.$$typeof===M)return Z($,H,eo($,X),le);lo($,X)}return null}function ne($,H,X,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return $=$.get(X)||null,E(H,$,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return $=$.get(le.key===null?X:le.key)||null,U(H,$,le,_e);case k:return $=$.get(le.key===null?X:le.key)||null,Q(H,$,le,_e);case B:return le=Ra(le),ne($,H,X,le,_e)}if(q(le)||te(le))return $=$.get(X)||null,re(H,$,le,_e,null);if(typeof le.then=="function")return ne($,H,X,ao(le),_e);if(le.$$typeof===M)return ne($,H,X,eo(H,le),_e);lo(H,le)}return null}function ye($,H,X,le){for(var _e=null,tt=null,Ce=H,Be=H=0,Xe=null;Ce!==null&&Be<X.length;Be++){Ce.index>Be?(Xe=Ce,Ce=null):Xe=Ce.sibling;var nt=Z($,Ce,X[Be],le);if(nt===null){Ce===null&&(Ce=Xe);break}t&&Ce&&nt.alternate===null&&n($,Ce),H=x(nt,H,Be),tt===null?_e=nt:tt.sibling=nt,tt=nt,Ce=Xe}if(Be===X.length)return i($,Ce),Ze&&yr($,Be),_e;if(Ce===null){for(;Be<X.length;Be++)Ce=ie($,X[Be],le),Ce!==null&&(H=x(Ce,H,Be),tt===null?_e=Ce:tt.sibling=Ce,tt=Ce);return Ze&&yr($,Be),_e}for(Ce=c(Ce);Be<X.length;Be++)Xe=ne(Ce,$,Be,X[Be],le),Xe!==null&&(t&&Xe.alternate!==null&&Ce.delete(Xe.key===null?Be:Xe.key),H=x(Xe,H,Be),tt===null?_e=Xe:tt.sibling=Xe,tt=Xe);return t&&Ce.forEach(function(sa){return n($,sa)}),Ze&&yr($,Be),_e}function Me($,H,X,le){if(X==null)throw Error(l(151));for(var _e=null,tt=null,Ce=H,Be=H=0,Xe=null,nt=X.next();Ce!==null&&!nt.done;Be++,nt=X.next()){Ce.index>Be?(Xe=Ce,Ce=null):Xe=Ce.sibling;var sa=Z($,Ce,nt.value,le);if(sa===null){Ce===null&&(Ce=Xe);break}t&&Ce&&sa.alternate===null&&n($,Ce),H=x(sa,H,Be),tt===null?_e=sa:tt.sibling=sa,tt=sa,Ce=Xe}if(nt.done)return i($,Ce),Ze&&yr($,Be),_e;if(Ce===null){for(;!nt.done;Be++,nt=X.next())nt=ie($,nt.value,le),nt!==null&&(H=x(nt,H,Be),tt===null?_e=nt:tt.sibling=nt,tt=nt);return Ze&&yr($,Be),_e}for(Ce=c(Ce);!nt.done;Be++,nt=X.next())nt=ne(Ce,$,Be,nt.value,le),nt!==null&&(t&&nt.alternate!==null&&Ce.delete(nt.key===null?Be:nt.key),H=x(nt,H,Be),tt===null?_e=nt:tt.sibling=nt,tt=nt);return t&&Ce.forEach(function(TC){return n($,TC)}),Ze&&yr($,Be),_e}function ut($,H,X,le){if(typeof X=="object"&&X!==null&&X.type===C&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case b:e:{for(var _e=X.key;H!==null;){if(H.key===_e){if(_e=X.type,_e===C){if(H.tag===7){i($,H.sibling),le=m(H,X.props.children),le.return=$,$=le;break e}}else if(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&Ra(_e)===H.type){i($,H.sibling),le=m(H,X.props),Ni(le,X),le.return=$,$=le;break e}i($,H);break}else n($,H);H=H.sibling}X.type===C?(le=Na(X.props.children,$.mode,le,X.key),le.return=$,$=le):(le=Zs(X.type,X.key,X.props,null,$.mode,le),Ni(le,X),le.return=$,$=le)}return w($);case k:e:{for(_e=X.key;H!==null;){if(H.key===_e)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){i($,H.sibling),le=m(H,X.children||[]),le.return=$,$=le;break e}else{i($,H);break}else n($,H);H=H.sibling}le=Yu(X,$.mode,le),le.return=$,$=le}return w($);case B:return X=Ra(X),ut($,H,X,le)}if(q(X))return ye($,H,X,le);if(te(X)){if(_e=te(X),typeof _e!="function")throw Error(l(150));return X=_e.call(X),Me($,H,X,le)}if(typeof X.then=="function")return ut($,H,ao(X),le);if(X.$$typeof===M)return ut($,H,eo($,X),le);lo($,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,H!==null&&H.tag===6?(i($,H.sibling),le=m(H,X),le.return=$,$=le):(i($,H),le=$u(X,$.mode,le),le.return=$,$=le),w($)):i($,H)}return function($,H,X,le){try{Ci=0;var _e=ut($,H,X,le);return gl=null,_e}catch(Ce){if(Ce===pl||Ce===no)throw Ce;var tt=vn(29,Ce,null,$.mode);return tt.lanes=le,tt.return=$,tt}}}var Oa=yg(!0),vg=yg(!1),Gr=!1;function ad(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ld(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function $r(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Yr(t,n,i){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(rt&2)!==0){var m=c.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),c.pending=n,n=Qs(t),ng(t,null,i),n}return Xs(t,c,n,i),Qs(t)}function Ei(t,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,i|=c,n.lanes=i,up(t,i)}}function id(t,n){var i=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var m=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?m=x=w:x=x.next=w,i=i.next}while(i!==null);x===null?m=x=n:x=x.next=n}else m=x=n;i={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=n:t.next=n,i.lastBaseUpdate=n}var sd=!1;function Ai(){if(sd){var t=ml;if(t!==null)throw t}}function _i(t,n,i,c){sd=!1;var m=t.updateQueue;Gr=!1;var x=m.firstBaseUpdate,w=m.lastBaseUpdate,E=m.shared.pending;if(E!==null){m.shared.pending=null;var U=E,Q=U.next;U.next=null,w===null?x=Q:w.next=Q,w=U;var re=t.alternate;re!==null&&(re=re.updateQueue,E=re.lastBaseUpdate,E!==w&&(E===null?re.firstBaseUpdate=Q:E.next=Q,re.lastBaseUpdate=U))}if(x!==null){var ie=m.baseState;w=0,re=Q=U=null,E=x;do{var Z=E.lane&-536870913,ne=Z!==E.lane;if(ne?(Ke&Z)===Z:(c&Z)===Z){Z!==0&&Z===hl&&(sd=!0),re!==null&&(re=re.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var ye=t,Me=E;Z=n;var ut=i;switch(Me.tag){case 1:if(ye=Me.payload,typeof ye=="function"){ie=ye.call(ut,ie,Z);break e}ie=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Me.payload,Z=typeof ye=="function"?ye.call(ut,ie,Z):ye,Z==null)break e;ie=g({},ie,Z);break e;case 2:Gr=!0}}Z=E.callback,Z!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=m.callbacks,ne===null?m.callbacks=[Z]:ne.push(Z))}else ne={lane:Z,tag:E.tag,payload:E.payload,callback:E.callback,next:null},re===null?(Q=re=ne,U=ie):re=re.next=ne,w|=Z;if(E=E.next,E===null){if(E=m.shared.pending,E===null)break;ne=E,E=ne.next,ne.next=null,m.lastBaseUpdate=ne,m.shared.pending=null}}while(!0);re===null&&(U=ie),m.baseState=U,m.firstBaseUpdate=Q,m.lastBaseUpdate=re,x===null&&(m.shared.lanes=0),Zr|=w,t.lanes=w,t.memoizedState=ie}}function bg(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function Sg(t,n){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)bg(i[t],n)}var xl=_(null),io=_(0);function wg(t,n){t=_r,T(io,t),T(xl,n),_r=t|n.baseLanes}function od(){T(io,_r),T(xl,xl.current)}function cd(){_r=io.current,G(xl),G(io)}var bn=_(null),Ln=null;function Vr(t){var n=t.alternate;T(Et,Et.current&1),T(bn,t),Ln===null&&(n===null||xl.current!==null||n.memoizedState!==null)&&(Ln=t)}function ud(t){T(Et,Et.current),T(bn,t),Ln===null&&(Ln=t)}function kg(t){t.tag===22?(T(Et,Et.current),T(bn,t),Ln===null&&(Ln=t)):Kr()}function Kr(){T(Et,Et.current),T(bn,bn.current)}function Sn(t){G(bn),Ln===t&&(Ln=null),G(Et)}var Et=_(0);function so(t){for(var n=t;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||xf(i)||yf(i)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Sr=0,Ie=null,ot=null,Tt=null,oo=!1,yl=!1,Da=!1,co=0,Ti=0,vl=null,b2=0;function Ct(){throw Error(l(321))}function dd(t,n){if(n===null)return!1;for(var i=0;i<n.length&&i<t.length;i++)if(!yn(t[i],n[i]))return!1;return!0}function fd(t,n,i,c,m,x){return Sr=x,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=t===null||t.memoizedState===null?ix:Ed,Da=!1,x=i(c,m),Da=!1,yl&&(x=Cg(n,i,c,m)),jg(t),x}function jg(t){z.H=Oi;var n=ot!==null&&ot.next!==null;if(Sr=0,Tt=ot=Ie=null,oo=!1,Ti=0,vl=null,n)throw Error(l(300));t===null||Rt||(t=t.dependencies,t!==null&&Ws(t)&&(Rt=!0))}function Cg(t,n,i,c){Ie=t;var m=0;do{if(yl&&(vl=null),Ti=0,yl=!1,25<=m)throw Error(l(301));if(m+=1,Tt=ot=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=sx,x=n(i,c)}while(yl);return x}function S2(){var t=z.H,n=t.useState()[0];return n=typeof n.then=="function"?Ri(n):n,t=t.useState()[0],(ot!==null?ot.memoizedState:null)!==t&&(Ie.flags|=1024),n}function hd(){var t=co!==0;return co=0,t}function md(t,n,i){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~i}function pd(t){if(oo){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}oo=!1}Sr=0,Tt=ot=Ie=null,yl=!1,Ti=co=0,vl=null}function tn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ie.memoizedState=Tt=t:Tt=Tt.next=t,Tt}function At(){if(ot===null){var t=Ie.alternate;t=t!==null?t.memoizedState:null}else t=ot.next;var n=Tt===null?Ie.memoizedState:Tt.next;if(n!==null)Tt=n,ot=t;else{if(t===null)throw Ie.alternate===null?Error(l(467)):Error(l(310));ot=t,t={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Tt===null?Ie.memoizedState=Tt=t:Tt=Tt.next=t}return Tt}function uo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ri(t){var n=Ti;return Ti+=1,vl===null&&(vl=[]),t=pg(vl,t,n),n=Ie,(Tt===null?n.memoizedState:Tt.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?ix:Ed),t}function fo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ri(t);if(t.$$typeof===M)return $t(t)}throw Error(l(438,String(t)))}function gd(t){var n=null,i=Ie.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var c=Ie.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=uo(),Ie.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(t),c=0;c<t;c++)i[c]=P;return n.index++,i}function wr(t,n){return typeof n=="function"?n(t):n}function ho(t){var n=At();return xd(n,ot,t)}function xd(t,n,i){var c=t.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=i;var m=t.baseQueue,x=c.pending;if(x!==null){if(m!==null){var w=m.next;m.next=x.next,x.next=w}n.baseQueue=m=x,c.pending=null}if(x=t.baseState,m===null)t.memoizedState=x;else{n=m.next;var E=w=null,U=null,Q=n,re=!1;do{var ie=Q.lane&-536870913;if(ie!==Q.lane?(Ke&ie)===ie:(Sr&ie)===ie){var Z=Q.revertLane;if(Z===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),ie===hl&&(re=!0);else if((Sr&Z)===Z){Q=Q.next,Z===hl&&(re=!0);continue}else ie={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},U===null?(E=U=ie,w=x):U=U.next=ie,Ie.lanes|=Z,Zr|=Z;ie=Q.action,Da&&i(x,ie),x=Q.hasEagerState?Q.eagerState:i(x,ie)}else Z={lane:ie,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},U===null?(E=U=Z,w=x):U=U.next=Z,Ie.lanes|=ie,Zr|=ie;Q=Q.next}while(Q!==null&&Q!==n);if(U===null?w=x:U.next=E,!yn(x,t.memoizedState)&&(Rt=!0,re&&(i=ml,i!==null)))throw i;t.memoizedState=x,t.baseState=w,t.baseQueue=U,c.lastRenderedState=x}return m===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function yd(t){var n=At(),i=n.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=t;var c=i.dispatch,m=i.pending,x=n.memoizedState;if(m!==null){i.pending=null;var w=m=m.next;do x=t(x,w.action),w=w.next;while(w!==m);yn(x,n.memoizedState)||(Rt=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),i.lastRenderedState=x}return[x,c]}function Ng(t,n,i){var c=Ie,m=At(),x=Ze;if(x){if(i===void 0)throw Error(l(407));i=i()}else i=n();var w=!yn((ot||m).memoizedState,i);if(w&&(m.memoizedState=i,Rt=!0),m=m.queue,Sd(_g.bind(null,c,m,t),[t]),m.getSnapshot!==n||w||Tt!==null&&Tt.memoizedState.tag&1){if(c.flags|=2048,bl(9,{destroy:void 0},Ag.bind(null,c,m,i,n),null),ft===null)throw Error(l(349));x||(Sr&127)!==0||Eg(c,n,i)}return i}function Eg(t,n,i){t.flags|=16384,t={getSnapshot:n,value:i},n=Ie.updateQueue,n===null?(n=uo(),Ie.updateQueue=n,n.stores=[t]):(i=n.stores,i===null?n.stores=[t]:i.push(t))}function Ag(t,n,i,c){n.value=i,n.getSnapshot=c,Tg(n)&&Rg(t)}function _g(t,n,i){return i(function(){Tg(n)&&Rg(t)})}function Tg(t){var n=t.getSnapshot;t=t.value;try{var i=n();return!yn(t,i)}catch{return!0}}function Rg(t){var n=Ca(t,2);n!==null&&mn(n,t,2)}function vd(t){var n=tn();if(typeof t=="function"){var i=t;if(t=i(),Da){sn(!0);try{i()}finally{sn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:t},n}function Mg(t,n,i,c){return t.baseState=i,xd(t,ot,typeof c=="function"?c:wr)}function w2(t,n,i,c,m){if(go(t))throw Error(l(485));if(t=n.action,t!==null){var x={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){x.listeners.push(w)}};z.T!==null?i(!0):x.isTransition=!1,c(x),i=n.pending,i===null?(x.next=n.pending=x,Og(n,x)):(x.next=i.next,n.pending=i.next=x)}}function Og(t,n){var i=n.action,c=n.payload,m=t.state;if(n.isTransition){var x=z.T,w={};z.T=w;try{var E=i(m,c),U=z.S;U!==null&&U(w,E),Dg(t,n,E)}catch(Q){bd(t,n,Q)}finally{x!==null&&w.types!==null&&(x.types=w.types),z.T=x}}else try{x=i(m,c),Dg(t,n,x)}catch(Q){bd(t,n,Q)}}function Dg(t,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){zg(t,n,c)},function(c){return bd(t,n,c)}):zg(t,n,i)}function zg(t,n,i){n.status="fulfilled",n.value=i,Lg(n),t.state=i,n=t.pending,n!==null&&(i=n.next,i===n?t.pending=null:(i=i.next,n.next=i,Og(t,i)))}function bd(t,n,i){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=i,Lg(n),n=n.next;while(n!==c)}t.action=null}function Lg(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Pg(t,n){return n}function Ug(t,n){if(Ze){var i=ft.formState;if(i!==null){e:{var c=Ie;if(Ze){if(pt){t:{for(var m=pt,x=zn;m.nodeType!==8;){if(!x){m=null;break t}if(m=Pn(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){pt=Pn(m.nextSibling),c=m.data==="F!";break e}}qr(c)}c=!1}c&&(n=i[0])}}return i=tn(),i.memoizedState=i.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pg,lastRenderedState:n},i.queue=c,i=rx.bind(null,Ie,c),c.dispatch=i,c=vd(!1),x=Nd.bind(null,Ie,!1,c.queue),c=tn(),m={state:n,dispatch:null,action:t,pending:null},c.queue=m,i=w2.bind(null,Ie,m,x,i),m.dispatch=i,c.memoizedState=t,[n,i,!1]}function Ig(t){var n=At();return Bg(n,ot,t)}function Bg(t,n,i){if(n=xd(t,n,Pg)[0],t=ho(wr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=Ri(n)}catch(w){throw w===pl?no:w}else c=n;n=At();var m=n.queue,x=m.dispatch;return i!==n.memoizedState&&(Ie.flags|=2048,bl(9,{destroy:void 0},k2.bind(null,m,i),null)),[c,x,t]}function k2(t,n){t.action=n}function Hg(t){var n=At(),i=ot;if(i!==null)return Bg(n,i,t);At(),n=n.memoizedState,i=At();var c=i.queue.dispatch;return i.memoizedState=t,[n,c,!1]}function bl(t,n,i,c){return t={tag:t,create:i,deps:c,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=uo(),Ie.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=t.next=t:(c=i.next,i.next=t,t.next=c,n.lastEffect=t),t}function qg(){return At().memoizedState}function mo(t,n,i,c){var m=tn();Ie.flags|=t,m.memoizedState=bl(1|n,{destroy:void 0},i,c===void 0?null:c)}function po(t,n,i,c){var m=At();c=c===void 0?null:c;var x=m.memoizedState.inst;ot!==null&&c!==null&&dd(c,ot.memoizedState.deps)?m.memoizedState=bl(n,x,i,c):(Ie.flags|=t,m.memoizedState=bl(1|n,x,i,c))}function Fg(t,n){mo(8390656,8,t,n)}function Sd(t,n){po(2048,8,t,n)}function j2(t){Ie.flags|=4;var n=Ie.updateQueue;if(n===null)n=uo(),Ie.updateQueue=n,n.events=[t];else{var i=n.events;i===null?n.events=[t]:i.push(t)}}function Gg(t){var n=At().memoizedState;return j2({ref:n,nextImpl:t}),function(){if((rt&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function $g(t,n){return po(4,2,t,n)}function Yg(t,n){return po(4,4,t,n)}function Vg(t,n){if(typeof n=="function"){t=t();var i=n(t);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Kg(t,n,i){i=i!=null?i.concat([t]):null,po(4,4,Vg.bind(null,n,t),i)}function wd(){}function Xg(t,n){var i=At();n=n===void 0?null:n;var c=i.memoizedState;return n!==null&&dd(n,c[1])?c[0]:(i.memoizedState=[t,n],t)}function Qg(t,n){var i=At();n=n===void 0?null:n;var c=i.memoizedState;if(n!==null&&dd(n,c[1]))return c[0];if(c=t(),Da){sn(!0);try{t()}finally{sn(!1)}}return i.memoizedState=[c,n],c}function kd(t,n,i){return i===void 0||(Sr&1073741824)!==0&&(Ke&261930)===0?t.memoizedState=n:(t.memoizedState=i,t=Zx(),Ie.lanes|=t,Zr|=t,i)}function Zg(t,n,i,c){return yn(i,n)?i:xl.current!==null?(t=kd(t,i,c),yn(t,n)||(Rt=!0),t):(Sr&42)===0||(Sr&1073741824)!==0&&(Ke&261930)===0?(Rt=!0,t.memoizedState=i):(t=Zx(),Ie.lanes|=t,Zr|=t,n)}function Jg(t,n,i,c,m){var x=F.p;F.p=x!==0&&8>x?x:8;var w=z.T,E={};z.T=E,Nd(t,!1,n,i);try{var U=m(),Q=z.S;if(Q!==null&&Q(E,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=v2(U,c);Mi(t,n,re,jn(t))}else Mi(t,n,c,jn(t))}catch(ie){Mi(t,n,{then:function(){},status:"rejected",reason:ie},jn())}finally{F.p=x,w!==null&&E.types!==null&&(w.types=E.types),z.T=w}}function C2(){}function jd(t,n,i,c){if(t.tag!==5)throw Error(l(476));var m=Wg(t).queue;Jg(t,m,n,J,i===null?C2:function(){return ex(t),i(c)})}function Wg(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:J},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:i},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ex(t){var n=Wg(t);n.next===null&&(n=t.alternate.memoizedState),Mi(t,n.next.queue,{},jn())}function Cd(){return $t(Xi)}function tx(){return At().memoizedState}function nx(){return At().memoizedState}function N2(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var i=jn();t=$r(i);var c=Yr(n,t,i);c!==null&&(mn(c,n,i),Ei(c,n,i)),n={cache:ed()},t.payload=n;return}n=n.return}}function E2(t,n,i){var c=jn();i={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},go(t)?ax(n,i):(i=Fu(t,n,i,c),i!==null&&(mn(i,t,c),lx(i,n,c)))}function rx(t,n,i){var c=jn();Mi(t,n,i,c)}function Mi(t,n,i,c){var m={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(go(t))ax(n,m);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var w=n.lastRenderedState,E=x(w,i);if(m.hasEagerState=!0,m.eagerState=E,yn(E,w))return Xs(t,n,m,0),ft===null&&Ks(),!1}catch{}if(i=Fu(t,n,m,c),i!==null)return mn(i,t,c),lx(i,n,c),!0}return!1}function Nd(t,n,i,c){if(c={lane:2,revertLane:af(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},go(t)){if(n)throw Error(l(479))}else n=Fu(t,i,c,2),n!==null&&mn(n,t,2)}function go(t){var n=t.alternate;return t===Ie||n!==null&&n===Ie}function ax(t,n){yl=oo=!0;var i=t.pending;i===null?n.next=n:(n.next=i.next,i.next=n),t.pending=n}function lx(t,n,i){if((i&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,i|=c,n.lanes=i,up(t,i)}}var Oi={readContext:$t,use:fo,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Oi.useEffectEvent=Ct;var ix={readContext:$t,use:fo,useCallback:function(t,n){return tn().memoizedState=[t,n===void 0?null:n],t},useContext:$t,useEffect:Fg,useImperativeHandle:function(t,n,i){i=i!=null?i.concat([t]):null,mo(4194308,4,Vg.bind(null,n,t),i)},useLayoutEffect:function(t,n){return mo(4194308,4,t,n)},useInsertionEffect:function(t,n){mo(4,2,t,n)},useMemo:function(t,n){var i=tn();n=n===void 0?null:n;var c=t();if(Da){sn(!0);try{t()}finally{sn(!1)}}return i.memoizedState=[c,n],c},useReducer:function(t,n,i){var c=tn();if(i!==void 0){var m=i(n);if(Da){sn(!0);try{i(n)}finally{sn(!1)}}}else m=n;return c.memoizedState=c.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},c.queue=t,t=t.dispatch=E2.bind(null,Ie,t),[c.memoizedState,t]},useRef:function(t){var n=tn();return t={current:t},n.memoizedState=t},useState:function(t){t=vd(t);var n=t.queue,i=rx.bind(null,Ie,n);return n.dispatch=i,[t.memoizedState,i]},useDebugValue:wd,useDeferredValue:function(t,n){var i=tn();return kd(i,t,n)},useTransition:function(){var t=vd(!1);return t=Jg.bind(null,Ie,t.queue,!0,!1),tn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,i){var c=Ie,m=tn();if(Ze){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),ft===null)throw Error(l(349));(Ke&127)!==0||Eg(c,n,i)}m.memoizedState=i;var x={value:i,getSnapshot:n};return m.queue=x,Fg(_g.bind(null,c,x,t),[t]),c.flags|=2048,bl(9,{destroy:void 0},Ag.bind(null,c,x,i,n),null),i},useId:function(){var t=tn(),n=ft.identifierPrefix;if(Ze){var i=er,c=Wn;i=(c&~(1<<32-dt(c)-1)).toString(32)+i,n="_"+n+"R_"+i,i=co++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=b2++,n="_"+n+"r_"+i.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Cd,useFormState:Ug,useActionState:Ug,useOptimistic:function(t){var n=tn();n.memoizedState=n.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Nd.bind(null,Ie,!0,i),i.dispatch=n,[t,n]},useMemoCache:gd,useCacheRefresh:function(){return tn().memoizedState=N2.bind(null,Ie)},useEffectEvent:function(t){var n=tn(),i={impl:t};return n.memoizedState=i,function(){if((rt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Ed={readContext:$t,use:fo,useCallback:Xg,useContext:$t,useEffect:Sd,useImperativeHandle:Kg,useInsertionEffect:$g,useLayoutEffect:Yg,useMemo:Qg,useReducer:ho,useRef:qg,useState:function(){return ho(wr)},useDebugValue:wd,useDeferredValue:function(t,n){var i=At();return Zg(i,ot.memoizedState,t,n)},useTransition:function(){var t=ho(wr)[0],n=At().memoizedState;return[typeof t=="boolean"?t:Ri(t),n]},useSyncExternalStore:Ng,useId:tx,useHostTransitionStatus:Cd,useFormState:Ig,useActionState:Ig,useOptimistic:function(t,n){var i=At();return Mg(i,ot,t,n)},useMemoCache:gd,useCacheRefresh:nx};Ed.useEffectEvent=Gg;var sx={readContext:$t,use:fo,useCallback:Xg,useContext:$t,useEffect:Sd,useImperativeHandle:Kg,useInsertionEffect:$g,useLayoutEffect:Yg,useMemo:Qg,useReducer:yd,useRef:qg,useState:function(){return yd(wr)},useDebugValue:wd,useDeferredValue:function(t,n){var i=At();return ot===null?kd(i,t,n):Zg(i,ot.memoizedState,t,n)},useTransition:function(){var t=yd(wr)[0],n=At().memoizedState;return[typeof t=="boolean"?t:Ri(t),n]},useSyncExternalStore:Ng,useId:tx,useHostTransitionStatus:Cd,useFormState:Hg,useActionState:Hg,useOptimistic:function(t,n){var i=At();return ot!==null?Mg(i,ot,t,n):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:gd,useCacheRefresh:nx};sx.useEffectEvent=Gg;function Ad(t,n,i,c){n=t.memoizedState,i=i(c,n),i=i==null?n:g({},n,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var _d={enqueueSetState:function(t,n,i){t=t._reactInternals;var c=jn(),m=$r(c);m.payload=n,i!=null&&(m.callback=i),n=Yr(t,m,c),n!==null&&(mn(n,t,c),Ei(n,t,c))},enqueueReplaceState:function(t,n,i){t=t._reactInternals;var c=jn(),m=$r(c);m.tag=1,m.payload=n,i!=null&&(m.callback=i),n=Yr(t,m,c),n!==null&&(mn(n,t,c),Ei(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var i=jn(),c=$r(i);c.tag=2,n!=null&&(c.callback=n),n=Yr(t,c,i),n!==null&&(mn(n,t,i),Ei(n,t,i))}};function ox(t,n,i,c,m,x,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,x,w):n.prototype&&n.prototype.isPureReactComponent?!vi(i,c)||!vi(m,x):!0}function cx(t,n,i,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,c),n.state!==t&&_d.enqueueReplaceState(n,n.state,null)}function za(t,n){var i=n;if("ref"in n){i={};for(var c in n)c!=="ref"&&(i[c]=n[c])}if(t=t.defaultProps){i===n&&(i=g({},i));for(var m in t)i[m]===void 0&&(i[m]=t[m])}return i}function ux(t){Vs(t)}function dx(t){console.error(t)}function fx(t){Vs(t)}function xo(t,n){try{var i=t.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function hx(t,n,i){try{var c=t.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Td(t,n,i){return i=$r(i),i.tag=3,i.payload={element:null},i.callback=function(){xo(t,n)},i}function mx(t){return t=$r(t),t.tag=3,t}function px(t,n,i,c){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var x=c.value;t.payload=function(){return m(x)},t.callback=function(){hx(n,i,c)}}var w=i.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){hx(n,i,c),typeof m!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var E=c.stack;this.componentDidCatch(c.value,{componentStack:E!==null?E:""})})}function A2(t,n,i,c,m){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=i.alternate,n!==null&&fl(n,i,m,!0),i=bn.current,i!==null){switch(i.tag){case 31:case 13:return Ln===null?_o():i.alternate===null&&Nt===0&&(Nt=3),i.flags&=-257,i.flags|=65536,i.lanes=m,c===ro?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([c]):n.add(c),tf(t,c,m)),!1;case 22:return i.flags|=65536,c===ro?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([c]):i.add(c)),tf(t,c,m)),!1}throw Error(l(435,i.tag))}return tf(t,c,m),_o(),!1}if(Ze)return n=bn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,c!==Xu&&(t=Error(l(422),{cause:c}),wi(Mn(t,i)))):(c!==Xu&&(n=Error(l(423),{cause:c}),wi(Mn(n,i))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,c=Mn(c,i),m=Td(t.stateNode,c,m),id(t,m),Nt!==4&&(Nt=2)),!1;var x=Error(l(520),{cause:c});if(x=Mn(x,i),Hi===null?Hi=[x]:Hi.push(x),Nt!==4&&(Nt=2),n===null)return!0;c=Mn(c,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,t=m&-m,i.lanes|=t,t=Td(i.stateNode,c,t),id(i,t),!1;case 1:if(n=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Jr===null||!Jr.has(x))))return i.flags|=65536,m&=-m,i.lanes|=m,m=mx(m),px(m,t,i,c),id(i,m),!1}i=i.return}while(i!==null);return!1}var Rd=Error(l(461)),Rt=!1;function Yt(t,n,i,c){n.child=t===null?vg(n,null,i,c):Oa(n,t.child,i,c)}function gx(t,n,i,c,m){i=i.render;var x=n.ref;if("ref"in c){var w={};for(var E in c)E!=="ref"&&(w[E]=c[E])}else w=c;return _a(n),c=fd(t,n,i,w,x,m),E=hd(),t!==null&&!Rt?(md(t,n,m),kr(t,n,m)):(Ze&&E&&Vu(n),n.flags|=1,Yt(t,n,c,m),n.child)}function xx(t,n,i,c,m){if(t===null){var x=i.type;return typeof x=="function"&&!Gu(x)&&x.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=x,yx(t,n,x,c,m)):(t=Zs(i.type,null,c,n,n.mode,m),t.ref=n.ref,t.return=n,n.child=t)}if(x=t.child,!Id(t,m)){var w=x.memoizedProps;if(i=i.compare,i=i!==null?i:vi,i(w,c)&&t.ref===n.ref)return kr(t,n,m)}return n.flags|=1,t=xr(x,c),t.ref=n.ref,t.return=n,n.child=t}function yx(t,n,i,c,m){if(t!==null){var x=t.memoizedProps;if(vi(x,c)&&t.ref===n.ref)if(Rt=!1,n.pendingProps=c=x,Id(t,m))(t.flags&131072)!==0&&(Rt=!0);else return n.lanes=t.lanes,kr(t,n,m)}return Md(t,n,i,c,m)}function vx(t,n,i,c){var m=c.children,x=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,t!==null){for(c=n.child=t.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~x}else c=0,n.child=null;return bx(t,n,x,i,c)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&to(n,x!==null?x.cachePool:null),x!==null?wg(n,x):od(),kg(n);else return c=n.lanes=536870912,bx(t,n,x!==null?x.baseLanes|i:i,i,c)}else x!==null?(to(n,x.cachePool),wg(n,x),Kr(),n.memoizedState=null):(t!==null&&to(n,null),od(),Kr());return Yt(t,n,m,i),n.child}function Di(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function bx(t,n,i,c,m){var x=nd();return x=x===null?null:{parent:_t._currentValue,pool:x},n.memoizedState={baseLanes:i,cachePool:x},t!==null&&to(n,null),od(),kg(n),t!==null&&fl(t,n,c,!0),n.childLanes=m,null}function yo(t,n){return n=bo({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Sx(t,n,i){return Oa(n,t.child,null,i),t=yo(n,n.pendingProps),t.flags|=2,Sn(n),n.memoizedState=null,t}function _2(t,n,i){var c=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ze){if(c.mode==="hidden")return t=yo(n,c),n.lanes=536870912,Di(null,t);if(ud(n),(t=pt)?(t=Oy(t,zn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Br!==null?{id:Wn,overflow:er}:null,retryLane:536870912,hydrationErrors:null},i=ag(t),i.return=n,n.child=i,Gt=n,pt=null)):t=null,t===null)throw qr(n);return n.lanes=536870912,null}return yo(n,c)}var x=t.memoizedState;if(x!==null){var w=x.dehydrated;if(ud(n),m)if(n.flags&256)n.flags&=-257,n=Sx(t,n,i);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(l(558));else if(Rt||fl(t,n,i,!1),m=(i&t.childLanes)!==0,Rt||m){if(c=ft,c!==null&&(w=dp(c,i),w!==0&&w!==x.retryLane))throw x.retryLane=w,Ca(t,w),mn(c,t,w),Rd;_o(),n=Sx(t,n,i)}else t=x.treeContext,pt=Pn(w.nextSibling),Gt=n,Ze=!0,Hr=null,zn=!1,t!==null&&sg(n,t),n=yo(n,c),n.flags|=4096;return n}return t=xr(t.child,{mode:c.mode,children:c.children}),t.ref=n.ref,n.child=t,t.return=n,t}function vo(t,n){var i=n.ref;if(i===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(t===null||t.ref!==i)&&(n.flags|=4194816)}}function Md(t,n,i,c,m){return _a(n),i=fd(t,n,i,c,void 0,m),c=hd(),t!==null&&!Rt?(md(t,n,m),kr(t,n,m)):(Ze&&c&&Vu(n),n.flags|=1,Yt(t,n,i,m),n.child)}function wx(t,n,i,c,m,x){return _a(n),n.updateQueue=null,i=Cg(n,c,i,m),jg(t),c=hd(),t!==null&&!Rt?(md(t,n,x),kr(t,n,x)):(Ze&&c&&Vu(n),n.flags|=1,Yt(t,n,i,x),n.child)}function kx(t,n,i,c,m){if(_a(n),n.stateNode===null){var x=ol,w=i.contextType;typeof w=="object"&&w!==null&&(x=$t(w)),x=new i(c,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=_d,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=c,x.state=n.memoizedState,x.refs={},ad(n),w=i.contextType,x.context=typeof w=="object"&&w!==null?$t(w):ol,x.state=n.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(Ad(n,i,w,c),x.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&_d.enqueueReplaceState(x,x.state,null),_i(n,c,x,m),Ai(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){x=n.stateNode;var E=n.memoizedProps,U=za(i,E);x.props=U;var Q=x.context,re=i.contextType;w=ol,typeof re=="object"&&re!==null&&(w=$t(re));var ie=i.getDerivedStateFromProps;re=typeof ie=="function"||typeof x.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,re||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E||Q!==w)&&cx(n,x,c,w),Gr=!1;var Z=n.memoizedState;x.state=Z,_i(n,c,x,m),Ai(),Q=n.memoizedState,E||Z!==Q||Gr?(typeof ie=="function"&&(Ad(n,i,ie,c),Q=n.memoizedState),(U=Gr||ox(n,i,U,c,Z,Q,w))?(re||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=Q),x.props=c,x.state=Q,x.context=w,c=U):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{x=n.stateNode,ld(t,n),w=n.memoizedProps,re=za(i,w),x.props=re,ie=n.pendingProps,Z=x.context,Q=i.contextType,U=ol,typeof Q=="object"&&Q!==null&&(U=$t(Q)),E=i.getDerivedStateFromProps,(Q=typeof E=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==ie||Z!==U)&&cx(n,x,c,U),Gr=!1,Z=n.memoizedState,x.state=Z,_i(n,c,x,m),Ai();var ne=n.memoizedState;w!==ie||Z!==ne||Gr||t!==null&&t.dependencies!==null&&Ws(t.dependencies)?(typeof E=="function"&&(Ad(n,i,E,c),ne=n.memoizedState),(re=Gr||ox(n,i,re,c,Z,ne,U)||t!==null&&t.dependencies!==null&&Ws(t.dependencies))?(Q||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,ne,U),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,ne,U)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===t.memoizedProps&&Z===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&Z===t.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ne),x.props=c,x.state=ne,x.context=U,c=re):(typeof x.componentDidUpdate!="function"||w===t.memoizedProps&&Z===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&Z===t.memoizedState||(n.flags|=1024),c=!1)}return x=c,vo(t,n),c=(n.flags&128)!==0,x||c?(x=n.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,t!==null&&c?(n.child=Oa(n,t.child,null,m),n.child=Oa(n,null,i,m)):Yt(t,n,i,m),n.memoizedState=x.state,t=n.child):t=kr(t,n,m),t}function jx(t,n,i,c){return Ea(),n.flags|=256,Yt(t,n,i,c),n.child}var Od={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dd(t){return{baseLanes:t,cachePool:hg()}}function zd(t,n,i){return t=t!==null?t.childLanes&~i:0,n&&(t|=kn),t}function Cx(t,n,i){var c=n.pendingProps,m=!1,x=(n.flags&128)!==0,w;if((w=x)||(w=t!==null&&t.memoizedState===null?!1:(Et.current&2)!==0),w&&(m=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ze){if(m?Vr(n):Kr(),(t=pt)?(t=Oy(t,zn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Br!==null?{id:Wn,overflow:er}:null,retryLane:536870912,hydrationErrors:null},i=ag(t),i.return=n,n.child=i,Gt=n,pt=null)):t=null,t===null)throw qr(n);return yf(t)?n.lanes=32:n.lanes=536870912,null}var E=c.children;return c=c.fallback,m?(Kr(),m=n.mode,E=bo({mode:"hidden",children:E},m),c=Na(c,m,i,null),E.return=n,c.return=n,E.sibling=c,n.child=E,c=n.child,c.memoizedState=Dd(i),c.childLanes=zd(t,w,i),n.memoizedState=Od,Di(null,c)):(Vr(n),Ld(n,E))}var U=t.memoizedState;if(U!==null&&(E=U.dehydrated,E!==null)){if(x)n.flags&256?(Vr(n),n.flags&=-257,n=Pd(t,n,i)):n.memoizedState!==null?(Kr(),n.child=t.child,n.flags|=128,n=null):(Kr(),E=c.fallback,m=n.mode,c=bo({mode:"visible",children:c.children},m),E=Na(E,m,i,null),E.flags|=2,c.return=n,E.return=n,c.sibling=E,n.child=c,Oa(n,t.child,null,i),c=n.child,c.memoizedState=Dd(i),c.childLanes=zd(t,w,i),n.memoizedState=Od,n=Di(null,c));else if(Vr(n),yf(E)){if(w=E.nextSibling&&E.nextSibling.dataset,w)var Q=w.dgst;w=Q,c=Error(l(419)),c.stack="",c.digest=w,wi({value:c,source:null,stack:null}),n=Pd(t,n,i)}else if(Rt||fl(t,n,i,!1),w=(i&t.childLanes)!==0,Rt||w){if(w=ft,w!==null&&(c=dp(w,i),c!==0&&c!==U.retryLane))throw U.retryLane=c,Ca(t,c),mn(w,t,c),Rd;xf(E)||_o(),n=Pd(t,n,i)}else xf(E)?(n.flags|=192,n.child=t.child,n=null):(t=U.treeContext,pt=Pn(E.nextSibling),Gt=n,Ze=!0,Hr=null,zn=!1,t!==null&&sg(n,t),n=Ld(n,c.children),n.flags|=4096);return n}return m?(Kr(),E=c.fallback,m=n.mode,U=t.child,Q=U.sibling,c=xr(U,{mode:"hidden",children:c.children}),c.subtreeFlags=U.subtreeFlags&65011712,Q!==null?E=xr(Q,E):(E=Na(E,m,i,null),E.flags|=2),E.return=n,c.return=n,c.sibling=E,n.child=c,Di(null,c),c=n.child,E=t.child.memoizedState,E===null?E=Dd(i):(m=E.cachePool,m!==null?(U=_t._currentValue,m=m.parent!==U?{parent:U,pool:U}:m):m=hg(),E={baseLanes:E.baseLanes|i,cachePool:m}),c.memoizedState=E,c.childLanes=zd(t,w,i),n.memoizedState=Od,Di(t.child,c)):(Vr(n),i=t.child,t=i.sibling,i=xr(i,{mode:"visible",children:c.children}),i.return=n,i.sibling=null,t!==null&&(w=n.deletions,w===null?(n.deletions=[t],n.flags|=16):w.push(t)),n.child=i,n.memoizedState=null,i)}function Ld(t,n){return n=bo({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function bo(t,n){return t=vn(22,t,null,n),t.lanes=0,t}function Pd(t,n,i){return Oa(n,t.child,null,i),t=Ld(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Nx(t,n,i){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),Ju(t.return,n,i)}function Ud(t,n,i,c,m,x){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:m,treeForkCount:x}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=i,w.tailMode=m,w.treeForkCount=x)}function Ex(t,n,i){var c=n.pendingProps,m=c.revealOrder,x=c.tail;c=c.children;var w=Et.current,E=(w&2)!==0;if(E?(w=w&1|2,n.flags|=128):w&=1,T(Et,w),Yt(t,n,c,i),c=Ze?Si:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Nx(t,i,n);else if(t.tag===19)Nx(t,i,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(m){case"forwards":for(i=n.child,m=null;i!==null;)t=i.alternate,t!==null&&so(t)===null&&(m=i),i=i.sibling;i=m,i===null?(m=n.child,n.child=null):(m=i.sibling,i.sibling=null),Ud(n,!1,m,i,x,c);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=n.child,n.child=null;m!==null;){if(t=m.alternate,t!==null&&so(t)===null){n.child=m;break}t=m.sibling,m.sibling=i,i=m,m=t}Ud(n,!0,i,null,x,c);break;case"together":Ud(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function kr(t,n,i){if(t!==null&&(n.dependencies=t.dependencies),Zr|=n.lanes,(i&n.childLanes)===0)if(t!==null){if(fl(t,n,i,!1),(i&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(l(153));if(n.child!==null){for(t=n.child,i=xr(t,t.pendingProps),n.child=i,i.return=n;t.sibling!==null;)t=t.sibling,i=i.sibling=xr(t,t.pendingProps),i.return=n;i.sibling=null}return n.child}function Id(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Ws(t)))}function T2(t,n,i){switch(n.tag){case 3:ze(n,n.stateNode.containerInfo),Fr(n,_t,t.memoizedState.cache),Ea();break;case 27:case 5:pe(n);break;case 4:ze(n,n.stateNode.containerInfo);break;case 10:Fr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,ud(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(Vr(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Cx(t,n,i):(Vr(n),t=kr(t,n,i),t!==null?t.sibling:null);Vr(n);break;case 19:var m=(t.flags&128)!==0;if(c=(i&n.childLanes)!==0,c||(fl(t,n,i,!1),c=(i&n.childLanes)!==0),m){if(c)return Ex(t,n,i);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),T(Et,Et.current),c)break;return null;case 22:return n.lanes=0,vx(t,n,i,n.pendingProps);case 24:Fr(n,_t,t.memoizedState.cache)}return kr(t,n,i)}function Ax(t,n,i){if(t!==null)if(t.memoizedProps!==n.pendingProps)Rt=!0;else{if(!Id(t,i)&&(n.flags&128)===0)return Rt=!1,T2(t,n,i);Rt=(t.flags&131072)!==0}else Rt=!1,Ze&&(n.flags&1048576)!==0&&ig(n,Si,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(t=Ra(n.elementType),n.type=t,typeof t=="function")Gu(t)?(c=za(t,c),n.tag=1,n=kx(null,n,t,c,i)):(n.tag=0,n=Md(null,n,t,c,i));else{if(t!=null){var m=t.$$typeof;if(m===O){n.tag=11,n=gx(null,n,t,c,i);break e}else if(m===I){n.tag=14,n=xx(null,n,t,c,i);break e}}throw n=ae(t)||t,Error(l(306,n,""))}}return n;case 0:return Md(t,n,n.type,n.pendingProps,i);case 1:return c=n.type,m=za(c,n.pendingProps),kx(t,n,c,m,i);case 3:e:{if(ze(n,n.stateNode.containerInfo),t===null)throw Error(l(387));c=n.pendingProps;var x=n.memoizedState;m=x.element,ld(t,n),_i(n,c,null,i);var w=n.memoizedState;if(c=w.cache,Fr(n,_t,c),c!==x.cache&&Wu(n,[_t],i,!0),Ai(),c=w.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=jx(t,n,c,i);break e}else if(c!==m){m=Mn(Error(l(424)),n),wi(m),n=jx(t,n,c,i);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,pt=Pn(t.firstChild),Gt=n,Ze=!0,Hr=null,zn=!0,i=vg(n,null,c,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ea(),c===m){n=kr(t,n,i);break e}Yt(t,n,c,i)}n=n.child}return n;case 26:return vo(t,n),t===null?(i=Iy(n.type,null,n.pendingProps,null))?n.memoizedState=i:Ze||(i=n.type,t=n.pendingProps,c=Lo(fe.current).createElement(i),c[Ft]=n,c[on]=t,Vt(c,i,t),It(c),n.stateNode=c):n.memoizedState=Iy(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return pe(n),t===null&&Ze&&(c=n.stateNode=Ly(n.type,n.pendingProps,fe.current),Gt=n,zn=!0,m=pt,na(n.type)?(vf=m,pt=Pn(c.firstChild)):pt=m),Yt(t,n,n.pendingProps.children,i),vo(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ze&&((m=c=pt)&&(c=iC(c,n.type,n.pendingProps,zn),c!==null?(n.stateNode=c,Gt=n,pt=Pn(c.firstChild),zn=!1,m=!0):m=!1),m||qr(n)),pe(n),m=n.type,x=n.pendingProps,w=t!==null?t.memoizedProps:null,c=x.children,mf(m,x)?c=null:w!==null&&mf(m,w)&&(n.flags|=32),n.memoizedState!==null&&(m=fd(t,n,S2,null,null,i),Xi._currentValue=m),vo(t,n),Yt(t,n,c,i),n.child;case 6:return t===null&&Ze&&((t=i=pt)&&(i=sC(i,n.pendingProps,zn),i!==null?(n.stateNode=i,Gt=n,pt=null,t=!0):t=!1),t||qr(n)),null;case 13:return Cx(t,n,i);case 4:return ze(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=Oa(n,null,c,i):Yt(t,n,c,i),n.child;case 11:return gx(t,n,n.type,n.pendingProps,i);case 7:return Yt(t,n,n.pendingProps,i),n.child;case 8:return Yt(t,n,n.pendingProps.children,i),n.child;case 12:return Yt(t,n,n.pendingProps.children,i),n.child;case 10:return c=n.pendingProps,Fr(n,n.type,c.value),Yt(t,n,c.children,i),n.child;case 9:return m=n.type._context,c=n.pendingProps.children,_a(n),m=$t(m),c=c(m),n.flags|=1,Yt(t,n,c,i),n.child;case 14:return xx(t,n,n.type,n.pendingProps,i);case 15:return yx(t,n,n.type,n.pendingProps,i);case 19:return Ex(t,n,i);case 31:return _2(t,n,i);case 22:return vx(t,n,i,n.pendingProps);case 24:return _a(n),c=$t(_t),t===null?(m=nd(),m===null&&(m=ft,x=ed(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=i),m=x),n.memoizedState={parent:c,cache:m},ad(n),Fr(n,_t,m)):((t.lanes&i)!==0&&(ld(t,n),_i(n,null,null,i),Ai()),m=t.memoizedState,x=n.memoizedState,m.parent!==c?(m={parent:c,cache:c},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),Fr(n,_t,c)):(c=x.cache,Fr(n,_t,c),c!==m.cache&&Wu(n,[_t],i,!0))),Yt(t,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function jr(t){t.flags|=4}function Bd(t,n,i,c,m){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(ty())t.flags|=8192;else throw Ma=ro,rd}else t.flags&=-16777217}function _x(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Gy(n))if(ty())t.flags|=8192;else throw Ma=ro,rd}function So(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?op():536870912,t.lanes|=n,jl|=n)}function zi(t,n){if(!Ze)switch(t.tailMode){case"hidden":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function gt(t){var n=t.alternate!==null&&t.alternate.child===t.child,i=0,c=0;if(n)for(var m=t.child;m!==null;)i|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)i|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=c,t.childLanes=i,n}function R2(t,n,i){var c=n.pendingProps;switch(Ku(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(n),null;case 1:return gt(n),null;case 3:return i=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),br(_t),Ee(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(dl(n)?jr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Qu())),gt(n),null;case 26:var m=n.type,x=n.memoizedState;return t===null?(jr(n),x!==null?(gt(n),_x(n,x)):(gt(n),Bd(n,m,null,c,i))):x?x!==t.memoizedState?(jr(n),gt(n),_x(n,x)):(gt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==c&&jr(n),gt(n),Bd(n,m,t,c,i)),null;case 27:if(Oe(n),i=fe.current,m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&jr(n);else{if(!c){if(n.stateNode===null)throw Error(l(166));return gt(n),null}t=oe.current,dl(n)?og(n):(t=Ly(m,c,i),n.stateNode=t,jr(n))}return gt(n),null;case 5:if(Oe(n),m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&jr(n);else{if(!c){if(n.stateNode===null)throw Error(l(166));return gt(n),null}if(x=oe.current,dl(n))og(n);else{var w=Lo(fe.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?w.createElement(m,{is:c.is}):w.createElement(m)}}x[Ft]=n,x[on]=c;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)x.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=x;e:switch(Vt(x,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&jr(n)}}return gt(n),Bd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,i),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&jr(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(l(166));if(t=fe.current,dl(n)){if(t=n.stateNode,i=n.memoizedProps,c=null,m=Gt,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}t[Ft]=n,t=!!(t.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||Cy(t.nodeValue,i)),t||qr(n,!0)}else t=Lo(t).createTextNode(c),t[Ft]=n,n.stateNode=t}return gt(n),null;case 31:if(i=n.memoizedState,t===null||t.memoizedState!==null){if(c=dl(n),i!==null){if(t===null){if(!c)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Ft]=n}else Ea(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),t=!1}else i=Qu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return n.flags&256?(Sn(n),n):(Sn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return gt(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=dl(n),c!==null&&c.dehydrated!==null){if(t===null){if(!m)throw Error(l(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[Ft]=n}else Ea(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),m=!1}else m=Qu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(Sn(n),n):(Sn(n),null)}return Sn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=c!==null,t=t!==null&&t.memoizedState!==null,i&&(c=n.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==m&&(c.flags|=2048)),i!==t&&i&&(n.child.flags|=8192),So(n,n.updateQueue),gt(n),null);case 4:return Ee(),t===null&&cf(n.stateNode.containerInfo),gt(n),null;case 10:return br(n.type),gt(n),null;case 19:if(G(Et),c=n.memoizedState,c===null)return gt(n),null;if(m=(n.flags&128)!==0,x=c.rendering,x===null)if(m)zi(c,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(x=so(t),x!==null){for(n.flags|=128,zi(c,!1),t=x.updateQueue,n.updateQueue=t,So(n,t),n.subtreeFlags=0,t=i,i=n.child;i!==null;)rg(i,t),i=i.sibling;return T(Et,Et.current&1|2),Ze&&yr(n,c.treeForkCount),n.child}t=t.sibling}c.tail!==null&&qe()>No&&(n.flags|=128,m=!0,zi(c,!1),n.lanes=4194304)}else{if(!m)if(t=so(x),t!==null){if(n.flags|=128,m=!0,t=t.updateQueue,n.updateQueue=t,So(n,t),zi(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Ze)return gt(n),null}else 2*qe()-c.renderingStartTime>No&&i!==536870912&&(n.flags|=128,m=!0,zi(c,!1),n.lanes=4194304);c.isBackwards?(x.sibling=n.child,n.child=x):(t=c.last,t!==null?t.sibling=x:n.child=x,c.last=x)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=qe(),t.sibling=null,i=Et.current,T(Et,m?i&1|2:i&1),Ze&&yr(n,c.treeForkCount),t):(gt(n),null);case 22:case 23:return Sn(n),cd(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(i&536870912)!==0&&(n.flags&128)===0&&(gt(n),n.subtreeFlags&6&&(n.flags|=8192)):gt(n),i=n.updateQueue,i!==null&&So(n,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==i&&(n.flags|=2048),t!==null&&G(Ta),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),br(_t),gt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function M2(t,n){switch(Ku(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return br(_t),Ee(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Oe(n),null;case 31:if(n.memoizedState!==null){if(Sn(n),n.alternate===null)throw Error(l(340));Ea()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Sn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Ea()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return G(Et),null;case 4:return Ee(),null;case 10:return br(n.type),null;case 22:case 23:return Sn(n),cd(),t!==null&&G(Ta),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return br(_t),null;case 25:return null;default:return null}}function Tx(t,n){switch(Ku(n),n.tag){case 3:br(_t),Ee();break;case 26:case 27:case 5:Oe(n);break;case 4:Ee();break;case 31:n.memoizedState!==null&&Sn(n);break;case 13:Sn(n);break;case 19:G(Et);break;case 10:br(n.type);break;case 22:case 23:Sn(n),cd(),t!==null&&G(Ta);break;case 24:br(_t)}}function Li(t,n){try{var i=n.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var m=c.next;i=m;do{if((i.tag&t)===t){c=void 0;var x=i.create,w=i.inst;c=x(),w.destroy=c}i=i.next}while(i!==m)}}catch(E){lt(n,n.return,E)}}function Xr(t,n,i){try{var c=n.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var x=m.next;c=x;do{if((c.tag&t)===t){var w=c.inst,E=w.destroy;if(E!==void 0){w.destroy=void 0,m=n;var U=i,Q=E;try{Q()}catch(re){lt(m,U,re)}}}c=c.next}while(c!==x)}}catch(re){lt(n,n.return,re)}}function Rx(t){var n=t.updateQueue;if(n!==null){var i=t.stateNode;try{Sg(n,i)}catch(c){lt(t,t.return,c)}}}function Mx(t,n,i){i.props=za(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(c){lt(t,n,c)}}function Pi(t,n){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof i=="function"?t.refCleanup=i(c):i.current=c}}catch(m){lt(t,n,m)}}function tr(t,n){var i=t.ref,c=t.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(m){lt(t,n,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(m){lt(t,n,m)}else i.current=null}function Ox(t){var n=t.type,i=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(m){lt(t,t.return,m)}}function Hd(t,n,i){try{var c=t.stateNode;eC(c,t.type,i,n),c[on]=n}catch(m){lt(t,t.return,m)}}function Dx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&na(t.type)||t.tag===4}function qd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Dx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&na(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Fd(t,n,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(t),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=pr));else if(c!==4&&(c===27&&na(t.type)&&(i=t.stateNode,n=null),t=t.child,t!==null))for(Fd(t,n,i),t=t.sibling;t!==null;)Fd(t,n,i),t=t.sibling}function wo(t,n,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?i.insertBefore(t,n):i.appendChild(t);else if(c!==4&&(c===27&&na(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(wo(t,n,i),t=t.sibling;t!==null;)wo(t,n,i),t=t.sibling}function zx(t){var n=t.stateNode,i=t.memoizedProps;try{for(var c=t.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);Vt(n,c,i),n[Ft]=t,n[on]=i}catch(x){lt(t,t.return,x)}}var Cr=!1,Mt=!1,Gd=!1,Lx=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function O2(t,n){if(t=t.containerInfo,ff=Fo,t=Kp(t),Pu(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var m=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var w=0,E=-1,U=-1,Q=0,re=0,ie=t,Z=null;t:for(;;){for(var ne;ie!==i||m!==0&&ie.nodeType!==3||(E=w+m),ie!==x||c!==0&&ie.nodeType!==3||(U=w+c),ie.nodeType===3&&(w+=ie.nodeValue.length),(ne=ie.firstChild)!==null;)Z=ie,ie=ne;for(;;){if(ie===t)break t;if(Z===i&&++Q===m&&(E=w),Z===x&&++re===c&&(U=w),(ne=ie.nextSibling)!==null)break;ie=Z,Z=ie.parentNode}ie=ne}i=E===-1||U===-1?null:{start:E,end:U}}else i=null}i=i||{start:0,end:0}}else i=null;for(hf={focusedElem:t,selectionRange:i},Fo=!1,Bt=n;Bt!==null;)if(n=Bt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Bt=t;else for(;Bt!==null;){switch(n=Bt,x=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)m=t[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,i=n,m=x.memoizedProps,x=x.memoizedState,c=i.stateNode;try{var ye=za(i.type,m);t=c.getSnapshotBeforeUpdate(ye,x),c.__reactInternalSnapshotBeforeUpdate=t}catch(Me){lt(i,i.return,Me)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,i=t.nodeType,i===9)gf(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":gf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=n.sibling,t!==null){t.return=n.return,Bt=t;break}Bt=n.return}}function Px(t,n,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:Er(t,i),c&4&&Li(5,i);break;case 1:if(Er(t,i),c&4)if(t=i.stateNode,n===null)try{t.componentDidMount()}catch(w){lt(i,i.return,w)}else{var m=za(i.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(m,n,t.__reactInternalSnapshotBeforeUpdate)}catch(w){lt(i,i.return,w)}}c&64&&Rx(i),c&512&&Pi(i,i.return);break;case 3:if(Er(t,i),c&64&&(t=i.updateQueue,t!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{Sg(t,n)}catch(w){lt(i,i.return,w)}}break;case 27:n===null&&c&4&&zx(i);case 26:case 5:Er(t,i),n===null&&c&4&&Ox(i),c&512&&Pi(i,i.return);break;case 12:Er(t,i);break;case 31:Er(t,i),c&4&&Bx(t,i);break;case 13:Er(t,i),c&4&&Hx(t,i),c&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=q2.bind(null,i),oC(t,i))));break;case 22:if(c=i.memoizedState!==null||Cr,!c){n=n!==null&&n.memoizedState!==null||Mt,m=Cr;var x=Mt;Cr=c,(Mt=n)&&!x?Ar(t,i,(i.subtreeFlags&8772)!==0):Er(t,i),Cr=m,Mt=x}break;case 30:break;default:Er(t,i)}}function Ux(t){var n=t.alternate;n!==null&&(t.alternate=null,Ux(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&bu(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var St=null,un=!1;function Nr(t,n,i){for(i=i.child;i!==null;)Ix(t,n,i),i=i.sibling}function Ix(t,n,i){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(en,i)}catch{}switch(i.tag){case 26:Mt||tr(i,n),Nr(t,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Mt||tr(i,n);var c=St,m=un;na(i.type)&&(St=i.stateNode,un=!1),Nr(t,n,i),Yi(i.stateNode),St=c,un=m;break;case 5:Mt||tr(i,n);case 6:if(c=St,m=un,St=null,Nr(t,n,i),St=c,un=m,St!==null)if(un)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(i.stateNode)}catch(x){lt(i,n,x)}else try{St.removeChild(i.stateNode)}catch(x){lt(i,n,x)}break;case 18:St!==null&&(un?(t=St,Ry(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),Ml(t)):Ry(St,i.stateNode));break;case 4:c=St,m=un,St=i.stateNode.containerInfo,un=!0,Nr(t,n,i),St=c,un=m;break;case 0:case 11:case 14:case 15:Xr(2,i,n),Mt||Xr(4,i,n),Nr(t,n,i);break;case 1:Mt||(tr(i,n),c=i.stateNode,typeof c.componentWillUnmount=="function"&&Mx(i,n,c)),Nr(t,n,i);break;case 21:Nr(t,n,i);break;case 22:Mt=(c=Mt)||i.memoizedState!==null,Nr(t,n,i),Mt=c;break;default:Nr(t,n,i)}}function Bx(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ml(t)}catch(i){lt(n,n.return,i)}}}function Hx(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ml(t)}catch(i){lt(n,n.return,i)}}function D2(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Lx),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Lx),n;default:throw Error(l(435,t.tag))}}function ko(t,n){var i=D2(t);n.forEach(function(c){if(!i.has(c)){i.add(c);var m=F2.bind(null,t,c);c.then(m,m)}})}function dn(t,n){var i=n.deletions;if(i!==null)for(var c=0;c<i.length;c++){var m=i[c],x=t,w=n,E=w;e:for(;E!==null;){switch(E.tag){case 27:if(na(E.type)){St=E.stateNode,un=!1;break e}break;case 5:St=E.stateNode,un=!1;break e;case 3:case 4:St=E.stateNode.containerInfo,un=!0;break e}E=E.return}if(St===null)throw Error(l(160));Ix(x,w,m),St=null,un=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)qx(n,t),n=n.sibling}var Yn=null;function qx(t,n){var i=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:dn(n,t),fn(t),c&4&&(Xr(3,t,t.return),Li(3,t),Xr(5,t,t.return));break;case 1:dn(n,t),fn(t),c&512&&(Mt||i===null||tr(i,i.return)),c&64&&Cr&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var m=Yn;if(dn(n,t),fn(t),c&512&&(Mt||i===null||tr(i,i.return)),c&4){var x=i!==null?i.memoizedState:null;if(c=t.memoizedState,i===null)if(c===null)if(t.stateNode===null){e:{c=t.type,i=t.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":x=m.getElementsByTagName("title")[0],(!x||x[ui]||x[Ft]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(c),m.head.insertBefore(x,m.querySelector("head > title"))),Vt(x,c,i),x[Ft]=t,It(x),c=x;break e;case"link":var w=qy("link","href",m).get(c+(i.href||""));if(w){for(var E=0;E<w.length;E++)if(x=w[E],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(E,1);break t}}x=m.createElement(c),Vt(x,c,i),m.head.appendChild(x);break;case"meta":if(w=qy("meta","content",m).get(c+(i.content||""))){for(E=0;E<w.length;E++)if(x=w[E],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(E,1);break t}}x=m.createElement(c),Vt(x,c,i),m.head.appendChild(x);break;default:throw Error(l(468,c))}x[Ft]=t,It(x),c=x}t.stateNode=c}else Fy(m,t.type,t.stateNode);else t.stateNode=Hy(m,c,t.memoizedProps);else x!==c?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,c===null?Fy(m,t.type,t.stateNode):Hy(m,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Hd(t,t.memoizedProps,i.memoizedProps)}break;case 27:dn(n,t),fn(t),c&512&&(Mt||i===null||tr(i,i.return)),i!==null&&c&4&&Hd(t,t.memoizedProps,i.memoizedProps);break;case 5:if(dn(n,t),fn(t),c&512&&(Mt||i===null||tr(i,i.return)),t.flags&32){m=t.stateNode;try{tl(m,"")}catch(ye){lt(t,t.return,ye)}}c&4&&t.stateNode!=null&&(m=t.memoizedProps,Hd(t,m,i!==null?i.memoizedProps:m)),c&1024&&(Gd=!0);break;case 6:if(dn(n,t),fn(t),c&4){if(t.stateNode===null)throw Error(l(162));c=t.memoizedProps,i=t.stateNode;try{i.nodeValue=c}catch(ye){lt(t,t.return,ye)}}break;case 3:if(Io=null,m=Yn,Yn=Po(n.containerInfo),dn(n,t),Yn=m,fn(t),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Ml(n.containerInfo)}catch(ye){lt(t,t.return,ye)}Gd&&(Gd=!1,Fx(t));break;case 4:c=Yn,Yn=Po(t.stateNode.containerInfo),dn(n,t),fn(t),Yn=c;break;case 12:dn(n,t),fn(t);break;case 31:dn(n,t),fn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,ko(t,c)));break;case 13:dn(n,t),fn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Co=qe()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,ko(t,c)));break;case 22:m=t.memoizedState!==null;var U=i!==null&&i.memoizedState!==null,Q=Cr,re=Mt;if(Cr=Q||m,Mt=re||U,dn(n,t),Mt=re,Cr=Q,fn(t),c&8192)e:for(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(i===null||U||Cr||Mt||La(t)),i=null,n=t;;){if(n.tag===5||n.tag===26){if(i===null){U=i=n;try{if(x=U.stateNode,m)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{E=U.stateNode;var ie=U.memoizedProps.style,Z=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;E.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ye){lt(U,U.return,ye)}}}else if(n.tag===6){if(i===null){U=n;try{U.stateNode.nodeValue=m?"":U.memoizedProps}catch(ye){lt(U,U.return,ye)}}}else if(n.tag===18){if(i===null){U=n;try{var ne=U.stateNode;m?My(ne,!0):My(U.stateNode,!1)}catch(ye){lt(U,U.return,ye)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=t.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,ko(t,i))));break;case 19:dn(n,t),fn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,ko(t,c)));break;case 30:break;case 21:break;default:dn(n,t),fn(t)}}function fn(t){var n=t.flags;if(n&2){try{for(var i,c=t.return;c!==null;){if(Dx(c)){i=c;break}c=c.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var m=i.stateNode,x=qd(t);wo(t,x,m);break;case 5:var w=i.stateNode;i.flags&32&&(tl(w,""),i.flags&=-33);var E=qd(t);wo(t,E,w);break;case 3:case 4:var U=i.stateNode.containerInfo,Q=qd(t);Fd(t,Q,U);break;default:throw Error(l(161))}}catch(re){lt(t,t.return,re)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Fx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Fx(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Er(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Px(t,n.alternate,n),n=n.sibling}function La(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Xr(4,n,n.return),La(n);break;case 1:tr(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Mx(n,n.return,i),La(n);break;case 27:Yi(n.stateNode);case 26:case 5:tr(n,n.return),La(n);break;case 22:n.memoizedState===null&&La(n);break;case 30:La(n);break;default:La(n)}t=t.sibling}}function Ar(t,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,m=t,x=n,w=x.flags;switch(x.tag){case 0:case 11:case 15:Ar(m,x,i),Li(4,x);break;case 1:if(Ar(m,x,i),c=x,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(Q){lt(c,c.return,Q)}if(c=x,m=c.updateQueue,m!==null){var E=c.stateNode;try{var U=m.shared.hiddenCallbacks;if(U!==null)for(m.shared.hiddenCallbacks=null,m=0;m<U.length;m++)bg(U[m],E)}catch(Q){lt(c,c.return,Q)}}i&&w&64&&Rx(x),Pi(x,x.return);break;case 27:zx(x);case 26:case 5:Ar(m,x,i),i&&c===null&&w&4&&Ox(x),Pi(x,x.return);break;case 12:Ar(m,x,i);break;case 31:Ar(m,x,i),i&&w&4&&Bx(m,x);break;case 13:Ar(m,x,i),i&&w&4&&Hx(m,x);break;case 22:x.memoizedState===null&&Ar(m,x,i),Pi(x,x.return);break;case 30:break;default:Ar(m,x,i)}n=n.sibling}}function $d(t,n){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&ki(i))}function Yd(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ki(t))}function Vn(t,n,i,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Gx(t,n,i,c),n=n.sibling}function Gx(t,n,i,c){var m=n.flags;switch(n.tag){case 0:case 11:case 15:Vn(t,n,i,c),m&2048&&Li(9,n);break;case 1:Vn(t,n,i,c);break;case 3:Vn(t,n,i,c),m&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ki(t)));break;case 12:if(m&2048){Vn(t,n,i,c),t=n.stateNode;try{var x=n.memoizedProps,w=x.id,E=x.onPostCommit;typeof E=="function"&&E(w,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){lt(n,n.return,U)}}else Vn(t,n,i,c);break;case 31:Vn(t,n,i,c);break;case 13:Vn(t,n,i,c);break;case 23:break;case 22:x=n.stateNode,w=n.alternate,n.memoizedState!==null?x._visibility&2?Vn(t,n,i,c):Ui(t,n):x._visibility&2?Vn(t,n,i,c):(x._visibility|=2,Sl(t,n,i,c,(n.subtreeFlags&10256)!==0||!1)),m&2048&&$d(w,n);break;case 24:Vn(t,n,i,c),m&2048&&Yd(n.alternate,n);break;default:Vn(t,n,i,c)}}function Sl(t,n,i,c,m){for(m=m&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var x=t,w=n,E=i,U=c,Q=w.flags;switch(w.tag){case 0:case 11:case 15:Sl(x,w,E,U,m),Li(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?Sl(x,w,E,U,m):Ui(x,w):(re._visibility|=2,Sl(x,w,E,U,m)),m&&Q&2048&&$d(w.alternate,w);break;case 24:Sl(x,w,E,U,m),m&&Q&2048&&Yd(w.alternate,w);break;default:Sl(x,w,E,U,m)}n=n.sibling}}function Ui(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=t,c=n,m=c.flags;switch(c.tag){case 22:Ui(i,c),m&2048&&$d(c.alternate,c);break;case 24:Ui(i,c),m&2048&&Yd(c.alternate,c);break;default:Ui(i,c)}n=n.sibling}}var Ii=8192;function wl(t,n,i){if(t.subtreeFlags&Ii)for(t=t.child;t!==null;)$x(t,n,i),t=t.sibling}function $x(t,n,i){switch(t.tag){case 26:wl(t,n,i),t.flags&Ii&&t.memoizedState!==null&&bC(i,Yn,t.memoizedState,t.memoizedProps);break;case 5:wl(t,n,i);break;case 3:case 4:var c=Yn;Yn=Po(t.stateNode.containerInfo),wl(t,n,i),Yn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Ii,Ii=16777216,wl(t,n,i),Ii=c):wl(t,n,i));break;default:wl(t,n,i)}}function Yx(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Bi(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var c=n[i];Bt=c,Kx(c,t)}Yx(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vx(t),t=t.sibling}function Vx(t){switch(t.tag){case 0:case 11:case 15:Bi(t),t.flags&2048&&Xr(9,t,t.return);break;case 3:Bi(t);break;case 12:Bi(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,jo(t)):Bi(t);break;default:Bi(t)}}function jo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var c=n[i];Bt=c,Kx(c,t)}Yx(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Xr(8,n,n.return),jo(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,jo(n));break;default:jo(n)}t=t.sibling}}function Kx(t,n){for(;Bt!==null;){var i=Bt;switch(i.tag){case 0:case 11:case 15:Xr(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:ki(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,Bt=c;else e:for(i=t;Bt!==null;){c=Bt;var m=c.sibling,x=c.return;if(Ux(c),c===i){Bt=null;break e}if(m!==null){m.return=x,Bt=m;break e}Bt=x}}}var z2={getCacheForType:function(t){var n=$t(_t),i=n.data.get(t);return i===void 0&&(i=t(),n.data.set(t,i)),i},cacheSignal:function(){return $t(_t).controller.signal}},L2=typeof WeakMap=="function"?WeakMap:Map,rt=0,ft=null,$e=null,Ke=0,at=0,wn=null,Qr=!1,kl=!1,Vd=!1,_r=0,Nt=0,Zr=0,Pa=0,Kd=0,kn=0,jl=0,Hi=null,hn=null,Xd=!1,Co=0,Xx=0,No=1/0,Eo=null,Jr=null,zt=0,Wr=null,Cl=null,Tr=0,Qd=0,Zd=null,Qx=null,qi=0,Jd=null;function jn(){return(rt&2)!==0&&Ke!==0?Ke&-Ke:z.T!==null?af():fp()}function Zx(){if(kn===0)if((Ke&536870912)===0||Ze){var t=Ds;Ds<<=1,(Ds&3932160)===0&&(Ds=262144),kn=t}else kn=536870912;return t=bn.current,t!==null&&(t.flags|=32),kn}function mn(t,n,i){(t===ft&&(at===2||at===9)||t.cancelPendingCommit!==null)&&(Nl(t,0),ea(t,Ke,kn,!1)),ci(t,i),((rt&2)===0||t!==ft)&&(t===ft&&((rt&2)===0&&(Pa|=i),Nt===4&&ea(t,Ke,kn,!1)),nr(t))}function Jx(t,n,i){if((rt&6)!==0)throw Error(l(327));var c=!i&&(n&127)===0&&(n&t.expiredLanes)===0||oi(t,n),m=c?I2(t,n):ef(t,n,!0),x=c;do{if(m===0){kl&&!c&&ea(t,n,0,!1);break}else{if(i=t.current.alternate,x&&!P2(i)){m=ef(t,n,!1),x=!1;continue}if(m===2){if(x=n,t.errorRecoveryDisabledLanes&x)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var E=t;m=Hi;var U=E.current.memoizedState.isDehydrated;if(U&&(Nl(E,w).flags|=256),w=ef(E,w,!1),w!==2){if(Vd&&!U){E.errorRecoveryDisabledLanes|=x,Pa|=x,m=4;break e}x=hn,hn=m,x!==null&&(hn===null?hn=x:hn.push.apply(hn,x))}m=w}if(x=!1,m!==2)continue}}if(m===1){Nl(t,0),ea(t,n,0,!0);break}e:{switch(c=t,x=m,x){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:ea(c,n,kn,!Qr);break e;case 2:hn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(m=Co+300-qe(),10<m)){if(ea(c,n,kn,!Qr),Ls(c,0,!0)!==0)break e;Tr=n,c.timeoutHandle=_y(Wx.bind(null,c,i,hn,Eo,Xd,n,kn,Pa,jl,Qr,x,"Throttled",-0,0),m);break e}Wx(c,i,hn,Eo,Xd,n,kn,Pa,jl,Qr,x,null,-0,0)}}break}while(!0);nr(t)}function Wx(t,n,i,c,m,x,w,E,U,Q,re,ie,Z,ne){if(t.timeoutHandle=-1,ie=n.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pr},$x(n,x,ie);var ye=(x&62914560)===x?Co-qe():(x&4194048)===x?Xx-qe():0;if(ye=SC(ie,ye),ye!==null){Tr=x,t.cancelPendingCommit=ye(sy.bind(null,t,n,x,i,c,m,w,E,U,re,ie,null,Z,ne)),ea(t,x,w,!Q);return}}sy(t,n,x,i,c,m,w,E,U)}function P2(t){for(var n=t;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var m=i[c],x=m.getSnapshot;m=m.value;try{if(!yn(x(),m))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ea(t,n,i,c){n&=~Kd,n&=~Pa,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var m=n;0<m;){var x=31-dt(m),w=1<<x;c[x]=-1,m&=~w}i!==0&&cp(t,i,n)}function Ao(){return(rt&6)===0?(Fi(0),!1):!0}function Wd(){if($e!==null){if(at===0)var t=$e.return;else t=$e,vr=Aa=null,pd(t),gl=null,Ci=0,t=$e;for(;t!==null;)Tx(t.alternate,t),t=t.return;$e=null}}function Nl(t,n){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,rC(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),Tr=0,Wd(),ft=t,$e=i=xr(t.current,null),Ke=n,at=0,wn=null,Qr=!1,kl=oi(t,n),Vd=!1,jl=kn=Kd=Pa=Zr=Nt=0,hn=Hi=null,Xd=!1,(n&8)!==0&&(n|=n&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=n;0<c;){var m=31-dt(c),x=1<<m;n|=t[m],c&=~x}return _r=n,Ks(),i}function ey(t,n){Ie=null,z.H=Oi,n===pl||n===no?(n=gg(),at=3):n===rd?(n=gg(),at=4):at=n===Rd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,wn=n,$e===null&&(Nt=1,xo(t,Mn(n,t.current)))}function ty(){var t=bn.current;return t===null?!0:(Ke&4194048)===Ke?Ln===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?t===Ln:!1}function ny(){var t=z.H;return z.H=Oi,t===null?Oi:t}function ry(){var t=z.A;return z.A=z2,t}function _o(){Nt=4,Qr||(Ke&4194048)!==Ke&&bn.current!==null||(kl=!0),(Zr&134217727)===0&&(Pa&134217727)===0||ft===null||ea(ft,Ke,kn,!1)}function ef(t,n,i){var c=rt;rt|=2;var m=ny(),x=ry();(ft!==t||Ke!==n)&&(Eo=null,Nl(t,n)),n=!1;var w=Nt;e:do try{if(at!==0&&$e!==null){var E=$e,U=wn;switch(at){case 8:Wd(),w=6;break e;case 3:case 2:case 9:case 6:bn.current===null&&(n=!0);var Q=at;if(at=0,wn=null,El(t,E,U,Q),i&&kl){w=0;break e}break;default:Q=at,at=0,wn=null,El(t,E,U,Q)}}U2(),w=Nt;break}catch(re){ey(t,re)}while(!0);return n&&t.shellSuspendCounter++,vr=Aa=null,rt=c,z.H=m,z.A=x,$e===null&&(ft=null,Ke=0,Ks()),w}function U2(){for(;$e!==null;)ay($e)}function I2(t,n){var i=rt;rt|=2;var c=ny(),m=ry();ft!==t||Ke!==n?(Eo=null,No=qe()+500,Nl(t,n)):kl=oi(t,n);e:do try{if(at!==0&&$e!==null){n=$e;var x=wn;t:switch(at){case 1:at=0,wn=null,El(t,n,x,1);break;case 2:case 9:if(mg(x)){at=0,wn=null,ly(n);break}n=function(){at!==2&&at!==9||ft!==t||(at=7),nr(t)},x.then(n,n);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:mg(x)?(at=0,wn=null,ly(n)):(at=0,wn=null,El(t,n,x,7));break;case 5:var w=null;switch($e.tag){case 26:w=$e.memoizedState;case 5:case 27:var E=$e;if(w?Gy(w):E.stateNode.complete){at=0,wn=null;var U=E.sibling;if(U!==null)$e=U;else{var Q=E.return;Q!==null?($e=Q,To(Q)):$e=null}break t}}at=0,wn=null,El(t,n,x,5);break;case 6:at=0,wn=null,El(t,n,x,6);break;case 8:Wd(),Nt=6;break e;default:throw Error(l(462))}}B2();break}catch(re){ey(t,re)}while(!0);return vr=Aa=null,z.H=c,z.A=m,rt=i,$e!==null?0:(ft=null,Ke=0,Ks(),Nt)}function B2(){for(;$e!==null&&!Qe();)ay($e)}function ay(t){var n=Ax(t.alternate,t,_r);t.memoizedProps=t.pendingProps,n===null?To(t):$e=n}function ly(t){var n=t,i=n.alternate;switch(n.tag){case 15:case 0:n=wx(i,n,n.pendingProps,n.type,void 0,Ke);break;case 11:n=wx(i,n,n.pendingProps,n.type.render,n.ref,Ke);break;case 5:pd(n);default:Tx(i,n),n=$e=rg(n,_r),n=Ax(i,n,_r)}t.memoizedProps=t.pendingProps,n===null?To(t):$e=n}function El(t,n,i,c){vr=Aa=null,pd(n),gl=null,Ci=0;var m=n.return;try{if(A2(t,m,n,i,Ke)){Nt=1,xo(t,Mn(i,t.current)),$e=null;return}}catch(x){if(m!==null)throw $e=m,x;Nt=1,xo(t,Mn(i,t.current)),$e=null;return}n.flags&32768?(Ze||c===1?t=!0:kl||(Ke&536870912)!==0?t=!1:(Qr=t=!0,(c===2||c===9||c===3||c===6)&&(c=bn.current,c!==null&&c.tag===13&&(c.flags|=16384))),iy(n,t)):To(n)}function To(t){var n=t;do{if((n.flags&32768)!==0){iy(n,Qr);return}t=n.return;var i=R2(n.alternate,n,_r);if(i!==null){$e=i;return}if(n=n.sibling,n!==null){$e=n;return}$e=n=t}while(n!==null);Nt===0&&(Nt=5)}function iy(t,n){do{var i=M2(t.alternate,t);if(i!==null){i.flags&=32767,$e=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(t=t.sibling,t!==null)){$e=t;return}$e=t=i}while(t!==null);Nt=6,$e=null}function sy(t,n,i,c,m,x,w,E,U){t.cancelPendingCommit=null;do Ro();while(zt!==0);if((rt&6)!==0)throw Error(l(327));if(n!==null){if(n===t.current)throw Error(l(177));if(x=n.lanes|n.childLanes,x|=qu,vj(t,i,x,w,E,U),t===ft&&($e=ft=null,Ke=0),Cl=n,Wr=t,Tr=i,Qd=x,Zd=m,Qx=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,G2(be,function(){return fy(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=z.T,z.T=null,m=F.p,F.p=2,w=rt,rt|=4;try{O2(t,n,i)}finally{rt=w,F.p=m,z.T=c}}zt=1,oy(),cy(),uy()}}function oy(){if(zt===1){zt=0;var t=Wr,n=Cl,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=z.T,z.T=null;var c=F.p;F.p=2;var m=rt;rt|=4;try{qx(n,t);var x=hf,w=Kp(t.containerInfo),E=x.focusedElem,U=x.selectionRange;if(w!==E&&E&&E.ownerDocument&&Vp(E.ownerDocument.documentElement,E)){if(U!==null&&Pu(E)){var Q=U.start,re=U.end;if(re===void 0&&(re=Q),"selectionStart"in E)E.selectionStart=Q,E.selectionEnd=Math.min(re,E.value.length);else{var ie=E.ownerDocument||document,Z=ie&&ie.defaultView||window;if(Z.getSelection){var ne=Z.getSelection(),ye=E.textContent.length,Me=Math.min(U.start,ye),ut=U.end===void 0?Me:Math.min(U.end,ye);!ne.extend&&Me>ut&&(w=ut,ut=Me,Me=w);var $=Yp(E,Me),H=Yp(E,ut);if($&&H&&(ne.rangeCount!==1||ne.anchorNode!==$.node||ne.anchorOffset!==$.offset||ne.focusNode!==H.node||ne.focusOffset!==H.offset)){var X=ie.createRange();X.setStart($.node,$.offset),ne.removeAllRanges(),Me>ut?(ne.addRange(X),ne.extend(H.node,H.offset)):(X.setEnd(H.node,H.offset),ne.addRange(X))}}}}for(ie=[],ne=E;ne=ne.parentNode;)ne.nodeType===1&&ie.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ie.length;E++){var le=ie[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Fo=!!ff,hf=ff=null}finally{rt=m,F.p=c,z.T=i}}t.current=n,zt=2}}function cy(){if(zt===2){zt=0;var t=Wr,n=Cl,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=z.T,z.T=null;var c=F.p;F.p=2;var m=rt;rt|=4;try{Px(t,n.alternate,n)}finally{rt=m,F.p=c,z.T=i}}zt=3}}function uy(){if(zt===4||zt===3){zt=0,et();var t=Wr,n=Cl,i=Tr,c=Qx;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?zt=5:(zt=0,Cl=Wr=null,dy(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(Jr=null),yu(i),n=n.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(en,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=z.T,m=F.p,F.p=2,z.T=null;try{for(var x=t.onRecoverableError,w=0;w<c.length;w++){var E=c[w];x(E.value,{componentStack:E.stack})}}finally{z.T=n,F.p=m}}(Tr&3)!==0&&Ro(),nr(t),m=t.pendingLanes,(i&261930)!==0&&(m&42)!==0?t===Jd?qi++:(qi=0,Jd=t):qi=0,Fi(0)}}function dy(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ki(n)))}function Ro(){return oy(),cy(),uy(),fy()}function fy(){if(zt!==5)return!1;var t=Wr,n=Qd;Qd=0;var i=yu(Tr),c=z.T,m=F.p;try{F.p=32>i?32:i,z.T=null,i=Zd,Zd=null;var x=Wr,w=Tr;if(zt=0,Cl=Wr=null,Tr=0,(rt&6)!==0)throw Error(l(331));var E=rt;if(rt|=4,Vx(x.current),Gx(x,x.current,w,i),rt=E,Fi(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(en,x)}catch{}return!0}finally{F.p=m,z.T=c,dy(t,n)}}function hy(t,n,i){n=Mn(i,n),n=Td(t.stateNode,n,2),t=Yr(t,n,2),t!==null&&(ci(t,2),nr(t))}function lt(t,n,i){if(t.tag===3)hy(t,t,i);else for(;n!==null;){if(n.tag===3){hy(n,t,i);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Jr===null||!Jr.has(c))){t=Mn(i,t),i=mx(2),c=Yr(n,i,2),c!==null&&(px(i,c,n,t),ci(c,2),nr(c));break}}n=n.return}}function tf(t,n,i){var c=t.pingCache;if(c===null){c=t.pingCache=new L2;var m=new Set;c.set(n,m)}else m=c.get(n),m===void 0&&(m=new Set,c.set(n,m));m.has(i)||(Vd=!0,m.add(i),t=H2.bind(null,t,n,i),n.then(t,t))}function H2(t,n,i){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,ft===t&&(Ke&i)===i&&(Nt===4||Nt===3&&(Ke&62914560)===Ke&&300>qe()-Co?(rt&2)===0&&Nl(t,0):Kd|=i,jl===Ke&&(jl=0)),nr(t)}function my(t,n){n===0&&(n=op()),t=Ca(t,n),t!==null&&(ci(t,n),nr(t))}function q2(t){var n=t.memoizedState,i=0;n!==null&&(i=n.retryLane),my(t,i)}function F2(t,n){var i=0;switch(t.tag){case 31:case 13:var c=t.stateNode,m=t.memoizedState;m!==null&&(i=m.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(l(314))}c!==null&&c.delete(n),my(t,i)}function G2(t,n){return Le(t,n)}var Mo=null,Al=null,nf=!1,Oo=!1,rf=!1,ta=0;function nr(t){t!==Al&&t.next===null&&(Al===null?Mo=Al=t:Al=Al.next=t),Oo=!0,nf||(nf=!0,Y2())}function Fi(t,n){if(!rf&&Oo){rf=!0;do for(var i=!1,c=Mo;c!==null;){if(t!==0){var m=c.pendingLanes;if(m===0)var x=0;else{var w=c.suspendedLanes,E=c.pingedLanes;x=(1<<31-dt(42|t)+1)-1,x&=m&~(w&~E),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,yy(c,x))}else x=Ke,x=Ls(c,c===ft?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||oi(c,x)||(i=!0,yy(c,x));c=c.next}while(i);rf=!1}}function $2(){py()}function py(){Oo=nf=!1;var t=0;ta!==0&&nC()&&(t=ta);for(var n=qe(),i=null,c=Mo;c!==null;){var m=c.next,x=gy(c,n);x===0?(c.next=null,i===null?Mo=m:i.next=m,m===null&&(Al=i)):(i=c,(t!==0||(x&3)!==0)&&(Oo=!0)),c=m}zt!==0&&zt!==5||Fi(t),ta!==0&&(ta=0)}function gy(t,n){for(var i=t.suspendedLanes,c=t.pingedLanes,m=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var w=31-dt(x),E=1<<w,U=m[w];U===-1?((E&i)===0||(E&c)!==0)&&(m[w]=yj(E,n)):U<=n&&(t.expiredLanes|=E),x&=~E}if(n=ft,i=Ke,i=Ls(t,t===n?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,i===0||t===n&&(at===2||at===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&he(c),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||oi(t,i)){if(n=i&-i,n===t.callbackPriority)return n;switch(c!==null&&he(c),yu(i)){case 2:case 8:i=se;break;case 32:i=be;break;case 268435456:i=Ae;break;default:i=be}return c=xy.bind(null,t),i=Le(i,c),t.callbackPriority=n,t.callbackNode=i,n}return c!==null&&c!==null&&he(c),t.callbackPriority=2,t.callbackNode=null,2}function xy(t,n){if(zt!==0&&zt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(Ro()&&t.callbackNode!==i)return null;var c=Ke;return c=Ls(t,t===ft?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Jx(t,c,n),gy(t,qe()),t.callbackNode!=null&&t.callbackNode===i?xy.bind(null,t):null)}function yy(t,n){if(Ro())return null;Jx(t,n,!0)}function Y2(){aC(function(){(rt&6)!==0?Le(W,$2):py()})}function af(){if(ta===0){var t=hl;t===0&&(t=Os,Os<<=1,(Os&261888)===0&&(Os=256)),ta=t}return ta}function vy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Bs(""+t)}function by(t,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,t.id&&i.setAttribute("form",t.id),n.parentNode.insertBefore(i,n),t=new FormData(t),i.parentNode.removeChild(i),t}function V2(t,n,i,c,m){if(n==="submit"&&i&&i.stateNode===m){var x=vy((m[on]||null).action),w=c.submitter;w&&(n=(n=w[on]||null)?vy(n.formAction):w.getAttribute("formAction"),n!==null&&(x=n,w=null));var E=new Gs("action","action",null,c,m);t.push({event:E,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ta!==0){var U=w?by(m,w):new FormData(m);jd(i,{pending:!0,data:U,method:m.method,action:x},null,U)}}else typeof x=="function"&&(E.preventDefault(),U=w?by(m,w):new FormData(m),jd(i,{pending:!0,data:U,method:m.method,action:x},x,U))},currentTarget:m}]})}}for(var lf=0;lf<Hu.length;lf++){var sf=Hu[lf],K2=sf.toLowerCase(),X2=sf[0].toUpperCase()+sf.slice(1);$n(K2,"on"+X2)}$n(Zp,"onAnimationEnd"),$n(Jp,"onAnimationIteration"),$n(Wp,"onAnimationStart"),$n("dblclick","onDoubleClick"),$n("focusin","onFocus"),$n("focusout","onBlur"),$n(d2,"onTransitionRun"),$n(f2,"onTransitionStart"),$n(h2,"onTransitionCancel"),$n(eg,"onTransitionEnd"),Wa("onMouseEnter",["mouseout","mouseover"]),Wa("onMouseLeave",["mouseout","mouseover"]),Wa("onPointerEnter",["pointerout","pointerover"]),Wa("onPointerLeave",["pointerout","pointerover"]),Sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gi="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(" "),Q2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gi));function Sy(t,n){n=(n&4)!==0;for(var i=0;i<t.length;i++){var c=t[i],m=c.event;c=c.listeners;e:{var x=void 0;if(n)for(var w=c.length-1;0<=w;w--){var E=c[w],U=E.instance,Q=E.currentTarget;if(E=E.listener,U!==x&&m.isPropagationStopped())break e;x=E,m.currentTarget=Q;try{x(m)}catch(re){Vs(re)}m.currentTarget=null,x=U}else for(w=0;w<c.length;w++){if(E=c[w],U=E.instance,Q=E.currentTarget,E=E.listener,U!==x&&m.isPropagationStopped())break e;x=E,m.currentTarget=Q;try{x(m)}catch(re){Vs(re)}m.currentTarget=null,x=U}}}}function Ye(t,n){var i=n[vu];i===void 0&&(i=n[vu]=new Set);var c=t+"__bubble";i.has(c)||(wy(n,t,2,!1),i.add(c))}function of(t,n,i){var c=0;n&&(c|=4),wy(i,t,c,n)}var Do="_reactListening"+Math.random().toString(36).slice(2);function cf(t){if(!t[Do]){t[Do]=!0,pp.forEach(function(i){i!=="selectionchange"&&(Q2.has(i)||of(i,!1,t),of(i,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Do]||(n[Do]=!0,of("selectionchange",!1,n))}}function wy(t,n,i,c){switch(Zy(n)){case 2:var m=jC;break;case 8:m=CC;break;default:m=jf}i=m.bind(null,n,i,t),m=void 0,!Au||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),c?m!==void 0?t.addEventListener(n,i,{capture:!0,passive:m}):t.addEventListener(n,i,!0):m!==void 0?t.addEventListener(n,i,{passive:m}):t.addEventListener(n,i,!1)}function uf(t,n,i,c,m){var x=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var E=c.stateNode.containerInfo;if(E===m)break;if(w===4)for(w=c.return;w!==null;){var U=w.tag;if((U===3||U===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;E!==null;){if(w=Qa(E),w===null)return;if(U=w.tag,U===5||U===6||U===26||U===27){c=x=w;continue e}E=E.parentNode}}c=c.return}Ep(function(){var Q=x,re=Nu(i),ie=[];e:{var Z=tg.get(t);if(Z!==void 0){var ne=Gs,ye=t;switch(t){case"keypress":if(qs(i)===0)break e;case"keydown":case"keyup":ne=Fj;break;case"focusin":ye="focus",ne=Mu;break;case"focusout":ye="blur",ne=Mu;break;case"beforeblur":case"afterblur":ne=Mu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Rj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Yj;break;case Zp:case Jp:case Wp:ne=Dj;break;case eg:ne=Kj;break;case"scroll":case"scrollend":ne=_j;break;case"wheel":ne=Qj;break;case"copy":case"cut":case"paste":ne=Lj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Mp;break;case"toggle":case"beforetoggle":ne=Jj}var Me=(n&4)!==0,ut=!Me&&(t==="scroll"||t==="scrollend"),$=Me?Z!==null?Z+"Capture":null:Z;Me=[];for(var H=Q,X;H!==null;){var le=H;if(X=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||X===null||$===null||(le=fi(H,$),le!=null&&Me.push($i(H,le,X))),ut)break;H=H.return}0<Me.length&&(Z=new ne(Z,ye,null,i,re),ie.push({event:Z,listeners:Me}))}}if((n&7)===0){e:{if(Z=t==="mouseover"||t==="pointerover",ne=t==="mouseout"||t==="pointerout",Z&&i!==Cu&&(ye=i.relatedTarget||i.fromElement)&&(Qa(ye)||ye[Xa]))break e;if((ne||Z)&&(Z=re.window===re?re:(Z=re.ownerDocument)?Z.defaultView||Z.parentWindow:window,ne?(ye=i.relatedTarget||i.toElement,ne=Q,ye=ye?Qa(ye):null,ye!==null&&(ut=u(ye),Me=ye.tag,ye!==ut||Me!==5&&Me!==27&&Me!==6)&&(ye=null)):(ne=null,ye=Q),ne!==ye)){if(Me=Tp,le="onMouseLeave",$="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(Me=Mp,le="onPointerLeave",$="onPointerEnter",H="pointer"),ut=ne==null?Z:di(ne),X=ye==null?Z:di(ye),Z=new Me(le,H+"leave",ne,i,re),Z.target=ut,Z.relatedTarget=X,le=null,Qa(re)===Q&&(Me=new Me($,H+"enter",ye,i,re),Me.target=X,Me.relatedTarget=ut,le=Me),ut=le,ne&&ye)t:{for(Me=Z2,$=ne,H=ye,X=0,le=$;le;le=Me(le))X++;le=0;for(var _e=H;_e;_e=Me(_e))le++;for(;0<X-le;)$=Me($),X--;for(;0<le-X;)H=Me(H),le--;for(;X--;){if($===H||H!==null&&$===H.alternate){Me=$;break t}$=Me($),H=Me(H)}Me=null}else Me=null;ne!==null&&ky(ie,Z,ne,Me,!1),ye!==null&&ut!==null&&ky(ie,ut,ye,Me,!0)}}e:{if(Z=Q?di(Q):window,ne=Z.nodeName&&Z.nodeName.toLowerCase(),ne==="select"||ne==="input"&&Z.type==="file")var tt=Bp;else if(Up(Z))if(Hp)tt=o2;else{tt=i2;var Ce=l2}else ne=Z.nodeName,!ne||ne.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?Q&&ju(Q.elementType)&&(tt=Bp):tt=s2;if(tt&&(tt=tt(t,Q))){Ip(ie,tt,i,re);break e}Ce&&Ce(t,Z,Q),t==="focusout"&&Q&&Z.type==="number"&&Q.memoizedProps.value!=null&&ku(Z,"number",Z.value)}switch(Ce=Q?di(Q):window,t){case"focusin":(Up(Ce)||Ce.contentEditable==="true")&&(ll=Ce,Uu=Q,bi=null);break;case"focusout":bi=Uu=ll=null;break;case"mousedown":Iu=!0;break;case"contextmenu":case"mouseup":case"dragend":Iu=!1,Xp(ie,i,re);break;case"selectionchange":if(u2)break;case"keydown":case"keyup":Xp(ie,i,re)}var Be;if(Du)e:{switch(t){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else al?Lp(t,i)&&(Xe="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(Xe="onCompositionStart");Xe&&(Op&&i.locale!=="ko"&&(al||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&al&&(Be=Ap()):(Ir=re,_u="value"in Ir?Ir.value:Ir.textContent,al=!0)),Ce=zo(Q,Xe),0<Ce.length&&(Xe=new Rp(Xe,t,null,i,re),ie.push({event:Xe,listeners:Ce}),Be?Xe.data=Be:(Be=Pp(i),Be!==null&&(Xe.data=Be)))),(Be=e2?t2(t,i):n2(t,i))&&(Xe=zo(Q,"onBeforeInput"),0<Xe.length&&(Ce=new Rp("onBeforeInput","beforeinput",null,i,re),ie.push({event:Ce,listeners:Xe}),Ce.data=Be)),V2(ie,t,Q,i,re)}Sy(ie,n)})}function $i(t,n,i){return{instance:t,listener:n,currentTarget:i}}function zo(t,n){for(var i=n+"Capture",c=[];t!==null;){var m=t,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=fi(t,i),m!=null&&c.unshift($i(t,m,x)),m=fi(t,n),m!=null&&c.push($i(t,m,x))),t.tag===3)return c;t=t.return}return[]}function Z2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ky(t,n,i,c,m){for(var x=n._reactName,w=[];i!==null&&i!==c;){var E=i,U=E.alternate,Q=E.stateNode;if(E=E.tag,U!==null&&U===c)break;E!==5&&E!==26&&E!==27||Q===null||(U=Q,m?(Q=fi(i,x),Q!=null&&w.unshift($i(i,Q,U))):m||(Q=fi(i,x),Q!=null&&w.push($i(i,Q,U)))),i=i.return}w.length!==0&&t.push({event:n,listeners:w})}var J2=/\r\n?/g,W2=/\u0000|\uFFFD/g;function jy(t){return(typeof t=="string"?t:""+t).replace(J2,`
9
+ `).replace(W2,"")}function Cy(t,n){return n=jy(n),jy(t)===n}function ct(t,n,i,c,m,x){switch(i){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||tl(t,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&tl(t,""+c);break;case"className":Us(t,"class",c);break;case"tabIndex":Us(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Us(t,i,c);break;case"style":Cp(t,c,x);break;case"data":if(n!=="object"){Us(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||i!=="href")){t.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=Bs(""+c),t.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(i,"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}else typeof x=="function"&&(i==="formAction"?(n!=="input"&&ct(t,n,"name",m.name,m,null),ct(t,n,"formEncType",m.formEncType,m,null),ct(t,n,"formMethod",m.formMethod,m,null),ct(t,n,"formTarget",m.formTarget,m,null)):(ct(t,n,"encType",m.encType,m,null),ct(t,n,"method",m.method,m,null),ct(t,n,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=Bs(""+c),t.setAttribute(i,c);break;case"onClick":c!=null&&(t.onclick=pr);break;case"onScroll":c!=null&&Ye("scroll",t);break;case"onScrollEnd":c!=null&&Ye("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(m.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}i=Bs(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""+c):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":c===!0?t.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,c):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(i,c):t.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(i):t.setAttribute(i,c);break;case"popover":Ye("beforetoggle",t),Ye("toggle",t),Ps(t,"popover",c);break;case"xlinkActuate":mr(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":mr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":mr(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":mr(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":mr(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":mr(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":mr(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":mr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":mr(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Ps(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ej.get(i)||i,Ps(t,i,c))}}function df(t,n,i,c,m,x){switch(i){case"style":Cp(t,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(m.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"children":typeof c=="string"?tl(t,c):(typeof c=="number"||typeof c=="bigint")&&tl(t,""+c);break;case"onScroll":c!=null&&Ye("scroll",t);break;case"onScrollEnd":c!=null&&Ye("scrollend",t);break;case"onClick":c!=null&&(t.onclick=pr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gp.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),n=i.slice(2,m?i.length-7:void 0),x=t[on]||null,x=x!=null?x[i]:null,typeof x=="function"&&t.removeEventListener(n,x,m),typeof c=="function")){typeof x!="function"&&x!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(n,c,m);break e}i in t?t[i]=c:c===!0?t.setAttribute(i,""):Ps(t,i,c)}}}function Vt(t,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",t),Ye("load",t);var c=!1,m=!1,x;for(x in i)if(i.hasOwnProperty(x)){var w=i[x];if(w!=null)switch(x){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ct(t,n,x,w,i,null)}}m&&ct(t,n,"srcSet",i.srcSet,i,null),c&&ct(t,n,"src",i.src,i,null);return;case"input":Ye("invalid",t);var E=x=w=m=null,U=null,Q=null;for(c in i)if(i.hasOwnProperty(c)){var re=i[c];if(re!=null)switch(c){case"name":m=re;break;case"type":w=re;break;case"checked":U=re;break;case"defaultChecked":Q=re;break;case"value":x=re;break;case"defaultValue":E=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(l(137,n));break;default:ct(t,n,c,re,i,null)}}Sp(t,x,E,U,Q,w,m,!1);return;case"select":Ye("invalid",t),c=w=x=null;for(m in i)if(i.hasOwnProperty(m)&&(E=i[m],E!=null))switch(m){case"value":x=E;break;case"defaultValue":w=E;break;case"multiple":c=E;default:ct(t,n,m,E,i,null)}n=x,i=w,t.multiple=!!c,n!=null?el(t,!!c,n,!1):i!=null&&el(t,!!c,i,!0);return;case"textarea":Ye("invalid",t),x=m=c=null;for(w in i)if(i.hasOwnProperty(w)&&(E=i[w],E!=null))switch(w){case"value":c=E;break;case"defaultValue":m=E;break;case"children":x=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(l(91));break;default:ct(t,n,w,E,i,null)}kp(t,c,m,x);return;case"option":for(U in i)i.hasOwnProperty(U)&&(c=i[U],c!=null)&&(U==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":ct(t,n,U,c,i,null));return;case"dialog":Ye("beforetoggle",t),Ye("toggle",t),Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":Ye("load",t);break;case"video":case"audio":for(c=0;c<Gi.length;c++)Ye(Gi[c],t);break;case"image":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"embed":case"source":case"link":Ye("error",t),Ye("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in i)if(i.hasOwnProperty(Q)&&(c=i[Q],c!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ct(t,n,Q,c,i,null)}return;default:if(ju(n)){for(re in i)i.hasOwnProperty(re)&&(c=i[re],c!==void 0&&df(t,n,re,c,i,void 0));return}}for(E in i)i.hasOwnProperty(E)&&(c=i[E],c!=null&&ct(t,n,E,c,i,null))}function eC(t,n,i,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,w=null,E=null,U=null,Q=null,re=null;for(ne in i){var ie=i[ne];if(i.hasOwnProperty(ne)&&ie!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":U=ie;default:c.hasOwnProperty(ne)||ct(t,n,ne,null,c,ie)}}for(var Z in c){var ne=c[Z];if(ie=i[Z],c.hasOwnProperty(Z)&&(ne!=null||ie!=null))switch(Z){case"type":x=ne;break;case"name":m=ne;break;case"checked":Q=ne;break;case"defaultChecked":re=ne;break;case"value":w=ne;break;case"defaultValue":E=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(l(137,n));break;default:ne!==ie&&ct(t,n,Z,ne,c,ie)}}wu(t,w,E,U,Q,re,x,m);return;case"select":ne=w=E=Z=null;for(x in i)if(U=i[x],i.hasOwnProperty(x)&&U!=null)switch(x){case"value":break;case"multiple":ne=U;default:c.hasOwnProperty(x)||ct(t,n,x,null,c,U)}for(m in c)if(x=c[m],U=i[m],c.hasOwnProperty(m)&&(x!=null||U!=null))switch(m){case"value":Z=x;break;case"defaultValue":E=x;break;case"multiple":w=x;default:x!==U&&ct(t,n,m,x,c,U)}n=E,i=w,c=ne,Z!=null?el(t,!!i,Z,!1):!!c!=!!i&&(n!=null?el(t,!!i,n,!0):el(t,!!i,i?[]:"",!1));return;case"textarea":ne=Z=null;for(E in i)if(m=i[E],i.hasOwnProperty(E)&&m!=null&&!c.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:ct(t,n,E,null,c,m)}for(w in c)if(m=c[w],x=i[w],c.hasOwnProperty(w)&&(m!=null||x!=null))switch(w){case"value":Z=m;break;case"defaultValue":ne=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==x&&ct(t,n,w,m,c,x)}wp(t,Z,ne);return;case"option":for(var ye in i)Z=i[ye],i.hasOwnProperty(ye)&&Z!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:ct(t,n,ye,null,c,Z));for(U in c)Z=c[U],ne=i[U],c.hasOwnProperty(U)&&Z!==ne&&(Z!=null||ne!=null)&&(U==="selected"?t.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":ct(t,n,U,Z,c,ne));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 Me in i)Z=i[Me],i.hasOwnProperty(Me)&&Z!=null&&!c.hasOwnProperty(Me)&&ct(t,n,Me,null,c,Z);for(Q in c)if(Z=c[Q],ne=i[Q],c.hasOwnProperty(Q)&&Z!==ne&&(Z!=null||ne!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(l(137,n));break;default:ct(t,n,Q,Z,c,ne)}return;default:if(ju(n)){for(var ut in i)Z=i[ut],i.hasOwnProperty(ut)&&Z!==void 0&&!c.hasOwnProperty(ut)&&df(t,n,ut,void 0,c,Z);for(re in c)Z=c[re],ne=i[re],!c.hasOwnProperty(re)||Z===ne||Z===void 0&&ne===void 0||df(t,n,re,Z,c,ne);return}}for(var $ in i)Z=i[$],i.hasOwnProperty($)&&Z!=null&&!c.hasOwnProperty($)&&ct(t,n,$,null,c,Z);for(ie in c)Z=c[ie],ne=i[ie],!c.hasOwnProperty(ie)||Z===ne||Z==null&&ne==null||ct(t,n,ie,Z,c,ne)}function Ny(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,i=performance.getEntriesByType("resource"),c=0;c<i.length;c++){var m=i[c],x=m.transferSize,w=m.initiatorType,E=m.duration;if(x&&E&&Ny(w)){for(w=0,E=m.responseEnd,c+=1;c<i.length;c++){var U=i[c],Q=U.startTime;if(Q>E)break;var re=U.transferSize,ie=U.initiatorType;re&&Ny(ie)&&(U=U.responseEnd,w+=re*(U<E?1:(E-Q)/(U-Q)))}if(--c,n+=8*(x+w)/(m.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var ff=null,hf=null;function Lo(t){return t.nodeType===9?t:t.ownerDocument}function Ey(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ay(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function mf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var pf=null;function nC(){var t=window.event;return t&&t.type==="popstate"?t===pf?!1:(pf=t,!0):(pf=null,!1)}var _y=typeof setTimeout=="function"?setTimeout:void 0,rC=typeof clearTimeout=="function"?clearTimeout:void 0,Ty=typeof Promise=="function"?Promise:void 0,aC=typeof queueMicrotask=="function"?queueMicrotask:typeof Ty<"u"?function(t){return Ty.resolve(null).then(t).catch(lC)}:_y;function lC(t){setTimeout(function(){throw t})}function na(t){return t==="head"}function Ry(t,n){var i=n,c=0;do{var m=i.nextSibling;if(t.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(c===0){t.removeChild(m),Ml(n);return}c--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")c++;else if(i==="html")Yi(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,Yi(i);for(var x=i.firstChild;x;){var w=x.nextSibling,E=x.nodeName;x[ui]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=w}}else i==="body"&&Yi(t.ownerDocument.body);i=m}while(i);Ml(n)}function My(t,n){var i=t;t=0;do{var c=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),c&&c.nodeType===8)if(i=c.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=c}while(i)}function gf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":gf(i),bu(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function iC(t,n,i,c){for(;t.nodeType===1;){var m=i;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[ui])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=Pn(t.nextSibling),t===null)break}return null}function sC(t,n,i){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Pn(t.nextSibling),t===null))return null;return t}function Oy(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Pn(t.nextSibling),t===null))return null;return t}function xf(t){return t.data==="$?"||t.data==="$~"}function yf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function oC(t,n){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||i.readyState!=="loading")n();else{var c=function(){n(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Pn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var vf=null;function Dy(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(n===0)return Pn(t.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}t=t.nextSibling}return null}function zy(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return t;n--}else i!=="/$"&&i!=="/&"||n++}t=t.previousSibling}return null}function Ly(t,n,i){switch(n=Lo(i),t){case"html":if(t=n.documentElement,!t)throw Error(l(452));return t;case"head":if(t=n.head,!t)throw Error(l(453));return t;case"body":if(t=n.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Yi(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);bu(t)}var Un=new Map,Py=new Set;function Po(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Rr=F.d;F.d={f:cC,r:uC,D:dC,C:fC,L:hC,m:mC,X:gC,S:pC,M:xC};function cC(){var t=Rr.f(),n=Ao();return t||n}function uC(t){var n=Za(t);n!==null&&n.tag===5&&n.type==="form"?ex(n):Rr.r(t)}var _l=typeof document>"u"?null:document;function Uy(t,n,i){var c=_l;if(c&&typeof n=="string"&&n){var m=Tn(n);m='link[rel="'+t+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),Py.has(m)||(Py.add(m),t={rel:t,crossOrigin:i,href:n},c.querySelector(m)===null&&(n=c.createElement("link"),Vt(n,"link",t),It(n),c.head.appendChild(n)))}}function dC(t){Rr.D(t),Uy("dns-prefetch",t,null)}function fC(t,n){Rr.C(t,n),Uy("preconnect",t,n)}function hC(t,n,i){Rr.L(t,n,i);var c=_l;if(c&&t&&n){var m='link[rel="preload"][as="'+Tn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+Tn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+Tn(i.imageSizes)+'"]')):m+='[href="'+Tn(t)+'"]';var x=m;switch(n){case"style":x=Tl(t);break;case"script":x=Rl(t)}Un.has(x)||(t=g({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:t,as:n},i),Un.set(x,t),c.querySelector(m)!==null||n==="style"&&c.querySelector(Vi(x))||n==="script"&&c.querySelector(Ki(x))||(n=c.createElement("link"),Vt(n,"link",t),It(n),c.head.appendChild(n)))}}function mC(t,n){Rr.m(t,n);var i=_l;if(i&&t){var c=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+Tn(c)+'"][href="'+Tn(t)+'"]',x=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Rl(t)}if(!Un.has(x)&&(t=g({rel:"modulepreload",href:t},n),Un.set(x,t),i.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ki(x)))return}c=i.createElement("link"),Vt(c,"link",t),It(c),i.head.appendChild(c)}}}function pC(t,n,i){Rr.S(t,n,i);var c=_l;if(c&&t){var m=Ja(c).hoistableStyles,x=Tl(t);n=n||"default";var w=m.get(x);if(!w){var E={loading:0,preload:null};if(w=c.querySelector(Vi(x)))E.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},i),(i=Un.get(x))&&bf(t,i);var U=w=c.createElement("link");It(U),Vt(U,"link",t),U._p=new Promise(function(Q,re){U.onload=Q,U.onerror=re}),U.addEventListener("load",function(){E.loading|=1}),U.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Uo(w,n,c)}w={type:"stylesheet",instance:w,count:1,state:E},m.set(x,w)}}}function gC(t,n){Rr.X(t,n);var i=_l;if(i&&t){var c=Ja(i).hoistableScripts,m=Rl(t),x=c.get(m);x||(x=i.querySelector(Ki(m)),x||(t=g({src:t,async:!0},n),(n=Un.get(m))&&Sf(t,n),x=i.createElement("script"),It(x),Vt(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function xC(t,n){Rr.M(t,n);var i=_l;if(i&&t){var c=Ja(i).hoistableScripts,m=Rl(t),x=c.get(m);x||(x=i.querySelector(Ki(m)),x||(t=g({src:t,async:!0,type:"module"},n),(n=Un.get(m))&&Sf(t,n),x=i.createElement("script"),It(x),Vt(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function Iy(t,n,i,c){var m=(m=fe.current)?Po(m):null;if(!m)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=Tl(i.href),i=Ja(m).hoistableStyles,c=i.get(n),c||(c={type:"style",instance:null,count:0,state:null},i.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=Tl(i.href);var x=Ja(m).hoistableStyles,w=x.get(t);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,w),(x=m.querySelector(Vi(t)))&&!x._p&&(w.instance=x,w.state.loading=5),Un.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Un.set(t,i),x||yC(m,t,i,w.state))),n&&c===null)throw Error(l(528,""));return w}if(n&&c!==null)throw Error(l(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Rl(i),i=Ja(m).hoistableScripts,c=i.get(n),c||(c={type:"script",instance:null,count:0,state:null},i.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Tl(t){return'href="'+Tn(t)+'"'}function Vi(t){return'link[rel="stylesheet"]['+t+"]"}function By(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function yC(t,n,i,c){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=t.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),Vt(n,"link",i),It(n),t.head.appendChild(n))}function Rl(t){return'[src="'+Tn(t)+'"]'}function Ki(t){return"script[async]"+t}function Hy(t,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+Tn(i.href)+'"]');if(c)return n.instance=c,It(c),c;var m=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),It(c),Vt(c,"style",m),Uo(c,i.precedence,t),n.instance=c;case"stylesheet":m=Tl(i.href);var x=t.querySelector(Vi(m));if(x)return n.state.loading|=4,n.instance=x,It(x),x;c=By(i),(m=Un.get(m))&&bf(c,m),x=(t.ownerDocument||t).createElement("link"),It(x);var w=x;return w._p=new Promise(function(E,U){w.onload=E,w.onerror=U}),Vt(x,"link",c),n.state.loading|=4,Uo(x,i.precedence,t),n.instance=x;case"script":return x=Rl(i.src),(m=t.querySelector(Ki(x)))?(n.instance=m,It(m),m):(c=i,(m=Un.get(x))&&(c=g({},i),Sf(c,m)),t=t.ownerDocument||t,m=t.createElement("script"),It(m),Vt(m,"link",c),t.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,Uo(c,i.precedence,t));return n.instance}function Uo(t,n,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,x=m,w=0;w<c.length;w++){var E=c[w];if(E.dataset.precedence===n)x=E;else if(x!==m)break}x?x.parentNode.insertBefore(t,x.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(t,n.firstChild))}function bf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Sf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Io=null;function qy(t,n,i){if(Io===null){var c=new Map,m=Io=new Map;m.set(i,c)}else m=Io,c=m.get(i),c||(c=new Map,m.set(i,c));if(c.has(t))return c;for(c.set(t,null),i=i.getElementsByTagName(t),m=0;m<i.length;m++){var x=i[m];if(!(x[ui]||x[Ft]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(n)||"";w=t+w;var E=c.get(w);E?E.push(x):c.set(w,[x])}}return c}function Fy(t,n,i){t=t.ownerDocument||t,t.head.insertBefore(i,n==="title"?t.querySelector("head > title"):null)}function vC(t,n,i){if(i===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Gy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function bC(t,n,i,c){if(i.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=Tl(c.href),x=n.querySelector(Vi(m));if(x){n=x._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Bo.bind(t),n.then(t,t)),i.state.loading|=4,i.instance=x,It(x);return}x=n.ownerDocument||n,c=By(c),(m=Un.get(m))&&bf(c,m),x=x.createElement("link"),It(x);var w=x;w._p=new Promise(function(E,U){w.onload=E,w.onerror=U}),Vt(x,"link",c),i.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Bo.bind(t),n.addEventListener("load",i),n.addEventListener("error",i))}}var wf=0;function SC(t,n){return t.stylesheets&&t.count===0&&qo(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var c=setTimeout(function(){if(t.stylesheets&&qo(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+n);0<t.imgBytes&&wf===0&&(wf=62500*tC());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&qo(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>wf?50:800)+n);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qo(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ho=null;function qo(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ho=new Map,n.forEach(wC,t),Ho=null,Bo.call(t))}function wC(t,n){if(!(n.state.loading&4)){var i=Ho.get(t);if(i)var c=i.get(null);else{i=new Map,Ho.set(t,i);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var w=m[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(i.set(w.dataset.precedence,w),c=w)}c&&i.set(null,c)}m=n.instance,w=m.getAttribute("data-precedence"),x=i.get(w)||c,x===c&&i.set(null,m),i.set(w,m),this.count++,c=Bo.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),x?x.parentNode.insertBefore(m,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),n.state.loading|=4}}var Xi={$$typeof:M,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function kC(t,n,i,c,m,x,w,E,U){this.tag=1,this.containerInfo=t,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=gu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gu(0),this.hiddenUpdates=gu(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function $y(t,n,i,c,m,x,w,E,U,Q,re,ie){return t=new kC(t,n,i,w,U,Q,re,ie,E),n=1,x===!0&&(n|=24),x=vn(3,null,null,n),t.current=x,x.stateNode=t,n=ed(),n.refCount++,t.pooledCache=n,n.refCount++,x.memoizedState={element:c,isDehydrated:i,cache:n},ad(x),t}function Yy(t){return t?(t=ol,t):ol}function Vy(t,n,i,c,m,x){m=Yy(m),c.context===null?c.context=m:c.pendingContext=m,c=$r(n),c.payload={element:i},x=x===void 0?null:x,x!==null&&(c.callback=x),i=Yr(t,c,n),i!==null&&(mn(i,t,n),Ei(i,t,n))}function Ky(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<n?i:n}}function kf(t,n){Ky(t,n),(t=t.alternate)&&Ky(t,n)}function Xy(t){if(t.tag===13||t.tag===31){var n=Ca(t,67108864);n!==null&&mn(n,t,67108864),kf(t,67108864)}}function Qy(t){if(t.tag===13||t.tag===31){var n=jn();n=xu(n);var i=Ca(t,n);i!==null&&mn(i,t,n),kf(t,n)}}var Fo=!0;function jC(t,n,i,c){var m=z.T;z.T=null;var x=F.p;try{F.p=2,jf(t,n,i,c)}finally{F.p=x,z.T=m}}function CC(t,n,i,c){var m=z.T;z.T=null;var x=F.p;try{F.p=8,jf(t,n,i,c)}finally{F.p=x,z.T=m}}function jf(t,n,i,c){if(Fo){var m=Cf(c);if(m===null)uf(t,n,c,Go,i),Jy(t,c);else if(EC(m,t,n,i,c))c.stopPropagation();else if(Jy(t,c),n&4&&-1<NC.indexOf(t)){for(;m!==null;){var x=Za(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=ba(x.pendingLanes);if(w!==0){var E=x;for(E.pendingLanes|=2,E.entangledLanes|=2;w;){var U=1<<31-dt(w);E.entanglements[1]|=U,w&=~U}nr(x),(rt&6)===0&&(No=qe()+500,Fi(0))}}break;case 31:case 13:E=Ca(x,2),E!==null&&mn(E,x,2),Ao(),kf(x,2)}if(x=Cf(c),x===null&&uf(t,n,c,Go,i),x===m)break;m=x}m!==null&&c.stopPropagation()}else uf(t,n,c,null,i)}}function Cf(t){return t=Nu(t),Nf(t)}var Go=null;function Nf(t){if(Go=null,t=Qa(t),t!==null){var n=u(t);if(n===null)t=null;else{var i=n.tag;if(i===13){if(t=d(n),t!==null)return t;t=null}else if(i===31){if(t=f(n),t!==null)return t;t=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Go=t,null}function Zy(t){switch(t){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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wt()){case W:return 2;case se:return 8;case be:case K:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var Ef=!1,ra=null,aa=null,la=null,Qi=new Map,Zi=new Map,ia=[],NC="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 Jy(t,n){switch(t){case"focusin":case"focusout":ra=null;break;case"dragenter":case"dragleave":aa=null;break;case"mouseover":case"mouseout":la=null;break;case"pointerover":case"pointerout":Qi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zi.delete(n.pointerId)}}function Ji(t,n,i,c,m,x){return t===null||t.nativeEvent!==x?(t={blockedOn:n,domEventName:i,eventSystemFlags:c,nativeEvent:x,targetContainers:[m]},n!==null&&(n=Za(n),n!==null&&Xy(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),t)}function EC(t,n,i,c,m){switch(n){case"focusin":return ra=Ji(ra,t,n,i,c,m),!0;case"dragenter":return aa=Ji(aa,t,n,i,c,m),!0;case"mouseover":return la=Ji(la,t,n,i,c,m),!0;case"pointerover":var x=m.pointerId;return Qi.set(x,Ji(Qi.get(x)||null,t,n,i,c,m)),!0;case"gotpointercapture":return x=m.pointerId,Zi.set(x,Ji(Zi.get(x)||null,t,n,i,c,m)),!0}return!1}function Wy(t){var n=Qa(t.target);if(n!==null){var i=u(n);if(i!==null){if(n=i.tag,n===13){if(n=d(i),n!==null){t.blockedOn=n,hp(t.priority,function(){Qy(i)});return}}else if(n===31){if(n=f(i),n!==null){t.blockedOn=n,hp(t.priority,function(){Qy(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function $o(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var i=Cf(t.nativeEvent);if(i===null){i=t.nativeEvent;var c=new i.constructor(i.type,i);Cu=c,i.target.dispatchEvent(c),Cu=null}else return n=Za(i),n!==null&&Xy(n),t.blockedOn=i,!1;n.shift()}return!0}function ev(t,n,i){$o(t)&&i.delete(n)}function AC(){Ef=!1,ra!==null&&$o(ra)&&(ra=null),aa!==null&&$o(aa)&&(aa=null),la!==null&&$o(la)&&(la=null),Qi.forEach(ev),Zi.forEach(ev)}function Yo(t,n){t.blockedOn===n&&(t.blockedOn=null,Ef||(Ef=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AC)))}var Vo=null;function tv(t){Vo!==t&&(Vo=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vo===t&&(Vo=null);for(var n=0;n<t.length;n+=3){var i=t[n],c=t[n+1],m=t[n+2];if(typeof c!="function"){if(Nf(c||i)===null)continue;break}var x=Za(i);x!==null&&(t.splice(n,3),n-=3,jd(x,{pending:!0,data:m,method:i.method,action:c},c,m))}}))}function Ml(t){function n(U){return Yo(U,t)}ra!==null&&Yo(ra,t),aa!==null&&Yo(aa,t),la!==null&&Yo(la,t),Qi.forEach(n),Zi.forEach(n);for(var i=0;i<ia.length;i++){var c=ia[i];c.blockedOn===t&&(c.blockedOn=null)}for(;0<ia.length&&(i=ia[0],i.blockedOn===null);)Wy(i),i.blockedOn===null&&ia.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var m=i[c],x=i[c+1],w=m[on]||null;if(typeof x=="function")w||tv(i);else if(w){var E=null;if(x&&x.hasAttribute("formAction")){if(m=x,w=x[on]||null)E=w.formAction;else if(Nf(m)!==null)continue}else E=w.action;typeof E=="function"?i[c+1]=E:(i.splice(c,3),c-=3),tv(i)}}}function nv(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=null),c||setTimeout(i,20)}function i(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),m!==null&&(m(),m=null)}}}function Af(t){this._internalRoot=t}Ko.prototype.render=Af.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,c=jn();Vy(i,c,t,n,null,null)},Ko.prototype.unmount=Af.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Vy(t.current,2,null,t,null,null),Ao(),n[Xa]=null}};function Ko(t){this._internalRoot=t}Ko.prototype.unstable_scheduleHydration=function(t){if(t){var n=fp();t={blockedOn:null,target:t,priority:n};for(var i=0;i<ia.length&&n!==0&&n<ia[i].priority;i++);ia.splice(i,0,t),i===0&&Wy(t)}};var rv=r.version;if(rv!=="19.2.4")throw Error(l(527,rv,"19.2.4"));F.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var _C={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xo.isDisabled&&Xo.supportsFiber)try{en=Xo.inject(_C),Dt=Xo}catch{}}return es.createRoot=function(t,n){if(!o(t))throw Error(l(299));var i=!1,c="",m=ux,x=dx,w=fx;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=$y(t,1,!1,null,null,i,c,null,m,x,w,nv),t[Xa]=n.current,cf(t),new Af(n)},es.hydrateRoot=function(t,n,i){if(!o(t))throw Error(l(299));var c=!1,m="",x=ux,w=dx,E=fx,U=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError),i.formState!==void 0&&(U=i.formState)),n=$y(t,1,!0,n,i??null,c,m,U,x,w,E,nv),n.context=Yy(null),i=n.current,c=jn(),c=xu(c),m=$r(c),m.callback=null,Yr(i,m,c),i=c,n.current.lanes=i,ci(n,i),nr(n),t[Xa]=n.current,cf(t),new Ko(n)},es.version="19.2.4",es}var hv;function IC(){if(hv)return Rf.exports;hv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Rf.exports=UC(),Rf.exports}var BC=IC();function s0(e){var r,a,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(a=s0(e[r]))&&(l&&(l+=" "),l+=a)}else for(a in e)e[a]&&(l&&(l+=" "),l+=a);return l}function o0(){for(var e,r,a=0,l="",o=arguments.length;a<o;a++)(e=arguments[a])&&(r=s0(e))&&(l&&(l+=" "),l+=r);return l}const mv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pv=o0,Lc=(e,r)=>a=>{var l;if(r?.variants==null)return pv(e,a?.class,a?.className);const{variants:o,defaultVariants:u}=r,d=Object.keys(o).map(p=>{const y=a?.[p],g=u?.[p];if(y===null)return null;const v=mv(y)||mv(g);return o[p][v]}),f=a&&Object.entries(a).reduce((p,y)=>{let[g,v]=y;return v===void 0||(p[g]=v),p},{}),h=r==null||(l=r.compoundVariants)===null||l===void 0?void 0:l.reduce((p,y)=>{let{class:g,className:v,...b}=y;return Object.entries(b).every(k=>{let[C,N]=k;return Array.isArray(N)?N.includes({...u,...f}[C]):{...u,...f}[C]===N})?[...p,g,v]:p},[]);return pv(e,d,h,a?.class,a?.className)};var Xh=i0();const HC=Dc(Xh);function gv(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Pc(...e){return r=>{let a=!1;const l=e.map(o=>{const u=gv(o,r);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let o=0;o<l.length;o++){const u=l[o];typeof u=="function"?u():gv(e[o],null)}}}}function bt(...e){return S.useCallback(Pc(...e),e)}function Gl(e){const r=qC(e),a=S.forwardRef((l,o)=>{const{children:u,...d}=l,f=S.Children.toArray(u),h=f.find(GC);if(h){const p=h.props.children,y=f.map(g=>g===h?S.Children.count(p)>1?S.Children.only(null):S.isValidElement(p)?p.props.children:null:g);return s.jsx(r,{...d,ref:o,children:S.isValidElement(p)?S.cloneElement(p,void 0,y):null})}return s.jsx(r,{...d,ref:o,children:u})});return a.displayName=`${e}.Slot`,a}var Uc=Gl("Slot");function qC(e){const r=S.forwardRef((a,l)=>{const{children:o,...u}=a;if(S.isValidElement(o)){const d=YC(o),f=$C(u,o.props);return o.type!==S.Fragment&&(f.ref=l?Pc(l,d):d),S.cloneElement(o,f)}return S.Children.count(o)>1?S.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var c0=Symbol("radix.slottable");function FC(e){const r=({children:a})=>s.jsx(s.Fragment,{children:a});return r.displayName=`${e}.Slottable`,r.__radixId=c0,r}function GC(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===c0}function $C(e,r){const a={...r};for(const l in r){const o=e[l],u=r[l];/^on[A-Z]/.test(l)?o&&u?a[l]=(...f)=>{const h=u(...f);return o(...f),h}:o&&(a[l]=o):l==="style"?a[l]={...o,...u}:l==="className"&&(a[l]=[o,u].filter(Boolean).join(" "))}return{...e,...a}}function YC(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var VC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=VC.reduce((e,r)=>{const a=Gl(`Primitive.${r}`),l=S.forwardRef((o,u)=>{const{asChild:d,...f}=o,h=d?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(h,{...f,ref:u})});return l.displayName=`Primitive.${r}`,{...e,[r]:l}},{});function u0(e,r){e&&Xh.flushSync(()=>e.dispatchEvent(r))}var KC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),XC="VisuallyHidden",d0=S.forwardRef((e,r)=>s.jsx(We.span,{...e,ref:r,style:{...KC,...e.style}}));d0.displayName=XC;var QC=d0;function ZC(e,r){const a=S.createContext(r),l=u=>{const{children:d,...f}=u,h=S.useMemo(()=>f,Object.values(f));return s.jsx(a.Provider,{value:h,children:d})};l.displayName=e+"Provider";function o(u){const d=S.useContext(a);if(d)return d;if(r!==void 0)return r;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[l,o]}function cr(e,r=[]){let a=[];function l(u,d){const f=S.createContext(d),h=a.length;a=[...a,d];const p=g=>{const{scope:v,children:b,...k}=g,C=v?.[e]?.[h]||f,N=S.useMemo(()=>k,Object.values(k));return s.jsx(C.Provider,{value:N,children:b})};p.displayName=u+"Provider";function y(g,v){const b=v?.[e]?.[h]||f,k=S.useContext(b);if(k)return k;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${u}\``)}return[p,y]}const o=()=>{const u=a.map(d=>S.createContext(d));return function(f){const h=f?.[e]||u;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return o.scopeName=e,[l,JC(o,...r)]}function JC(...e){const r=e[0];if(e.length===1)return r;const a=()=>{const l=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=l.reduce((f,{useScope:h,scopeName:p})=>{const g=h(u)[`__scope${p}`];return{...f,...g}},{});return S.useMemo(()=>({[`__scope${r.scopeName}`]:d}),[d])}};return a.scopeName=r.scopeName,a}function f0(e){const r=e+"CollectionProvider",[a,l]=cr(r),[o,u]=a(r,{collectionRef:{current:null},itemMap:new Map}),d=C=>{const{scope:N,children:j}=C,R=da.useRef(null),M=da.useRef(new Map).current;return s.jsx(o,{scope:N,itemMap:M,collectionRef:R,children:j})};d.displayName=r;const f=e+"CollectionSlot",h=Gl(f),p=da.forwardRef((C,N)=>{const{scope:j,children:R}=C,M=u(f,j),O=bt(N,M.collectionRef);return s.jsx(h,{ref:O,children:R})});p.displayName=f;const y=e+"CollectionItemSlot",g="data-radix-collection-item",v=Gl(y),b=da.forwardRef((C,N)=>{const{scope:j,children:R,...M}=C,O=da.useRef(null),L=bt(N,O),D=u(y,j);return da.useEffect(()=>(D.itemMap.set(O,{ref:O,...M}),()=>{D.itemMap.delete(O)})),s.jsx(v,{[g]:"",ref:L,children:R})});b.displayName=y;function k(C){const N=u(e+"CollectionConsumer",C);return da.useCallback(()=>{const R=N.collectionRef.current;if(!R)return[];const M=Array.from(R.querySelectorAll(`[${g}]`));return Array.from(N.itemMap.values()).sort((D,I)=>M.indexOf(D.ref.current)-M.indexOf(I.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:d,Slot:p,ItemSlot:b},k,l]}function Te(e,r,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return r?.(o)}}var Hn=globalThis?.document?S.useLayoutEffect:()=>{},WC=l0[" useInsertionEffect ".trim().toString()]||Hn;function bs({prop:e,defaultProp:r,onChange:a=()=>{},caller:l}){const[o,u,d]=eN({defaultProp:r,onChange:a}),f=e!==void 0,h=f?e:o;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${l} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,l])}const p=S.useCallback(y=>{if(f){const g=tN(y)?y(e):y;g!==e&&d.current?.(g)}else u(y)},[f,e,u,d]);return[h,p]}function eN({defaultProp:e,onChange:r}){const[a,l]=S.useState(e),o=S.useRef(a),u=S.useRef(r);return WC(()=>{u.current=r},[r]),S.useEffect(()=>{o.current!==a&&(u.current?.(a),o.current=a)},[a,o]),[a,l,u]}function tN(e){return typeof e=="function"}function nN(e,r){return S.useReducer((a,l)=>r[a][l]??a,e)}var an=e=>{const{present:r,children:a}=e,l=rN(r),o=typeof a=="function"?a({present:l.isPresent}):S.Children.only(a),u=bt(l.ref,aN(o));return typeof a=="function"||l.isPresent?S.cloneElement(o,{ref:u}):null};an.displayName="Presence";function rN(e){const[r,a]=S.useState(),l=S.useRef(null),o=S.useRef(e),u=S.useRef("none"),d=e?"mounted":"unmounted",[f,h]=nN(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const p=Qo(l.current);u.current=f==="mounted"?p:"none"},[f]),Hn(()=>{const p=l.current,y=o.current;if(y!==e){const v=u.current,b=Qo(p);e?h("MOUNT"):b==="none"||p?.display==="none"?h("UNMOUNT"):h(y&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),Hn(()=>{if(r){let p;const y=r.ownerDocument.defaultView??window,g=b=>{const C=Qo(l.current).includes(CSS.escape(b.animationName));if(b.target===r&&C&&(h("ANIMATION_END"),!o.current)){const N=r.style.animationFillMode;r.style.animationFillMode="forwards",p=y.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=N)})}},v=b=>{b.target===r&&(u.current=Qo(l.current))};return r.addEventListener("animationstart",v),r.addEventListener("animationcancel",g),r.addEventListener("animationend",g),()=>{y.clearTimeout(p),r.removeEventListener("animationstart",v),r.removeEventListener("animationcancel",g),r.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[r,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(p=>{l.current=p?getComputedStyle(p):null,a(p)},[])}}function Qo(e){return e?.animationName||"none"}function aN(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var lN=l0[" useId ".trim().toString()]||(()=>{}),iN=0;function ma(e){const[r,a]=S.useState(lN());return Hn(()=>{a(l=>l??String(iN++))},[e]),e||(r?`radix-${r}`:"")}var sN=S.createContext(void 0);function Ic(e){const r=S.useContext(sN);return e||r||"ltr"}function Kt(e){const r=S.useRef(e);return S.useEffect(()=>{r.current=e}),S.useMemo(()=>(...a)=>r.current?.(...a),[])}function oN(e,r=globalThis?.document){const a=Kt(e);S.useEffect(()=>{const l=o=>{o.key==="Escape"&&a(o)};return r.addEventListener("keydown",l,{capture:!0}),()=>r.removeEventListener("keydown",l,{capture:!0})},[a,r])}var cN="DismissableLayer",yh="dismissableLayer.update",uN="dismissableLayer.pointerDownOutside",dN="dismissableLayer.focusOutside",xv,h0=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bc=S.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:l,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...h}=e,p=S.useContext(h0),[y,g]=S.useState(null),v=y?.ownerDocument??globalThis?.document,[,b]=S.useState({}),k=bt(r,I=>g(I)),C=Array.from(p.layers),[N]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),j=C.indexOf(N),R=y?C.indexOf(y):-1,M=p.layersWithOutsidePointerEventsDisabled.size>0,O=R>=j,L=mN(I=>{const B=I.target,V=[...p.branches].some(P=>P.contains(B));!O||V||(o?.(I),d?.(I),I.defaultPrevented||f?.())},v),D=pN(I=>{const B=I.target;[...p.branches].some(P=>P.contains(B))||(u?.(I),d?.(I),I.defaultPrevented||f?.())},v);return oN(I=>{R===p.layers.size-1&&(l?.(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},v),S.useEffect(()=>{if(y)return a&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(xv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),yv(),()=>{a&&p.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=xv)}},[y,v,a,p]),S.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),yv())},[y,p]),S.useEffect(()=>{const I=()=>b({});return document.addEventListener(yh,I),()=>document.removeEventListener(yh,I)},[]),s.jsx(We.div,{...h,ref:k,style:{pointerEvents:M?O?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,L.onPointerDownCapture)})});Bc.displayName=cN;var fN="DismissableLayerBranch",hN=S.forwardRef((e,r)=>{const a=S.useContext(h0),l=S.useRef(null),o=bt(r,l);return S.useEffect(()=>{const u=l.current;if(u)return a.branches.add(u),()=>{a.branches.delete(u)}},[a.branches]),s.jsx(We.div,{...e,ref:o})});hN.displayName=fN;function mN(e,r=globalThis?.document){const a=Kt(e),l=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const u=f=>{if(f.target&&!l.current){let h=function(){m0(uN,a,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(r.removeEventListener("click",o.current),o.current=h,r.addEventListener("click",o.current,{once:!0})):h()}else r.removeEventListener("click",o.current);l.current=!1},d=window.setTimeout(()=>{r.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),r.removeEventListener("pointerdown",u),r.removeEventListener("click",o.current)}},[r,a]),{onPointerDownCapture:()=>l.current=!0}}function pN(e,r=globalThis?.document){const a=Kt(e),l=S.useRef(!1);return S.useEffect(()=>{const o=u=>{u.target&&!l.current&&m0(dN,a,{originalEvent:u},{discrete:!1})};return r.addEventListener("focusin",o),()=>r.removeEventListener("focusin",o)},[r,a]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function yv(){const e=new CustomEvent(yh);document.dispatchEvent(e)}function m0(e,r,a,{discrete:l}){const o=a.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});r&&o.addEventListener(e,r,{once:!0}),l?u0(o,u):o.dispatchEvent(u)}var zf="focusScope.autoFocusOnMount",Lf="focusScope.autoFocusOnUnmount",vv={bubbles:!1,cancelable:!0},gN="FocusScope",Qh=S.forwardRef((e,r)=>{const{loop:a=!1,trapped:l=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=e,[f,h]=S.useState(null),p=Kt(o),y=Kt(u),g=S.useRef(null),v=bt(r,C=>h(C)),b=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(l){let C=function(M){if(b.paused||!f)return;const O=M.target;f.contains(O)?g.current=O:fa(g.current,{select:!0})},N=function(M){if(b.paused||!f)return;const O=M.relatedTarget;O!==null&&(f.contains(O)||fa(g.current,{select:!0}))},j=function(M){if(document.activeElement===document.body)for(const L of M)L.removedNodes.length>0&&fa(f)};document.addEventListener("focusin",C),document.addEventListener("focusout",N);const R=new MutationObserver(j);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",N),R.disconnect()}}},[l,f,b.paused]),S.useEffect(()=>{if(f){Sv.add(b);const C=document.activeElement;if(!f.contains(C)){const j=new CustomEvent(zf,vv);f.addEventListener(zf,p),f.dispatchEvent(j),j.defaultPrevented||(xN(wN(p0(f)),{select:!0}),document.activeElement===C&&fa(f))}return()=>{f.removeEventListener(zf,p),setTimeout(()=>{const j=new CustomEvent(Lf,vv);f.addEventListener(Lf,y),f.dispatchEvent(j),j.defaultPrevented||fa(C??document.body,{select:!0}),f.removeEventListener(Lf,y),Sv.remove(b)},0)}}},[f,p,y,b]);const k=S.useCallback(C=>{if(!a&&!l||b.paused)return;const N=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,j=document.activeElement;if(N&&j){const R=C.currentTarget,[M,O]=yN(R);M&&O?!C.shiftKey&&j===O?(C.preventDefault(),a&&fa(M,{select:!0})):C.shiftKey&&j===M&&(C.preventDefault(),a&&fa(O,{select:!0})):j===R&&C.preventDefault()}},[a,l,b.paused]);return s.jsx(We.div,{tabIndex:-1,...d,ref:v,onKeyDown:k})});Qh.displayName=gN;function xN(e,{select:r=!1}={}){const a=document.activeElement;for(const l of e)if(fa(l,{select:r}),document.activeElement!==a)return}function yN(e){const r=p0(e),a=bv(r,e),l=bv(r.reverse(),e);return[a,l]}function p0(e){const r=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const o=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||o?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)r.push(a.currentNode);return r}function bv(e,r){for(const a of e)if(!vN(a,{upTo:r}))return a}function vN(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function bN(e){return e instanceof HTMLInputElement&&"select"in e}function fa(e,{select:r=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&bN(e)&&r&&e.select()}}var Sv=SN();function SN(){let e=[];return{add(r){const a=e[0];r!==a&&a?.pause(),e=wv(e,r),e.unshift(r)},remove(r){e=wv(e,r),e[0]?.resume()}}}function wv(e,r){const a=[...e],l=a.indexOf(r);return l!==-1&&a.splice(l,1),a}function wN(e){return e.filter(r=>r.tagName!=="A")}var kN="Portal",Hc=S.forwardRef((e,r)=>{const{container:a,...l}=e,[o,u]=S.useState(!1);Hn(()=>u(!0),[]);const d=a||o&&globalThis?.document?.body;return d?HC.createPortal(s.jsx(We.div,{...l,ref:r}),d):null});Hc.displayName=kN;var Pf=0;function g0(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kv()),document.body.insertAdjacentElement("beforeend",e[1]??kv()),Pf++,()=>{Pf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Pf--}},[])}function kv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ar=function(){return ar=Object.assign||function(r){for(var a,l=1,o=arguments.length;l<o;l++){a=arguments[l];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},ar.apply(this,arguments)};function x0(e,r){var a={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&r.indexOf(l)<0&&(a[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(e);o<l.length;o++)r.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(a[l[o]]=e[l[o]]);return a}function jN(e,r,a){if(a||arguments.length===2)for(var l=0,o=r.length,u;l<o;l++)(u||!(l in r))&&(u||(u=Array.prototype.slice.call(r,0,l)),u[l]=r[l]);return e.concat(u||Array.prototype.slice.call(r))}var uc="right-scroll-bar-position",dc="width-before-scroll-bar",CN="with-scroll-bars-hidden",NN="--removed-body-scroll-bar-size";function Uf(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function EN(e,r){var a=S.useState(function(){return{value:e,callback:r,facade:{get current(){return a.value},set current(l){var o=a.value;o!==l&&(a.value=l,a.callback(l,o))}}}})[0];return a.callback=r,a.facade}var AN=typeof window<"u"?S.useLayoutEffect:S.useEffect,jv=new WeakMap;function _N(e,r){var a=EN(null,function(l){return e.forEach(function(o){return Uf(o,l)})});return AN(function(){var l=jv.get(a);if(l){var o=new Set(l),u=new Set(e),d=a.current;o.forEach(function(f){u.has(f)||Uf(f,null)}),u.forEach(function(f){o.has(f)||Uf(f,d)})}jv.set(a,e)},[e]),a}function TN(e){return e}function RN(e,r){r===void 0&&(r=TN);var a=[],l=!1,o={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(u){var d=r(u,l);return a.push(d),function(){a=a.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(l=!0;a.length;){var d=a;a=[],d.forEach(u)}a={push:function(f){return u(f)},filter:function(){return a}}},assignMedium:function(u){l=!0;var d=[];if(a.length){var f=a;a=[],f.forEach(u),d=a}var h=function(){var y=d;d=[],y.forEach(u)},p=function(){return Promise.resolve().then(h)};p(),a={push:function(y){d.push(y),p()},filter:function(y){return d=d.filter(y),a}}}};return o}function MN(e){e===void 0&&(e={});var r=RN(null);return r.options=ar({async:!0,ssr:!1},e),r}var y0=function(e){var r=e.sideCar,a=x0(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=r.read();if(!l)throw new Error("Sidecar medium not found");return S.createElement(l,ar({},a))};y0.isSideCarExport=!0;function ON(e,r){return e.useMedium(r),y0}var v0=MN(),If=function(){},qc=S.forwardRef(function(e,r){var a=S.useRef(null),l=S.useState({onScrollCapture:If,onWheelCapture:If,onTouchMoveCapture:If}),o=l[0],u=l[1],d=e.forwardProps,f=e.children,h=e.className,p=e.removeScrollBar,y=e.enabled,g=e.shards,v=e.sideCar,b=e.noRelative,k=e.noIsolation,C=e.inert,N=e.allowPinchZoom,j=e.as,R=j===void 0?"div":j,M=e.gapMode,O=x0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=v,D=_N([a,r]),I=ar(ar({},O),o);return S.createElement(S.Fragment,null,y&&S.createElement(L,{sideCar:v0,removeScrollBar:p,shards:g,noRelative:b,noIsolation:k,inert:C,setCallbacks:u,allowPinchZoom:!!N,lockRef:a,gapMode:M}),d?S.cloneElement(S.Children.only(f),ar(ar({},I),{ref:D})):S.createElement(R,ar({},I,{className:h,ref:D}),f))});qc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qc.classNames={fullWidth:dc,zeroRight:uc};var DN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=DN();return r&&e.setAttribute("nonce",r),e}function LN(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function PN(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var UN=function(){var e=0,r=null;return{add:function(a){e==0&&(r=zN())&&(LN(r,a),PN(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},IN=function(){var e=UN();return function(r,a){S.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&a])}},b0=function(){var e=IN(),r=function(a){var l=a.styles,o=a.dynamic;return e(l,o),null};return r},BN={left:0,top:0,right:0,gap:0},Bf=function(e){return parseInt(e||"",10)||0},HN=function(e){var r=window.getComputedStyle(document.body),a=r[e==="padding"?"paddingLeft":"marginLeft"],l=r[e==="padding"?"paddingTop":"marginTop"],o=r[e==="padding"?"paddingRight":"marginRight"];return[Bf(a),Bf(l),Bf(o)]},qN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BN;var r=HN(e),a=document.documentElement.clientWidth,l=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,l-a+r[2]-r[0])}},FN=b0(),Il="data-scroll-locked",GN=function(e,r,a,l){var o=e.left,u=e.top,d=e.right,f=e.gap;return a===void 0&&(a="margin"),`
10
+ .`.concat(CN,` {
11
+ overflow: hidden `).concat(l,`;
12
+ padding-right: `).concat(f,"px ").concat(l,`;
13
+ }
14
+ body[`).concat(Il,`] {
15
+ overflow: hidden `).concat(l,`;
16
+ overscroll-behavior: contain;
17
+ `).concat([r&&"position: relative ".concat(l,";"),a==="margin"&&`
18
+ padding-left: `.concat(o,`px;
19
+ padding-top: `).concat(u,`px;
20
+ padding-right: `).concat(d,`px;
21
+ margin-left:0;
22
+ margin-top:0;
23
+ margin-right: `).concat(f,"px ").concat(l,`;
24
+ `),a==="padding"&&"padding-right: ".concat(f,"px ").concat(l,";")].filter(Boolean).join(""),`
25
+ }
26
+
27
+ .`).concat(uc,` {
28
+ right: `).concat(f,"px ").concat(l,`;
29
+ }
30
+
31
+ .`).concat(dc,` {
32
+ margin-right: `).concat(f,"px ").concat(l,`;
33
+ }
34
+
35
+ .`).concat(uc," .").concat(uc,` {
36
+ right: 0 `).concat(l,`;
37
+ }
38
+
39
+ .`).concat(dc," .").concat(dc,` {
40
+ margin-right: 0 `).concat(l,`;
41
+ }
42
+
43
+ body[`).concat(Il,`] {
44
+ `).concat(NN,": ").concat(f,`px;
45
+ }
46
+ `)},Cv=function(){var e=parseInt(document.body.getAttribute(Il)||"0",10);return isFinite(e)?e:0},$N=function(){S.useEffect(function(){return document.body.setAttribute(Il,(Cv()+1).toString()),function(){var e=Cv()-1;e<=0?document.body.removeAttribute(Il):document.body.setAttribute(Il,e.toString())}},[])},YN=function(e){var r=e.noRelative,a=e.noImportant,l=e.gapMode,o=l===void 0?"margin":l;$N();var u=S.useMemo(function(){return qN(o)},[o]);return S.createElement(FN,{styles:GN(u,!r,o,a?"":"!important")})},vh=!1;if(typeof window<"u")try{var Zo=Object.defineProperty({},"passive",{get:function(){return vh=!0,!0}});window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{vh=!1}var Ol=vh?{passive:!1}:!1,VN=function(e){return e.tagName==="TEXTAREA"},S0=function(e,r){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[r]!=="hidden"&&!(a.overflowY===a.overflowX&&!VN(e)&&a[r]==="visible")},KN=function(e){return S0(e,"overflowY")},XN=function(e){return S0(e,"overflowX")},Nv=function(e,r){var a=r.ownerDocument,l=r;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var o=w0(e,l);if(o){var u=k0(e,l),d=u[1],f=u[2];if(d>f)return!0}l=l.parentNode}while(l&&l!==a.body);return!1},QN=function(e){var r=e.scrollTop,a=e.scrollHeight,l=e.clientHeight;return[r,a,l]},ZN=function(e){var r=e.scrollLeft,a=e.scrollWidth,l=e.clientWidth;return[r,a,l]},w0=function(e,r){return e==="v"?KN(r):XN(r)},k0=function(e,r){return e==="v"?QN(r):ZN(r)},JN=function(e,r){return e==="h"&&r==="rtl"?-1:1},WN=function(e,r,a,l,o){var u=JN(e,window.getComputedStyle(r).direction),d=u*l,f=a.target,h=r.contains(f),p=!1,y=d>0,g=0,v=0;do{if(!f)break;var b=k0(e,f),k=b[0],C=b[1],N=b[2],j=C-N-u*k;(k||j)&&w0(e,f)&&(g+=j,v+=k);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!h&&f!==document.body||h&&(r.contains(f)||r===f));return(y&&Math.abs(g)<1||!y&&Math.abs(v)<1)&&(p=!0),p},Jo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ev=function(e){return[e.deltaX,e.deltaY]},Av=function(e){return e&&"current"in e?e.current:e},eE=function(e,r){return e[0]===r[0]&&e[1]===r[1]},tE=function(e){return`
47
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
48
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
+ `)},nE=0,Dl=[];function rE(e){var r=S.useRef([]),a=S.useRef([0,0]),l=S.useRef(),o=S.useState(nE++)[0],u=S.useState(b0)[0],d=S.useRef(e);S.useEffect(function(){d.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var C=jN([e.lockRef.current],(e.shards||[]).map(Av),!0).filter(Boolean);return C.forEach(function(N){return N.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),C.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=S.useCallback(function(C,N){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!d.current.allowPinchZoom;var j=Jo(C),R=a.current,M="deltaX"in C?C.deltaX:R[0]-j[0],O="deltaY"in C?C.deltaY:R[1]-j[1],L,D=C.target,I=Math.abs(M)>Math.abs(O)?"h":"v";if("touches"in C&&I==="h"&&D.type==="range")return!1;var B=window.getSelection(),V=B&&B.anchorNode,P=V?V===D||V.contains(D):!1;if(P)return!1;var ee=Nv(I,D);if(!ee)return!0;if(ee?L=I:(L=I==="v"?"h":"v",ee=Nv(I,D)),!ee)return!1;if(!l.current&&"changedTouches"in C&&(M||O)&&(l.current=L),!L)return!0;var te=l.current||L;return WN(te,N,C,te==="h"?M:O)},[]),h=S.useCallback(function(C){var N=C;if(!(!Dl.length||Dl[Dl.length-1]!==u)){var j="deltaY"in N?Ev(N):Jo(N),R=r.current.filter(function(L){return L.name===N.type&&(L.target===N.target||N.target===L.shadowParent)&&eE(L.delta,j)})[0];if(R&&R.should){N.cancelable&&N.preventDefault();return}if(!R){var M=(d.current.shards||[]).map(Av).filter(Boolean).filter(function(L){return L.contains(N.target)}),O=M.length>0?f(N,M[0]):!d.current.noIsolation;O&&N.cancelable&&N.preventDefault()}}},[]),p=S.useCallback(function(C,N,j,R){var M={name:C,delta:N,target:j,should:R,shadowParent:aE(j)};r.current.push(M),setTimeout(function(){r.current=r.current.filter(function(O){return O!==M})},1)},[]),y=S.useCallback(function(C){a.current=Jo(C),l.current=void 0},[]),g=S.useCallback(function(C){p(C.type,Ev(C),C.target,f(C,e.lockRef.current))},[]),v=S.useCallback(function(C){p(C.type,Jo(C),C.target,f(C,e.lockRef.current))},[]);S.useEffect(function(){return Dl.push(u),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Ol),document.addEventListener("touchmove",h,Ol),document.addEventListener("touchstart",y,Ol),function(){Dl=Dl.filter(function(C){return C!==u}),document.removeEventListener("wheel",h,Ol),document.removeEventListener("touchmove",h,Ol),document.removeEventListener("touchstart",y,Ol)}},[]);var b=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(u,{styles:tE(o)}):null,b?S.createElement(YN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aE(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const lE=ON(v0,rE);var Zh=S.forwardRef(function(e,r){return S.createElement(qc,ar({},e,{ref:r,sideCar:lE}))});Zh.classNames=qc.classNames;var iE=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},zl=new WeakMap,Wo=new WeakMap,ec={},Hf=0,j0=function(e){return e&&(e.host||j0(e.parentNode))},sE=function(e,r){return r.map(function(a){if(e.contains(a))return a;var l=j0(a);return l&&e.contains(l)?l:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},oE=function(e,r,a,l){var o=sE(r,Array.isArray(e)?e:[e]);ec[a]||(ec[a]=new WeakMap);var u=ec[a],d=[],f=new Set,h=new Set(o),p=function(g){!g||f.has(g)||(f.add(g),p(g.parentNode))};o.forEach(p);var y=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(v){if(f.has(v))y(v);else try{var b=v.getAttribute(l),k=b!==null&&b!=="false",C=(zl.get(v)||0)+1,N=(u.get(v)||0)+1;zl.set(v,C),u.set(v,N),d.push(v),C===1&&k&&Wo.set(v,!0),N===1&&v.setAttribute(a,"true"),k||v.setAttribute(l,"true")}catch(j){console.error("aria-hidden: cannot operate on ",v,j)}})};return y(r),f.clear(),Hf++,function(){d.forEach(function(g){var v=zl.get(g)-1,b=u.get(g)-1;zl.set(g,v),u.set(g,b),v||(Wo.has(g)||g.removeAttribute(l),Wo.delete(g)),b||g.removeAttribute(a)}),Hf--,Hf||(zl=new WeakMap,zl=new WeakMap,Wo=new WeakMap,ec={})}},C0=function(e,r,a){a===void 0&&(a="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),o=iE(e);return o?(l.push.apply(l,Array.from(o.querySelectorAll("[aria-live], script"))),oE(l,o,a,"aria-hidden")):function(){return null}},Fc="Dialog",[N0]=cr(Fc),[cE,Zn]=N0(Fc),E0=e=>{const{__scopeDialog:r,children:a,open:l,defaultOpen:o,onOpenChange:u,modal:d=!0}=e,f=S.useRef(null),h=S.useRef(null),[p,y]=bs({prop:l,defaultProp:o??!1,onChange:u,caller:Fc});return s.jsx(cE,{scope:r,triggerRef:f,contentRef:h,contentId:ma(),titleId:ma(),descriptionId:ma(),open:p,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(g=>!g),[y]),modal:d,children:a})};E0.displayName=Fc;var A0="DialogTrigger",uE=S.forwardRef((e,r)=>{const{__scopeDialog:a,...l}=e,o=Zn(A0,a),u=bt(r,o.triggerRef);return s.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":em(o.open),...l,ref:u,onClick:Te(e.onClick,o.onOpenToggle)})});uE.displayName=A0;var Jh="DialogPortal",[dE,_0]=N0(Jh,{forceMount:void 0}),T0=e=>{const{__scopeDialog:r,forceMount:a,children:l,container:o}=e,u=Zn(Jh,r);return s.jsx(dE,{scope:r,forceMount:a,children:S.Children.map(l,d=>s.jsx(an,{present:a||u.open,children:s.jsx(Hc,{asChild:!0,container:o,children:d})}))})};T0.displayName=Jh;var gc="DialogOverlay",R0=S.forwardRef((e,r)=>{const a=_0(gc,e.__scopeDialog),{forceMount:l=a.forceMount,...o}=e,u=Zn(gc,e.__scopeDialog);return u.modal?s.jsx(an,{present:l||u.open,children:s.jsx(hE,{...o,ref:r})}):null});R0.displayName=gc;var fE=Gl("DialogOverlay.RemoveScroll"),hE=S.forwardRef((e,r)=>{const{__scopeDialog:a,...l}=e,o=Zn(gc,a);return s.jsx(Zh,{as:fE,allowPinchZoom:!0,shards:[o.contentRef],children:s.jsx(We.div,{"data-state":em(o.open),...l,ref:r,style:{pointerEvents:"auto",...l.style}})})}),Ha="DialogContent",M0=S.forwardRef((e,r)=>{const a=_0(Ha,e.__scopeDialog),{forceMount:l=a.forceMount,...o}=e,u=Zn(Ha,e.__scopeDialog);return s.jsx(an,{present:l||u.open,children:u.modal?s.jsx(mE,{...o,ref:r}):s.jsx(pE,{...o,ref:r})})});M0.displayName=Ha;var mE=S.forwardRef((e,r)=>{const a=Zn(Ha,e.__scopeDialog),l=S.useRef(null),o=bt(r,a.contentRef,l);return S.useEffect(()=>{const u=l.current;if(u)return C0(u)},[]),s.jsx(O0,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&u.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,u=>u.preventDefault())})}),pE=S.forwardRef((e,r)=>{const a=Zn(Ha,e.__scopeDialog),l=S.useRef(!1),o=S.useRef(!1);return s.jsx(O0,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(l.current||a.triggerRef.current?.focus(),u.preventDefault()),l.current=!1,o.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(l.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),O0=S.forwardRef((e,r)=>{const{__scopeDialog:a,trapFocus:l,onOpenAutoFocus:o,onCloseAutoFocus:u,...d}=e,f=Zn(Ha,a),h=S.useRef(null),p=bt(r,h);return g0(),s.jsxs(s.Fragment,{children:[s.jsx(Qh,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:o,onUnmountAutoFocus:u,children:s.jsx(Bc,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":em(f.open),...d,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(gE,{titleId:f.titleId}),s.jsx(yE,{contentRef:h,descriptionId:f.descriptionId})]})]})}),Wh="DialogTitle",D0=S.forwardRef((e,r)=>{const{__scopeDialog:a,...l}=e,o=Zn(Wh,a);return s.jsx(We.h2,{id:o.titleId,...l,ref:r})});D0.displayName=Wh;var z0="DialogDescription",L0=S.forwardRef((e,r)=>{const{__scopeDialog:a,...l}=e,o=Zn(z0,a);return s.jsx(We.p,{id:o.descriptionId,...l,ref:r})});L0.displayName=z0;var P0="DialogClose",U0=S.forwardRef((e,r)=>{const{__scopeDialog:a,...l}=e,o=Zn(P0,a);return s.jsx(We.button,{type:"button",...l,ref:r,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});U0.displayName=P0;function em(e){return e?"open":"closed"}var I0="DialogTitleWarning",[LU,B0]=ZC(I0,{contentName:Ha,titleName:Wh,docsSlug:"dialog"}),gE=({titleId:e})=>{const r=B0(I0),a=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
50
+
51
+ If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
52
+
53
+ For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},xE="DialogDescriptionWarning",yE=({contentRef:e,descriptionId:r})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B0(xE).contentName}}.`;return S.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");r&&o&&(document.getElementById(r)||console.warn(l))},[l,e,r]),null},H0=E0,q0=T0,F0=R0,G0=M0,$0=D0,Y0=L0,V0=U0,qf={exports:{}},Ff={};var _v;function vE(){if(_v)return Ff;_v=1;var e=zc();function r(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var a=typeof Object.is=="function"?Object.is:r,l=e.useState,o=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue;function f(g,v){var b=v(),k=l({inst:{value:b,getSnapshot:v}}),C=k[0].inst,N=k[1];return u(function(){C.value=b,C.getSnapshot=v,h(C)&&N({inst:C})},[g,b,v]),o(function(){return h(C)&&N({inst:C}),g(function(){h(C)&&N({inst:C})})},[g]),d(b),b}function h(g){var v=g.getSnapshot;g=g.value;try{var b=v();return!a(g,b)}catch{return!0}}function p(g,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Ff.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Ff}var Tv;function bE(){return Tv||(Tv=1,qf.exports=vE()),qf.exports}var SE=bE();function wE(){return SE.useSyncExternalStore(kE,()=>!0,()=>!1)}function kE(){return()=>{}}var tm="Avatar",[jE]=cr(tm),[CE,K0]=jE(tm),X0=S.forwardRef((e,r)=>{const{__scopeAvatar:a,...l}=e,[o,u]=S.useState("idle");return s.jsx(CE,{scope:a,imageLoadingStatus:o,onImageLoadingStatusChange:u,children:s.jsx(We.span,{...l,ref:r})})});X0.displayName=tm;var Q0="AvatarImage",NE=S.forwardRef((e,r)=>{const{__scopeAvatar:a,src:l,onLoadingStatusChange:o=()=>{},...u}=e,d=K0(Q0,a),f=EE(l,u),h=Kt(p=>{o(p),d.onImageLoadingStatusChange(p)});return Hn(()=>{f!=="idle"&&h(f)},[f,h]),f==="loaded"?s.jsx(We.img,{...u,ref:r,src:l}):null});NE.displayName=Q0;var Z0="AvatarFallback",J0=S.forwardRef((e,r)=>{const{__scopeAvatar:a,delayMs:l,...o}=e,u=K0(Z0,a),[d,f]=S.useState(l===void 0);return S.useEffect(()=>{if(l!==void 0){const h=window.setTimeout(()=>f(!0),l);return()=>window.clearTimeout(h)}},[l]),d&&u.imageLoadingStatus!=="loaded"?s.jsx(We.span,{...o,ref:r}):null});J0.displayName=Z0;function Rv(e,r){return e?r?(e.src!==r&&(e.src=r),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function EE(e,{referrerPolicy:r,crossOrigin:a}){const l=wE(),o=S.useRef(null),u=l?(o.current||(o.current=new window.Image),o.current):null,[d,f]=S.useState(()=>Rv(u,e));return Hn(()=>{f(Rv(u,e))},[u,e]),Hn(()=>{const h=g=>()=>{f(g)};if(!u)return;const p=h("loaded"),y=h("error");return u.addEventListener("load",p),u.addEventListener("error",y),r&&(u.referrerPolicy=r),typeof a=="string"&&(u.crossOrigin=a),()=>{u.removeEventListener("load",p),u.removeEventListener("error",y)}},[u,a,r]),d}var AE=X0,_E=J0;function TE(e){const[r,a]=S.useState(void 0);return Hn(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const l=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let d,f;if("borderBoxSize"in u){const h=u.borderBoxSize,p=Array.isArray(h)?h[0]:h;d=p.inlineSize,f=p.blockSize}else d=e.offsetWidth,f=e.offsetHeight;a({width:d,height:f})});return l.observe(e,{box:"border-box"}),()=>l.unobserve(e)}else a(void 0)},[e]),r}const RE=["top","right","bottom","left"],ga=Math.min,Nn=Math.max,xc=Math.round,tc=Math.floor,ir=e=>({x:e,y:e}),ME={left:"right",right:"left",bottom:"top",top:"bottom"},OE={start:"end",end:"start"};function bh(e,r,a){return Nn(e,ga(r,a))}function Or(e,r){return typeof e=="function"?e(r):e}function Dr(e){return e.split("-")[0]}function ni(e){return e.split("-")[1]}function nm(e){return e==="x"?"y":"x"}function rm(e){return e==="y"?"height":"width"}const DE=new Set(["top","bottom"]);function lr(e){return DE.has(Dr(e))?"y":"x"}function am(e){return nm(lr(e))}function zE(e,r,a){a===void 0&&(a=!1);const l=ni(e),o=am(e),u=rm(o);let d=o==="x"?l===(a?"end":"start")?"right":"left":l==="start"?"bottom":"top";return r.reference[u]>r.floating[u]&&(d=yc(d)),[d,yc(d)]}function LE(e){const r=yc(e);return[Sh(e),r,Sh(r)]}function Sh(e){return e.replace(/start|end/g,r=>OE[r])}const Mv=["left","right"],Ov=["right","left"],PE=["top","bottom"],UE=["bottom","top"];function IE(e,r,a){switch(e){case"top":case"bottom":return a?r?Ov:Mv:r?Mv:Ov;case"left":case"right":return r?PE:UE;default:return[]}}function BE(e,r,a,l){const o=ni(e);let u=IE(Dr(e),a==="start",l);return o&&(u=u.map(d=>d+"-"+o),r&&(u=u.concat(u.map(Sh)))),u}function yc(e){return e.replace(/left|right|bottom|top/g,r=>ME[r])}function HE(e){return{top:0,right:0,bottom:0,left:0,...e}}function W0(e){return typeof e!="number"?HE(e):{top:e,right:e,bottom:e,left:e}}function vc(e){const{x:r,y:a,width:l,height:o}=e;return{width:l,height:o,top:a,left:r,right:r+l,bottom:a+o,x:r,y:a}}function Dv(e,r,a){let{reference:l,floating:o}=e;const u=lr(r),d=am(r),f=rm(d),h=Dr(r),p=u==="y",y=l.x+l.width/2-o.width/2,g=l.y+l.height/2-o.height/2,v=l[f]/2-o[f]/2;let b;switch(h){case"top":b={x:y,y:l.y-o.height};break;case"bottom":b={x:y,y:l.y+l.height};break;case"right":b={x:l.x+l.width,y:g};break;case"left":b={x:l.x-o.width,y:g};break;default:b={x:l.x,y:l.y}}switch(ni(r)){case"start":b[d]-=v*(a&&p?-1:1);break;case"end":b[d]+=v*(a&&p?-1:1);break}return b}async function qE(e,r){var a;r===void 0&&(r={});const{x:l,y:o,platform:u,rects:d,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=Or(r,e),k=W0(b),N=f[v?g==="floating"?"reference":"floating":g],j=vc(await u.getClippingRect({element:(a=await(u.isElement==null?void 0:u.isElement(N)))==null||a?N:N.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:p,rootBoundary:y,strategy:h})),R=g==="floating"?{x:l,y:o,width:d.floating.width,height:d.floating.height}:d.reference,M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),O=await(u.isElement==null?void 0:u.isElement(M))?await(u.getScale==null?void 0:u.getScale(M))||{x:1,y:1}:{x:1,y:1},L=vc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:R,offsetParent:M,strategy:h}):R);return{top:(j.top-L.top+k.top)/O.y,bottom:(L.bottom-j.bottom+k.bottom)/O.y,left:(j.left-L.left+k.left)/O.x,right:(L.right-j.right+k.right)/O.x}}const FE=async(e,r,a)=>{const{placement:l="bottom",strategy:o="absolute",middleware:u=[],platform:d}=a,f=u.filter(Boolean),h=await(d.isRTL==null?void 0:d.isRTL(r));let p=await d.getElementRects({reference:e,floating:r,strategy:o}),{x:y,y:g}=Dv(p,l,h),v=l,b={},k=0;for(let N=0;N<f.length;N++){var C;const{name:j,fn:R}=f[N],{x:M,y:O,data:L,reset:D}=await R({x:y,y:g,initialPlacement:l,placement:v,strategy:o,middlewareData:b,rects:p,platform:{...d,detectOverflow:(C=d.detectOverflow)!=null?C:qE},elements:{reference:e,floating:r}});y=M??y,g=O??g,b={...b,[j]:{...b[j],...L}},D&&k<=50&&(k++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(p=D.rects===!0?await d.getElementRects({reference:e,floating:r,strategy:o}):D.rects),{x:y,y:g}=Dv(p,v,h)),N=-1)}return{x:y,y:g,placement:v,strategy:o,middlewareData:b}},GE=e=>({name:"arrow",options:e,async fn(r){const{x:a,y:l,placement:o,rects:u,platform:d,elements:f,middlewareData:h}=r,{element:p,padding:y=0}=Or(e,r)||{};if(p==null)return{};const g=W0(y),v={x:a,y:l},b=am(o),k=rm(b),C=await d.getDimensions(p),N=b==="y",j=N?"top":"left",R=N?"bottom":"right",M=N?"clientHeight":"clientWidth",O=u.reference[k]+u.reference[b]-v[b]-u.floating[k],L=v[b]-u.reference[b],D=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let I=D?D[M]:0;(!I||!await(d.isElement==null?void 0:d.isElement(D)))&&(I=f.floating[M]||u.floating[k]);const B=O/2-L/2,V=I/2-C[k]/2-1,P=ga(g[j],V),ee=ga(g[R],V),te=P,ce=I-C[k]-ee,ae=I/2-C[k]/2+B,q=bh(te,ae,ce),z=!h.arrow&&ni(o)!=null&&ae!==q&&u.reference[k]/2-(ae<te?P:ee)-C[k]/2<0,F=z?ae<te?ae-te:ae-ce:0;return{[b]:v[b]+F,data:{[b]:q,centerOffset:ae-q-F,...z&&{alignmentOffset:F}},reset:z}}}),$E=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(r){var a,l;const{placement:o,middlewareData:u,rects:d,initialPlacement:f,platform:h,elements:p}=r,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:C=!0,...N}=Or(e,r);if((a=u.arrow)!=null&&a.alignmentOffset)return{};const j=Dr(o),R=lr(f),M=Dr(f)===f,O=await(h.isRTL==null?void 0:h.isRTL(p.floating)),L=v||(M||!C?[yc(f)]:LE(f)),D=k!=="none";!v&&D&&L.push(...BE(f,C,k,O));const I=[f,...L],B=await h.detectOverflow(r,N),V=[];let P=((l=u.flip)==null?void 0:l.overflows)||[];if(y&&V.push(B[j]),g){const ae=zE(o,d,O);V.push(B[ae[0]],B[ae[1]])}if(P=[...P,{placement:o,overflows:V}],!V.every(ae=>ae<=0)){var ee,te;const ae=(((ee=u.flip)==null?void 0:ee.index)||0)+1,q=I[ae];if(q&&(!(g==="alignment"?R!==lr(q):!1)||P.every(J=>lr(J.placement)===R?J.overflows[0]>0:!0)))return{data:{index:ae,overflows:P},reset:{placement:q}};let z=(te=P.filter(F=>F.overflows[0]<=0).sort((F,J)=>F.overflows[1]-J.overflows[1])[0])==null?void 0:te.placement;if(!z)switch(b){case"bestFit":{var ce;const F=(ce=P.filter(J=>{if(D){const Y=lr(J.placement);return Y===R||Y==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(Y=>Y>0).reduce((Y,A)=>Y+A,0)]).sort((J,Y)=>J[1]-Y[1])[0])==null?void 0:ce[0];F&&(z=F);break}case"initialPlacement":z=f;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function zv(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function Lv(e){return RE.some(r=>e[r]>=0)}const YE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:a,platform:l}=r,{strategy:o="referenceHidden",...u}=Or(e,r);switch(o){case"referenceHidden":{const d=await l.detectOverflow(r,{...u,elementContext:"reference"}),f=zv(d,a.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Lv(f)}}}case"escaped":{const d=await l.detectOverflow(r,{...u,altBoundary:!0}),f=zv(d,a.floating);return{data:{escapedOffsets:f,escaped:Lv(f)}}}default:return{}}}}},e1=new Set(["left","top"]);async function VE(e,r){const{placement:a,platform:l,elements:o}=e,u=await(l.isRTL==null?void 0:l.isRTL(o.floating)),d=Dr(a),f=ni(a),h=lr(a)==="y",p=e1.has(d)?-1:1,y=u&&h?-1:1,g=Or(r,e);let{mainAxis:v,crossAxis:b,alignmentAxis:k}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof k=="number"&&(b=f==="end"?k*-1:k),h?{x:b*y,y:v*p}:{x:v*p,y:b*y}}const KE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var a,l;const{x:o,y:u,placement:d,middlewareData:f}=r,h=await VE(r,e);return d===((a=f.offset)==null?void 0:a.placement)&&(l=f.arrow)!=null&&l.alignmentOffset?{}:{x:o+h.x,y:u+h.y,data:{...h,placement:d}}}}},XE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:a,y:l,placement:o,platform:u}=r,{mainAxis:d=!0,crossAxis:f=!1,limiter:h={fn:j=>{let{x:R,y:M}=j;return{x:R,y:M}}},...p}=Or(e,r),y={x:a,y:l},g=await u.detectOverflow(r,p),v=lr(Dr(o)),b=nm(v);let k=y[b],C=y[v];if(d){const j=b==="y"?"top":"left",R=b==="y"?"bottom":"right",M=k+g[j],O=k-g[R];k=bh(M,k,O)}if(f){const j=v==="y"?"top":"left",R=v==="y"?"bottom":"right",M=C+g[j],O=C-g[R];C=bh(M,C,O)}const N=h.fn({...r,[b]:k,[v]:C});return{...N,data:{x:N.x-a,y:N.y-l,enabled:{[b]:d,[v]:f}}}}}},QE=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:a,y:l,placement:o,rects:u,middlewareData:d}=r,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=Or(e,r),y={x:a,y:l},g=lr(o),v=nm(g);let b=y[v],k=y[g];const C=Or(f,r),N=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const M=v==="y"?"height":"width",O=u.reference[v]-u.floating[M]+N.mainAxis,L=u.reference[v]+u.reference[M]-N.mainAxis;b<O?b=O:b>L&&(b=L)}if(p){var j,R;const M=v==="y"?"width":"height",O=e1.has(Dr(o)),L=u.reference[g]-u.floating[M]+(O&&((j=d.offset)==null?void 0:j[g])||0)+(O?0:N.crossAxis),D=u.reference[g]+u.reference[M]+(O?0:((R=d.offset)==null?void 0:R[g])||0)-(O?N.crossAxis:0);k<L?k=L:k>D&&(k=D)}return{[v]:b,[g]:k}}}},ZE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var a,l;const{placement:o,rects:u,platform:d,elements:f}=r,{apply:h=()=>{},...p}=Or(e,r),y=await d.detectOverflow(r,p),g=Dr(o),v=ni(o),b=lr(o)==="y",{width:k,height:C}=u.floating;let N,j;g==="top"||g==="bottom"?(N=g,j=v===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(j=g,N=v==="end"?"top":"bottom");const R=C-y.top-y.bottom,M=k-y.left-y.right,O=ga(C-y[N],R),L=ga(k-y[j],M),D=!r.middlewareData.shift;let I=O,B=L;if((a=r.middlewareData.shift)!=null&&a.enabled.x&&(B=M),(l=r.middlewareData.shift)!=null&&l.enabled.y&&(I=R),D&&!v){const P=Nn(y.left,0),ee=Nn(y.right,0),te=Nn(y.top,0),ce=Nn(y.bottom,0);b?B=k-2*(P!==0||ee!==0?P+ee:Nn(y.left,y.right)):I=C-2*(te!==0||ce!==0?te+ce:Nn(y.top,y.bottom))}await h({...r,availableWidth:B,availableHeight:I});const V=await d.getDimensions(f.floating);return k!==V.width||C!==V.height?{reset:{rects:!0}}:{}}}};function Gc(){return typeof window<"u"}function ri(e){return t1(e)?(e.nodeName||"").toLowerCase():"#document"}function En(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function ur(e){var r;return(r=(t1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function t1(e){return Gc()?e instanceof Node||e instanceof En(e).Node:!1}function Xn(e){return Gc()?e instanceof Element||e instanceof En(e).Element:!1}function sr(e){return Gc()?e instanceof HTMLElement||e instanceof En(e).HTMLElement:!1}function Pv(e){return!Gc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof En(e).ShadowRoot}const JE=new Set(["inline","contents"]);function Ss(e){const{overflow:r,overflowX:a,overflowY:l,display:o}=Qn(e);return/auto|scroll|overlay|hidden|clip/.test(r+l+a)&&!JE.has(o)}const WE=new Set(["table","td","th"]);function eA(e){return WE.has(ri(e))}const tA=[":popover-open",":modal"];function $c(e){return tA.some(r=>{try{return e.matches(r)}catch{return!1}})}const nA=["transform","translate","scale","rotate","perspective"],rA=["transform","translate","scale","rotate","perspective","filter"],aA=["paint","layout","strict","content"];function lm(e){const r=im(),a=Xn(e)?Qn(e):e;return nA.some(l=>a[l]?a[l]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!r&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!r&&(a.filter?a.filter!=="none":!1)||rA.some(l=>(a.willChange||"").includes(l))||aA.some(l=>(a.contain||"").includes(l))}function lA(e){let r=xa(e);for(;sr(r)&&!$l(r);){if(lm(r))return r;if($c(r))return null;r=xa(r)}return null}function im(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const iA=new Set(["html","body","#document"]);function $l(e){return iA.has(ri(e))}function Qn(e){return En(e).getComputedStyle(e)}function Yc(e){return Xn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xa(e){if(ri(e)==="html")return e;const r=e.assignedSlot||e.parentNode||Pv(e)&&e.host||ur(e);return Pv(r)?r.host:r}function n1(e){const r=xa(e);return $l(r)?e.ownerDocument?e.ownerDocument.body:e.body:sr(r)&&Ss(r)?r:n1(r)}function ms(e,r,a){var l;r===void 0&&(r=[]),a===void 0&&(a=!0);const o=n1(e),u=o===((l=e.ownerDocument)==null?void 0:l.body),d=En(o);if(u){const f=wh(d);return r.concat(d,d.visualViewport||[],Ss(o)?o:[],f&&a?ms(f):[])}return r.concat(o,ms(o,[],a))}function wh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function r1(e){const r=Qn(e);let a=parseFloat(r.width)||0,l=parseFloat(r.height)||0;const o=sr(e),u=o?e.offsetWidth:a,d=o?e.offsetHeight:l,f=xc(a)!==u||xc(l)!==d;return f&&(a=u,l=d),{width:a,height:l,$:f}}function sm(e){return Xn(e)?e:e.contextElement}function Bl(e){const r=sm(e);if(!sr(r))return ir(1);const a=r.getBoundingClientRect(),{width:l,height:o,$:u}=r1(r);let d=(u?xc(a.width):a.width)/l,f=(u?xc(a.height):a.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const sA=ir(0);function a1(e){const r=En(e);return!im()||!r.visualViewport?sA:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function oA(e,r,a){return r===void 0&&(r=!1),!a||r&&a!==En(e)?!1:r}function qa(e,r,a,l){r===void 0&&(r=!1),a===void 0&&(a=!1);const o=e.getBoundingClientRect(),u=sm(e);let d=ir(1);r&&(l?Xn(l)&&(d=Bl(l)):d=Bl(e));const f=oA(u,a,l)?a1(u):ir(0);let h=(o.left+f.x)/d.x,p=(o.top+f.y)/d.y,y=o.width/d.x,g=o.height/d.y;if(u){const v=En(u),b=l&&Xn(l)?En(l):l;let k=v,C=wh(k);for(;C&&l&&b!==k;){const N=Bl(C),j=C.getBoundingClientRect(),R=Qn(C),M=j.left+(C.clientLeft+parseFloat(R.paddingLeft))*N.x,O=j.top+(C.clientTop+parseFloat(R.paddingTop))*N.y;h*=N.x,p*=N.y,y*=N.x,g*=N.y,h+=M,p+=O,k=En(C),C=wh(k)}}return vc({width:y,height:g,x:h,y:p})}function Vc(e,r){const a=Yc(e).scrollLeft;return r?r.left+a:qa(ur(e)).left+a}function l1(e,r){const a=e.getBoundingClientRect(),l=a.left+r.scrollLeft-Vc(e,a),o=a.top+r.scrollTop;return{x:l,y:o}}function cA(e){let{elements:r,rect:a,offsetParent:l,strategy:o}=e;const u=o==="fixed",d=ur(l),f=r?$c(r.floating):!1;if(l===d||f&&u)return a;let h={scrollLeft:0,scrollTop:0},p=ir(1);const y=ir(0),g=sr(l);if((g||!g&&!u)&&((ri(l)!=="body"||Ss(d))&&(h=Yc(l)),sr(l))){const b=qa(l);p=Bl(l),y.x=b.x+l.clientLeft,y.y=b.y+l.clientTop}const v=d&&!g&&!u?l1(d,h):ir(0);return{width:a.width*p.x,height:a.height*p.y,x:a.x*p.x-h.scrollLeft*p.x+y.x+v.x,y:a.y*p.y-h.scrollTop*p.y+y.y+v.y}}function uA(e){return Array.from(e.getClientRects())}function dA(e){const r=ur(e),a=Yc(e),l=e.ownerDocument.body,o=Nn(r.scrollWidth,r.clientWidth,l.scrollWidth,l.clientWidth),u=Nn(r.scrollHeight,r.clientHeight,l.scrollHeight,l.clientHeight);let d=-a.scrollLeft+Vc(e);const f=-a.scrollTop;return Qn(l).direction==="rtl"&&(d+=Nn(r.clientWidth,l.clientWidth)-o),{width:o,height:u,x:d,y:f}}const Uv=25;function fA(e,r){const a=En(e),l=ur(e),o=a.visualViewport;let u=l.clientWidth,d=l.clientHeight,f=0,h=0;if(o){u=o.width,d=o.height;const y=im();(!y||y&&r==="fixed")&&(f=o.offsetLeft,h=o.offsetTop)}const p=Vc(l);if(p<=0){const y=l.ownerDocument,g=y.body,v=getComputedStyle(g),b=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(l.clientWidth-g.clientWidth-b);k<=Uv&&(u-=k)}else p<=Uv&&(u+=p);return{width:u,height:d,x:f,y:h}}const hA=new Set(["absolute","fixed"]);function mA(e,r){const a=qa(e,!0,r==="fixed"),l=a.top+e.clientTop,o=a.left+e.clientLeft,u=sr(e)?Bl(e):ir(1),d=e.clientWidth*u.x,f=e.clientHeight*u.y,h=o*u.x,p=l*u.y;return{width:d,height:f,x:h,y:p}}function Iv(e,r,a){let l;if(r==="viewport")l=fA(e,a);else if(r==="document")l=dA(ur(e));else if(Xn(r))l=mA(r,a);else{const o=a1(e);l={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return vc(l)}function i1(e,r){const a=xa(e);return a===r||!Xn(a)||$l(a)?!1:Qn(a).position==="fixed"||i1(a,r)}function pA(e,r){const a=r.get(e);if(a)return a;let l=ms(e,[],!1).filter(f=>Xn(f)&&ri(f)!=="body"),o=null;const u=Qn(e).position==="fixed";let d=u?xa(e):e;for(;Xn(d)&&!$l(d);){const f=Qn(d),h=lm(d);!h&&f.position==="fixed"&&(o=null),(u?!h&&!o:!h&&f.position==="static"&&!!o&&hA.has(o.position)||Ss(d)&&!h&&i1(e,d))?l=l.filter(y=>y!==d):o=f,d=xa(d)}return r.set(e,l),l}function gA(e){let{element:r,boundary:a,rootBoundary:l,strategy:o}=e;const d=[...a==="clippingAncestors"?$c(r)?[]:pA(r,this._c):[].concat(a),l],f=d[0],h=d.reduce((p,y)=>{const g=Iv(r,y,o);return p.top=Nn(g.top,p.top),p.right=ga(g.right,p.right),p.bottom=ga(g.bottom,p.bottom),p.left=Nn(g.left,p.left),p},Iv(r,f,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function xA(e){const{width:r,height:a}=r1(e);return{width:r,height:a}}function yA(e,r,a){const l=sr(r),o=ur(r),u=a==="fixed",d=qa(e,!0,u,r);let f={scrollLeft:0,scrollTop:0};const h=ir(0);function p(){h.x=Vc(o)}if(l||!l&&!u)if((ri(r)!=="body"||Ss(o))&&(f=Yc(r)),l){const b=qa(r,!0,u,r);h.x=b.x+r.clientLeft,h.y=b.y+r.clientTop}else o&&p();u&&!l&&o&&p();const y=o&&!l&&!u?l1(o,f):ir(0),g=d.left+f.scrollLeft-h.x-y.x,v=d.top+f.scrollTop-h.y-y.y;return{x:g,y:v,width:d.width,height:d.height}}function Gf(e){return Qn(e).position==="static"}function Bv(e,r){if(!sr(e)||Qn(e).position==="fixed")return null;if(r)return r(e);let a=e.offsetParent;return ur(e)===a&&(a=a.ownerDocument.body),a}function s1(e,r){const a=En(e);if($c(e))return a;if(!sr(e)){let o=xa(e);for(;o&&!$l(o);){if(Xn(o)&&!Gf(o))return o;o=xa(o)}return a}let l=Bv(e,r);for(;l&&eA(l)&&Gf(l);)l=Bv(l,r);return l&&$l(l)&&Gf(l)&&!lm(l)?a:l||lA(e)||a}const vA=async function(e){const r=this.getOffsetParent||s1,a=this.getDimensions,l=await a(e.floating);return{reference:yA(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function bA(e){return Qn(e).direction==="rtl"}const SA={convertOffsetParentRelativeRectToViewportRelativeRect:cA,getDocumentElement:ur,getClippingRect:gA,getOffsetParent:s1,getElementRects:vA,getClientRects:uA,getDimensions:xA,getScale:Bl,isElement:Xn,isRTL:bA};function o1(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function wA(e,r){let a=null,l;const o=ur(e);function u(){var f;clearTimeout(l),(f=a)==null||f.disconnect(),a=null}function d(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),u();const p=e.getBoundingClientRect(),{left:y,top:g,width:v,height:b}=p;if(f||r(),!v||!b)return;const k=tc(g),C=tc(o.clientWidth-(y+v)),N=tc(o.clientHeight-(g+b)),j=tc(y),M={rootMargin:-k+"px "+-C+"px "+-N+"px "+-j+"px",threshold:Nn(0,ga(1,h))||1};let O=!0;function L(D){const I=D[0].intersectionRatio;if(I!==h){if(!O)return d();I?d(!1,I):l=setTimeout(()=>{d(!1,1e-7)},1e3)}I===1&&!o1(p,e.getBoundingClientRect())&&d(),O=!1}try{a=new IntersectionObserver(L,{...M,root:o.ownerDocument})}catch{a=new IntersectionObserver(L,M)}a.observe(e)}return d(!0),u}function kA(e,r,a,l){l===void 0&&(l={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=l,p=sm(e),y=o||u?[...p?ms(p):[],...ms(r)]:[];y.forEach(j=>{o&&j.addEventListener("scroll",a,{passive:!0}),u&&j.addEventListener("resize",a)});const g=p&&f?wA(p,a):null;let v=-1,b=null;d&&(b=new ResizeObserver(j=>{let[R]=j;R&&R.target===p&&b&&(b.unobserve(r),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var M;(M=b)==null||M.observe(r)})),a()}),p&&!h&&b.observe(p),b.observe(r));let k,C=h?qa(e):null;h&&N();function N(){const j=qa(e);C&&!o1(C,j)&&a(),C=j,k=requestAnimationFrame(N)}return a(),()=>{var j;y.forEach(R=>{o&&R.removeEventListener("scroll",a),u&&R.removeEventListener("resize",a)}),g?.(),(j=b)==null||j.disconnect(),b=null,h&&cancelAnimationFrame(k)}}const jA=KE,CA=XE,NA=$E,EA=ZE,AA=YE,Hv=GE,_A=QE,TA=(e,r,a)=>{const l=new Map,o={platform:SA,...a},u={...o.platform,_c:l};return FE(e,r,{...o,platform:u})};var RA=typeof document<"u",MA=function(){},fc=RA?S.useLayoutEffect:MA;function bc(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let a,l,o;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==r.length)return!1;for(l=a;l--!==0;)if(!bc(e[l],r[l]))return!1;return!0}if(o=Object.keys(e),a=o.length,a!==Object.keys(r).length)return!1;for(l=a;l--!==0;)if(!{}.hasOwnProperty.call(r,o[l]))return!1;for(l=a;l--!==0;){const u=o[l];if(!(u==="_owner"&&e.$$typeof)&&!bc(e[u],r[u]))return!1}return!0}return e!==e&&r!==r}function c1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qv(e,r){const a=c1(e);return Math.round(r*a)/a}function $f(e){const r=S.useRef(e);return fc(()=>{r.current=e}),r}function OA(e){e===void 0&&(e={});const{placement:r="bottom",strategy:a="absolute",middleware:l=[],platform:o,elements:{reference:u,floating:d}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[y,g]=S.useState({x:0,y:0,strategy:a,placement:r,middlewareData:{},isPositioned:!1}),[v,b]=S.useState(l);bc(v,l)||b(l);const[k,C]=S.useState(null),[N,j]=S.useState(null),R=S.useCallback(J=>{J!==D.current&&(D.current=J,C(J))},[]),M=S.useCallback(J=>{J!==I.current&&(I.current=J,j(J))},[]),O=u||k,L=d||N,D=S.useRef(null),I=S.useRef(null),B=S.useRef(y),V=h!=null,P=$f(h),ee=$f(o),te=$f(p),ce=S.useCallback(()=>{if(!D.current||!I.current)return;const J={placement:r,strategy:a,middleware:v};ee.current&&(J.platform=ee.current),TA(D.current,I.current,J).then(Y=>{const A={...Y,isPositioned:te.current!==!1};ae.current&&!bc(B.current,A)&&(B.current=A,Xh.flushSync(()=>{g(A)}))})},[v,r,a,ee,te]);fc(()=>{p===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,g(J=>({...J,isPositioned:!1})))},[p]);const ae=S.useRef(!1);fc(()=>(ae.current=!0,()=>{ae.current=!1}),[]),fc(()=>{if(O&&(D.current=O),L&&(I.current=L),O&&L){if(P.current)return P.current(O,L,ce);ce()}},[O,L,ce,P,V]);const q=S.useMemo(()=>({reference:D,floating:I,setReference:R,setFloating:M}),[R,M]),z=S.useMemo(()=>({reference:O,floating:L}),[O,L]),F=S.useMemo(()=>{const J={position:a,left:0,top:0};if(!z.floating)return J;const Y=qv(z.floating,y.x),A=qv(z.floating,y.y);return f?{...J,transform:"translate("+Y+"px, "+A+"px)",...c1(z.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Y,top:A}},[a,f,z.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:ce,refs:q,elements:z,floatingStyles:F}),[y,ce,q,z,F])}const DA=e=>{function r(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:l,padding:o}=typeof e=="function"?e(a):e;return l&&r(l)?l.current!=null?Hv({element:l.current,padding:o}).fn(a):{}:l?Hv({element:l,padding:o}).fn(a):{}}}},zA=(e,r)=>({...jA(e),options:[e,r]}),LA=(e,r)=>({...CA(e),options:[e,r]}),PA=(e,r)=>({..._A(e),options:[e,r]}),UA=(e,r)=>({...NA(e),options:[e,r]}),IA=(e,r)=>({...EA(e),options:[e,r]}),BA=(e,r)=>({...AA(e),options:[e,r]}),HA=(e,r)=>({...DA(e),options:[e,r]});var qA="Arrow",u1=S.forwardRef((e,r)=>{const{children:a,width:l=10,height:o=5,...u}=e;return s.jsx(We.svg,{...u,ref:r,width:l,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});u1.displayName=qA;var FA=u1,om="Popper",[d1,Kc]=cr(om),[GA,f1]=d1(om),h1=e=>{const{__scopePopper:r,children:a}=e,[l,o]=S.useState(null);return s.jsx(GA,{scope:r,anchor:l,onAnchorChange:o,children:a})};h1.displayName=om;var m1="PopperAnchor",p1=S.forwardRef((e,r)=>{const{__scopePopper:a,virtualRef:l,...o}=e,u=f1(m1,a),d=S.useRef(null),f=bt(r,d),h=S.useRef(null);return S.useEffect(()=>{const p=h.current;h.current=l?.current||d.current,p!==h.current&&u.onAnchorChange(h.current)}),l?null:s.jsx(We.div,{...o,ref:f})});p1.displayName=m1;var cm="PopperContent",[$A,YA]=d1(cm),g1=S.forwardRef((e,r)=>{const{__scopePopper:a,side:l="bottom",sideOffset:o=0,align:u="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:k,...C}=e,N=f1(cm,a),[j,R]=S.useState(null),M=bt(r,ge=>R(ge)),[O,L]=S.useState(null),D=TE(O),I=D?.width??0,B=D?.height??0,V=l+(u!=="center"?"-"+u:""),P=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ee=Array.isArray(p)?p:[p],te=ee.length>0,ce={padding:P,boundary:ee.filter(KA),altBoundary:te},{refs:ae,floatingStyles:q,placement:z,isPositioned:F,middlewareData:J}=OA({strategy:"fixed",placement:V,whileElementsMounted:(...ge)=>kA(...ge,{animationFrame:b==="always"}),elements:{reference:N.anchor},middleware:[zA({mainAxis:o+B,alignmentAxis:d}),h&&LA({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?PA():void 0,...ce}),h&&UA({...ce}),IA({...ce,apply:({elements:ge,rects:ze,availableWidth:Ee,availableHeight:pe})=>{const{width:Oe,height:De}=ze.reference,Ue=ge.floating.style;Ue.setProperty("--radix-popper-available-width",`${Ee}px`),Ue.setProperty("--radix-popper-available-height",`${pe}px`),Ue.setProperty("--radix-popper-anchor-width",`${Oe}px`),Ue.setProperty("--radix-popper-anchor-height",`${De}px`)}}),O&&HA({element:O,padding:f}),XA({arrowWidth:I,arrowHeight:B}),v&&BA({strategy:"referenceHidden",...ce})]}),[Y,A]=v1(z),_=Kt(k);Hn(()=>{F&&_?.()},[F,_]);const G=J.arrow?.x,T=J.arrow?.y,oe=J.arrow?.centerOffset!==0,[me,fe]=S.useState();return Hn(()=>{j&&fe(window.getComputedStyle(j).zIndex)},[j]),s.jsx("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:F?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[J.transformOrigin?.x,J.transformOrigin?.y].join(" "),...J.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx($A,{scope:a,placedSide:Y,onArrowChange:L,arrowX:G,arrowY:T,shouldHideArrow:oe,children:s.jsx(We.div,{"data-side":Y,"data-align":A,...C,ref:M,style:{...C.style,animation:F?void 0:"none"}})})})});g1.displayName=cm;var x1="PopperArrow",VA={top:"bottom",right:"left",bottom:"top",left:"right"},y1=S.forwardRef(function(r,a){const{__scopePopper:l,...o}=r,u=YA(x1,l),d=VA[u.placedSide];return s.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:s.jsx(FA,{...o,ref:a,style:{...o.style,display:"block"}})})});y1.displayName=x1;function KA(e){return e!==null}var XA=e=>({name:"transformOrigin",options:e,fn(r){const{placement:a,rects:l,middlewareData:o}=r,d=o.arrow?.centerOffset!==0,f=d?0:e.arrowWidth,h=d?0:e.arrowHeight,[p,y]=v1(a),g={start:"0%",center:"50%",end:"100%"}[y],v=(o.arrow?.x??0)+f/2,b=(o.arrow?.y??0)+h/2;let k="",C="";return p==="bottom"?(k=d?g:`${v}px`,C=`${-h}px`):p==="top"?(k=d?g:`${v}px`,C=`${l.floating.height+h}px`):p==="right"?(k=`${-h}px`,C=d?g:`${b}px`):p==="left"&&(k=`${l.floating.width+h}px`,C=d?g:`${b}px`),{data:{x:k,y:C}}}});function v1(e){const[r,a="center"]=e.split("-");return[r,a]}var b1=h1,S1=p1,w1=g1,k1=y1,Yf="rovingFocusGroup.onEntryFocus",QA={bubbles:!1,cancelable:!0},ws="RovingFocusGroup",[kh,j1,ZA]=f0(ws),[JA,Xc]=cr(ws,[ZA]),[WA,e_]=JA(ws),C1=S.forwardRef((e,r)=>s.jsx(kh.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(kh.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(t_,{...e,ref:r})})}));C1.displayName=ws;var t_=S.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,orientation:l,loop:o=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:y=!1,...g}=e,v=S.useRef(null),b=bt(r,v),k=Ic(u),[C,N]=bs({prop:d,defaultProp:f??null,onChange:h,caller:ws}),[j,R]=S.useState(!1),M=Kt(p),O=j1(a),L=S.useRef(!1),[D,I]=S.useState(0);return S.useEffect(()=>{const B=v.current;if(B)return B.addEventListener(Yf,M),()=>B.removeEventListener(Yf,M)},[M]),s.jsx(WA,{scope:a,orientation:l,dir:k,loop:o,currentTabStopId:C,onItemFocus:S.useCallback(B=>N(B),[N]),onItemShiftTab:S.useCallback(()=>R(!0),[]),onFocusableItemAdd:S.useCallback(()=>I(B=>B+1),[]),onFocusableItemRemove:S.useCallback(()=>I(B=>B-1),[]),children:s.jsx(We.div,{tabIndex:j||D===0?-1:0,"data-orientation":l,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{L.current=!0}),onFocus:Te(e.onFocus,B=>{const V=!L.current;if(B.target===B.currentTarget&&V&&!j){const P=new CustomEvent(Yf,QA);if(B.currentTarget.dispatchEvent(P),!P.defaultPrevented){const ee=O().filter(z=>z.focusable),te=ee.find(z=>z.active),ce=ee.find(z=>z.id===C),q=[te,ce,...ee].filter(Boolean).map(z=>z.ref.current);A1(q,y)}}L.current=!1}),onBlur:Te(e.onBlur,()=>R(!1))})})}),N1="RovingFocusGroupItem",E1=S.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,focusable:l=!0,active:o=!1,tabStopId:u,children:d,...f}=e,h=ma(),p=u||h,y=e_(N1,a),g=y.currentTabStopId===p,v=j1(a),{onFocusableItemAdd:b,onFocusableItemRemove:k,currentTabStopId:C}=y;return S.useEffect(()=>{if(l)return b(),()=>k()},[l,b,k]),s.jsx(kh.ItemSlot,{scope:a,id:p,focusable:l,active:o,children:s.jsx(We.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...f,ref:r,onMouseDown:Te(e.onMouseDown,N=>{l?y.onItemFocus(p):N.preventDefault()}),onFocus:Te(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:Te(e.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){y.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const j=a_(N,y.orientation,y.dir);if(j!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let M=v().filter(O=>O.focusable).map(O=>O.ref.current);if(j==="last")M.reverse();else if(j==="prev"||j==="next"){j==="prev"&&M.reverse();const O=M.indexOf(N.currentTarget);M=y.loop?l_(M,O+1):M.slice(O+1)}setTimeout(()=>A1(M))}}),children:typeof d=="function"?d({isCurrentTabStop:g,hasTabStop:C!=null}):d})})});E1.displayName=N1;var n_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function r_(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function a_(e,r,a){const l=r_(e.key,a);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return n_[l]}function A1(e,r=!1){const a=document.activeElement;for(const l of e)if(l===a||(l.focus({preventScroll:r}),document.activeElement!==a))return}function l_(e,r){return e.map((a,l)=>e[(r+l)%e.length])}var _1=C1,T1=E1,jh=["Enter"," "],i_=["ArrowDown","PageUp","Home"],R1=["ArrowUp","PageDown","End"],s_=[...i_,...R1],o_={ltr:[...jh,"ArrowRight"],rtl:[...jh,"ArrowLeft"]},c_={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ks="Menu",[ps,u_,d_]=f0(ks),[Ga,M1]=cr(ks,[d_,Kc,Xc]),Qc=Kc(),O1=Xc(),[f_,$a]=Ga(ks),[h_,js]=Ga(ks),D1=e=>{const{__scopeMenu:r,open:a=!1,children:l,dir:o,onOpenChange:u,modal:d=!0}=e,f=Qc(r),[h,p]=S.useState(null),y=S.useRef(!1),g=Kt(u),v=Ic(o);return S.useEffect(()=>{const b=()=>{y.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>y.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),s.jsx(b1,{...f,children:s.jsx(f_,{scope:r,open:a,onOpenChange:g,content:h,onContentChange:p,children:s.jsx(h_,{scope:r,onClose:S.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:y,dir:v,modal:d,children:l})})})};D1.displayName=ks;var m_="MenuAnchor",um=S.forwardRef((e,r)=>{const{__scopeMenu:a,...l}=e,o=Qc(a);return s.jsx(S1,{...o,...l,ref:r})});um.displayName=m_;var dm="MenuPortal",[p_,z1]=Ga(dm,{forceMount:void 0}),L1=e=>{const{__scopeMenu:r,forceMount:a,children:l,container:o}=e,u=$a(dm,r);return s.jsx(p_,{scope:r,forceMount:a,children:s.jsx(an,{present:a||u.open,children:s.jsx(Hc,{asChild:!0,container:o,children:l})})})};L1.displayName=dm;var Bn="MenuContent",[g_,fm]=Ga(Bn),P1=S.forwardRef((e,r)=>{const a=z1(Bn,e.__scopeMenu),{forceMount:l=a.forceMount,...o}=e,u=$a(Bn,e.__scopeMenu),d=js(Bn,e.__scopeMenu);return s.jsx(ps.Provider,{scope:e.__scopeMenu,children:s.jsx(an,{present:l||u.open,children:s.jsx(ps.Slot,{scope:e.__scopeMenu,children:d.modal?s.jsx(x_,{...o,ref:r}):s.jsx(y_,{...o,ref:r})})})})}),x_=S.forwardRef((e,r)=>{const a=$a(Bn,e.__scopeMenu),l=S.useRef(null),o=bt(r,l);return S.useEffect(()=>{const u=l.current;if(u)return C0(u)},[]),s.jsx(hm,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),y_=S.forwardRef((e,r)=>{const a=$a(Bn,e.__scopeMenu);return s.jsx(hm,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),v_=Gl("MenuContent.ScrollLock"),hm=S.forwardRef((e,r)=>{const{__scopeMenu:a,loop:l=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:v,onDismiss:b,disableOutsideScroll:k,...C}=e,N=$a(Bn,a),j=js(Bn,a),R=Qc(a),M=O1(a),O=u_(a),[L,D]=S.useState(null),I=S.useRef(null),B=bt(r,I,N.onContentChange),V=S.useRef(0),P=S.useRef(""),ee=S.useRef(0),te=S.useRef(null),ce=S.useRef("right"),ae=S.useRef(0),q=k?Zh:S.Fragment,z=k?{as:v_,allowPinchZoom:!0}:void 0,F=Y=>{const A=P.current+Y,_=O().filter(ge=>!ge.disabled),G=document.activeElement,T=_.find(ge=>ge.ref.current===G)?.textValue,oe=_.map(ge=>ge.textValue),me=R_(oe,A,T),fe=_.find(ge=>ge.textValue===me)?.ref.current;(function ge(ze){P.current=ze,window.clearTimeout(V.current),ze!==""&&(V.current=window.setTimeout(()=>ge(""),1e3))})(A),fe&&setTimeout(()=>fe.focus())};S.useEffect(()=>()=>window.clearTimeout(V.current),[]),g0();const J=S.useCallback(Y=>ce.current===te.current?.side&&O_(Y,te.current?.area),[]);return s.jsx(g_,{scope:a,searchRef:P,onItemEnter:S.useCallback(Y=>{J(Y)&&Y.preventDefault()},[J]),onItemLeave:S.useCallback(Y=>{J(Y)||(I.current?.focus(),D(null))},[J]),onTriggerLeave:S.useCallback(Y=>{J(Y)&&Y.preventDefault()},[J]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:S.useCallback(Y=>{te.current=Y},[]),children:s.jsx(q,{...z,children:s.jsx(Qh,{asChild:!0,trapped:o,onMountAutoFocus:Te(u,Y=>{Y.preventDefault(),I.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:s.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:v,onDismiss:b,children:s.jsx(_1,{asChild:!0,...M,dir:j.dir,orientation:"vertical",loop:l,currentTabStopId:L,onCurrentTabStopIdChange:D,onEntryFocus:Te(h,Y=>{j.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(w1,{role:"menu","aria-orientation":"vertical","data-state":W1(N.open),"data-radix-menu-content":"",dir:j.dir,...R,...C,ref:B,style:{outline:"none",...C.style},onKeyDown:Te(C.onKeyDown,Y=>{const _=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,G=Y.ctrlKey||Y.altKey||Y.metaKey,T=Y.key.length===1;_&&(Y.key==="Tab"&&Y.preventDefault(),!G&&T&&F(Y.key));const oe=I.current;if(Y.target!==oe||!s_.includes(Y.key))return;Y.preventDefault();const fe=O().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);R1.includes(Y.key)&&fe.reverse(),__(fe)}),onBlur:Te(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(V.current),P.current="")}),onPointerMove:Te(e.onPointerMove,gs(Y=>{const A=Y.target,_=ae.current!==Y.clientX;if(Y.currentTarget.contains(A)&&_){const G=Y.clientX>ae.current?"right":"left";ce.current=G,ae.current=Y.clientX}}))})})})})})})});P1.displayName=Bn;var b_="MenuGroup",mm=S.forwardRef((e,r)=>{const{__scopeMenu:a,...l}=e;return s.jsx(We.div,{role:"group",...l,ref:r})});mm.displayName=b_;var S_="MenuLabel",U1=S.forwardRef((e,r)=>{const{__scopeMenu:a,...l}=e;return s.jsx(We.div,{...l,ref:r})});U1.displayName=S_;var Sc="MenuItem",Fv="menu.itemSelect",Zc=S.forwardRef((e,r)=>{const{disabled:a=!1,onSelect:l,...o}=e,u=S.useRef(null),d=js(Sc,e.__scopeMenu),f=fm(Sc,e.__scopeMenu),h=bt(r,u),p=S.useRef(!1),y=()=>{const g=u.current;if(!a&&g){const v=new CustomEvent(Fv,{bubbles:!0,cancelable:!0});g.addEventListener(Fv,b=>l?.(b),{once:!0}),u0(g,v),v.defaultPrevented?p.current=!1:d.onClose()}};return s.jsx(I1,{...o,ref:h,disabled:a,onClick:Te(e.onClick,y),onPointerDown:g=>{e.onPointerDown?.(g),p.current=!0},onPointerUp:Te(e.onPointerUp,g=>{p.current||g.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,g=>{const v=f.searchRef.current!=="";a||v&&g.key===" "||jh.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});Zc.displayName=Sc;var I1=S.forwardRef((e,r)=>{const{__scopeMenu:a,disabled:l=!1,textValue:o,...u}=e,d=fm(Sc,a),f=O1(a),h=S.useRef(null),p=bt(r,h),[y,g]=S.useState(!1),[v,b]=S.useState("");return S.useEffect(()=>{const k=h.current;k&&b((k.textContent??"").trim())},[u.children]),s.jsx(ps.ItemSlot,{scope:a,disabled:l,textValue:o??v,children:s.jsx(T1,{asChild:!0,...f,focusable:!l,children:s.jsx(We.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":l||void 0,"data-disabled":l?"":void 0,...u,ref:p,onPointerMove:Te(e.onPointerMove,gs(k=>{l?d.onItemLeave(k):(d.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,gs(k=>d.onItemLeave(k))),onFocus:Te(e.onFocus,()=>g(!0)),onBlur:Te(e.onBlur,()=>g(!1))})})})}),w_="MenuCheckboxItem",B1=S.forwardRef((e,r)=>{const{checked:a=!1,onCheckedChange:l,...o}=e;return s.jsx($1,{scope:e.__scopeMenu,checked:a,children:s.jsx(Zc,{role:"menuitemcheckbox","aria-checked":wc(a)?"mixed":a,...o,ref:r,"data-state":gm(a),onSelect:Te(o.onSelect,()=>l?.(wc(a)?!0:!a),{checkForDefaultPrevented:!1})})})});B1.displayName=w_;var H1="MenuRadioGroup",[k_,j_]=Ga(H1,{value:void 0,onValueChange:()=>{}}),q1=S.forwardRef((e,r)=>{const{value:a,onValueChange:l,...o}=e,u=Kt(l);return s.jsx(k_,{scope:e.__scopeMenu,value:a,onValueChange:u,children:s.jsx(mm,{...o,ref:r})})});q1.displayName=H1;var F1="MenuRadioItem",G1=S.forwardRef((e,r)=>{const{value:a,...l}=e,o=j_(F1,e.__scopeMenu),u=a===o.value;return s.jsx($1,{scope:e.__scopeMenu,checked:u,children:s.jsx(Zc,{role:"menuitemradio","aria-checked":u,...l,ref:r,"data-state":gm(u),onSelect:Te(l.onSelect,()=>o.onValueChange?.(a),{checkForDefaultPrevented:!1})})})});G1.displayName=F1;var pm="MenuItemIndicator",[$1,C_]=Ga(pm,{checked:!1}),Y1=S.forwardRef((e,r)=>{const{__scopeMenu:a,forceMount:l,...o}=e,u=C_(pm,a);return s.jsx(an,{present:l||wc(u.checked)||u.checked===!0,children:s.jsx(We.span,{...o,ref:r,"data-state":gm(u.checked)})})});Y1.displayName=pm;var N_="MenuSeparator",V1=S.forwardRef((e,r)=>{const{__scopeMenu:a,...l}=e;return s.jsx(We.div,{role:"separator","aria-orientation":"horizontal",...l,ref:r})});V1.displayName=N_;var E_="MenuArrow",K1=S.forwardRef((e,r)=>{const{__scopeMenu:a,...l}=e,o=Qc(a);return s.jsx(k1,{...o,...l,ref:r})});K1.displayName=E_;var A_="MenuSub",[PU,X1]=Ga(A_),is="MenuSubTrigger",Q1=S.forwardRef((e,r)=>{const a=$a(is,e.__scopeMenu),l=js(is,e.__scopeMenu),o=X1(is,e.__scopeMenu),u=fm(is,e.__scopeMenu),d=S.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=u,p={__scopeMenu:e.__scopeMenu},y=S.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return S.useEffect(()=>y,[y]),S.useEffect(()=>{const g=f.current;return()=>{window.clearTimeout(g),h(null)}},[f,h]),s.jsx(um,{asChild:!0,...p,children:s.jsx(I1,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":o.contentId,"data-state":W1(a.open),...e,ref:Pc(r,o.onTriggerChange),onClick:g=>{e.onClick?.(g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,gs(g=>{u.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!a.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{a.onOpenChange(!0),y()},100))})),onPointerLeave:Te(e.onPointerLeave,gs(g=>{y();const v=a.content?.getBoundingClientRect();if(v){const b=a.content?.dataset.side,k=b==="right",C=k?-5:5,N=v[k?"left":"right"],j=v[k?"right":"left"];u.onPointerGraceIntentChange({area:[{x:g.clientX+C,y:g.clientY},{x:N,y:v.top},{x:j,y:v.top},{x:j,y:v.bottom},{x:N,y:v.bottom}],side:b}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(g),g.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,g=>{const v=u.searchRef.current!=="";e.disabled||v&&g.key===" "||o_[l.dir].includes(g.key)&&(a.onOpenChange(!0),a.content?.focus(),g.preventDefault())})})})});Q1.displayName=is;var Z1="MenuSubContent",J1=S.forwardRef((e,r)=>{const a=z1(Bn,e.__scopeMenu),{forceMount:l=a.forceMount,...o}=e,u=$a(Bn,e.__scopeMenu),d=js(Bn,e.__scopeMenu),f=X1(Z1,e.__scopeMenu),h=S.useRef(null),p=bt(r,h);return s.jsx(ps.Provider,{scope:e.__scopeMenu,children:s.jsx(an,{present:l||u.open,children:s.jsx(ps.Slot,{scope:e.__scopeMenu,children:s.jsx(hm,{id:f.contentId,"aria-labelledby":f.triggerId,...o,ref:p,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{d.isUsingKeyboardRef.current&&h.current?.focus(),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:Te(e.onFocusOutside,y=>{y.target!==f.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,y=>{d.onClose(),y.preventDefault()}),onKeyDown:Te(e.onKeyDown,y=>{const g=y.currentTarget.contains(y.target),v=c_[d.dir].includes(y.key);g&&v&&(u.onOpenChange(!1),f.trigger?.focus(),y.preventDefault())})})})})})});J1.displayName=Z1;function W1(e){return e?"open":"closed"}function wc(e){return e==="indeterminate"}function gm(e){return wc(e)?"indeterminate":e?"checked":"unchecked"}function __(e){const r=document.activeElement;for(const a of e)if(a===r||(a.focus(),document.activeElement!==r))return}function T_(e,r){return e.map((a,l)=>e[(r+l)%e.length])}function R_(e,r,a){const o=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,u=a?e.indexOf(a):-1;let d=T_(e,Math.max(u,0));o.length===1&&(d=d.filter(p=>p!==a));const h=d.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return h!==a?h:void 0}function M_(e,r){const{x:a,y:l}=e;let o=!1;for(let u=0,d=r.length-1;u<r.length;d=u++){const f=r[u],h=r[d],p=f.x,y=f.y,g=h.x,v=h.y;y>l!=v>l&&a<(g-p)*(l-y)/(v-y)+p&&(o=!o)}return o}function O_(e,r){if(!r)return!1;const a={x:e.clientX,y:e.clientY};return M_(a,r)}function gs(e){return r=>r.pointerType==="mouse"?e(r):void 0}var D_=D1,z_=um,L_=L1,P_=P1,U_=mm,I_=U1,B_=Zc,H_=B1,q_=q1,F_=G1,G_=Y1,$_=V1,Y_=K1,V_=Q1,K_=J1,Jc="DropdownMenu",[X_]=cr(Jc,[M1]),ln=M1(),[Q_,eS]=X_(Jc),tS=e=>{const{__scopeDropdownMenu:r,children:a,dir:l,open:o,defaultOpen:u,onOpenChange:d,modal:f=!0}=e,h=ln(r),p=S.useRef(null),[y,g]=bs({prop:o,defaultProp:u??!1,onChange:d,caller:Jc});return s.jsx(Q_,{scope:r,triggerId:ma(),triggerRef:p,contentId:ma(),open:y,onOpenChange:g,onOpenToggle:S.useCallback(()=>g(v=>!v),[g]),modal:f,children:s.jsx(D_,{...h,open:y,onOpenChange:g,dir:l,modal:f,children:a})})};tS.displayName=Jc;var nS="DropdownMenuTrigger",rS=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,disabled:l=!1,...o}=e,u=eS(nS,a),d=ln(a);return s.jsx(z_,{asChild:!0,...d,children:s.jsx(We.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...o,ref:Pc(r,u.triggerRef),onPointerDown:Te(e.onPointerDown,f=>{!l&&f.button===0&&f.ctrlKey===!1&&(u.onOpenToggle(),u.open||f.preventDefault())}),onKeyDown:Te(e.onKeyDown,f=>{l||(["Enter"," "].includes(f.key)&&u.onOpenToggle(),f.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});rS.displayName=nS;var Z_="DropdownMenuPortal",aS=e=>{const{__scopeDropdownMenu:r,...a}=e,l=ln(r);return s.jsx(L_,{...l,...a})};aS.displayName=Z_;var lS="DropdownMenuContent",iS=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=eS(lS,a),u=ln(a),d=S.useRef(!1);return s.jsx(P_,{id:o.contentId,"aria-labelledby":o.triggerId,...u,...l,ref:r,onCloseAutoFocus:Te(e.onCloseAutoFocus,f=>{d.current||o.triggerRef.current?.focus(),d.current=!1,f.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,y=h.button===2||p;(!o.modal||y)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iS.displayName=lS;var J_="DropdownMenuGroup",W_=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(U_,{...o,...l,ref:r})});W_.displayName=J_;var eT="DropdownMenuLabel",tT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(I_,{...o,...l,ref:r})});tT.displayName=eT;var nT="DropdownMenuItem",sS=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(B_,{...o,...l,ref:r})});sS.displayName=nT;var rT="DropdownMenuCheckboxItem",aT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(H_,{...o,...l,ref:r})});aT.displayName=rT;var lT="DropdownMenuRadioGroup",iT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(q_,{...o,...l,ref:r})});iT.displayName=lT;var sT="DropdownMenuRadioItem",oT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(F_,{...o,...l,ref:r})});oT.displayName=sT;var cT="DropdownMenuItemIndicator",uT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(G_,{...o,...l,ref:r})});uT.displayName=cT;var dT="DropdownMenuSeparator",fT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx($_,{...o,...l,ref:r})});fT.displayName=dT;var hT="DropdownMenuArrow",mT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(Y_,{...o,...l,ref:r})});mT.displayName=hT;var pT="DropdownMenuSubTrigger",gT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(V_,{...o,...l,ref:r})});gT.displayName=pT;var xT="DropdownMenuSubContent",yT=S.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...l}=e,o=ln(a);return s.jsx(K_,{...o,...l,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yT.displayName=xT;var vT=tS,bT=rS,ST=aS,wT=iS,kT=sS;function jT(e,[r,a]){return Math.min(a,Math.max(r,e))}function CT(e,r){return S.useReducer((a,l)=>r[a][l]??a,e)}var xm="ScrollArea",[oS]=cr(xm),[NT,qn]=oS(xm),cS=S.forwardRef((e,r)=>{const{__scopeScrollArea:a,type:l="hover",dir:o,scrollHideDelay:u=600,...d}=e,[f,h]=S.useState(null),[p,y]=S.useState(null),[g,v]=S.useState(null),[b,k]=S.useState(null),[C,N]=S.useState(null),[j,R]=S.useState(0),[M,O]=S.useState(0),[L,D]=S.useState(!1),[I,B]=S.useState(!1),V=bt(r,ee=>h(ee)),P=Ic(o);return s.jsx(NT,{scope:a,type:l,dir:P,scrollHideDelay:u,scrollArea:f,viewport:p,onViewportChange:y,content:g,onContentChange:v,scrollbarX:b,onScrollbarXChange:k,scrollbarXEnabled:L,onScrollbarXEnabledChange:D,scrollbarY:C,onScrollbarYChange:N,scrollbarYEnabled:I,onScrollbarYEnabledChange:B,onCornerWidthChange:R,onCornerHeightChange:O,children:s.jsx(We.div,{dir:P,...d,ref:V,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})});cS.displayName=xm;var uS="ScrollAreaViewport",dS=S.forwardRef((e,r)=>{const{__scopeScrollArea:a,children:l,nonce:o,...u}=e,d=qn(uS,a),f=S.useRef(null),h=bt(r,f,d.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),s.jsx(We.div,{"data-radix-scroll-area-viewport":"",...u,ref:h,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});dS.displayName=uS;var dr="ScrollAreaScrollbar",fS=S.forwardRef((e,r)=>{const{forceMount:a,...l}=e,o=qn(dr,e.__scopeScrollArea),{onScrollbarXEnabledChange:u,onScrollbarYEnabledChange:d}=o,f=e.orientation==="horizontal";return S.useEffect(()=>(f?u(!0):d(!0),()=>{f?u(!1):d(!1)}),[f,u,d]),o.type==="hover"?s.jsx(ET,{...l,ref:r,forceMount:a}):o.type==="scroll"?s.jsx(AT,{...l,ref:r,forceMount:a}):o.type==="auto"?s.jsx(hS,{...l,ref:r,forceMount:a}):o.type==="always"?s.jsx(ym,{...l,ref:r}):null});fS.displayName=dr;var ET=S.forwardRef((e,r)=>{const{forceMount:a,...l}=e,o=qn(dr,e.__scopeScrollArea),[u,d]=S.useState(!1);return S.useEffect(()=>{const f=o.scrollArea;let h=0;if(f){const p=()=>{window.clearTimeout(h),d(!0)},y=()=>{h=window.setTimeout(()=>d(!1),o.scrollHideDelay)};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",y),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",y)}}},[o.scrollArea,o.scrollHideDelay]),s.jsx(an,{present:a||u,children:s.jsx(hS,{"data-state":u?"visible":"hidden",...l,ref:r})})}),AT=S.forwardRef((e,r)=>{const{forceMount:a,...l}=e,o=qn(dr,e.__scopeScrollArea),u=e.orientation==="horizontal",d=eu(()=>h("SCROLL_END"),100),[f,h]=CT("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>h("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,o.scrollHideDelay,h]),S.useEffect(()=>{const p=o.viewport,y=u?"scrollLeft":"scrollTop";if(p){let g=p[y];const v=()=>{const b=p[y];g!==b&&(h("SCROLL"),d()),g=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,u,h,d]),s.jsx(an,{present:a||f!=="hidden",children:s.jsx(ym,{"data-state":f==="hidden"?"hidden":"visible",...l,ref:r,onPointerEnter:Te(e.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Te(e.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),hS=S.forwardRef((e,r)=>{const a=qn(dr,e.__scopeScrollArea),{forceMount:l,...o}=e,[u,d]=S.useState(!1),f=e.orientation==="horizontal",h=eu(()=>{if(a.viewport){const p=a.viewport.offsetWidth<a.viewport.scrollWidth,y=a.viewport.offsetHeight<a.viewport.scrollHeight;d(f?p:y)}},10);return Yl(a.viewport,h),Yl(a.content,h),s.jsx(an,{present:l||u,children:s.jsx(ym,{"data-state":u?"visible":"hidden",...o,ref:r})})}),ym=S.forwardRef((e,r)=>{const{orientation:a="vertical",...l}=e,o=qn(dr,e.__scopeScrollArea),u=S.useRef(null),d=S.useRef(0),[f,h]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=yS(f.viewport,f.content),y={...l,sizes:f,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:v=>u.current=v,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:v=>d.current=v};function g(v,b){return DT(v,d.current,f,b)}return a==="horizontal"?s.jsx(_T,{...y,ref:r,onThumbPositionChange:()=>{if(o.viewport&&u.current){const v=o.viewport.scrollLeft,b=Gv(v,f,o.dir);u.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=g(v,o.dir))}}):a==="vertical"?s.jsx(TT,{...y,ref:r,onThumbPositionChange:()=>{if(o.viewport&&u.current){const v=o.viewport.scrollTop,b=Gv(v,f);u.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=g(v))}}):null}),_T=S.forwardRef((e,r)=>{const{sizes:a,onSizesChange:l,...o}=e,u=qn(dr,e.__scopeScrollArea),[d,f]=S.useState(),h=S.useRef(null),p=bt(r,h,u.onScrollbarXChange);return S.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),s.jsx(pS,{"data-orientation":"horizontal",...o,ref:p,sizes:a,style:{bottom:0,left:u.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:u.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wc(a)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.x),onDragScroll:y=>e.onDragScroll(y.x),onWheelScroll:(y,g)=>{if(u.viewport){const v=u.viewport.scrollLeft+y.deltaX;e.onWheelScroll(v),bS(v,g)&&y.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:jc(d.paddingLeft),paddingEnd:jc(d.paddingRight)}})}})}),TT=S.forwardRef((e,r)=>{const{sizes:a,onSizesChange:l,...o}=e,u=qn(dr,e.__scopeScrollArea),[d,f]=S.useState(),h=S.useRef(null),p=bt(r,h,u.onScrollbarYChange);return S.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),s.jsx(pS,{"data-orientation":"vertical",...o,ref:p,sizes:a,style:{top:0,right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wc(a)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.y),onDragScroll:y=>e.onDragScroll(y.y),onWheelScroll:(y,g)=>{if(u.viewport){const v=u.viewport.scrollTop+y.deltaY;e.onWheelScroll(v),bS(v,g)&&y.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:jc(d.paddingTop),paddingEnd:jc(d.paddingBottom)}})}})}),[RT,mS]=oS(dr),pS=S.forwardRef((e,r)=>{const{__scopeScrollArea:a,sizes:l,hasThumb:o,onThumbChange:u,onThumbPointerUp:d,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:y,onResize:g,...v}=e,b=qn(dr,a),[k,C]=S.useState(null),N=bt(r,V=>C(V)),j=S.useRef(null),R=S.useRef(""),M=b.viewport,O=l.content-l.viewport,L=Kt(y),D=Kt(h),I=eu(g,10);function B(V){if(j.current){const P=V.clientX-j.current.left,ee=V.clientY-j.current.top;p({x:P,y:ee})}}return S.useEffect(()=>{const V=P=>{const ee=P.target;k?.contains(ee)&&L(P,O)};return document.addEventListener("wheel",V,{passive:!1}),()=>document.removeEventListener("wheel",V,{passive:!1})},[M,k,O,L]),S.useEffect(D,[l,D]),Yl(k,I),Yl(b.content,I),s.jsx(RT,{scope:a,scrollbar:k,hasThumb:o,onThumbChange:Kt(u),onThumbPointerUp:Kt(d),onThumbPositionChange:D,onThumbPointerDown:Kt(f),children:s.jsx(We.div,{...v,ref:N,style:{position:"absolute",...v.style},onPointerDown:Te(e.onPointerDown,V=>{V.button===0&&(V.target.setPointerCapture(V.pointerId),j.current=k.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),B(V))}),onPointerMove:Te(e.onPointerMove,B),onPointerUp:Te(e.onPointerUp,V=>{const P=V.target;P.hasPointerCapture(V.pointerId)&&P.releasePointerCapture(V.pointerId),document.body.style.webkitUserSelect=R.current,b.viewport&&(b.viewport.style.scrollBehavior=""),j.current=null})})})}),kc="ScrollAreaThumb",gS=S.forwardRef((e,r)=>{const{forceMount:a,...l}=e,o=mS(kc,e.__scopeScrollArea);return s.jsx(an,{present:a||o.hasThumb,children:s.jsx(MT,{ref:r,...l})})}),MT=S.forwardRef((e,r)=>{const{__scopeScrollArea:a,style:l,...o}=e,u=qn(kc,a),d=mS(kc,a),{onThumbPositionChange:f}=d,h=bt(r,g=>d.onThumbChange(g)),p=S.useRef(void 0),y=eu(()=>{p.current&&(p.current(),p.current=void 0)},100);return S.useEffect(()=>{const g=u.viewport;if(g){const v=()=>{if(y(),!p.current){const b=zT(g,f);p.current=b,f()}};return f(),g.addEventListener("scroll",v),()=>g.removeEventListener("scroll",v)}},[u.viewport,y,f]),s.jsx(We.div,{"data-state":d.hasThumb?"visible":"hidden",...o,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:Te(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),k=g.clientX-b.left,C=g.clientY-b.top;d.onThumbPointerDown({x:k,y:C})}),onPointerUp:Te(e.onPointerUp,d.onThumbPointerUp)})});gS.displayName=kc;var vm="ScrollAreaCorner",xS=S.forwardRef((e,r)=>{const a=qn(vm,e.__scopeScrollArea),l=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&l?s.jsx(OT,{...e,ref:r}):null});xS.displayName=vm;var OT=S.forwardRef((e,r)=>{const{__scopeScrollArea:a,...l}=e,o=qn(vm,a),[u,d]=S.useState(0),[f,h]=S.useState(0),p=!!(u&&f);return Yl(o.scrollbarX,()=>{const y=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(y),h(y)}),Yl(o.scrollbarY,()=>{const y=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(y),d(y)}),p?s.jsx(We.div,{...l,ref:r,style:{width:u,height:f,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function jc(e){return e?parseInt(e,10):0}function yS(e,r){const a=e/r;return isNaN(a)?0:a}function Wc(e){const r=yS(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=(e.scrollbar.size-a)*r;return Math.max(l,18)}function DT(e,r,a,l="ltr"){const o=Wc(a),u=o/2,d=r||u,f=o-d,h=a.scrollbar.paddingStart+d,p=a.scrollbar.size-a.scrollbar.paddingEnd-f,y=a.content-a.viewport,g=l==="ltr"?[0,y]:[y*-1,0];return vS([h,p],g)(e)}function Gv(e,r,a="ltr"){const l=Wc(r),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,u=r.scrollbar.size-o,d=r.content-r.viewport,f=u-l,h=a==="ltr"?[0,d]:[d*-1,0],p=jT(e,h);return vS([0,d],[0,f])(p)}function vS(e,r){return a=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const l=(r[1]-r[0])/(e[1]-e[0]);return r[0]+l*(a-e[0])}}function bS(e,r){return e>0&&e<r}var zT=(e,r=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},l=0;return(function o(){const u={left:e.scrollLeft,top:e.scrollTop},d=a.left!==u.left,f=a.top!==u.top;(d||f)&&r(),a=u,l=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(l)};function eu(e,r){const a=Kt(e),l=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(l.current),[]),S.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(a,r)},[a,r])}function Yl(e,r){const a=Kt(r);Hn(()=>{let l=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(a)});return o.observe(e),()=>{window.cancelAnimationFrame(l),o.unobserve(e)}}},[e,a])}var LT=cS,PT=dS,UT=xS,tu="Tabs",[IT]=cr(tu,[Xc]),SS=Xc(),[BT,bm]=IT(tu),wS=S.forwardRef((e,r)=>{const{__scopeTabs:a,value:l,onValueChange:o,defaultValue:u,orientation:d="horizontal",dir:f,activationMode:h="automatic",...p}=e,y=Ic(f),[g,v]=bs({prop:l,onChange:o,defaultProp:u??"",caller:tu});return s.jsx(BT,{scope:a,baseId:ma(),value:g,onValueChange:v,orientation:d,dir:y,activationMode:h,children:s.jsx(We.div,{dir:y,"data-orientation":d,...p,ref:r})})});wS.displayName=tu;var kS="TabsList",jS=S.forwardRef((e,r)=>{const{__scopeTabs:a,loop:l=!0,...o}=e,u=bm(kS,a),d=SS(a);return s.jsx(_1,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:l,children:s.jsx(We.div,{role:"tablist","aria-orientation":u.orientation,...o,ref:r})})});jS.displayName=kS;var CS="TabsTrigger",NS=S.forwardRef((e,r)=>{const{__scopeTabs:a,value:l,disabled:o=!1,...u}=e,d=bm(CS,a),f=SS(a),h=_S(d.baseId,l),p=TS(d.baseId,l),y=l===d.value;return s.jsx(T1,{asChild:!0,...f,focusable:!o,active:y,children:s.jsx(We.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":p,"data-state":y?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:h,...u,ref:r,onMouseDown:Te(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?d.onValueChange(l):g.preventDefault()}),onKeyDown:Te(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&d.onValueChange(l)}),onFocus:Te(e.onFocus,()=>{const g=d.activationMode!=="manual";!y&&!o&&g&&d.onValueChange(l)})})})});NS.displayName=CS;var ES="TabsContent",AS=S.forwardRef((e,r)=>{const{__scopeTabs:a,value:l,forceMount:o,children:u,...d}=e,f=bm(ES,a),h=_S(f.baseId,l),p=TS(f.baseId,l),y=l===f.value,g=S.useRef(y);return S.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),s.jsx(an,{present:o||y,children:({present:v})=>s.jsx(We.div,{"data-state":y?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":h,hidden:!v,id:p,tabIndex:0,...d,ref:r,style:{...e.style,animationDuration:g.current?"0s":void 0},children:v&&u})})});AS.displayName=ES;function _S(e,r){return`${e}-trigger-${r}`}function TS(e,r){return`${e}-content-${r}`}var HT=wS,qT=jS,FT=NS,GT=AS,[nu]=cr("Tooltip",[Kc]),ru=Kc(),RS="TooltipProvider",$T=700,Ch="tooltip.open",[YT,Sm]=nu(RS),MS=e=>{const{__scopeTooltip:r,delayDuration:a=$T,skipDelayDuration:l=300,disableHoverableContent:o=!1,children:u}=e,d=S.useRef(!0),f=S.useRef(!1),h=S.useRef(0);return S.useEffect(()=>{const p=h.current;return()=>window.clearTimeout(p)},[]),s.jsx(YT,{scope:r,isOpenDelayedRef:d,delayDuration:a,onOpen:S.useCallback(()=>{window.clearTimeout(h.current),d.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>d.current=!0,l)},[l]),isPointerInTransitRef:f,onPointerInTransitChange:S.useCallback(p=>{f.current=p},[]),disableHoverableContent:o,children:u})};MS.displayName=RS;var xs="Tooltip",[VT,Cs]=nu(xs),OS=e=>{const{__scopeTooltip:r,children:a,open:l,defaultOpen:o,onOpenChange:u,disableHoverableContent:d,delayDuration:f}=e,h=Sm(xs,e.__scopeTooltip),p=ru(r),[y,g]=S.useState(null),v=ma(),b=S.useRef(0),k=d??h.disableHoverableContent,C=f??h.delayDuration,N=S.useRef(!1),[j,R]=bs({prop:l,defaultProp:o??!1,onChange:I=>{I?(h.onOpen(),document.dispatchEvent(new CustomEvent(Ch))):h.onClose(),u?.(I)},caller:xs}),M=S.useMemo(()=>j?N.current?"delayed-open":"instant-open":"closed",[j]),O=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N.current=!1,R(!0)},[R]),L=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,R(!1)},[R]),D=S.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{N.current=!0,R(!0),b.current=0},C)},[C,R]);return S.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),s.jsx(b1,{...p,children:s.jsx(VT,{scope:r,contentId:v,open:j,stateAttribute:M,trigger:y,onTriggerChange:g,onTriggerEnter:S.useCallback(()=>{h.isOpenDelayedRef.current?D():O()},[h.isOpenDelayedRef,D,O]),onTriggerLeave:S.useCallback(()=>{k?L():(window.clearTimeout(b.current),b.current=0)},[L,k]),onOpen:O,onClose:L,disableHoverableContent:k,children:a})})};OS.displayName=xs;var Nh="TooltipTrigger",DS=S.forwardRef((e,r)=>{const{__scopeTooltip:a,...l}=e,o=Cs(Nh,a),u=Sm(Nh,a),d=ru(a),f=S.useRef(null),h=bt(r,f,o.onTriggerChange),p=S.useRef(!1),y=S.useRef(!1),g=S.useCallback(()=>p.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),s.jsx(S1,{asChild:!0,...d,children:s.jsx(We.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...l,ref:h,onPointerMove:Te(e.onPointerMove,v=>{v.pointerType!=="touch"&&!y.current&&!u.isPointerInTransitRef.current&&(o.onTriggerEnter(),y.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{o.onTriggerLeave(),y.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Te(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:Te(e.onBlur,o.onClose),onClick:Te(e.onClick,o.onClose)})})});DS.displayName=Nh;var wm="TooltipPortal",[KT,XT]=nu(wm,{forceMount:void 0}),zS=e=>{const{__scopeTooltip:r,forceMount:a,children:l,container:o}=e,u=Cs(wm,r);return s.jsx(KT,{scope:r,forceMount:a,children:s.jsx(an,{present:a||u.open,children:s.jsx(Hc,{asChild:!0,container:o,children:l})})})};zS.displayName=wm;var Vl="TooltipContent",LS=S.forwardRef((e,r)=>{const a=XT(Vl,e.__scopeTooltip),{forceMount:l=a.forceMount,side:o="top",...u}=e,d=Cs(Vl,e.__scopeTooltip);return s.jsx(an,{present:l||d.open,children:d.disableHoverableContent?s.jsx(PS,{side:o,...u,ref:r}):s.jsx(QT,{side:o,...u,ref:r})})}),QT=S.forwardRef((e,r)=>{const a=Cs(Vl,e.__scopeTooltip),l=Sm(Vl,e.__scopeTooltip),o=S.useRef(null),u=bt(r,o),[d,f]=S.useState(null),{trigger:h,onClose:p}=a,y=o.current,{onPointerInTransitChange:g}=l,v=S.useCallback(()=>{f(null),g(!1)},[g]),b=S.useCallback((k,C)=>{const N=k.currentTarget,j={x:k.clientX,y:k.clientY},R=eR(j,N.getBoundingClientRect()),M=tR(j,R),O=nR(C.getBoundingClientRect()),L=aR([...M,...O]);f(L),g(!0)},[g]);return S.useEffect(()=>()=>v(),[v]),S.useEffect(()=>{if(h&&y){const k=N=>b(N,y),C=N=>b(N,h);return h.addEventListener("pointerleave",k),y.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",k),y.removeEventListener("pointerleave",C)}}},[h,y,b,v]),S.useEffect(()=>{if(d){const k=C=>{const N=C.target,j={x:C.clientX,y:C.clientY},R=h?.contains(N)||y?.contains(N),M=!rR(j,d);R?v():M&&(v(),p())};return document.addEventListener("pointermove",k),()=>document.removeEventListener("pointermove",k)}},[h,y,d,p,v]),s.jsx(PS,{...e,ref:u})}),[ZT,JT]=nu(xs,{isInside:!1}),WT=FC("TooltipContent"),PS=S.forwardRef((e,r)=>{const{__scopeTooltip:a,children:l,"aria-label":o,onEscapeKeyDown:u,onPointerDownOutside:d,...f}=e,h=Cs(Vl,a),p=ru(a),{onClose:y}=h;return S.useEffect(()=>(document.addEventListener(Ch,y),()=>document.removeEventListener(Ch,y)),[y]),S.useEffect(()=>{if(h.trigger){const g=v=>{v.target?.contains(h.trigger)&&y()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,y]),s.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g=>g.preventDefault(),onDismiss:y,children:s.jsxs(w1,{"data-state":h.stateAttribute,...p,...f,ref:r,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(WT,{children:l}),s.jsx(ZT,{scope:a,isInside:!0,children:s.jsx(QC,{id:h.contentId,role:"tooltip",children:o||l})})]})})});LS.displayName=Vl;var US="TooltipArrow",IS=S.forwardRef((e,r)=>{const{__scopeTooltip:a,...l}=e,o=ru(a);return JT(US,a).isInside?null:s.jsx(k1,{...o,...l,ref:r})});IS.displayName=US;function eR(e,r){const a=Math.abs(r.top-e.y),l=Math.abs(r.bottom-e.y),o=Math.abs(r.right-e.x),u=Math.abs(r.left-e.x);switch(Math.min(a,l,o,u)){case u:return"left";case o:return"right";case a:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function tR(e,r,a=5){const l=[];switch(r){case"top":l.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":l.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":l.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":l.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return l}function nR(e){const{top:r,right:a,bottom:l,left:o}=e;return[{x:o,y:r},{x:a,y:r},{x:a,y:l},{x:o,y:l}]}function rR(e,r){const{x:a,y:l}=e;let o=!1;for(let u=0,d=r.length-1;u<r.length;d=u++){const f=r[u],h=r[d],p=f.x,y=f.y,g=h.x,v=h.y;y>l!=v>l&&a<(g-p)*(l-y)/(v-y)+p&&(o=!o)}return o}function aR(e){const r=e.slice();return r.sort((a,l)=>a.x<l.x?-1:a.x>l.x?1:a.y<l.y?-1:a.y>l.y?1:0),lR(r)}function lR(e){if(e.length<=1)return e.slice();const r=[];for(let l=0;l<e.length;l++){const o=e[l];for(;r.length>=2;){const u=r[r.length-1],d=r[r.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))r.pop();else break}r.push(o)}r.pop();const a=[];for(let l=e.length-1;l>=0;l--){const o=e[l];for(;a.length>=2;){const u=a[a.length-1],d=a[a.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))a.pop();else break}a.push(o)}return a.pop(),r.length===1&&a.length===1&&r[0].x===a[0].x&&r[0].y===a[0].y?r:r.concat(a)}var iR=MS,sR=OS,oR=DS,cR=zS,uR=LS,dR=IS;const fR=(e,r)=>{const a=new Array(e.length+r.length);for(let l=0;l<e.length;l++)a[l]=e[l];for(let l=0;l<r.length;l++)a[e.length+l]=r[l];return a},hR=(e,r)=>({classGroupId:e,validator:r}),BS=(e=new Map,r=null,a)=>({nextPart:e,validators:r,classGroupId:a}),Cc="-",$v=[],mR="arbitrary..",pR=e=>{const r=xR(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:l}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return gR(d);const f=d.split(Cc),h=f[0]===""&&f.length>1?1:0;return HS(f,h,r)},getConflictingClassGroupIds:(d,f)=>{if(f){const h=l[d],p=a[d];return h?p?fR(p,h):h:p||$v}return a[d]||$v}}},HS=(e,r,a)=>{if(e.length-r===0)return a.classGroupId;const o=e[r],u=a.nextPart.get(o);if(u){const p=HS(e,r+1,u);if(p)return p}const d=a.validators;if(d===null)return;const f=r===0?e.join(Cc):e.slice(r).join(Cc),h=d.length;for(let p=0;p<h;p++){const y=d[p];if(y.validator(f))return y.classGroupId}},gR=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),a=r.indexOf(":"),l=r.slice(0,a);return l?mR+l:void 0})(),xR=e=>{const{theme:r,classGroups:a}=e;return yR(a,r)},yR=(e,r)=>{const a=BS();for(const l in e){const o=e[l];km(o,a,l,r)}return a},km=(e,r,a,l)=>{const o=e.length;for(let u=0;u<o;u++){const d=e[u];vR(d,r,a,l)}},vR=(e,r,a,l)=>{if(typeof e=="string"){bR(e,r,a);return}if(typeof e=="function"){SR(e,r,a,l);return}wR(e,r,a,l)},bR=(e,r,a)=>{const l=e===""?r:qS(r,e);l.classGroupId=a},SR=(e,r,a,l)=>{if(kR(e)){km(e(l),r,a,l);return}r.validators===null&&(r.validators=[]),r.validators.push(hR(a,e))},wR=(e,r,a,l)=>{const o=Object.entries(e),u=o.length;for(let d=0;d<u;d++){const[f,h]=o[d];km(h,qS(r,f),a,l)}},qS=(e,r)=>{let a=e;const l=r.split(Cc),o=l.length;for(let u=0;u<o;u++){const d=l[u];let f=a.nextPart.get(d);f||(f=BS(),a.nextPart.set(d,f)),a=f}return a},kR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,jR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,a=Object.create(null),l=Object.create(null);const o=(u,d)=>{a[u]=d,r++,r>e&&(r=0,l=a,a=Object.create(null))};return{get(u){let d=a[u];if(d!==void 0)return d;if((d=l[u])!==void 0)return o(u,d),d},set(u,d){u in a?a[u]=d:o(u,d)}}},Eh="!",Yv=":",CR=[],Vv=(e,r,a,l,o)=>({modifiers:e,hasImportantModifier:r,baseClassName:a,maybePostfixModifierPosition:l,isExternal:o}),NR=e=>{const{prefix:r,experimentalParseClassName:a}=e;let l=o=>{const u=[];let d=0,f=0,h=0,p;const y=o.length;for(let C=0;C<y;C++){const N=o[C];if(d===0&&f===0){if(N===Yv){u.push(o.slice(h,C)),h=C+1;continue}if(N==="/"){p=C;continue}}N==="["?d++:N==="]"?d--:N==="("?f++:N===")"&&f--}const g=u.length===0?o:o.slice(h);let v=g,b=!1;g.endsWith(Eh)?(v=g.slice(0,-1),b=!0):g.startsWith(Eh)&&(v=g.slice(1),b=!0);const k=p&&p>h?p-h:void 0;return Vv(u,b,v,k)};if(r){const o=r+Yv,u=l;l=d=>d.startsWith(o)?u(d.slice(o.length)):Vv(CR,!1,d,void 0,!0)}if(a){const o=l;l=u=>a({className:u,parseClassName:o})}return l},ER=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((a,l)=>{r.set(a,1e6+l)}),a=>{const l=[];let o=[];for(let u=0;u<a.length;u++){const d=a[u],f=d[0]==="[",h=r.has(d);f||h?(o.length>0&&(o.sort(),l.push(...o),o=[]),l.push(d)):o.push(d)}return o.length>0&&(o.sort(),l.push(...o)),l}},AR=e=>({cache:jR(e.cacheSize),parseClassName:NR(e),sortModifiers:ER(e),...pR(e)}),_R=/\s+/,TR=(e,r)=>{const{parseClassName:a,getClassGroupId:l,getConflictingClassGroupIds:o,sortModifiers:u}=r,d=[],f=e.trim().split(_R);let h="";for(let p=f.length-1;p>=0;p-=1){const y=f[p],{isExternal:g,modifiers:v,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:C}=a(y);if(g){h=y+(h.length>0?" "+h:h);continue}let N=!!C,j=l(N?k.substring(0,C):k);if(!j){if(!N){h=y+(h.length>0?" "+h:h);continue}if(j=l(k),!j){h=y+(h.length>0?" "+h:h);continue}N=!1}const R=v.length===0?"":v.length===1?v[0]:u(v).join(":"),M=b?R+Eh:R,O=M+j;if(d.indexOf(O)>-1)continue;d.push(O);const L=o(j,N);for(let D=0;D<L.length;++D){const I=L[D];d.push(M+I)}h=y+(h.length>0?" "+h:h)}return h},RR=(...e)=>{let r=0,a,l,o="";for(;r<e.length;)(a=e[r++])&&(l=FS(a))&&(o&&(o+=" "),o+=l);return o},FS=e=>{if(typeof e=="string")return e;let r,a="";for(let l=0;l<e.length;l++)e[l]&&(r=FS(e[l]))&&(a&&(a+=" "),a+=r);return a},MR=(e,...r)=>{let a,l,o,u;const d=h=>{const p=r.reduce((y,g)=>g(y),e());return a=AR(p),l=a.cache.get,o=a.cache.set,u=f,f(h)},f=h=>{const p=l(h);if(p)return p;const y=TR(h,a);return o(h,y),y};return u=d,(...h)=>u(RR(...h))},OR=[],Lt=e=>{const r=a=>a[e]||OR;return r.isThemeGetter=!0,r},GS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$S=/^\((?:(\w[\w-]*):)?(.+)\)$/i,DR=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,PR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,IR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oa=e=>DR.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),ca=e=>!!e&&Number.isInteger(Number(e)),Vf=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),Mr=e=>zR.test(e),YS=()=>!0,BR=e=>LR.test(e)&&!PR.test(e),jm=()=>!1,HR=e=>UR.test(e),qR=e=>IR.test(e),FR=e=>!Se(e)&&!ke(e),GR=e=>ya(e,XS,jm),Se=e=>GS.test(e),Ua=e=>ya(e,QS,BR),Kv=e=>ya(e,JR,Fe),$R=e=>ya(e,JS,YS),YR=e=>ya(e,ZS,jm),Xv=e=>ya(e,VS,jm),VR=e=>ya(e,KS,qR),nc=e=>ya(e,WS,HR),ke=e=>$S.test(e),ts=e=>Ya(e,QS),KR=e=>Ya(e,ZS),Qv=e=>Ya(e,VS),XR=e=>Ya(e,XS),QR=e=>Ya(e,KS),rc=e=>Ya(e,WS,!0),ZR=e=>Ya(e,JS,!0),ya=(e,r,a)=>{const l=GS.exec(e);return l?l[1]?r(l[1]):a(l[2]):!1},Ya=(e,r,a=!1)=>{const l=$S.exec(e);return l?l[1]?r(l[1]):a:!1},VS=e=>e==="position"||e==="percentage",KS=e=>e==="image"||e==="url",XS=e=>e==="length"||e==="size"||e==="bg-size",QS=e=>e==="length",JR=e=>e==="number",ZS=e=>e==="family-name",JS=e=>e==="number"||e==="weight",WS=e=>e==="shadow",WR=()=>{const e=Lt("color"),r=Lt("font"),a=Lt("text"),l=Lt("font-weight"),o=Lt("tracking"),u=Lt("leading"),d=Lt("breakpoint"),f=Lt("container"),h=Lt("spacing"),p=Lt("radius"),y=Lt("shadow"),g=Lt("inset-shadow"),v=Lt("text-shadow"),b=Lt("drop-shadow"),k=Lt("blur"),C=Lt("perspective"),N=Lt("aspect"),j=Lt("ease"),R=Lt("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...O(),ke,Se],D=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],B=()=>[ke,Se,h],V=()=>[oa,"full","auto",...B()],P=()=>[ca,"none","subgrid",ke,Se],ee=()=>["auto",{span:["full",ca,ke,Se]},ca,ke,Se],te=()=>[ca,"auto",ke,Se],ce=()=>["auto","min","max","fr",ke,Se],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...B()],F=()=>[oa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],J=()=>[oa,"screen","full","dvw","lvw","svw","min","max","fit",...B()],Y=()=>[oa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],A=()=>[e,ke,Se],_=()=>[...O(),Qv,Xv,{position:[ke,Se]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",XR,GR,{size:[ke,Se]}],oe=()=>[Vf,ts,Ua],me=()=>["","none","full",p,ke,Se],fe=()=>["",Fe,ts,Ua],ge=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[Fe,Vf,Qv,Xv],pe=()=>["","none",k,ke,Se],Oe=()=>["none",Fe,ke,Se],De=()=>["none",Fe,ke,Se],Ue=()=>[Fe,ke,Se],Ge=()=>[oa,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mr],breakpoint:[Mr],color:[YS],container:[Mr],"drop-shadow":[Mr],ease:["in","out","in-out"],font:[FR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mr],shadow:[Mr],spacing:["px",Fe],text:[Mr],"text-shadow":[Mr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oa,Se,ke,N]}],container:["container"],columns:[{columns:[Fe,Se,ke,f]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[ca,"auto",ke,Se]}],basis:[{basis:[oa,"full","auto",f,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,oa,"auto","initial","none",Se]}],grow:[{grow:["",Fe,ke,Se]}],shrink:[{shrink:["",Fe,ke,Se]}],order:[{order:[ca,"first","last","none",ke,Se]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[f,"screen",...F()]}],"min-w":[{"min-w":[f,"screen","none",...F()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",a,ts,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,ZR,$R]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vf,Se]}],"font-family":[{font:[KR,YR,r]}],"font-features":[{"font-features":[Se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ke,Se]}],"line-clamp":[{"line-clamp":[Fe,"none",ke,Kv]}],leading:[{leading:[u,...B()]}],"list-image":[{"list-image":["none",ke,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",ke,Ua]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Fe,"auto",ke,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ca,ke,Se],radial:["",ke,Se],conic:[ca,ke,Se]},QR,VR]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:me()}],"rounded-s":[{"rounded-s":me()}],"rounded-e":[{"rounded-e":me()}],"rounded-t":[{"rounded-t":me()}],"rounded-r":[{"rounded-r":me()}],"rounded-b":[{"rounded-b":me()}],"rounded-l":[{"rounded-l":me()}],"rounded-ss":[{"rounded-ss":me()}],"rounded-se":[{"rounded-se":me()}],"rounded-ee":[{"rounded-ee":me()}],"rounded-es":[{"rounded-es":me()}],"rounded-tl":[{"rounded-tl":me()}],"rounded-tr":[{"rounded-tr":me()}],"rounded-br":[{"rounded-br":me()}],"rounded-bl":[{"rounded-bl":me()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,ke,Se]}],"outline-w":[{outline:["",Fe,ts,Ua]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",y,rc,nc]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,rc,nc]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Fe,Ua]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",v,rc,nc]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Fe,ke,Se]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[ke,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Se]}],filter:[{filter:["","none",ke,Se]}],blur:[{blur:pe()}],brightness:[{brightness:[Fe,ke,Se]}],contrast:[{contrast:[Fe,ke,Se]}],"drop-shadow":[{"drop-shadow":["","none",b,rc,nc]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Fe,ke,Se]}],"hue-rotate":[{"hue-rotate":[Fe,ke,Se]}],invert:[{invert:["",Fe,ke,Se]}],saturate:[{saturate:[Fe,ke,Se]}],sepia:[{sepia:["",Fe,ke,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Se]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,ke,Se]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,ke,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,ke,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,ke,Se]}],"backdrop-invert":[{"backdrop-invert":["",Fe,ke,Se]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,ke,Se]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,ke,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,ke,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",ke,Se]}],ease:[{ease:["linear","initial",j,ke,Se]}],delay:[{delay:[Fe,ke,Se]}],animate:[{animate:["none",R,ke,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ke,Se]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:Ue()}],"skew-x":[{"skew-x":Ue()}],"skew-y":[{"skew-y":Ue()}],transform:[{transform:[ke,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,Se]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Fe,ts,Ua,Kv]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},eM=MR(WR);function je(...e){return eM(o0(e))}const tM=Lc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ue({className:e,variant:r="default",size:a="default",asChild:l=!1,...o}){const u=l?Uc:"button";return s.jsx(u,{"data-slot":"button","data-variant":r,"data-size":a,className:je(tM({variant:r,size:a,className:e})),...o})}const ew=(...e)=>e.filter((r,a,l)=>!!r&&r.trim()!==""&&l.indexOf(r)===a).join(" ").trim();const nM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const rM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,a,l)=>l?l.toUpperCase():a.toLowerCase());const Zv=e=>{const r=rM(e);return r.charAt(0).toUpperCase()+r.slice(1)};var aM={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"};const lM=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};const iM=S.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:o="",children:u,iconNode:d,...f},h)=>S.createElement("svg",{ref:h,...aM,width:r,height:r,stroke:e,strokeWidth:l?Number(a)*24/Number(r):a,className:ew("lucide",o),...!u&&!lM(f)&&{"aria-hidden":"true"},...f},[...d.map(([p,y])=>S.createElement(p,y)),...Array.isArray(u)?u:[u]]));const ve=(e,r)=>{const a=S.forwardRef(({className:l,...o},u)=>S.createElement(iM,{ref:u,iconNode:r,className:ew(`lucide-${nM(Zv(e))}`,`lucide-${e}`,l),...o}));return a.displayName=Zv(e),a};const sM=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],oM=ve("activity",sM);const cM=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],uM=ve("arrow-left",cM);const dM=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],tw=ve("book-open",dM);const fM=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],nw=ve("brain",fM);const hM=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],mM=ve("calendar-clock",hM);const pM=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],gM=ve("calendar",pM);const xM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ah=ve("check",xM);const yM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vM=ve("chevron-down",yM);const bM=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Cm=ve("chevron-left",bM);const SM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],zr=ve("chevron-right",SM);const wM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kM=ve("chevron-up",wM);const jM=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],CM=ve("cloud",jM);const NM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Jv=ve("copy",NM);const EM=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],rw=ve("cpu",EM);const AM=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],_M=ve("credit-card",AM);const TM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],RM=ve("download",TM);const MM=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],OM=ve("ellipsis-vertical",MM);const DM=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],zM=ve("ellipsis",DM);const LM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Nm=ve("external-link",LM);const PM=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],UM=ve("eye-off",PM);const IM=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],BM=ve("eye",IM);const HM=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],qM=ve("facebook",HM);const FM=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],GM=ve("file-down",FM);const $M=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Em=ve("file-text",$M);const YM=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],Wv=ve("folder-kanban",YM);const VM=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],KM=ve("folder-open",VM);const XM=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],QM=ve("github",XM);const ZM=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],aw=ve("hard-drive",ZM);const JM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],WM=ve("history",JM);const eO=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],tO=ve("image-plus",eO);const nO=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],rO=ve("layout-dashboard",nO);const aO=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],lO=ve("layout-grid",aO);const iO=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],lw=ve("lightbulb",iO);const sO=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],oO=ve("link-2",sO);const cO=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],uO=ve("list-todo",cO);const dO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Nc=ve("loader-circle",dO);const fO=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],hO=ve("lock",fO);const mO=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],eb=ve("mail",mO);const pO=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],ss=ve("message-circle",pO);const gO=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],xO=ve("message-square",gO);const yO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],vO=ve("panel-left",yO);const bO=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],SO=ve("pen-tool",bO);const wO=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],kO=ve("pencil",wO);const jO=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],CO=ve("play",jO);const NO=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],iw=ve("plug",NO);const EO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],sw=ve("plus",EO);const AO=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],_O=ve("power",AO);const TO=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],RO=ve("presentation",TO);const MO=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ow=ve("puzzle",MO);const OO=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tb=ve("search",OO);const DO=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],zO=ve("send",DO);const LO=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],_h=ve("server",LO);const PO=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],cw=ve("settings-2",PO);const UO=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],IO=ve("share-2",UO);const BO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]],HO=ve("sheet",BO);const qO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],nb=ve("shield-alert",qO);const FO=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],uw=ve("sparkles",FO);const GO=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],$O=ve("square-check-big",GO);const YO=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ec=ve("trash-2",YO);const VO=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],KO=ve("user",VO);const XO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],QO=ve("users",XO);const ZO=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],JO=ve("video",ZO);const WO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],us=ve("x",WO);const e4=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],t4=ve("youtube",e4);const n4=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],r4=ve("zap",n4),Kf=768;function a4(){const[e,r]=S.useState(void 0);return S.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Kf-1}px)`),l=()=>{r(window.innerWidth<Kf)};return a.addEventListener("change",l),r(window.innerWidth<Kf),()=>a.removeEventListener("change",l)},[]),!!e}function kt({className:e,type:r,...a}){return s.jsx("input",{type:r,"data-slot":"input",className:je("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}function au({...e}){return s.jsx(H0,{"data-slot":"sheet",...e})}function l4({...e}){return s.jsx(q0,{"data-slot":"sheet-portal",...e})}function i4({className:e,...r}){return s.jsx(F0,{"data-slot":"sheet-overlay",className:je("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function lu({className:e,children:r,side:a="right",showCloseButton:l=!0,...o}){return s.jsxs(l4,{children:[s.jsx(i4,{}),s.jsxs(G0,{"data-slot":"sheet-content",className:je("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[r,l&&s.jsxs(V0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[s.jsx(us,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function iu({className:e,...r}){return s.jsx("div",{"data-slot":"sheet-header",className:je("flex flex-col gap-1.5 p-4",e),...r})}function su({className:e,...r}){return s.jsx($0,{"data-slot":"sheet-title",className:je("text-foreground font-semibold",e),...r})}function ou({className:e,...r}){return s.jsx(Y0,{"data-slot":"sheet-description",className:je("text-muted-foreground text-sm",e),...r})}function s4({delayDuration:e=0,...r}){return s.jsx(iR,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function o4({...e}){return s.jsx(sR,{"data-slot":"tooltip",...e})}function c4({...e}){return s.jsx(oR,{"data-slot":"tooltip-trigger",...e})}function u4({className:e,sideOffset:r=0,children:a,...l}){return s.jsx(cR,{children:s.jsxs(uR,{"data-slot":"tooltip-content",sideOffset:r,className:je("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...l,children:[a,s.jsx(dR,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const d4="sidebar_state",f4=3600*24*7,h4="16rem",m4="18rem",p4="3rem",g4="b",dw=S.createContext(null);function cu(){const e=S.useContext(dw);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function x4({defaultOpen:e=!0,open:r,onOpenChange:a,className:l,style:o,children:u,...d}){const f=a4(),[h,p]=S.useState(!1),[y,g]=S.useState(e),v=r??y,b=S.useCallback(j=>{const R=typeof j=="function"?j(v):j;a?a(R):g(R),document.cookie=`${d4}=${R}; path=/; max-age=${f4}`},[a,v]),k=S.useCallback(()=>f?p(j=>!j):b(j=>!j),[f,b,p]);S.useEffect(()=>{const j=R=>{R.key===g4&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),k())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[k]);const C=v?"expanded":"collapsed",N=S.useMemo(()=>({state:C,open:v,setOpen:b,isMobile:f,openMobile:h,setOpenMobile:p,toggleSidebar:k}),[C,v,b,f,h,p,k]);return s.jsx(dw.Provider,{value:N,children:s.jsx(s4,{delayDuration:0,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":h4,"--sidebar-width-icon":p4,...o},className:je("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",l),...d,children:u})})})}function y4({side:e="left",variant:r="sidebar",collapsible:a="offcanvas",className:l,children:o,...u}){const{isMobile:d,state:f,openMobile:h,setOpenMobile:p}=cu();return a==="none"?s.jsx("div",{"data-slot":"sidebar",className:je("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",l),...u,children:o}):d?s.jsx(au,{open:h,onOpenChange:p,...u,children:s.jsxs(lu,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":m4},side:e,children:[s.jsxs(iu,{className:"sr-only",children:[s.jsx(su,{children:"Sidebar"}),s.jsx(ou,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):s.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?a:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[s.jsx("div",{"data-slot":"sidebar-gap",className:je("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{"data-slot":"sidebar-container",className:je("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"||r==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",l),...u,children:s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function v4({className:e,onClick:r,...a}){const{toggleSidebar:l}=cu();return s.jsxs(ue,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:je("size-7",e),onClick:o=>{r?.(o),l()},...a,children:[s.jsx(vO,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function b4({className:e,...r}){const{toggleSidebar:a}=cu();return s.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:je("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...r})}function S4({className:e,...r}){return s.jsx("main",{"data-slot":"sidebar-inset",className:je("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...r})}function w4({className:e,...r}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:je("flex flex-col gap-2 p-2",e),...r})}function k4({className:e,...r}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:je("flex flex-col gap-2 p-2",e),...r})}function j4({className:e,...r}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:je("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function C4({className:e,...r}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:je("relative flex w-full min-w-0 flex-col p-2",e),...r})}function N4({className:e,asChild:r=!1,...a}){const l=r?Uc:"div";return s.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:je("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function Xf({className:e,...r}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:je("flex w-full min-w-0 flex-col gap-1",e),...r})}function Qf({className:e,...r}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:je("group/menu-item relative",e),...r})}const E4=Lc("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Zf({asChild:e=!1,isActive:r=!1,variant:a="default",size:l="default",tooltip:o,className:u,...d}){const f=e?Uc:"button",{isMobile:h,state:p}=cu(),y=s.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":l,"data-active":r,className:je(E4({variant:a,size:l}),u),...d});return o?(typeof o=="string"&&(o={children:o}),s.jsxs(o4,{children:[s.jsx(c4,{asChild:!0,children:y}),s.jsx(u4,{side:"right",align:"center",hidden:p!=="collapsed"||h,...o})]})):y}const A4=[{page:"chat",label:"AI Chat",icon:xO},{page:"skills",label:"Skills",icon:tw},{page:"integrations",label:"Integrations",icon:iw},{page:"jobs",label:"Jobs",icon:mM},{page:"settings",label:"Settings",icon:cw}];function _4({activePage:e,onNavigate:r,...a}){return s.jsxs(y4,{collapsible:"icon",...a,children:[s.jsx(w4,{children:s.jsx(Xf,{children:s.jsx(Qf,{children:s.jsxs(Zf,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[s.jsxs("div",{className:"bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center overflow-hidden rounded-lg p-1",children:[s.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-full object-contain dark:hidden","aria-hidden":!0}),s.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-full object-contain hidden dark:block","aria-hidden":!0})]}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:"Sulala Agent"}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Local AI orchestration"})]})]})})})}),s.jsx(j4,{children:s.jsxs(C4,{children:[s.jsx(N4,{children:"Main"}),s.jsx(Xf,{children:A4.map(l=>s.jsx(Qf,{children:s.jsxs(Zf,{tooltip:l.label,isActive:e===l.page,onClick:()=>r(l.page),children:[s.jsx(l.icon,{className:"size-4"}),s.jsx("span",{children:l.label})]})},l.page))})]})}),s.jsx(k4,{children:s.jsx(Xf,{children:s.jsx(Qf,{children:s.jsx(Zf,{size:"lg",className:"text-muted-foreground cursor-default",children:s.jsx("span",{className:"truncate text-xs",children:"127.0.0.1"})})})})}),s.jsx(b4,{})]})}const fw="sulala-theme";function T4(){if(typeof window>"u")return"light";const e=localStorage.getItem(fw);return e==="dark"||e==="light"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function R4(e){if(typeof document>"u")return;const r=document.documentElement;e==="dark"?r.classList.add("dark"):r.classList.remove("dark")}function M4(){const[e,r]=S.useState(T4);return S.useEffect(()=>{R4(e),localStorage.setItem(fw,e)},[e]),{theme:e,setTheme:o=>{r(u=>typeof o=="function"?o(u):o)},toggle:()=>r(o=>o==="dark"?"light":"dark")}}function O4({activePage:e,onNavigate:r,error:a,children:l}){const{theme:o,toggle:u}=M4();return s.jsxs(x4,{children:[s.jsx(_4,{activePage:e,onNavigate:r}),s.jsxs(S4,{children:[s.jsxs("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b px-4",children:[s.jsx(v4,{className:"-ml-1"}),s.jsx("div",{className:"flex-1"}),s.jsx(ue,{variant:"outline",size:"sm",onClick:u,"aria-label":"Toggle theme",children:o==="dark"?"Light":"Dark"})]}),s.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-4 md:p-6 w-full",children:[a&&s.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-4 py-2 text-sm text-destructive",children:a}),l]})]})]})}const xe="http://localhost:2026",rb="https://hub.sulala.ai".trim?.()||null,D4=null;function we(e={}){return{"Content-Type":"application/json",...e}}async function hw(){const e=await fetch(`${xe}/api/schedules`,{headers:we()});if(!e.ok)throw new Error(`Failed to fetch schedules: ${e.status}`);return e.json()}async function mw(e){const r=await fetch(`${xe}/api/schedules`,{method:"POST",headers:we(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Create schedule failed: ${r.status}`)}return r.json()}async function pw(e){const r=await fetch(`${xe}/api/jobs/parse`,{method:"POST",headers:we(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Parse failed: ${r.status}`)}return r.json()}async function gw(e,r){const a=await fetch(`${xe}/api/schedules/${encodeURIComponent(e)}`,{method:"PATCH",headers:we(),body:JSON.stringify(r)});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Update schedule failed: ${a.status}`)}return a.json()}async function xw(e){const r=await fetch(`${xe}/api/schedules/${encodeURIComponent(e)}`,{method:"DELETE",headers:we()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Delete schedule failed: ${r.status}`)}}async function yw(e){const r=await fetch(`${xe}/api/schedules/${encodeURIComponent(e)}/run`,{method:"POST",headers:we()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Run job failed: ${r.status}`)}return r.json()}async function Am(){const e=await fetch(`${xe}/api/channels/telegram`,{headers:we()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Fetch Telegram channel failed: ${e.status}`)}return e.json()}async function vw(e){const r=await fetch(`${xe}/api/channels/telegram`,{method:"PUT",headers:we(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Update Telegram channel failed: ${r.status}`)}return r.json()}async function bw(){const e=await fetch(`${xe}/api/channels/discord`,{headers:we()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Fetch Discord channel failed: ${e.status}`)}return e.json()}async function Sw(e){const r=await fetch(`${xe}/api/channels/discord`,{method:"PUT",headers:we(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Update Discord channel failed: ${r.status}`)}return r.json()}async function ww(){const e=await fetch(`${xe}/api/channels/stripe`,{headers:we()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Fetch Stripe channel failed: ${e.status}`)}return e.json()}async function kw(e){const r=await fetch(`${xe}/api/channels/stripe`,{method:"PUT",headers:we(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Update Stripe channel failed: ${r.status}`)}return r.json()}async function jw(e,r=30){const a=await fetch(`${xe}/api/schedules/${encodeURIComponent(e)}/runs?limit=${r}`,{headers:we()});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Fetch runs failed: ${a.status}`)}return a.json()}async function _m(){const e=await fetch(`${xe}/api/onboard/status`,{headers:we()});return e.ok?e.json():{complete:!1}}async function Cw(){const e=await fetch(`${xe}/api/onboard/complete`,{method:"PUT",headers:we()});if(!e.ok)throw new Error(`Failed to complete onboarding: ${e.status}`);return e.json()}async function or(){const e=await fetch(`${xe}/api/onboard/env`,{headers:we()});return e.ok?e.json():{keys:{}}}async function Ns(e){const r=await fetch(`${xe}/api/onboard/env`,{method:"PUT",headers:we(),body:JSON.stringify(e)});if(!r.ok)throw new Error(`Failed to save API keys: ${r.status}`);return r.json()}async function Nw(){const e=await fetch(`${xe}/api/onboard/recommended-models`,{headers:we()});return e.ok?e.json():{models:[]}}async function Ew(e){const r=await fetch(`${xe}/api/ollama/pull`,{method:"POST",headers:we(),body:JSON.stringify({model:e})});if(!r.ok)throw new Error(`Failed to pull model: ${r.status}`);return r.json()}async function Aw(){const e=await fetch(`${xe}/health`,{headers:we()});if(!e.ok)throw new Error(`Gateway health check failed: ${e.status}`);return e.json()}async function _w(e=50){const r=await fetch(`${xe}/api/tasks?limit=${e}`,{headers:we()});if(!r.ok)throw new Error(`Failed to fetch tasks: ${r.status}`);return r.json()}async function Tw(e=100){const r=await fetch(`${xe}/api/logs?limit=${e}`,{headers:we()});if(!r.ok)throw new Error(`Failed to fetch logs: ${r.status}`);return r.json()}async function Rw(e=200){const r=await fetch(`${xe}/api/file-states?limit=${e}`,{headers:we()});if(!r.ok)throw new Error(`Failed to fetch file states: ${r.status}`);return r.json()}async function Mw(e){const r=await fetch(`${xe}/api/tasks`,{method:"POST",headers:we(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to enqueue task: ${r.status}`)}return r.json()}function Ow(){const e=new URL(xe);return e.protocol=e.protocol==="https:"?"wss:":"ws:",`${e.origin}/ws`}async function Es(e){const r=await fetch(`${xe}/api/agent/models?provider=${encodeURIComponent(e)}`,{headers:we()});if(!r.ok)throw new Error(`Failed to fetch models: ${r.status}`);return r.json()}async function Dw(e){const r=e?`?session_id=${encodeURIComponent(e)}`:"",a=await fetch(`${xe}/api/agent/pending-actions${r}`,{headers:we()});if(!a.ok)throw new Error(`Failed to fetch pending actions: ${a.status}`);return a.json()}async function zw(e){const r=await fetch(`${xe}/api/agent/pending-actions/${encodeURIComponent(e)}/approve`,{method:"POST",headers:we()});if(!r.ok)throw new Error(`Failed to approve: ${r.status}`);return r.json()}async function Lw(e){const r=await fetch(`${xe}/api/agent/pending-actions/${encodeURIComponent(e)}/reject`,{method:"POST",headers:we()});if(!r.ok)throw new Error(`Failed to reject: ${r.status}`);return r.json()}function Tm(e){const r=e?.trim()||D4;return r?r.replace(/\/$/,""):null}async function Th(e){const r=Tm(e);if(!r)throw new Error("Integrations URL not configured. Set INTEGRATIONS_URL in the agent .env or configure Portal in Settings.");const a=await fetch(`${r}/integrations`,{cache:"no-store"});if(!a.ok)throw new Error(`Failed to fetch integrations: ${a.status}`);return{integrations:((await a.json()).integrations??[]).map(d=>{if(typeof d!="object"||d===null||!("id"in d)||typeof d.id!="string")return{id:"unknown",name:"Unknown",iconUrl:"",description:"",connections:[]};const f=d,h=Array.isArray(f.connections)?f.connections.map(p=>{const y=p;return{id:String(y?.id??""),provider:String(y?.provider??""),scopes:Array.isArray(y?.scopes)?y.scopes:[],createdAt:Number(y?.createdAt??0),updatedAt:y?.updatedAt!=null?Number(y.updatedAt):void 0}}):[];return{id:f.id,name:typeof f.name=="string"?f.name:f.id,iconUrl:typeof f.iconUrl=="string"?f.iconUrl:"",description:typeof f.description=="string"?f.description:"",connections:h}})}}async function Pw(e,r,a){const l=Tm(a);if(!l)throw new Error("Integrations URL not configured. Set INTEGRATIONS_URL or use Portal in Settings.");const o=await fetch(`${l}/connect/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirect_success:r})});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||`Connect failed: ${o.status}`)}return o.json()}async function Uw(e,r){const a=Tm(r);if(!a)throw new Error("Integrations URL not configured.");const l=await fetch(`${a}/connections/${encodeURIComponent(e)}`,{method:"DELETE"});if(!l.ok)throw new Error(`Failed to disconnect: ${l.status}`);return l.json()}async function Va(){const e=await fetch(`${xe}/api/config`,{headers:we(),cache:"no-store"});if(!e.ok)throw new Error(`Failed to fetch config: ${e.status}`);return e.json()}async function Rm(){const e=await fetch(`${xe}/api/mcp/config`,{headers:we(),cache:"no-store"});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to fetch MCP config: ${e.status}`)}return e.json()}async function Iw(e){const r=await fetch(`${xe}/api/mcp/config`,{method:"PUT",headers:we(),body:JSON.stringify({servers:e})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to save MCP config: ${r.status}`)}return r.json()}async function Bw(e){const r=await fetch(`${xe}/api/mcp/build-with-ai`,{method:"POST",headers:we(),body:JSON.stringify({description:e.trim()})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to start build: ${r.status}`)}return r.json()}async function Mm(e){const r=e?.trim()?`?return_to=${encodeURIComponent(e.trim())}`:"",a=await fetch(`${xe}/api/oauth/connect-url${r}`,{headers:we(),cache:"no-store"});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Failed to get Connect URL: ${a.status}`)}return a.json()}async function Hw(){const e=await fetch(`${xe}/api/integrations/connections`,{headers:we(),cache:"no-store"});if(!e.ok){const a=await e.json().catch(()=>({}));throw new Error(a.error||`Failed to fetch Portal connections: ${e.status}`)}return{connections:(await e.json()).connections??[]}}async function qw(e,r){const a=await fetch(`${xe}/api/integrations/connect`,{method:"POST",headers:we(),body:JSON.stringify({provider:e,redirect_success:r})});if(!a.ok){const o=await a.json().catch(()=>({}));throw new Error(o.error||`Connect failed: ${a.status}`)}const l=await a.json();if(!l.authUrl)throw new Error("No authUrl from agent");return{authUrl:l.authUrl,connectionId:l.connectionId??null}}async function Fw(e){const r=await fetch(`${xe}/api/integrations/connections/${encodeURIComponent(e)}`,{method:"DELETE",headers:we()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Disconnect failed: ${r.status}`)}return r.json()}async function Ac(){const e=await fetch(`${xe}/api/settings/job-default`,{headers:we()});if(!e.ok)throw new Error(`Failed to fetch job default: ${e.status}`);return e.json()}async function Gw(e){const r=await fetch(`${xe}/api/settings/job-default`,{method:"PUT",headers:we(),body:JSON.stringify(e)});if(!r.ok)throw new Error(`Failed to update job default: ${r.status}`);return r.json()}async function Kl(){const e=await fetch(`${xe}/api/ollama/status`,{headers:we()});return e.ok?e.json():{running:!1}}async function $w(){const e=await fetch(`${xe}/api/system/capabilities`,{headers:we()});return e.ok?e.json():{storageFreeBytes:null,isCloudOrContainer:!1,cloudReason:"",ollamaSuitable:!0,ollamaSuitableReason:"Check unavailable"}}async function Yw(){const e=await fetch(`${xe}/api/ollama/install`,{method:"POST",headers:we()});if(!e.ok)throw new Error(`Install failed: ${e.status}`);return e.json()}async function Vw(){const e=await fetch(`${xe}/api/ollama/pull-status`,{headers:we()});return e.ok?e.json():{inProgress:!1,model:"",lastLine:"",percent:0}}async function Kw(e){const r=await fetch(`${xe}/api/tasks/${encodeURIComponent(e)}`,{method:"PATCH",headers:we(),body:JSON.stringify({action:"cancel"})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Cancel failed: ${r.status}`)}return r.json()}async function Xw(e){const r=await fetch(`${xe}/api/tasks/${encodeURIComponent(e)}`,{method:"PATCH",headers:we(),body:JSON.stringify({action:"retry"})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Retry failed: ${r.status}`)}return r.json()}async function hc(){const e=await fetch(`${xe}/api/agent/skills/config`,{headers:we()});if(!e.ok)throw new Error(`Failed to fetch skills config: ${e.status}`);return e.json()}async function Rh(e){const r=await fetch(`${xe}/api/agent/skills/config`,{method:"PUT",headers:we(),body:JSON.stringify({skills:e})});if(!r.ok)throw new Error(`Failed to save skills config: ${r.status}`);return r.json()}async function Qw(){const e=await fetch(`${xe}/api/agent/skills/updates`,{headers:we()});if(!e.ok)throw new Error(`Failed to fetch updates: ${e.status}`);return e.json()}function ai(){return rb?rb.replace(/\/$/,""):null}function Hl(){const e=ai();return e?`${e}/api/sulalahub/registry`:null}function Om(){const e=ai();return e?`${e}/api/sulalahub/system/registry`:null}function os(e){const r=ai();return r?`${r}/api/sulalahub/skills/${e}`:null}async function _c(){const e=Hl(),r=e?`${xe}/api/agent/skills/registry?url=${encodeURIComponent(e)}`:`${xe}/api/agent/skills/registry`,a=await fetch(r,{headers:we()});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Failed to fetch registry: ${a.status}`)}return a.json()}async function Mh(){const e=Om();if(!e)return{skills:[]};const r=await fetch(e);if(!r.ok)throw new Error(`Failed to fetch system registry: ${r.status}`);return r.json()}async function Zw(){const e=await fetch(`${xe}/api/agent/skills/update`,{method:"POST",headers:we()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Update failed: ${e.status}`)}return e.json()}async function Jw(e,r){const a=await fetch(`${xe}/api/agent/skills/uninstall`,{method:"POST",headers:we(),body:JSON.stringify({slug:e,target:r})});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Uninstall failed: ${a.status}`)}return a.json()}async function Dm(e,r,a){const l={slug:e,target:r},o=a?.registryUrl??(a?.system?Om():null)??Hl()??void 0;o&&(l.registryUrl=o);const u=await fetch(`${xe}/api/agent/skills/install`,{method:"POST",headers:we(),body:JSON.stringify(l)});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d.error||`Install failed: ${u.status}`)}return u.json()}async function Ww(){const e=await fetch(`${xe}/api/agent/skills`,{headers:we()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to fetch skills: ${e.status}`)}return e.json()}async function Oh(){const r=await(await fetch(`${xe}/api/agent/skills/publish-status`,{headers:we()})).json().catch(()=>({}));return{submissions:Array.isArray(r.submissions)?r.submissions:[]}}async function ek(e,r){const a=await fetch(`${xe}/api/agent/skills/publish`,{method:"POST",headers:we(),body:JSON.stringify({slug:e,priceIntent:r?.priceIntent??"free",intendedPriceCents:r?.intendedPriceCents})}),l=await a.json().catch(()=>({}));if(!a.ok)throw new Error(l.error||`Publish failed: ${a.status}`);return l}async function tk(){const e=await fetch(`${xe}/api/agent/skills/wizard-apps`,{headers:we()});if(!e.ok)throw new Error(`Failed to fetch wizard options: ${e.status}`);return e.json()}async function Dh(e){const r=await fetch(`${xe}/api/agent/skills/generate`,{method:"POST",headers:we(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Generate failed: ${r.status}`)}return r.json()}async function zh(e=50){const r=await fetch(`${xe}/api/agent/sessions?limit=${encodeURIComponent(String(e))}`,{headers:we()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to list sessions: ${r.status}`)}return r.json()}async function nk(e){const r=await fetch(`${xe}/api/agent/sessions`,{method:"POST",headers:we(),body:JSON.stringify(e??{})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to create session: ${r.status}`)}return r.json()}async function rk(){const e=await fetch(`${xe}/api/agent/memory/scope-keys`,{headers:we()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to fetch memory scope keys: ${e.status}`)}return e.json()}async function ak(e){const r=new URLSearchParams;r.set("scope",e.scope),r.set("scope_key",e.scope_key),r.set("limit",String(e.limit));const a=await fetch(`${xe}/api/agent/memory?${r.toString()}`,{headers:we()});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Failed to fetch memory: ${a.status}`)}return a.json()}async function Ba(e){const r=await fetch(`${xe}/api/agent/sessions/${encodeURIComponent(e)}`,{headers:we()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to load session: ${r.status}`)}return r.json()}async function lk(e){const r=await new Promise((l,o)=>{const u=new FileReader;u.onload=()=>{const d=u.result,f=d.includes(",")?d.slice(d.indexOf(",")+1):d;l(f)},u.onerror=()=>o(new Error("Failed to read file")),u.readAsDataURL(e)}),a=await fetch(`${xe}/api/upload`,{method:"POST",headers:we(),body:JSON.stringify({filename:e.name,content_type:e.type,data:r})});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Upload failed: ${a.status}`)}return a.json()}async function ik(e,r){const a=`${xe}/api/agent/sessions/${encodeURIComponent(e)}/messages`;try{const l=await fetch(a,{method:"POST",headers:we(),body:JSON.stringify(r)});if(!l.ok){const o=await l.json().catch(()=>({}));if(l.status===422&&o.type==="missing_integrations"&&Array.isArray(o.missing)){const d=new Error(o.error||"Missing required integrations");throw d.missing=o.missing,d}const u=o.error||`Agent request failed: ${l.status}`;throw console.error("[chat] fetchAgentSendMessage failed:",l.status,a,u),new Error(u)}return l.json()}catch(l){throw console.error("[chat] fetchAgentSendMessage fetch error:",a,l),l}}async function Lh(e,r,a){const l=`${xe}/api/agent/sessions/${encodeURIComponent(e)}/messages/stream`;let o;try{o=await fetch(l,{method:"POST",headers:we(),body:JSON.stringify(r)})}catch(p){console.error("[chat] fetchAgentSendMessageStream fetch error:",l,p),a.onError(p instanceof Error?p.message:"Fetch failed");return}if(!o.ok){const p=await o.json().catch(()=>({}));o.status===422&&p.type==="missing_integrations"&&Array.isArray(p.missing)&&a.onMissingIntegrations?.(p.missing);const y=p.error||`Stream failed: ${o.status}`;console.error("[chat] fetchAgentSendMessageStream failed:",o.status,l,y),a.onError(y);return}const u=o.body?.getReader();if(!u){a.onError("No response body");return}const d=new TextDecoder;let f="",h="";try{for(;;){const{done:p,value:y}=await u.read();if(p)break;f+=d.decode(y,{stream:!0});const g=f.split(`
54
+ `);f=g.pop()??"";for(const v of g)if(v.startsWith("event:"))h=v.slice(6).trim();else if(v.startsWith("data:")&&h){try{const b=JSON.parse(v.slice(5).trim());h==="assistant"&&b.delta?a.onDelta(b.delta):h==="thinking"&&b.delta?a.onThinking?.(b.delta):h==="done"&&b.finalContent!=null?a.onDone(b.finalContent):h==="pending_approval"&&b.pendingActionId?a.onPendingApproval?.(b.pendingActionId):h==="error"&&b.message&&a.onError(b.message)}catch{}h=""}}if(f.trim()&&h&&f.startsWith("data:"))try{const p=JSON.parse(f.slice(5).trim());h==="done"&&p.finalContent!=null&&a.onDone(p.finalContent)}catch{}}finally{u.releaseLock()}}const z4=Object.freeze(Object.defineProperty({__proto__:null,approvePendingAction:zw,buildMcpServerWithAi:Bw,createSchedule:mw,deleteIntegrationsConnection:Uw,deletePortalConnection:Fw,deleteSchedule:xw,enqueueTask:Mw,fetchAgentMemory:ak,fetchAgentMemoryScopeKeys:rk,fetchAgentModels:Es,fetchAgentSendMessage:ik,fetchAgentSendMessageStream:Lh,fetchAgentSession:Ba,fetchAgentSessionCreate:nk,fetchAgentSessions:zh,fetchAgentSkillGenerate:Dh,fetchAgentSkillInstall:Dm,fetchAgentSkillPublish:ek,fetchAgentSkillUninstall:Jw,fetchAgentSkillWizardApps:tk,fetchAgentSkills:Ww,fetchAgentSkillsConfig:hc,fetchAgentSkillsConfigSave:Rh,fetchAgentSkillsPublishStatus:Oh,fetchAgentSkillsRegistry:_c,fetchAgentSkillsSystemRegistry:Mh,fetchAgentSkillsUpdate:Zw,fetchAgentSkillsUpdates:Qw,fetchChannelsDiscord:bw,fetchChannelsStripe:ww,fetchChannelsTelegram:Am,fetchConfig:Va,fetchFileStates:Rw,fetchHealth:Aw,fetchIntegrations:Th,fetchJobDefault:Ac,fetchLogs:Tw,fetchMcpConfig:Rm,fetchOAuthConnectUrl:Mm,fetchOllamaPullStatus:Vw,fetchOllamaStatus:Kl,fetchOnboardEnv:or,fetchOnboardStatus:_m,fetchParseJobPrompt:pw,fetchPendingActions:Dw,fetchPortalConnections:Hw,fetchRecommendedModels:Nw,fetchScheduleRuns:jw,fetchSchedules:hw,fetchSystemCapabilities:$w,fetchTasks:_w,fetchUploadFile:lk,getHubBaseUrl:ai,getHubRegistryUrl:Hl,getHubSkillContentUrl:os,getHubSystemRegistryUrl:Om,postOllamaInstall:Yw,postOllamaPull:Ew,putOnboardComplete:Cw,putOnboardEnv:Ns,rejectPendingAction:Lw,runScheduleJob:yw,startIntegrationsConnect:Pw,startPortalConnect:qw,taskCancel:Kw,taskRetry:Xw,updateChannelsDiscord:Sw,updateChannelsStripe:kw,updateChannelsTelegram:vw,updateJobDefault:Gw,updateMcpConfig:Iw,updateSchedule:gw,wsUrl:Ow},Symbol.toStringTag,{value:"Module"}));function L4(e){const[r,a]=S.useState(null),[l,o]=S.useState([]),[u,d]=S.useState([]),[f,h]=S.useState([]),[p,y]=S.useState([]),[g,v]=S.useState(!0),[b,k]=S.useState("heartbeat"),[C,N]=S.useState("{}"),[j,R]=S.useState(!1),[M,O]=S.useState(null),L=async()=>{v(!0);try{const[q,z,F,J,Y]=await Promise.all([Aw(),_w(),Tw(),Rw(),hw()]);a(q),o(z.tasks),d(F.logs),h(J.fileStates),y(Y.schedules)}catch(q){e(q instanceof Error?q.message:"Failed to load"),a(null),o([]),d([]),h([]),y([])}finally{v(!1)}},D=S.useRef(L);return D.current=L,S.useEffect(()=>{D.current()},[]),S.useEffect(()=>{const q=setInterval(()=>D.current(),3e4);return()=>clearInterval(q)},[]),{health:r,tasks:l,logs:u,fileStates:f,schedules:p,loading:g,load:L,enqueueType:b,setEnqueueType:k,enqueuePayload:C,setEnqueuePayload:N,enqueueing:j,actionTaskId:M,handleTaskCancel:async q=>{O(q);try{await Kw(q),await L()}catch(z){e(z instanceof Error?z.message:"Cancel failed")}finally{O(null)}},handleTaskRetry:async q=>{O(q);try{await Xw(q),await L()}catch(z){e(z instanceof Error?z.message:"Retry failed")}finally{O(null)}},handleEnqueue:async()=>{R(!0);try{let q=null;try{q=C.trim()?JSON.parse(C):null}catch{e("Payload must be valid JSON");return}await Mw({type:b,payload:q}),await L()}catch(q){e(q instanceof Error?q.message:"Enqueue failed")}finally{R(!1)}},handleCreateSchedule:async q=>{try{await mw(q),await L()}catch(z){e(z instanceof Error?z.message:"Create schedule failed")}},handleUpdateSchedule:async(q,z)=>{try{await gw(q,z),await L()}catch(F){e(F instanceof Error?F.message:"Update schedule failed")}},handleDeleteSchedule:async q=>{try{await xw(q),await L()}catch(z){e(z instanceof Error?z.message:"Delete schedule failed")}},handleRunSchedule:async q=>yw(q),handleFetchScheduleRuns:async q=>jw(q)}}const P4=Lc("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function jt({className:e,variant:r="default",asChild:a=!1,...l}){const o=a?Uc:"span";return s.jsx(o,{"data-slot":"badge","data-variant":r,className:je(P4({variant:r}),e),...l})}function it({className:e,...r}){return s.jsx("div",{"data-slot":"card",className:je("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function xt({className:e,...r}){return s.jsx("div",{"data-slot":"card-header",className:je("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function yt({className:e,...r}){return s.jsx("div",{"data-slot":"card-title",className:je("leading-none font-semibold",e),...r})}function vt({className:e,...r}){return s.jsx("div",{"data-slot":"card-description",className:je("text-muted-foreground text-sm",e),...r})}function st({className:e,...r}){return s.jsx("div",{"data-slot":"card-content",className:je("px-6",e),...r})}function li({className:e,children:r,...a}){return s.jsxs(LT,{"data-slot":"scroll-area",className:je("relative",e),...a,children:[s.jsx(PT,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:r}),s.jsx(U4,{}),s.jsx(UT,{})]})}function U4({className:e,orientation:r="vertical",...a}){return s.jsx(fS,{"data-slot":"scroll-area-scrollbar",orientation:r,className:je("flex touch-none p-px transition-colors select-none",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:s.jsx(gS,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function As(e){return new Date(e).toLocaleTimeString()}function sk(e){const r=new Date(e),a=new Date;return r.getDate()===a.getDate()&&r.getMonth()===a.getMonth()&&r.getFullYear()===a.getFullYear()?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function I4({event:e}){return e.type==="connected"||e.type==="pong"?s.jsxs("div",{className:"text-muted-foreground text-sm",children:[e.type," @ ",As(e.ts)]}):e.type==="file_event"?s.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1 text-sm",children:[s.jsx("span",{className:"font-medium",children:e.payload.event})," ",s.jsx("span",{className:"text-muted-foreground break-all",children:e.payload.path})]}):e.type==="task_done"?s.jsxs("div",{className:"text-sm",children:["Task done: ",s.jsx("span",{className:"font-mono text-xs",children:e.taskId})]}):null}function B4({health:e,loading:r,connected:a,events:l}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"Gateway"}),s.jsx(vt,{children:"API server status"})]}),s.jsx(st,{className:"flex items-center gap-2",children:r?s.jsx("span",{className:"text-muted-foreground text-sm",children:"Checking…"}):e?s.jsx(jt,{variant:"default",children:e.status}):s.jsx(jt,{variant:"destructive",children:"Unreachable"})})]}),s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"WebSocket"}),s.jsx(vt,{children:"Live event stream"})]}),s.jsx(st,{className:"flex items-center gap-2",children:s.jsx(jt,{variant:a?"default":"secondary",children:a?"Connected":"Disconnected"})})]})]}),s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"Live events"}),s.jsx(vt,{children:"File and task events from the gateway"})]}),s.jsx(st,{children:s.jsx(li,{className:"h-[280px] rounded-md border p-3",children:s.jsx("div",{className:"space-y-2",children:l.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No events yet. Change a file in a watched folder or run a task."}):l.map((o,u)=>s.jsx(I4,{event:o},u))})})})]})]})}function H4(e){const[r,a]=S.useState([]),[l,o]=S.useState(!1),[u,d]=S.useState(""),[f,h]=S.useState([]),[p,y]=S.useState(!1),[g,v]=S.useState([]),[b,k]=S.useState(!1),[C,N]=S.useState(null),[j,R]=S.useState(null),[M,O]=S.useState(null),[L,D]=S.useState(!1),[I,B]=S.useState(null),[V,P]=S.useState("~/.sulala/config.json"),[ee,te]=S.useState(new Set),[ce,ae]=S.useState("installed"),[q,z]=S.useState({}),[F,J]=S.useState({}),Y=()=>{o(!0),Ww().then(pe=>a(pe.skills||[])).catch(()=>a([])).finally(()=>o(!1))},A=()=>{Y(),y(!0),k(!0),hc().then(pe=>{B(pe.skills??null),pe.configPath&&P(pe.configPath)}).catch(()=>B(null)),Qw().then(pe=>te(new Set(pe.updates.map(Oe=>Oe.slug)))).catch(()=>te(new Set)),Promise.all([_c().then(pe=>h(pe.skills||[])).catch(()=>h([])),Mh().then(pe=>v(pe.skills||[])).catch(()=>v([]))]).finally(()=>{y(!1),k(!1)}),Oh().then(pe=>{const Oe={};for(const De of pe.submissions)Oe[De.slug]=De.status;J(Oe)}).catch(()=>J({}))},_=(pe,Oe,De)=>{const Ue={};for(const Ge of Oe){const Pt=pe[Ge]??De?.[Ge];typeof Pt=="string"&&Pt.trim()||(Ue[Ge]=`Required (${Ge})`)}return{valid:Object.keys(Ue).length===0,errors:Ue}};return{skills:r,skillsLoading:l,skillsSearch:u,setSkillsSearch:d,registrySkills:f,registryLoading:p,systemRegistrySkills:g,systemRegistryLoading:b,installingSlug:C,publishingSlug:j,selectedHubSkill:M,setSelectedHubSkill:O,skillsUpdating:L,skillsConfig:I,skillsConfigPath:V,skillsUpdates:ee,skillsTab:ce,setSkillsTab:ae,visibleSecretKeys:q,setVisibleSecretKeys:z,loadSkills:Y,loadSkillsData:A,handleSkillConfigToggle:async(pe,Oe)=>{const De=I?.entries?.[pe]??{},Ue={...I,entries:{...I?.entries,[pe]:{...De,enabled:Oe}}};B(Ue);try{const Ge=await Rh(Ue);Ge.configPath&&P(Ge.configPath),Y()}catch(Ge){e(Ge instanceof Error?Ge.message:"Failed to save config")}},handleSkillEntryUpdate:(pe,Oe)=>{const De=I?.entries?.[pe]??{};B({...I,entries:{...I?.entries,[pe]:{...De,...Oe}}})},handleSkillEntrySave:async(pe,Oe,De)=>{if(I){if(pe&&Oe?.length){const Ue=I?.entries?.[pe]??{},{valid:Ge,errors:Pt}=_(Ue,Oe,De);if(!Ge){e(`Set required values: ${Object.keys(Pt).join(", ")}`);return}}try{await Rh(I),e(null)}catch(Ue){e(Ue instanceof Error?Ue.message:"Failed to save config")}}},handleInstallSkill:async(pe,Oe)=>{N(pe);try{await Dm(pe,Oe,{system:pe.startsWith("system-")}),Y();const De=await hc();B(De.skills??null),De.configPath&&P(De.configPath)}catch(De){e(De instanceof Error?De.message:"Install failed")}finally{N(null)}},handleUninstallSkill:async(pe,Oe)=>{const De=Oe==="user"?"user":"managed";try{await Jw(pe,De),Y();const Ue=await hc();B(Ue.skills??null),Ue.configPath&&P(Ue.configPath)}catch(Ue){e(Ue instanceof Error?Ue.message:"Uninstall failed")}},handlePublishSkill:async(pe,Oe)=>{R(pe);try{await ek(pe,Oe),e(""),Oh().then(De=>{const Ue={};for(const Ge of De.submissions)Ue[Ge.slug]=Ge.status;J(Ue)}).catch(()=>{})}catch(De){throw e(De instanceof Error?De.message:"Publish failed"),De}finally{R(null)}},handleUpdateSkills:async()=>{D(!0);try{const pe=await Zw();Y(),pe.failed.length>0&&e(`Update failed: ${pe.failed.map(Oe=>Oe.slug).join(", ")}`)}catch(pe){e(pe instanceof Error?pe.message:"Update failed")}finally{D(!1)}},refreshRegistry:()=>{y(!0),k(!0),Promise.all([_c().then(pe=>h(pe.skills||[])).catch(()=>h([])),Mh().then(pe=>v(pe.skills||[])).catch(()=>v([]))]).finally(()=>{y(!1),k(!1)})},validateSkillEnvConfig:_,publishStatusMap:F}}function zm({className:e,orientation:r="horizontal",...a}){return s.jsx(HT,{"data-slot":"tabs","data-orientation":r,orientation:r,className:je("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...a})}const q4=Lc("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Lm({className:e,variant:r="default",...a}){return s.jsx(qT,{"data-slot":"tabs-list","data-variant":r,className:je(q4({variant:r}),e),...a})}function ql({className:e,...r}){return s.jsx(FT,{"data-slot":"tabs-trigger",className:je("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...r})}function nn({className:e,...r}){return s.jsx(GT,{"data-slot":"tabs-content",className:je("flex-1 outline-none",e),...r})}function Xl({...e}){return s.jsx(H0,{"data-slot":"dialog",...e})}function F4({...e}){return s.jsx(q0,{"data-slot":"dialog-portal",...e})}function G4({className:e,...r}){return s.jsx(F0,{"data-slot":"dialog-overlay",className:je("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function Ql({className:e,children:r,showCloseButton:a=!0,...l}){return s.jsxs(F4,{children:[s.jsx(G4,{}),s.jsxs(G0,{"data-slot":"dialog-content",className:je("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg max-h-[90vh] overflow-y-auto",e),...l,children:[r,a&&s.jsxs(V0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[s.jsx(us,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Zl({className:e,...r}){return s.jsx("div",{"data-slot":"dialog-header",className:je("flex flex-col gap-1.5 text-left",e),...r})}function Jl({className:e,...r}){return s.jsx("div",{"data-slot":"dialog-footer",className:je("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function Wl({className:e,...r}){return s.jsx($0,{"data-slot":"dialog-title",className:je("text-foreground font-semibold text-lg",e),...r})}function ei({className:e,...r}){return s.jsx(Y0,{"data-slot":"dialog-description",className:je("text-muted-foreground text-sm",e),...r})}function Pm({...e}){return s.jsx(vT,{"data-slot":"dropdown-menu",...e})}function Um({...e}){return s.jsx(bT,{"data-slot":"dropdown-menu-trigger",...e})}function Im({className:e,sideOffset:r=4,...a}){return s.jsx(ST,{children:s.jsx(wT,{"data-slot":"dropdown-menu-content",sideOffset:r,className:je("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...a})})}function ha({className:e,inset:r,variant:a="default",...l}){return s.jsx(kT,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":a,className:je("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l})}const ok=S.forwardRef(({className:e,orientation:r="vertical",...a},l)=>s.jsx("div",{ref:l,role:"group","data-slot":"field",className:je(r==="horizontal"?"flex flex-row items-center gap-2":"flex flex-col gap-1.5",e),...a}));ok.displayName="Field";function $4({className:e,...r}){return s.jsx("label",{"data-slot":"field-label",className:je("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r})}function Y4({className:e,...r}){return s.jsx("p",{"data-slot":"field-description",className:je("text-muted-foreground text-xs",e),...r})}function V4({className:e,...r}){return s.jsx("p",{"data-slot":"field-error",role:"alert",className:je("text-destructive text-xs",e),...r})}function qt({className:e,...r}){return s.jsx("label",{"data-slot":"label",className:je("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r})}function Bm({className:e,value:r=0,...a}){return s.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r,"data-slot":"progress",className:je("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...a,children:s.jsx("div",{className:"bg-primary h-full rounded-full transition-[width]",style:{width:`${Math.min(100,Math.max(0,r))}%`}})})}const cs=["What should this skill do?","Which app to connect?","When should it run?","Review & create"];function K4(e){const[r,a]=S.useState({step:0,goal:"",app:"other",trigger:"manual",apps:[],triggers:[],spec:null,loading:!1,error:null}),l=S.useCallback(async()=>{try{const{apps:g,triggers:v}=await tk();a(b=>({...b,apps:g,triggers:v}))}catch(g){a(v=>({...v,error:g instanceof Error?g.message:"Failed to load options"}))}},[]);S.useEffect(()=>{l()},[l]);const o=S.useCallback(g=>{a(v=>({...v,step:Math.max(0,Math.min(g,cs.length-1)),error:null}))},[]),u=S.useCallback(g=>{a(v=>({...v,goal:g}))},[]),d=S.useCallback(g=>{a(v=>({...v,app:g}))},[]),f=S.useCallback(g=>{a(v=>({...v,trigger:g}))},[]),h=S.useCallback(async()=>{a(g=>({...g,loading:!0,error:null}));try{const{spec:g}=await Dh({goal:r.goal,app:r.app,trigger:r.trigger,write:!1});return a(v=>({...v,spec:g,loading:!1})),g}catch(g){return a(v=>({...v,loading:!1,error:g instanceof Error?g.message:"Failed to generate preview"})),null}},[r.goal,r.app,r.trigger]),p=S.useCallback(async()=>{a(g=>({...g,loading:!0,error:null}));try{const g=await Dh({goal:r.goal,app:r.app,trigger:r.trigger,write:!0});return a(v=>({...v,loading:!1})),e?.(),g}catch(g){return a(v=>({...v,loading:!1,error:g instanceof Error?g.message:"Failed to create skill"})),null}},[r.goal,r.app,r.trigger,e]),y=S.useCallback(()=>{a({step:0,goal:"",app:"other",trigger:"manual",apps:r.apps,triggers:r.triggers,spec:null,loading:!1,error:null})},[r.apps,r.triggers]);return{state:r,setStep:o,setGoal:u,setApp:d,setTrigger:f,generatePreview:h,createSkill:p,loadApps:l,reset:y}}const ck=S.createContext(null);function uu(){const e=S.useContext(ck);if(!e)throw new Error("SkillWizardFlow must wrap steps");return e}function X4(){const{state:e,setGoal:r,setStep:a}=uu();return s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:'Describe what you want this agent to do. For example: "Summarize my important emails daily" or "Post updates to Slack when I deploy."'}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{htmlFor:"wizard-goal",children:"What should this skill do?"}),s.jsx("textarea",{id:"wizard-goal",placeholder:"e.g. Check Gmail and summarize important emails daily",value:e.goal,onChange:l=>r(l.target.value),rows:4,className:je("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 w-full min-w-0 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs outline-none focus-visible:ring-[3px] resize-none")})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(ue,{onClick:()=>a(1),disabled:!e.goal.trim(),children:["Next",s.jsx(zr,{className:"ml-1 size-4"})]})})]})}function Q4(){const{state:e,setApp:r,setStep:a}=uu(),l=e.apps.length?e.apps:[{id:"gmail",label:"Gmail",envHint:"API key or connect later"},{id:"slack",label:"Slack",envHint:"Token or connect later"},{id:"notion",label:"Notion",envHint:"API key or connect later"},{id:"github",label:"GitHub",envHint:"Token or connect later"},{id:"calendar",label:"Google Calendar",envHint:"Credentials or connect later"},{id:"webhook",label:"Webhook",envHint:"Optional"},{id:"other",label:"Other",envHint:"Depends on skill"}];return s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"Choose the app or service this skill will use. You can add API keys or connect the app later on the Skills page."}),s.jsx("div",{className:"grid gap-2",children:l.map(o=>s.jsxs("label",{className:`border-input flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-muted/50 ${e.app===o.id?"border-primary bg-muted/50":""}`,children:[s.jsx("input",{type:"radio",name:"wizard-app",value:o.id,checked:e.app===o.id,onChange:()=>r(o.id),className:"size-4"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("span",{className:"font-medium",children:o.label}),s.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",o.envHint,")"]})]})]},o.id))}),s.jsxs("div",{className:"flex justify-between",children:[s.jsxs(ue,{variant:"outline",onClick:()=>a(0),children:[s.jsx(Cm,{className:"mr-1 size-4"}),"Back"]}),s.jsxs(ue,{onClick:()=>a(2),children:["Next",s.jsx(zr,{className:"ml-1 size-4"})]})]})]})}function Z4(){const{state:e,setTrigger:r,setStep:a,generatePreview:l}=uu(),o=e.triggers.length?e.triggers:[{id:"manual",label:"When I ask (manual)"},{id:"schedule",label:"On a schedule (cron)"},{id:"webhook",label:"When a webhook is called"},{id:"message",label:"When I send a message (e.g. Telegram)"}];return s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"When should this skill run? You can configure schedules or webhooks later in Jobs."}),s.jsx("div",{className:"grid gap-2",children:o.map(u=>s.jsxs("label",{className:`border-input flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-muted/50 ${e.trigger===u.id?"border-primary bg-muted/50":""}`,children:[s.jsx("input",{type:"radio",name:"wizard-trigger",value:u.id,checked:e.trigger===u.id,onChange:()=>r(u.id),className:"size-4"}),s.jsx("span",{className:"font-medium",children:u.label})]},u.id))}),s.jsxs("div",{className:"flex justify-between",children:[s.jsxs(ue,{variant:"outline",onClick:()=>a(1),children:[s.jsx(Cm,{className:"mr-1 size-4"}),"Back"]}),s.jsxs(ue,{onClick:async()=>{await l(),a(3)},disabled:e.loading,children:[e.loading?"Generating…":"Review",s.jsx(zr,{className:"ml-1 size-4"})]})]})]})}function J4(){const{state:e,setStep:r,createSkill:a}=uu(),l=e.spec,o=async()=>{(await a())?.written};return!l&&!e.loading?s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"Preview not loaded. Go back and click Review again."}),s.jsx(ue,{variant:"outline",onClick:()=>r(2),children:"Back"})]}):s.jsxs("div",{className:"space-y-6",children:[l&&s.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-2",children:[s.jsx("div",{className:"font-medium",children:l.name}),s.jsx("p",{className:"text-muted-foreground text-sm",children:l.description}),s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Slug: ",s.jsx("code",{className:"rounded bg-muted px-1",children:l.slug}),l.requiredEnv.length>0&&s.jsxs(s.Fragment,{children:[" · Required: ",l.requiredEnv.join(", ")]})]})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Click Create to add this skill to your workspace. You can then enable it and add API keys (or connect the app) on the Skills page."}),e.error&&s.jsx("p",{className:"text-destructive text-sm",children:e.error}),s.jsxs("div",{className:"flex justify-between",children:[s.jsxs(ue,{variant:"outline",onClick:()=>r(2),children:[s.jsx(Cm,{className:"mr-1 size-4"}),"Back"]}),s.jsx(ue,{onClick:o,disabled:e.loading,children:e.loading?"Creating…":"Create skill"})]})]})}function W4({open:e,onOpenChange:r,onSuccess:a}){const l=K4(()=>{a?.(),r(!1),l.reset()}),{state:o}=l,u=Math.max(0,Math.min(o.step,cs.length-1));return s.jsx(ck.Provider,{value:l,children:s.jsx(Xl,{open:e,onOpenChange:r,children:s.jsxs(Ql,{className:"w-full max-w-lg sm:max-w-xl",showCloseButton:!0,children:[s.jsxs(Zl,{className:"space-y-2 pb-4 border-b",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-lg",children:s.jsx(ow,{className:"size-5"})}),s.jsxs("div",{children:[s.jsx(Wl,{children:"Create a skill"}),s.jsxs(ei,{children:["Step ",u+1," of ",cs.length,": ",cs[u]]})]})]}),s.jsx(Bm,{value:(u+1)/cs.length*100,className:"h-2"})]}),s.jsxs("div",{className:"pt-4",children:[o.error&&s.jsx("div",{className:"mb-4 rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive",children:o.error}),u===0&&s.jsx(X4,{}),u===1&&s.jsx(Q4,{}),u===2&&s.jsx(Z4,{}),u===3&&s.jsx(J4,{})]})]})})})}function eD(e){const[r,a]=S.useState(!1),[l,o]=S.useState(null),{skills:u,skillsLoading:d,skillsSearch:f,setSkillsSearch:h,registrySkills:p,registryLoading:y,systemRegistrySkills:g,systemRegistryLoading:v,installingSlug:b,publishingSlug:k,selectedHubSkill:C,setSelectedHubSkill:N,skillsUpdating:j,skillsConfig:R,skillsConfigPath:M,skillsUpdates:O,skillsTab:L,setSkillsTab:D,visibleSecretKeys:I,setVisibleSecretKeys:B,loadSkills:V,handleSkillConfigToggle:P,handleSkillEntryUpdate:ee,handleSkillEntrySave:te,handleInstallSkill:ce,handleUninstallSkill:ae,handlePublishSkill:q,handleUpdateSkills:z,refreshRegistry:F,validateSkillEnvConfig:J,publishStatusMap:Y}=e;return s.jsxs(s.Fragment,{children:[s.jsxs(it,{children:[s.jsxs(xt,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(yt,{className:"text-base",children:"Skills"}),s.jsxs(vt,{children:["Config: ",M]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ue,{variant:"default",size:"sm",onClick:()=>a(!0),children:[s.jsx(sw,{className:"mr-1 size-4"}),"Create skill"]}),s.jsx("input",{className:"border-input bg-background h-9 w-48 rounded-md border px-3 text-sm placeholder:text-muted-foreground",placeholder:"Search…",value:f,onChange:A=>h(A.target.value)}),L==="installed"||L==="myskills"?s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"outline",size:"sm",onClick:V,disabled:d,children:d?"…":"Refresh"}),L==="installed"&&s.jsx(ue,{variant:"secondary",size:"sm",onClick:z,disabled:j,children:j?"…":"Update all"})]}):s.jsx(ue,{variant:"outline",size:"sm",onClick:F,disabled:y,children:y?"…":"Refresh"})]})]}),s.jsx(st,{children:s.jsxs(zm,{value:L,onValueChange:A=>D(A),children:[s.jsxs(Lm,{className:"mb-4",children:[s.jsx(ql,{value:"installed",children:"Installed"}),s.jsx(ql,{value:"myskills",children:"My skills"}),s.jsx(ql,{value:"hub",children:"From Hub"})]}),s.jsx(nn,{value:"installed",className:"mt-0",children:s.jsx(ab,{skills:u,skillsLoading:d,skillsSearch:f,skillsConfig:R,skillsUpdates:O,visibleSecretKeys:I,setVisibleSecretKeys:B,handleSkillConfigToggle:P,handleSkillEntryUpdate:ee,handleSkillEntrySave:te,handleUninstallSkill:ae,onPublishOpen:(A,_)=>o({slug:A,name:_}),validateSkillEnvConfig:J,publishStatusMap:Y})}),s.jsx(nn,{value:"myskills",className:"mt-0",children:s.jsx(ab,{skills:u.filter(A=>A.source==="user"),skillsLoading:d,skillsSearch:f,skillsConfig:R,skillsUpdates:O,visibleSecretKeys:I,setVisibleSecretKeys:B,handleSkillConfigToggle:P,handleSkillEntryUpdate:ee,handleSkillEntrySave:te,handleUninstallSkill:ae,onPublishOpen:(A,_)=>o({slug:A,name:_}),validateSkillEnvConfig:J,publishStatusMap:Y,emptyMessage:s.jsxs(s.Fragment,{children:["Skills you or the AI created appear here. They’re stored in"," ",s.jsx("code",{className:"text-xs",children:"~/.sulala/workspace/skills/my/<name>/README.md"}),'. Create one via "Create skill" or ask the agent to create a skill for you.']})})}),s.jsx(nn,{value:"hub",className:"mt-0",children:s.jsx(lD,{skills:u,registrySkills:p,registryLoading:y,systemRegistrySkills:g,systemRegistryLoading:v,skillsSearch:f,setSelectedHubSkill:N})})]})})]}),s.jsx(iD,{skill:C,installingSlug:b,onClose:()=>N(null),onInstall:ce}),s.jsx(W4,{open:r,onOpenChange:a,onSuccess:V}),s.jsx(tD,{slug:l?.slug,name:l?.name,onClose:()=>o(null),onPublish:q,publishingSlug:k})]})}function ab({skills:e,skillsLoading:r,skillsSearch:a,skillsConfig:l,skillsUpdates:o,visibleSecretKeys:u,setVisibleSecretKeys:d,handleSkillConfigToggle:f,handleSkillEntryUpdate:h,handleSkillEntrySave:p,handleUninstallSkill:y,onPublishOpen:g,validateSkillEnvConfig:v,publishStatusMap:b,emptyMessage:k}){const C=e.filter(N=>!a.trim()||N.name.toLowerCase().includes(a.toLowerCase())||N.description.toLowerCase().includes(a.toLowerCase()));return r&&!e.length?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}):C.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:k??s.jsx(s.Fragment,{children:"No installed skills. Add skills to ~/.sulala/workspace/skills/<name>/README.md, or install from the From Hub tab."})}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:C.map(N=>{const R={slug:N.slug??N.filePath.split(/[/\\]/).pop()?.replace(/\.md$/,"")??N.name,name:N.name,description:N.description},M=l?.entries?.[R.slug]??{},O=M.enabled!==!1;return s.jsx(nD,{slug:R.slug,name:R.name,description:N.description,category:N.category,version:N.version,tags:N.tags,status:N.status,source:N.source,env:N.env,missing:N.missing,enabled:O,hasUpdate:o.has(R.slug),entry:M,visibleSecretKeys:u,setVisibleSecretKeys:d,onToggle:()=>f(R.slug,!O),onEntryUpdate:L=>h(R.slug,L),onEntrySave:(L,D)=>p(R.slug,L,D),canUninstall:N.source==="user"||N.source==="installed",onUninstall:()=>y(R.slug,N.source),canPublish:N.source==="user"&&!!g,onPublish:g?()=>g(R.slug,R.name):void 0,publishStatus:b?.[R.slug],validateSkillEnvConfig:v},R.slug)})})}function tD({slug:e,name:r,onClose:a,onPublish:l,publishingSlug:o}){const[u,d]=S.useState("free"),[f,h]=S.useState(""),[p,y]=S.useState(!1),[g,v]=S.useState(null),b=!!e,k=async N=>{if(N.preventDefault(),!!e){v(null);try{const j=u==="paid"&&f.trim()!==""?Math.round(parseFloat(f)*100):void 0;await l(e,{priceIntent:u,intendedPriceCents:j!==void 0&&Number.isFinite(j)?j:void 0}),y(!0)}catch(j){v(j instanceof Error?j.message:"Publish failed. Set SKILLS_REGISTRY_URL in the agent .env to your store (e.g. http://localhost:3002).")}}},C=()=>{y(!1),v(null),d("free"),h(""),a()};return s.jsx(Xl,{open:b,onOpenChange:N=>!N&&C(),children:s.jsxs(Ql,{className:"max-w-md",showCloseButton:!0,children:[s.jsxs(Zl,{children:[s.jsx(Wl,{children:"Publish to store"}),s.jsxs(ei,{children:['Submit "',r??e,'" to the skill store. Others can install it after an admin approves. Set ',s.jsx("code",{className:"text-xs",children:"SKILLS_REGISTRY_URL"})," in the agent .env to your store URL (e.g. http://localhost:3002). No API key needed unless your store requires one."]})]}),p?s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Submitted to the store. An admin will review it. You can track it under My skills on the store."}),s.jsx(Jl,{children:s.jsx(ue,{onClick:C,children:"Close"})})]}):s.jsxs("form",{onSubmit:k,className:"space-y-4 pt-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{children:"Price"}),s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"radio",name:"priceIntent",checked:u==="free",onChange:()=>d("free")}),"Free"]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"radio",name:"priceIntent",checked:u==="paid",onChange:()=>d("paid")}),"Paid"]})]})]}),u==="paid"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{htmlFor:"publish-price",children:"Price (USD)"}),s.jsx(kt,{id:"publish-price",type:"number",min:0,step:.01,placeholder:"4.99",value:f,onChange:N=>h(N.target.value)})]}),g&&s.jsx("p",{className:"text-sm text-destructive",children:g}),s.jsxs(Jl,{className:"gap-2 pt-2",children:[s.jsx(ue,{type:"button",variant:"outline",onClick:C,children:"Cancel"}),s.jsx(ue,{type:"submit",disabled:!!o,children:o===e?"Submitting…":"Submit to store"})]})]})]})})}function nD({slug:e,name:r,description:a,category:l,version:o,tags:u,status:d,source:f,env:h,missing:p,enabled:y,hasUpdate:g,entry:v,visibleSecretKeys:b,setVisibleSecretKeys:k,onToggle:C,onEntryUpdate:N,onEntrySave:j,canUninstall:R,onUninstall:M,canPublish:O,onPublish:L,publishStatus:D,validateSkillEnvConfig:I}){const[B,V]=S.useState(!1);return s.jsxs("article",{className:"border-border/70 bg-card/30 relative flex flex-col gap-3 rounded-xl border p-4",children:[s.jsx("div",{className:"absolute right-3 top-3",children:s.jsxs(Pm,{children:[s.jsx(Um,{asChild:!0,children:s.jsxs(ue,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground size-8 shrink-0",children:[s.jsx(OM,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Actions"})]})}),s.jsxs(Im,{align:"end",children:[s.jsx(ha,{onClick:C,children:y?"Disable":"Enable"}),O&&L&&!D&&s.jsxs(ha,{onClick:L,children:[s.jsx(IO,{className:"size-4"}),"Publish to store"]}),R&&M&&s.jsx(ha,{variant:"destructive",onClick:()=>V(!0),children:"Uninstall"})]})]})}),s.jsxs("div",{className:"flex flex-1 flex-col gap-2 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx(jt,{variant:"secondary",className:"text-xs",children:"Free"}),l&&s.jsx(jt,{variant:"outline",className:"text-xs",children:l}),o&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",o]}),g&&s.jsx(jt,{variant:"outline",className:"text-xs text-amber-600 dark:text-amber-400",children:"Update"}),D==="approved"&&s.jsx(jt,{variant:"default",className:"text-xs",children:"Approved"}),D==="pending"&&s.jsx(jt,{variant:"secondary",className:"text-xs",children:"Pending review"}),s.jsx(jt,{variant:d==="eligible"?"default":d==="blocked"?"destructive":"secondary",children:d})]}),s.jsx("h3",{className:"font-semibold text-sm",children:r}),s.jsx("p",{className:"text-muted-foreground line-clamp-3 text-xs flex-1",children:a}),u&&u.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:u.slice(0,4).map(P=>s.jsxs("span",{className:"text-xs text-muted-foreground/80",children:["#",P]},P))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[D==="pending"&&s.jsx("span",{className:"text-muted-foreground text-xs",children:"Already submitted"}),D==="approved"&&s.jsx("span",{className:"text-muted-foreground text-xs",children:"Published"}),f&&s.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:f})]})]}),s.jsx(Xl,{open:B,onOpenChange:V,children:s.jsxs(Ql,{className:"sm:max-w-sm",children:[s.jsxs(Zl,{children:[s.jsx(Wl,{children:"Remove skill?"}),s.jsxs(ei,{children:['"',r,'" will be uninstalled. You can install it again from the hub later.']})]}),s.jsxs(Jl,{children:[s.jsx(ue,{variant:"outline",onClick:()=>V(!1),children:"Cancel"}),s.jsx(ue,{variant:"destructive",onClick:()=>{M?.(),V(!1)},children:"Remove"})]})]})}),s.jsx(rD,{entry:v,onEntryUpdate:N,onEntrySave:j}),h&&h.length>0&&s.jsx(aD,{slug:e,env:h,entry:v,visibleSecretKeys:b,setVisibleSecretKeys:k,onEntryUpdate:N,onEntrySave:j,validateSkillEnvConfig:I}),p&&p.length>0&&s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Missing bins: ",p.join(", ")]})]})}function rD({entry:e,onEntryUpdate:r,onEntrySave:a}){const l=e.readOnly===!0,o=Array.isArray(e.allowedTools)?e.allowedTools.join(", "):typeof e.allowedTools=="string"?e.allowedTools:"",u=f=>{r({...e,readOnly:f}),a(void 0,void 0)},d=f=>{const h=f.split(",").map(p=>p.trim()).filter(Boolean);r({...e,allowedTools:h.length?h:void 0})};return s.jsxs("div",{className:"mt-1 flex flex-col gap-2 border-t pt-2 text-xs",children:[s.jsxs("div",{className:"text-muted-foreground flex items-center gap-1.5 font-medium",children:[s.jsx(hO,{className:"size-3.5"}),"Permissions"]}),s.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[s.jsx("input",{type:"checkbox",checked:l,onChange:f=>u(f.target.checked),className:"size-4 rounded border-input"}),s.jsx("span",{className:"text-muted-foreground",children:"Read only"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-muted-foreground block mb-0.5",children:"Allowed tools"}),s.jsx("input",{type:"text",placeholder:"Leave empty for global allowlist",value:o,onChange:f=>d(f.target.value),onBlur:()=>a(void 0,void 0),className:"border-input bg-background w-full rounded px-2 py-1.5 text-xs","aria-label":"Allowed tools"}),s.jsx("p",{className:"text-muted-foreground mt-0.5 text-[10px]",children:"Comma-separated (e.g. read_file, run_task). Empty = use global."})]})]})}function aD({slug:e,env:r,entry:a,visibleSecretKeys:l,setVisibleSecretKeys:o,onEntryUpdate:u,onEntrySave:d,validateSkillEnvConfig:f}){const h=e==="bluesky"?{BSKY_HANDLE:a.handle,BSKY_APP_PASSWORD:a.apiKey}:void 0,p=f(a,r,h),y=g=>/PASSWORD|SECRET|KEY|TOKEN/i.test(g);return s.jsx("div",{className:"mt-1 flex flex-wrap gap-3 border-t pt-2 text-xs",children:r.map(g=>{const v=a[g]??h?.[g],b=v==="set",k=b?"":String(v??""),C=p.errors[g],N=`skill-${e}-${g}`,j=`${e}-${g}`,R=l[j];return s.jsxs(ok,{className:"min-w-[200px]",children:[s.jsx($4,{htmlFor:N,children:g}),s.jsxs("div",{className:"relative",children:[s.jsx(kt,{id:N,type:y(g)?R?"text":"password":"text",placeholder:b?"(already set)":`Enter ${g}`,value:k,onChange:M=>{const O=M.target.value,L={...a,[g]:O};e==="bluesky"&&g==="BSKY_HANDLE"&&(L.handle=O),e==="bluesky"&&g==="BSKY_APP_PASSWORD"&&(L.apiKey=O),u(L)},onBlur:()=>d(r,h),className:`h-9 text-sm ${y(g)?"pr-9":""} ${C?"border-destructive":""}`,"aria-invalid":!!C,"aria-describedby":C?`${N}-err`:void 0,autoComplete:"off"}),y(g)&&s.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>o(M=>({...M,[j]:!M[j]})),"aria-label":R?"Hide":"Show",children:R?s.jsx(UM,{className:"h-4 w-4"}):s.jsx(BM,{className:"h-4 w-4"})})]}),C&&s.jsx(V4,{id:`${N}-err`,children:C}),!C&&y(g)&&s.jsx(Y4,{children:"Tokens and keys are stored securely. Use the eye icon to show or hide."})]},g)})})}function lD({skills:e,registrySkills:r,registryLoading:a,systemRegistrySkills:l,systemRegistryLoading:o,skillsSearch:u,setSelectedHubSkill:d}){const f=new Set(e.filter(k=>k.source==="user"||k.source==="workspace"||k.source==="managed").map(k=>k.slug??k.name)),h=k=>k.filter(C=>!f.has(C.slug)).filter(C=>!u.trim()||(C.name||C.slug).toLowerCase().includes(u.toLowerCase())||(C.description||"").toLowerCase().includes(u.toLowerCase())),p=h(l),y=h(r),g=a||o,v=p.length>0||y.length>0;if(g&&!r.length&&!l.length)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});if(!v)return s.jsx("p",{className:"text-muted-foreground text-sm",children:l.length===0&&r.length===0?"Hub registry is empty or not configured. Set VITE_SKILLS_REGISTRY_URL to your store URL.":"All listed skills are already installed, or no matching search."});const b=({r:k})=>{const C=k.priceCents!=null&&k.priceCents>0?`$${(k.priceCents/100).toFixed(2)}`:"Free";return s.jsxs("article",{className:"border-border/70 bg-card/30 flex flex-col gap-3 rounded-xl border p-4",children:[s.jsx("span",{className:"bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-lg",children:s.jsx(ow,{className:"size-5"})}),s.jsxs("div",{className:"flex flex-1 flex-col gap-2 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx(jt,{variant:"secondary",className:"text-xs",children:C}),k.category&&s.jsx(jt,{variant:"outline",className:"text-xs",children:k.category}),k.version&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",k.version]})]}),s.jsx("h3",{className:"font-semibold text-sm",children:k.name||k.slug}),s.jsx("p",{className:"text-muted-foreground line-clamp-3 text-xs flex-1",children:k.description||""}),k.tags&&k.tags.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:k.tags.slice(0,4).map(N=>s.jsxs("span",{className:"text-xs text-muted-foreground/80",children:["#",N]},N))}),s.jsx(ue,{variant:"outline",size:"sm",className:"w-fit mt-1",onClick:()=>d(k),children:"View & install"})]})]},k.slug)};return s.jsxs("div",{className:"space-y-6",children:[p.length>0&&s.jsxs("section",{children:[s.jsx("h3",{className:"text-muted-foreground mb-3 text-sm font-medium",children:"System skills"}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:p.map(k=>s.jsx(b,{r:k},k.slug))})]}),y.length>0&&s.jsxs("section",{children:[s.jsx("h3",{className:"text-muted-foreground mb-3 text-sm font-medium",children:"Community / Hub"}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:y.map(k=>s.jsx(b,{r:k},k.slug))})]})]})}function iD({skill:e,installingSlug:r,onClose:a,onInstall:l}){if(!e)return null;const o=(e.priceCents??0)>0,u=ai(),d=u?`${u}/skills/${e.slug}`:null;return s.jsx(au,{open:!!e,onOpenChange:f=>!f&&a(),children:s.jsxs(lu,{side:"right",className:"w-full max-w-lg sm:max-w-xl overflow-y-auto p-6 sm:p-8",children:[s.jsxs(iu,{className:"space-y-3 p-0",children:[s.jsxs(ue,{variant:"ghost",size:"sm",className:"w-fit -ml-2",onClick:a,children:[s.jsx(uM,{className:"h-4 w-4 mr-1"}),"Back to skills"]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(jt,{variant:o?"default":"secondary",children:o?`$${(e.priceCents/100).toFixed(2)}`:"Free"}),e.category&&s.jsx(jt,{variant:"outline",children:e.category}),e.version&&s.jsxs(jt,{variant:"secondary",children:["v",e.version]}),e.tags?.map(f=>s.jsxs(jt,{variant:"secondary",className:"font-normal",children:["#",f]},f))]}),s.jsx(su,{className:"text-left",children:e.name||e.slug}),s.jsx(ou,{className:"text-left",children:e.description}),(e.creatorName||e.creatorId)&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Creator: ",e.creatorName??e.creatorId]})]}),s.jsx("div",{className:"mt-6 space-y-6",children:o?s.jsxs(it,{className:"p-4",children:[s.jsxs(xt,{className:"px-0 pt-0 pb-3",children:[s.jsx(yt,{className:"text-sm",children:"Purchase required"}),s.jsx(vt,{className:"text-xs mt-1.5",children:"This skill is paid. Buy it on the store to get an install URL with your license."})]}),s.jsx(st,{className:"px-0 pb-0 pt-2 space-y-3",children:d?s.jsx(ue,{asChild:!0,children:s.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Buy on store"})}):s.jsx("p",{className:"text-xs text-muted-foreground",children:"Set VITE_SKILLS_REGISTRY_URL to the hub base URL to see the store link."})})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium mb-2",children:"Install directly"}),s.jsx(ue,{disabled:r!==null,onClick:async()=>{await l(e.slug,"managed"),a()},children:r===e.slug?"Installing…":"Install"})]}),s.jsxs(it,{children:[s.jsxs(xt,{className:"py-3",children:[s.jsx(yt,{className:"text-sm",children:"Install via URL or CLI"}),s.jsx(vt,{className:"text-xs",children:"For users who want to install from the command line or use the install URL."})]}),s.jsxs(st,{className:"space-y-3 pt-0",children:[os(e.slug)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Install URL"}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx("input",{readOnly:!0,className:"border-input bg-muted flex-1 rounded px-2 py-1.5 font-mono text-xs",value:os(e.slug)}),s.jsx(ue,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>navigator.clipboard.writeText(os(e.slug)),children:s.jsx(Jv,{className:"h-4 w-4"})})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["CLI:"," ",s.jsxs("code",{className:"rounded bg-muted px-1 py-0.5",children:['sulala skill install --from-url="',os(e.slug),'"']})]})]}),Hl()&&s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Registry URL (for env)"}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx("input",{readOnly:!0,className:"border-input bg-muted flex-1 rounded px-2 py-1.5 font-mono text-xs",value:`SKILLS_REGISTRY_URL=${Hl()}`}),s.jsx(ue,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>navigator.clipboard.writeText(`SKILLS_REGISTRY_URL=${Hl()}`),children:s.jsx(Jv,{className:"h-4 w-4"})})]}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Then:"," ",s.jsxs("code",{className:"rounded bg-muted px-1 py-0.5",children:["sulala skill install ",e.slug]})]})]})]})]})]})})]})})}const lb={openai:[{id:"gpt-4o-mini",name:"GPT-4o mini"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5-mini",name:"GPT-5 mini"},{id:"gpt-5-nano",name:"GPT-5 nano"},{id:"gpt-5.2-pro",name:"GPT-5.2 Pro"},{id:"gpt-4.1",name:"GPT-4.1"}],openrouter:[],claude:[{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6"},{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5"}],gemini:[{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro (preview)"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash (preview)"}],ollama:[{id:"qwen3.5:27b",name:"Qwen 3.5 27B"},{id:"qwen3.5:35b",name:"Qwen 3.5 35B"},{id:"qwen3.5:122b",name:"Qwen 3.5 122B"},{id:"glm-4.7-flash",name:"GLM 4.7 Flash"},{id:"qwen3-vl:8b",name:"Qwen3-VL 8B"},{id:"qwen3-vl:30b",name:"Qwen3-VL 30B"},{id:"qwen3-vl:32b",name:"Qwen3-VL 32B"},{id:"qwen3-next:80b",name:"Qwen3-Next 80B"},{id:"nemotron-3-nano:30b",name:"Nemotron 3 Nano 30B"},{id:"gpt-oss-safeguard:20b",name:"GPT-OSS Safeguard 20B"},{id:"gpt-oss-safeguard:120b",name:"GPT-OSS Safeguard 120B"},{id:"qwen3:8b",name:"Qwen 3 8B"},{id:"qwen3:14b",name:"Qwen 3 14B"},{id:"qwen3:30b",name:"Qwen 3 30B"},{id:"qwen3:32b",name:"Qwen 3 32B"},{id:"qwen3:235b",name:"Qwen 3 235B"},{id:"gpt-oss:20b",name:"GPT-OSS 20B"},{id:"gpt-oss:120b",name:"GPT-OSS 120B"},{id:"magistral:24b",name:"Magistral 24B"},{id:"deepseek-v3.1:671b",name:"DeepSeek V3.1 671B"},{id:"deepseek-r1:7b",name:"DeepSeek R1 7B"},{id:"deepseek-r1:8b",name:"DeepSeek R1 8B"},{id:"deepseek-r1:14b",name:"DeepSeek R1 14B"},{id:"deepseek-r1:32b",name:"DeepSeek R1 32B"},{id:"deepseek-r1:70b",name:"DeepSeek R1 70B"},{id:"deepseek-r1:671b",name:"DeepSeek R1 671B"},{id:"llama3.2:3b",name:"Llama 3.2 3B"},{id:"llama3.1:8b",name:"Llama 3.1 8B"},{id:"llama3.1:70b",name:"Llama 3.1 70B"},{id:"hermes3:8b",name:"Hermes 3 8B"},{id:"hermes3:70b",name:"Hermes 3 70B"},{id:"mistral",name:"Mistral 7B"},{id:"gemma2:9b",name:"Gemma 2 9B"},{id:"qwen2:7b",name:"Qwen 2 7B"},{id:"qwen2:72b",name:"Qwen 2 72B"}]},ac="sulala_chat_provider",Jf="sulala_chat_model",sD={openai:"OPENAI_API_KEY",openrouter:"OPENROUTER_API_KEY",claude:"ANTHROPIC_API_KEY",gemini:["GOOGLE_GEMINI_API_KEY","GEMINI_API_KEY"],ollama:""};function oD(e,r,a){if(e==="ollama")return a===!0;const l=sD[e];return l?Array.isArray(l)?l.some(o=>r[o]==="set"):r[l]==="set":!1}function Wf(e){try{const r=localStorage.getItem(e);if(typeof r=="string")return r}catch{}return""}function cD(e,r,a){const[l,o]=S.useState(null),[u,d]=S.useState({}),[f,h]=S.useState([]),[p,y]=S.useState(""),[g,v]=S.useState(()=>Wf(ac)),[b,k]=S.useState(()=>Wf(Jf)),[C,N]=S.useState([]),[j,R]=S.useState(!1),[M,O]=S.useState([]),[L,D]=S.useState(!1),[I,B]=S.useState(!1),[V,P]=S.useState(null),[ee,te]=S.useState(null),[ce,ae]=S.useState(!1),[q,z]=S.useState(null),[F,J]=S.useState(null),[Y,A]=S.useState(null),[_,G]=S.useState(!1),[T,oe]=S.useState(null),[me,fe]=S.useState([]),ge=()=>{ae(!0),Kl().then(Ne=>te(Ne.running)).catch(()=>te(!1)).finally(()=>ae(!1))};S.useEffect(()=>{if(e!=="chat"){te(null),z(null);return}ae(!0),Kl().then(Ne=>te(Ne.running)).catch(()=>te(!1)).finally(()=>ae(!1))},[e]),S.useEffect(()=>{if(e!=="chat"&&g!=="ollama")return;if(e!=="chat"){z(null);return}if(g!=="ollama")return;const Ne=()=>{Vw().then(z).catch(()=>z(null))};Ne();const Le=setInterval(Ne,1500);return()=>clearInterval(Le)},[e,g]),S.useEffect(()=>{e==="chat"&&Promise.all([Va(),or()]).then(([Ne,Le])=>{o(Ne??null),d(Le?.keys??{})}).catch(()=>{o(null),d({})})},[e]);const ze=S.useMemo(()=>(l?.aiProviders??[]).filter(Ne=>oD(Ne.id,u,ee)),[l?.aiProviders,u,ee]);S.useEffect(()=>{if(e!=="chat"||!l?.aiProviders?.length)return;const Ne=Wf(ac),Le=ze;if(Le.length===0)return;const he=et=>{const qe=et&&Le.some(se=>se.id===et)?Le.find(se=>se.id===et):null,Wt=Le[0],W=qe??Wt;if(W){v(W.id),k(W.defaultModel||"");try{localStorage.setItem(ac,W.id),localStorage.setItem(Jf,W.defaultModel||"")}catch{}}};if(!Ne){Ac().then(et=>he(et.defaultProvider??null)).catch(()=>he(null));return}Le.some(et=>et.id===Ne)||Ac().then(et=>he(et.defaultProvider??null)).catch(()=>he(null))},[e,l,ze]),S.useEffect(()=>{if(e!=="chat"||g!=="openrouter"&&g!=="ollama"){N([]);return}R(!0),Es(g).then(Ne=>N(Ne.models||[])).catch(()=>N([])).finally(()=>R(!1))},[e,g]),S.useEffect(()=>{e==="chat"&&(D(!0),zh(50).then(Ne=>O(Ne.sessions||[])).catch(()=>O([])).finally(()=>D(!1)))},[e,V]),S.useEffect(()=>{if(!F||!V){F||A(null);return}G(!0),Dw(V).then(Ne=>{const Le=(Ne.pendingActions||[]).find(he=>he.id===F);A(Le??null)}).catch(()=>A(null)).finally(()=>G(!1))},[F,V]);const Ee=async Ne=>{if(!Ne){Ue();return}J(null),A(null),B(!0);try{const Le=await Ba(Ne);P(Le.id),h(Le.messages||[])}catch(Le){r(Le instanceof Error?Le.message:"Failed to load session")}finally{B(!1)}},pe=async()=>{const Ne=p.trim();if(!Ne&&me.length===0||I)return;const Le=[...me];y(""),fe([]),await De(Ne||"(with attachments)",Le)},Oe=async Ne=>{const Le=(Ne??"").trim();!Le||I||await De(Le,[])},De=async(Ne,Le)=>{const he={role:"user",content:Ne||"(with attachments)"};h(Qe=>[...Qe,he]),B(!0),r(null);try{let Qe=V;if(!Qe){Qe=(await nk({session_key:`chat_${Date.now()}`})).id,P(Qe);const be=await zh(50).catch(()=>({sessions:[]}));O(be.sessions||[])}const et=[];for(const se of Le){const{url:be}=await lk(se);et.push(be)}const qe=l?.aiProviders.find(se=>se.id===g),Wt=b||qe?.defaultModel||(Ut.length>0?Ut[0].id:""),W={message:Ne||"Post the attached image(s) as requested.",provider:g,model:Wt||void 0,max_tokens:1024};if(et.length>0&&(W.attachment_urls=et),T&&Ne===T.base_prompt.trim()&&T.required_integrations.length>0&&(W.required_integrations=T.required_integrations),g==="openai"||g==="openrouter"||g==="ollama")h(se=>[...se,{role:"assistant",content:"",thinking:""}]),await Lh(Qe,W,{onDelta:se=>{h(be=>{const K=[...be],Ae=K[K.length-1];return Ae?.role==="assistant"&&(K[K.length-1]={...Ae,content:(Ae.content??"")+se}),K})},onThinking:se=>{h(be=>{const K=[...be],Ae=K[K.length-1];return Ae?.role==="assistant"&&(K[K.length-1]={...Ae,thinking:(Ae.thinking??"")+se}),K})},onDone:async se=>{if(h(be=>{const K=[...be],Ae=K[K.length-1];return Ae?.role==="assistant"&&(K[K.length-1]={...Ae,content:se}),K}),Qe&&g!=="ollama")try{const be=await Ba(Qe);h(be.messages||[])}catch{}},onPendingApproval:se=>{B(!1),J(se)},onError:r,onMissingIntegrations:a?.onMissingIntegrations});else{const se=await ik(Qe,W);se.pendingActionId&&J(se.pendingActionId);const be=await Ba(Qe);h(be.messages||[])}}catch(Qe){const et=Qe;Array.isArray(et.missing)&&et.missing.length>0&&a?.onMissingIntegrations?.(et.missing),r(et instanceof Error?et.message:"Completion failed")}finally{B(!1)}},Ue=()=>{P(null),h([]),J(null),A(null),r(null)},Ge=async()=>{if(!F||!V)return;const Ne=V;try{await zw(F),J(null),A(null);const Le=await Ba(Ne);h(Le.messages||[]);const he=l?.aiProviders.find(qe=>qe.id===g),Qe=b||he?.defaultModel||(Ut.length>0?Ut[0].id:"");["openai","openrouter","ollama"].includes(g)&&(B(!0),h(qe=>[...qe,{role:"assistant",content:"",thinking:""}]),await Lh(Ne,{continue:!0,provider:g,model:Qe||void 0,max_tokens:1024},{onDelta:qe=>{h(Wt=>{const W=[...Wt],se=W[W.length-1];return se?.role==="assistant"&&(W[W.length-1]={...se,content:(se.content??"")+qe}),W})},onThinking:qe=>{h(Wt=>{const W=[...Wt],se=W[W.length-1];return se?.role==="assistant"&&(W[W.length-1]={...se,thinking:(se.thinking??"")+qe}),W})},onDone:async()=>{try{const qe=await Ba(Ne);h(qe.messages||[])}catch{}B(!1)},onPendingApproval:qe=>{J(qe),B(!1)},onError:qe=>{B(!1),r(qe)}}))}catch(Le){r(Le instanceof Error?Le.message:"Failed to approve")}finally{B(!1)}},Pt=async()=>{if(F)try{if(await Lw(F),J(null),A(null),V){const Ne=await Ba(V);h(Ne.messages||[])}}catch(Ne){r(Ne instanceof Error?Ne.message:"Failed to reject")}},Ut=g==="ollama"?(()=>{const Ne=new Set(C.map(he=>he.id)),Le=(lb.ollama||[]).filter(he=>!Ne.has(he.id));return[...C,...Le]})():g==="openrouter"&&C.length>0?C:lb[g]||[];return{config:l,configuredProviders:ze,chatMessages:f,chatInput:p,setChatInput:y,chatProvider:g,setChatProvider:Ne=>{v(Ne);try{localStorage.setItem(ac,Ne)}catch{}},chatModel:b,setChatModel:Ne=>{k(Ne);try{localStorage.setItem(Jf,Ne)}catch{}},chatModels:C,chatModelsLoading:j,chatSessions:M,chatSessionsLoading:L,chatLoading:I,chatAgentSessionId:V,models:Ut,ollamaRunning:ee,ollamaStatusLoading:ce,ollamaPullState:q,checkOllama:ge,handleSelectSession:Ee,handleChatSend:pe,sendMessage:Oe,handleNewChat:Ue,pendingActionId:F,pendingActionDetails:Y,pendingActionLoading:_,handleApprovePending:Ge,handleRejectPending:Pt,setLastAppliedIdea:oe,chatAttachments:me,setChatAttachments:fe}}function uD({className:e,size:r="default",...a}){return s.jsx(AE,{"data-slot":"avatar","data-size":r,className:je("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",e),...a})}function dD({className:e,...r}){return s.jsx(_E,{"data-slot":"avatar-fallback",className:je("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",e),...r})}function Ph({className:e}){return s.jsxs("div",{className:je("flex items-center gap-1",e),"aria-label":"Typing",children:[s.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0ms"}}),s.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0.15s"}}),s.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0.3s"}})]})}function fD({className:e}){return s.jsx("span",{className:je("inline-block h-4 w-0.5 animate-pulse bg-foreground align-middle",e),"aria-hidden":!0})}function hD(e,r){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const mD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gD={};function ib(e,r){return(gD.jsx?pD:mD).test(e)}const xD=/[ \t\n\f\r]/g;function yD(e){return typeof e=="object"?e.type==="text"?sb(e.value):!1:sb(e)}function sb(e){return e.replace(xD,"")===""}class _s{constructor(r,a,l){this.normal=a,this.property=r,l&&(this.space=l)}}_s.prototype.normal={};_s.prototype.property={};_s.prototype.space=void 0;function uk(e,r){const a={},l={};for(const o of e)Object.assign(a,o.property),Object.assign(l,o.normal);return new _s(a,l,r)}function Uh(e){return e.toLowerCase()}class gn{constructor(r,a){this.attribute=a,this.property=r}}gn.prototype.attribute="";gn.prototype.booleanish=!1;gn.prototype.boolean=!1;gn.prototype.commaOrSpaceSeparated=!1;gn.prototype.commaSeparated=!1;gn.prototype.defined=!1;gn.prototype.mustUseProperty=!1;gn.prototype.number=!1;gn.prototype.overloadedBoolean=!1;gn.prototype.property="";gn.prototype.spaceSeparated=!1;gn.prototype.space=void 0;let vD=0;const He=Ka(),Ot=Ka(),Ih=Ka(),de=Ka(),mt=Ka(),Fl=Ka(),Cn=Ka();function Ka(){return 2**++vD}const Bh=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Ot,commaOrSpaceSeparated:Cn,commaSeparated:Fl,number:de,overloadedBoolean:Ih,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),eh=Object.keys(Bh);class Hm extends gn{constructor(r,a,l,o){let u=-1;if(super(r,a),ob(this,"space",o),typeof l=="number")for(;++u<eh.length;){const d=eh[u];ob(this,eh[u],(l&Bh[d])===Bh[d])}}}Hm.prototype.defined=!0;function ob(e,r,a){a&&(e[r]=a)}function ii(e){const r={},a={};for(const[l,o]of Object.entries(e.properties)){const u=new Hm(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(u.mustUseProperty=!0),r[l]=u,a[Uh(l)]=l,a[Uh(u.attribute)]=l}return new _s(r,a,e.space)}const dk=ii({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:mt,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:de,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:mt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Ot,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function fk(e,r){return r in e?e[r]:r}function hk(e,r){return fk(e,r.toLowerCase())}const bD=ii({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fl,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:mt,autoFocus:He,autoPlay:He,blocking:mt,capture:null,charSet:null,checked:He,cite:null,className:mt,cols:de,colSpan:null,content:null,contentEditable:Ot,controls:He,controlsList:mt,coords:de|Fl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:Ih,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:mt,height:de,hidden:Ih,high:de,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:mt,itemRef:mt,itemScope:He,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:He,optimum:de,pattern:null,ping:mt,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:mt,required:He,reversed:He,rows:de,rowSpan:de,sandbox:mt,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:Ot,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Ot,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:He,disableRemotePlayback:He,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:hk}),SD=ii({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Cn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:mt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fl,g2:Fl,glyphName:Fl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fk}),mk=ii({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,r){return"xlink:"+r.slice(5).toLowerCase()}}),pk=ii({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hk}),gk=ii({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,r){return"xml:"+r.slice(3).toLowerCase()}}),wD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},kD=/[A-Z]/g,cb=/-[a-z]/g,jD=/^data[-\w.:]+$/i;function CD(e,r){const a=Uh(r);let l=r,o=gn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&jD.test(r)){if(r.charAt(4)==="-"){const u=r.slice(5).replace(cb,ED);l="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=r.slice(4);if(!cb.test(u)){let d=u.replace(kD,ND);d.charAt(0)!=="-"&&(d="-"+d),r="data"+d}}o=Hm}return new o(l,r)}function ND(e){return"-"+e.toLowerCase()}function ED(e){return e.charAt(1).toUpperCase()}const AD=uk([dk,bD,mk,pk,gk],"html"),qm=uk([dk,SD,mk,pk,gk],"svg");function _D(e){return e.join(" ").trim()}var Ll={},th,ub;function TD(){if(ub)return th;ub=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,a=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
55
+ `,p="/",y="*",g="",v="comment",b="declaration";function k(N,j){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];j=j||{};var R=1,M=1;function O(ae){var q=ae.match(r);q&&(R+=q.length);var z=ae.lastIndexOf(h);M=~z?ae.length-z:M+ae.length}function L(){var ae={line:R,column:M};return function(q){return q.position=new D(ae),V(),q}}function D(ae){this.start=ae,this.end={line:R,column:M},this.source=j.source}D.prototype.content=N;function I(ae){var q=new Error(j.source+":"+R+":"+M+": "+ae);if(q.reason=ae,q.filename=j.source,q.line=R,q.column=M,q.source=N,!j.silent)throw q}function B(ae){var q=ae.exec(N);if(q){var z=q[0];return O(z),N=N.slice(z.length),q}}function V(){B(a)}function P(ae){var q;for(ae=ae||[];q=ee();)q!==!1&&ae.push(q);return ae}function ee(){var ae=L();if(!(p!=N.charAt(0)||y!=N.charAt(1))){for(var q=2;g!=N.charAt(q)&&(y!=N.charAt(q)||p!=N.charAt(q+1));)++q;if(q+=2,g===N.charAt(q-1))return I("End of comment missing");var z=N.slice(2,q-2);return M+=2,O(z),N=N.slice(q),M+=2,ae({type:v,comment:z})}}function te(){var ae=L(),q=B(l);if(q){if(ee(),!B(o))return I("property missing ':'");var z=B(u),F=ae({type:b,property:C(q[0].replace(e,g)),value:z?C(z[0].replace(e,g)):g});return B(d),F}}function ce(){var ae=[];P(ae);for(var q;q=te();)q!==!1&&(ae.push(q),P(ae));return ae}return V(),ce()}function C(N){return N?N.replace(f,g):g}return th=k,th}var db;function RD(){if(db)return Ll;db=1;var e=Ll&&Ll.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.default=a;const r=e(TD());function a(l,o){let u=null;if(!l||typeof l!="string")return u;const d=(0,r.default)(l),f=typeof o=="function";return d.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:y}=h;f?o(p,y,h):y&&(u=u||{},u[p]=y)}),u}return Ll}var ns={},fb;function MD(){if(fb)return ns;fb=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,a=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(p){return!p||a.test(p)||e.test(p)},d=function(p,y){return y.toUpperCase()},f=function(p,y){return"".concat(y,"-")},h=function(p,y){return y===void 0&&(y={}),u(p)?p:(p=p.toLowerCase(),y.reactCompat?p=p.replace(o,f):p=p.replace(l,f),p.replace(r,d))};return ns.camelCase=h,ns}var rs,hb;function OD(){if(hb)return rs;hb=1;var e=rs&&rs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},r=e(RD()),a=MD();function l(o,u){var d={};return!o||typeof o!="string"||(0,r.default)(o,function(f,h){f&&h&&(d[(0,a.camelCase)(f,u)]=h)}),d}return l.default=l,rs=l,rs}var DD=OD();const zD=Dc(DD),xk=yk("end"),Fm=yk("start");function yk(e){return r;function r(a){const l=a&&a.position&&a.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function LD(e){const r=Fm(e),a=xk(e);if(r&&a)return{start:r,end:a}}function ds(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mb(e.position):"start"in e||"end"in e?mb(e):"line"in e||"column"in e?Hh(e):""}function Hh(e){return pb(e&&e.line)+":"+pb(e&&e.column)}function mb(e){return Hh(e&&e.start)+"-"+Hh(e&&e.end)}function pb(e){return e&&typeof e=="number"?e:1}class Jt extends Error{constructor(r,a,l){super(),typeof a=="string"&&(l=a,a=void 0);let o="",u={},d=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof r=="string"?o=r:!u.cause&&r&&(d=!0,o=r.message,u.cause=r),!u.ruleId&&!u.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?u.ruleId=l:(u.source=l.slice(0,h),u.ruleId=l.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=ds(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Jt.prototype.file="";Jt.prototype.name="";Jt.prototype.reason="";Jt.prototype.message="";Jt.prototype.stack="";Jt.prototype.column=void 0;Jt.prototype.line=void 0;Jt.prototype.ancestors=void 0;Jt.prototype.cause=void 0;Jt.prototype.fatal=void 0;Jt.prototype.place=void 0;Jt.prototype.ruleId=void 0;Jt.prototype.source=void 0;const Gm={}.hasOwnProperty,PD=new Map,UD=/[A-Z]/g,ID=new Set(["table","tbody","thead","tfoot","tr"]),BD=new Set(["td","th"]),vk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function HD(e,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=XD(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=KD(a,r.jsx,r.jsxs)}const o={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?qm:AD,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},u=bk(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function bk(e,r,a){if(r.type==="element")return qD(e,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return FD(e,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return $D(e,r,a);if(r.type==="mdxjsEsm")return GD(e,r);if(r.type==="root")return YD(e,r,a);if(r.type==="text")return VD(e,r)}function qD(e,r,a){const l=e.schema;let o=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=qm,e.schema=o),e.ancestors.push(r);const u=wk(e,r.tagName,!1),d=QD(e,r);let f=Ym(e,r);return ID.has(r.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!yD(h):!0})),Sk(e,d,u,r),$m(d,f),e.ancestors.pop(),e.schema=l,e.create(r,u,d,a)}function FD(e,r){if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}ys(e,r.position)}function GD(e,r){if(r.data&&r.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(r.data.estree);ys(e,r.position)}function $D(e,r,a){const l=e.schema;let o=l;r.name==="svg"&&l.space==="html"&&(o=qm,e.schema=o),e.ancestors.push(r);const u=r.name===null?e.Fragment:wk(e,r.name,!0),d=ZD(e,r),f=Ym(e,r);return Sk(e,d,u,r),$m(d,f),e.ancestors.pop(),e.schema=l,e.create(r,u,d,a)}function YD(e,r,a){const l={};return $m(l,Ym(e,r)),e.create(r,e.Fragment,l,a)}function VD(e,r){return r.value}function Sk(e,r,a,l){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(r.node=l)}function $m(e,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(e.children=a)}}function KD(e,r,a){return l;function l(o,u,d,f){const p=Array.isArray(d.children)?a:r;return f?p(u,d,f):p(u,d)}}function XD(e,r){return a;function a(l,o,u,d){const f=Array.isArray(u.children),h=Fm(l);return r(o,u,d,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function QD(e,r){const a={};let l,o;for(o in r.properties)if(o!=="children"&&Gm.call(r.properties,o)){const u=JD(e,o,r.properties[o]);if(u){const[d,f]=u;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&BD.has(r.tagName)?l=f:a[d]=f}}if(l){const u=a.style||(a.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return a}function ZD(e,r){const a={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const u=l.data.estree.body[0];u.type;const d=u.expression;d.type;const f=d.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else ys(e,r.position);else{const o=l.name;let u;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else ys(e,r.position);else u=l.value===null?!0:l.value;a[o]=u}return a}function Ym(e,r){const a=[];let l=-1;const o=e.passKeys?new Map:PD;for(;++l<r.children.length;){const u=r.children[l];let d;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const p=o.get(h)||0;d=h+"-"+p,o.set(h,p+1)}}const f=bk(e,u,d);f!==void 0&&a.push(f)}return a}function JD(e,r,a){const l=CD(e.schema,r);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=l.commaSeparated?hD(a):_D(a)),l.property==="style"){let o=typeof a=="object"?a:WD(e,String(a));return e.stylePropertyNameCase==="css"&&(o=ez(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?wD[l.property]||l.property:l.attribute,a]}}function WD(e,r){try{return zD(r,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const l=a,o=new Jt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=vk+"#cannot-parse-style-attribute",o}}function wk(e,r,a){let l;if(!a)l={type:"Literal",value:r};else if(r.includes(".")){const o=r.split(".");let u=-1,d;for(;++u<o.length;){const f=ib(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}l=d}else l=ib(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const o=l.value;return Gm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);ys(e)}function ys(e,r){const a=new Jt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=vk+"#cannot-handle-mdx-estrees-without-createevaluater",a}function ez(e){const r={};let a;for(a in e)Gm.call(e,a)&&(r[tz(a)]=e[a]);return r}function tz(e){let r=e.replace(UD,nz);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function nz(e){return"-"+e.toLowerCase()}const nh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},rz={};function Vm(e,r){const a=rz,l=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return kk(e,l,o)}function kk(e,r,a){if(az(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return gb(e.children,r,a)}return Array.isArray(e)?gb(e,r,a):""}function gb(e,r,a){const l=[];let o=-1;for(;++o<e.length;)l[o]=kk(e[o],r,a);return l.join("")}function az(e){return!!(e&&typeof e=="object")}const xb=document.createElement("i");function Km(e){const r="&"+e+";";xb.innerHTML=r;const a=xb.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===r?!1:a}function An(e,r,a,l){const o=e.length;let u=0,d;if(r<0?r=-r>o?0:o+r:r=r>o?o:r,a=a>0?a:0,l.length<1e4)d=Array.from(l),d.unshift(r,a),e.splice(...d);else for(a&&e.splice(r,a);u<l.length;)d=l.slice(u,u+1e4),d.unshift(r,0),e.splice(...d),u+=1e4,r+=1e4}function In(e,r){return e.length>0?(An(e,e.length,0,r),e):r}const yb={}.hasOwnProperty;function jk(e){const r={};let a=-1;for(;++a<e.length;)lz(r,e[a]);return r}function lz(e,r){let a;for(a in r){const o=(yb.call(e,a)?e[a]:void 0)||(e[a]={}),u=r[a];let d;if(u)for(d in u){yb.call(o,d)||(o[d]=[]);const f=u[d];iz(o[d],Array.isArray(f)?f:f?[f]:[])}}}function iz(e,r){let a=-1;const l=[];for(;++a<r.length;)(r[a].add==="after"?e:l).push(r[a]);An(e,0,0,l)}function Ck(e,r){const a=Number.parseInt(e,r);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Kn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const rn=va(/[A-Za-z]/),Zt=va(/[\dA-Za-z]/),sz=va(/[#-'*+\--9=?A-Z^-~]/);function Tc(e){return e!==null&&(e<32||e===127)}const qh=va(/\d/),oz=va(/[\dA-Fa-f]/),cz=va(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const du=va(new RegExp("\\p{P}|\\p{S}","u")),Fa=va(/\s/);function va(e){return r;function r(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function si(e){const r=[];let a=-1,l=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let d="";if(u===37&&Zt(e.charCodeAt(a+1))&&Zt(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(a+1);u<56320&&f>56319&&f<57344?(d=String.fromCharCode(u,f),o=1):d="�"}else d=String.fromCharCode(u);d&&(r.push(e.slice(l,a),encodeURIComponent(d)),l=a+o+1,d=""),o&&(a+=o,o=0)}return r.join("")+e.slice(l)}function Je(e,r,a,l){const o=l?l-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(h){return Ve(h)?(e.enter(a),f(h)):r(h)}function f(h){return Ve(h)&&u++<o?(e.consume(h),f):(e.exit(a),r(h))}}const uz={tokenize:dz};function dz(e){const r=e.attempt(this.parser.constructs.contentInitial,l,o);let a;return r;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Je(e,r,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const h=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=h),a=h,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Re(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),d)}}const fz={tokenize:hz},vb={tokenize:mz};function hz(e){const r=this,a=[];let l=0,o,u,d;return f;function f(M){if(l<a.length){const O=a[l];return r.containerState=O[1],e.attempt(O[0].continuation,h,p)(M)}return p(M)}function h(M){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,o&&R();const O=r.events.length;let L=O,D;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){D=r.events[L][1].end;break}j(l);let I=O;for(;I<r.events.length;)r.events[I][1].end={...D},I++;return An(r.events,L+1,0,r.events.slice(O)),r.events.length=I,p(M)}return f(M)}function p(M){if(l===a.length){if(!o)return v(M);if(o.currentConstruct&&o.currentConstruct.concrete)return k(M);r.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return r.containerState={},e.check(vb,y,g)(M)}function y(M){return o&&R(),j(l),v(M)}function g(M){return r.parser.lazy[r.now().line]=l!==a.length,d=r.now().offset,k(M)}function v(M){return r.containerState={},e.attempt(vb,b,k)(M)}function b(M){return l++,a.push([r.currentConstruct,r.containerState]),v(M)}function k(M){if(M===null){o&&R(),j(0),e.consume(M);return}return o=o||r.parser.flow(r.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),C(M)}function C(M){if(M===null){N(e.exit("chunkFlow"),!0),j(0),e.consume(M);return}return Re(M)?(e.consume(M),N(e.exit("chunkFlow")),l=0,r.interrupt=void 0,f):(e.consume(M),C)}function N(M,O){const L=r.sliceStream(M);if(O&&L.push(null),M.previous=u,u&&(u.next=M),u=M,o.defineSkip(M.start),o.write(L),r.parser.lazy[M.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<d&&(!o.events[D][1].end||o.events[D][1].end.offset>d))return;const I=r.events.length;let B=I,V,P;for(;B--;)if(r.events[B][0]==="exit"&&r.events[B][1].type==="chunkFlow"){if(V){P=r.events[B][1].end;break}V=!0}for(j(l),D=I;D<r.events.length;)r.events[D][1].end={...P},D++;An(r.events,B+1,0,r.events.slice(I)),r.events.length=D}}function j(M){let O=a.length;for(;O-- >M;){const L=a[O];r.containerState=L[1],L[0].exit.call(r,e)}a.length=M}function R(){o.write([null]),u=void 0,o=void 0,r.containerState._closeFlow=void 0}}function mz(e,r,a){return Je(e,e.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ti(e){if(e===null||ht(e)||Fa(e))return 1;if(du(e))return 2}function fu(e,r,a){const l=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!l.includes(u)&&(r=u(r,a),l.push(u))}return r}const Fh={name:"attention",resolveAll:pz,tokenize:gz};function pz(e,r){let a=-1,l,o,u,d,f,h,p,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(l=a;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&r.sliceSerialize(e[l][1]).charCodeAt(0)===r.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[l][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;h=e[l][1].end.offset-e[l][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const g={...e[l][1].end},v={...e[a][1].start};bb(g,-h),bb(v,h),d={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:v},u={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[a][1].start}},o={type:h>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[l][1].end={...d.start},e[a][1].start={...f.end},p=[],e[l][1].end.offset-e[l][1].start.offset&&(p=In(p,[["enter",e[l][1],r],["exit",e[l][1],r]])),p=In(p,[["enter",o,r],["enter",d,r],["exit",d,r],["enter",u,r]]),p=In(p,fu(r.parser.constructs.insideSpan.null,e.slice(l+1,a),r)),p=In(p,[["exit",u,r],["enter",f,r],["exit",f,r],["exit",o,r]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,p=In(p,[["enter",e[a][1],r],["exit",e[a][1],r]])):y=0,An(e,l-1,a-l+3,p),a=l+p.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function gz(e,r){const a=this.parser.constructs.attentionMarkers.null,l=this.previous,o=ti(l);let u;return d;function d(h){return u=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===u)return e.consume(h),f;const p=e.exit("attentionSequence"),y=ti(h),g=!y||y===2&&o||a.includes(h),v=!o||o===2&&y||a.includes(l);return p._open=!!(u===42?g:g&&(o||!v)),p._close=!!(u===42?v:v&&(y||!g)),r(h)}}function bb(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const xz={name:"autolink",tokenize:yz};function yz(e,r,a){let l=0;return o;function o(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(b){return rn(b)?(e.consume(b),d):b===64?a(b):p(b)}function d(b){return b===43||b===45||b===46||Zt(b)?(l=1,f(b)):p(b)}function f(b){return b===58?(e.consume(b),l=0,h):(b===43||b===45||b===46||Zt(b))&&l++<32?(e.consume(b),f):(l=0,p(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),r):b===null||b===32||b===60||Tc(b)?a(b):(e.consume(b),h)}function p(b){return b===64?(e.consume(b),y):sz(b)?(e.consume(b),p):a(b)}function y(b){return Zt(b)?g(b):a(b)}function g(b){return b===46?(e.consume(b),l=0,y):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),r):v(b)}function v(b){if((b===45||Zt(b))&&l++<63){const k=b===45?v:g;return e.consume(b),k}return a(b)}}const Ts={partial:!0,tokenize:vz};function vz(e,r,a){return l;function l(u){return Ve(u)?Je(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Re(u)?r(u):a(u)}}const Nk={continuation:{tokenize:Sz},exit:wz,name:"blockQuote",tokenize:bz};function bz(e,r,a){const l=this;return o;function o(d){if(d===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return a(d)}function u(d){return Ve(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),r):(e.exit("blockQuotePrefix"),r(d))}}function Sz(e,r,a){const l=this;return o;function o(d){return Ve(d)?Je(e,u,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Nk,r,a)(d)}}function wz(e){e.exit("blockQuote")}const Ek={name:"characterEscape",tokenize:kz};function kz(e,r,a){return l;function l(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return cz(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):a(u)}}const Ak={name:"characterReference",tokenize:jz};function jz(e,r,a){const l=this;let o=0,u,d;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),u=31,d=Zt,y(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=oz,y):(e.enter("characterReferenceValue"),u=7,d=qh,y(g))}function y(g){if(g===59&&o){const v=e.exit("characterReferenceValue");return d===Zt&&!Km(l.sliceSerialize(v))?a(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),r)}return d(g)&&o++<u?(e.consume(g),y):a(g)}}const Sb={partial:!0,tokenize:Nz},wb={concrete:!0,name:"codeFenced",tokenize:Cz};function Cz(e,r,a){const l=this,o={partial:!0,tokenize:L};let u=0,d=0,f;return h;function h(D){return p(D)}function p(D){const I=l.events[l.events.length-1];return u=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,f=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===f?(d++,e.consume(D),y):d<3?a(D):(e.exit("codeFencedFenceSequence"),Ve(D)?Je(e,g,"whitespace")(D):g(D))}function g(D){return D===null||Re(D)?(e.exit("codeFencedFence"),l.interrupt?r(D):e.check(Sb,C,O)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Re(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(D)):Ve(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,b,"whitespace")(D)):D===96&&D===f?a(D):(e.consume(D),v)}function b(D){return D===null||Re(D)?g(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(D))}function k(D){return D===null||Re(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(D)):D===96&&D===f?a(D):(e.consume(D),k)}function C(D){return e.attempt(o,O,N)(D)}function N(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),j}function j(D){return u>0&&Ve(D)?Je(e,R,"linePrefix",u+1)(D):R(D)}function R(D){return D===null||Re(D)?e.check(Sb,C,O)(D):(e.enter("codeFlowValue"),M(D))}function M(D){return D===null||Re(D)?(e.exit("codeFlowValue"),R(D)):(e.consume(D),M)}function O(D){return e.exit("codeFenced"),r(D)}function L(D,I,B){let V=0;return P;function P(q){return D.enter("lineEnding"),D.consume(q),D.exit("lineEnding"),ee}function ee(q){return D.enter("codeFencedFence"),Ve(q)?Je(D,te,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):te(q)}function te(q){return q===f?(D.enter("codeFencedFenceSequence"),ce(q)):B(q)}function ce(q){return q===f?(V++,D.consume(q),ce):V>=d?(D.exit("codeFencedFenceSequence"),Ve(q)?Je(D,ae,"whitespace")(q):ae(q)):B(q)}function ae(q){return q===null||Re(q)?(D.exit("codeFencedFence"),I(q)):B(q)}}}function Nz(e,r,a){const l=this;return o;function o(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return l.parser.lazy[l.now().line]?a(d):r(d)}}const rh={name:"codeIndented",tokenize:Az},Ez={partial:!0,tokenize:_z};function Az(e,r,a){const l=this;return o;function o(p){return e.enter("codeIndented"),Je(e,u,"linePrefix",5)(p)}function u(p){const y=l.events[l.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(p):a(p)}function d(p){return p===null?h(p):Re(p)?e.attempt(Ez,d,h)(p):(e.enter("codeFlowValue"),f(p))}function f(p){return p===null||Re(p)?(e.exit("codeFlowValue"),d(p)):(e.consume(p),f)}function h(p){return e.exit("codeIndented"),r(p)}}function _z(e,r,a){const l=this;return o;function o(d){return l.parser.lazy[l.now().line]?a(d):Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):Je(e,u,"linePrefix",5)(d)}function u(d){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?r(d):Re(d)?o(d):a(d)}}const Tz={name:"codeText",previous:Mz,resolve:Rz,tokenize:Oz};function Rz(e){let r=e.length-4,a=3,l,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(l=a;++l<r;)if(e[l][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[r][1].type="codeTextPadding",a+=2,r-=2;break}}for(l=a-1,r++;++l<=r;)o===void 0?l!==r&&e[l][1].type!=="lineEnding"&&(o=l):(l===r||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),r-=l-o-2,l=o+2),o=void 0);return e}function Mz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Oz(e,r,a){let l=0,o,u;return d;function d(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),l++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?a(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(u=e.enter("codeTextSequence"),o=0,y(g)):Re(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||Re(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),p)}function y(g){return g===96?(e.consume(g),o++,y):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),r(g)):(u.type="codeTextData",p(g))}}class Dz{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,a){const l=a??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,a,l){const o=a||0;this.setCursor(Math.trunc(r));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&as(this.left,l),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),as(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),as(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const a=this.left.splice(r,Number.POSITIVE_INFINITY);as(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);as(this.left,a.reverse())}}}function as(e,r){let a=0;if(r.length<1e4)e.push(...r);else for(;a<r.length;)e.push(...r.slice(a,a+1e4)),a+=1e4}function _k(e){const r={};let a=-1,l,o,u,d,f,h,p;const y=new Dz(e);for(;++a<y.length;){for(;a in r;)a=r[a];if(l=y.get(a),a&&l[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(h=l[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,zz(y,a)),a=r[a],p=!0);else if(l[1]._container){for(u=a,o=void 0;u--;)if(d=y.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(l[1].end={...y.get(o)[1].start},f=y.slice(o,a),f.unshift(l),y.splice(o,a-o+1,f))}}return An(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!p}function zz(e,r){const a=e.get(r)[1],l=e.get(r)[2];let o=r-1;const u=[];let d=a._tokenizer;d||(d=l.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,h=[],p={};let y,g,v=-1,b=a,k=0,C=0;const N=[C];for(;b;){for(;e.get(++o)[1]!==b;);u.push(o),b._tokenizer||(y=l.sliceStream(b),b.next||y.push(null),g&&d.defineSkip(b.start),b._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),b._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=a;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(C=v+1,N.push(C),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(d.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),v=N.length;v--;){const j=f.slice(N[v],N[v+1]),R=u.pop();h.push([R,R+j.length-1]),e.splice(R,2,j)}for(h.reverse(),v=-1;++v<h.length;)p[k+h[v][0]]=k+h[v][1],k+=h[v][1]-h[v][0]-1;return p}const Lz={resolve:Uz,tokenize:Iz},Pz={partial:!0,tokenize:Bz};function Uz(e){return _k(e),e}function Iz(e,r){let a;return l;function l(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):Re(f)?e.check(Pz,d,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),r(f)}function d(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function Bz(e,r,a){const l=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Je(e,u,"linePrefix")}function u(d){if(d===null||Re(d))return a(d);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?r(d):e.interrupt(l.parser.constructs.flow,a,r)(d)}}function Tk(e,r,a,l,o,u,d,f,h){const p=h||Number.POSITIVE_INFINITY;let y=0;return g;function g(j){return j===60?(e.enter(l),e.enter(o),e.enter(u),e.consume(j),e.exit(u),v):j===null||j===32||j===41||Tc(j)?a(j):(e.enter(l),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),C(j))}function v(j){return j===62?(e.enter(u),e.consume(j),e.exit(u),e.exit(o),e.exit(l),r):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===62?(e.exit("chunkString"),e.exit(f),v(j)):j===null||j===60||Re(j)?a(j):(e.consume(j),j===92?k:b)}function k(j){return j===60||j===62||j===92?(e.consume(j),b):b(j)}function C(j){return!y&&(j===null||j===41||ht(j))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(l),r(j)):y<p&&j===40?(e.consume(j),y++,C):j===41?(e.consume(j),y--,C):j===null||j===32||j===40||Tc(j)?a(j):(e.consume(j),j===92?N:C)}function N(j){return j===40||j===41||j===92?(e.consume(j),C):C(j)}}function Rk(e,r,a,l,o,u){const d=this;let f=0,h;return p;function p(b){return e.enter(l),e.enter(o),e.consume(b),e.exit(o),e.enter(u),y}function y(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?a(b):b===93?(e.exit(u),e.enter(o),e.consume(b),e.exit(o),e.exit(l),r):Re(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Re(b)||f++>999?(e.exit("chunkString"),y(b)):(e.consume(b),h||(h=!Ve(b)),b===92?v:g)}function v(b){return b===91||b===92||b===93?(e.consume(b),f++,g):g(b)}}function Mk(e,r,a,l,o,u){let d;return f;function f(v){return v===34||v===39||v===40?(e.enter(l),e.enter(o),e.consume(v),e.exit(o),d=v===40?41:v,h):a(v)}function h(v){return v===d?(e.enter(o),e.consume(v),e.exit(o),e.exit(l),r):(e.enter(u),p(v))}function p(v){return v===d?(e.exit(u),h(d)):v===null?a(v):Re(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Je(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===d||v===null||Re(v)?(e.exit("chunkString"),p(v)):(e.consume(v),v===92?g:y)}function g(v){return v===d||v===92?(e.consume(v),y):y(v)}}function fs(e,r){let a;return l;function l(o){return Re(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,l):Ve(o)?Je(e,l,a?"linePrefix":"lineSuffix")(o):r(o)}}const Hz={name:"definition",tokenize:Fz},qz={partial:!0,tokenize:Gz};function Fz(e,r,a){const l=this;let o;return u;function u(b){return e.enter("definition"),d(b)}function d(b){return Rk.call(l,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return o=Kn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):a(b)}function h(b){return ht(b)?fs(e,p)(b):p(b)}function p(b){return Tk(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(qz,g,g)(b)}function g(b){return Ve(b)?Je(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Re(b)?(e.exit("definition"),l.parser.defined.push(o),r(b)):a(b)}}function Gz(e,r,a){return l;function l(f){return ht(f)?fs(e,o)(f):a(f)}function o(f){return Mk(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return Ve(f)?Je(e,d,"whitespace")(f):d(f)}function d(f){return f===null||Re(f)?r(f):a(f)}}const $z={name:"hardBreakEscape",tokenize:Yz};function Yz(e,r,a){return l;function l(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Re(u)?(e.exit("hardBreakEscape"),r(u)):a(u)}}const Vz={name:"headingAtx",resolve:Kz,tokenize:Xz};function Kz(e,r){let a=e.length-2,l=3,o,u;return e[l][1].type==="whitespace"&&(l+=2),a-2>l&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(l===a-1||a-4>l&&e[a-2][1].type==="whitespace")&&(a-=l+1===a?2:4),a>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[a][1].end},u={type:"chunkText",start:e[l][1].start,end:e[a][1].end,contentType:"text"},An(e,l,a-l+1,[["enter",o,r],["enter",u,r],["exit",u,r],["exit",o,r]])),e}function Xz(e,r,a){let l=0;return o;function o(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&l++<6?(e.consume(y),d):y===null||ht(y)?(e.exit("atxHeadingSequence"),f(y)):a(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),h(y)):y===null||Re(y)?(e.exit("atxHeading"),r(y)):Ve(y)?Je(e,f,"whitespace")(y):(e.enter("atxHeadingText"),p(y))}function h(y){return y===35?(e.consume(y),h):(e.exit("atxHeadingSequence"),f(y))}function p(y){return y===null||y===35||ht(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),p)}}const Qz=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],kb=["pre","script","style","textarea"],Zz={concrete:!0,name:"htmlFlow",resolveTo:e3,tokenize:t3},Jz={partial:!0,tokenize:r3},Wz={partial:!0,tokenize:n3};function e3(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function t3(e,r,a){const l=this;let o,u,d,f,h;return p;function p(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),v):T===47?(e.consume(T),u=!0,C):T===63?(e.consume(T),o=3,l.interrupt?r:A):rn(T)?(e.consume(T),d=String.fromCharCode(T),N):a(T)}function v(T){return T===45?(e.consume(T),o=2,b):T===91?(e.consume(T),o=5,f=0,k):rn(T)?(e.consume(T),o=4,l.interrupt?r:A):a(T)}function b(T){return T===45?(e.consume(T),l.interrupt?r:A):a(T)}function k(T){const oe="CDATA[";return T===oe.charCodeAt(f++)?(e.consume(T),f===oe.length?l.interrupt?r:te:k):a(T)}function C(T){return rn(T)?(e.consume(T),d=String.fromCharCode(T),N):a(T)}function N(T){if(T===null||T===47||T===62||ht(T)){const oe=T===47,me=d.toLowerCase();return!oe&&!u&&kb.includes(me)?(o=1,l.interrupt?r(T):te(T)):Qz.includes(d.toLowerCase())?(o=6,oe?(e.consume(T),j):l.interrupt?r(T):te(T)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?a(T):u?R(T):M(T))}return T===45||Zt(T)?(e.consume(T),d+=String.fromCharCode(T),N):a(T)}function j(T){return T===62?(e.consume(T),l.interrupt?r:te):a(T)}function R(T){return Ve(T)?(e.consume(T),R):P(T)}function M(T){return T===47?(e.consume(T),P):T===58||T===95||rn(T)?(e.consume(T),O):Ve(T)?(e.consume(T),M):P(T)}function O(T){return T===45||T===46||T===58||T===95||Zt(T)?(e.consume(T),O):L(T)}function L(T){return T===61?(e.consume(T),D):Ve(T)?(e.consume(T),L):M(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?a(T):T===34||T===39?(e.consume(T),h=T,I):Ve(T)?(e.consume(T),D):B(T)}function I(T){return T===h?(e.consume(T),h=null,V):T===null||Re(T)?a(T):(e.consume(T),I)}function B(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||ht(T)?L(T):(e.consume(T),B)}function V(T){return T===47||T===62||Ve(T)?M(T):a(T)}function P(T){return T===62?(e.consume(T),ee):a(T)}function ee(T){return T===null||Re(T)?te(T):Ve(T)?(e.consume(T),ee):a(T)}function te(T){return T===45&&o===2?(e.consume(T),z):T===60&&o===1?(e.consume(T),F):T===62&&o===4?(e.consume(T),_):T===63&&o===3?(e.consume(T),A):T===93&&o===5?(e.consume(T),Y):Re(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Jz,G,ce)(T)):T===null||Re(T)?(e.exit("htmlFlowData"),ce(T)):(e.consume(T),te)}function ce(T){return e.check(Wz,ae,G)(T)}function ae(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),q}function q(T){return T===null||Re(T)?ce(T):(e.enter("htmlFlowData"),te(T))}function z(T){return T===45?(e.consume(T),A):te(T)}function F(T){return T===47?(e.consume(T),d="",J):te(T)}function J(T){if(T===62){const oe=d.toLowerCase();return kb.includes(oe)?(e.consume(T),_):te(T)}return rn(T)&&d.length<8?(e.consume(T),d+=String.fromCharCode(T),J):te(T)}function Y(T){return T===93?(e.consume(T),A):te(T)}function A(T){return T===62?(e.consume(T),_):T===45&&o===2?(e.consume(T),A):te(T)}function _(T){return T===null||Re(T)?(e.exit("htmlFlowData"),G(T)):(e.consume(T),_)}function G(T){return e.exit("htmlFlow"),r(T)}}function n3(e,r,a){const l=this;return o;function o(d){return Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):a(d)}function u(d){return l.parser.lazy[l.now().line]?a(d):r(d)}}function r3(e,r,a){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ts,r,a)}}const a3={name:"htmlText",tokenize:l3};function l3(e,r,a){const l=this;let o,u,d;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),L):A===63?(e.consume(A),M):rn(A)?(e.consume(A),B):a(A)}function p(A){return A===45?(e.consume(A),y):A===91?(e.consume(A),u=0,k):rn(A)?(e.consume(A),R):a(A)}function y(A){return A===45?(e.consume(A),b):a(A)}function g(A){return A===null?a(A):A===45?(e.consume(A),v):Re(A)?(d=g,F(A)):(e.consume(A),g)}function v(A){return A===45?(e.consume(A),b):g(A)}function b(A){return A===62?z(A):A===45?v(A):g(A)}function k(A){const _="CDATA[";return A===_.charCodeAt(u++)?(e.consume(A),u===_.length?C:k):a(A)}function C(A){return A===null?a(A):A===93?(e.consume(A),N):Re(A)?(d=C,F(A)):(e.consume(A),C)}function N(A){return A===93?(e.consume(A),j):C(A)}function j(A){return A===62?z(A):A===93?(e.consume(A),j):C(A)}function R(A){return A===null||A===62?z(A):Re(A)?(d=R,F(A)):(e.consume(A),R)}function M(A){return A===null?a(A):A===63?(e.consume(A),O):Re(A)?(d=M,F(A)):(e.consume(A),M)}function O(A){return A===62?z(A):M(A)}function L(A){return rn(A)?(e.consume(A),D):a(A)}function D(A){return A===45||Zt(A)?(e.consume(A),D):I(A)}function I(A){return Re(A)?(d=I,F(A)):Ve(A)?(e.consume(A),I):z(A)}function B(A){return A===45||Zt(A)?(e.consume(A),B):A===47||A===62||ht(A)?V(A):a(A)}function V(A){return A===47?(e.consume(A),z):A===58||A===95||rn(A)?(e.consume(A),P):Re(A)?(d=V,F(A)):Ve(A)?(e.consume(A),V):z(A)}function P(A){return A===45||A===46||A===58||A===95||Zt(A)?(e.consume(A),P):ee(A)}function ee(A){return A===61?(e.consume(A),te):Re(A)?(d=ee,F(A)):Ve(A)?(e.consume(A),ee):V(A)}function te(A){return A===null||A===60||A===61||A===62||A===96?a(A):A===34||A===39?(e.consume(A),o=A,ce):Re(A)?(d=te,F(A)):Ve(A)?(e.consume(A),te):(e.consume(A),ae)}function ce(A){return A===o?(e.consume(A),o=void 0,q):A===null?a(A):Re(A)?(d=ce,F(A)):(e.consume(A),ce)}function ae(A){return A===null||A===34||A===39||A===60||A===61||A===96?a(A):A===47||A===62||ht(A)?V(A):(e.consume(A),ae)}function q(A){return A===47||A===62||ht(A)?V(A):a(A)}function z(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),r):a(A)}function F(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),J}function J(A){return Ve(A)?Je(e,Y,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Y(A)}function Y(A){return e.enter("htmlTextData"),d(A)}}const Xm={name:"labelEnd",resolveAll:c3,resolveTo:u3,tokenize:d3},i3={tokenize:f3},s3={tokenize:h3},o3={tokenize:m3};function c3(e){let r=-1;const a=[];for(;++r<e.length;){const l=e[r][1];if(a.push(e[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",r+=o}}return e.length!==a.length&&An(e,0,e.length,a),e}function u3(e,r){let a=e.length,l=0,o,u,d,f;for(;a--;)if(o=e[a][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=a,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(d=a);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[u+l+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",h,r],["enter",p,r]],f=In(f,e.slice(u+1,u+l+3)),f=In(f,[["enter",y,r]]),f=In(f,fu(r.parser.constructs.insideSpan.null,e.slice(u+l+4,d-3),r)),f=In(f,[["exit",y,r],e[d-2],e[d-1],["exit",p,r]]),f=In(f,e.slice(d+1)),f=In(f,[["exit",h,r]]),An(e,u,e.length,f),e}function d3(e,r,a){const l=this;let o=l.events.length,u,d;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){u=l.events[o][1];break}return f;function f(v){return u?u._inactive?g(v):(d=l.parser.defined.includes(Kn(l.sliceSerialize({start:u.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):a(v)}function h(v){return v===40?e.attempt(i3,y,d?y:g)(v):v===91?e.attempt(s3,y,d?p:g)(v):d?y(v):g(v)}function p(v){return e.attempt(o3,y,g)(v)}function y(v){return r(v)}function g(v){return u._balanced=!0,a(v)}}function f3(e,r,a){return l;function l(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return ht(g)?fs(e,u)(g):u(g)}function u(g){return g===41?y(g):Tk(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function d(g){return ht(g)?fs(e,h)(g):y(g)}function f(g){return a(g)}function h(g){return g===34||g===39||g===40?Mk(e,p,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function p(g){return ht(g)?fs(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),r):a(g)}}function h3(e,r,a){const l=this;return o;function o(f){return Rk.call(l,e,u,d,"reference","referenceMarker","referenceString")(f)}function u(f){return l.parser.defined.includes(Kn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(f):a(f)}function d(f){return a(f)}}function m3(e,r,a){return l;function l(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),r):a(u)}}const p3={name:"labelStartImage",resolveAll:Xm.resolveAll,tokenize:g3};function g3(e,r,a){const l=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):a(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?a(f):r(f)}}const x3={name:"labelStartLink",resolveAll:Xm.resolveAll,tokenize:y3};function y3(e,r,a){const l=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in l.parser.constructs?a(d):r(d)}}const ah={name:"lineEnding",tokenize:v3};function v3(e,r){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Je(e,r,"linePrefix")}}const mc={name:"thematicBreak",tokenize:b3};function b3(e,r,a){let l=0,o;return u;function u(p){return e.enter("thematicBreak"),d(p)}function d(p){return o=p,f(p)}function f(p){return p===o?(e.enter("thematicBreakSequence"),h(p)):l>=3&&(p===null||Re(p))?(e.exit("thematicBreak"),r(p)):a(p)}function h(p){return p===o?(e.consume(p),l++,h):(e.exit("thematicBreakSequence"),Ve(p)?Je(e,f,"whitespace")(p):f(p))}}const pn={continuation:{tokenize:j3},exit:N3,name:"list",tokenize:k3},S3={partial:!0,tokenize:E3},w3={partial:!0,tokenize:C3};function k3(e,r,a){const l=this,o=l.events[l.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return f;function f(b){const k=l.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!l.containerState.marker||b===l.containerState.marker:qh(b)){if(l.containerState.type||(l.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(mc,a,p)(b):p(b);if(!l.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return a(b)}function h(b){return qh(b)&&++d<10?(e.consume(b),h):(!l.interrupt||d<2)&&(l.containerState.marker?b===l.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),p(b)):a(b)}function p(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||b,e.check(Ts,l.interrupt?a:y,e.attempt(S3,v,g))}function y(b){return l.containerState.initialBlankLine=!0,u++,v(b)}function g(b){return Ve(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):a(b)}function v(b){return l.containerState.size=u+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(b)}}function j3(e,r,a){const l=this;return l.containerState._closeFlow=void 0,e.check(Ts,o,u);function o(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Je(e,r,"listItemIndent",l.containerState.size+1)(f)}function u(f){return l.containerState.furtherBlankLines||!Ve(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,d(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(w3,r,d)(f))}function d(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,Je(e,e.attempt(pn,r,a),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function C3(e,r,a){const l=this;return Je(e,o,"listItemIndent",l.containerState.size+1);function o(u){const d=l.events[l.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===l.containerState.size?r(u):a(u)}}function N3(e){e.exit(this.containerState.type)}function E3(e,r,a){const l=this;return Je(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=l.events[l.events.length-1];return!Ve(u)&&d&&d[1].type==="listItemPrefixWhitespace"?r(u):a(u)}}const jb={name:"setextUnderline",resolveTo:A3,tokenize:_3};function A3(e,r){let a=e.length,l,o,u;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){l=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!u&&e[a][1].type==="definition"&&(u=a);const d={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,r]),e.splice(u+1,0,["exit",e[l][1],r]),e[l][1].end={...e[u][1].end}):e[l][1]=d,e.push(["exit",d,r]),e}function _3(e,r,a){const l=this;let o;return u;function u(p){let y=l.events.length,g;for(;y--;)if(l.events[y][1].type!=="lineEnding"&&l.events[y][1].type!=="linePrefix"&&l.events[y][1].type!=="content"){g=l.events[y][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||g)?(e.enter("setextHeadingLine"),o=p,d(p)):a(p)}function d(p){return e.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===o?(e.consume(p),f):(e.exit("setextHeadingLineSequence"),Ve(p)?Je(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||Re(p)?(e.exit("setextHeadingLine"),r(p)):a(p)}}const T3={tokenize:R3};function R3(e){const r=this,a=e.attempt(Ts,l,e.attempt(this.parser.constructs.flowInitial,o,Je(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Lz,o)),"linePrefix")));return a;function l(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),r.currentConstruct=void 0,a}}const M3={resolveAll:Dk()},O3=Ok("string"),D3=Ok("text");function Ok(e){return{resolveAll:Dk(e==="text"?z3:void 0),tokenize:r};function r(a){const l=this,o=this.parser.constructs[e],u=a.attempt(o,d,f);return d;function d(y){return p(y)?u(y):f(y)}function f(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),h}function h(y){return p(y)?(a.exit("data"),u(y)):(a.consume(y),h)}function p(y){if(y===null)return!0;const g=o[y];let v=-1;if(g)for(;++v<g.length;){const b=g[v];if(!b.previous||b.previous.call(l,l.previous))return!0}return!1}}}function Dk(e){return r;function r(a,l){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(a,l):a}}function z3(e,r){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const l=e[a-1][1],o=r.sliceStream(l);let u=o.length,d=-1,f=0,h;for(;u--;){const p=o[u];if(typeof p=="string"){for(d=p.length;p.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(p===-2)h=!0,f++;else if(p!==-1){u++;break}}if(r._contentTypeTextTrailing&&a===e.length&&(f=0),f){const p={type:a===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:l.start._bufferIndex+d,_index:l.start._index+u,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...p.start},l.start.offset===l.end.offset?Object.assign(l,p):(e.splice(a,0,["enter",p,r],["exit",p,r]),a+=2)}a++}return e}const L3={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:Nk},P3={91:Hz},U3={[-2]:rh,[-1]:rh,32:rh},I3={35:Vz,42:mc,45:[jb,mc],60:Zz,61:jb,95:mc,96:wb,126:wb},B3={38:Ak,92:Ek},H3={[-5]:ah,[-4]:ah,[-3]:ah,33:p3,38:Ak,42:Fh,60:[xz,a3],91:x3,92:[$z,Ek],93:Xm,95:Fh,96:Tz},q3={null:[Fh,M3]},F3={null:[42,95]},G3={null:[]},$3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:F3,contentInitial:P3,disable:G3,document:L3,flow:I3,flowInitial:U3,insideSpan:q3,string:B3,text:H3},Symbol.toStringTag,{value:"Module"}));function Y3(e,r,a){let l={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let d=[],f=[];const h={attempt:I(L),check:I(D),consume:R,enter:M,exit:O,interrupt:I(D,{interrupt:!0})},p={code:null,containerState:{},defineSkip:C,events:[],now:k,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:g};let y=r.tokenize.call(p,h);return r.resolveAll&&u.push(r),p;function g(ee){return d=In(d,ee),N(),d[d.length-1]!==null?[]:(B(r,0),p.events=fu(u,p.events,p),p.events)}function v(ee,te){return K3(b(ee),te)}function b(ee){return V3(d,ee)}function k(){const{_bufferIndex:ee,_index:te,line:ce,column:ae,offset:q}=l;return{_bufferIndex:ee,_index:te,line:ce,column:ae,offset:q}}function C(ee){o[ee.line]=ee.column,P()}function N(){let ee;for(;l._index<d.length;){const te=d[l._index];if(typeof te=="string")for(ee=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===ee&&l._bufferIndex<te.length;)j(te.charCodeAt(l._bufferIndex));else j(te)}}function j(ee){y=y(ee)}function R(ee){Re(ee)?(l.line++,l.column=1,l.offset+=ee===-3?2:1,P()):ee!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===d[l._index].length&&(l._bufferIndex=-1,l._index++)),p.previous=ee}function M(ee,te){const ce=te||{};return ce.type=ee,ce.start=k(),p.events.push(["enter",ce,p]),f.push(ce),ce}function O(ee){const te=f.pop();return te.end=k(),p.events.push(["exit",te,p]),te}function L(ee,te){B(ee,te.from)}function D(ee,te){te.restore()}function I(ee,te){return ce;function ce(ae,q,z){let F,J,Y,A;return Array.isArray(ae)?G(ae):"tokenize"in ae?G([ae]):_(ae);function _(fe){return ge;function ge(ze){const Ee=ze!==null&&fe[ze],pe=ze!==null&&fe.null,Oe=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return G(Oe)(ze)}}function G(fe){return F=fe,J=0,fe.length===0?z:T(fe[J])}function T(fe){return ge;function ge(ze){return A=V(),Y=fe,fe.partial||(p.currentConstruct=fe),fe.name&&p.parser.constructs.disable.null.includes(fe.name)?me():fe.tokenize.call(te?Object.assign(Object.create(p),te):p,h,oe,me)(ze)}}function oe(fe){return ee(Y,A),q}function me(fe){return A.restore(),++J<F.length?T(F[J]):z}}}function B(ee,te){ee.resolveAll&&!u.includes(ee)&&u.push(ee),ee.resolve&&An(p.events,te,p.events.length-te,ee.resolve(p.events.slice(te),p)),ee.resolveTo&&(p.events=ee.resolveTo(p.events,p))}function V(){const ee=k(),te=p.previous,ce=p.currentConstruct,ae=p.events.length,q=Array.from(f);return{from:ae,restore:z};function z(){l=ee,p.previous=te,p.currentConstruct=ce,p.events.length=ae,f=q,P()}}function P(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function V3(e,r){const a=r.start._index,l=r.start._bufferIndex,o=r.end._index,u=r.end._bufferIndex;let d;if(a===o)d=[e[a].slice(l,u)];else{if(d=e.slice(a,o),l>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(l):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function K3(e,r){let a=-1;const l=[];let o;for(;++a<e.length;){const u=e[a];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
56
+ `;break}case-3:{d=`\r
57
+ `;break}case-2:{d=r?" ":" ";break}case-1:{if(!r&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,l.push(d)}return l.join("")}function X3(e){const l={constructs:jk([$3,...(e||{}).extensions||[]]),content:o(uz),defined:[],document:o(fz),flow:o(T3),lazy:{},string:o(O3),text:o(D3)};return l;function o(u){return d;function d(f){return Y3(l,u,f)}}}function Q3(e){for(;!_k(e););return e}const Cb=/[\0\t\n\r]/g;function Z3(){let e=1,r="",a=!0,l;return o;function o(u,d,f){const h=[];let p,y,g,v,b;for(u=r+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),g=0,r="",a&&(u.charCodeAt(0)===65279&&g++,a=void 0);g<u.length;){if(Cb.lastIndex=g,p=Cb.exec(u),v=p&&p.index!==void 0?p.index:u.length,b=u.charCodeAt(v),!p){r=u.slice(g);break}if(b===10&&g===v&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),g<v&&(h.push(u.slice(g,v)),e+=v-g),b){case 0:{h.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:l=!0,e=1}g=v+1}return f&&(l&&h.push(-5),r&&h.push(r),h.push(null)),h}}const J3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function W3(e){return e.replace(J3,e5)}function e5(e,r,a){if(r)return r;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return Ck(a.slice(u?2:1),u?16:10)}return Km(a)||e}const zk={}.hasOwnProperty;function t5(e,r,a){return r&&typeof r=="object"&&(a=r,r=void 0),n5(a)(Q3(X3(a).document().write(Z3()(e,r,!0))))}function n5(e){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Ne),autolinkProtocol:V,autolinkEmail:V,atxHeading:u(Pt),blockQuote:u(pe),characterEscape:V,characterReference:V,codeFenced:u(Oe),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(Oe,d),codeText:u(De,d),codeTextData:V,data:V,codeFlowValue:V,definition:u(Ue),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(Ge),hardBreakEscape:u(Ut),hardBreakTrailing:u(Ut),htmlFlow:u(Jn,d),htmlFlowData:V,htmlText:u(Jn,d),htmlTextData:V,image:u(Fn),label:d,link:u(Ne),listItem:u(he),listItemValue:v,listOrdered:u(Le,g),listUnordered:u(Le),paragraph:u(Qe),reference:T,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(Pt),strong:u(et),thematicBreak:u(Wt)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:Ee,autolinkProtocol:ze,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:fe,characterReference:ge,codeFenced:h(N),codeFencedFence:C,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:P,codeIndented:h(j),codeText:h(q),codeTextData:P,data:P,definition:h(),definitionDestinationString:O,definitionLabelString:R,definitionTitleString:M,emphasis:h(),hardBreakEscape:h(te),hardBreakTrailing:h(te),htmlFlow:h(ce),htmlFlowData:P,htmlText:h(ae),htmlTextData:P,image:h(F),label:Y,labelText:J,lineEnding:ee,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:oe,resourceDestinationString:A,resourceTitleString:_,resource:G,setextHeading:h(B),setextHeadingLineSequence:I,setextHeadingText:D,strong:h(),thematicBreak:h()}};Lk(r,(e||{}).mdastExtensions||[]);const a={};return l;function l(W){let se={type:"root",children:[]};const be={stack:[se],tokenStack:[],config:r,enter:f,exit:p,buffer:d,resume:y,data:a},K=[];let Ae=-1;for(;++Ae<W.length;)if(W[Ae][1].type==="listOrdered"||W[Ae][1].type==="listUnordered")if(W[Ae][0]==="enter")K.push(Ae);else{const xn=K.pop();Ae=o(W,xn,Ae)}for(Ae=-1;++Ae<W.length;){const xn=r[W[Ae][0]];zk.call(xn,W[Ae][1].type)&&xn[W[Ae][1].type].call(Object.assign({sliceSerialize:W[Ae][2].sliceSerialize},be),W[Ae][1])}if(be.tokenStack.length>0){const xn=be.tokenStack[be.tokenStack.length-1];(xn[1]||Nb).call(be,void 0,xn[0])}for(se.position={start:ua(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:ua(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<r.transforms.length;)se=r.transforms[Ae](se)||se;return se}function o(W,se,be){let K=se-1,Ae=-1,xn=!1,hr,en,Dt,sn;for(;++K<=be;){const dt=W[K];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?Ae++:Ae--,sn=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(hr&&!sn&&!Ae&&!Dt&&(Dt=K),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!Ae&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||Ae===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(hr){let Pr=K;for(en=void 0;Pr--;){const Gn=W[Pr];if(Gn[1].type==="lineEnding"||Gn[1].type==="lineEndingBlank"){if(Gn[0]==="exit")continue;en&&(W[en][1].type="lineEndingBlank",xn=!0),Gn[1].type="lineEnding",en=Pr}else if(!(Gn[1].type==="linePrefix"||Gn[1].type==="blockQuotePrefix"||Gn[1].type==="blockQuotePrefixWhitespace"||Gn[1].type==="blockQuoteMarker"||Gn[1].type==="listItemIndent"))break}Dt&&(!en||Dt<en)&&(hr._spread=!0),hr.end=Object.assign({},en?W[en][1].start:dt[1].end),W.splice(en||K,0,["exit",hr,dt[2]]),K++,be++}if(dt[1].type==="listItemPrefix"){const Pr={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};hr=Pr,W.splice(K,0,["enter",Pr,dt[2]]),K++,be++,Dt=void 0,sn=!0}}}return W[se][1]._spread=xn,be}function u(W,se){return be;function be(K){f.call(this,W(K),K),se&&se.call(this,K)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(W,se,be){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([se,be||void 0]),W.position={start:ua(se.start),end:void 0}}function h(W){return se;function se(be){W&&W.call(this,be),p.call(this,be)}}function p(W,se){const be=this.stack.pop(),K=this.tokenStack.pop();if(K)K[0].type!==W.type&&(se?se.call(this,W,K[0]):(K[1]||Nb).call(this,W,K[0]));else throw new Error("Cannot close `"+W.type+"` ("+ds({start:W.start,end:W.end})+"): it’s not open");be.position.end=ua(W.end)}function y(){return Vm(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(W){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function b(){const W=this.resume(),se=this.stack[this.stack.length-1];se.lang=W}function k(){const W=this.resume(),se=this.stack[this.stack.length-1];se.meta=W}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W.replace(/(\r?\n|\r)$/g,"")}function R(W){const se=this.resume(),be=this.stack[this.stack.length-1];be.label=se,be.identifier=Kn(this.sliceSerialize(W)).toLowerCase()}function M(){const W=this.resume(),se=this.stack[this.stack.length-1];se.title=W}function O(){const W=this.resume(),se=this.stack[this.stack.length-1];se.url=W}function L(W){const se=this.stack[this.stack.length-1];if(!se.depth){const be=this.sliceSerialize(W).length;se.depth=be}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function I(W){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function V(W){const be=this.stack[this.stack.length-1].children;let K=be[be.length-1];(!K||K.type!=="text")&&(K=qe(),K.position={start:ua(W.start),end:void 0},be.push(K)),this.stack.push(K)}function P(W){const se=this.stack.pop();se.value+=this.sliceSerialize(W),se.position.end=ua(W.end)}function ee(W){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=se.children[se.children.length-1];be.position.end=ua(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(se.type)&&(V.call(this,W),P.call(this,W))}function te(){this.data.atHardBreak=!0}function ce(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function ae(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function q(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function z(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=se,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function F(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=se,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function J(W){const se=this.sliceSerialize(W),be=this.stack[this.stack.length-2];be.label=W3(se),be.identifier=Kn(se).toLowerCase()}function Y(){const W=this.stack[this.stack.length-1],se=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const K=W.children;be.children=K}else be.alt=se}function A(){const W=this.resume(),se=this.stack[this.stack.length-1];se.url=W}function _(){const W=this.resume(),se=this.stack[this.stack.length-1];se.title=W}function G(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function oe(W){const se=this.resume(),be=this.stack[this.stack.length-1];be.label=se,be.identifier=Kn(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function me(W){this.data.characterReferenceType=W.type}function fe(W){const se=this.sliceSerialize(W),be=this.data.characterReferenceType;let K;be?(K=Ck(se,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):K=Km(se);const Ae=this.stack[this.stack.length-1];Ae.value+=K}function ge(W){const se=this.stack.pop();se.position.end=ua(W.end)}function ze(W){P.call(this,W);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(W)}function Ee(W){P.call(this,W);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(W)}function pe(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ge(){return{type:"emphasis",children:[]}}function Pt(){return{type:"heading",depth:0,children:[]}}function Ut(){return{type:"break"}}function Jn(){return{type:"html",value:""}}function Fn(){return{type:"image",title:null,url:"",alt:null}}function Ne(){return{type:"link",title:null,url:"",children:[]}}function Le(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function he(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function et(){return{type:"strong",children:[]}}function qe(){return{type:"text",value:""}}function Wt(){return{type:"thematicBreak"}}}function ua(e){return{line:e.line,column:e.column,offset:e.offset}}function Lk(e,r){let a=-1;for(;++a<r.length;){const l=r[a];Array.isArray(l)?Lk(e,l):r5(e,l)}}function r5(e,r){let a;for(a in r)if(zk.call(r,a))switch(a){case"canContainEols":{const l=r[a];l&&e[a].push(...l);break}case"transforms":{const l=r[a];l&&e[a].push(...l);break}case"enter":case"exit":{const l=r[a];l&&Object.assign(e[a],l);break}}}function Nb(e,r){throw e?new Error("Cannot close `"+e.type+"` ("+ds({start:e.start,end:e.end})+"): a different token (`"+r.type+"`, "+ds({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+ds({start:r.start,end:r.end})+") is still open")}function a5(e){const r=this;r.parser=a;function a(l){return t5(l,{...r.data("settings"),...e,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function l5(e,r){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(r),!0)};return e.patch(r,a),e.applyData(r,a)}function i5(e,r){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(r,a),[e.applyData(r,a),{type:"text",value:`
58
+ `}]}function s5(e,r){const a=r.value?r.value+`
59
+ `:"",l={},o=r.lang?r.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:l,children:[{type:"text",value:a}]};return r.meta&&(u.data={meta:r.meta}),e.patch(r,u),u=e.applyData(r,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(r,u),u}function o5(e,r){const a={type:"element",tagName:"del",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function c5(e,r){const a={type:"element",tagName:"em",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function u5(e,r){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),o=si(l.toLowerCase()),u=e.footnoteOrder.indexOf(l);let d,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),d=e.footnoteOrder.length):d=u+1,f+=1,e.footnoteCounts.set(l,f);const h={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(r,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(r,p),e.applyData(r,p)}function d5(e,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function f5(e,r){if(e.options.allowDangerousHtml){const a={type:"raw",value:r.value};return e.patch(r,a),e.applyData(r,a)}}function Pk(e,r){const a=r.referenceType;let l="]";if(a==="collapsed"?l+="[]":a==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const o=e.all(r),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=l:o.push({type:"text",value:l}),o}function h5(e,r){const a=String(r.identifier).toUpperCase(),l=e.definitionById.get(a);if(!l)return Pk(e,r);const o={src:si(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(r,u),e.applyData(r,u)}function m5(e,r){const a={src:si(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(r,l),e.applyData(r,l)}function p5(e,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};e.patch(r,a);const l={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(r,l),e.applyData(r,l)}function g5(e,r){const a=String(r.identifier).toUpperCase(),l=e.definitionById.get(a);if(!l)return Pk(e,r);const o={href:si(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"a",properties:o,children:e.all(r)};return e.patch(r,u),e.applyData(r,u)}function x5(e,r){const a={href:si(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(r)};return e.patch(r,l),e.applyData(r,l)}function y5(e,r,a){const l=e.all(r),o=a?v5(a):Uk(r),u={},d=[];if(typeof r.checked=="boolean"){const y=l[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},l.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const y=l[f];(o||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
60
+ `}),y.type==="element"&&y.tagName==="p"&&!o?d.push(...y.children):d.push(y)}const h=l[l.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&d.push({type:"text",value:`
61
+ `});const p={type:"element",tagName:"li",properties:u,children:d};return e.patch(r,p),e.applyData(r,p)}function v5(e){let r=!1;if(e.type==="list"){r=e.spread||!1;const a=e.children;let l=-1;for(;!r&&++l<a.length;)r=Uk(a[l])}return r}function Uk(e){const r=e.spread;return r??e.children.length>1}function b5(e,r){const a={},l=e.all(r);let o=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++o<l.length;){const d=l[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:r.ordered?"ol":"ul",properties:a,children:e.wrap(l,!0)};return e.patch(r,u),e.applyData(r,u)}function S5(e,r){const a={type:"element",tagName:"p",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function w5(e,r){const a={type:"root",children:e.wrap(e.all(r))};return e.patch(r,a),e.applyData(r,a)}function k5(e,r){const a={type:"element",tagName:"strong",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function j5(e,r){const a=e.all(r),l=a.shift(),o=[];if(l){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(r.children[0],d),o.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=Fm(r.children[1]),h=xk(r.children[r.children.length-1]);f&&h&&(d.position={start:f,end:h}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(r,u),e.applyData(r,u)}function C5(e,r,a){const l=a?a.children:void 0,u=(l?l.indexOf(r):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,f=d?d.length:r.children.length;let h=-1;const p=[];for(;++h<f;){const g=r.children[h],v={},b=d?d[h]:void 0;b&&(v.align=b);let k={type:"element",tagName:u,properties:v,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),p.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(r,y),e.applyData(r,y)}function N5(e,r){const a={type:"element",tagName:"td",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}const Eb=9,Ab=32;function E5(e){const r=String(e),a=/\r?\n|\r/g;let l=a.exec(r),o=0;const u=[];for(;l;)u.push(_b(r.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=a.exec(r);return u.push(_b(r.slice(o),o>0,!1)),u.join("")}function _b(e,r,a){let l=0,o=e.length;if(r){let u=e.codePointAt(l);for(;u===Eb||u===Ab;)l++,u=e.codePointAt(l)}if(a){let u=e.codePointAt(o-1);for(;u===Eb||u===Ab;)o--,u=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}function A5(e,r){const a={type:"text",value:E5(String(r.value))};return e.patch(r,a),e.applyData(r,a)}function _5(e,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,a),e.applyData(r,a)}const T5={blockquote:l5,break:i5,code:s5,delete:o5,emphasis:c5,footnoteReference:u5,heading:d5,html:f5,imageReference:h5,image:m5,inlineCode:p5,linkReference:g5,link:x5,listItem:y5,list:b5,paragraph:S5,root:w5,strong:k5,table:j5,tableCell:N5,tableRow:C5,text:A5,thematicBreak:_5,toml:lc,yaml:lc,definition:lc,footnoteDefinition:lc};function lc(){}const Ik=-1,hu=0,hs=1,Rc=2,Qm=3,Zm=4,Jm=5,Wm=6,Bk=7,Hk=8,Tb=typeof self=="object"?self:globalThis,R5=(e,r)=>{const a=(o,u)=>(e.set(u,o),o),l=o=>{if(e.has(o))return e.get(o);const[u,d]=r[o];switch(u){case hu:case Ik:return a(d,o);case hs:{const f=a([],o);for(const h of d)f.push(l(h));return f}case Rc:{const f=a({},o);for(const[h,p]of d)f[l(h)]=l(p);return f}case Qm:return a(new Date(d),o);case Zm:{const{source:f,flags:h}=d;return a(new RegExp(f,h),o)}case Jm:{const f=a(new Map,o);for(const[h,p]of d)f.set(l(h),l(p));return f}case Wm:{const f=a(new Set,o);for(const h of d)f.add(l(h));return f}case Bk:{const{name:f,message:h}=d;return a(new Tb[f](h),o)}case Hk:return a(BigInt(d),o);case"BigInt":return a(Object(BigInt(d)),o);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return a(new DataView(f),d)}}return a(new Tb[u](d),o)};return l},Rb=e=>R5(new Map,e)(0),Pl="",{toString:M5}={},{keys:O5}=Object,ls=e=>{const r=typeof e;if(r!=="object"||!e)return[hu,r];const a=M5.call(e).slice(8,-1);switch(a){case"Array":return[hs,Pl];case"Object":return[Rc,Pl];case"Date":return[Qm,Pl];case"RegExp":return[Zm,Pl];case"Map":return[Jm,Pl];case"Set":return[Wm,Pl];case"DataView":return[hs,a]}return a.includes("Array")?[hs,a]:a.includes("Error")?[Bk,a]:[Rc,a]},ic=([e,r])=>e===hu&&(r==="function"||r==="symbol"),D5=(e,r,a,l)=>{const o=(d,f)=>{const h=l.push(d)-1;return a.set(f,h),h},u=d=>{if(a.has(d))return a.get(d);let[f,h]=ls(d);switch(f){case hu:{let y=d;switch(h){case"bigint":f=Hk,y=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);y=null;break;case"undefined":return o([Ik],d)}return o([f,y],d)}case hs:{if(h){let v=d;return h==="DataView"?v=new Uint8Array(d.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(d)),o([h,[...v]],d)}const y=[],g=o([f,y],d);for(const v of d)y.push(u(v));return g}case Rc:{if(h)switch(h){case"BigInt":return o([h,d.toString()],d);case"Boolean":case"Number":case"String":return o([h,d.valueOf()],d)}if(r&&"toJSON"in d)return u(d.toJSON());const y=[],g=o([f,y],d);for(const v of O5(d))(e||!ic(ls(d[v])))&&y.push([u(v),u(d[v])]);return g}case Qm:return o([f,d.toISOString()],d);case Zm:{const{source:y,flags:g}=d;return o([f,{source:y,flags:g}],d)}case Jm:{const y=[],g=o([f,y],d);for(const[v,b]of d)(e||!(ic(ls(v))||ic(ls(b))))&&y.push([u(v),u(b)]);return g}case Wm:{const y=[],g=o([f,y],d);for(const v of d)(e||!ic(ls(v)))&&y.push(u(v));return g}}const{message:p}=d;return o([f,{name:h,message:p}],d)};return u},Mb=(e,{json:r,lossy:a}={})=>{const l=[];return D5(!(r||a),!!r,new Map,l)(e),l},Mc=typeof structuredClone=="function"?(e,r)=>r&&("json"in r||"lossy"in r)?Rb(Mb(e,r)):structuredClone(e):(e,r)=>Rb(Mb(e,r));function z5(e,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function L5(e,r){return"Back to reference "+(e+1)+(r>1?"-"+r:"")}function P5(e){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||z5,l=e.options.footnoteBackLabel||L5,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[h]);if(!p)continue;const y=e.all(p),g=String(p.identifier).toUpperCase(),v=si(g.toLowerCase());let b=0;const k=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++b<=C;){k.length>0&&k.push({type:"text",value:" "});let R=typeof a=="string"?a:a(h,b);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,b),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const R=N.children[N.children.length-1];R&&R.type==="text"?R.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else y.push(...k);const j={type:"element",tagName:"li",properties:{id:r+"fn-"+v},children:e.wrap(y,!0)};e.patch(p,j),f.push(j)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Mc(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
62
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
63
+ `}]}}const mu=(function(e){if(e==null)return H5;if(typeof e=="function")return pu(e);if(typeof e=="object")return Array.isArray(e)?U5(e):I5(e);if(typeof e=="string")return B5(e);throw new Error("Expected function, string, or object as test")});function U5(e){const r=[];let a=-1;for(;++a<e.length;)r[a]=mu(e[a]);return pu(l);function l(...o){let u=-1;for(;++u<r.length;)if(r[u].apply(this,o))return!0;return!1}}function I5(e){const r=e;return pu(a);function a(l){const o=l;let u;for(u in e)if(o[u]!==r[u])return!1;return!0}}function B5(e){return pu(r);function r(a){return a&&a.type===e}}function pu(e){return r;function r(a,l,o){return!!(q5(a)&&e.call(this,a,typeof l=="number"?l:void 0,o||void 0))}}function H5(){return!0}function q5(e){return e!==null&&typeof e=="object"&&"type"in e}const qk=[],F5=!0,Gh=!1,G5="skip";function Fk(e,r,a,l){let o;typeof r=="function"&&typeof a!="function"?(l=a,a=r):o=r;const u=mu(o),d=l?-1:1;f(e,void 0,[])();function f(h,p,y){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=qk,k,C,N;if((!r||u(h,p,y[y.length-1]||void 0))&&(b=$5(a(h,y)),b[0]===Gh))return b;if("children"in h&&h.children){const j=h;if(j.children&&b[0]!==G5)for(C=(l?j.children.length:-1)+d,N=y.concat(j);C>-1&&C<j.children.length;){const R=j.children[C];if(k=f(R,C,N)(),k[0]===Gh)return k;C=typeof k[1]=="number"?k[1]:C+d}}return b}}}function $5(e){return Array.isArray(e)?e:typeof e=="number"?[F5,e]:e==null?qk:[e]}function ep(e,r,a,l){let o,u,d;typeof r=="function"&&typeof a!="function"?(u=void 0,d=r,o=a):(u=r,d=a,o=l),Fk(e,u,f,o);function f(h,p){const y=p[p.length-1],g=y?y.children.indexOf(h):void 0;return d(h,g,y)}}const $h={}.hasOwnProperty,Y5={};function V5(e,r){const a=r||Y5,l=new Map,o=new Map,u=new Map,d={...T5,...a.handlers},f={all:p,applyData:X5,definitionById:l,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:h,options:a,patch:K5,wrap:Z5};return ep(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?l:o,v=String(y.identifier).toUpperCase();g.has(v)||g.set(v,y)}}),f;function h(y,g){const v=y.type,b=f.handlers[v];if($h.call(f.handlers,v)&&b)return b(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in y){const{children:C,...N}=y,j=Mc(N);return j.children=f.all(y),j}return Mc(y)}return(f.options.unknownHandler||Q5)(f,y,g)}function p(y){const g=[];if("children"in y){const v=y.children;let b=-1;for(;++b<v.length;){const k=f.one(v[b],y);if(k){if(b&&v[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Ob(k.value)),!Array.isArray(k)&&k.type==="element")){const C=k.children[0];C&&C.type==="text"&&(C.value=Ob(C.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function K5(e,r){e.position&&(r.position=LD(e))}function X5(e,r){let a=r;if(e&&e.data){const l=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof l=="string")if(a.type==="element")a.tagName=l;else{const d="children"in a?a.children:[a];a={type:"element",tagName:l,properties:{},children:d}}a.type==="element"&&u&&Object.assign(a.properties,Mc(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function Q5(e,r){const a=r.data||{},l="value"in r&&!($h.call(a,"hProperties")||$h.call(a,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:e.all(r)};return e.patch(r,l),e.applyData(r,l)}function Z5(e,r){const a=[];let l=-1;for(r&&a.push({type:"text",value:`
64
+ `});++l<e.length;)l&&a.push({type:"text",value:`
65
+ `}),a.push(e[l]);return r&&e.length>0&&a.push({type:"text",value:`
66
+ `}),a}function Ob(e){let r=0,a=e.charCodeAt(r);for(;a===9||a===32;)r++,a=e.charCodeAt(r);return e.slice(r)}function Db(e,r){const a=V5(e,r),l=a.one(e,void 0),o=P5(a),u=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
67
+ `},o),u}function J5(e,r){return e&&"run"in e?async function(a,l){const o=Db(a,{file:l,...r});await e.run(o,l)}:function(a,l){return Db(a,{file:l,...e||r})}}function zb(e){if(e)throw e}var lh,Lb;function W5(){if(Lb)return lh;Lb=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):r.call(p)==="[object Array]"},u=function(p){if(!p||r.call(p)!=="[object Object]")return!1;var y=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!g)return!1;var v;for(v in p);return typeof v>"u"||e.call(p,v)},d=function(p,y){a&&y.name==="__proto__"?a(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},f=function(p,y){if(y==="__proto__")if(e.call(p,y)){if(l)return l(p,y).value}else return;return p[y]};return lh=function h(){var p,y,g,v,b,k,C=arguments[0],N=1,j=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},N=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});N<j;++N)if(p=arguments[N],p!=null)for(y in p)g=f(C,y),v=f(p,y),C!==v&&(R&&v&&(u(v)||(b=o(v)))?(b?(b=!1,k=g&&o(g)?g:[]):k=g&&u(g)?g:{},d(C,{name:y,newValue:h(R,k,v)})):typeof v<"u"&&d(C,{name:y,newValue:v}));return C},lh}var eL=W5();const ih=Dc(eL);function Yh(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function tL(){const e=[],r={run:a,use:l};return r;function a(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...o);function f(h,...p){const y=e[++u];let g=-1;if(h){d(h);return}for(;++g<o.length;)(p[g]===null||p[g]===void 0)&&(p[g]=o[g]);o=p,y?nL(y,f)(...p):d(null,...p)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),r}}function nL(e,r){let a;return l;function l(...d){const f=e.length>d.length;let h;f&&d.push(o);try{h=e.apply(this,d)}catch(p){const y=p;if(f&&a)throw y;return o(y)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,o):h instanceof Error?o(h):u(h))}function o(d,...f){a||(a=!0,r(d,...f))}function u(d){o(null,d)}}const rr={basename:rL,dirname:aL,extname:lL,join:iL,sep:"/"};function rL(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Rs(e);let a=0,l=-1,o=e.length,u;if(r===void 0||r.length===0||r.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else l<0&&(u=!0,l=o+1);return l<0?"":e.slice(a,l)}if(r===e)return"";let d=-1,f=r.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else d<0&&(u=!0,d=o+1),f>-1&&(e.codePointAt(o)===r.codePointAt(f--)?f<0&&(l=o):(f=-1,l=d));return a===l?l=d:l<0&&(l=e.length),e.slice(a,l)}function aL(e){if(Rs(e),e.length===0)return".";let r=-1,a=e.length,l;for(;--a;)if(e.codePointAt(a)===47){if(l){r=a;break}}else l||(l=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function lL(e){Rs(e);let r=e.length,a=-1,l=0,o=-1,u=0,d;for(;r--;){const f=e.codePointAt(r);if(f===47){if(d){l=r+1;break}continue}a<0&&(d=!0,a=r+1),f===46?o<0?o=r:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===l+1?"":e.slice(o,a)}function iL(...e){let r=-1,a;for(;++r<e.length;)Rs(e[r]),e[r]&&(a=a===void 0?e[r]:a+"/"+e[r]);return a===void 0?".":sL(a)}function sL(e){Rs(e);const r=e.codePointAt(0)===47;let a=oL(e,!r);return a.length===0&&!r&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),r?"/"+a:a}function oL(e,r){let a="",l=0,o=-1,u=0,d=-1,f,h;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(a.length<2||l!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(h=a.lastIndexOf("/"),h!==a.length-1){h<0?(a="",l=0):(a=a.slice(0,h),l=a.length-1-a.lastIndexOf("/")),o=d,u=0;continue}}else if(a.length>0){a="",l=0,o=d,u=0;continue}}r&&(a=a.length>0?a+"/..":"..",l=2)}else a.length>0?a+="/"+e.slice(o+1,d):a=e.slice(o+1,d),l=d-o-1;o=d,u=0}else f===46&&u>-1?u++:u=-1}return a}function Rs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cL={cwd:uL};function uL(){return"/"}function Vh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dL(e){if(typeof e=="string")e=new URL(e);else if(!Vh(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return fL(e)}function fL(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=e.pathname;let a=-1;for(;++a<r.length;)if(r.codePointAt(a)===37&&r.codePointAt(a+1)===50){const l=r.codePointAt(a+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(r)}const sh=["history","path","basename","stem","extname","dirname"];class Gk{constructor(r){let a;r?Vh(r)?a={path:r}:typeof r=="string"||hL(r)?a={value:r}:a=r:a={},this.cwd="cwd"in a?"":cL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<sh.length;){const u=sh[l];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)sh.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?rr.basename(this.path):void 0}set basename(r){ch(r,"basename"),oh(r,"basename"),this.path=rr.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?rr.dirname(this.path):void 0}set dirname(r){Pb(this.basename,"dirname"),this.path=rr.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?rr.extname(this.path):void 0}set extname(r){if(oh(r,"extname"),Pb(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=rr.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Vh(r)&&(r=dL(r)),ch(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?rr.basename(this.path,this.extname):void 0}set stem(r){ch(r,"stem"),oh(r,"stem"),this.path=rr.join(this.dirname||"",r+(this.extname||""))}fail(r,a,l){const o=this.message(r,a,l);throw o.fatal=!0,o}info(r,a,l){const o=this.message(r,a,l);return o.fatal=void 0,o}message(r,a,l){const o=new Jt(r,a,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function oh(e,r){if(e&&e.includes(rr.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+rr.sep+"`")}function ch(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function Pb(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}function hL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mL=(function(e){const l=this.constructor.prototype,o=l[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,l),u}),pL={}.hasOwnProperty;class tp extends mL{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=tL()}copy(){const r=new tp;let a=-1;for(;++a<this.attachers.length;){const l=this.attachers[a];r.use(...l)}return r.data(ih(!0,{},this.namespace)),r}data(r,a){return typeof r=="string"?arguments.length===2?(fh("data",this.frozen),this.namespace[r]=a,this):pL.call(this.namespace,r)&&this.namespace[r]||void 0:r?(fh("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=a.call(r,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const a=sc(r),l=this.parser||this.Parser;return uh("parse",l),l(String(a),a)}process(r,a){const l=this;return this.freeze(),uh("process",this.parser||this.Parser),dh("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,d){const f=sc(r),h=l.parse(f);l.run(h,f,function(y,g,v){if(y||!g||!v)return p(y);const b=g,k=l.stringify(b,v);yL(k)?v.value=k:v.result=k,p(y,v)});function p(y,g){y||!g?d(y):u?u(g):a(void 0,g)}}}processSync(r){let a=!1,l;return this.freeze(),uh("processSync",this.parser||this.Parser),dh("processSync",this.compiler||this.Compiler),this.process(r,o),Ib("processSync","process",a),l;function o(u,d){a=!0,zb(u),l=d}}run(r,a,l){Ub(r),this.freeze();const o=this.transformers;return!l&&typeof a=="function"&&(l=a,a=void 0),l?u(void 0,l):new Promise(u);function u(d,f){const h=sc(a);o.run(r,h,p);function p(y,g,v){const b=g||r;y?f(y):d?d(b):l(void 0,b,v)}}}runSync(r,a){let l=!1,o;return this.run(r,a,u),Ib("runSync","run",l),o;function u(d,f){zb(d),o=f,l=!0}}stringify(r,a){this.freeze();const l=sc(a),o=this.compiler||this.Compiler;return dh("stringify",o),Ub(r),o(r,l)}use(r,...a){const l=this.attachers,o=this.namespace;if(fh("use",this.frozen),r!=null)if(typeof r=="function")h(r,a);else if(typeof r=="object")Array.isArray(r)?f(r):d(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function u(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[y,...g]=p;h(y,g)}else d(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function d(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(p.plugins),p.settings&&(o.settings=ih(!0,o.settings,p.settings))}function f(p){let y=-1;if(p!=null)if(Array.isArray(p))for(;++y<p.length;){const g=p[y];u(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,y){let g=-1,v=-1;for(;++g<l.length;)if(l[g][0]===p){v=g;break}if(v===-1)l.push([p,...y]);else if(y.length>0){let[b,...k]=y;const C=l[v][1];Yh(C)&&Yh(b)&&(b=ih(!0,C,b)),l[v]=[p,b,...k]}}}}const gL=new tp().freeze();function uh(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dh(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fh(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ub(e){if(!Yh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ib(e,r,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function sc(e){return xL(e)?e:new Gk(e)}function xL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function yL(e){return typeof e=="string"||vL(e)}function vL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Bb=[],Hb={allowDangerousHtml:!0},SL=/^(https?|ircs?|mailto|xmpp)$/i,wL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function qb(e){const r=kL(e),a=jL(e);return CL(r.runSync(r.parse(a),a),e)}function kL(e){const r=e.rehypePlugins||Bb,a=e.remarkPlugins||Bb,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hb}:Hb;return gL().use(a5).use(a).use(J5,l).use(r)}function jL(e){const r=e.children||"",a=new Gk;return typeof r=="string"&&(a.value=r),a}function CL(e,r){const a=r.allowedElements,l=r.allowElement,o=r.components,u=r.disallowedElements,d=r.skipHtml,f=r.unwrapDisallowed,h=r.urlTransform||NL;for(const y of wL)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+bL+y.id,void 0);return ep(e,p),HD(e,{Fragment:s.Fragment,components:o,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function p(y,g,v){if(y.type==="raw"&&v&&typeof g=="number")return d?v.children.splice(g,1):v.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let b;for(b in nh)if(Object.hasOwn(nh,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],C=nh[b];(C===null||C.includes(y.tagName))&&(y.properties[b]=h(String(k||""),b,y))}}if(y.type==="element"){let b=a?!a.includes(y.tagName):u?u.includes(y.tagName):!1;if(!b&&l&&typeof g=="number"&&(b=!l(y,g,v)),b&&v&&typeof g=="number")return f&&y.children?v.children.splice(g,1,...y.children):v.children.splice(g,1),g}}}function NL(e){const r=e.indexOf(":"),a=e.indexOf("?"),l=e.indexOf("#"),o=e.indexOf("/");return r===-1||o!==-1&&r>o||a!==-1&&r>a||l!==-1&&r>l||SL.test(e.slice(0,r))?e:""}function Fb(e,r){const a=String(e);if(typeof r!="string")throw new TypeError("Expected character");let l=0,o=a.indexOf(r);for(;o!==-1;)l++,o=a.indexOf(r,o+r.length);return l}function EL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function AL(e,r,a){const o=mu((a||{}).ignore||[]),u=_L(r);let d=-1;for(;++d<u.length;)Fk(e,"text",f);function f(p,y){let g=-1,v;for(;++g<y.length;){const b=y[g],k=v?v.children:void 0;if(o(b,k?k.indexOf(b):void 0,v))return;v=b}if(v)return h(p,y)}function h(p,y){const g=y[y.length-1],v=u[d][0],b=u[d][1];let k=0;const N=g.children.indexOf(p);let j=!1,R=[];v.lastIndex=0;let M=v.exec(p.value);for(;M;){const O=M.index,L={index:M.index,input:M.input,stack:[...y,p]};let D=b(...M,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=O+1:(k!==O&&R.push({type:"text",value:p.value.slice(k,O)}),Array.isArray(D)?R.push(...D):D&&R.push(D),k=O+M[0].length,j=!0),!v.global)break;M=v.exec(p.value)}return j?(k<p.value.length&&R.push({type:"text",value:p.value.slice(k)}),g.children.splice(N,1,...R)):R=[p],N+R.length}}function _L(e){const r=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<a.length;){const o=a[l];r.push([TL(o[0]),RL(o[1])])}return r}function TL(e){return typeof e=="string"?new RegExp(EL(e),"g"):e}function RL(e){return typeof e=="function"?e:function(){return e}}const hh="phrasing",mh=["autolink","link","image","label"];function ML(){return{transforms:[IL],enter:{literalAutolink:DL,literalAutolinkEmail:ph,literalAutolinkHttp:ph,literalAutolinkWww:ph},exit:{literalAutolink:UL,literalAutolinkEmail:PL,literalAutolinkHttp:zL,literalAutolinkWww:LL}}}function OL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hh,notInConstruct:mh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hh,notInConstruct:mh},{character:":",before:"[ps]",after:"\\/",inConstruct:hh,notInConstruct:mh}]}}function DL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ph(e){this.config.enter.autolinkProtocol.call(this,e)}function zL(e){this.config.exit.autolinkProtocol.call(this,e)}function LL(e){this.config.exit.data.call(this,e);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(e)}function PL(e){this.config.exit.autolinkEmail.call(this,e)}function UL(e){this.exit(e)}function IL(e){AL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,BL],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),HL]],{ignore:["link","linkReference"]})}function BL(e,r,a,l,o){let u="";if(!$k(o)||(/^w/i.test(r)&&(a=r+a,r="",u="http://"),!qL(a)))return!1;const d=FL(a+l);if(!d[0])return!1;const f={type:"link",title:null,url:u+r+d[0],children:[{type:"text",value:r+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function HL(e,r,a,l){return!$k(l,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+a,children:[{type:"text",value:r+"@"+a}]}}function qL(e){const r=e.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function FL(e){const r=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!r)return[e,void 0];e=e.slice(0,r.index);let a=r[0],l=a.indexOf(")");const o=Fb(e,"(");let u=Fb(e,")");for(;l!==-1&&o>u;)e+=a.slice(0,l+1),a=a.slice(l+1),l=a.indexOf(")"),u++;return[e,a]}function $k(e,r){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Fa(a)||du(a))&&(!r||a!==47)}Yk.peek=JL;function GL(){this.buffer()}function $L(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YL(){this.buffer()}function VL(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function KL(e){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Kn(this.sliceSerialize(e)).toLowerCase(),a.label=r}function XL(e){this.exit(e)}function QL(e){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Kn(this.sliceSerialize(e)).toLowerCase(),a.label=r}function ZL(e){this.exit(e)}function JL(){return"["}function Yk(e,r,a,l){const o=a.createTracker(l);let u=o.move("[^");const d=a.enter("footnoteReference"),f=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),f(),d(),u+=o.move("]"),u}function WL(){return{enter:{gfmFootnoteCallString:GL,gfmFootnoteCall:$L,gfmFootnoteDefinitionLabelString:YL,gfmFootnoteDefinition:VL},exit:{gfmFootnoteCallString:KL,gfmFootnoteCall:XL,gfmFootnoteDefinitionLabelString:QL,gfmFootnoteDefinition:ZL}}}function e6(e){let r=!1;return e&&e.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Yk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(l,o,u,d){const f=u.createTracker(d);let h=f.move("[^");const p=u.enter("footnoteDefinition"),y=u.enter("label");return h+=f.move(u.safe(u.associationId(l),{before:h,after:"]"})),y(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((r?`
68
+ `:" ")+u.indentLines(u.containerFlow(l,f.current()),r?Vk:t6))),p(),h}}function t6(e,r,a){return r===0?e:Vk(e,r,a)}function Vk(e,r,a){return(a?"":" ")+e}const n6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Kk.peek=s6;function r6(){return{canContainEols:["delete"],enter:{strikethrough:l6},exit:{strikethrough:i6}}}function a6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:n6}],handlers:{delete:Kk}}}function l6(e){this.enter({type:"delete",children:[]},e)}function i6(e){this.exit(e)}function Kk(e,r,a,l){const o=a.createTracker(l),u=a.enter("strikethrough");let d=o.move("~~");return d+=a.containerPhrasing(e,{...o.current(),before:d,after:"~"}),d+=o.move("~~"),u(),d}function s6(){return"~"}function o6(e){return e.length}function c6(e,r){const a=r||{},l=(a.align||[]).concat(),o=a.stringLength||o6,u=[],d=[],f=[],h=[];let p=0,y=-1;for(;++y<e.length;){const C=[],N=[];let j=-1;for(e[y].length>p&&(p=e[y].length);++j<e[y].length;){const R=u6(e[y][j]);if(a.alignDelimiters!==!1){const M=o(R);N[j]=M,(h[j]===void 0||M>h[j])&&(h[j]=M)}C.push(R)}d[y]=C,f[y]=N}let g=-1;if(typeof l=="object"&&"length"in l)for(;++g<p;)u[g]=Gb(l[g]);else{const C=Gb(l);for(;++g<p;)u[g]=C}g=-1;const v=[],b=[];for(;++g<p;){const C=u[g];let N="",j="";C===99?(N=":",j=":"):C===108?N=":":C===114&&(j=":");let R=a.alignDelimiters===!1?1:Math.max(1,h[g]-N.length-j.length);const M=N+"-".repeat(R)+j;a.alignDelimiters!==!1&&(R=N.length+R+j.length,R>h[g]&&(h[g]=R),b[g]=R),v[g]=M}d.splice(1,0,v),f.splice(1,0,b),y=-1;const k=[];for(;++y<d.length;){const C=d[y],N=f[y];g=-1;const j=[];for(;++g<p;){const R=C[g]||"";let M="",O="";if(a.alignDelimiters!==!1){const L=h[g]-(N[g]||0),D=u[g];D===114?M=" ".repeat(L):D===99?L%2?(M=" ".repeat(L/2+.5),O=" ".repeat(L/2-.5)):(M=" ".repeat(L/2),O=M):O=" ".repeat(L)}a.delimiterStart!==!1&&!g&&j.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&R==="")&&(a.delimiterStart!==!1||g)&&j.push(" "),a.alignDelimiters!==!1&&j.push(M),j.push(R),a.alignDelimiters!==!1&&j.push(O),a.padding!==!1&&j.push(" "),(a.delimiterEnd!==!1||g!==p-1)&&j.push("|")}k.push(a.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return k.join(`
69
+ `)}function u6(e){return e==null?"":String(e)}function Gb(e){const r=typeof e=="string"?e.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function d6(e,r,a,l){const o=a.enter("blockquote"),u=a.createTracker(l);u.move("> "),u.shift(2);const d=a.indentLines(a.containerFlow(e,u.current()),f6);return o(),d}function f6(e,r,a){return">"+(a?"":" ")+e}function h6(e,r){return $b(e,r.inConstruct,!0)&&!$b(e,r.notInConstruct,!1)}function $b(e,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let l=-1;for(;++l<r.length;)if(e.includes(r[l]))return!0;return!1}function Yb(e,r,a,l){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
70
+ `&&h6(a.stack,a.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
71
+ `}function m6(e,r){const a=String(e);let l=a.indexOf(r),o=l,u=0,d=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++u>d&&(d=u):u=1,o=l+r.length,l=a.indexOf(r,o);return d}function p6(e,r){return!!(r.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function g6(e){const r=e.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function x6(e,r,a,l){const o=g6(a),u=e.value||"",d=o==="`"?"GraveAccent":"Tilde";if(p6(e,a)){const g=a.enter("codeIndented"),v=a.indentLines(u,y6);return g(),v}const f=a.createTracker(l),h=o.repeat(Math.max(m6(u,o)+1,3)),p=a.enter("codeFenced");let y=f.move(h);if(e.lang){const g=a.enter(`codeFencedLang${d}`);y+=f.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=a.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(a.safe(e.meta,{before:y,after:`
72
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
73
+ `),u&&(y+=f.move(u+`
74
+ `)),y+=f.move(h),p(),y}function y6(e,r,a){return(a?"":" ")+e}function np(e){const r=e.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function v6(e,r,a,l){const o=np(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("definition");let f=a.enter("label");const h=a.createTracker(l);let p=h.move("[");return p+=h.move(a.safe(a.associationId(e),{before:p,after:"]",...h.current()})),p+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(a.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=a.enter("destinationRaw"),p+=h.move(a.safe(e.url,{before:p,after:e.title?" ":`
75
+ `,...h.current()}))),f(),e.title&&(f=a.enter(`title${u}`),p+=h.move(" "+o),p+=h.move(a.safe(e.title,{before:p,after:o,...h.current()})),p+=h.move(o),f()),d(),p}function b6(e){const r=e.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function vs(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Oc(e,r,a){const l=ti(e),o=ti(r);return l===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Xk.peek=S6;function Xk(e,r,a,l){const o=b6(a),u=a.enter("emphasis"),d=a.createTracker(l),f=d.move(o);let h=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const p=h.charCodeAt(0),y=Oc(l.before.charCodeAt(l.before.length-1),p,o);y.inside&&(h=vs(p)+h.slice(1));const g=h.charCodeAt(h.length-1),v=Oc(l.after.charCodeAt(0),g,o);v.inside&&(h=h.slice(0,-1)+vs(g));const b=d.move(o);return u(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+h+b}function S6(e,r,a){return a.options.emphasis||"*"}function w6(e,r){let a=!1;return ep(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return a=!0,Gh}),!!((!e.depth||e.depth<3)&&Vm(e)&&(r.options.setext||a))}function k6(e,r,a,l){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(l);if(w6(e,a)){const y=a.enter("headingSetext"),g=a.enter("phrasing"),v=a.containerPhrasing(e,{...u.current(),before:`
76
+ `,after:`
77
+ `});return g(),y(),v+`
78
+ `+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
79
+ `))+1))}const d="#".repeat(o),f=a.enter("headingAtx"),h=a.enter("phrasing");u.move(d+" ");let p=a.containerPhrasing(e,{before:"# ",after:`
80
+ `,...u.current()});return/^[\t ]/.test(p)&&(p=vs(p.charCodeAt(0))+p.slice(1)),p=p?d+" "+p:d,a.options.closeAtx&&(p+=" "+d),h(),f(),p}Qk.peek=j6;function Qk(e){return e.value||""}function j6(){return"<"}Zk.peek=C6;function Zk(e,r,a,l){const o=np(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("image");let f=a.enter("label");const h=a.createTracker(l);let p=h.move("![");return p+=h.move(a.safe(e.alt,{before:p,after:"]",...h.current()})),p+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(a.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=a.enter("destinationRaw"),p+=h.move(a.safe(e.url,{before:p,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=a.enter(`title${u}`),p+=h.move(" "+o),p+=h.move(a.safe(e.title,{before:p,after:o,...h.current()})),p+=h.move(o),f()),p+=h.move(")"),d(),p}function C6(){return"!"}Jk.peek=N6;function Jk(e,r,a,l){const o=e.referenceType,u=a.enter("imageReference");let d=a.enter("label");const f=a.createTracker(l);let h=f.move("![");const p=a.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const g=a.safe(a.associationId(e),{before:h,after:"]",...f.current()});return d(),a.stack=y,u(),o==="full"||!p||p!==g?h+=f.move(g+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function N6(){return"!"}Wk.peek=E6;function Wk(e,r,a){let l=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++u<a.unsafe.length;){const d=a.unsafe[u],f=a.compilePattern(d);let h;if(d.atBreak)for(;h=f.exec(l);){let p=h.index;l.charCodeAt(p)===10&&l.charCodeAt(p-1)===13&&p--,l=l.slice(0,p)+" "+l.slice(h.index+1)}}return o+l+o}function E6(){return"`"}function ej(e,r){const a=Vm(e);return!!(!r.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}tj.peek=A6;function tj(e,r,a,l){const o=np(a),u=o==='"'?"Quote":"Apostrophe",d=a.createTracker(l);let f,h;if(ej(e,a)){const y=a.stack;a.stack=[],f=a.enter("autolink");let g=d.move("<");return g+=d.move(a.containerPhrasing(e,{before:g,after:">",...d.current()})),g+=d.move(">"),f(),a.stack=y,g}f=a.enter("link"),h=a.enter("label");let p=d.move("[");return p+=d.move(a.containerPhrasing(e,{before:p,after:"](",...d.current()})),p+=d.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(a.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(h=a.enter("destinationRaw"),p+=d.move(a.safe(e.url,{before:p,after:e.title?" ":")",...d.current()}))),h(),e.title&&(h=a.enter(`title${u}`),p+=d.move(" "+o),p+=d.move(a.safe(e.title,{before:p,after:o,...d.current()})),p+=d.move(o),h()),p+=d.move(")"),f(),p}function A6(e,r,a){return ej(e,a)?"<":"["}nj.peek=_6;function nj(e,r,a,l){const o=e.referenceType,u=a.enter("linkReference");let d=a.enter("label");const f=a.createTracker(l);let h=f.move("[");const p=a.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const g=a.safe(a.associationId(e),{before:h,after:"]",...f.current()});return d(),a.stack=y,u(),o==="full"||!p||p!==g?h+=f.move(g+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function _6(){return"["}function rp(e){const r=e.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function T6(e){const r=rp(e),a=e.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function R6(e){const r=e.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function rj(e){const r=e.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function M6(e,r,a,l){const o=a.enter("list"),u=a.bulletCurrent;let d=e.ordered?R6(a):rp(a);const f=e.ordered?d==="."?")":".":T6(a);let h=r&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(h=!0),rj(a)===d&&y){let g=-1;for(;++g<e.children.length;){const v=e.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(d=f),a.bulletCurrent=d;const p=a.containerFlow(e,l);return a.bulletLastUsed=d,a.bulletCurrent=u,o(),p}function O6(e){const r=e.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function D6(e,r,a,l){const o=O6(a);let u=a.bulletCurrent||rp(a);r&&r.type==="list"&&r.ordered&&(u=(typeof r.start=="number"&&r.start>-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(r&&r.type==="list"&&r.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=a.createTracker(l);f.move(u+" ".repeat(d-u.length)),f.shift(d);const h=a.enter("listItem"),p=a.indentLines(a.containerFlow(e,f.current()),y);return h(),p;function y(g,v,b){return v?(b?"":" ".repeat(d))+g:(b?u:u+" ".repeat(d-u.length))+g}}function z6(e,r,a,l){const o=a.enter("paragraph"),u=a.enter("phrasing"),d=a.containerPhrasing(e,l);return u(),o(),d}const L6=mu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function P6(e,r,a,l){return(e.children.some(function(d){return L6(d)})?a.containerPhrasing:a.containerFlow).call(a,e,l)}function U6(e){const r=e.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}aj.peek=I6;function aj(e,r,a,l){const o=U6(a),u=a.enter("strong"),d=a.createTracker(l),f=d.move(o+o);let h=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const p=h.charCodeAt(0),y=Oc(l.before.charCodeAt(l.before.length-1),p,o);y.inside&&(h=vs(p)+h.slice(1));const g=h.charCodeAt(h.length-1),v=Oc(l.after.charCodeAt(0),g,o);v.inside&&(h=h.slice(0,-1)+vs(g));const b=d.move(o+o);return u(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+h+b}function I6(e,r,a){return a.options.strong||"*"}function B6(e,r,a,l){return a.safe(e.value,l)}function H6(e){const r=e.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function q6(e,r,a){const l=(rj(a)+(a.options.ruleSpaces?" ":"")).repeat(H6(a));return a.options.ruleSpaces?l.slice(0,-1):l}const lj={blockquote:d6,break:Yb,code:x6,definition:v6,emphasis:Xk,hardBreak:Yb,heading:k6,html:Qk,image:Zk,imageReference:Jk,inlineCode:Wk,link:tj,linkReference:nj,list:M6,listItem:D6,paragraph:z6,root:P6,strong:aj,text:B6,thematicBreak:q6};function F6(){return{enter:{table:G6,tableData:Vb,tableHeader:Vb,tableRow:Y6},exit:{codeText:V6,table:$6,tableData:gh,tableHeader:gh,tableRow:gh}}}function G6(e){const r=e._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function $6(e){this.exit(e),this.data.inTable=void 0}function Y6(e){this.enter({type:"tableRow",children:[]},e)}function gh(e){this.exit(e)}function Vb(e){this.enter({type:"tableCell",children:[]},e)}function V6(e){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,K6));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(e)}function K6(e,r){return r==="|"?r:e}function X6(e){const r=e||{},a=r.tableCellPadding,l=r.tablePipeAlign,o=r.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
81
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:h,tableRow:f}};function d(b,k,C,N){return p(y(b,C,N),b.align)}function f(b,k,C,N){const j=g(b,C,N),R=p([j]);return R.slice(0,R.indexOf(`
82
+ `))}function h(b,k,C,N){const j=C.enter("tableCell"),R=C.enter("phrasing"),M=C.containerPhrasing(b,{...N,before:u,after:u});return R(),j(),M}function p(b,k){return c6(b,{align:k,alignDelimiters:l,padding:a,stringLength:o})}function y(b,k,C){const N=b.children;let j=-1;const R=[],M=k.enter("table");for(;++j<N.length;)R[j]=g(N[j],k,C);return M(),R}function g(b,k,C){const N=b.children;let j=-1;const R=[],M=k.enter("tableRow");for(;++j<N.length;)R[j]=h(N[j],b,k,C);return M(),R}function v(b,k,C){let N=lj.inlineCode(b,k,C);return C.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function Q6(){return{exit:{taskListCheckValueChecked:Kb,taskListCheckValueUnchecked:Kb,paragraph:J6}}}function Z6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:W6}}}function Kb(e){const r=this.stack[this.stack.length-2];r.type,r.checked=e.type==="taskListCheckValueChecked"}function J6(e){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const l=a.children[0];if(l&&l.type==="text"){const o=r.children;let u=-1,d;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){d=f;break}}d===a&&(l.value=l.value.slice(1),l.value.length===0?a.children.shift():a.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,a.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function W6(e,r,a,l){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=a.createTracker(l);u&&f.move(d);let h=lj.listItem(e,r,a,{...l,...f.current()});return u&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),h;function p(y){return y+d}}function eP(){return[ML(),WL(),r6(),F6(),Q6()]}function tP(e){return{extensions:[OL(),e6(e),a6(),X6(e),Z6()]}}const nP={tokenize:oP,partial:!0},ij={tokenize:cP,partial:!0},sj={tokenize:uP,partial:!0},oj={tokenize:dP,partial:!0},rP={tokenize:fP,partial:!0},cj={name:"wwwAutolink",tokenize:iP,previous:dj},uj={name:"protocolAutolink",tokenize:sP,previous:fj},Lr={name:"emailAutolink",tokenize:lP,previous:hj},fr={};function aP(){return{text:fr}}let Ia=48;for(;Ia<123;)fr[Ia]=Lr,Ia++,Ia===58?Ia=65:Ia===91&&(Ia=97);fr[43]=Lr;fr[45]=Lr;fr[46]=Lr;fr[95]=Lr;fr[72]=[Lr,uj];fr[104]=[Lr,uj];fr[87]=[Lr,cj];fr[119]=[Lr,cj];function lP(e,r,a){const l=this;let o,u;return d;function d(g){return!Kh(g)||!hj.call(l,l.previous)||ap(l.events)?a(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Kh(g)?(e.consume(g),f):g===64?(e.consume(g),h):a(g)}function h(g){return g===46?e.check(rP,y,p)(g):g===45||g===95||Zt(g)?(u=!0,e.consume(g),h):y(g)}function p(g){return e.consume(g),o=!0,h}function y(g){return u&&o&&rn(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),r(g)):a(g)}}function iP(e,r,a){const l=this;return o;function o(d){return d!==87&&d!==119||!dj.call(l,l.previous)||ap(l.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nP,e.attempt(ij,e.attempt(sj,u),a),a)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),r(d)}}function sP(e,r,a){const l=this;let o="",u=!1;return d;function d(g){return(g===72||g===104)&&fj.call(l,l.previous)&&!ap(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),f):a(g)}function f(g){if(rn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(g),h}return a(g)}function h(g){return g===47?(e.consume(g),u?p:(u=!0,h)):a(g)}function p(g){return g===null||Tc(g)||ht(g)||Fa(g)||du(g)?a(g):e.attempt(ij,e.attempt(sj,y),a)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),r(g)}}function oP(e,r,a){let l=0;return o;function o(d){return(d===87||d===119)&&l<3?(l++,e.consume(d),o):d===46&&l===3?(e.consume(d),u):a(d)}function u(d){return d===null?a(d):r(d)}}function cP(e,r,a){let l,o,u;return d;function d(p){return p===46||p===95?e.check(oj,h,f)(p):p===null||ht(p)||Fa(p)||p!==45&&du(p)?h(p):(u=!0,e.consume(p),d)}function f(p){return p===95?l=!0:(o=l,l=void 0),e.consume(p),d}function h(p){return o||l||!u?a(p):r(p)}}function uP(e,r){let a=0,l=0;return o;function o(d){return d===40?(a++,e.consume(d),o):d===41&&l<a?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(oj,r,u)(d):d===null||ht(d)||Fa(d)?r(d):(e.consume(d),o)}function u(d){return d===41&&l++,e.consume(d),o}}function dP(e,r,a){return l;function l(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),l):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||ht(f)||Fa(f)?r(f):a(f)}function o(f){return f===null||f===40||f===91||ht(f)||Fa(f)?r(f):l(f)}function u(f){return rn(f)?d(f):a(f)}function d(f){return f===59?(e.consume(f),l):rn(f)?(e.consume(f),d):a(f)}}function fP(e,r,a){return l;function l(u){return e.consume(u),o}function o(u){return Zt(u)?a(u):r(u)}}function dj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function fj(e){return!rn(e)}function hj(e){return!(e===47||Kh(e))}function Kh(e){return e===43||e===45||e===46||e===95||Zt(e)}function ap(e){let r=e.length,a=!1;for(;r--;){const l=e[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){a=!0;break}if(l._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const hP={tokenize:SP,partial:!0};function mP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yP,continuation:{tokenize:vP},exit:bP}},text:{91:{name:"gfmFootnoteCall",tokenize:xP},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pP,resolveTo:gP}}}}function pP(e,r,a){const l=this;let o=l.events.length;const u=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let d;for(;o--;){const h=l.events[o][1];if(h.type==="labelImage"){d=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!d||!d._balanced)return a(h);const p=Kn(l.sliceSerialize({start:d.end,end:l.now()}));return p.codePointAt(0)!==94||!u.includes(p.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),r(h))}}function gP(e,r){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[a+1],e[a+2],["enter",l,r],e[a+3],e[a+4],["enter",o,r],["exit",o,r],["enter",u,r],["enter",d,r],["exit",d,r],["exit",u,r],e[e.length-2],e[e.length-1],["exit",l,r]];return e.splice(a,e.length-a+1,...f),e}function xP(e,r,a){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u=0,d;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),h}function h(g){return g!==94?a(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(g){if(u>999||g===93&&!d||g===null||g===91||ht(g))return a(g);if(g===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(Kn(l.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),r):a(g)}return ht(g)||(d=!0),u++,e.consume(g),g===92?y:p}function y(g){return g===91||g===92||g===93?(e.consume(g),u++,p):p(g)}}function yP(e,r,a){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u,d=0,f;return h;function h(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(k)}function y(k){if(d>999||k===93&&!f||k===null||k===91||ht(k))return a(k);if(k===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return u=Kn(l.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return ht(k)||(f=!0),d++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),d++,y):y(k)}function v(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),o.includes(u)||o.push(u),Je(e,b,"gfmFootnoteDefinitionWhitespace")):a(k)}function b(k){return r(k)}}function vP(e,r,a){return e.check(Ts,r,e.attempt(hP,r,a))}function bP(e){e.exit("gfmFootnoteDefinition")}function SP(e,r,a){const l=this;return Je(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=l.events[l.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?r(u):a(u)}}function wP(e){let a=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(d,f){let h=-1;for(;++h<d.length;)if(d[h][0]==="enter"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._close){let p=h;for(;p--;)if(d[p][0]==="exit"&&d[p][1].type==="strikethroughSequenceTemporary"&&d[p][1]._open&&d[h][1].end.offset-d[h][1].start.offset===d[p][1].end.offset-d[p][1].start.offset){d[h][1].type="strikethroughSequence",d[p][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[p][1].start),end:Object.assign({},d[h][1].end)},g={type:"strikethroughText",start:Object.assign({},d[p][1].end),end:Object.assign({},d[h][1].start)},v=[["enter",y,f],["enter",d[p][1],f],["exit",d[p][1],f],["enter",g,f]],b=f.parser.constructs.insideSpan.null;b&&An(v,v.length,0,fu(b,d.slice(p+1,h),f)),An(v,v.length,0,[["exit",g,f],["enter",d[h][1],f],["exit",d[h][1],f],["exit",y,f]]),An(d,p-1,h-p+3,v),h=p+v.length-2;break}}for(h=-1;++h<d.length;)d[h][1].type==="strikethroughSequenceTemporary"&&(d[h][1].type="data");return d}function u(d,f,h){const p=this.previous,y=this.events;let g=0;return v;function v(k){return p===126&&y[y.length-1][1].type!=="characterEscape"?h(k):(d.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const C=ti(p);if(k===126)return g>1?h(k):(d.consume(k),g++,b);if(g<2&&!a)return h(k);const N=d.exit("strikethroughSequenceTemporary"),j=ti(k);return N._open=!j||j===2&&!!C,N._close=!C||C===2&&!!j,f(k)}}}class kP{constructor(){this.map=[]}add(r,a,l){jP(this,r,a,l)}consume(r){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const l=[];for(;a>0;)a-=1,l.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];l.push(r.slice()),r.length=0;let o=l.pop();for(;o;){for(const u of o)r.push(u);o=l.pop()}this.map.length=0}}function jP(e,r,a,l){let o=0;if(!(a===0&&l.length===0)){for(;o<e.map.length;){if(e.map[o][0]===r){e.map[o][1]+=a,e.map[o][2].push(...l);return}o+=1}e.map.push([r,a,l])}}function CP(e,r){let a=!1;const l=[];for(;r<e.length;){const o=e[r];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(e[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[r-1][1].type==="tableDelimiterMarker"){const u=l.length-1;l[u]=l[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);r+=1}return l}function NP(){return{flow:{null:{name:"table",tokenize:EP,resolveAll:AP}}}}function EP(e,r,a){const l=this;let o=0,u=0,d;return f;function f(P){let ee=l.events.length-1;for(;ee>-1;){const ae=l.events[ee][1].type;if(ae==="lineEnding"||ae==="linePrefix")ee--;else break}const te=ee>-1?l.events[ee][1].type:null,ce=te==="tableHead"||te==="tableRow"?D:h;return ce===D&&l.parser.lazy[l.now().line]?a(P):ce(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),p(P)}function p(P){return P===124||(d=!0,u+=1),y(P)}function y(P){return P===null?a(P):Re(P)?u>1?(u=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b):a(P):Ve(P)?Je(e,y,"whitespace")(P):(u+=1,d&&(d=!1,o+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),g(P)))}function g(P){return P===null||P===124||ht(P)?(e.exit("data"),y(P)):(e.consume(P),P===92?v:g)}function v(P){return P===92||P===124?(e.consume(P),g):g(P)}function b(P){return l.interrupt=!1,l.parser.lazy[l.now().line]?a(P):(e.enter("tableDelimiterRow"),d=!1,Ve(P)?Je(e,k,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):k(P))}function k(P){return P===45||P===58?N(P):P===124?(d=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),C):L(P)}function C(P){return Ve(P)?Je(e,N,"whitespace")(P):N(P)}function N(P){return P===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),j):P===45?(u+=1,j(P)):P===null||Re(P)?O(P):L(P)}function j(P){return P===45?(e.enter("tableDelimiterFiller"),R(P)):L(P)}function R(P){return P===45?(e.consume(P),R):P===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(P))}function M(P){return Ve(P)?Je(e,O,"whitespace")(P):O(P)}function O(P){return P===124?k(P):P===null||Re(P)?!d||o!==u?L(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),r(P)):L(P)}function L(P){return a(P)}function D(P){return e.enter("tableRow"),I(P)}function I(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),I):P===null||Re(P)?(e.exit("tableRow"),r(P)):Ve(P)?Je(e,I,"whitespace")(P):(e.enter("data"),B(P))}function B(P){return P===null||P===124||ht(P)?(e.exit("data"),I(P)):(e.consume(P),P===92?V:B)}function V(P){return P===92||P===124?(e.consume(P),B):B(P)}}function AP(e,r){let a=-1,l=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],f=!1,h=0,p,y,g;const v=new kP;for(;++a<e.length;){const b=e[a],k=b[1];b[0]==="enter"?k.type==="tableHead"?(f=!1,h!==0&&(Xb(v,r,h,p,y),y=void 0,h=0),p={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(a,0,[["enter",p,r]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(l=!0,g=void 0,u=[0,0,0,0],d=[0,a+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(a,0,[["enter",y,r]])),o=k.type==="tableDelimiterRow"?2:y?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(l=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],g=oc(v,r,u,o,void 0,g),u=[0,0,0,0]),d[2]=a)):k.type==="tableCellDivider"&&(l?l=!1:(u[1]!==0&&(d[0]=d[1],g=oc(v,r,u,o,void 0,g)),u=d,d=[u[1],a,0,0])):k.type==="tableHead"?(f=!0,h=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(h=a,u[1]!==0?(d[0]=d[1],g=oc(v,r,u,o,a,g)):d[1]!==0&&(g=oc(v,r,d,o,a,g)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=a)}for(h!==0&&Xb(v,r,h,p,y),v.consume(r.events),a=-1;++a<r.events.length;){const b=r.events[a];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=CP(r.events,a))}return e}function oc(e,r,a,l,o,u){const d=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(u.end=Object.assign({},Ul(r.events,a[0])),e.add(a[0],0,[["exit",u,r]]));const h=Ul(r.events,a[1]);if(u={type:d,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",u,r]]),a[2]!==0){const p=Ul(r.events,a[2]),y=Ul(r.events,a[3]),g={type:f,start:Object.assign({},p),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",g,r]]),l!==2){const v=r.events[a[2]],b=r.events[a[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[1].contentType="text",a[3]>a[2]+1){const k=a[2]+1,C=a[3]-a[2]-1;e.add(k,C,[])}}e.add(a[3]+1,0,[["exit",g,r]])}return o!==void 0&&(u.end=Object.assign({},Ul(r.events,o)),e.add(o,0,[["exit",u,r]]),u=void 0),u}function Xb(e,r,a,l,o){const u=[],d=Ul(r.events,a);o&&(o.end=Object.assign({},d),u.push(["exit",o,r])),l.end=Object.assign({},d),u.push(["exit",l,r]),e.add(a+1,0,u)}function Ul(e,r){const a=e[r],l=a[0]==="enter"?"start":"end";return a[1][l]}const _P={name:"tasklistCheck",tokenize:RP};function TP(){return{text:{91:_P}}}function RP(e,r,a){const l=this;return o;function o(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),u)}function u(h){return ht(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),d):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),d):a(h)}function d(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(h)}function f(h){return Re(h)?r(h):Ve(h)?e.check({tokenize:MP},r,a)(h):a(h)}}function MP(e,r,a){return Je(e,l,"whitespace");function l(o){return o===null?a(o):r(o)}}function OP(e){return jk([aP(),mP(),wP(e),NP(),TP()])}const DP={};function Qb(e){const r=this,a=e||DP,l=r.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),u=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),d=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(OP(a)),u.push(eP()),d.push(tP(a))}function zP(e){return e.filter(r=>r.connections.length>0).map(r=>r.id)}function LP({ideas:e,connectedIds:r,onSelectIdea:a,onMissingIntegrations:l}){const o=u=>{const d=h=>h.toLowerCase();u.required_integrations.every(h=>r.some(p=>d(p)===d(h)))?a(u):l(u)};return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"text-muted-foreground flex items-center gap-1.5 text-xs font-medium",children:[s.jsx(lw,{className:"size-3.5","aria-hidden":!0}),"Try an idea"]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.slice(0,8).map(u=>s.jsxs("button",{type:"button",onClick:()=>o(u),className:"border-input hover:bg-muted/50 flex min-w-0 flex-col items-start gap-0.5 rounded-lg border px-3 py-2 text-left text-sm transition-colors",children:[s.jsx("span",{className:"truncate font-medium w-full",children:u.title}),s.jsx("span",{className:"text-muted-foreground line-clamp-1 text-xs font-normal w-full min-w-0",children:u.description})]},u.id))})]})}const wt="https://cdn.simpleicons.org",mj=[{id:"github",name:"GitHub",description:"Repos, issues, and code",category:"featured",icon:QM,logoUrl:`${wt}/github`},{id:"gmail",name:"Gmail",description:"Send and read email",category:"featured",icon:eb,logoUrl:`${wt}/gmail`},{id:"notion",name:"Notion",description:"Pages, databases, and docs",category:"featured",icon:tw,logoUrl:`${wt}/notion`},{id:"slack",name:"Slack",description:"Channels and messages",category:"featured",icon:ss,logoUrl:`${wt}/slack`},{id:"calendar",name:"Google Calendar",description:"Events and scheduling",category:"featured",icon:gM,logoUrl:`${wt}/googlecalendar`},{id:"drive",name:"Google Drive",description:"Files and folders",category:"featured",icon:aw,logoUrl:`${wt}/googledrive`},{id:"docs",name:"Google Docs",description:"Create and edit documents",category:"featured",icon:Em,logoUrl:`${wt}/googledocs`},{id:"sheets",name:"Google Sheets",description:"Spreadsheets and data",category:"featured",icon:HO,logoUrl:`${wt}/googlesheets`},{id:"asana",name:"Asana",description:"Tasks and projects",category:"featured",icon:$O,logoUrl:`${wt}/asana`},{id:"contacts",name:"Google Contacts",description:"Contacts and people",category:"featured",icon:QO,logoUrl:`${wt}/google`},{id:"facebook",name:"Facebook",description:"Pages and posts",category:"featured",icon:qM,logoUrl:`${wt}/facebook`},{id:"bluesky",name:"Bluesky",description:"Posts and timeline (atproto)",category:"featured",icon:ss,logoUrl:`${wt}/bluesky`},{id:"airtable",name:"Airtable",description:"Bases, tables, and records",category:"featured",icon:lO,logoUrl:`${wt}/airtable`},{id:"linear",name:"Linear",description:"Issues and workflows",category:"featured",icon:oM,logoUrl:`${wt}/linear`},{id:"zoom",name:"Zoom",description:"Meetings and video",category:"featured",icon:JO,logoUrl:`${wt}/zoom`},{id:"dropbox",name:"Dropbox",description:"Files and folders",category:"featured",icon:CM,logoUrl:`${wt}/dropbox`},{id:"jira",name:"Jira",description:"Issues and projects",category:"featured",icon:Wv,logoUrl:`${wt}/jirasoftware`},{id:"slides",name:"Google Slides",description:"Presentations and slides",category:"featured",icon:RO,logoUrl:`${wt}/googleslides`},{id:"figma",name:"Figma",description:"Design files and prototypes",category:"featured",icon:SO,logoUrl:`${wt}/figma`},{id:"trello",name:"Trello",description:"Boards, lists, and cards",category:"productivity",icon:Wv,logoUrl:`${wt}/trello`},{id:"twitter",name:"Twitter / X",description:"Post and read tweets",category:"featured",icon:ss,logoUrl:`${wt}/x`},{id:"microsoft",name:"Microsoft 365",description:"Outlook, Calendar, OneDrive",category:"featured",icon:eb,logoUrl:`${wt}/microsoft`},{id:"zendesk",name:"Zendesk",description:"Tickets and support",category:"productivity",icon:ss,logoUrl:`${wt}/zendesk`},{id:"youtube",name:"YouTube",description:"Channels, videos, and uploads",category:"featured",icon:t4,logoUrl:`${wt}/youtube`}],PP=new Map(mj.map(e=>[e.id,e]));function UP(e){return PP.get(e.toLowerCase())??null}function cc(){return mj}function IP({open:e,onOpenChange:r,requiredIntegrations:a,connectedIds:l,ideaTitle:o,onConnect:u}){const d=h=>h.toLowerCase(),f=a.filter(h=>l.some(p=>d(p)===d(h)));return s.jsx(Xl,{open:e,onOpenChange:r,children:s.jsxs(Ql,{className:"max-w-md",showCloseButton:!0,children:[s.jsxs(Zl,{children:[s.jsx(Wl,{children:o?`Missing integrations: ${o}`:"Missing integrations"}),s.jsx(ei,{children:"Connect the required apps below, then try again. Do not execute the workflow until all required integrations are connected."})]}),s.jsx("ul",{className:"space-y-2 text-sm",children:a.map(h=>{const y=UP(h)?.name??h,g=f.includes(h);return s.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border bg-muted/30 px-3 py-2",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[g?s.jsx("span",{className:"text-green-600 dark:text-green-400","aria-hidden":!0,children:"✓"}):s.jsx("span",{className:"text-muted-foreground","aria-hidden":!0,children:"✗"}),y]}),!g&&s.jsx(ue,{size:"sm",variant:"outline",onClick:()=>u(h),children:"Connect"})]},h)})}),s.jsx(Jl,{className:"gap-2 pt-2",children:s.jsx(ue,{variant:"outline",onClick:()=>r(!1),children:"Close"})})]})})}const Zb=[{id:"summarize_inbox",title:"Summarize my inbox",description:"Get a brief summary of unread emails",base_prompt:"Summarize my unread emails and list the most important ones with senders and subjects.",required_integrations:["gmail"],optional_integrations:[]},{id:"create_linear_issue",title:"Create a Linear issue",description:"Turn a short description into a Linear issue",base_prompt:"Create a Linear issue from this: [describe the issue]. Use the default team and set a sensible title and description.",required_integrations:["linear"],optional_integrations:["slack"]},{id:"schedule_zoom",title:"Schedule a Zoom meeting",description:"Create a Zoom meeting and optionally invite via Slack",base_prompt:"Schedule a Zoom meeting for [time/topic]. Create the meeting and share the link.",required_integrations:["zoom"],optional_integrations:["slack","calendar"]},{id:"stripe_overview",title:"Stripe overview",description:"See recent customers and revenue",base_prompt:"Give me a short overview of my Stripe account: recent customers, revenue this month, and any failed payments.",required_integrations:["stripe"],optional_integrations:[]},{id:"send_email",title:"Send an email",description:"Draft and send an email to a recipient",base_prompt:"Send an email to [recipient] with subject [subject] and body [your message].",required_integrations:["gmail"],optional_integrations:[]},{id:"list_calendar_events",title:"List my calendar events",description:"See upcoming events for today or this week",base_prompt:"List my calendar events for today and the next 7 days.",required_integrations:["calendar"],optional_integrations:[]},{id:"create_calendar_event",title:"Create a calendar event",description:"Add a new event to your calendar",base_prompt:"Create a calendar event: [title] on [date/time] with [optional details].",required_integrations:["calendar"],optional_integrations:[]},{id:"list_slack_channels",title:"List Slack channels",description:"See all channels you're in",base_prompt:"List all Slack channels I'm a member of.",required_integrations:["slack"],optional_integrations:[]},{id:"post_to_slack",title:"Post to Slack",description:"Send a message to a Slack channel",base_prompt:"Post this message to Slack channel [channel name]: [your message].",required_integrations:["slack"],optional_integrations:[]},{id:"list_github_issues",title:"List GitHub issues",description:"See open issues for a repo",base_prompt:"List open issues in my GitHub repository [repo name].",required_integrations:["github"],optional_integrations:[]},{id:"create_github_issue",title:"Create a GitHub issue",description:"Open a new issue in a repo",base_prompt:"Create a GitHub issue in [repo]: title [title], body [description].",required_integrations:["github"],optional_integrations:[]},{id:"search_notion",title:"Search Notion",description:"Find pages and databases in Notion",base_prompt:"Search Notion for pages and databases matching [query].",required_integrations:["notion"],optional_integrations:[]},{id:"list_drive_files",title:"List Google Drive files",description:"See files in a Drive folder",base_prompt:"List files in my Google Drive root (or folder [name]).",required_integrations:["drive"],optional_integrations:[]},{id:"read_google_sheet",title:"Read a Google Sheet",description:"Get data from a spreadsheet",base_prompt:"Read and summarize the data from my Google Sheet [name or URL].",required_integrations:["sheets"],optional_integrations:[]},{id:"find_unread_important",title:"Find important unread emails",description:"Prioritize emails from key senders",base_prompt:"Find my most important unread emails (e.g. from work, invoices, or key contacts) and list them with senders and subjects.",required_integrations:["gmail"],optional_integrations:[]},{id:"archive_old_emails",title:"Archive old read emails",description:"Clean up inbox by archiving",base_prompt:"Archive read emails older than 30 days from my inbox.",required_integrations:["gmail"],optional_integrations:[]},{id:"linear_board_status",title:"Linear board status",description:"See issues by status",base_prompt:"Show me the status of Linear issues: what's in progress, blocked, and done this week.",required_integrations:["linear"],optional_integrations:[]},{id:"jira_sprint_report",title:"Jira sprint report",description:"Summarize current sprint",base_prompt:"Give me a brief report on the current Jira sprint: completed, in progress, and blocked issues.",required_integrations:["jira"],optional_integrations:[]},{id:"trello_board_summary",title:"Trello board summary",description:"Overview of a Trello board",base_prompt:"Summarize my Trello board [board name]: lists and key cards.",required_integrations:["trello"],optional_integrations:[]},{id:"asana_tasks_today",title:"Asana tasks for today",description:"List today's tasks",base_prompt:"List my Asana tasks due today.",required_integrations:["asana"],optional_integrations:[]},{id:"stripe_failed_payments",title:"Stripe failed payments",description:"See failed charges",base_prompt:"List failed payments in Stripe from the last 7 days and suggest follow-up actions.",required_integrations:["stripe"],optional_integrations:[]},{id:"zendesk_open_tickets",title:"Zendesk open tickets",description:"See unsolved support tickets",base_prompt:"List open Zendesk support tickets, sorted by priority.",required_integrations:["zendesk"],optional_integrations:[]},{id:"airtable_list_records",title:"Airtable records",description:"List records from a base",base_prompt:"List records from my Airtable base [base name], table [table name].",required_integrations:["airtable"],optional_integrations:[]},{id:"youtube_search",title:"Search YouTube",description:"Find videos by topic",base_prompt:"Search YouTube for videos about [topic] and list the top 5 results.",required_integrations:["youtube"],optional_integrations:[]},{id:"figma_list_files",title:"List Figma files",description:"See design files",base_prompt:"List my Figma files and projects.",required_integrations:["figma"],optional_integrations:[]},{id:"dropbox_list_folders",title:"List Dropbox folders",description:"See folders in Dropbox",base_prompt:"List folders in my Dropbox root.",required_integrations:["dropbox"],optional_integrations:[]},{id:"post_bluesky",title:"Post to Bluesky",description:"Share a post on Bluesky",base_prompt:"Post to Bluesky: [your message].",required_integrations:["bluesky"],optional_integrations:[]},{id:"post_twitter",title:"Post a tweet",description:"Share on X (Twitter)",base_prompt:"Post a tweet: [your message].",required_integrations:["twitter"],optional_integrations:[]},{id:"outlook_unread",title:"Outlook unread emails",description:"List unread in Outlook",base_prompt:"List my unread Outlook emails with senders and subjects.",required_integrations:["microsoft"],optional_integrations:[]},{id:"create_notion_page",title:"Create Notion page",description:"Add a new page",base_prompt:"Create a new Notion page titled [title] with content [description].",required_integrations:["notion"],optional_integrations:[]},{id:"google_docs_summary",title:"Summarize a Google Doc",description:"Get a summary of a document",base_prompt:"Summarize the Google Doc [name or URL].",required_integrations:["docs"],optional_integrations:[]},{id:"github_pr_list",title:"List GitHub PRs",description:"See open pull requests",base_prompt:"List open pull requests in [repo].",required_integrations:["github"],optional_integrations:[]},{id:"slack_unread",title:"Slack unread messages",description:"Catch up on unread",base_prompt:"Summarize my unread Slack messages across channels.",required_integrations:["slack"],optional_integrations:[]},{id:"zoom_upcoming",title:"Upcoming Zoom meetings",description:"See scheduled meetings",base_prompt:"List my upcoming Zoom meetings for the next 7 days.",required_integrations:["zoom"],optional_integrations:[]},{id:"calendar_busy_times",title:"Find free slots",description:"When am I free?",base_prompt:"Find my free time slots tomorrow (or [date]) for a [duration]-minute meeting.",required_integrations:["calendar"],optional_integrations:[]},{id:"gmail_search",title:"Search Gmail",description:"Find emails by criteria",base_prompt:"Search my Gmail for [query, e.g. from:sender, has:attachment, is:unread] and list the results.",required_integrations:["gmail"],optional_integrations:[]},{id:"reply_to_email",title:"Reply to an email",description:"Draft a reply",base_prompt:"Reply to the email [subject or ID] with: [your reply].",required_integrations:["gmail"],optional_integrations:[]},{id:"add_google_contact",title:"Add Google Contact",description:"Create a new contact",base_prompt:"Add a new Google Contact: name [name], email [email], phone [optional].",required_integrations:["contacts"],optional_integrations:[]},{id:"drive_upload",title:"Upload to Drive",description:"Upload a file to Google Drive",base_prompt:"Upload the file [path or URL] to my Google Drive folder [folder name].",required_integrations:["drive"],optional_integrations:[]},{id:"sheets_append_row",title:"Add row to Sheet",description:"Append data to a spreadsheet",base_prompt:"Append a row to my Google Sheet [name] with: [column values].",required_integrations:["sheets"],optional_integrations:[]},{id:"linear_my_issues",title:"My Linear issues",description:"Issues assigned to me",base_prompt:"List Linear issues assigned to me, grouped by status.",required_integrations:["linear"],optional_integrations:[]},{id:"stripe_customers",title:"Stripe customers list",description:"Recent customers",base_prompt:"List my most recent Stripe customers with email and subscription status.",required_integrations:["stripe"],optional_integrations:[]},{id:"slack_create_channel",title:"Create Slack channel",description:"Start a new channel",base_prompt:"Create a new Slack channel named [name] with topic [topic].",required_integrations:["slack"],optional_integrations:[]},{id:"notion_database_query",title:"Query Notion database",description:"Filter and sort database",base_prompt:"Query my Notion database [name] with filter [criteria] and return the top 10 results.",required_integrations:["notion"],optional_integrations:[]},{id:"meeting_notes",title:"Draft meeting notes",description:"Create notes from a meeting",base_prompt:"Create a Google Doc with meeting notes for [topic/meeting name] including: attendees, agenda, decisions, and action items.",required_integrations:["docs"],optional_integrations:["calendar","slack"]},{id:"weekly_summary",title:"Weekly summary",description:"Inbox, calendar, and tasks",base_prompt:"Give me a weekly summary: unread email count, calendar events this week, and any overdue tasks (from Linear, Jira, or Asana).",required_integrations:[],optional_integrations:["gmail","calendar","linear","jira","asana"]},{id:"invoice_reminder",title:"Invoice follow-up",description:"Stripe invoices to chase",base_prompt:"List Stripe invoices that are past due or unpaid, and draft a short follow-up email for each.",required_integrations:["stripe"],optional_integrations:["gmail"]},{id:"social_post",title:"Post to social media",description:"Share on Bluesky or X",base_prompt:"Post this to [Bluesky / X / both]: [your message].",required_integrations:[],optional_integrations:["bluesky","twitter"]},{id:"feedback_to_linear",title:"Turn feedback into Linear issue",description:"Create issue from user feedback",base_prompt:"Create a Linear issue from this user feedback: [paste feedback]. Set appropriate labels and priority.",required_integrations:["linear"],optional_integrations:["slack","gmail"]},{id:"slides_outline",title:"Draft presentation outline",description:"Create slides structure",base_prompt:"Create a Google Slides presentation with outline for [topic]: title slide, main points, and summary.",required_integrations:["slides"],optional_integrations:[]},{id:"todo_from_email",title:"Todo from email",description:"Extract action items",base_prompt:"Read my most recent unread emails and create a todo list of action items with due dates.",required_integrations:["gmail"],optional_integrations:["notion","linear"]},{id:"facebook_page_post",title:"Post to Facebook page",description:"Share on your page",base_prompt:"Post to my Facebook page: [your message].",required_integrations:["facebook"],optional_integrations:[]},{id:"zendesk_reply",title:"Draft Zendesk reply",description:"Reply to a ticket",base_prompt:"Draft a reply to Zendesk ticket [id] addressing the customer's issue.",required_integrations:["zendesk"],optional_integrations:[]}];function BP(e){const r=e??"";return/would you like me to create (a )?job for you/i.test(r)}const Jb={p:({children:e})=>s.jsx("p",{className:"mb-2 last:mb-0",children:e}),h1:({children:e})=>s.jsx("h1",{className:"mb-2 mt-3 text-lg font-bold first:mt-0",children:e}),h2:({children:e})=>s.jsx("h2",{className:"mb-2 mt-3 text-base font-bold first:mt-0",children:e}),h3:({children:e})=>s.jsx("h3",{className:"mb-1 mt-2 text-sm font-bold first:mt-0",children:e}),ul:({children:e})=>s.jsx("ul",{className:"mb-2 list-inside list-disc space-y-0.5",children:e}),ol:({children:e})=>s.jsx("ol",{className:"mb-2 list-inside list-decimal space-y-0.5",children:e}),code:({className:e,children:r,...a})=>e?.includes("language-")?s.jsx("pre",{className:"mb-2 overflow-x-auto rounded bg-muted p-2 text-xs",children:s.jsx("code",{className:e,...a,children:r})}):s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-xs",...a,children:r}),a:({href:e,children:r})=>s.jsx("a",{href:e,className:"text-primary underline hover:no-underline",target:"_blank",rel:"noopener noreferrer",children:r}),blockquote:({children:e})=>s.jsx("blockquote",{className:"my-2 border-l-2 border-muted-foreground/30 pl-3 italic",children:e}),img:({src:e,alt:r})=>e?s.jsx("img",{src:e,alt:r??"attachment",className:"my-1 max-h-48 max-w-full rounded object-contain"}):null};function HP(e){return e?e.replace(/\[Attached media \(use these URLs when posting images[^\]]*\):\s*([^\]]+)\]/,(r,a)=>a.split(",").map(l=>l.trim()).filter(Boolean).map(l=>`![attached](${l})`).join(`
83
+ `)):""}function qP({message:e,isLast:r,isStreaming:a}){const l=e,o=l.created_at?sk(l.created_at):null,u=l.usage,d=u&&((u.prompt_tokens??0)>0||(u.completion_tokens??0)>0);if(l.role==="user"){const f=HP(l.content);return s.jsxs("div",{className:"flex items-start gap-2 justify-end",children:[s.jsxs("div",{className:"border-border bg-muted/30 flex max-w-[min(85%,42rem)] flex-col gap-0.5 rounded-lg rounded-tr-sm px-3 py-2 text-sm",children:[s.jsx("div",{className:"chat-markdown text-foreground break-words [&>*:last-child]:mb-0",children:s.jsx(qb,{remarkPlugins:[Qb],components:Jb,children:f})}),o&&s.jsx("div",{className:"text-muted-foreground text-right text-xs",children:o})]}),s.jsx(uD,{className:"size-8 shrink-0",children:s.jsx(dD,{className:"rounded-full",children:s.jsx(KO,{className:"size-4"})})})]})}if(l.role==="assistant")return s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"size-8 shrink-0 flex items-center justify-center overflow-hidden rounded-full bg-muted",children:[s.jsx("img",{src:"/icon.svg",alt:"",className:"size-5 dark:hidden","aria-hidden":!0}),s.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-5 hidden dark:block","aria-hidden":!0})]}),s.jsxs("div",{className:"border-border bg-muted/30 flex max-w-[min(85%,42rem)] flex-1 flex-col gap-0.5 rounded-lg rounded-tl-sm px-3 py-2 text-sm",children:[(l.thinking??"")&&s.jsxs("details",{className:"text-muted-foreground border-border mb-2 rounded border border-dashed py-1.5 pl-2 pr-2 text-xs",open:a,children:[s.jsxs("summary",{className:"cursor-pointer font-medium flex items-center gap-2",children:["Thinking",a&&s.jsx(Ph,{className:"ml-1"})]}),s.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap break-words font-sans",children:l.thinking})]}),l.content??""?s.jsxs("div",{className:"flex items-end gap-x-1",children:[s.jsx("div",{className:"chat-markdown text-foreground min-w-0 flex-1 [&>*:last-child]:mb-0",children:s.jsx(qb,{remarkPlugins:[Qb],components:Jb,children:String(l.content)})}),a&&s.jsx(fD,{className:"shrink-0"})]}):a&&r?s.jsx(Ph,{}):null,l.tool_calls?.length?s.jsxs("details",{className:"text-muted-foreground mt-1 text-xs group/details",children:[s.jsxs("summary",{className:"cursor-pointer list-none flex items-center gap-1 opacity-80 hover:opacity-100 [&::-webkit-details-marker]:hidden",children:[s.jsx(zr,{className:"size-3.5 shrink-0 transition-transform group-open/details:rotate-90"}),s.jsx("span",{children:"Show details"}),s.jsxs("span",{className:"opacity-75",children:["(",l.tool_calls.length," tool call",l.tool_calls.length!==1?"s":"",")"]})]}),s.jsx("div",{className:"mt-1.5 border-l border-border/50 pl-4",children:s.jsxs("div",{className:"opacity-80",children:["Tool calls:"," ",l.tool_calls.map(f=>`${f.name}(${f.arguments?.slice(0,40)??""}${(f.arguments?.length??0)>40?"…":""})`).join(", ")]})})]}):null,o||d||l.cost_usd!=null&&l.cost_usd>0?s.jsxs("div",{className:"text-muted-foreground mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs opacity-80",children:[o&&s.jsx("span",{children:o}),d&&s.jsxs("span",{children:[u.prompt_tokens??0," in / ",u.completion_tokens??0," out",u.total_tokens!=null&&` (${u.total_tokens} total)`]}),l.cost_usd!=null&&l.cost_usd>0&&s.jsxs("span",{title:"Estimated cost for this response",children:["$",l.cost_usd.toFixed(6)]})]}):null]})]});if(l.role==="tool"||l.name){const f=l.name??"tool",h=String(l.content??"");return s.jsxs("details",{className:"text-muted-foreground group/tool flex gap-2 pl-10 text-xs",children:[s.jsxs("summary",{className:"cursor-pointer list-none flex flex-1 items-start gap-2 [&::-webkit-details-marker]:hidden",children:[s.jsx(zr,{className:"size-3.5 shrink-0 mt-0.5 transition-transform group-open/tool:rotate-90"}),s.jsxs("div",{className:"flex-1 min-w-0 rounded bg-muted/20 px-2 py-1",children:[s.jsxs("span",{className:"font-medium",children:["Tool result (",f,")"]}),o&&s.jsxs("span",{className:"ml-1 opacity-75",children:["· ",o]})]})]}),s.jsx("div",{className:"pl-10 pr-2 pb-1",children:s.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-words rounded bg-muted/20 p-2 text-xs font-sans",children:h||"(empty)"})})]})}return null}function FP(e){const{configuredProviders:r=[],chatMessages:a,chatInput:l,setChatInput:o,chatProvider:u,setChatProvider:d,chatModel:f,setChatModel:h,chatModelsLoading:p,chatSessions:y,chatSessionsLoading:g,chatLoading:v,chatAgentSessionId:b,models:k,ollamaRunning:C,ollamaStatusLoading:N,ollamaPullState:j,checkOllama:R,handleSelectSession:M,handleChatSend:O,sendMessage:L,handleNewChat:D,pendingActionId:I,pendingActionDetails:B,pendingActionLoading:V,handleApprovePending:P,handleRejectPending:ee,setLastAppliedIdea:te,chatAttachments:ce=[],setChatAttachments:ae,integrations:q=[],onNavigateToIntegrations:z,missingIntegrationsFromServer:F=null,onClearMissingIntegrationsFromServer:J}=e,[Y,A]=S.useState(!1),[_,G]=S.useState([]),[T,oe]=S.useState(""),[me,fe]=S.useState(!1),[ge,ze]=S.useState([]);S.useEffect(()=>{Rm().then(({servers:he})=>ze(he?.map(Qe=>Qe.name.toLowerCase())??[])).catch(()=>ze([]))},[]);const Ee=zP(q),pe=Array.from(new Set([...Ee.map(he=>he.toLowerCase()),...ge])),Oe=a.length===0&&l.length===0,De=he=>{o(he.base_prompt),te?.(he)},Ue=he=>{G(he.required_integrations),oe(he.title),A(!0)},Ge=he=>{A(!1),z?.()},Pt=he=>{M(he),fe(!1)},Ut=b&&y.length>0?y.find(he=>he.id===b)?.session_key??"Current chat":"Chat history",Jn=he=>{De(he)},Fn=u==="ollama"&&C===!1&&!N,Ne=u==="ollama"&&j?.inProgress,Le=u==="ollama";return s.jsxs(it,{className:"flex flex-1 flex-col",children:[s.jsxs(xt,{className:"flex flex-row items-center justify-between space-y-0",children:[s.jsxs("div",{children:[s.jsx(yt,{className:"text-base",children:"AI Chat"}),s.jsx(vt,{children:"Agent with sessions and tools (e.g. run_task). OpenAI supports tool calls."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Pm,{children:[s.jsx(Um,{asChild:!0,children:s.jsxs(ue,{variant:"outline",size:"sm",className:"gap-1.5",children:[s.jsx(lw,{className:"size-3.5"}),"Try an idea"]})}),s.jsx(Im,{align:"end",className:"min-w-[220px] max-w-[min(300px,calc(100vw-2rem))] max-h-[70vh] overflow-y-auto overflow-x-hidden",children:Zb.map(he=>s.jsxs(ha,{onClick:()=>Jn(he),className:"flex min-w-0 flex-col items-start gap-0.5 py-2",children:[s.jsx("span",{className:"truncate font-medium w-full",children:he.title}),s.jsx("span",{className:"text-muted-foreground line-clamp-2 text-xs font-normal w-full min-w-0",children:he.description})]},he.id))})]}),s.jsx(ue,{variant:"outline",size:"sm",onClick:D,children:"New chat"})]})]}),s.jsxs(st,{className:"flex flex-1 flex-col gap-4",children:[Fn&&s.jsxs("div",{className:"bg-muted border-border flex flex-wrap items-center justify-between gap-2 rounded-lg border p-3 text-sm",children:[s.jsx("span",{children:"Ollama is not running. Set it up to use the default AI."}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ue,{variant:"outline",size:"sm",asChild:!0,children:s.jsx("a",{href:"/onboard",target:"_blank",rel:"noopener noreferrer",children:"Set up Ollama"})}),s.jsx(ue,{variant:"secondary",size:"sm",onClick:R,disabled:N,children:"Check again"})]})]}),Ne&&j&&s.jsxs("div",{className:"bg-primary/10 border-primary/20 flex flex-col gap-2 rounded-lg border p-3 text-sm",children:[s.jsxs("div",{className:"font-medium",children:["Pulling model ",j.model,"…"]}),j.percent>=0&&j.percent<=100&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"bg-muted h-2 flex-1 overflow-hidden rounded-full",children:s.jsx("div",{className:"bg-primary h-full transition-[width] duration-300",style:{width:`${j.percent}%`}})}),s.jsxs("span",{className:"text-muted-foreground shrink-0 text-xs",children:[j.percent,"%"]})]}),j.lastLine&&s.jsx("div",{className:"text-muted-foreground truncate font-mono text-xs",title:j.lastLine,children:j.lastLine})]}),Le&&s.jsxs("div",{className:"bg-amber-500/10 border-amber-500/50 flex items-center gap-2 rounded-lg border p-3 text-sm",children:[s.jsx(nb,{className:"size-4 shrink-0 text-amber-600 dark:text-amber-400","aria-hidden":!0}),s.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:"Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support, switch to a cloud provider."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(au,{open:me,onOpenChange:fe,children:[s.jsxs(ue,{variant:"outline",size:"sm",className:"gap-1.5 min-w-[140px] justify-between",onClick:()=>fe(!0),disabled:g,children:[s.jsx(WM,{className:"size-3.5 shrink-0"}),s.jsx("span",{className:"truncate",children:Ut})]}),s.jsxs(lu,{side:"right",className:"flex flex-col w-full sm:max-w-md",children:[s.jsxs(iu,{children:[s.jsx(su,{children:"Chat history"}),s.jsx(ou,{children:"Switch to a previous chat or start a new one."})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[s.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start mb-2",onClick:()=>Pt(""),children:"New chat"}),y.length===0&&!g&&s.jsx("p",{className:"text-muted-foreground text-sm py-2",children:"No chats yet."}),g&&s.jsxs("p",{className:"text-muted-foreground text-sm py-2 flex items-center gap-2",children:[s.jsx(Nc,{className:"size-4 animate-spin"}),"Loading…"]}),s.jsx("ul",{className:"space-y-1",children:y.map(he=>s.jsx("li",{children:s.jsx("button",{type:"button",onClick:()=>Pt(he.id),className:je("w-full text-left rounded-md px-3 py-2 text-sm transition-colors",he.id===b?"bg-primary/10 text-primary font-medium":"hover:bg-muted"),children:s.jsx("span",{className:"truncate block",children:he.session_key})})},he.id))})]})]})]}),s.jsxs("select",{className:"border-input bg-background h-9 rounded-md border px-3 text-sm",value:u,onChange:he=>{const Qe=he.target.value;d(Qe);const et=r.find(qe=>qe.id===Qe);h(et?.defaultModel||"")},children:[(r.length===0||!u||!r.some(he=>he.id===u))&&s.jsx("option",{value:"",children:r.length===0?"No provider configured":"Select provider"}),r.map(he=>s.jsx("option",{value:he.id,children:he.label},he.id))]}),s.jsxs("select",{className:"border-input bg-background min-w-[200px] rounded-md border px-3 py-2 text-sm",value:f,onChange:he=>h(he.target.value),disabled:(u==="openrouter"||u==="ollama")&&p,children:[(u==="openrouter"||u==="ollama")&&p?s.jsx("option",{value:f,children:"Loading models…"}):k.map(he=>s.jsx("option",{value:he.id,children:he.name},he.id)),(u==="openrouter"||u==="ollama")&&!p&&k.length===0&&f&&s.jsx("option",{value:f,children:f})]})]}),s.jsx(li,{className:"min-h-[240px] flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[a.length===0&&(Oe?s.jsx(LP,{ideas:Zb,connectedIds:pe,onSelectIdea:De,onMissingIntegrations:Ue}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"Send a message to start. Provider and model can be changed above."})),a.map((he,Qe)=>s.jsx(qP,{message:he,isLast:Qe===a.length-1,isStreaming:v&&Qe===a.length-1},Qe)),!v&&!I&&a.length>0&&a[a.length-1]?.role==="assistant"&&BP(a[a.length-1]?.content)&&s.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[s.jsx("span",{className:"text-muted-foreground text-sm",children:"Reply:"}),s.jsxs(ue,{size:"sm",onClick:()=>L("yes"),children:[s.jsx(Ah,{className:"size-3.5"}),"Yes, create it"]}),s.jsxs(ue,{size:"sm",variant:"outline",onClick:()=>L("no"),children:[s.jsx(us,{className:"size-3.5"}),"No, don't create"]})]}),I&&s.jsxs(it,{className:"border-amber-500/50 bg-amber-500/5",children:[s.jsxs(xt,{className:"pb-2",children:[s.jsxs(yt,{className:"flex items-center gap-2 text-base",children:[s.jsx(nb,{className:"size-4 text-amber-600"}),"Approve this action"]}),s.jsx(vt,{children:"The agent wants to run a tool that can change files or run commands. Approve to continue or reject to cancel."})]}),s.jsx(st,{className:"space-y-3",children:V&&!B?s.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 py-2",children:[s.jsx(Nc,{className:"size-4 animate-spin"}),"Loading…"]}):s.jsxs(s.Fragment,{children:[B&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"font-mono text-sm font-medium",children:B.toolName}),Object.keys(B.args).length>0&&s.jsx("pre",{className:"bg-muted max-h-32 overflow-auto rounded p-2 text-xs",children:JSON.stringify(B.args,null,2)})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ue,{size:"sm",onClick:P,children:[s.jsx(Ah,{className:"size-4"}),"Approve"]}),s.jsxs(ue,{size:"sm",variant:"destructive",onClick:ee,children:[s.jsx(us,{className:"size-4"}),"Reject"]})]})]})})]}),v&&a.length>0&&a[a.length-1]?.role==="user"&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"size-8 shrink-0 flex items-center justify-center overflow-hidden rounded-full bg-muted",children:[s.jsx("img",{src:"/icon.svg",alt:"",className:"size-5 dark:hidden","aria-hidden":!0}),s.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-5 hidden dark:block","aria-hidden":!0})]}),s.jsx("div",{className:"border-border bg-muted/30 flex items-center gap-2 rounded-lg rounded-tl-sm px-3 py-2 text-sm",children:s.jsx(Ph,{})})]})]})}),ce.length>0&&s.jsx("div",{className:"border-border flex flex-wrap gap-2 rounded-md border p-2",children:ce.map((he,Qe)=>s.jsxs("div",{className:"relative",children:[he.type.startsWith("image/")?s.jsx("img",{src:URL.createObjectURL(he),alt:he.name,className:"h-14 w-14 rounded object-cover"}):s.jsx("div",{className:"border-input flex h-14 w-14 items-center justify-center rounded border text-xs",children:he.name.slice(0,8)}),s.jsx("button",{type:"button",className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-muted-foreground text-muted hover:bg-foreground hover:text-background",onClick:()=>ae(et=>et.filter((qe,Wt)=>Wt!==Qe)),"aria-label":"Remove attachment",children:s.jsx(us,{className:"h-3 w-3"})})]},`${he.name}-${Qe}`))}),s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs("label",{className:"cursor-pointer shrink-0 rounded-md border border-input px-2 py-2 text-muted-foreground hover:bg-muted/50",children:[s.jsx("input",{type:"file",accept:"image/*,video/*,.mp4,.webm,.mov,.m4v,.avi",className:"sr-only",multiple:!0,onChange:he=>{const Qe=he.target.files?Array.from(he.target.files):[];ae(et=>[...et,...Qe]),he.target.value=""}}),s.jsx(tO,{className:"h-5 w-5","aria-hidden":!0})]}),s.jsx("textarea",{className:"border-input bg-background field-sizing-content min-h-10 max-h-48 w-full min-w-0 flex-1 resize-none rounded-md border px-3 py-2 text-sm leading-relaxed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",placeholder:"Type a message…",value:l,onChange:he=>o(he.target.value),onKeyDown:he=>{he.key==="Enter"&&!he.shiftKey&&(he.preventDefault(),O())},rows:1}),s.jsx(ue,{onClick:O,disabled:v||!l.trim()&&ce.length===0,children:v?"Sending…":"Send"})]}),s.jsx(IP,{open:Y||F!=null&&F.length>0,onOpenChange:he=>{he||(A(!1),J?.())},requiredIntegrations:Y?_:F??[],connectedIds:pe,ideaTitle:Y?T:"",onConnect:Ge})]})]})}function GP(e,r){const[a,l]=S.useState([]),[o,u]=S.useState(!1),[d,f]=S.useState(null),[h,p]=S.useState(!1),[y,g]=S.useState(null),[v,b]=S.useState(void 0),[k,C]=S.useState(!1),[N,j]=S.useState(!1),R=15e3,M=S.useCallback(async()=>{u(!0),p(!1),g(null),b(void 0),C(!1),j(!1);const B=new Promise((V,P)=>{setTimeout(()=>P(new Error("Request timed out. Check that the agent and integrations service are running.")),R)});try{const V=await Promise.race([Va(),B]),P=!!(V.portalGatewayUrl?.trim()&&V.integrationsMode!=="portal");if(C(P),j(V.portalOAuthConnectAvailable===!0),V.integrationsMode==="portal"){p(!0),g(V.portalGatewayUrl??null);const te=V.integrationsUrl?.trim()||void 0;try{let ce;if(te)try{const{integrations:z}=await Promise.race([Th(te),B]);ce=z.map(F=>({...F,connections:[]}))}catch{ce=cc().map(F=>({id:F.id,name:F.name,iconUrl:F.logoUrl??"",description:F.description,connections:[]}))}else ce=cc().map(F=>({id:F.id,name:F.name,iconUrl:F.logoUrl??"",description:F.description,connections:[]}));const ae=new Map(ce.map(z=>[z.id,z])),{connections:q}=await Promise.race([Hw(),B]);for(const z of q){const F=z.provider||"other";let J=ae.get(F);if(!J){const Y=F.charAt(0).toUpperCase()+F.slice(1);J={id:F,name:Y,iconUrl:"",description:"Connected via Portal",connections:[]},ae.set(F,J),ce.push(J)}J.connections.push(z)}l(ce)}catch{l(cc().map(ce=>({id:ce.id,name:ce.name,iconUrl:ce.logoUrl??"",description:ce.description,connections:[],tokenOnly:ce.tokenOnly})))}u(!1);return}const ee=V.integrationsUrl?.trim()||void 0;if(b(ee),ee){const{integrations:te}=await Promise.race([Th(ee),B]);l(te)}else l(cc().map(te=>({id:te.id,name:te.name,iconUrl:te.logoUrl??"",description:te.description,connections:[],tokenOnly:te.tokenOnly})))}catch(V){r(V.message),l([])}finally{u(!1)}},[r]),O=S.useRef(M);O.current=M,S.useEffect(()=>{(e==="integrations"||e==="chat")&&O.current()},[e]);const L=S.useCallback(async B=>{f(B);try{const V=typeof window<"u"?`${window.location.origin}${window.location.pathname}?page=integrations`:"";if(h){const{authUrl:P}=await qw(B,V);window.location.href=P}else{const{authUrl:P}=await Pw(B,V,v);window.location.href=P}}catch(V){r(V.message),f(null)}},[h,v,r]),D=S.useCallback(async B=>{try{h?await Fw(B):await Uw(B,v),await M()}catch(V){r(V.message)}},[h,v,M,r]),I=S.useCallback(async B=>{try{const{url:V}=await Mm(B);window.open(V,"_blank","noopener,noreferrer")}catch(V){r(V.message)}},[r]);return{integrations:a,loading:o,connectingProvider:d,integrationsManagedByPortal:h,portalGatewayUrl:y,portalUrlSetButKeyMissing:k,portalOAuthConnectAvailable:N,load:M,handleConnect:L,handleDisconnect:D,startOAuthConnect:I}}function $P(e){if(Array.isArray(e))return e;if(!e||typeof e!="object")return[];const r=e;return"servers"in r&&Array.isArray(r.servers)?r.servers:"mcpServers"in r&&r.mcpServers&&typeof r.mcpServers=="object"&&!Array.isArray(r.mcpServers)?Object.entries(r.mcpServers).map(([a,l])=>({name:a,...l&&typeof l=="object"?l:{}})):[]}const YP=["Gmail – read and send emails","YouTube – search and get video details","GitHub – repos, issues, PRs","Slack – channels and messages","Google Drive – list and read files","Notion – pages and databases","Figma – list files and comments","Postgres / SQL – run queries"];function Wb(e){const r=e.trim();return r?r.startsWith("http://")||r.startsWith("https://")?r:`https://cdn.simpleicons.org/${encodeURIComponent(r)}`:""}function VP(e){try{const r=JSON.parse(e),a=$P(r);if(!(Array.isArray(r)||r&&typeof r=="object"&&("servers"in r||"mcpServers"in r)))return null;const o=[];for(const u of a){const d=u&&typeof u=="object"?u:{},f=typeof d.name=="string"?d.name.trim():"",h=typeof d.command=="string"?d.command.trim():"";if(!f||!h)continue;const p=Array.isArray(d.args)?d.args.map(b=>String(b)):void 0;let y;if(d.env&&typeof d.env=="object"&&!Array.isArray(d.env)){y={};for(const[b,k]of Object.entries(d.env))typeof b=="string"&&typeof k=="string"&&(y[b]=k);Object.keys(y).length===0&&(y=void 0)}const g=typeof d.icon=="string"&&d.icon.trim()||void 0,v=typeof d.credentialsUrl=="string"&&d.credentialsUrl.trim()||void 0;o.push({name:f,command:h,args:p,env:y,icon:g,credentialsUrl:v})}return o}catch{return null}}function KP({onError:e}){const[r,a]=S.useState([]),[l,o]=S.useState(!0),[u,d]=S.useState(!1),[f,h]=S.useState(null),[p,y]=S.useState(!1),[g,v]=S.useState(null),[b,k]=S.useState(!1),[C,N]=S.useState(""),[j,R]=S.useState(null),[M,O]=S.useState({name:"",command:"npx",args:["-y","package-name"],env:{}}),[L,D]=S.useState(""),[I,B]=S.useState(!1),[V,P]=S.useState(null);S.useEffect(()=>{p&&(g!==null&&r[g]?O({...r[g],env:{...r[g].env??{}}}):O({name:"",command:"npx",args:["-y","package-name"],env:{}}))},[p,g,r]);const ee=_=>{O(G=>({...G,..._}))},te=(_,G)=>{O(T=>{const oe={...T.env??{}};return G===""?delete oe[_]:oe[_]=G,{...T,env:oe}})},ce=()=>{!M.name?.trim()||!M.command?.trim()||(a(g!==null?_=>{const G=[..._];return G[g]={...M},G}:_=>[..._,{...M}]),y(!1))},ae=async()=>{o(!0),h(null);try{const G=(await Rm()).servers??[];return a(G),{servers:G}}catch(_){return h(_ instanceof Error?_.message:String(_)),e?.(_ instanceof Error?_.message:String(_)),{servers:[]}}finally{o(!1)}};S.useEffect(()=>{ae()},[]);const q=async()=>{d(!0),h(null);try{const _=r.map(G=>({...G,env:G.env?Object.fromEntries(Object.entries(G.env).map(([T,oe])=>[T,oe===""?"***":oe])):void 0}));await Iw(_),await ae()}catch(_){h(_ instanceof Error?_.message:String(_)),e?.(_ instanceof Error?_.message:String(_))}finally{d(!1)}},z=()=>{R(null);const _=VP(C);if(!_?.length){R('Invalid or empty. Use { "servers": [ ... ] } or { "mcpServers": { "name": { ... } } }.');return}a(G=>[...G,..._]),N(""),k(!1)},F=()=>{v(null),y(!0)},J=_=>{v(_),y(!0)},Y=_=>{a(G=>G.filter((T,oe)=>oe!==_))},A=async()=>{const _=L.trim();if(_){B(!0),P(null),h(null);try{const G=await Bw(_);P(G),D(""),setTimeout(()=>ae(),2e3)}catch(G){h(G instanceof Error?G.message:String(G)),e?.(G instanceof Error?G.message:String(G))}finally{B(!1)}}};return l?s.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading MCP servers…"}):s.jsxs("div",{className:"flex flex-col gap-4 max-w-2xl",children:[s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsxs(yt,{className:"flex items-center gap-2",children:[s.jsx(_h,{className:"size-5"}),"MCP Servers"]}),s.jsxs(vt,{className:"space-y-1",children:[s.jsx("span",{className:"block",children:"MCP is for users who want to run and configure their own servers (e.g. API keys in env)—more setup, more control or services not in Connections."}),s.jsxs("span",{className:"block",children:["Add MCP servers one at a time. Tools appear as ",s.jsx("code",{className:"rounded bg-muted px-1",children:"mcp_<name>_<tool>"}),". Config is saved to ",s.jsx("code",{className:"rounded bg-muted px-1",children:"~/.sulala/mcp.json"}),"."]}),s.jsxs("span",{className:"block",children:["Find more servers at"," ",s.jsx("a",{href:"https://mcpservers.org/",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:no-underline",children:"mcpservers.org"}),"."]})]})]}),s.jsxs(st,{className:"flex flex-col gap-4",children:[f&&s.jsx("p",{className:"text-destructive text-sm",children:f}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(ue,{type:"button",variant:"default",size:"sm",onClick:F,children:[s.jsx(sw,{className:"size-4 mr-1"}),"Add server"]}),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>k(!0),children:[s.jsx(GM,{className:"size-4 mr-1"}),"Import from JSON"]}),s.jsx(ue,{type:"button",size:"sm",variant:"secondary",onClick:q,disabled:u,children:u?"Saving…":"Save & reload tools"})]}),r.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No MCP servers configured. Click Add server to create one, or Import from JSON to add from a config snippet."}):s.jsx("ul",{className:"flex flex-col gap-2",children:r.map((_,G)=>s.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg border bg-card px-4 py-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[_.icon?s.jsx("img",{src:Wb(_.icon),alt:"",className:"size-5 shrink-0 rounded object-contain",onError:T=>{T.target.style.display="none"}}):s.jsx(_h,{className:"size-5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"font-medium truncate",title:_.name||`Server ${G+1}`,children:_.name||`Server ${G+1}`})]}),s.jsxs("span",{className:"text-muted-foreground truncate max-w-[40%]",title:[_.command,..._.args??[]].join(" "),children:[_.command," ",Array.isArray(_.args)&&_.args.length?_.args.join(" "):""]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[_.credentialsUrl&&s.jsxs("a",{href:_.credentialsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary text-xs inline-flex items-center gap-0.5",title:"Where to get API keys",children:[s.jsx(Nm,{className:"size-3.5"}),"Get keys"]}),s.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>J(G),title:"Edit",children:s.jsx(kO,{className:"size-4"})}),s.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-destructive",onClick:()=>Y(G),title:"Remove",children:s.jsx(Ec,{className:"size-4"})})]})]},G))})]})]}),s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsxs(yt,{className:"flex items-center gap-2",children:[s.jsx(uw,{className:"size-5"}),"Build with AI"]}),s.jsxs(vt,{children:["Describe the MCP server you want. The agent will find an existing npm MCP server or guide you, then add it so it appears here and as ",s.jsx("code",{className:"rounded bg-muted px-1",children:"mcp_<name>_*"})," tools."]})]}),s.jsxs(st,{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Suggestions"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:YP.map(_=>s.jsx(ue,{type:"button",variant:"outline",size:"sm",className:"h-auto py-1.5 px-2.5 text-xs font-normal whitespace-nowrap",onClick:()=>D(_),disabled:I,children:_},_))}),s.jsx("textarea",{className:"border-input bg-background min-h-[80px] w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"e.g. Gmail MCP server to read inbox and send emails",value:L,onChange:_=>D(_.target.value),disabled:I}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ue,{type:"button",variant:"default",size:"sm",onClick:A,disabled:I||!L.trim(),children:I?"Starting…":"Build with AI"}),V&&s.jsx("span",{className:"text-muted-foreground text-sm",children:V.message})]})]})]}),s.jsx(Xl,{open:p,onOpenChange:y,children:s.jsxs(Ql,{className:"max-w-lg max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[s.jsxs(Zl,{children:[s.jsx(Wl,{children:g!==null?"Edit MCP server":"Add MCP server"}),s.jsxs(ei,{children:["Name is used as the tool prefix (e.g. ",s.jsx("code",{className:"rounded bg-muted px-1",children:"mcp_<name>_<tool>"}),"). Command and args are run to start the server (e.g. npx + package, or node + path)."]})]}),s.jsxs("div",{className:"grid gap-3 py-2",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(qt,{className:"text-muted-foreground text-sm",children:"Icon (optional)"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kt,{placeholder:"e.g. github, youtube or https://…",value:M.icon??"",onChange:_=>ee({icon:_.target.value.trim()||void 0})}),M.icon&&s.jsx("img",{src:Wb(M.icon),alt:"",className:"size-8 shrink-0 rounded object-contain border border-input bg-muted",onError:_=>{_.target.style.display="none"}})]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Use a"," ",s.jsx("a",{href:"https://simpleicons.org/",target:"_blank",rel:"noopener noreferrer",className:"underline hover:no-underline",children:"Simple Icons"})," ","slug (e.g. ",s.jsx("code",{className:"rounded bg-muted px-1",children:"github"}),", ",s.jsx("code",{className:"rounded bg-muted px-1",children:"youtube"}),") or any image URL."]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(qt,{className:"text-muted-foreground text-sm",children:"Name"}),s.jsx(kt,{placeholder:"e.g. youtube",value:M.name,onChange:_=>ee({name:_.target.value.trim()})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(qt,{className:"text-muted-foreground text-sm",children:"Command"}),s.jsx(kt,{placeholder:"e.g. npx or node",value:M.command,onChange:_=>ee({command:_.target.value.trim()})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(qt,{className:"text-muted-foreground text-sm",children:"Args (comma-separated)"}),s.jsx(kt,{placeholder:"e.g. -y, package-name or /path/to/index.js",value:Array.isArray(M.args)?M.args.join(", "):"",onChange:_=>ee({args:_.target.value.split(",").map(G=>G.trim()).filter(Boolean)})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(qt,{className:"text-muted-foreground text-sm",children:"Env (API keys, etc.)"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:'Add a "Credentials help URL" below so users know where to get these keys.'}),s.jsxs("div",{className:"space-y-2",children:[Object.entries(M.env??{}).map(([_,G])=>s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx(kt,{className:"flex-1 font-mono text-sm",placeholder:"KEY",value:_,readOnly:!0}),s.jsx(kt,{type:"password",className:"flex-1 font-mono text-sm",placeholder:"value",value:G==="***"?"":G,onChange:T=>te(_,T.target.value)}),s.jsx(ue,{type:"button",variant:"ghost",size:"sm",onClick:()=>te(_,""),children:s.jsx(Ec,{className:"size-4"})})]},_)),s.jsx(XP,{onAdd:(_,G)=>{_&&te(_,G)}})]}),s.jsxs("div",{className:"grid gap-2 pt-1",children:[s.jsx(qt,{className:"text-muted-foreground text-sm",children:"Credentials help URL (optional)"}),s.jsx(kt,{type:"url",placeholder:"e.g. https://developers.google.com/gmail/api/quickstart/nodejs",value:M.credentialsUrl??"",onChange:_=>ee({credentialsUrl:_.target.value.trim()||void 0})}),s.jsx("p",{className:"text-muted-foreground text-xs",children:'Link to official docs on where and how to get API keys for this server. Shown as "Get keys" in the list.'})]})]})]}),s.jsxs(Jl,{children:[s.jsx(ue,{type:"button",variant:"outline",onClick:()=>y(!1),children:"Cancel"}),s.jsx(ue,{type:"button",onClick:ce,disabled:!M.name?.trim()||!M.command?.trim(),children:g!==null?"Update":"Add"})]})]})}),s.jsx(Xl,{open:b,onOpenChange:_=>{k(_),_||R(null)},children:s.jsxs(Ql,{className:"max-w-lg",showCloseButton:!0,children:[s.jsxs(Zl,{children:[s.jsx(Wl,{children:"Import from JSON"}),s.jsxs(ei,{children:["Paste JSON to add servers (they will be appended). Accepts"," ",s.jsx("code",{className:"rounded bg-muted px-1",children:'{ "servers": [ ... ] }'})," or"," ",s.jsx("code",{className:"rounded bg-muted px-1",children:'{ "mcpServers": { "name": { ... } } }'}),"."]})]}),j&&s.jsx("p",{className:"text-destructive text-sm",children:j}),s.jsx("textarea",{className:"border-input bg-background min-h-[160px] w-full rounded-md border px-3 py-2 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring",value:C,onChange:_=>N(_.target.value),spellCheck:!1,placeholder:'{"mcpServers":{"bluesky":{"command":"node","args":["/path/to/index.js"],"env":{...}}}}'}),s.jsxs(Jl,{children:[s.jsx(ue,{type:"button",variant:"outline",onClick:()=>k(!1),children:"Cancel"}),s.jsx(ue,{type:"button",onClick:z,children:"Add these servers to list"})]})]})})]})}function XP({onAdd:e}){const[r,a]=S.useState(""),[l,o]=S.useState(""),u=()=>{const d=r.trim();d&&(e(d,l.trim()),a(""),o(""))};return s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx(kt,{className:"flex-1 font-mono text-sm",placeholder:"e.g. YOUTUBE_API_KEY",value:r,onChange:d=>a(d.target.value)}),s.jsx(kt,{type:"password",className:"flex-1 font-mono text-sm",placeholder:"value",value:l,onChange:d=>o(d.target.value)}),s.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:u,children:"Add env"})]})}function QP({integrations:e,loading:r,connectingProvider:a,integrationsManagedByPortal:l,portalUrlSetButKeyMissing:o=!1,load:u,handleConnect:d,handleDisconnect:f,onError:h}){const[p,y]=S.useState("");S.useEffect(()=>{const b=new URLSearchParams(window.location.search),k=b.get("connectionId"),C=b.get("error"),N=b.get("oauth"),j=b.get("message");if(k||C){if(C&&h)try{h(decodeURIComponent(C))}catch{h("OAuth failed")}u();const R=new URL(window.location.href);R.searchParams.delete("connectionId"),R.searchParams.delete("error"),window.history.replaceState({},"",R.toString())}else if(N==="success"||N==="error"){N==="error"&&j&&h&&h(j==="exchange_failed"?"Token exchange failed. Check PORTAL_OAUTH_CLIENT_SECRET and redirect_uri.":j==="no_token"?"No access token in response.":j),u();const R=new URL(window.location.href);R.searchParams.delete("oauth"),R.searchParams.delete("message"),window.history.replaceState({},"",R.toString())}},[u,h]);const g=S.useMemo(()=>{const b=p.trim().toLowerCase();return b?e.filter(k=>k.name.toLowerCase().includes(b)||k.description.toLowerCase().includes(b)||k.id.toLowerCase().includes(b)):e},[e,p]),v=r&&e.length===0?s.jsxs("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 py-12",children:[s.jsx(Nc,{className:"size-5 animate-spin"}),s.jsx("span",{children:"Loading…"})]}):l?s.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Apps"}),s.jsx(jt,{variant:"secondary",className:"rounded-full text-[10px] font-medium uppercase",children:"Beta"})]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connect and disconnect apps here—no API keys to set up per app; use OAuth to connect. Your agent uses ",s.jsx("code",{className:"rounded bg-muted px-1",children:"PORTAL_API_KEY"})," or OAuth to access them."]})]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Configure Portal gateway and connect in ",s.jsx("strong",{children:"Settings → Portal"}),"."]}),e.length>0&&s.jsx("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(tb,{className:"text-muted-foreground absolute left-3 top-1/2 size-4 -translate-y-1/2"}),s.jsx(kt,{type:"search",placeholder:"Search apps",value:p,onChange:b=>y(b.target.value),className:"pl-9"})]})}),g.length>0?s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:g.map(b=>s.jsx(e0,{app:b,connecting:a===b.id,onConnect:()=>d(b.id),onDisconnect:f},b.id))}):p.trim()?s.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No apps match your search."}):s.jsx("p",{className:"text-muted-foreground py-4 text-center text-sm",children:"No connections yet. Click an app to connect."})]}):e.length===0&&!r?o?s.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-4",children:[s.jsxs("div",{className:"border-amber-500/50 bg-amber-500/10 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:"Portal API key required"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Configure Portal gateway URL and API key (or connect with OAuth) in ",s.jsx("strong",{children:"Settings → Portal"}),"."]})]}),s.jsx(ue,{variant:"secondary",size:"sm",onClick:()=>u(),className:"self-start",children:"Retry"})]}):s.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:s.jsxs("div",{className:"border-destructive/50 bg-destructive/5 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:"Could not reach the integrations service"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Configure ",s.jsx("strong",{children:"Settings → Portal"})," (recommended), or set ",s.jsx("code",{className:"rounded bg-muted px-1",children:"INTEGRATIONS_URL"})," in the agent .env and run the integrations service."]}),s.jsx(ue,{variant:"secondary",size:"sm",onClick:()=>u(),children:"Retry"})]})}):s.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Apps"}),s.jsx(jt,{variant:"secondary",className:"rounded-full text-[10px] font-medium uppercase",children:"Beta"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect your favorite apps—no API keys to set up per app; connect with one click. The agent uses these via connectionId; no secrets in skills."})]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Portal gateway and Connect with Sulala are in ",s.jsx("strong",{children:"Settings → Portal"}),"."]}),s.jsx("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(tb,{className:"text-muted-foreground absolute left-3 top-1/2 size-4 -translate-y-1/2"}),s.jsx(kt,{type:"search",placeholder:"Search apps",value:p,onChange:b=>y(b.target.value),className:"pl-9"})]})}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:g.map(b=>s.jsx(e0,{app:b,connecting:a===b.id,onConnect:()=>d(b.id),onDisconnect:f},b.id))}),g.length===0&&s.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No apps match your search."})]});return s.jsxs("div",{className:"flex flex-1 flex-col p-4 min-h-0",children:[s.jsxs("p",{className:"text-muted-foreground mb-2 text-sm",children:[s.jsx("strong",{children:"Connections"}),": connect apps with one click (no per-app API keys). ",s.jsx("strong",{children:"MCP Servers"}),": run and configure your own servers for more control or services not in Connections."]}),s.jsxs(zm,{defaultValue:"mcp",className:"flex flex-1 flex-col min-h-0",children:[s.jsxs(Lm,{className:"w-full max-w-xs grid grid-cols-2 mb-4",children:[s.jsxs(ql,{value:"mcp",className:"flex items-center gap-2",children:[s.jsx(_h,{className:"size-4"}),"MCP Servers"]}),s.jsxs(ql,{value:"connections",className:"flex items-center gap-2",children:[s.jsx(iw,{className:"size-4"}),"Connections"]})]}),s.jsx(nn,{value:"mcp",className:"mt-0 flex-1 data-[state=inactive]:hidden min-h-0",children:s.jsx(KP,{onError:h})}),s.jsx(nn,{value:"connections",className:"mt-0 flex-1 data-[state=inactive]:hidden min-h-0",children:v})]})]})}const ZP="https://discord.com/developers/applications",JP="https://dashboard.stripe.com/apikeys";function e0({app:e,connecting:r,onConnect:a,onDisconnect:l,portalMode:o=!1}){const u=e.connections.length>0,d=e.tokenOnly===!0,f=e.id==="discord",h=e.id==="stripe",p=()=>{if(!u){if(d&&f){window.open(ZP,"_blank","noopener,noreferrer");return}if(d&&h){window.open(JP,"_blank","noopener,noreferrer");return}a()}};return s.jsxs("div",{className:"border-border hover:bg-muted/50 flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 transition-colors",onClick:p,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),p())},role:"button",tabIndex:0,children:[s.jsx("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg p-1.5",children:e.iconUrl?s.jsx("img",{src:e.iconUrl,alt:"",className:"size-full object-contain"}):s.jsx("span",{className:"text-muted-foreground text-sm font-medium",children:e.name.charAt(0)})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium truncate",children:e.name}),u&&s.jsx(jt,{variant:"secondary",className:"shrink-0 text-[10px]",children:"Connected"}),d&&!u&&s.jsx(jt,{variant:"outline",className:"shrink-0 text-[10px]",children:"Setup"})]}),s.jsx("p",{className:"text-muted-foreground truncate text-sm",children:e.description}),f&&d&&s.jsxs("p",{className:"text-muted-foreground mt-0.5 text-xs",children:["Set ",s.jsx("code",{className:"rounded bg-muted px-1",children:"DISCORD_BOT_TOKEN"})," in agent .env or Settings → Channels. Click to open Discord Developer Portal."]}),h&&d&&s.jsxs("p",{className:"text-muted-foreground mt-0.5 text-xs",children:["Set Secret Key in Settings → Payment or ",s.jsx("code",{className:"rounded bg-muted px-1",children:"STRIPE_SECRET_KEY"})," in agent .env. Click to open Stripe API keys."]})]}),s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:u&&!o?e.connections.map(y=>s.jsx(ue,{variant:"ghost",size:"icon",className:"size-8",onClick:g=>{g.stopPropagation(),l(y.id)},title:"Disconnect",children:s.jsx(Ec,{className:"size-3.5 text-muted-foreground"})},y.id)):u&&o?s.jsx("span",{title:"Manage in Portal",children:s.jsx(zr,{className:"text-muted-foreground size-5"})}):r?s.jsx(Nc,{className:"text-muted-foreground size-5 animate-spin"}):s.jsx(zr,{className:"text-muted-foreground size-5"})})]})}function lp({className:e,...r}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:je("w-full caption-bottom text-sm",e),...r})})}function ip({className:e,...r}){return s.jsx("thead",{"data-slot":"table-header",className:je("[&_tr]:border-b",e),...r})}function sp({className:e,...r}){return s.jsx("tbody",{"data-slot":"table-body",className:je("[&_tr:last-child]:border-0",e),...r})}function pa({className:e,...r}){return s.jsx("tr",{"data-slot":"table-row",className:je("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...r})}function Qt({className:e,...r}){return s.jsx("th",{"data-slot":"table-head",className:je("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function Ht({className:e,...r}){return s.jsx("td",{"data-slot":"table-cell",className:je("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}const pc=[{label:"Every day at 9:00 AM",value:"0 9 * * *"},{label:"Every day at 8:00 AM",value:"0 8 * * *"},{label:"Every day at 12:00 PM (noon)",value:"0 12 * * *"},{label:"Every day at 6:00 PM",value:"0 18 * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Every 30 minutes",value:"*/30 * * * *"},{label:"Every 15 minutes",value:"*/15 * * * *"},{label:"Every Monday at 9:00 AM",value:"0 9 * * 1"},{label:"Every weekday at 9:00 AM",value:"0 9 * * 1-5"},{label:"Custom (advanced)",value:"__custom__"}];function t0(e){return pc.find(a=>a.value===e&&a.value!=="__custom__")?.label??(e?`Custom: ${e}`:"—")}const WP=[{label:"Morning news → Bluesky",prompt:"Fetch daily news and post one to Bluesky every morning at 9."},{label:"Hourly RSS summary",prompt:"Summarize my RSS feeds and send a short summary every hour."},{label:"Weekday weather reminder",prompt:"Send me the weather for my location every weekday at 8 AM."},{label:"Daily digest to Telegram",prompt:"Collect top stories from my configured sources and send a daily digest to Telegram at 6 PM."},{label:"Bluesky post every 12h",prompt:"Post a tip or quote to Bluesky every 12 hours."},{label:"Backup reminder weekly",prompt:"Remind me to run my backup every Monday at 9 AM."}];function eU(e){const{schedules:r,load:a,onCreateSchedule:l,onUpdateSchedule:o,onDeleteSchedule:u,onRunSchedule:d,onFetchScheduleRuns:f,onNavigateToSettings:h}=e,[p,y]=S.useState(null),[g,v]=S.useState(""),[b,k]=S.useState(!1),[C,N]=S.useState(null),[j,R]=S.useState(null),[M,O]=S.useState(!1),[L,D]=S.useState("Morning post"),[I,B]=S.useState(""),[V,P]=S.useState("Fetch daily news and post one to Bluesky."),[ee,te]=S.useState("0 9 * * *"),[ce,ae]=S.useState(""),[q,z]=S.useState(!0),[F,J]=S.useState(""),[Y,A]=S.useState(""),[_,G]=S.useState([]),[T,oe]=S.useState([]),[me,fe]=S.useState(!1),[ge,ze]=S.useState(!1),[Ee,pe]=S.useState(null),[Oe,De]=S.useState(null),[Ue,Ge]=S.useState([]),[Pt,Ut]=S.useState(!1),[Jn,Fn]=S.useState(null),Ne=ee==="__custom__"?ce.trim():ee,Le=j?j.prompt:V.trim(),he=j?j.cron_expression:Ne,Qe=j?j.name:L.trim()||"Scheduled job";S.useEffect(()=>{Va().then(K=>G(K?.aiProviders??[])).catch(()=>G([]))},[]),S.useEffect(()=>{Am().then(y).catch(()=>y(null))},[]),S.useEffect(()=>{if(!F||F!=="ollama"&&F!=="openrouter"){oe([]),A("");return}fe(!0),Es(F).then(K=>oe(K.models??[])).catch(()=>oe([])).finally(()=>fe(!1))},[F]);const et=async()=>{const K=g.trim();if(K){N(null),k(!0);try{const Ae=await pw({message:K});R(Ae)}catch(Ae){N(Ae instanceof Error?Ae.message:"Failed to understand schedule"),R(null)}finally{k(!1)}}},qe=async()=>{if(Le){ze(!0),N(null);try{const K=q?[{channel:"telegram",target:"default"}]:[];await l({name:Qe,description:I.trim()||void 0,cron_expression:he.trim(),prompt:Le,delivery:K.length?K:void 0,provider:F.trim()||null,model:Y.trim()||null}),R(null),v(""),D("Morning post"),B(""),P("Fetch daily news and post one to Bluesky."),te("0 9 * * *"),ae(""),z(!0),J(""),A("")}finally{ze(!1)}}},Wt=async K=>{pe(K.id);try{await o(K.id,{enabled:!K.enabled})}finally{pe(null)}},W=async K=>{pe(K);try{await u(K)}finally{pe(null)}},se=async K=>{pe(K.id),Fn(null);try{const Ae=await d(K.id);Fn({jobId:K.id,message:`Job enqueued (task ${Ae.id.slice(0,12)}…)`}),a()}catch(Ae){Fn({jobId:K.id,message:Ae instanceof Error?Ae.message:"Run failed"})}finally{pe(null)}},be=K=>{De(K)};return S.useEffect(()=>{if(!Oe){Ge([]);return}Ut(!0),f(Oe.id).then(({runs:K})=>Ge(K)).catch(()=>Ge([])).finally(()=>Ut(!1))},[Oe?.id,f]),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"New job"}),s.jsx(vt,{children:"Describe what you want in plain language; the AI will figure out the task and schedule. The agent uses your skills (e.g. news, Bluesky) and runs on that schedule. Results can be sent to Telegram (first chat that messages the bot, or set in Settings → Channels)."})]}),s.jsxs(st,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"Describe your job"}),s.jsx("p",{className:"text-muted-foreground mb-1.5 text-xs",children:"Quick ideas — click to use"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:WP.map(K=>s.jsx(ue,{variant:"outline",size:"sm",className:"h-8 text-xs font-normal",onClick:()=>v(K.prompt),disabled:b,children:K.label},K.label))}),s.jsx("textarea",{className:"border-input bg-background min-h-[88px] w-full rounded-md border px-3 py-2 text-sm",value:g,onChange:K=>v(K.target.value),placeholder:"e.g. Fetch daily news and post one to Bluesky every morning at 9",rows:3,disabled:b}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ue,{onClick:et,disabled:b||!g.trim(),children:b?"Understanding…":s.jsxs(s.Fragment,{children:[s.jsx(uw,{className:"mr-1.5 size-4"}),"Understand & schedule"]})}),s.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>O(K=>!K),children:[M?s.jsx(kM,{className:"size-4"}):s.jsx(vM,{className:"size-4"}),"Advanced form"]})]}),C&&s.jsx("p",{className:"text-destructive text-sm",children:C})]}),j&&s.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-3",children:[s.jsx("p",{className:"text-muted-foreground text-sm font-medium",children:"Job preview — confirm or edit below"}),s.jsxs("dl",{className:"grid gap-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("dt",{className:"text-muted-foreground",children:"Name"}),s.jsx("dd",{className:"font-medium",children:j.name})]}),s.jsxs("div",{children:[s.jsx("dt",{className:"text-muted-foreground",children:"Task"}),s.jsx("dd",{children:j.prompt})]}),s.jsxs("div",{children:[s.jsx("dt",{className:"text-muted-foreground",children:"Schedule"}),s.jsx("dd",{children:t0(j.cron_expression)})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-1",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:q,onChange:K=>z(K.target.checked)}),"Notify via Telegram"]}),q&&p!==null&&!p.configured&&s.jsxs("p",{className:"text-amber-600 dark:text-amber-400 text-sm w-full",children:["Telegram is not set up. Set it up in Settings → Channels to receive job notifications.",h&&s.jsx(ue,{variant:"link",className:"h-auto p-0 ml-1 text-sm",onClick:h,children:"Open Settings"})]}),s.jsx(ue,{onClick:qe,disabled:ge||!Le||q&&(p===null||!p.configured),children:ge?"Adding…":"Confirm & add job"}),s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>R(null),children:"Discard"})]})]}),M&&s.jsxs("div",{className:"space-y-4 border-t pt-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"Name"}),s.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:j?j.name:L,onChange:K=>{j?R({...j,name:K.target.value}):D(K.target.value)},placeholder:"Morning post"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"Schedule"}),s.jsx("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:j?pc.some(K=>K.value===j.cron_expression)?j.cron_expression:"__custom__":ee,onChange:K=>{const Ae=K.target.value;j?R({...j,cron_expression:Ae==="__custom__"?j.cron_expression||"0 9 * * *":Ae}):te(Ae)},children:pc.map(K=>s.jsx("option",{value:K.value,children:K.label},K.value))}),(j&&j.cron_expression&&!pc.find(K=>K.value===j.cron_expression)||!j&&ee==="__custom__")&&s.jsxs("div",{className:"mt-2 space-y-1",children:[s.jsx("label",{className:"text-muted-foreground block text-xs",children:"Cron expression"}),s.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 font-mono text-sm",value:j?j.cron_expression:ce,onChange:K=>{j?R({...j,cron_expression:K.target.value}):ae(K.target.value)},placeholder:"0 9 * * *"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"Prompt"}),s.jsx("textarea",{className:"border-input bg-background min-h-[60px] w-full rounded-md border px-3 py-2 text-sm",value:j?j.prompt:V,onChange:K=>{j?R({...j,prompt:K.target.value}):P(K.target.value)},placeholder:"e.g. Fetch daily news and post one to Bluesky.",rows:2})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"AI Provider (optional)"}),s.jsxs("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:F,onChange:K=>J(K.target.value),children:[s.jsx("option",{value:"",children:"Use default"}),_.map(K=>s.jsx("option",{value:K.id,children:K.label},K.id)),_.length===0&&s.jsxs(s.Fragment,{children:[s.jsx("option",{value:"openrouter",children:"OpenRouter"}),s.jsx("option",{value:"openai",children:"OpenAI"}),s.jsx("option",{value:"ollama",children:"Ollama"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"Model (optional)"}),F&&(F==="ollama"||F==="openrouter")?s.jsxs("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:Y,onChange:K=>A(K.target.value),disabled:me,children:[s.jsx("option",{value:"",children:"Use provider default"}),T.map(K=>s.jsx("option",{value:K.id,children:K.name},K.id))]}):s.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:Y,onChange:K=>A(K.target.value),placeholder:F?"e.g. gpt-4o-mini":"Select provider first",disabled:!F})]})]}),!j&&s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:q,onChange:K=>z(K.target.checked)}),"Notify via Telegram"]}),q&&p!==null&&!p.configured&&s.jsxs("p",{className:"text-amber-600 dark:text-amber-400 text-sm w-full",children:["Telegram is not set up. Set it up in Settings → Channels to receive job notifications.",h&&s.jsx(ue,{variant:"link",className:"h-auto p-0 ml-1 text-sm",onClick:h,children:"Open Settings"})]}),s.jsx(ue,{onClick:qe,disabled:ge||!V.trim()||!Ne||q&&(p===null||!p.configured),children:ge?"Adding…":"Add job"})]})]})]})]}),s.jsxs(it,{children:[s.jsxs(xt,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(yt,{className:"text-base",children:"Scheduled jobs"}),s.jsx(vt,{children:"Agent jobs (prompt + schedule). You get a Telegram notification on success or failure if delivery is set."})]}),s.jsx(ue,{variant:"outline",size:"sm",onClick:a,children:"Refresh"})]}),s.jsx(st,{children:s.jsx(li,{className:"h-[320px]",children:s.jsxs(lp,{children:[s.jsx(ip,{children:s.jsxs(pa,{children:[s.jsx(Qt,{children:"Name"}),s.jsx(Qt,{children:"Prompt"}),s.jsx(Qt,{children:"Model"}),s.jsx(Qt,{children:"Cron"}),s.jsx(Qt,{children:"Delivery"}),s.jsx(Qt,{children:"Enabled"}),s.jsx(Qt,{children:"Created"}),s.jsx(Qt,{className:"w-[70px]",children:"Actions"})]})}),s.jsx(sp,{children:r.length===0?s.jsx(pa,{children:s.jsx(Ht,{colSpan:8,className:"text-muted-foreground text-center text-sm",children:"No scheduled jobs. Add one above."})}):r.map(K=>s.jsxs(pa,{children:[s.jsx(Ht,{className:"font-medium",children:K.name||K.id}),s.jsx(Ht,{className:"max-w-[200px] truncate text-sm",children:K.prompt||K.task_type||"—"}),s.jsx(Ht,{className:"text-muted-foreground max-w-[120px] truncate text-xs",children:K.provider?`${K.provider}${K.model?` / ${K.model}`:""}`:"—"}),s.jsx(Ht,{className:"text-xs",children:t0(K.cron_expression)}),s.jsx(Ht,{children:K.delivery?s.jsx(jt,{variant:"outline",children:"Telegram"}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),s.jsx(Ht,{children:s.jsx(jt,{variant:K.enabled?"default":"secondary",children:K.enabled?"On":"Off"})}),s.jsx(Ht,{className:"text-muted-foreground text-xs",children:As(K.created_at)}),s.jsx(Ht,{children:s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(Pm,{children:[s.jsx(Um,{asChild:!0,children:s.jsx(ue,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:Ee===K.id,title:"Actions",children:s.jsx(zM,{className:"size-4"})})}),s.jsxs(Im,{align:"end",children:[s.jsxs(ha,{onClick:()=>se(K),children:[s.jsx(CO,{className:"size-4"}),"Test"]}),s.jsxs(ha,{onClick:()=>be(K),children:[s.jsx(Em,{className:"size-4"}),"Logs"]}),s.jsxs(ha,{onClick:()=>Wt(K),children:[s.jsx(_O,{className:"size-4"}),K.enabled?"Disable":"Enable"]}),s.jsxs(ha,{variant:"destructive",onClick:()=>W(K.id),children:[s.jsx(Ec,{className:"size-4"}),"Delete"]})]})]}),Jn?.jobId===K.id&&s.jsx("span",{className:"text-muted-foreground text-xs",children:Jn.message})]})})]},K.id))})]})})})]}),s.jsx(au,{open:!!Oe,onOpenChange:K=>!K&&De(null),children:s.jsxs(lu,{side:"right",className:"w-full max-w-lg overflow-y-auto",children:[s.jsxs(iu,{children:[s.jsxs(su,{children:[Oe?.name||Oe?.id," — Run logs"]}),s.jsx(ou,{children:"Recent runs for this job. Status: pending, running, done, or failed."})]}),s.jsx("div",{className:"mt-4 space-y-3",children:Pt?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}):Ue.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No runs yet. Use Test to run now."}):Ue.map(K=>s.jsxs("div",{className:"border-input rounded-md border p-3 text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(jt,{variant:K.status==="done"?"default":K.status==="failed"?"destructive":K.status==="running"?"secondary":"outline",children:K.status}),s.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[K.id.slice(0,16),"…"]})]}),s.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:[sk(K.created_at),K.finished_at!=null&&K.started_at!=null&&s.jsxs(s.Fragment,{children:[" · ",Math.round((K.finished_at-K.started_at)/1e3),"s"]})]}),K.error&&s.jsx("p",{className:"mt-2 text-destructive text-xs",children:K.error})]},K.id))})]})})]})}function tU({config:e}){return s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"Watched folders"}),s.jsx(vt,{children:"Paths monitored by the file watcher (from env and config/watched.json). Read-only."})]}),s.jsx(st,{children:e?.watchFolders&&e.watchFolders.length>0?s.jsx("ul",{className:"space-y-2 font-mono text-sm",children:e.watchFolders.map(r=>s.jsx("li",{className:"rounded border bg-muted/30 px-3 py-2",children:r},r))}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"No watched folders configured. Set WATCH_FOLDERS in .env or add paths to config/watched.json."})})]})}function nU(e){const[r,a]=S.useState(null);return S.useEffect(()=>{(e==="config"||e==="settings")&&Va().then(a).catch(()=>a(null))},[e]),r}const n0={OPENAI_API_KEY:"OpenAI API Key",ANTHROPIC_API_KEY:"Anthropic (Claude) API Key",GOOGLE_GEMINI_API_KEY:"Google Gemini API Key",GEMINI_API_KEY:"Gemini API Key (alt)",OPENROUTER_API_KEY:"OpenRouter API Key",OLLAMA_BASE_URL:"Ollama Base URL",GATEWAY_API_KEY:"Gateway API Key"};function rU(){const[e,r]=S.useState({}),[a,l]=S.useState({}),[o,u]=S.useState(!0),[d,f]=S.useState(!1),[h,p]=S.useState(null),[y,g]=S.useState(!1),[v,b]=S.useState(null),[k,C]=S.useState(null),[N,j]=S.useState(""),[R,M]=S.useState(""),[O,L]=S.useState([]),[D,I]=S.useState(!1),[B,V]=S.useState(!1),[P,ee]=S.useState(null);S.useEffect(()=>{Promise.all([or(),Kl(),Va(),Ac()]).then(([q,z,F,J])=>{r(q.keys||{}),p(z.running),C(F??null),j(J.defaultProvider??""),M(J.defaultModel??"")}).catch(()=>b({type:"error",text:"Failed to load"})).finally(()=>u(!1))},[]),S.useEffect(()=>{if(!N||N!=="ollama"&&N!=="openrouter"){L([]);return}I(!0),Es(N).then(q=>L(q.models??[])).catch(()=>L([])).finally(()=>I(!1))},[N]);const te=async()=>{g(!0);try{const{running:q}=await Kl();p(q)}finally{g(!1)}},ce=async()=>{f(!0),b(null);try{const q={};for(const[F,J]of Object.entries(a))typeof J=="string"&&J.trim()&&(q[F]=J.trim());await Ns(q);const{keys:z}=await or();r(z),l({}),b({type:"success",text:"API keys saved. Restart the agent for changes to take effect."})}catch(q){b({type:"error",text:q instanceof Error?q.message:"Failed to save"})}finally{f(!1)}},ae=Object.keys(n0);return o?s.jsx(it,{children:s.jsx(st,{className:"pt-6",children:s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"})})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{children:"AI Providers"}),s.jsxs(vt,{children:["Add or update API keys. Saved to ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"~/.sulala/.env"}),". Restart the agent for changes."]})]}),s.jsxs(st,{className:"space-y-4",children:[ae.map(q=>s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{htmlFor:q,children:n0[q]??q}),s.jsx(kt,{id:q,type:"password",placeholder:e[q]==="set"?"(already set)":"",value:a[q]??"",onChange:z=>l(F=>({...F,[q]:z.target.value})),autoComplete:"off"})]},q)),v&&s.jsx("p",{className:v.type==="success"?"text-green-600 dark:text-green-400 text-sm":"text-destructive text-sm",children:v.text}),s.jsx(ue,{onClick:ce,disabled:d||Object.keys(a).length===0,children:d?"Saving…":"Save"})]})]}),s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{children:"Default for scheduled jobs"}),s.jsx(vt,{children:'When a job uses "Use default", this provider and model are used. Set this to OpenRouter or OpenAI (not Ollama) so jobs run reliably even when Ollama is not running.'})]}),s.jsxs(st,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{htmlFor:"job-default-provider",children:"Provider"}),s.jsxs("select",{id:"job-default-provider",className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:N,onChange:q=>{j(q.target.value),M("")},children:[s.jsx("option",{value:"",children:"Use env default"}),(k?.aiProviders??[]).filter(q=>q.id!=="ollama").map(q=>s.jsx("option",{value:q.id,children:q.label},q.id)),s.jsx("option",{value:"ollama",children:"Ollama (not recommended for jobs)"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{htmlFor:"job-default-model",children:"Model"}),N&&(N==="ollama"||N==="openrouter")?s.jsxs("select",{id:"job-default-model",className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:R,onChange:q=>M(q.target.value),disabled:D,children:[s.jsx("option",{value:"",children:"Use provider default"}),O.map(q=>s.jsx("option",{value:q.id,children:q.name},q.id))]}):s.jsx(kt,{id:"job-default-model",className:"h-9 text-sm",value:R,onChange:q=>M(q.target.value),placeholder:N?"e.g. gpt-4o-mini":"Set provider first",disabled:!N})]})]}),N==="ollama"&&s.jsx("p",{className:"text-amber-600 dark:text-amber-400 text-sm",children:"Ollama is not recommended for scheduled jobs. If Ollama is not running when the job runs, the job will fail."}),P&&s.jsx("p",{className:P.type==="success"?"text-green-600 dark:text-green-400 text-sm":"text-destructive text-sm",children:P.text}),s.jsx(ue,{onClick:async()=>{V(!0),ee(null);try{await Gw({defaultProvider:N.trim()||null,defaultModel:R.trim()||null}),ee({type:"success",text:"Job default saved. New jobs using “Use default” will use this."})}catch(q){ee({type:"error",text:q instanceof Error?q.message:"Failed to save"})}finally{V(!1)}},disabled:B,children:B?"Saving…":"Save job default"})]})]}),s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{children:"Ollama"}),s.jsx(vt,{children:"Local AI. No API key required. Install from ollama.com"})]}),s.jsxs(st,{children:[h?s.jsx("p",{className:"text-green-600 dark:text-green-400 text-sm",children:"Ollama is running."}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"Ollama is not running."}),s.jsx(ue,{variant:"outline",size:"sm",onClick:te,disabled:y,className:"mt-2",children:y?"Checking…":"Check again"}),s.jsxs("p",{className:"text-muted-foreground mt-2 text-xs",children:["Install from ",s.jsx("a",{href:"https://ollama.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"ollama.com"})," or run ",s.jsx("code",{children:"ollama serve"})," in terminal."]})]})]})]})}function aU(e){const{tasks:r,load:a,enqueueType:l,setEnqueueType:o,enqueuePayload:u,setEnqueuePayload:d,enqueueing:f,actionTaskId:h,handleTaskCancel:p,handleTaskRetry:y,handleEnqueue:g}=e;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"Enqueue task"}),s.jsx(vt,{children:"Add a task to the queue"})]}),s.jsxs(st,{className:"flex flex-wrap items-end gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"Type"}),s.jsx("input",{className:"border-input bg-background h-9 rounded-md border px-3 text-sm",value:l,onChange:v=>o(v.target.value),placeholder:"e.g. heartbeat"})]}),s.jsxs("div",{className:"min-w-[200px] space-y-2",children:[s.jsx("label",{className:"text-muted-foreground block text-sm",children:"Payload (JSON)"}),s.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:u,onChange:v=>d(v.target.value),placeholder:'{"key": "value"}'})]}),s.jsx(ue,{onClick:g,disabled:f,children:f?"Enqueueing…":"Enqueue"})]})]}),s.jsxs(it,{children:[s.jsxs(xt,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(yt,{className:"text-base",children:"Tasks"}),s.jsx(vt,{children:"Recent tasks (from gateway)"})]}),s.jsx(ue,{variant:"outline",size:"sm",onClick:a,children:"Refresh"})]}),s.jsx(st,{children:s.jsx(li,{className:"h-[400px]",children:s.jsxs(lp,{children:[s.jsx(ip,{children:s.jsxs(pa,{children:[s.jsx(Qt,{children:"ID"}),s.jsx(Qt,{children:"Type"}),s.jsx(Qt,{children:"Status"}),s.jsx(Qt,{children:"Created"}),s.jsx(Qt,{className:"w-[120px]",children:"Actions"})]})}),s.jsx(sp,{children:r.map(v=>s.jsxs(pa,{children:[s.jsxs(Ht,{className:"font-mono text-xs",children:[v.id.slice(0,20),"…"]}),s.jsx(Ht,{children:v.type}),s.jsx(Ht,{children:s.jsx(jt,{variant:v.status==="done"?"default":v.status==="failed"?"destructive":v.status==="cancelled"?"outline":"secondary",children:v.status})}),s.jsx(Ht,{className:"text-muted-foreground text-xs",children:As(v.created_at)}),s.jsxs(Ht,{children:[(v.status==="pending"||v.status==="running")&&s.jsx(ue,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",disabled:h===v.id,onClick:()=>p(v.id),children:"Cancel"}),v.status==="failed"&&s.jsx(ue,{variant:"ghost",size:"sm",className:"h-7",disabled:h===v.id,onClick:()=>y(v.id),children:"Retry"})]})]},v.id))})]})})})]})]})}function lU({logs:e,load:r}){return s.jsxs(it,{children:[s.jsxs(xt,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(yt,{className:"text-base",children:"Logs"}),s.jsx(vt,{children:"Recent gateway and worker logs"})]}),s.jsx(ue,{variant:"outline",size:"sm",onClick:r,children:"Refresh"})]}),s.jsx(st,{children:s.jsx(li,{className:"h-[500px] rounded-md border p-3",children:s.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.map(a=>s.jsxs("div",{className:"flex flex-wrap gap-2 border-b py-1.5 last:border-0",children:[s.jsx("span",{className:"text-muted-foreground shrink-0",children:As(a.created_at)}),s.jsx(jt,{variant:"outline",className:"shrink-0",children:a.source}),s.jsx("span",{className:a.level==="error"?"text-destructive":a.level==="warn"?"text-amber-600 dark:text-amber-400":"",children:a.message})]},a.id))})})})]})}function iU({fileStates:e,load:r}){return s.jsxs(it,{children:[s.jsxs(xt,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(yt,{className:"text-base",children:"File states"}),s.jsx(vt,{children:"Files seen by the watcher (last modified time, size)"})]}),s.jsx(ue,{variant:"outline",size:"sm",onClick:r,children:"Refresh"})]}),s.jsx(st,{children:s.jsx(li,{className:"h-[500px]",children:s.jsxs(lp,{children:[s.jsx(ip,{children:s.jsxs(pa,{children:[s.jsx(Qt,{children:"Path"}),s.jsx(Qt,{children:"Size"}),s.jsx(Qt,{children:"Last seen"})]})}),s.jsx(sp,{children:e.length===0?s.jsx(pa,{children:s.jsx(Ht,{colSpan:3,className:"text-muted-foreground text-center",children:"No file states. Add watched folders and trigger file events."})}):e.map(a=>s.jsxs(pa,{children:[s.jsx(Ht,{className:"max-w-[400px] truncate font-mono text-xs",children:a.path}),s.jsx(Ht,{className:"text-muted-foreground text-xs",children:a.size!=null?`${a.size} B`:"—"}),s.jsx(Ht,{className:"text-muted-foreground text-xs",children:As(a.last_seen)})]},a.path))})]})})})]})}const sU="https://discord.com/developers/applications";function oU(){const[e,r]=S.useState(null),[a,l]=S.useState(null),[o,u]=S.useState(!0),[d,f]=S.useState(!1),[h,p]=S.useState(null),[y,g]=S.useState(!1),[v,b]=S.useState(""),[k,C]=S.useState("open"),[N,j]=S.useState(""),[R,M]=S.useState(""),[O,L]=S.useState(""),[D,I]=S.useState([]),[B,V]=S.useState(!1),[P,ee]=S.useState(null),[te,ce]=S.useState(""),[ae,q]=S.useState(!1),z=async()=>{u(!0),p(null);try{const[Y,A,_]=await Promise.all([Am(),bw(),Va()]);r(Y),ee(A),l(_),g(Y.enabled),b(""),C(Y.dmPolicy||"open"),j(Array.isArray(Y.allowFrom)?Y.allowFrom.join(", "):""),M(Y.defaultProvider??""),L(Y.defaultModel??"")}catch(Y){p(Y instanceof Error?Y.message:String(Y))}finally{u(!1)}};S.useEffect(()=>{z()},[]),S.useEffect(()=>{if(!R||R!=="ollama"&&R!=="openrouter"){I([]);return}V(!0),Es(R).then(Y=>I(Y.models??[])).catch(()=>I([])).finally(()=>V(!1))},[R]);const F=async()=>{f(!0),p(null);try{const Y=N.split(/[,;\s]+/).map(G=>parseInt(G.trim(),10)).filter(G=>!Number.isNaN(G)),A={enabled:y,dmPolicy:k,allowFrom:Y,defaultProvider:R.trim()||null,defaultModel:O.trim()||null};v.trim()&&(A.botToken=v.trim());const _=await vw(A);r(_),b("")}catch(Y){p(Y instanceof Error?Y.message:String(Y))}finally{f(!1)}},J=async()=>{q(!0),p(null);try{const Y=await Sw({botToken:te.trim()||null});ee(Y),ce("")}catch(Y){p(Y instanceof Error?Y.message:String(Y))}finally{q(!1)}};return o?s.jsx(it,{children:s.jsx(st,{className:"pt-6",children:s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading channels…"})})}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"Telegram"}),s.jsx(vt,{children:"Connect your device to Telegram so you can chat with the agent from your phone. Create a bot with @BotFather, then paste the token below."})]}),s.jsxs(st,{className:"space-y-4",children:[e&&s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"}),e.status==="connected"&&e.botUsername?s.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["Connected as @",e.botUsername]}):e.configured?s.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"Not connected"}):s.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]}),e.error&&s.jsx("p",{className:"text-destructive text-xs",children:e.error}),e.configured&&!e.botUsername&&!e.error&&s.jsx("p",{className:"text-muted-foreground text-xs",children:"Click Save or Reconnect to start the bot. Use “Anyone” under Who can DM if you want to receive messages."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",id:"telegram-enabled",checked:y,onChange:Y=>g(Y.target.checked),className:"h-4 w-4 rounded border-input"}),s.jsx("label",{htmlFor:"telegram-enabled",className:"text-sm font-medium",children:"Enable Telegram channel"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"telegram-token",className:"text-sm font-medium",children:"Bot token"}),s.jsx(kt,{id:"telegram-token",type:"password",placeholder:e?.configured?"(already set)":"123456789:ABC…",value:v,onChange:Y=>b(Y.target.value),autoComplete:"off",className:"font-mono text-sm"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a token from @BotFather in Telegram. Leave blank to keep the current token."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"telegram-dm-policy",className:"text-sm font-medium",children:"Who can DM the bot"}),s.jsxs("select",{id:"telegram-dm-policy",value:k,onChange:Y=>C(Y.target.value),className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[s.jsx("option",{value:"open",children:"Anyone"}),s.jsx("option",{value:"allowlist",children:"Only allowlist (set IDs below)"}),s.jsx("option",{value:"disabled",children:"Disabled"})]}),k==="disabled"&&s.jsx("p",{className:"text-muted-foreground text-xs",children:"Bot can still connect; it won’t reply to any DMs. Choose Anyone to chat from Telegram."})]}),k==="allowlist"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"telegram-allow-from",className:"text-sm font-medium",children:"Allowed user IDs (comma-separated)"}),s.jsx(kt,{id:"telegram-allow-from",value:N,onChange:Y=>j(Y.target.value),placeholder:"123456789, 987654321",className:"font-mono text-sm"})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx("label",{className:"text-sm font-medium",children:"AI for Telegram"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Provider and model used when you chat via Telegram. Leave empty to use a connected provider (OpenRouter or OpenAI if configured, otherwise app default)."}),s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{htmlFor:"telegram-provider",className:"text-xs text-muted-foreground",children:"Provider"}),s.jsxs("select",{id:"telegram-provider",value:R,onChange:Y=>{M(Y.target.value),L("")},className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[s.jsx("option",{value:"",children:"Use app default"}),(a?.aiProviders??[]).map(Y=>s.jsx("option",{value:Y.id,children:Y.label},Y.id))]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{htmlFor:"telegram-model",className:"text-xs text-muted-foreground",children:"Model"}),R==="ollama"||R==="openrouter"?s.jsxs("select",{id:"telegram-model",value:O,onChange:Y=>L(Y.target.value),disabled:B,className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[s.jsx("option",{value:"",children:"Use provider default"}),D.map(Y=>s.jsx("option",{value:Y.id,children:Y.name},Y.id))]}):s.jsx(kt,{id:"telegram-model",value:O,onChange:Y=>L(Y.target.value),placeholder:R?"e.g. gpt-4o-mini":"Set provider first",disabled:!R,className:"h-9 text-sm"})]})]}),R==="ollama"&&s.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:s.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support in Telegram, use a cloud provider."})})]}),h&&s.jsx("p",{className:"text-destructive text-sm",children:h}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(ue,{onClick:F,disabled:d,children:[s.jsx(zO,{className:"size-4"}),d?"Saving…":"Save"]}),e?.configured&&e.status!=="connected"&&s.jsx(ue,{variant:"outline",onClick:F,disabled:d,title:"Restart the bot with current settings",children:"Reconnect"})]})]})]}),s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"Discord"}),s.jsx(vt,{children:"Let the agent post to your Discord servers. Create an app at the Discord Developer Portal, add a bot, invite it to your server with Send Messages, then paste the bot token below."})]}),s.jsxs(st,{className:"space-y-4",children:[P&&s.jsx("div",{className:"space-y-1 text-sm",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"}),P.configured?s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Configured"}):s.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"discord-token",className:"text-sm font-medium",children:"Bot token"}),s.jsx(kt,{id:"discord-token",type:"password",placeholder:P?.configured?"(already set)":"Paste your bot token…",value:te,onChange:Y=>ce(Y.target.value),autoComplete:"off",className:"font-mono text-sm"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a token from the Discord Developer Portal (Bot section). Leave blank to keep the current token."})]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsxs("a",{href:sU,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Open Discord Developer Portal",s.jsx(Nm,{className:"size-3"})]})," ","→ create app, add bot, then OAuth2 → URL Generator (scope: bot, permissions: Send Messages) to invite the bot to your server."]}),h&&s.jsx("p",{className:"text-destructive text-sm",children:h}),s.jsx(ue,{onClick:J,disabled:ae,children:ae?"Saving…":"Save"})]})]})]})}const cU="https://dashboard.stripe.com/apikeys";function uU(){const[e,r]=S.useState(null),[a,l]=S.useState(""),[o,u]=S.useState(!1),[d,f]=S.useState(!0),[h,p]=S.useState(null),y=async()=>{f(!0),p(null);try{const v=await ww();r(v)}catch(v){p(v instanceof Error?v.message:String(v))}finally{f(!1)}};S.useEffect(()=>{y()},[]);const g=async()=>{u(!0),p(null);try{const v=await kw({secretKey:a.trim()||null});r(v),l("")}catch(v){p(v instanceof Error?v.message:String(v))}finally{u(!1)}};return d?s.jsx(it,{children:s.jsx(st,{className:"pt-6",children:s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading payment settings…"})})}):s.jsx("div",{className:"space-y-4",children:s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{className:"text-base",children:"Stripe"}),s.jsx(vt,{children:"Let the agent list customers and invoices, and create invoices. Paste your Stripe Secret Key (from Dashboard → API keys). Use test key (sk_test_…) for development."})]}),s.jsxs(st,{className:"space-y-4",children:[e&&s.jsx("div",{className:"space-y-1 text-sm",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"}),e.configured?s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Configured"}):s.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"stripe-secret-key",className:"text-sm font-medium",children:"Secret key"}),s.jsx(kt,{id:"stripe-secret-key",type:"password",placeholder:e?.configured?"(already set)":"sk_test_… or sk_live_…",value:a,onChange:v=>l(v.target.value),autoComplete:"off",className:"font-mono text-sm"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a key from Stripe Dashboard → Developers → API keys. Leave blank to keep the current key."})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:s.jsxs("a",{href:cU,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Open Stripe API keys",s.jsx(Nm,{className:"size-3"})]})}),h&&s.jsx("p",{className:"text-destructive text-sm",children:h}),s.jsx(ue,{onClick:g,disabled:o,children:o?"Saving…":"Save"})]})]})})}function dU(){const[e,r]=S.useState(null),[a,l]=S.useState("session"),[o,u]=S.useState(""),[d,f]=S.useState([]),[h,p]=S.useState(!0),[y,g]=S.useState(!1),[v,b]=S.useState(null);S.useEffect(()=>{b(null),rk().then(j=>{r(j),j.session.length>0?(l("session"),u(j.session[0])):j.shared.length>0&&(l("shared"),u(j.shared[0]))}).catch(j=>b(j instanceof Error?j.message:String(j))).finally(()=>p(!1))},[]);const k=a==="session"?e?.session??[]:e?.shared??[];S.useEffect(()=>{if(!o||!k.includes(o)){f([]);return}g(!0),ak({scope:a,scope_key:o,limit:200}).then(j=>f(j.entries??[])).catch(j=>b(j instanceof Error?j.message:String(j))).finally(()=>g(!1))},[a,o]);const C=()=>{const j=new Blob([JSON.stringify({scope:a,scope_key:o,exported_at:new Date().toISOString(),entries:d},null,2)],{type:"application/json"}),R=document.createElement("a");R.href=URL.createObjectURL(j),R.download=`sulala-memory-${a}-${o.replace(/[^a-z0-9-_]/gi,"_")}.json`,R.click(),URL.revokeObjectURL(R.href)},N=j=>new Date(j).toLocaleString();return h?s.jsx(it,{children:s.jsx(st,{className:"pt-6",children:s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading memory…"})})}):s.jsx("div",{className:"space-y-4",children:s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsxs(yt,{className:"flex items-center gap-2 text-base",children:[s.jsx(nw,{className:"size-4"}),"Agent memory"]}),s.jsx(vt,{children:"View stored memory (session-scoped or shared across sessions). Use the chat to add entries via the write_memory tool."})]}),s.jsxs(st,{className:"space-y-4",children:[v&&s.jsx("p",{className:"text-destructive text-sm",role:"alert",children:v}),s.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{htmlFor:"memory-scope",children:"Scope"}),s.jsxs("select",{id:"memory-scope",className:"flex h-9 w-[140px] rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:a,onChange:j=>{const R=j.target.value;l(R);const M=R==="session"?e?.session??[]:e?.shared??[];u(M[0]??"")},children:[s.jsx("option",{value:"session",children:"Session"}),s.jsx("option",{value:"shared",children:"Shared"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{htmlFor:"memory-scope-key",children:a==="session"?"Session":"Shared key"}),s.jsx("select",{id:"memory-scope-key",className:"flex h-9 min-w-[200px] max-w-[320px] rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:o,onChange:j=>u(j.target.value),children:k.length===0?s.jsx("option",{value:"",children:"— No keys —"}):k.map(j=>s.jsx("option",{value:j,children:j.length>40?j.slice(0,37)+"…":j},j))})]}),d.length>0&&s.jsxs(ue,{variant:"outline",size:"sm",onClick:C,children:[s.jsx(RM,{className:"size-4 mr-1"}),"Export JSON"]})]}),y&&s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading entries…"}),!y&&o&&k.includes(o)&&s.jsx("div",{className:"rounded-md border",children:d.length===0?s.jsxs("p",{className:"p-4 text-muted-foreground text-sm",children:["No memory entries for this ",a," key."]}):s.jsx("ul",{className:"divide-y divide-border max-h-[400px] overflow-y-auto",children:d.map(j=>s.jsxs("li",{className:"p-3 text-sm",children:[s.jsx("p",{className:"text-foreground",children:j.content}),s.jsx("p",{className:"mt-1 text-muted-foreground text-xs",children:N(j.created_at)})]},j.id))})})]})]})})}const xh="https://portal.sulala.ai/api/gateway";function fU({required:e=!1,portalGatewayUrl:r,onSaved:a,onError:l,portalOAuthConnectAvailable:o=!1,onOAuthConnect:u}){const[d,f]=S.useState({}),[h,p]=S.useState(r?.trim()||xh),[y,g]=S.useState(""),[v,b]=S.useState(!1),[k,C]=S.useState(!1),[N,j]=S.useState(!1);S.useEffect(()=>{p(r?.trim()||xh)},[r]),S.useEffect(()=>{b(!0),or().then(({keys:I})=>{f(I??{})}).catch(()=>f({})).finally(()=>b(!1))},[]);const R=async()=>{const I=h.trim();if(!I){l?.("Enter Portal gateway URL");return}if(e&&!y.trim()){l?.("Enter Portal API key");return}C(!0);try{const B={PORTAL_GATEWAY_URL:I};y.trim()&&(B.PORTAL_API_KEY=y.trim()),await Ns(B);const{keys:V}=await or();f(V??{}),y.trim()&&g(""),a?.()}catch(B){l?.(B instanceof Error?B.message:"Failed to save")}finally{C(!1)}},M=d.PORTAL_API_KEY==="set"?"(already set)":"sk_live_...",O=k||!h.trim()||e&&!y.trim(),L=o&&u,D=async()=>{j(!0),l?.("");try{await u?.()}catch(I){l?.(I.message)}finally{j(!1)}};return s.jsxs("div",{className:"border-border bg-muted/30 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:e?"Portal API key required":"Portal settings"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:e?"Create an API key at your Portal and enter it below. Takes effect immediately.":"Connect GitHub, Gmail, and other apps via Portal. Saved keys take effect immediately."}),v?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Loading…"}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(qt,{htmlFor:"portal-gateway-url",className:"text-xs",children:"Portal gateway URL"}),s.jsx(kt,{id:"portal-gateway-url",type:"url",placeholder:xh,value:h,onChange:I=>p(I.target.value),className:"h-8 font-mono text-xs"}),s.jsx("p",{className:"text-muted-foreground text-[10px]",children:"e.g. http://localhost:3004/api/gateway for local Portal, or https://portal.sulala.ai/api/gateway"})]}),L&&s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"default",size:"sm",onClick:D,disabled:N,className:"w-fit",children:N?"Opening…":"Connect with Sulala (OAuth)"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Opens in a new tab. After signing in you’ll be redirected back; refresh this page if the key doesn’t appear."}),s.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"or"})]}),s.jsxs("form",{className:"space-y-3",onSubmit:I=>{I.preventDefault(),R()},children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(qt,{htmlFor:"portal-api-key",className:"text-xs",children:"Portal API Key"}),s.jsx(kt,{id:"portal-api-key",type:"password",placeholder:M,value:y,onChange:I=>g(I.target.value),autoComplete:"off",className:"h-8"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ue,{type:"submit",variant:"secondary",size:"sm",disabled:O,children:k?"Saving…":"Save"}),s.jsx("a",{href:(()=>{const I=h.trim();if(!I)return"https://portal.sulala.ai/api/keys";try{const B=I.replace(/\/api\/gateway$/i,""),V=/^https?:\/\//i.test(B)?B:`https://${B}`;return new URL("/api-keys",V).toString()}catch{return"https://portal.sulala.ai/api/keys"}})(),target:"_blank",rel:"noreferrer",className:"text-primary hover:underline text-xs",children:"Create API key →"})]})]})]})]})}function hU({storeBaseUrl:e,onSaved:r,onError:a}){const[l,o]=S.useState({}),[u,d]=S.useState(""),[f,h]=S.useState(!1),[p,y]=S.useState(!1);S.useEffect(()=>{h(!0),or().then(({keys:k})=>o(k??{})).catch(()=>o({})).finally(()=>h(!1))},[]);const g=async()=>{y(!0);try{const k={};u.trim()&&(k.STORE_PUBLISH_API_KEY=u.trim()),await Ns(k);const{keys:C}=await or();o(C??{}),u.trim()&&d(""),r?.()}catch(k){a?.(k instanceof Error?k.message:"Failed to save")}finally{y(!1)}},v=l.STORE_PUBLISH_API_KEY==="set"?"(already set)":"sk_pub_...",b=e?`${e.replace(/\/$/,"")}/my-skills`:null;return s.jsxs("div",{className:"border-border bg-muted/30 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:"Store publish API key"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Publish skills from the dashboard (Skills → My skills → Publish to store). Create a key on the store (My skills → Create publish API key), then paste it here."}),f?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Loading…"}):s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:k=>{k.preventDefault(),g()},children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(qt,{htmlFor:"store-publish-api-key",className:"text-xs",children:"API key"}),s.jsx(kt,{id:"store-publish-api-key",type:"password",placeholder:v,value:u,onChange:k=>d(k.target.value),autoComplete:"off",className:"h-8"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ue,{type:"submit",variant:"secondary",size:"sm",disabled:p,children:p?"Saving…":"Save"}),b&&s.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline text-xs",children:"Create API key on store →"})]})]})]})}const mU=[{value:"overview",label:"Overview",icon:rO},{value:"tasks",label:"Tasks",icon:uO},{value:"logs",label:"Logs",icon:Em},{value:"files",label:"File states",icon:KM},{value:"ai-providers",label:"AI Providers",icon:rw},{value:"channels",label:"Channels",icon:ss},{value:"payment",label:"Payment",icon:_M},{value:"memory",label:"Memory",icon:nw},{value:"portal",label:"Portal",icon:oO},{value:"config",label:"Watched folders",icon:cw}];function pU(e){return s.jsx("div",{className:"flex flex-1 flex-col min-h-0",children:s.jsx(zm,{defaultValue:"overview",orientation:"vertical",className:"flex flex-1 flex-col min-h-0",children:s.jsxs("div",{className:"flex flex-1 min-h-0",children:[s.jsx(Lm,{variant:"line",className:"w-52 shrink-0 flex flex-col h-auto rounded-none p-2 gap-0.5",children:mU.map(({value:r,label:a,icon:l})=>s.jsxs(ql,{value:r,className:je("w-full justify-start gap-2 rounded-md px-3 py-2 h-auto font-normal","data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:font-medium"),children:[s.jsx(l,{className:"size-4 shrink-0"}),s.jsx("span",{className:"truncate",children:a})]},r))}),s.jsxs("div",{className:"flex-1 min-w-0 overflow-auto p-4",children:[s.jsx(nn,{value:"overview",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(B4,{health:e.health,loading:e.loading,connected:e.connected,events:e.events})}),s.jsx(nn,{value:"tasks",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(aU,{tasks:e.tasks,loading:e.loading,load:e.load,enqueueType:e.enqueueType,setEnqueueType:e.setEnqueueType,enqueuePayload:e.enqueuePayload,setEnqueuePayload:e.setEnqueuePayload,enqueueing:e.enqueueing,actionTaskId:e.actionTaskId,handleTaskCancel:e.handleTaskCancel,handleTaskRetry:e.handleTaskRetry,handleEnqueue:e.handleEnqueue})}),s.jsx(nn,{value:"logs",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(lU,{logs:e.logs,load:e.load})}),s.jsx(nn,{value:"files",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(iU,{fileStates:e.fileStates,load:e.load})}),s.jsx(nn,{value:"ai-providers",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(rU,{})}),s.jsx(nn,{value:"channels",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(oU,{})}),s.jsx(nn,{value:"payment",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(uU,{})}),s.jsx(nn,{value:"memory",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(dU,{})}),s.jsx(nn,{value:"portal",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(gU,{config:e.config,onError:e.onError})}),s.jsx(nn,{value:"config",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:s.jsx(tU,{config:e.config})})]})]})})})}function gU({config:e,onError:r}){const a=e?.portalGatewayUrl??null,l=e?.portalOAuthConnectAvailable===!0,o=async()=>{const{url:d}=await Mm();window.open(d,"_blank","noopener,noreferrer")},u=ai();return s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(fU,{portalGatewayUrl:a,onError:r,portalOAuthConnectAvailable:l,onOAuthConnect:l?o:void 0}),s.jsx(hU,{storeBaseUrl:u,onError:r})]})}const xU=100;function yU(e){const[r,a]=S.useState([]),[l,o]=S.useState(!1),u=S.useRef(null),d=S.useRef(e?.onSkillsChanged);return d.current=e?.onSkillsChanged,S.useEffect(()=>{const f=Ow(),h=new WebSocket(f);return h.onopen=()=>o(!0),h.onclose=()=>o(!1),h.onmessage=p=>{try{const y=JSON.parse(p.data);a(g=>[y,...g].slice(0,xU)),y.type==="skills_changed"&&d.current&&d.current()}catch{}},h.onerror=()=>{},u.current=h,()=>{h.close(),u.current=null,o(!1)}},[]),{events:r,connected:l}}function vU({className:e,checked:r,onCheckedChange:a,onChange:l,...o}){const u=r===!0;return s.jsx("input",{type:"checkbox",checked:u,onChange:d=>{l?.(d),a?.(d.target.checked)},"data-slot":"checkbox",className:je("border-input size-4 shrink-0 rounded border transition-colors","focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2","accent-primary disabled:opacity-50",e),...o})}const bU="modulepreload",SU=function(e){return"/"+e},r0={},wU=function(r,a,l){let o=Promise.resolve();if(a&&a.length>0){let p=function(y){return Promise.all(y.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};var d=p;document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");o=p(a.map(y=>{if(y=SU(y),y in r0)return;r0[y]=!0;const g=y.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${v}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":bU,g||(b.as="script"),b.crossOrigin="",b.href=y,h&&b.setAttribute("nonce",h),document.head.appendChild(b),g)return new Promise((k,C)=>{b.addEventListener("load",k),b.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${y}`)))})}))}function u(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return o.then(f=>{for(const h of f||[])h.status==="rejected"&&u(h.reason);return r().catch(u)})},pj=[{id:"openrouter",label:"OpenRouter",envKey:"OPENROUTER_API_KEY",apiKeyUrl:"https://openrouter.ai/keys"},{id:"ollama",label:"Ollama (Local – No API Key Required)",envKey:null,apiKeyUrl:null},{id:"openai",label:"OpenAI",envKey:"OPENAI_API_KEY",apiKeyUrl:"https://platform.openai.com/api-keys"},{id:"anthropic",label:"Anthropic (Claude)",envKey:"ANTHROPIC_API_KEY",apiKeyUrl:"https://console.anthropic.com/settings/keys"},{id:"google",label:"Google / Gemini",envKey:"GOOGLE_GEMINI_API_KEY",apiKeyUrl:"https://aistudio.google.com/app/apikey"}],kU={openai:"OPENAI_API_KEY",anthropic:"ANTHROPIC_API_KEY",google:"GOOGLE_GEMINI_API_KEY",gemini:"GEMINI_API_KEY",openrouter:"OPENROUTER_API_KEY"};function jU(e){const[r,a]=S.useState({statusLoading:!0,statusComplete:null,step:0,selectedProviders:[],envKeys:{},envKeysInput:{},recommendedModels:[],registrySkills:[],selectedSkills:[],ollamaRunning:null,ollamaStatusLoading:!1,pullState:{inProgress:!1,model:"",lastLine:"",percent:0},pullingModels:new Set,loading:!1,error:null,systemCapabilities:null}),l=S.useCallback(async()=>{a(O=>({...O,statusLoading:!0}));try{const{complete:O}=await _m();return a(L=>({...L,statusComplete:O,statusLoading:!1})),O}catch(O){return a(L=>({...L,statusComplete:!1,statusLoading:!1,error:O instanceof Error?O.message:"Failed to load status"})),!1}},[]),o=S.useCallback(async()=>{try{const{keys:O}=await or();return a(L=>({...L,envKeys:O})),O}catch{return{}}},[]),u=S.useCallback(async()=>{try{const{models:O}=await Nw();return a(L=>({...L,recommendedModels:O})),O}catch{return[]}},[]),d=S.useCallback(async()=>{try{const{skills:O}=await _c();return a(L=>({...L,registrySkills:O})),O}catch{return[]}},[]),f=S.useCallback(async()=>{a(O=>({...O,ollamaStatusLoading:!0}));try{const{running:O}=await Kl();return a(L=>({...L,ollamaRunning:O,ollamaStatusLoading:!1})),O}catch{return a(O=>({...O,ollamaRunning:!1,ollamaStatusLoading:!1})),!1}},[]),h=S.useCallback(async()=>{const{fetchOllamaPullStatus:O}=await wU(async()=>{const{fetchOllamaPullStatus:D}=await Promise.resolve().then(()=>z4);return{fetchOllamaPullStatus:D}},void 0),L=await O();return a(D=>({...D,pullState:L})),L},[]);S.useEffect(()=>{l()},[l]);const p=S.useCallback(async()=>{try{const O=await $w();return a(L=>({...L,systemCapabilities:O})),O}catch{return a(O=>({...O,systemCapabilities:null})),null}},[]);return S.useEffect(()=>{r.step===0&&p()},[r.step,p]),S.useEffect(()=>{(r.step===1||r.step===2)&&o()},[r.step,o]),S.useEffect(()=>{r.step===2&&r.selectedProviders.includes("ollama")&&(u(),f())},[r.step,r.selectedProviders,u,f]),S.useEffect(()=>{r.step===4&&d()},[r.step,d]),S.useEffect(()=>{if(!r.pullState.inProgress)return;const O=setInterval(h,500);return()=>clearInterval(O)},[r.pullState.inProgress,h]),{...r,loadStatus:l,loadSystemCapabilities:p,installOllama:async()=>{a(O=>({...O,error:null}));try{await Yw(),await f()}catch(O){a(L=>({...L,error:O instanceof Error?O.message:"Failed to install Ollama"}))}},loadEnv:o,loadRecommendedModels:u,loadRegistrySkills:d,checkOllama:f,setStep:O=>a(L=>({...L,step:O})),setSelectedProviders:O=>a(L=>({...L,selectedProviders:O})),setEnvKeysInput:O=>a(L=>({...L,envKeysInput:O})),setSelectedSkills:O=>a(L=>({...L,selectedSkills:O})),setError:O=>a(L=>({...L,error:O})),saveEnv:async(O,L)=>{a(D=>({...D,loading:!0,error:null}));try{const D=r.envKeysInput,I={...L};for(const[V,P]of Object.entries(D))typeof P=="string"&&P.trim()&&(I[V]=P.trim());await Ns(I);const{keys:B}=await or();a(V=>({...V,envKeys:B,envKeysInput:{},loading:!1,step:O??2}))}catch(D){a(I=>({...I,loading:!1,error:D instanceof Error?D.message:"Failed to save API keys"}))}},pullModel:async O=>{a(L=>({...L,pullingModels:new Set(L.pullingModels).add(O),error:null}));try{await Ew(O),h()}catch(L){a(D=>({...D,pullingModels:(()=>{const I=new Set(D.pullingModels);return I.delete(O),I})(),error:L instanceof Error?L.message:"Failed to pull model"}))}},installSkill:async O=>{a(L=>({...L,loading:!0,error:null}));try{await Dm(O,"managed"),a(L=>({...L,selectedSkills:[...new Set([...L.selectedSkills,O])],loading:!1}))}catch(L){a(D=>({...D,loading:!1,error:L instanceof Error?L.message:"Failed to install skill"}))}},finishOnboarding:async()=>{a(O=>({...O,loading:!0,error:null}));try{await Cw(),a(O=>({...O,statusComplete:!0,loading:!1})),e?.()}catch(O){a(L=>({...L,loading:!1,error:O instanceof Error?O.message:"Failed to complete onboarding"}))}}}}function CU(e){if(!e)return null;const r=e.match(/~?(\d+(?:\.\d+)?)\s*(GB|MB|gb|mb)/);if(!r)return null;const a=parseFloat(r[1]),l=r[2].toUpperCase();return l==="GB"?Math.round(a*1024*1024*1024):l==="MB"?Math.round(a*1024*1024):null}const gj=S.createContext(null);function Ms(){const e=S.useContext(gj);if(!e)throw new Error("OnboardingFlow must wrap steps");return e}const NU=["Choose AI Provider","Provider Configuration","Integrations","Ollama Model Setup","Finish"],EU=["Choose AI Provider","Provider Configuration","Integrations","Finish"];function AU(){const{selectedProviders:e,setSelectedProviders:r,setStep:a,systemCapabilities:l}=Ms(),o=l&&!l.ollamaSuitable,u=f=>{if(f==="ollama"&&o)return;const h=e.includes(f)?e.filter(p=>p!==f):[...e,f];r(h)},d=e.length>=1;return s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"Select at least one AI provider to continue. Ollama runs locally and needs no API key."}),o&&l&&s.jsxs("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:[s.jsxs("p",{className:"text-amber-700 dark:text-amber-400",children:["⚠️ ",l.ollamaSuitableReason]}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Use a cloud provider (OpenAI, OpenRouter, etc.) instead."})]}),e.includes("ollama")&&s.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:s.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support and best results, add a cloud provider."})}),s.jsx("div",{className:"grid gap-3",children:pj.map(f=>s.jsxs("label",{className:`border-input flex items-center gap-3 rounded-lg border p-4 transition-colors ${f.id==="ollama"&&o?"cursor-not-allowed opacity-60":"hover:bg-muted/50 cursor-pointer"}`,children:[s.jsx(vU,{checked:e.includes(f.id),onCheckedChange:()=>u(f.id),disabled:f.id==="ollama"&&!!o}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-medium",children:f.label}),f.id==="ollama"&&o&&s.jsx("div",{className:"text-amber-600 dark:text-amber-400 mt-0.5 text-xs",children:"Not available on this system"}),f.envKey&&s.jsxs("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-2 text-xs",children:[s.jsx("span",{children:"Requires API key"}),"apiKeyUrl"in f&&typeof f.apiKeyUrl=="string"&&s.jsx("a",{href:f.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get API key →"})]})]})]},f.id))}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("div",{}),s.jsxs(ue,{disabled:!d,onClick:()=>a(1),children:["Next",s.jsx(zr,{className:"ml-1 size-4"})]})]})]})}function _U(){const{selectedProviders:e,envKeys:r,envKeysInput:a,setEnvKeysInput:l,saveEnv:o,setStep:u,loading:d,error:f}=Ms(),h=e.filter(C=>C!=="ollama"),p={OPENAI_API_KEY:"OpenAI API Key",ANTHROPIC_API_KEY:"Anthropic API Key",GOOGLE_GEMINI_API_KEY:"Google Gemini API Key",GEMINI_API_KEY:"Gemini API Key (alt)",OPENROUTER_API_KEY:"OpenRouter API Key"},y={};pj.forEach(C=>{C.envKey&&"apiKeyUrl"in C&&typeof C.apiKeyUrl=="string"&&(y[C.envKey]=C.apiKeyUrl)});const g=h.flatMap(C=>{const N=kU[C];return N?[N]:[]}),b=!g.some(C=>r[C]!=="set")||g.length===0,k=g.some(C=>(a[C]??"").trim().length>0);return s.jsxs("div",{className:"space-y-6",children:[h.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No cloud providers selected. Skipping API keys."}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Enter API keys for selected providers. Keys are saved securely to ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"~/.sulala/.env"}),"."]}),s.jsx("div",{className:"grid gap-4",children:g.map(C=>s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[s.jsx(qt,{htmlFor:C,children:p[C]??C}),y[C]&&s.jsx("a",{href:y[C],target:"_blank",rel:"noopener noreferrer",className:"text-primary text-xs hover:underline",children:"Get API key →"})]}),s.jsx(kt,{id:C,type:"password",placeholder:r[C]==="set"?"(already set)":"sk-...",value:a[C]??"",onChange:N=>l({...a,[C]:N.target.value}),autoComplete:"off"})]},C))})]}),f&&s.jsx("div",{className:"text-destructive text-sm",children:f}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx(ue,{variant:"outline",onClick:()=>u(0),children:"Back"}),s.jsxs("div",{className:"flex gap-2",children:[(b||k)&&s.jsx(ue,{variant:"outline",onClick:()=>u(2),children:h.length===0?"Next":"Skip for now"}),k&&s.jsx(ue,{onClick:()=>o(2),disabled:d,children:d?"Saving…":"Save & Next"}),b&&!k&&h.length>0&&s.jsx(ue,{onClick:()=>u(2),children:"Next"})]})]})]})}function TU(){const{setStep:e,selectedProviders:r}=Ms(),l=r.includes("ollama")?4:3;return s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"You can connect apps (GitHub, Gmail, Twitter, etc.) in two ways:"}),s.jsxs("ul",{className:"text-muted-foreground list-disc list-inside space-y-1 text-sm",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"MCP Servers"})," — Integrations → MCP Servers tab. Add servers and API keys (e.g. YouTube, Twitter). Find more at"," ",s.jsx("a",{href:"https://mcpservers.org/",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:no-underline",children:"mcpservers.org"}),"."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Sulala Portal"})," — To use Portal for OAuth apps, add your API key later in ",s.jsx("strong",{children:"Settings → Portal"}),"."]})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Neither is required now. You can set up either option anytime from the dashboard."}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsx(ue,{variant:"outline",onClick:()=>e(1),children:"Back"}),s.jsxs(ue,{onClick:()=>e(l),children:["Next",s.jsx(zr,{className:"ml-1 size-4"})]})]})]})}function RU({m:e,installed:r,pulling:a,onPull:l}){return s.jsxs("div",{className:"border-input flex flex-col gap-2 rounded-lg border p-4 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:e.name}),s.jsx("div",{className:"text-muted-foreground text-sm",children:e.description}),s.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-xs",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(aw,{className:"size-3"})," ",e.size]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(r4,{className:"size-3"})," ",e.ram," RAM"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(rw,{className:"size-3"})," ",e.cpu]}),e.gpu!=="None"&&s.jsxs("span",{children:["GPU: ",e.gpu]})]})]}),s.jsx(ue,{variant:r?"secondary":"default",size:"sm",onClick:l,disabled:r||a,children:r?"Installed":a?"Installing…":"Install"})]})}function MU(){const{recommendedModels:e,ollamaRunning:r,ollamaStatusLoading:a,pullState:l,pullingModels:o,pullModel:u,installOllama:d,setStep:f,checkOllama:h,systemCapabilities:p,error:y}=Ms(),g=()=>{window.confirm("Ollama will be downloaded and installed (~500MB). This requires network access and sufficient disk space. Continue?")&&d()},v=C=>{const N=p?.storageFreeBytes??0,j=CU(C.size);if(j!=null&&N>0&&j>N){alert(`Insufficient storage. This model needs ~${C.size}. You have ${(N/1024/1024/1024).toFixed(1)}GB free.`);return}window.confirm(`Download and install ${C.name}? This will use ~${C.size} of disk space. Continue?`)&&u(C.id)},b=new Set;l.inProgress&&l.model&&b.add(l.model);const k=p&&!p.ollamaSuitable;return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:s.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support and best results, use a cloud provider."})}),k&&s.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:s.jsxs("p",{className:"text-amber-700 dark:text-amber-400",children:["⚠️ ",p.ollamaSuitableReason," Ollama may not run well here."]})}),a?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Checking Ollama…"}):r===!1?s.jsxs("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-4",children:[s.jsxs("p",{className:"text-amber-700 dark:text-amber-400 text-sm",children:["⚠️ Ollama is not running. Click Install to download Ollama, or install from"," ",s.jsx("a",{href:"https://ollama.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"ollama.com"})," ","and run ",s.jsx("code",{children:"ollama serve"}),"."]}),s.jsxs("div",{className:"mt-2 flex gap-2",children:[s.jsx(ue,{variant:"default",size:"sm",onClick:g,disabled:a,children:"Install Ollama"}),s.jsx(ue,{variant:"outline",size:"sm",onClick:h,disabled:a,children:"Check again"})]})]}):null,l.inProgress&&s.jsxs("div",{className:"rounded-lg border border-blue-500/50 bg-blue-500/10 p-4",children:[s.jsxs("div",{className:"font-medium",children:["Pulling ",l.model,"…"]}),l.percent>=0&&l.percent<=100&&s.jsx(Bm,{value:l.percent,className:"mt-2 h-2"}),l.lastLine&&s.jsx("div",{className:"text-muted-foreground mt-1 truncate font-mono text-xs",children:l.lastLine})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Select models to install. You can skip and install later from Settings."}),s.jsx("div",{className:"grid gap-3",children:e.map(C=>s.jsx(RU,{m:C,installed:!1,pulling:o.has(C.id),onPull:()=>v(C)},C.id))}),y&&s.jsx("div",{className:"text-destructive text-sm",children:y}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx(ue,{variant:"outline",onClick:()=>f(2),children:"Back"}),s.jsx(ue,{onClick:()=>f(4),children:"Skip or Next"})]})]})}function a0(){const{selectedProviders:e,finishOnboarding:r,loading:a,error:l,setStep:o}=Ms(),u=e.includes("ollama");return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold",children:"Summary"}),s.jsx("ul",{className:"text-muted-foreground mt-2 space-y-1 text-sm",children:s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Ah,{className:"size-4 text-green-600"}),"AI providers: ",e.join(", ")||"None"]})})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Click Finish to complete onboarding and open the dashboard. You can change providers anytime in Settings."}),l&&s.jsx("div",{className:"text-destructive text-sm",children:l}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx(ue,{variant:"outline",onClick:()=>o(u?3:2),children:"Back"}),s.jsx(ue,{onClick:r,disabled:a,children:a?"Finishing…":"Finish"})]})]})}function OU({onComplete:e}){const r=jU(e),{step:a,selectedProviders:l}=r,o=l.includes("ollama"),u=o?5:4,d=o?NU:EU,f=Math.max(0,Math.min(a,u-1)),h={0:"Choose which AI providers you want to use.",1:"Enter API keys for cloud providers.",2:"Connect apps via MCP servers or Sulala Portal (optional). Add Portal API key in Settings → Portal if you use Portal.",...o?{3:"Install local models with Ollama.",4:"Review and complete setup."}:{3:"Review and complete setup."}};return s.jsx(gj.Provider,{value:r,children:s.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-2xl space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Welcome to Sulala"}),s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Step ",f+1," of ",u,": ",d[f]]}),s.jsx(Bm,{value:(f+1)/u*100,className:"mt-4 h-2"})]}),s.jsxs(it,{children:[s.jsxs(xt,{children:[s.jsx(yt,{children:d[f]}),s.jsx(vt,{children:h[f]})]}),s.jsxs(st,{children:[f===0&&s.jsx(AU,{}),f===1&&s.jsx(_U,{}),f===2&&s.jsx(TU,{}),f===3&&(o?s.jsx(MU,{}):s.jsx(a0,{})),f===4&&o&&s.jsx(a0,{})]})]})]})})})}function DU(){const[e,r]=S.useState(null),[a,l]=S.useState(()=>{if(typeof window>"u")return"chat";const j=new URLSearchParams(window.location.search).get("page");return["chat","skills","integrations","jobs","settings","overview","tasks","logs","files","config"].includes(j)?j:"chat"}),[o,u]=S.useState(null);S.useEffect(()=>{console.log("fetching onboarding status"),_m().then(({complete:j})=>{console.log("onboarding status",j),r(j)}).catch(j=>{console.error("error fetching onboarding status",j);const R=j.message||String(j);r(!!(R.includes("429")||R.includes("fetch")))})},[]);const[d,f]=S.useState(null),h=L4(j=>u(j)),p=H4(j=>u(j)),y=cD(a,j=>u(j),{onMissingIntegrations:j=>f(j)}),g=GP(a,j=>u(j)),v=nU(a);S.useEffect(()=>{(a==="settings"||a==="jobs")&&h.load()},[a]);const b=S.useRef(()=>{});b.current=p.loadSkills;const{events:k,connected:C}=yU({onSkillsChanged:()=>b.current?.()});if(S.useEffect(()=>{a==="skills"&&p.loadSkillsData()},[a]),e===null)return s.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center",children:s.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading…"})});if(!e)return s.jsx(zU,{onComplete:()=>{window.location.reload()}});const N=j=>{if(l(j),typeof window<"u"){const R=new URL(window.location.href);R.searchParams.set("page",j),window.history.replaceState({},"",R.toString())}};return s.jsxs(O4,{activePage:a,onNavigate:N,error:o,children:[a==="chat"&&s.jsx(FP,{...y,integrations:g.integrations,onNavigateToIntegrations:()=>N("integrations"),missingIntegrationsFromServer:d,onClearMissingIntegrationsFromServer:()=>f(null)}),a==="skills"&&s.jsx(eD,{...p}),a==="integrations"&&s.jsx(QP,{...g,onError:j=>u(j)}),a==="jobs"&&s.jsx(eU,{schedules:h.schedules,loading:h.loading,load:h.load,onCreateSchedule:h.handleCreateSchedule,onUpdateSchedule:h.handleUpdateSchedule,onDeleteSchedule:h.handleDeleteSchedule,onRunSchedule:h.handleRunSchedule,onFetchScheduleRuns:h.handleFetchScheduleRuns,onNavigateToSettings:()=>N("settings")}),a==="settings"&&s.jsx(pU,{health:h.health,loading:h.loading,connected:C,events:k,tasks:h.tasks,load:h.load,enqueueType:h.enqueueType,setEnqueueType:h.setEnqueueType,enqueuePayload:h.enqueuePayload,setEnqueuePayload:h.setEnqueuePayload,enqueueing:h.enqueueing,actionTaskId:h.actionTaskId,handleTaskCancel:h.handleTaskCancel,handleTaskRetry:h.handleTaskRetry,handleEnqueue:h.handleEnqueue,logs:h.logs,fileStates:h.fileStates,config:v,onError:j=>u(j)})]})}function zU({onComplete:e}){return s.jsx(OU,{onComplete:e})}BC.createRoot(document.getElementById("root")).render(s.jsx(S.StrictMode,{children:s.jsx(DU,{})}));