scream-code 0.19.0 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,455 +0,0 @@
1
- var F3=Object.defineProperty;var wR=e=>{throw TypeError(e)};var q3=(e,t,s)=>t in e?F3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ge=(e,t,s)=>q3(e,typeof t!="symbol"?t+"":t,s),Fy=(e,t,s)=>t.has(e)||wR("Cannot "+s);var G=(e,t,s)=>(Fy(e,t,"read from private field"),s?s.call(e):t.get(e)),Fe=(e,t,s)=>t.has(e)?wR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Ce=(e,t,s,i)=>(Fy(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),tt=(e,t,s)=>(Fy(e,t,"access private method"),s);var ah=(e,t,s,i)=>({set _(o){Ce(e,t,o,s)},get _(){return G(e,t,i)}});function H3(e,t){for(var s=0;s<t.length;s++){const i=t[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(i,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function G3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qy={exports:{}},bu={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var SR;function K3(){if(SR)return bu;SR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return bu.Fragment=t,bu.jsx=s,bu.jsxs=s,bu}var TR;function Y3(){return TR||(TR=1,qy.exports=K3()),qy.exports}var v=Y3(),Hy={exports:{}},Qe={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var RR;function $3(){if(RR)return Qe;RR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),w=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=w&&P[w]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,A={};function C(P,K,L){this.props=P,this.context=K,this.refs=A,this.updater=L||S}C.prototype.isReactComponent={},C.prototype.setState=function(P,K){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,K,"setState")},C.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function k(){}k.prototype=C.prototype;function M(P,K,L){this.props=P,this.context=K,this.refs=A,this.updater=L||S}var D=M.prototype=new k;D.constructor=M,T(D,C.prototype),D.isPureReactComponent=!0;var _=Array.isArray;function N(){}var O={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function I(P,K,L){var H=L.ref;return{$$typeof:e,type:P,key:K,ref:H!==void 0?H:null,props:L}}function V(P,K){return I(P.type,K,P.props)}function $(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function X(P){var K={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(L){return K[L]})}var B=/\/+/g;function q(P,K){return typeof P=="object"&&P!==null&&P.key!=null?X(""+P.key):K.toString(36)}function F(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(N,N):(P.status="pending",P.then(function(K){P.status==="pending"&&(P.status="fulfilled",P.value=K)},function(K){P.status==="pending"&&(P.status="rejected",P.reason=K)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function ie(P,K,L,H,fe){var oe=typeof P;(oe==="undefined"||oe==="boolean")&&(P=null);var ye=!1;if(P===null)ye=!0;else switch(oe){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(P.$$typeof){case e:case t:ye=!0;break;case p:return ye=P._init,ie(ye(P._payload),K,L,H,fe)}}if(ye)return fe=fe(P),ye=H===""?"."+q(P,0):H,_(fe)?(L="",ye!=null&&(L=ye.replace(B,"$&/")+"/"),ie(fe,K,L,"",function(ze){return ze})):fe!=null&&($(fe)&&(fe=V(fe,L+(fe.key==null||P&&P.key===fe.key?"":(""+fe.key).replace(B,"$&/")+"/")+ye)),K.push(fe)),1;ye=0;var ce=H===""?".":H+":";if(_(P))for(var me=0;me<P.length;me++)H=P[me],oe=ce+q(H,me),ye+=ie(H,K,L,oe,fe);else if(me=x(P),typeof me=="function")for(P=me.call(P),me=0;!(H=P.next()).done;)H=H.value,oe=ce+q(H,me++),ye+=ie(H,K,L,oe,fe);else if(oe==="object"){if(typeof P.then=="function")return ie(F(P),K,L,H,fe);throw K=String(P),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return ye}function Q(P,K,L){if(P==null)return P;var H=[],fe=0;return ie(P,H,"","",function(oe){return K.call(L,oe,fe++)}),H}function ae(P){if(P._status===-1){var K=P._result,L=K();L.then(function(H){(P._status===0||P._status===-1)&&(P._status=1,P._result=H,L.status===void 0&&(L.status="fulfilled",L.value=H))},function(H){(P._status===0||P._status===-1)&&(P._status=2,P._result=H,L.status===void 0&&(L.status="rejected",L.reason=H))}),P._status===-1&&(P._status=0,P._result=L)}if(P._status===1)return P._result.default;throw P._result}var ne=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)};function pe(P){var K=O.T,L={};L.types=K!==null?K.types:null,O.T=L;try{var H=P(),fe=O.S;fe!==null&&fe(L,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(N,ne)}catch(oe){ne(oe)}finally{K!==null&&L.types!==null&&(K.types=L.types),O.T=K}}function ee(P){var K=O.T;if(K!==null){var L=K.types;L===null?K.types=[P]:L.indexOf(P)===-1&&L.push(P)}else pe(ee.bind(null,P))}var ve={map:Q,forEach:function(P,K,L){Q(P,function(){K.apply(this,arguments)},L)},count:function(P){var K=0;return Q(P,function(){K++}),K},toArray:function(P){return Q(P,function(K){return K})||[]},only:function(P){if(!$(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Qe.Activity=g,Qe.Children=ve,Qe.Component=C,Qe.Fragment=s,Qe.Profiler=o,Qe.PureComponent=M,Qe.StrictMode=i,Qe.Suspense=f,Qe.ViewTransition=b,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(P){return O.H.useMemoCache(P)}},Qe.addTransitionType=ee,Qe.cache=function(P){return function(){return P.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(P,K,L){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var H=T({},P.props),fe=P.key;if(K!=null)for(oe in K.key!==void 0&&(fe=""+K.key),K)!z.call(K,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&K.ref===void 0||(H[oe]=K[oe]);var oe=arguments.length-2;if(oe===1)H.children=L;else if(1<oe){for(var ye=Array(oe),ce=0;ce<oe;ce++)ye[ce]=arguments[ce+2];H.children=ye}return I(P.type,fe,H)},Qe.createContext=function(P){return P={$$typeof:u,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:l,_context:P},P},Qe.createElement=function(P,K,L){var H,fe={},oe=null;if(K!=null)for(H in K.key!==void 0&&(oe=""+K.key),K)z.call(K,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&(fe[H]=K[H]);var ye=arguments.length-2;if(ye===1)fe.children=L;else if(1<ye){for(var ce=Array(ye),me=0;me<ye;me++)ce[me]=arguments[me+2];fe.children=ce}if(P&&P.defaultProps)for(H in ye=P.defaultProps,ye)fe[H]===void 0&&(fe[H]=ye[H]);return I(P,oe,fe)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(P){return{$$typeof:d,render:P}},Qe.isValidElement=$,Qe.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:ae}},Qe.memo=function(P,K){return{$$typeof:h,type:P,compare:K===void 0?null:K}},Qe.startTransition=pe,Qe.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Qe.use=function(P){return O.H.use(P)},Qe.useActionState=function(P,K,L){return O.H.useActionState(P,K,L)},Qe.useCallback=function(P,K){return O.H.useCallback(P,K)},Qe.useContext=function(P){return O.H.useContext(P)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(P,K){return O.H.useDeferredValue(P,K)},Qe.useEffect=function(P,K){return O.H.useEffect(P,K)},Qe.useEffectEvent=function(P){return O.H.useEffectEvent(P)},Qe.useId=function(){return O.H.useId()},Qe.useImperativeHandle=function(P,K,L){return O.H.useImperativeHandle(P,K,L)},Qe.useInsertionEffect=function(P,K){return O.H.useInsertionEffect(P,K)},Qe.useLayoutEffect=function(P,K){return O.H.useLayoutEffect(P,K)},Qe.useMemo=function(P,K){return O.H.useMemo(P,K)},Qe.useOptimistic=function(P,K){return O.H.useOptimistic(P,K)},Qe.useReducer=function(P,K,L){return O.H.useReducer(P,K,L)},Qe.useRef=function(P){return O.H.useRef(P)},Qe.useState=function(P){return O.H.useState(P)},Qe.useSyncExternalStore=function(P,K,L){return O.H.useSyncExternalStore(P,K,L)},Qe.useTransition=function(){return O.H.useTransition()},Qe.version="19.3.1",Qe}var ER;function wd(){return ER||(ER=1,Hy.exports=$3()),Hy.exports}var E=wd();const Sd=G3(E),Q3=H3({__proto__:null,default:Sd},[E]),x2=E.createContext(void 0),Us=e=>{const t=E.useContext(x2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},X3=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(x2.Provider,{value:e,children:t})),Z3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var io,Xb,l2,W3=(l2=class{constructor(){Fe(this,io,Z3);Fe(this,Xb,!1)}setTimeoutProvider(e){Ce(this,io,e)}setTimeout(e,t){return G(this,io).setTimeout(e,t)}clearTimeout(e){G(this,io).clearTimeout(e)}setInterval(e,t){return G(this,io).setInterval(e,t)}clearInterval(e){G(this,io).clearInterval(e)}},io=new WeakMap,Xb=new WeakMap,l2);const ca=new W3;function J3(e){setTimeout(e,0)}const eI=typeof window>"u"||"Deno"in globalThis;function Yn(){}function tI(e,t){return typeof e=="function"?e(t):e}function w2(e){return typeof e=="number"&&e>=0&&e!==1/0}function S2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qt(e,t){return typeof e=="function"?e(t):e}function CR(e,t){const{type:s="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(t.queryHash!==Zb(u,t.options))return!1}else if(!hc(t.queryKey,u))return!1}if(s!=="all"){const f=t.isActive();if(s==="active"&&!f||s==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||l&&!l(t))}function AR(e,t){const{exact:s,status:i,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(s){if(Ca(t.options.mutationKey)!==Ca(l))return!1}else if(!hc(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||o&&!o(t))}function Zb(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ca)(e)}function Ca(e){return JSON.stringify(e,(t,s)=>Bv(s)?Object.keys(s).sort().reduce((i,o)=>(i[o]=s[o],i),{}):s)}function hc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let i=0;i<t.length;i++)if(!hc(e[i],t[i]))return!1;return!0}const s=Object.keys(t);for(const i of s)if(!hc(e[i],t[i]))return!1;return!0}return!1}const nI=Object.prototype.hasOwnProperty;function T2(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=kR(e)&&kR(t);if(!i&&!(Bv(e)&&Bv(t)))return t;const o=(i?e:Object.keys(e)).length,l=i?t:Object.keys(t),u=l.length,d=i?new Array(u):{};let f=0;for(let h=0;h<u;h++){const p=i?h:l[h],g=e[p],b=t[p];if(g===b){d[p]=g,(i?h<o:nI.call(e,p))&&f++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){d[p]=b;continue}const w=T2(g,b,s+1);d[p]=w,w===g&&f++}return o===u&&f===o?e:d}function Ph(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function kR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bv(e){if(!MR(e))return!1;const t=Object.getPrototypeOf(e),s=t==null?void 0:t.constructor;if(s===void 0)return!0;if(typeof s!="function")return!1;const i=s.prototype;return!(!MR(i)||!i.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function MR(e){return Object.prototype.toString.call(e)==="[object Object]"}function sI(e){return new Promise(t=>{ca.setTimeout(t,e)})}function Uv(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?T2(e,t):t}function iI(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function rI(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}const Wb=Symbol();function R2(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Wb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Jb(e,t){return typeof e=="function"?e(...t):!!e}function oI(e,t,s){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),i||(i=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),e}let aI=()=>eI;const ex=()=>aI();var wc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ha,ro,ec,c2,lI=(c2=class extends wc{constructor(){super();Fe(this,ha);Fe(this,ro);Fe(this,ec);Ce(this,ec,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){G(this,ro)||this.setEventListener(G(this,ec))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,ro))==null||t.call(this),Ce(this,ro,void 0))}setEventListener(t){var s;Ce(this,ec,t),(s=G(this,ro))==null||s.call(this),Ce(this,ro,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){G(this,ha)!==t&&(Ce(this,ha,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof G(this,ha)=="boolean"?G(this,ha):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ha=new WeakMap,ro=new WeakMap,ec=new WeakMap,c2);const tx=new lI,cI=J3;function uI(){let e=[],t=0,s=d=>{d()},i=d=>{d()},o=cI;const l=d=>{t?e.push(d):o(()=>{s(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(f=>{s(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||u()}return f},batchCalls:d=>(...f)=>{l(()=>{d(...f)})},schedule:l,setNotifyFunction:d=>{s=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}const mn=uI();var tc,oo,nc,u2,dI=(u2=class extends wc{constructor(){super();Fe(this,tc,!0);Fe(this,oo);Fe(this,nc);Ce(this,nc,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){G(this,oo)||this.setEventListener(G(this,nc))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,oo))==null||t.call(this),Ce(this,oo,void 0))}setEventListener(t){var s;Ce(this,nc,t),(s=G(this,oo))==null||s.call(this),Ce(this,oo,t(this.setOnline.bind(this)))}setOnline(t){G(this,tc)!==t&&(Ce(this,tc,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return G(this,tc)}},tc=new WeakMap,oo=new WeakMap,nc=new WeakMap,u2);const Jh=new dI;function fI(e){return Math.min(1e3*2**e,3e4)}function E2(e){return(e??"online")==="online"?Jh.isOnline():!0}var Vv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function C2(e){let t=!1,s=0,i,o="pending",l,u;const d=new Promise((C,k)=>{l=C,u=k});d.catch(Yn);const f=()=>o!=="pending",h=C=>{var k;if(!f()){const M=new Vv(C);S(M),(k=e.onCancel)==null||k.call(e,M)}},p=()=>{t=!0},g=()=>{t=!1},b=()=>tx.isFocused()&&(e.networkMode==="always"||Jh.isOnline())&&e.canRun(),w=()=>E2(e.networkMode)&&e.canRun(),x=C=>{f()||(i==null||i(),o="resolved",l(C))},S=C=>{f()||(i==null||i(),o="rejected",u(C))},T=C=>new Promise(k=>{var M;i=D=>{(f()||C())&&k(D)},(M=e.onPause)==null||M.call(e)}).then(()=>{var k;i=void 0,f()||(k=e.onContinue)==null||k.call(e)}),A=()=>{if(f())return;let C;const k=s===0?e.initialPromise:void 0;try{C=k??e.fn()}catch(M){C=Promise.reject(M)}Promise.resolve(C).then(x).catch(M=>{var z;if(f())return;const D=e.retry??(ex()?0:3),_=e.retryDelay??fI,N=typeof _=="function"?_(s,M):_,O=D===!0||typeof D=="number"&&s<D||typeof D=="function"&&D(s,M);if(t||!O){S(M);return}s++,(z=e.onFail)==null||z.call(e,s,M),sI(N).then(()=>b()?void 0:T(b)).then(()=>{t?S(M):A()})})};return{promise:d,status:()=>o,cancel:h,continue:()=>(i==null||i(),d),cancelRetry:p,continueRetry:g,canStart:w,start:()=>(w()?A():T(w).then(A),d)}}var ma,d2,A2=(d2=class{constructor(){Fe(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w2(this.gcTime)&&Ce(this,ma,ca.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ex()?1/0:3e5))}clearGcTimeout(){G(this,ma)!==void 0&&(ca.clearTimeout(G(this,ma)),Ce(this,ma,void 0))}},ma=new WeakMap,d2);function hI(e){return{onFetch:(t,s)=>{var p,g,b,w,x;const i=t.options,o=(b=(g=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,l=((w=t.state.data)==null?void 0:w.pages)||[],u=((x=t.state.data)==null?void 0:x.pageParams)||[];let d={pages:[],pageParams:[]},f=0;const h=async()=>{let S=!1;const T=k=>{oI(k,()=>t.signal,()=>S=!0)},A=R2(t.options,t.fetchOptions),C=async(k,M,D)=>{if(S)return Promise.reject(t.signal.reason);if(M==null&&k.pages.length)return Promise.resolve(k);const N=(()=>{const V={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return T(V),V})(),O=await A(N),{maxPages:z}=t.options,I=D?rI:iI;return{pages:I(k.pages,O,z),pageParams:I(k.pageParams,M,z)}};if(o&&l.length){const k=o==="backward",M=k?mI:NR,D={pages:l,pageParams:u};d=await C(D,M(i,D),k)}else{const k=e??l.length;do{const M=f===0?u[0]===void 0?i.initialPageParam:u[0]:NR(i,d);if(f>0&&M==null)break;d=await C(d,M),f++}while(f<k)}return d};t.options.persister?t.fetchFn=()=>{var S,T;return(T=(S=t.options).persister)==null?void 0:T.call(S,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=h}}}function NR(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function mI(e,{pages:t,pageParams:s}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,s[0],s):void 0}var sc,pa,ic,Is,ga,cn,pd,ya,ei,or,f2,pI=(f2=class extends A2{constructor(t){super();Fe(this,ei);Fe(this,sc);Fe(this,pa);Fe(this,ic);Fe(this,Is);Fe(this,ga);Fe(this,cn);Fe(this,pd);Fe(this,ya);Ce(this,ya,!1),Ce(this,pd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,ga,t.client),Ce(this,Is,G(this,ga).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,pa,jR(this.options)),this.state=t.state??G(this,pa),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return G(this,sc)}get promise(){var t;return(t=G(this,cn))==null?void 0:t.promise}setOptions(t){if(this.options={...G(this,pd),...t},t!=null&&t._type&&Ce(this,sc,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=jR(this.options);s.data!==void 0&&(this.setState(OR(s.data,s.dataUpdatedAt)),Ce(this,pa,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,Is).remove(this)}setData(t,s){const i=Uv(this.state.data,t,this.options);return tt(this,ei,or).call(this,{data:i,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),i}setState(t){tt(this,ei,or).call(this,{type:"setState",state:t})}cancel(t){var i,o;const s=(i=G(this,cn))==null?void 0:i.promise;return(o=G(this,cn))==null||o.cancel(t),s?s.then(Yn).catch(Yn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return G(this,pa)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>qt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!S2(this.state.dataUpdatedAt,t)}onFocus(){var t,s;(t=this.observers.find(i=>i.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(s=G(this,cn))==null||s.continue()}onOnline(){var t,s;(t=this.observers.find(i=>i.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(s=G(this,cn))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),G(this,Is).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const s=this.observers.indexOf(t);s!==-1&&(this.observers.splice(s,1),this.observers.length||(G(this,cn)&&(G(this,ya)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?G(this,cn).cancel({revert:!0}):G(this,cn).cancelRetry()),this.scheduleGc()),G(this,Is).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||tt(this,ei,or).call(this,{type:"invalidate"})}async fetch(t,s){var h,p,g,b,w,x,S,T,A,C,k,M;if(this.state.fetchStatus!=="idle"&&((h=G(this,cn))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(G(this,cn))return G(this,cn).continueRetry(),G(this,cn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const D=this.observers.find(_=>_.options.queryFn);D&&this.setOptions(D.options)}const i=new AbortController,o=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>(Ce(this,ya,!0),i.signal)})},l=()=>{const D=R2(this.options,s),N=(()=>{const O={client:G(this,ga),queryKey:this.queryKey,meta:this.meta};return o(O),O})();return Ce(this,ya,!1),this.options.persister?this.options.persister(D,N,this):D(N)},d=(()=>{const D={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:G(this,ga),state:this.state,fetchFn:l};return o(D),D})();(p=G(this,sc)==="infinite"?hI(this.options.pages):this.options.behavior)==null||p.onFetch(d,this),Ce(this,ic,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=d.fetchOptions)==null?void 0:g.meta))&&tt(this,ei,or).call(this,{type:"fetch",meta:(b=d.fetchOptions)==null?void 0:b.meta});const f=Ce(this,cn,C2({initialPromise:s==null?void 0:s.initialPromise,fn:d.fetchFn,onCancel:D=>{D instanceof Vv&&D.revert&&this.setState({...G(this,ic),fetchStatus:"idle"}),i.abort()},onFail:(D,_)=>{tt(this,ei,or).call(this,{type:"failed",failureCount:D,error:_})},onPause:()=>{tt(this,ei,or).call(this,{type:"pause"})},onContinue:()=>{tt(this,ei,or).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const D=await f.start();if(D===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(D),(x=(w=G(this,Is).config).onSuccess)==null||x.call(w,D,this),(T=(S=G(this,Is).config).onSettled)==null||T.call(S,D,this.state.error,this),D}catch(D){if(D instanceof Vv){if(D.silent)return G(this,cn).promise;if(D.revert){if(this.state.data===void 0)throw D;return this.state.data}}throw tt(this,ei,or).call(this,{type:"error",error:D}),(C=(A=G(this,Is).config).onError)==null||C.call(A,D,this),(M=(k=G(this,Is).config).onSettled)==null||M.call(k,this.state.data,D,this),D}finally{G(this,cn)===f&&Ce(this,cn,void 0),this.scheduleGc()}}},sc=new WeakMap,pa=new WeakMap,ic=new WeakMap,Is=new WeakMap,ga=new WeakMap,cn=new WeakMap,pd=new WeakMap,ya=new WeakMap,ei=new WeakSet,or=function(t){const s=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...k2(i.data,this.options),fetchMeta:t.meta??null};case"success":const o={...i,...OR(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ce(this,ic,t.manual?o:void 0),o;case"error":const l=t.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=s(this.state),mn.batch(()=>{this.observers.slice().forEach(i=>{i.onQueryUpdate()}),G(this,Is).notify({query:this,type:"updated",action:t})})},f2);function k2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:E2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function OR(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Gn,ft,gd,Kn,va,rc,cr,yd,oc,ac,ba,xa,ao,lc,Tt,Nu,Fv,qv,Hv,Gv,Kv,Yv,$v,Qv,h2,gI=(h2=class extends wc{constructor(t,s){super();Fe(this,Tt);Fe(this,Gn);Fe(this,ft);Fe(this,gd);Fe(this,Kn);Fe(this,va);Fe(this,rc);Fe(this,cr);Fe(this,yd);Fe(this,oc);Fe(this,ac);Fe(this,ba);Fe(this,xa);Fe(this,ao);Fe(this,lc,new Set);this.options=s,Ce(this,Gn,t),Ce(this,cr,null),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,ft).addObserver(this),DR(G(this,ft),this.options)?tt(this,Tt,Nu).call(this):this.updateResult(),tt(this,Tt,Kv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xv(G(this,ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xv(G(this,ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,tt(this,Tt,Yv).call(this),tt(this,Tt,$v).call(this),G(this,ft).removeObserver(this)}setOptions(t){const s=this.options,i=G(this,ft);if(this.options=G(this,Gn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qt(this.options.enabled,G(this,ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");tt(this,Tt,Qv).call(this),G(this,ft).setOptions(this.options),s._defaulted&&!Ph(this.options,s)&&G(this,Gn).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,ft),observer:this});const o=this.hasListeners();o&&_R(G(this,ft),i,this.options,s)&&tt(this,Tt,Nu).call(this),this.updateResult(),o&&(G(this,ft)!==i||qt(this.options.enabled,G(this,ft))!==qt(s.enabled,G(this,ft))||qt(this.options.staleTime,G(this,ft))!==qt(s.staleTime,G(this,ft)))&&tt(this,Tt,qv).call(this);const l=tt(this,Tt,Hv).call(this);o&&(G(this,ft)!==i||qt(this.options.enabled,G(this,ft))!==qt(s.enabled,G(this,ft))||l!==G(this,ao))&&tt(this,Tt,Gv).call(this,l)}getOptimisticResult(t){const s=G(this,Gn).getQueryCache().build(G(this,Gn),t),i=this.createResult(s,t);return Ph(this.getCurrentResult(),i)||(Ce(this,Kn,i),Ce(this,rc,this.options),Ce(this,va,G(this,ft).state)),i}getCurrentResult(){return G(this,Kn)}trackResult(t,s){return new Proxy(t,{get:(i,o)=>(this.trackProp(o),s==null||s(o),Reflect.get(i,o))})}trackProp(t){G(this,lc).add(t)}getCurrentQuery(){return G(this,ft)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=G(this,Gn).defaultQueryOptions(t),i=G(this,Gn).getQueryCache().build(G(this,Gn),s);let o=()=>{},l;const u=new Promise(d=>{l=d,o=G(this,Gn).getQueryCache().subscribe(f=>{f.type==="updated"&&f.query.queryHash===i.queryHash&&i.state.data!==void 0&&(o(),d(this.createResult(i,s)))})});return Promise.race([i.fetch(s).then(()=>{const d=this.createResult(i,s);return l==null||l(d),d}).finally(()=>{o()}),u])}fetch(t){return tt(this,Tt,Nu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),G(this,Kn)))}createResult(t,s){var _;const i=G(this,ft),o=this.options,l=G(this,Kn),u=G(this,va),d=G(this,rc),f=t!==i?t.state:G(this,gd),{state:h}=t;let p={...h},g=!1,b;if(s._optimisticResults){const N=this.hasListeners(),O=!N&&DR(t,s),z=N&&_R(t,i,s,o);(O||z)&&(p={...p,...k2(h.data,t.options)}),s._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:x,status:S}=p;b=p.data;let T=!1;if(s.placeholderData!==void 0&&b===void 0&&S==="pending"){let N;l!=null&&l.isPlaceholderData&&s.placeholderData===(d==null?void 0:d.placeholderData)?(N=l.data,T=!0):N=typeof s.placeholderData=="function"?s.placeholderData((_=G(this,ac))==null?void 0:_.state.data,G(this,ac)):s.placeholderData,N!==void 0&&(S="success",b=Uv(l==null?void 0:l.data,N,s),g=!0)}if(s.select&&b!==void 0&&!T)if(l&&b===(u==null?void 0:u.data)&&s.select===G(this,yd))b=G(this,oc);else try{Ce(this,yd,s.select),b=s.select(b),b=Uv(l==null?void 0:l.data,b,s),Ce(this,oc,b),Ce(this,cr,null)}catch(N){Ce(this,cr,N)}else b===void 0&&Ce(this,cr,null);G(this,cr)&&(w=G(this,cr),b=G(this,oc),x=Date.now(),S="error",g=!1);const A=p.fetchStatus==="fetching",C=S==="pending",k=S==="error",M=C&&A,D=b!==void 0;return{status:S,fetchStatus:p.fetchStatus,isPending:C,isSuccess:S==="success",isError:k,isInitialLoading:M,isLoading:M,data:b,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:A,isRefetching:A&&!C,isLoadingError:k&&!D,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&D,isStale:nx(t,s),refetch:this.refetch,isEnabled:qt(s.enabled,t)!==!1}}updateResult(){const t=G(this,Kn),s=this.createResult(G(this,ft),this.options);if(Ce(this,va,G(this,ft).state),Ce(this,rc,this.options),G(this,va).data!==void 0&&Ce(this,ac,G(this,ft)),Ph(s,t))return;Ce(this,Kn,s);const o=(()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!G(this,lc).size)return!0;const d=new Set(u??G(this,lc));return this.options.throwOnError&&d.add("error"),Object.keys(G(this,Kn)).some(f=>{const h=f;return G(this,Kn)[h]!==t[h]&&d.has(h)})})();mn.batch(()=>{o&&this.listeners.forEach(l=>{l(G(this,Kn))}),G(this,Gn).getQueryCache().notify({query:G(this,ft),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&tt(this,Tt,Kv).call(this)}},Gn=new WeakMap,ft=new WeakMap,gd=new WeakMap,Kn=new WeakMap,va=new WeakMap,rc=new WeakMap,cr=new WeakMap,yd=new WeakMap,oc=new WeakMap,ac=new WeakMap,ba=new WeakMap,xa=new WeakMap,ao=new WeakMap,lc=new WeakMap,Tt=new WeakSet,Nu=function(t){tt(this,Tt,Qv).call(this);let s=G(this,ft).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(Yn)),s},Fv=function(t){return!ex()&&qt(this.options.enabled,G(this,ft))!==!1&&w2(t)},qv=function(){tt(this,Tt,Yv).call(this);const t=qt(this.options.staleTime,G(this,ft));if(G(this,Kn).isStale||!tt(this,Tt,Fv).call(this,t))return;const s=S2(G(this,Kn).dataUpdatedAt,t)+1;Ce(this,ba,ca.setTimeout(()=>{G(this,Kn).isStale||this.updateResult()},s))},Hv=function(){return qt(this.options.refetchInterval,G(this,ft))??!1},Gv=function(t){tt(this,Tt,$v).call(this),Ce(this,ao,t),!(G(this,ao)===0||!tt(this,Tt,Fv).call(this,G(this,ao)))&&Ce(this,xa,ca.setInterval(()=>{(this.options.refetchIntervalInBackground||tx.isFocused())&&tt(this,Tt,Nu).call(this)},G(this,ao)))},Kv=function(){tt(this,Tt,qv).call(this),tt(this,Tt,Gv).call(this,tt(this,Tt,Hv).call(this))},Yv=function(){G(this,ba)!==void 0&&(ca.clearTimeout(G(this,ba)),Ce(this,ba,void 0))},$v=function(){G(this,xa)!==void 0&&(ca.clearInterval(G(this,xa)),Ce(this,xa,void 0))},Qv=function(){const t=G(this,Gn).getQueryCache().build(G(this,Gn),this.options);if(t===G(this,ft))return;const s=G(this,ft);Ce(this,ft,t),Ce(this,gd,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},h2);function yI(e,t){return qt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&qt(t.retryOnMount,e)===!1)}function DR(e,t){return yI(e,t)||e.state.data!==void 0&&Xv(e,t,t.refetchOnMount)}function Xv(e,t,s){if(qt(t.enabled,e)!==!1&&qt(t.staleTime,e)!=="static"){const i=qt(s,e);return i==="always"||i!==!1&&nx(e,t)}return!1}function _R(e,t,s,i){return(e!==t||qt(i.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&nx(e,s)}function nx(e,t){return qt(t.enabled,e)!==!1&&e.isStaleByTime(qt(t.staleTime,e))}var vd,Ri,In,wa,Ei,no,m2,vI=(m2=class extends A2{constructor(t){super();Fe(this,Ei);Fe(this,vd);Fe(this,Ri);Fe(this,In);Fe(this,wa);Ce(this,vd,t.client),this.mutationId=t.mutationId,Ce(this,In,t.mutationCache),Ce(this,Ri,[]),this.state=t.state||M2(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){G(this,Ri).includes(t)||(G(this,Ri).push(t),this.clearGcTimeout(),G(this,In).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,Ri,G(this,Ri).filter(s=>s!==t)),this.scheduleGc(),G(this,In).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){G(this,Ri).length||(this.state.status==="pending"?this.scheduleGc():G(this,In).remove(this))}continue(){var t;return((t=G(this,wa))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var d,f,h,p,g,b,w,x,S,T,A,C,k,M,D,_,N,O;const s=()=>{tt(this,Ei,no).call(this,{type:"continue"})},i={client:G(this,vd),meta:this.options.meta,mutationKey:this.options.mutationKey},o=Ce(this,wa,C2({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(z,I)=>{tt(this,Ei,no).call(this,{type:"failed",failureCount:z,error:I})},onPause:()=>{tt(this,Ei,no).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,In).canRun(this)})),l=this.state.status==="pending",u=!o.canStart();try{if(l)s();else{tt(this,Ei,no).call(this,{type:"pending",variables:t,isPaused:u}),G(this,In).config.onMutate&&await G(this,In).config.onMutate(t,this,i);const I=await((f=(d=this.options).onMutate)==null?void 0:f.call(d,t,i));I!==this.state.context&&tt(this,Ei,no).call(this,{type:"pending",context:I,variables:t,isPaused:u})}const z=await o.start();return await((p=(h=G(this,In).config).onSuccess)==null?void 0:p.call(h,z,t,this.state.context,this,i)),await((b=(g=this.options).onSuccess)==null?void 0:b.call(g,z,t,this.state.context,i)),await((x=(w=G(this,In).config).onSettled)==null?void 0:x.call(w,z,null,this.state.variables,this.state.context,this,i)),await((T=(S=this.options).onSettled)==null?void 0:T.call(S,z,null,t,this.state.context,i)),tt(this,Ei,no).call(this,{type:"success",data:z}),z}catch(z){try{await((C=(A=G(this,In).config).onError)==null?void 0:C.call(A,z,t,this.state.context,this,i))}catch(I){Promise.reject(I)}try{await((M=(k=this.options).onError)==null?void 0:M.call(k,z,t,this.state.context,i))}catch(I){Promise.reject(I)}try{await((_=(D=G(this,In).config).onSettled)==null?void 0:_.call(D,void 0,z,this.state.variables,this.state.context,this,i))}catch(I){Promise.reject(I)}try{await((O=(N=this.options).onSettled)==null?void 0:O.call(N,void 0,z,t,this.state.context,i))}catch(I){Promise.reject(I)}throw tt(this,Ei,no).call(this,{type:"error",error:z}),z}finally{G(this,wa)===o&&Ce(this,wa,void 0),G(this,In).runNext(this)}}},vd=new WeakMap,Ri=new WeakMap,In=new WeakMap,wa=new WeakMap,Ei=new WeakSet,no=function(t){const s=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),mn.batch(()=>{G(this,Ri).forEach(i=>{i.onMutationUpdate(t)}),G(this,In).notify({mutation:this,type:"updated",action:t})})},m2);function M2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lo,ti,bd,p2,bI=(p2=class extends wc{constructor(t={}){super();Fe(this,lo);Fe(this,ti);Fe(this,bd);this.config=t,Ce(this,lo,new Set),Ce(this,ti,new Map),Ce(this,bd,0)}build(t,s,i){const o=new vI({client:t,mutationCache:this,mutationId:++ah(this,bd)._,options:t.defaultMutationOptions(s),state:i});return this.add(o),o}add(t){G(this,lo).add(t);const s=lh(t);if(typeof s=="string"){const i=G(this,ti).get(s);i?i.push(t):G(this,ti).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(G(this,lo).delete(t)){const s=lh(t);if(typeof s=="string"){const i=G(this,ti).get(s);if(i)if(i.length>1){const o=i.indexOf(t);o!==-1&&i.splice(o,1)}else i[0]===t&&G(this,ti).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){var i;const s=lh(t);if(typeof s=="string"){const o=(i=G(this,ti).get(s))==null?void 0:i.find(l=>l.state.status==="pending");return!o||o===t}else return!0}runNext(t){var i,o;const s=lh(t);return typeof s=="string"?((o=(i=G(this,ti).get(s))==null?void 0:i.find(l=>l!==t&&l.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){mn.batch(()=>{const t=this.getAll();G(this,lo).clear(),G(this,ti).clear(),t.forEach(s=>{this.notify({type:"removed",mutation:s})})})}getAll(){return Array.from(G(this,lo))}find(t){const s={exact:!0,...t};return this.getAll().find(i=>AR(s,i))}findAll(t={}){return this.getAll().filter(s=>AR(t,s))}notify(t){mn.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return mn.batch(()=>Promise.all(t.map(s=>s.continue().catch(Yn))))}},lo=new WeakMap,ti=new WeakMap,bd=new WeakMap,p2);function lh(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ur,co,Pn,xd,Oi,Ou,Zv,g2,xI=(g2=class extends wc{constructor(s,i){super();Fe(this,Oi);Fe(this,ur);Fe(this,co);Fe(this,Pn);Fe(this,xd);Ce(this,ur,s),this.setOptions(i),this.bindMethods(),tt(this,Oi,Ou).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var o;const i=this.options;this.options=G(this,ur).defaultMutationOptions(s),Ph(this.options,i)||G(this,ur).getMutationCache().notify({type:"observerOptionsUpdated",mutation:G(this,Pn),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&Ca(i.mutationKey)!==Ca(this.options.mutationKey)?this.reset():((o=G(this,Pn))==null?void 0:o.state.status)==="pending"&&G(this,Pn).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&G(this,Pn)&&(G(this,Pn).addObserver(this),tt(this,Oi,Ou).call(this))}onUnsubscribe(){var s;this.hasListeners()||(s=G(this,Pn))==null||s.removeObserver(this)}onMutationUpdate(s){tt(this,Oi,Ou).call(this),tt(this,Oi,Zv).call(this,s)}getCurrentResult(){return G(this,co)}reset(){var s;(s=G(this,Pn))==null||s.removeObserver(this),Ce(this,Pn,void 0),tt(this,Oi,Ou).call(this),tt(this,Oi,Zv).call(this)}mutate(s,i){var o;return Ce(this,xd,i),(o=G(this,Pn))==null||o.removeObserver(this),Ce(this,Pn,G(this,ur).getMutationCache().build(G(this,ur),this.options)),G(this,Pn).addObserver(this),G(this,Pn).execute(s)}},ur=new WeakMap,co=new WeakMap,Pn=new WeakMap,xd=new WeakMap,Oi=new WeakSet,Ou=function(){var i;const s=((i=G(this,Pn))==null?void 0:i.state)??M2();Ce(this,co,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},Zv=function(s){mn.batch(()=>{var o,l,u,d;const i=G(this,xd);if(i&&this.hasListeners()){const f=G(this,co).variables,h=G(this,co).context,p={client:G(this,ur),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(o=i.onSuccess)==null||o.call(i,s.data,f,h,p)}catch(g){Promise.reject(g)}try{(l=i.onSettled)==null||l.call(i,s.data,null,f,h,p)}catch(g){Promise.reject(g)}}else if((s==null?void 0:s.type)==="error"){try{(u=i.onError)==null||u.call(i,s.error,f,h,p)}catch(g){Promise.reject(g)}try{(d=i.onSettled)==null||d.call(i,void 0,s.error,f,h,p)}catch(g){Promise.reject(g)}}}this.listeners.forEach(f=>{f(G(this,co))})})},g2),Ci,y2,wI=(y2=class extends wc{constructor(t={}){super();Fe(this,Ci);this.config=t,Ce(this,Ci,new Map)}build(t,s,i){const o=s.queryKey,l=s.queryHash??Zb(o,s);let u=this.get(l);return u||(u=new pI({client:t,queryKey:o,queryHash:l,options:t.defaultQueryOptions(s),state:i,defaultOptions:t.getQueryDefaults(o)}),this.add(u)),u}add(t){G(this,Ci).has(t.queryHash)||(G(this,Ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){G(this,Ci).get(t.queryHash)===t&&(t.destroy(),G(this,Ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){mn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return G(this,Ci).get(t)}getAll(){return[...G(this,Ci).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(i=>CR(s,i))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(i=>CR(t,i)):s}notify(t){mn.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){mn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){mn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ci=new WeakMap,y2),Kt,uo,fo,cc,uc,ho,dc,fc,v2,SI=(v2=class{constructor(e={}){Fe(this,Kt);Fe(this,uo);Fe(this,fo);Fe(this,cc);Fe(this,uc);Fe(this,ho);Fe(this,dc);Fe(this,fc);Ce(this,Kt,e.queryCache||new wI),Ce(this,uo,e.mutationCache||new bI),Ce(this,fo,e.defaultOptions||{}),Ce(this,cc,new Map),Ce(this,uc,new Map),Ce(this,ho,0)}mount(){ah(this,ho)._++,G(this,ho)===1&&(Ce(this,dc,tx.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,Kt).onFocus())})),Ce(this,fc,Jh.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,Kt).onOnline())})))}unmount(){var e,t;ah(this,ho)._--,G(this,ho)===0&&((e=G(this,dc))==null||e.call(this),Ce(this,dc,void 0),(t=G(this,fc))==null||t.call(this),Ce(this,fc,void 0))}isFetching(e){return G(this,Kt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return G(this,uo).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=G(this,Kt).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=G(this,Kt).build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(qt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return G(this,Kt).findAll(e).map(({queryKey:t,state:s})=>[t,s.data])}setQueryData(e,t,s){var u;const i=this.defaultQueryOptions({queryKey:e}),o=(u=G(this,Kt).get(i.queryHash))==null?void 0:u.state.data,l=tI(t,o);if(l!==void 0)return G(this,Kt).build(this,i).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return mn.batch(()=>G(this,Kt).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=G(this,Kt).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=G(this,Kt);mn.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=G(this,Kt);return mn.batch(()=>{const i=s.findAll(e),o=new Set(i);return i.forEach(l=>{l.reset()}),this.refetchQueries({type:"active",predicate:l=>o.has(l)},t)})}cancelQueries(e,t={}){const s={revert:!0,...t},i=mn.batch(()=>G(this,Kt).findAll(e).map(o=>o.cancel(s)));return Promise.all(i).then(Yn).catch(Yn)}invalidateQueries(e,t={}){return mn.batch(()=>(G(this,Kt).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},i=mn.batch(()=>G(this,Kt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,s);return s.throwOnError||(l=l.catch(Yn)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(Yn)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=G(this,Kt).build(this,t),i=s.isStaleByTime(qt(t.staleTime,s))?await s.fetch(t):s.state.data,o=t.select;return o?o(i):i}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=G(this,Kt).build(this,t);return s.isStaleByTime(qt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yn).catch(Yn)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yn).catch(Yn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Jh.isOnline()?G(this,uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Kt)}getMutationCache(){return G(this,uo)}getDefaultOptions(){return G(this,fo)}setDefaultOptions(e){Ce(this,fo,e)}setQueryDefaults(e,t){G(this,cc).set(Ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...G(this,cc).values()],s={};return t.forEach(i=>{hc(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){G(this,uc).set(Ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...G(this,uc).values()],s={};return t.forEach(i=>{hc(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...G(this,fo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Wb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...G(this,fo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){G(this,Kt).clear(),G(this,uo).clear()}},Kt=new WeakMap,uo=new WeakMap,fo=new WeakMap,cc=new WeakMap,uc=new WeakMap,ho=new WeakMap,dc=new WeakMap,fc=new WeakMap,v2);const N2=E.createContext(!1),TI=()=>E.useContext(N2);N2.Provider;function RI(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const EI=E.createContext(RI()),CI=()=>E.useContext(EI),AI=(e,t,s)=>{const i=(s==null?void 0:s.state.status)==="error"&&typeof e.throwOnError=="function"?Jb(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||i)&&(t.isReset()||(e.retryOnMount=!1))},kI=e=>{E.useEffect(()=>{e.clearReset()},[e])},MI=({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Jb(s,[e.error,i])),NI=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>s(i(...o)):s(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},OI=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,jI=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function DI(e,t,s){const i=TI(),o=CI(),l=Us(),u=l.defaultQueryOptions(e),d=l.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":f?"optimistic":void 0,NI(u),AI(u,o,d),kI(o);const[h]=E.useState(()=>new t(l,u)),p=h.getOptimisticResult(u),g=!i&&f;if(E.useSyncExternalStore(E.useCallback(b=>{const w=g?h.subscribe(mn.batchCalls(b)):Yn;return h.updateResult(),w},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),E.useEffect(()=>{h.setOptions(u)},[u,h]),OI(u,p))throw jI(u,h,o);if(MI({result:p,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw p.error;return u.notifyOnChangeProps?p:h.trackResult(p)}function Et(e,t){return DI(e,gI)}function On(e,t){const s=Us(),[i]=E.useState(()=>new xI(s,e));E.useEffect(()=>{i.setOptions(e)},[i,e]);const o=E.useSyncExternalStore(E.useCallback(u=>i.subscribe(mn.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=E.useCallback((...u)=>{i.mutate(u[0],u[1]).catch(Yn)},[i]);if(o.error&&Jb(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}const IR=!1;var sx=E.useLayoutEffect;function So(e){return e[e.length-1]}function O2(e,t){return typeof e=="function"?e(t):e}const ix=Object.prototype.hasOwnProperty;function j2(e){for(const t in e)if(ix.call(e,t))return!0;return!1}const zh=()=>Object.create(null),zl=(e,t)=>vo(e,t,!0);function vo(e,t,s,i=0){if(e===t)return e;if(i++>500)return t;const o=Array.isArray(e)&&Array.isArray(t);if(!o&&!(em(e)&&em(t)))return t;const l=Object.keys(e),u=l.length,d=Object.keys(t),f=d.length;if(o?u!==e.length||f!==t.length||u&&So(l)!==`${u-1}`||f&&So(d)!==`${f-1}`:u!==Object.getOwnPropertyNames(e).length||f!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let h=0,p,g,b;if(o){for(;h<f&&(b=h,g=e[b],p=t[b],p=g===p?g:typeof g=="object"?vo(g,p,s,i):p,p===g);h++);if(h===f&&u===f)return e}else{let x=u===f,S=!0;for(;h<f;h++){b=d[h],g=e[b];const T=t[b];p=g===T?g:typeof g=="object"?vo(g,T,s,i):T,x&&(x=p===g&&(l[h]===b||ix.call(e,b))),S&&(S=Object.is(p,T)),l[h]=p}if(x)return Object.getOwnPropertySymbols(e).length?t:e;if(S)return t}const w=o?d.fill(0):s?zh():{};for(let x=0;x<f;x++)b=o?x:d[x],o?(g=e[b],x>h&&(p=t[b],p=g===p?g:typeof g=="object"?vo(g,p,s,i):p),w[b]=x<h?g:p):w[b]=l[x];return w}function em(e){var t;return!e||typeof e!="object"?!1:(((t=Object.getPrototypeOf(e))==null?void 0:t.constructor)??Object)===Object}function hr(e,t,s,i){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let o=0,l=e.length;o<l;o++){const u=e[o],d=t[o];if(u!==d&&!hr(u,d,s,i))return!1}return!0}if(em(e)&&em(t)){if(s){for(const l in t)if((i||t[l]!==void 0)&&!hr(e[l],t[l],s,i))return!1;return!0}let o=0;if(i)o=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&o++;for(const l in t)if((i||t[l]!==void 0)&&(o--===0||!hr(e[l],t[l],s,i)))return!1;return o===0}return!1}const _I=/[\x00-\x1f\x7f"<>`{}]/g;function II(e){return e.replace(_I,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function PR(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return II(t)}const PI=["http:","https:","mailto:","tel:"];function Gu(e){var t,s;if(e[0]!=="/"&&e.includes(":"))return(s=(t=/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e))==null?void 0:t[1])==null?void 0:s.replace(/[\t\n\r]/g,"").toLowerCase()}const D2=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function _2(e,t){if(!e)return!1;if(D2.test(e))return!0;const s=Gu(e);return s?!t.has(s):!1}function xu(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){const s=/%25|%5C/gi;let i=0,o;for(t="";(o=s.exec(e))!==null;)t+=PR(e.slice(i,o.index))+o[0],i=s.lastIndex;t+=PR(i?e.slice(i):e)}return t}function zI(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function LI(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}function rx(){throw new Error("Invariant failed")}function Gl(e){return e.replace(/\/{2,}/g,"/")}function I2(e){return e==="/"?e:e.replace(/^\/+/,"")}function Mi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/+$/,""):e}function P2(e){return Mi(I2(e))}function zR(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function LR(e,t,s="never",i){if(t.includes("//")&&(t=Gl(t)),t.startsWith("/"))return t.length===1||s==="preserve"?t:s==="always"?t.endsWith("/")?t:`${t}/`:t.endsWith("/")?t.slice(0,-1):t;const o=t===".";let l;if(i){l=o?e:e+"\0"+t;const h=i.get(l);if(h)return h}let u;if(o)u=e.split("/");else{for(e.includes("//")&&(e=Gl(e)),u=e.split("/");u.length>1&&So(u)==="";)u.pop();const h=t.split("/");for(let p=0,g=h.length;p<g;p++){const b=h[p];b===""?p?p===g-1&&u.push(b):u=[b]:b===".."?u.length>1?u.pop():u=[""]:b==="."||u.push(b)}}u.length>1&&(So(u)===""?s==="never"&&u.pop():s==="always"&&u.push(""));const d=u.join("/"),f=(o?Gl(d):d)||"/";return l&&i&&i.set(l,f),f}function BI(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),s=new RegExp([...t.keys()].join("|").replace(/[.*()]/g,"\\$&"),"g");return i=>i.replace(s,o=>t.get(o)??o)}function UI(e){return e==null||e===""}function VI(e,t,s){if(typeof t!="string")return""+(t??void 0);const i=e==="_splat";if(i&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let o=encodeURIComponent(t);return i&&(o=o.replaceAll("%2F","/")),s?s(o):o}function BR(e,t,s,i,o){const l=e.endsWith("/")?"/":"";let u="";for(const d of t){if(typeof d=="string"){u+=d;continue}const[f,h,p,g]=d,b=f===2,w=b&&g!==void 0?g+l:g;let x=s[h];if(!(f===3&&x==null)){if(o&&(o[h]=x,b&&(o["*"]=x)),b&&UI(x)){if(p==="/"&&!w)continue;x=""}u+=p+VI(h,x,i)+(w||"")}}return u+l||"/"}function mc(e){return(e==null?void 0:e.isNotFound)===!0}function FI(){try{return sessionStorage}catch{return}}const qI="tsr-scroll-restoration-v1_3",Kl=FI();function HI(){try{return JSON.parse((Kl==null?void 0:Kl.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}const Jr=HI(),UR="data-scroll-restoration-id",GI=e=>e.state.__TSR_key||e.href;function KI(e){const t=e.getAttribute(UR);if(t)return`[${UR}="${t}"]`;let s="",i=e,o;for(;o=i.parentNode;){let l=1,u=i;for(;u=u.previousElementSibling;)l++;const d=`${i.localName}:nth-child(${l})`;s=s?`${d} > ${s}`:d,i=o}return s}let ch=!1;const Lh="window";function Wv(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function VR(e){const t=new Set;for(const s of e){if(s===Lh)continue;const i=Wv(s);i&&t.add(i)}return t}function YI(e,t){const s=e.options.scrollRestoration,i=e._scroll;s&&(i.e=!0);const o=e.options.getScrollRestorationKey||GI,l=new Set,u=d=>{const f=Jr[d]||(Jr[d]={});for(const h of l)h===document?f[Lh]={scrollX,scrollY}:h.isConnected&&(f[KI(h)]={scrollX:h.scrollLeft,scrollY:h.scrollTop})};s&&!i.s&&(i.s=!0,ch=!1,history.scrollRestoration="manual",document.addEventListener("scroll",d=>{ch||l.add(d.target)},!0),e.subscribe("onBeforeLoad",d=>{d.fromLocation&&u(o(d.fromLocation)),l.clear()}),addEventListener("pagehide",()=>{history.scrollRestoration="auto",u(o(e.stores.resolvedLocation.get()??e.stores.location.get()));try{Kl==null||Kl.setItem(qI,JSON.stringify(Jr))}catch{}}),addEventListener("pageshow",d=>{d.persisted&&(history.scrollRestoration="manual")})),!i.r&&(i.r=!0,e.subscribe("onRendered",d=>{var S;const f=e.options.scrollRestorationBehavior,h=e.options.scrollToTopSelectors,p=i.n,g=i.h;let b;if(l.clear(),i.n=!0,i.h=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const w=o(d.toLocation),x=d.fromLocation&&o(d.fromLocation);if(i.e&&x&&x!==w){const T=Jr[x];if(T){let A=Jr[w];for(const C in T){if(C===Lh){if(p)continue}else{const k=Wv(C);if(!k||p&&h&&(b??(b=VR(h)),b.has(k)))continue}A||(A=Jr[w]={}),A[C]??(A[C]=T[C])}}}ch=!0;try{const T=d.toLocation.hash,A=d.toLocation.state.__hashScrollIntoViewOptions??!0;let C=!1;if(p){!T&&h&&(b??(b=VR(h)));const k=T&&A&&g,M=i.e?Jr[w]:void 0;if(M)for(const D in M){const{scrollX:_,scrollY:N}=M[D];if(D===Lh){if(k)continue;scrollTo({top:N,left:_,behavior:f}),C=!0}else{const O=Wv(D);O&&(O.scrollLeft=_,O.scrollTop=N,b==null||b.delete(O))}}if(!T){const D={top:0,left:0,behavior:f};if(C||scrollTo(D),b)for(const _ of b)_.scrollTo(D)}}!C&&T&&A&&((S=document.getElementById(T))==null||S.scrollIntoView(A))}finally{ch=!1}}))}function $I(e,t=String){let s;for(const i in e){const o=e[i];o!==void 0&&(s||(s=new URLSearchParams)).set(i,t(o))}return s?s.toString():""}function Gy(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function QI(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[i,o]of t.entries()){const l=s[i];l==null?s[i]=Gy(o):Array.isArray(l)?l.push(Gy(o)):s[i]=[l,Gy(o)]}return s}const z2=/^(?:\s|["[{\d-]|fa|nu|tr)/,XI=WI(JSON.parse),ZI=JI(JSON.stringify,JSON.parse);function WI(e){const t=e===JSON.parse;return s=>{s[0]==="?"&&(s=s.slice(1));const i=QI(s);for(const o in i){const l=i[o];if(typeof l=="string"){if(t&&!z2.test(l))continue;try{i[o]=e(l)}catch{}}}return i}}function JI(e,t){const s=t===JSON.parse;function i(o){if(o&&typeof o=="object")try{return e(o)}catch{}else if(t&&typeof o=="string"){if(s&&!z2.test(o))return o;try{return t(o),e(o)}catch{}}return o}return o=>{const l=$I(o,i);return l?`?${l}`:""}}const Yl="__root__";function eP(e){e.statusCode=e.statusCode||e.code||307;const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function L2(e){return e instanceof Response&&!!e.options}function tm(e){const t=new Map;let s,i;return{get(o){const l=t.get(o);if(l)return l.visited=!0,l.value},set(o,l){const u=t.get(o);if(u){u.value=l;return}if(t.size>=e){let f=s==null?void 0:s.next().value;for(;!f||f.visited;)f?f.visited=!1:s=t.values(),f=s.next().value;f===i&&(s=void 0),t.delete(f.key)}const d={key:o,value:l,visited:!1};i=d,t.set(o,d)},clear(){t.clear(),s=void 0,i=void 0}}}const mo=4,B2=5;function tP(e){const t=e.names;if(t)return t;const s=[];for(const i of e)typeof i!="string"&&s.push(i[1]);return e.names=s}function nP(e,t,s){const i=e.slice(t,s);if(i.charCodeAt(0)===36)return i.length===1?[2,"_splat","",void 0]:[1,i.slice(1),"",""];const o=i.indexOf("{");if(o>=0){const l=i.indexOf("}",o),u=i.charCodeAt(o+1)===45,d=o+(u?3:2);if(l>=0&&i.charCodeAt(d-1)===36&&(!u||d<l)){const f=i.slice(d,l);return[u?3:f?1:2,f||"_splat",i.slice(0,o),e.slice(t+l+1,f?s:e.length)]}}return i}function Ku(e,t,s,i,o,l){var A,C;let u=s;const d=t.fullPath??t.from,f=t.options,h=d.length,p=d.endsWith("/")?h-1:h,g=(f==null?void 0:f.caseSensitive)??e,b=((A=f==null?void 0:f.params)==null?void 0:A.parse)??(f==null?void 0:f.parseParams);let w,x=l?s-1:0;if(!i||d.includes("$")){w=(l==null?void 0:l.slice())??[];const k=So(w);k&&typeof k!="string"&&k[0]===2&&(w[w.length-1]=[k[0],k[1],k[2],k[3]===void 0?void 0:k[3]+d.substring(s-(d[s-2]==="/"?2:1),p)],x=h)}for(;u<h;){const k=u,M=d.indexOf("/",k);let D=M===-1?h:M;const _=nP(d,k,D);u=D+1;let N;if(typeof _=="string"){if(!i)continue;let O=_,z;g?z=i.static??(i.static=new Map):(O=_.toLowerCase(),z=i.staticInsensitive??(i.staticInsensitive=new Map));const I=z.get(O);if(I)N=I;else{const V=ua(i);N=V,z.set(O,V)}}else{const O=_[0];let z=_[2],I=_[3]??"";if(O===2&&(D=h,u=D+1),w&&x<D&&(x<k-1&&w.push(d.slice(x,k-1)),_[2]="/"+z,O===2&&_[3]!==void 0&&p<h&&(_[3]=I.slice(0,-1)),w.push(_),x=D),!i)continue;const V=g&&!!(z||I);g||(z=z.toLowerCase(),I=I.toLowerCase());const $=O===1?i.dynamic??(i.dynamic=[]):O===3?i.optional??(i.optional=[]):i.wildcard??(i.wildcard=[]),X=O!==2&&!b&&$.find(B=>!B.parse&&B.caseSensitive===V&&B.prefix===z&&B.suffix===I);if(X)N=X;else{const B=ua(i,O,V,z,I);N=B,$.push(B),$.length===2&&(o==null||o.push($))}}i=N}w&&x<p&&w.push(d.slice(x,p));const S=w==null?void 0:w.slice();if(!i)return S;if(b&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const k=ua(i,B2);(i.pathless??(i.pathless=[])).push(k),i=k}const T=(t.path||!t.children)&&!t.isRoot;if(T&&p<h){const k=ua(i,mo);i.index=k,i=k}return i.parse=b??null,i.priority=((C=f==null?void 0:f.params)==null?void 0:C.priority)??0,i.route||(i.data=S,T&&(i.route=t)),[i,u,S]}function U2(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ua(e,t=0,s,i,o){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:s,prefix:i,suffix:o}}function sP(e,t){const s=ua(),i=[];function o(l,u,d,f){const[h,p,g]=Ku(!1,l,u,d,i,f);if(l.children)for(const b of l.children)o(b,p,h,g)}for(const l of e)o(l,1,s);for(const l of i)l.sort(U2);t.masksTree=s,t.flatCache=tm(1e3)}function iP(e,t){e||(e="/");const s=t.flatCache.get(e);if(s!==void 0)return s;const i=ox(e,t.masksTree);return t.flatCache.set(e,i),i}function rP(e,t,s,i,o){e||(e="/"),i||(i="/");const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);return u||(u=ua(),Ku(t,{from:e},1,u),o.singleCache.set(l,u)),ox(i,u,s)}function oP(e,t,s=!1){const i=s?e:`nofuzz\0${e}`,o=t.matchCache.get(i);if(o!==void 0)return o;e||(e="/");let l;try{l=ox(e,t.segmentTree,s)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=F2(l.route)),t.matchCache.set(i,l),l}function aP(e,t=!1){const s=ua(),i=[],o={},l={};let u=0;function d(f,h,p,g){if(f.init(u),f.id in o&&rx(),o[f.id]=f,u!==0&&f.path){const S=Mi(f.fullPath);(!l[S]||f.fullPath.endsWith("/"))&&(l[S]=f)}u++;const[b,w,x]=Ku(t,f,h,p,i,g);if(f._interpolation=x,f.children)for(const S of f.children)d(S,w,b,x)}d(e,1,s);for(const f of i)f.sort(U2);return{processedTree:{segmentTree:s,singleCache:tm(1e3),matchCache:tm(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:l}}function ox(e,t,s=!1){const i=e.split("/"),o=cP(e,i,t,s);if(!o)return null;const[l]=V2(e,i,o);return{route:o.node.route,rawParams:l}}function V2(e,t,s){var p,g,b,w;const i=lP(s.node),o=s.node.data&&tP(s.node.data),l=Object.create(null);let u=((p=s.extract)==null?void 0:p.part)??0,d=((g=s.extract)==null?void 0:g.node)??0,f=((b=s.extract)==null?void 0:b.path)??0,h=((w=s.extract)==null?void 0:w.param)??0;for(;d<i.length;u++,d++,f++){const x=i[d];if(x.kind===mo)break;if(x.kind===B2){u--,f--;continue}const S=t[u],T=f;if(S&&(f+=S.length),x.kind===1||x.kind===3){const A=o[h++];if(x.kind===3&&s.skipped&1<<d){u--,f=T-1;continue}const C=x.suffix||x.prefix?S.substring(x.prefix.length,S.length-x.suffix.length):S;(C||x.kind===1)&&(l[A]=decodeURIComponent(C))}else if(x.kind===2){const A=x,C=e.substring(T+A.prefix.length,e.length-A.suffix.length),k=decodeURIComponent(C);l["*"]=k,l._splat=k;break}}return s.rawParams&&Object.assign(l,s.rawParams),[l,{part:u,node:d,path:f,param:h}]}function F2(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function lP(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function cP(e,t,s,i){if(e==="/"&&s.index)return{node:s.index,skipped:0};const o=!So(t),l=o&&e!=="/",u=t.length-(o?1:0),d=[{node:s,index:1,skipped:0,statics:0,dynamics:0,optionals:0}];let f=null,h=null;for(;d.length;){const p=d.pop(),{node:g,index:b,skipped:w,statics:x,dynamics:S,optionals:T}=p;let{extract:A,rawParams:C}=p;if(g.kind===2&&g.route&&!dh(h,p))continue;if(g.parse){if(!FR(e,t,p))continue;C=p.rawParams,A=p.extract}i&&g.route&&g.kind!==mo&&dh(f,p)&&(f=p);const k=b===u;if(k&&(g.route&&(!l||g.kind===mo||g.kind===2)&&dh(h,p)&&(h=p),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const M=k?void 0:t[b];let D;if(k&&g.index){const _={node:g.index,index:b,skipped:w,statics:x,dynamics:S,optionals:T,extract:A,rawParams:C};let N=!0;if(g.index.parse&&(FR(e,t,_)||(N=!1)),N){if(!S&&!T&&!w&&uP(x,u))return _;dh(h,_)&&(h=_)}}if(g.wildcard)for(let _=g.wildcard.length-1;_>=0;_--){const N=g.wildcard[_],{prefix:O,suffix:z}=N;if(!(O&&(k||!(N.caseSensitive?M:D??(D=M.toLowerCase())).startsWith(O)))){if(z){if(k)continue;const I=t.slice(b).join("/"),V=I.slice(-z.length);if((N.caseSensitive?V:V.toLowerCase())!==z||I.length-z.length<O.length)continue}d.push({node:N,index:u,skipped:w,statics:x,dynamics:S,optionals:T,extract:A,rawParams:C})}}if(g.optional){const _=w|1<<g.depth+1;for(let N=g.optional.length-1;N>=0;N--){const O=g.optional[N];d.push({node:O,index:b,skipped:_,statics:x,dynamics:S,optionals:T,extract:A,rawParams:C})}if(!k)for(let N=g.optional.length-1;N>=0;N--){const O=g.optional[N],{prefix:z,suffix:I}=O;if(z||I){const V=O.caseSensitive?M:D??(D=M.toLowerCase());if(z&&!V.startsWith(z)||I&&V.indexOf(I,V.length-I.length)<z.length)continue}d.push({node:O,index:b+1,skipped:w,statics:x,dynamics:S,optionals:T+uh(u,b),extract:A,rawParams:C})}}if(!k&&g.dynamic&&M)for(let _=g.dynamic.length-1;_>=0;_--){const N=g.dynamic[_],{prefix:O,suffix:z}=N;if(O||z){const I=N.caseSensitive?M:D??(D=M.toLowerCase());if(O&&!I.startsWith(O)||z&&I.indexOf(z,I.length-z.length)<O.length)continue}d.push({node:N,index:b+1,skipped:w,statics:x,dynamics:S+uh(u,b),optionals:T,extract:A,rawParams:C})}if(!k&&g.staticInsensitive){const _=g.staticInsensitive.get(D??(D=M.toLowerCase()));_&&d.push({node:_,index:b+1,skipped:w,statics:x+uh(u,b),dynamics:S,optionals:T,extract:A,rawParams:C})}if(!k&&g.static){const _=g.static.get(M);_&&d.push({node:_,index:b+1,skipped:w,statics:x+uh(u,b),dynamics:S,optionals:T,extract:A,rawParams:C})}if(g.pathless)for(let _=g.pathless.length-1;_>=0;_--){const N=g.pathless[_];d.push({node:N,index:b,skipped:w,statics:x,dynamics:S,optionals:T,extract:A,rawParams:C})}}if(h)return h;if(i&&f){let p=f.index;for(let b=0;b<f.index;b++)p+=t[b].length;const g=p===e.length?"/":e.slice(p);return f.rawParams??(f.rawParams=Object.create(null)),f.rawParams["**"]=decodeURIComponent(g),f}return null}function uh(e,t){return 2**(e-t-1)}function uP(e,t){return e===2**(t-1)-1}function FR(e,t,s){let i,o;try{[i,o]=V2(e,t,s)}catch{return null}if(s.rawParams=i,s.extract=o,!s.node.parse)return!0;try{if(s.node.parse(i)===!1)return null}catch{}return!0}function dh(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===mo)>(e.node.kind===mo)||t.node.kind===mo==(e.node.kind===mo)&&t.node.depth>e.node.depth))):!0}function dP(e,t,s){const i=P2(e),o=`/${i}`,l=t?o:o.toLowerCase(),u=`${l}/`,d={input:({url:f})=>{const h=t?f.pathname:f.pathname.toLowerCase();return h===l?f.pathname="/":h.startsWith(u)&&(f.pathname=f.pathname.slice(o.length)),f},output:({url:f})=>(f.pathname=Gl(`/${i}${f.pathname}`),f)};return s?{input:({url:f})=>Jv(s,d.input({url:f})),output:({url:f})=>d.output({url:q2(s,f)})}:d}function Jv(e,t){var i;const s=(i=e==null?void 0:e.input)==null?void 0:i.call(e,{url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function q2(e,t){var i;const s=(i=e==null?void 0:e.output)==null?void 0:i.call(e,{url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function fP(e,t){const{createMutableStore:s,createReadonlyStore:i,batch:o}=t,l=new Map,u=s("idle"),d=s(e),f=s(void 0),h=s([]),p=i(()=>h.get().map(S=>l.get(S).get())),g=i(()=>({status:u.get(),isLoading:u.get()==="pending",matches:p.get(),location:d.get(),resolvedLocation:f.get()}));function b(S){let T=l.get(S);return T||(T=s(void 0),l.set(S,T)),T}const w={status:u,location:d,resolvedLocation:f,ids:h,matches:p,byRoute:l,__store:g,getMatchStore:b,setMatches:x};function x(S){const T=h.get(),A=S.map(C=>C.routeId);o(()=>{LI(T,A)||h.set(A);for(const C of T)A.includes(C)||l.get(C).set(()=>{});for(const C of S){const k=b(C.routeId);k.get()!==C&&k.set(C)}})}return w}var bo="__TSR_index",qR="popstate",HR="beforeunload",hP=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Bh(e){const t=hP.exec(e);return t?"/"+e.slice(t[0].length):e}function H2(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,t=>`
18
- \r`.includes(t)?"":encodeURIComponent(t))),Bh(e)}function mP(e){let t=e.getLocation();const s=new Set,i=u=>{t=e.getLocation(),s.forEach(d=>d({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?i(u):t=e.getLocation()},l=async u=>{var f,h,p;const d=(f=u.navigateOpts)!=null&&f.ignoreBlocker||(h=e.getBlockers)==null?void 0:h.call(e);if(typeof document<"u"&&(d!=null&&d.length)&&(u.type==="PUSH"||u.type==="REPLACE"))for(const g of d){const b=nm(u.path,u.state);if(await g.blockerFn({currentLocation:t,nextLocation:b,action:u.type})){(p=e.onBlocked)==null||p.call(e);return}}u.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:u=>(s.add(u),()=>{s.delete(u)}),push:(u,d,f)=>{const h=t.state[bo];d=GR(h+1,d),l({task:()=>{e.pushState(u,d),i({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:u,state:d})},replace:(u,d,f)=>{const h=t.state[bo];d=GR(h,d),l({task:()=>{e.replaceState(u,d),i({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:u,state:d})},go:(u,d)=>{l({task:()=>{e.go(u,(d==null?void 0:d.ignoreBlocker)??!1),o({type:"GO",index:u})},navigateOpts:d,type:"GO"})},back:u=>{l({task:()=>{e.back((u==null?void 0:u.ignoreBlocker)??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward((u==null?void 0:u.ignoreBlocker)??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[bo]!==0,createHref:u=>e.createHref(u),block:u=>{var f;if(!e.setBlockers)return()=>{};const d=((f=e.getBlockers)==null?void 0:f.call(e))??[];return e.setBlockers([...d,u]),()=>{var p,g;const h=((p=e.getBlockers)==null?void 0:p.call(e))??[];(g=e.setBlockers)==null||g.call(e,h.filter(b=>b!==u))}},flush:()=>{var u;return(u=e.flush)==null?void 0:u.call(e)},destroy:()=>{var u;return(u=e.destroy)==null?void 0:u.call(e)},notify:i,_getBlockers:()=>{var u;return((u=e.getBlockers)==null?void 0:u.call(e))??[]}}}function GR(e,t){const s=ax();return{...t,key:s,__TSR_key:s,[bo]:e}}function pP(e){var N,O;const t=typeof document<"u"?window:void 0,s=t.history.pushState,i=t.history.replaceState;let o=[];const l=()=>o,u=z=>o=z,d=z=>H2(z),f=(()=>nm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((N=t.history.state)!=null&&N.__TSR_key)&&!((O=t.history.state)!=null&&O.key)){const z=ax();t.history.replaceState({[bo]:0,key:z,__TSR_key:z},"")}let h=f(),p,g=!1,b=!1,w=!1,x=!1;const S=()=>h;let T;const A=()=>{T&&(_._ignoreSubscribers=!0,(T[2]?t.history.pushState:t.history.replaceState)(T[1],"",T[0]),_._ignoreSubscribers=!1,T=void 0,p=void 0)},C=(z,I,V)=>{const $=!!T;$||(p=h),h=nm(I,V),T=[h.href,V,(T==null?void 0:T[2])||z],$||queueMicrotask(()=>A())},k=z=>{h=f(),_.notify({type:z})},M=async()=>{if(x=!1,b){b=!1;return}const z=f(),I=z.state[bo]-h.state[bo],V=I===1,$=I===-1,X=!V&&!$||g;g=!1;const B=X?"GO":$?"BACK":"FORWARD",q=X?{type:"GO",index:I}:{type:$?"BACK":"FORWARD"};if(w)w=!1;else{const F=l();if(typeof document<"u"&&F.length){for(const ie of F)if(await ie.blockerFn({currentLocation:h,nextLocation:z,action:B})){b=!0,t.history.go(-I),_.notify(q);return}}}h=f(),_.notify(q)},D=z=>{if(x){x=!1;return}let I=!1;const V=l();if(typeof document<"u"&&V.length)for(const $ of V){const X=$.enableBeforeUnload??!0;if(X===!0){I=!0;break}if(typeof X=="function"&&X()===!0){I=!0;break}}if(I)return z.preventDefault(),z.returnValue=""},_=mP({getLocation:S,getLength:()=>t.history.length,pushState:(z,I)=>C(!0,z,I),replaceState:(z,I)=>C(!1,z,I),back:z=>(z&&(w=!0,x=!0),t.history.back()),forward:z=>{z&&(w=!0,x=!0),t.history.forward()},go:(z,I)=>{g=!0,I&&(w=!0,x=!0),t.history.go(z)},createHref:d,flush:A,destroy:()=>{t.history.pushState=s,t.history.replaceState=i,t.removeEventListener(HR,D,{capture:!0}),t.removeEventListener(qR,M)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return _._ignoreNextBeforeUnload=z=>{x=!1;try{z=new URL(z,t.document.baseURI).href,x=/^https?:/.test(z)&&(!z.includes("#")||z.split("#")[0]!==t.location.href.split("#")[0])}catch{}},t.addEventListener(HR,D,{capture:!0}),t.addEventListener(qR,M),t.history.pushState=function(...z){const I=s.apply(t.history,z);return _._ignoreSubscribers||k("PUSH"),I},t.history.replaceState=function(...z){const I=i.apply(t.history,z);return _._ignoreSubscribers||k("REPLACE"),I},_}function nm(e,t){const s=H2(e),i=s.indexOf("#"),o=s.indexOf("?");if(!t){const l=ax();t={[bo]:0,key:l,__TSR_key:l}}return{href:s,pathname:s.slice(0,i>-1?o>-1?Math.min(i,o):i:o>-1?o:s.length),hash:i>-1?s.slice(i):"",search:o>-1?s.slice(o,i===-1?void 0:i):"",state:t}}function ax(){return(Math.random()+1).toString(36).slice(7)}function Ky(e,t){return e.protocol!=="http:"&&e.protocol!=="https:"||e.origin!==t||!!e.username||!!e.password}function Yy(e){return e.pathname+e.search+e.hash}function KR(e){var t,s;return e.options.loader||e.options.beforeLoad||e.lazyFn||((t=e.options.component)==null?void 0:t.preload)||((s=e.options.pendingComponent)==null?void 0:s.preload)}function zm(e,t){return{fromLocation:t,toLocation:e,pathChanged:(t==null?void 0:t.pathname)!==e.pathname,hrefChanged:(t==null?void 0:t.href)!==e.href,hashChanged:(t==null?void 0:t.hash)!==e.hash}}function YR({key:e,__TSR_key:t,__TSR_index:s,__hashScrollIntoViewOptions:i,...o}){return o}function gP(e){return e.findIndex(t=>t.status==="error"||t.status==="notFound"||t._notFound)+1}function yP(e,t,s,i,o,l){var u,d,f,h;i&&(t=t.slice(0,i)),o&&(s=s.slice(0,o));for(const p of t){if(l&&e._tx!==l)return;s.some(g=>g.routeId===p.routeId)||(d=(u=e.routesById[p.routeId].options).onLeave)==null||d.call(u,p)}for(const p of s){if(l&&e._tx!==l)return;(h=(f=e.routesById[p.routeId].options)[t.some(g=>g.routeId===p.routeId)?"onStay":"onEnter"])==null||h.call(f,p)}}var vP=class{constructor(e,t){var s;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async i=>(i(),!1),this.update=i=>{const o=this.options;this.options={...o,...i},this.isServer=this.options.isServer??IR??typeof document>"u",this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=pP()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost");const l=this.options.basepath??"/",u=this.options.rewrite,d=this.basepath!==l||(o==null?void 0:o.rewrite)!==u||(o==null?void 0:o.caseSensitive)!==this.options.caseSensitive;if(d&&(this.basepath=l,this.rewrite=l!=="/"&&P2(l)?dP(l,this.options.caseSensitive,u):u),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree||IR){this.routeTree=this.options.routeTree;let f;f=this.buildRouteTree(),this.setRoutes(f)}if(this.stores)d&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=fP(this.latestLocation,f),YI(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const i=aP(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&sP(this.options.routeMasks,i.processedTree),{...i,resolvePathCache:tm(1e3)}},this.subscribe=(i,o)=>{const l={eventType:i,fn:o};return this.subscribers.add(l),()=>{this.subscribers.delete(l)}},this.emit=i=>{for(const o of this.subscribers)if(o.eventType===i.type)try{o.fn(i)}catch(l){console.error(l)}},this.parseLocation=(i,o)=>{const l=({pathname:h,search:p,hash:g,href:b},w)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const A=this.options.parseSearch(p),C=this.options.stringifySearch(A);return{href:h+C+g,publicHref:h+C+g,pathname:xu(h),external:!1,searchStr:C,search:zl(o==null?void 0:o.search,A),hash:xu(g.slice(1)),state:vo(o==null?void 0:o.state,w)}}const x=Jv(this.rewrite,new URL(b,this.origin)),S=this.options.parseSearch(x.search),T=this.options.stringifySearch(S);return x.search=T,{href:x.href.replace(x.origin,""),publicHref:b,pathname:xu(Bh(x.pathname)),external:!!this.rewrite&&Ky(x,this.origin),searchStr:T,search:zl(o==null?void 0:o.search,S),hash:xu(x.hash.slice(1)),state:vo(o==null?void 0:o.state,w)}},u=l(i,i.state),{__tempLocation:d,__tempKey:f}=u.state;if(d&&(!f||f===this.tempLocationKey)){const h=l(d,{...d.state,__tempLocation:void 0,key:u.state.key,__TSR_key:u.state.__TSR_key});return h.maskedLocation=u,h}return u},this.matchRoutes=(i,o,l)=>typeof i=="string"?this.matchRoutesInternal({pathname:i,search:o},l):this.matchRoutesInternal(i,o),this.getMatchedRoutes=i=>{const o=Object.create(null),l=oP(Mi(i),this.processedTree,!0);return l&&Object.assign(o,l.rawParams),[(l==null?void 0:l.branch)||[this.routesById.__root__],o,l==null?void 0:l.route]},this.buildLocation=i=>{{const d=this.staticLocations.get(i);if(d)return d}let o=!1;const l=(d={})=>{var q;if(d.href){const F=nm(d.href,{});d={...d,to:Jv(this.rewrite,new URL(F.pathname,this.origin)).pathname,search:this.options.parseSearch(F.search),hash:F.hash.slice(1)}}const f=i._fromLocation||this._pendingLocation||this.latestLocation;let h;const p=()=>(o=!0,f),g=()=>h??(h=this.matchRoutesLightweight(p())),b=d.to?`${d.to}`:".",w=LR(b[0]==="/"?"":d.unsafeRelative==="path"?p().pathname:d.from??g()[1],b,this.options.trailingSlash,this.resolvePathCache),x=this.routesByPath[Mi(w)],S=w.includes("$");let T;if(x)T=x._branch??(x._branch=F2(x));else if(S)T=[];else{const[F,ie,Q]=this.getMatchedRoutes(w);T=F,this.options.notFoundRoute&&(!Q||Q.path!=="/"&&ie["**"])&&(T=[...T,this.options.notFoundRoute])}const A=S?(x==null?void 0:x._interpolation)??Ku(!1,{fullPath:w},0):void 0;let C;for(const F of T){const ie=((q=F.options.params)==null?void 0:q.stringify)??F.options.stringifyParams;if(ie){const Q=g()[3];if(C??(C=$y(d.params,Q)),!j2(C))break;C===Q&&(C=Object.assign(zh(),C));try{Object.assign(C,ie(C))}catch{}}}C??(C=$y(d.params,xP(d.params,A)?g()[3]:Qy));const k=i.leaveParams?w:Bh(xu(A?BR(w,A,C,this.pathParamsDecoder):w)),M=wP(T,i._includeValidateSearch),D=()=>{var ie;let F=g()[2];if(i._includeValidateSearch&&((ie=this.options.search)!=null&&ie.strict)){const Q={};T.forEach(ae=>{if(ae.options.validateSearch)try{Object.assign(Q,Uh(ae.options.validateSearch,{...Q,...F}))}catch{}}),F=Q}return F},_=M.length?SP(M,D(),d):d.search===!0?D():typeof d.search=="function"?d.search(D()):d.search||Qy,N=this.options.stringifySearch(_),O=d.hash===!0?p().hash:typeof d.hash=="function"?d.hash(p().hash):d.hash||void 0,z=O?`#${O}`:"",I=d.state?d.state===!0?p().state:typeof d.state=="function"?d.state(p().state):d.state:Qy,V=`${k}${N}${z}`;let $,X,B=!1;if(this.rewrite){const F=new URL(V,this.origin),ie=F.origin,Q=q2(this.rewrite,F);$=Yy(F),Ky(Q,ie)?(X=Q.href,B=!0):X=Bh(Yy(Q))}else $=zI(V),X=$;return{publicHref:X,href:$,pathname:k,search:_,searchStr:N,state:I,hash:O??"",external:B,unmaskOnReload:d.unmaskOnReload}},u=l(i);if(i.mask)u.maskedLocation=l({from:i.from,...i.mask});else if(this.options.routeMasks){const d=iP(u.pathname,this.processedTree);if(d){const f=Object.assign(zh(),d.rawParams),{from:h,params:p,...g}=d.route,b=$y(p,f);u.maskedLocation=l({from:i.from,...g,params:b})}}return!o&&i._fromLocation&&this.staticLocations.set(i,u),u},this.commitLocation=async({viewTransition:i,ignoreBlocker:o,...l})=>{const u=l.maskedLocation??l;if(u.external)return $R(this,u.publicHref,{replace:l.replace,ignoreBlocker:o});let d;const f=Mi(this.latestLocation.href)===Mi(l.href)&&hr(YR(l.state),YR(this.latestLocation.state)),h=this._commitPromise;let p;const g=new Promise(b=>{p=b});if(g.resolve=()=>{p(),h==null||h.resolve()},this._commitPromise=g,f)this.load();else{let{maskedLocation:b,hashScrollIntoView:w,...x}=l;b&&(x={...b,state:{...b.state,__tempKey:void 0,__tempLocation:{...x,search:x.searchStr,state:{...x.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(x.unmaskOnReload??this.options.unmaskOnReload??!1)&&(x.state.__tempKey=this.tempLocationKey)),x.state={...x.state,__hashScrollIntoViewOptions:w??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=i,d=l.replace?"REPLACE":"PUSH",this.history[d==="REPLACE"?"replace":"push"](x.publicHref,x.state,{ignoreBlocker:o}),this.history.subscribers.size||this.load({action:{type:d}})}return this._scroll.n=l.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:i,resetScroll:o,hashScrollIntoView:l,viewTransition:u,ignoreBlocker:d,...f}={})=>{const h=this.buildLocation({...f,_includeValidateSearch:!0});this._pendingLocation=h;const p=this.commitLocation({...h,viewTransition:u,replace:i,resetScroll:o,hashScrollIntoView:l,ignoreBlocker:d});return queueMicrotask(()=>{this._pendingLocation===h&&(this._pendingLocation=void 0)}),p},this.navigate=async({to:i,reloadDocument:o,href:l,publicHref:u,...d})=>{const f=l?Gu(l):void 0;if(f||o){if(i!==void 0||!l){const p=this.buildLocation({to:i,...d}),g=p.maskedLocation??p;l??(l=g.publicHref),u??(u=g.publicHref)}return $R(this,!f&&u?u:l,d)}return this.buildAndCommitLocation({...d,href:l,to:i,_isNavigate:!0})},this.load=async i=>{this.updateLatestLocation(),i!=null&&i.action&&(this._scroll.h=i.action.type==="PUSH"||i.action.type==="REPLACE"),await jP(this,i)},this.startViewTransition=i=>{var l,u;const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document.startViewTransition=="function"){let d;if(typeof o=="object"&&((u=(l=window.CSS)==null?void 0:l.supports)!=null&&u.call(l,"selector(:active-view-transition-type(a))"))){const f=this.latestLocation,h=this.stores.resolvedLocation.get(),p=typeof o.types=="function"?o.types(zm(f,h)):o.types;if(p===!1)return i();d={update:i,types:p}}else d=i;return document.startViewTransition(d).updateCallbackDone}return i()},this.invalidate=i=>{var g,b,w;const o=this._committed,l=i==null?void 0:i.filter,u=this._preloads,d=new Set,f=x=>{(!l||l(x))&&d.add(x.id)};o.forEach(f),this._cache.forEach(f),u==null||u.forEach(x=>x.forEach(f)),(g=this._tx)==null||g[3].forEach(f);const h=[];for(const[x,S]of u??[])S.some(T=>d.has(T.id))&&(u.delete(x),h.push(x));const p=x=>{if(d.has(x.id)){const S=this.routesById[x.routeId],T={...x,invalid:!0,...(i!=null&&i.forcePending||x.status==="error"||x.status==="notFound")&&KR(S)?{status:"pending",error:void 0}:void 0};return x._flight=void 0,T}return x};this._committed=o.map(p);for(const[x,S]of this._cache)d.has(x)&&(S.invalid=!0,i!=null&&i.forcePending&&(S.status="pending"));for(const x of d){const S=(b=this._flights)==null?void 0:b.get(x);(w=this._flights)==null||w.delete(x),S&&!S[2]&&h.push(S[1])}for(const x of h)x.abort();return this.shouldViewTransition=!1,this.load({sync:i==null?void 0:i.sync})},this.resolveRedirect=i=>{const o=i.options;let l=i.headers.get("Location")||o.href;if(!l){const d=this.buildLocation(o);l=(d.maskedLocation??d).publicHref||"/"}let u;if(D2.test(l)||(u=Gu(l))&&!this.protocolAllowlist.has(u))throw new Error("Redirect blocked: unsafe protocol");if(u==="http:"||u==="https:"){const d=new URL(l);d.pathname.startsWith("//")?l=d.href:Ky(d,this.origin)||(l=Yy(d),u=void 0)}return u&&(o.reloadDocument=!0),o.href=l,i.headers.set("Location",l),i},this.clearCache=i=>{var p;const o=this._cache,l=this._preloads,u=i==null?void 0:i.filter,d=[],f=[];for(const[g,b]of o)(!u||u(b))&&(f.push(g),d.push(b));const h=[];for(const[g,b]of l??[])(!u||b.some(u))&&(h.push(g),d.push(...b));for(const g of f)o.delete(g);for(const g of h)l.delete(g);for(const g of d){const b=g._flight;g._flight=void 0,b&&!--b[2]&&(((p=this._flights)==null?void 0:p.get(g.id))===b&&this._flights.delete(g.id),h.push(b[1]))}for(const g of h)g.abort()},this.loadRouteChunk=$l,this.preloadRoute=i=>DP(this,i),this.matchRoute=(i,o)=>{const l={...i,to:i.to?LR(i.from||"",i.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:i.params||{},leaveParams:!0},u=this.buildLocation(l),d=this.stores.status.get()==="pending";if(o!=null&&o.pending&&!d)return!1;const f=(o==null?void 0:o.pending)??!d?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),h=rP(u.pathname,(o==null?void 0:o.caseSensitive)??!1,(o==null?void 0:o.fuzzy)??!1,f.pathname,this.processedTree);return!h||i.params&&!hr(h.rawParams,i.params,!0)?!1:(o==null?void 0:o.includeSearch)??!0?hr(f.search,u.search,!0)?h.rawParams:!1:h.rawParams},this.getStoreConfig=t,(s=e.pathParamsAllowedCharacters)!=null&&s.length&&(this.pathParamsDecoder=BI(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??ZI,parseSearch:e.parseSearch??XI,protocolAllowlist:e.protocolAllowlist??PI}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;const t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Ku(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){var b,w;const[s,i,o]=this.getMatchedRoutes(e.pathname);let l=s,u=!1;(o?o.path!=="/"&&i["**"]:Mi(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:u=!0);const d=u?TP(this.options.notFoundMode,l):void 0,f=new Array(l.length),h=this._committed,p=(x,S)=>{const T=h[S];return(T==null?void 0:T.routeId)===x.id?T:x===this.options.notFoundRoute?h.find(A=>A.routeId===x.id):void 0};let g;for(let x=0;x<l.length;x++){const S=l[x],T=f[x-1];let A,C,k;{const q=(T==null?void 0:T.search)??e.search,F=(T==null?void 0:T._strictSearch)??void 0;try{const ie=Uh(S.options.validateSearch,{...q})??void 0;A={...q,...ie},C={...F,...ie}}catch(ie){let Q=ie;if(ie instanceof sm||(Q=new sm(ie.message,{cause:ie})),t!=null&&t.throwOnError)throw Q;A=q,C={},k=Q}}let M="",D="";try{M=((w=(b=S.options).loaderDeps)==null?void 0:w.call(b,{search:A}))??"",D=M&&JSON.stringify(M)||""}catch(q){if(t!=null&&t.throwOnError)throw q;k??(k=q)}const _=zh(),N=S._interpolation?BR(S.fullPath,S._interpolation,i,this.pathParamsDecoder,_):S.fullPath,O=S.id+N+D,z=p(S,x),I=this._cache.get(O)??((z==null?void 0:z.id)===O?z:void 0);g=(I==null?void 0:I._strictParams)??Object.assign(_,g);let V;if(!I)try{QR(S,g)}catch(q){if(mc(q)||L2(q)?V=q:V=new bP(q.message,{cause:q}),t!=null&&t.throwOnError)throw V}const $=z?"stay":"enter";let X;if(I)X={...I,cause:$,search:zl(z?z.search:I.search,A),_strictSearch:C,searchError:k};else{const q=KR(S)?"pending":"success";X={id:O,ssr:S.options.ssr,index:x,routeId:S.id,params:(z==null?void 0:z.params)??g,_strictParams:g,pathname:N,updatedAt:Date.now(),search:z?zl(z.search,A):A,_strictSearch:C,searchError:k,status:q,isFetching:!1,error:void 0,paramsError:V,context:{},abortController:(t==null?void 0:t._controller)??new AbortController,cause:$,loaderDeps:z?vo(z.loaderDeps,M):M,invalid:!1,preload:!1,staticData:S.options.staticData||{},fullPath:S.fullPath}}const B=d===S.id;X._notFound&&!B&&(X.error=void 0),X._notFound=B,f[x]=X}for(let x=0;x<f.length;x++){const S=f[x];S.params=S.cause==="stay"?zl(S.params,g):g,t!=null&&t._controller&&(S.context={})}return f}matchRoutesLightweight(e){const t=So(this.stores.ids.get()),s=t?this.stores.byRoute.get(t).get():void 0,i=s==null?void 0:s.id,o=this.lightweightCache.get(e);if(o&&o[0]===i)return o[1];const[l,u]=this.getMatchedRoutes(e.pathname),d=So(l),f={...e.search};for(const b of l)try{Object.assign(f,Uh(b.options.validateSearch,f))}catch{}const h=s&&s.routeId===d.id&&s.pathname===e.pathname;let p;if(h)p=s.params;else{const b=u;for(const w of l)try{QR(w,b)}catch{}p=b}const g=[l,d.fullPath,f,p];return this.lightweightCache.set(e,[i,g]),g}};async function $R(e,t,{replace:s,ignoreBlocker:i}){var o,l;if(!_2(t,e.protocolAllowlist)){if(!i){const u=e.history._getBlockers();for(const d of u)if(d!=null&&d.blockerFn&&await d.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:s?"REPLACE":"PUSH"}))return}(l=(o=e.history)._ignoreNextBeforeUnload)==null||l.call(o,t),s?window.location.replace(t):window.location.href=t}}var sm=class extends Error{},bP=class extends Error{};function Uh(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new sm("Async validation not supported");if(s.issues)throw new sm(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function $y(e,t){if(e===void 0||e===!0)return t;const s=Object.create(null);return e===!1||e===null?s:typeof e=="function"?(Object.assign(s,t),Object.assign(s,e(s))):Object.assign(s,t,e)}function xP(e,t){return typeof e=="function"?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(s=>typeof s!="string"&&!ix.call(e,s[1]))}const Qy=Object.freeze({});function wP(e,t){var i;const s=[];for(let o=0;o<e.length;o++){const l=e[o].options;if("search"in l)(i=l.search)!=null&&i.middlewares&&s.push(...l.search.middlewares);else if(l.preSearchFilters||l.postSearchFilters){const d=({search:f,next:h})=>{const p=h(l.preSearchFilters?l.preSearchFilters.reduce((g,b)=>b(g),f):f);return l.postSearchFilters?l.postSearchFilters.reduce((g,b)=>b(g),p):p};s.push(d)}const u=l.validateSearch;if(t&&u){const d=({search:f,next:h,meta:p})=>{const g=h(f);try{const b=Uh(u,g);if(p&&b)for(const w in b)w in g||(p.defaulted||(p.defaulted=new Map)).set(w,b[w]);return{...g,...b}}catch{}return g};s.push(d)}}return s}function SP(e,t,s){const i=(o,l,u)=>{if(o>=e.length){if(!s.search)return{};if(s.search===!0)return l;const f=O2(s.search,l);return u&&(u.explicit=f),f}const d=(f,h)=>{if(h){const p=u||{};return{search:i(o+1,f,p),meta:p}}return i(o+1,f,u)};return e[o]({search:l,next:d,meta:u})};return i(0,t)}function TP(e,t){if(e!=="root"){let s;for(let i=t.length-1;i>=0;i--){const o=t[i];if(o.options.notFoundComponent)return o.id;s||(s=o.children&&o.id)}if(s)return s}return Yl}function QR(e,t){var i;const s=((i=e.options.params)==null?void 0:i.parse)??e.options.parseParams;s&&Object.assign(t,s(t))}function eb(e,t){var s,i;return(i=(s=e.options[t])==null?void 0:s.preload)==null?void 0:i.call(s)}function RP(e,t){const s=eb(e,"component");let i=eb(e,"pendingComponent");return t&&(i?i=i.then(t):t()),s&&i?Promise.all([s,i]).then(()=>{}):s??i}function $l(e,t,s){const i=()=>t===!1?void 0:t?eb(e,t):RP(e,s),o=e._lazy;if(o)return o===!0?i():o.then(i);if(!e.lazyFn)return i();const l=e.lazyFn().then(u=>{{const{id:d,...f}=u.options;Object.assign(e.options,f),e._lazy=!0}},u=>{throw e._lazy=void 0,u});return e._lazy=l,l.then(i)}function lx(e){const t=e.findIndex(s=>s.status!=="success"||s._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function EP(e,t,s){const i=e._tx;return t&&(i==null?void 0:i[2])===s&&!i[3].some(o=>o.routeId===t)}const ji=0,mr=1,Lm=2,Qn=3,To=[4];function Yu(e){return typeof e[0]=="number"}function _a(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((s,i)=>{const o=()=>i(t);t.addEventListener("abort",o,{once:!0}),Promise.resolve(e).then(s,i).then(()=>t.removeEventListener("abort",o))})}function Ia(e,t){return e.routesById[t.routeId]}function $u(e,t,s){return L2(e)?[Qn,e]:mc(e)?(e.routeId||(e.routeId=s),[Lm,e]):t?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[mr,e]):[ji,e]}function cx(e,t){var i,o;let s=$u(t,!0,e.id);if(s[0]!==mr)return s;try{(o=(i=e.options).onError)==null||o.call(i,s[1])}catch(l){s=$u(l,!0,e.id)}return s}function Iu(e,t,s,i,o){return o[0].signal.aborted?To:fx(e,t,s,cx(s,i),o)}async function CP(e,t,s,i,o,l){var p,g;const[u,d]=t,f=s[0].signal,h=!!s[3];for(let b=s[6]??0;b<i;b++){const w=d[b],x=Ia(e,w);w.abortController=s[0];const S=((p=d[b-1])==null?void 0:p.context)??e.options.context??{},T={params:w.params,location:u,navigate:M=>e.navigate({...M,_fromLocation:u}),buildLocation:e.buildLocation,cause:h?"preload":w.cause,abortController:s[0],preload:h,matches:d,routeId:x.id};try{const M=w._ctx||(w._ctx=x.options.context?x.options.context({...T,deps:w.loaderDeps,context:S})||{}:void 0);w.context={...S,...M}}catch(M){return dr(e,w),[b,Iu(e,t,x,M,s)]}if(f.aborted)return[b,To];const A=w.paramsError??w.searchError;if(A!==void 0)return dr(e,w),[b,Iu(e,t,x,A,s)];const C=x.options.beforeLoad;if(!C)continue;const k=w.status;b>=l&&(w.status="pending",(g=s[7])==null||g.call(s));try{Qu(e,w,"beforeLoad",s[0]);const M=C({...T,search:w.search,context:w.context,...e.options.additionalContext}),D=await(typeof(M==null?void 0:M.then)=="function"?_a(M,f):M);if(f.aborted)return[b,To];const _=fx(e,t,x,$u(D,!1,x.id),s);if(_[0]!==ji)return dr(e,w),[b,_];w.context={...w.context,...D}}catch(M){return dr(e,w),[b,Iu(e,t,x,M,s)]}finally{w.status=k,Qu(e,w,!1,s[0])}}o()}function ux(e,t,s){var i;if(!(!s||--s[2])){if(((i=e._flights)==null?void 0:i.get(t.id))===s){const o=e._tx;if(o&&!o[0].signal.aborted&&!o[3].includes(t)&&o[3].some(l=>l.id===t.id)&&o[3].some(l=>l.isFetching==="beforeLoad"))return;e._flights.delete(t.id)}return s[1]}}function dr(e,t){var i;const s=t._flight;t._flight=void 0,(i=ux(e,t,s))==null||i.abort()}function ls(e,t,s,i){var l;const o=[];for(const u of t)if(!(s!=null&&s.includes(u))){const d=u._flight;if(u._flight=void 0,i&&(d==null?void 0:d[2])===1&&((l=e._flights)==null?void 0:l.get(u.id))===d&&(s!=null&&s.some(f=>f.id===u.id)))d[2]=0;else{const f=ux(e,u,d);f&&o.push(f)}}for(const u of o)u.abort()}function dx(e){for(const t of e){const s=t._flight;s&&s[2]++}}function Qu(e,t,s,i){var u;if(t.isFetching=s,i&&((u=e._tx)==null?void 0:u[0])!==i)return;const o=e.stores.byRoute.get(t.routeId),l=o==null?void 0:o.get();(l==null?void 0:l.id)===t.id&&o.set({...l,isFetching:s})}function G2(e,t,s,i,o,l,u){const d=t[0];return{params:s.params,location:d,navigate:f=>e.navigate({...f,_fromLocation:d}),cause:u?"preload":s.cause,abortController:o,preload:u,deps:s.loaderDeps,parentMatchPromise:l,context:s.context,route:i,...e.options.additionalContext}}async function XR(e,t,s,i,o,l,u){const d=u[0],f=d.signal;if(f.aborted)return To;if(!o)return[ji,void 0];let h=s._flight;Qu(e,s,"loader",d);try{if(!h){const p=new AbortController;h=[Promise.resolve().then(()=>o(G2(e,t,s,i,p,l,!!u[3]))).then(g=>$u(g,!1,i.id),g=>$u(g,!0,i.id)).then(g=>{var b;return g[0]!==ji&&((b=e._flights)==null?void 0:b.get(s.id))===h&&(e._flights.delete(s.id),h[2]||p.abort()),g[0]===mr&&h[2]?cx(i,g[1]):g}),p,1],(e._flights??(e._flights=new Map)).set(s.id,h)}return s._flight=h,s.abortController=h[1],fx(e,t,i,await _a(h[0],f),u)}catch(p){if(p!==f||!f.aborted)throw p;return dr(e,s),To}finally{Qu(e,s,!1,d)}}function ZR(e,t,s){t[0]!==Qn&&(e.status="success",e.error=void 0,t[0]===ji?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=s):e.invalid=!0)}function AP(e,t,s){const i=e._cache.get(t.id);if(i!==s||e._committed.some(l=>l.id===t.id&&l._flight===t._flight))return;const o={...t,_notFound:void 0,context:{}};o._flight&&o._flight[2]++,e._cache.set(t.id,o),i&&dr(e,i)}function WR(e,t){return t[0]===mr||t[0]===Lm?{...e,status:t[0]===mr?"error":"notFound",error:t[1],_flight:void 0}:e}function kP(e,t,s,i,o,l,u){var $,X;const d=t[1][s],f=Ia(e,d),h=!!l[3],p=e._cache.get(d.id);let g,b=!1,w;try{if(d.status==="success"&&(g=f.options.shouldReload,typeof g=="function"&&(g=g(G2(e,t,d,f,l[0],o,h))),l[0].signal.aborted&&(w=To)),!w)if(d.status!=="success")b=!0;else{const B=h||d.preload?f.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:f.options.staleTime??e.options.defaultStaleTime??0;b=!!(d.invalid||g||g===void 0&&Date.now()-d.updatedAt>=B&&(l[5]||d.cause==="enter"||l[2].some(q=>q.routeId===d.routeId&&q.id!==d.id)))}}catch(B){d.invalid=!0,dr(e,d),w=Iu(e,t,f,B,l)}const x=f.options.loader,S=typeof x=="function",T=S?x:x==null?void 0:x.handler,A=!h||f.options.preload!==!1;let C=A&&x?($=e._flights)==null?void 0:$.get(d.id):void 0;C===d._flight||w?C=void 0:C&&!b&&!h&&g===void 0?b=!0:b||(C=void 0);const k=!!(x&&b&&d.status==="success"&&!h&&!l[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),M=b&&A,D=M&&!k&&(d.status!=="success"||!!x),_=s>=u?l[7]:void 0,N=f.lazyFn&&f._lazy!==!0?_:void 0;if(M&&!x&&(d.invalid=!1,d.updatedAt=Date.now()),C&&C[2]++,D){const B=d._flight;d._flight=C,(X=ux(e,d,B))==null||X.abort(),s>=u&&(d.status="pending"),_==null||_()}M||(d.isFetching=!1);const O=!w&&D?XR(e,t,d,f,T,o,l).then(B=>(ZR(d,B,h),B[0]===ji&&(x&&!l[0].signal.aborted&&AP(e,d,p),s>=u&&(d.status="pending")),B)):Promise.resolve(w??[ji,d.loaderData]),z=(async()=>{try{const q=$l(f,void 0,N);q&&await _a(q,l[0].signal)}catch(q){if(!t[1].some((F,ie)=>ie<=s&&(F.status==="error"||F.status==="notFound"||F._notFound)))return[s,Iu(e,t,f,q,l)]}const B=await O;D&&B[0]===ji&&d.status==="pending"&&!l[0].signal.aborted&&(d.status="success",_==null||_())})();if(i.push([s,O,z]),!k)return O.then(B=>WR(d,B));const I={...d,status:"pending",preload:!1,_flight:C};d.invalid=!1,d.isFetching="loader";const V=XR(e,t,I,f,T,o,l).then(B=>(d.isFetching=!1,ZR(I,B,!1),B));return(t[2]??(t[2]=[])).push([s,V,z,I]),V.then(B=>WR(I,B))}async function tb(e,t,s,i,o=0){const l=s==null?void 0:s[1][1];let u=l!=null&&l.routeId?t.findIndex(d=>d.routeId===l.routeId):(s==null?void 0:s[0])??t.length-1;u<0&&(u=0);for(let d=u;d>=0;d--){const f=Ia(e,t[d]);try{const h=$l(f,!1);h&&await _a(h,i)}catch(h){if(h===i&&i.aborted)throw h}if(f.options.notFoundComponent)return d}return l!=null&&l.routeId?u:o}function Sa(e,t){t[2]&&(ls(e,t[2].map(s=>s[3])),t[2]=void 0)}async function JR(e,t,s,i){let o;try{await Promise.all(e.map(l=>l[1].then(async u=>{const d=l[0];if(!(i&&d>=await i)){if(u[0]>=Qn)throw[d,u];!o&&u[0]!==ji&&(o=[d,u],await Promise.all((s??[]).map(f=>{if(!(f[0]<=d))return f[1].then(h=>{if(h[0]===Qn)throw[f[0],h]})})))}})))}catch(l){return l}return t??o}function fx(e,t,s,i,o,l){for(;i[0]===Qn;){const u=i[1],d=u.options;try{if((d.href||u.headers.has("Location"))&&(e.resolveRedirect(u),d.reloadDocument)||(d.reloadDocument?o[3]:o[1]>=20))return i;const f=e.buildLocation({...d,_fromLocation:t[0],_includeValidateSearch:!0}),h=f.maskedLocation??f;if(h.external){const p=u.clone();return p.options={...d},p.headers.set("Location",h.publicHref),e.resolveRedirect(p),o[3]?[Qn,p]:[Qn,p,h]}return[Qn,u,f]}catch(f){i=l?[mr,f]:cx(s,f),l=!0}}return i}async function K2(e,t,s,i,o,l){const u=t[1];let d=await o,f=!1;const h=u.findIndex(w=>w._notFound),p=w=>w[1][0]===Lm?tb(e,u,w,i.signal):w[0];let g=h<0?u.length:h;if(((d==null?void 0:d[1][0])??0)>=Qn)g=0;else if(d){g=d[2]??(d[2]=await p(d));for(const w of s){if(w[0]>=g)break;const x=await w[1];if(x[0]!==ji&&x[0]<Qn&&!("loaderData"in u[w[0]])){d=[w[0],x],g=d[2]=await p(d);break}}}for(const w of s){if(w[0]>=g)break;const x=await w[2];if(x){d=x;break}}if(((d==null?void 0:d[1][0])??0)>=Qn){const w=d[1];if(w[0]!==Qn||w[1].options.reloadDocument||w[2])return Sa(e,t),w;f=!0,d=[0,[mr,new Error("Too many redirects")]]}const b=d?d[2]??await p(d):h;if(b>=0){const w=d==null?void 0:d[1],x=w==null?void 0:w[0],S=u[b],T=w==null?void 0:w[1],A=()=>{w&&(S._notFound=void 0,x===mr?S.status="error":(T.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=T,S.isFetching=!1)};A(),w||l==null||l();const C=Ia(e,S);try{await _a(w?Promise.resolve().then(()=>$l(C,x===mr?"errorComponent":"notFoundComponent")):Promise.all([$l(C),$l(C,"notFoundComponent")]),i.signal)}catch(k){if(k===i.signal&&i.signal.aborted)return Sa(e,t),To}w?f&&(i.abort(),await Promise.all([...s.map(k=>k[1]),...s.map(k=>k[2]),...(t[2]??[]).map(k=>k[1])]),Sa(e,t),ls(e,u),A()):S.status="success"}return t}async function Y2(e,t,s,i=0,o=t[1].length){var u,d;const l=t[1];for(let f=i;f<o;f++){const h=l[f],p=Ia(e,h).options;if(p.head||p.scripts)try{const g={ssr:e.options.ssr,matches:l,match:h,params:h.params,loaderData:h.loaderData},[b,w]=await _a(Promise.all([(u=p.head)==null?void 0:u.call(p,g),(d=p.scripts)==null?void 0:d.call(p,g)]),s);h.meta=b==null?void 0:b.meta,h.links=b==null?void 0:b.links,h.headScripts=b==null?void 0:b.scripts,h.styles=b==null?void 0:b.styles,h.scripts=w}catch(g){if(g===s&&s.aborted)break;console.error(g)}if(h.status!=="success"||h._notFound)break}return t}async function $2(e,t,s,i){var d;const o=[t,s],l=i[0].signal;let u;try{const f=e.stores.matches.get();let h=s.findIndex(C=>C._notFound);if(e.options.notFoundMode!=="root"&&h>=0){const C=await tb(e,s,void 0,l,h);s[h]._notFound=void 0,s[C]._notFound=!0,h=C}let p=h<0?s.length:h+1,g=0;for(;g<p&&g!==h;){const C=s[g],k=i[2][g],M=f[g];if((k==null?void 0:k.id)!==C.id||k.status!=="success"||C.preload||(M==null?void 0:M.id)!==C.id||M.status!=="success"||(g++,k._notFound||M._notFound))break}const b=[],w=i[6]??0;let x=w?Promise.resolve(s[w-1]):void 0;const S=()=>{for(let C=w;C<p&&!l.aborted;C++)x=kP(e,o,C,b,x,i,g)},T=await CP(e,o,i,p,S,g);if(T){if(i[4]=!0,p=T[0],T[1][0]===Lm){const C=await tb(e,s,T,l);T[2]=C,p=Math.min(p,C+1)}else T[1][0]>=Qn&&(p=0);S()}if(!l.aborted&&!i[3]){const C=[];for(const[k,M]of e._flights??[])M[2]||(e._flights.delete(k),C.push(M[1]));for(const k of C)k.abort()}const A=K2(e,o,b,i[0],JR(b,T,o[2]),i[7]);(d=o[2])!=null&&d.length&&(o[3]=JR(o[2],void 0,void 0,A.then(C=>Yu(C)?0:lx(s).length,()=>0))),u=await A}catch(f){if(Sa(e,o),f===l&&l.aborted)return To;throw f}return Yu(u)?u:Y2(e,u,l,i[6]===s.length?i[6]:0)}function nb(e,t){var l,u;if(e._tx!==t)return;const s=t[3],i=e.stores.matches.get();let o=e._pending;for(let d=0;d<s.length;d++){const f=s[d],h=f.status==="success"&&!f._notFound,p=((l=i[d])==null?void 0:l.id)===f.id&&((u=i[d])==null?void 0:u.status)==="pending";if(h&&!p)continue;const g=Ia(e,f),b=h||f.invalid?0:g.options.pendingMs??e.options.defaultPendingMs,w=g.options.pendingComponent??e.options.defaultPendingComponent;if(!w||typeof b!="number"||b===1/0){o&&(o[0]=t,o[2]=0,o[4]=!0);return}const x=g.options.pendingMinMs??e.options.defaultPendingMinMs??0;let S=!1;if((o==null?void 0:o[1])===f.id?(S=o[0]!==t,o[0]=t):(clearTimeout(o==null?void 0:o[3]),e._pending=o=void 0),o||(e._pending=o=[t,f.id,p?Date.now()+x:t[4]+b,void 0,p||void 0,w]),o[4]&&!S&&o[5]===w)return;if(o[5]=w,!o[4]){clearTimeout(o[3]);const C=o[2]-Date.now();if(C>0){o[3]=setTimeout(()=>nb(e,t),C);return}o[2]=0}const T=s.map(C=>({...C,_flight:void 0}));T[d].status="pending";const A=o[4]=e.startTransition(()=>e.stores.setMatches(T),T).then(C=>(C&&e._pending===o&&o[4]===A&&!o[2]&&(o[2]=Date.now()+x),C));return}}function wu(e,t){var i;const s=e._pending;(e._tx===t||!((i=e._tx)!=null&&i[3].some(o=>o.id===(s==null?void 0:s[1]))))&&(clearTimeout(s==null?void 0:s[3]),e._pending=void 0)}async function eE(e,t){const s=e._pending;if(!s)return;clearTimeout(s[3]);const i=s[2]-Date.now();if(!s[4]||i<=0||!lx(t[3]).some(l=>l.id===s[1]))return;let o;try{await _a(new Promise(l=>{o=setTimeout(l,i)}),t[0].signal)}catch{}clearTimeout(o)}function Q2(e,t){e._committed=t,e.stores.setMatches(t)}function MP(e,t,s,i){const o=e._committed,l=e._lifecycleEnd,u=e._cache;for(const p of s)p.preload=!1,i&&(p._assetEnd=void 0);const d=lx(s).length,f=new Map;{const p=Date.now(),g=new Set;for(let b=0;b<s.length;b++){const w=s[b];(b<d||w.status==="success")&&g.add(w.id)}for(const b of[...o,...u.values()]){if(b.status!=="success"||g.has(b.id))continue;const w=Ia(e,b);!w.options.loader||p-b.updatedAt>=(b.preload?w.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:w.options.gcTime??e.options.defaultGcTime??3e5)||f.set(b.id,u.get(b.id)===b?b:{...b,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=f;const h=e._lifecycleEnd=gP(s);Q2(e,s),ls(e,[...u.values(),...o].filter(p=>p._flight&&f.get(p.id)!==p),s),yP(e,o,s,l,h,t)}async function fh(e,t){let s=e._tx;for(;s&&s!==t;)t=s,await s[5],s=e._tx}function X2(e,t,s){const i=s[1].options,o=s[2];if(!o)return e.navigate({...i,replace:!0,ignoreBlocker:!0});if(i.reloadDocument)return e.navigate({href:(o.maskedLocation??o).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});o._redirects=t[1]+1,e._pendingLocation=o;const l=e.commitLocation({...o,viewTransition:i.viewTransition,replace:!0,resetScroll:i.resetScroll,hashScrollIntoView:i.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===o&&(e._pendingLocation=void 0)}),l}async function NP(e,t,s,i,o){const l=s.map(f=>({...f}));dx(l);for(const f of i)dr(e,l[f[0]]),l[f[0]]=f[3];const u=[t[2],l];let d;try{d=await K2(e,u,i,t[0],o)}catch(f){throw ls(e,l),f}if(Yu(d)){ls(e,l),d[0]===Qn&&e._tx===t&&e._committed===s&&await X2(e,t,d);return}if(await Y2(e,d,t[0].signal),e._tx!==t||e._committed!==s){ls(e,l);return}for(const f of l){const h=e._cache.get(f.id);h!=null&&h._flight&&h._flight===f._flight&&(e._cache.delete(f.id),dr(e,h))}Q2(e,l),ls(e,s,l)}async function OP(e,t,s,i,o,l){const u=await $2(e,t[2],t[3],[t[0],t[1],e._committed,void 0,o,s,l,i]);if(Yu(u)){const g=u[0]===Qn&&e._tx===t;if((!g||u[1].options.reloadDocument)&&wu(e,t),ls(e,t[3]),t[3]=[],!g)return;if(e._tx!==t){wu(e,t);return}await X2(e,t,u);return}const d=u[1];if(e._tx===t&&await eE(e,t),e._tx!==t){wu(e,t),ls(e,d),Sa(e,u);return}const f=t[2],h=zm(f,e.stores.resolvedLocation.get()),p=u[2];await e.startViewTransition(async()=>{var w;if(e._tx===t&&await eE(e,t),e._tx!==t){wu(e,t),ls(e,d),Sa(e,u);return}const g=()=>{wu(e,t),MP(e,t,d,l),e._tx===t&&(e.emit({type:"onLoad",...h}),e._tx===t&&e.emit({type:"onBeforeRouteMount",...h}))},b=await e.startTransition(g,d);if(e._tx!==t){Sa(e,u);return}p!=null&&p.length&&NP(e,t,d,p,u[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(f),e.stores.status.set("idle"),e._tx===t&&e.emit({type:"onResolved",...h}),b&&e._tx===t&&e.emit({type:"onRendered",...h})}),e._tx===t&&((w=e._commitPromise)==null||w.resolve(),e._commitPromise=void 0)})}async function jP(e,t){var M;const s=e._tx,i=e.stores.resolvedLocation.get(),o=i??e.stores.location.get(),l=e.latestLocation,u=e._pendingLocation,d=(u==null?void 0:u.href)===l.href?u._redirects??0:0,f=e._handoff,h=f==null?void 0:f[0](),p=new AbortController,g=e._preflight;if(e._preflight=p,h||f==null||f[1](),g==null||g.abort(),!p.signal.aborted){const D=zm(l,i);e.emit({type:"onBeforeNavigate",...D}),p.signal.aborted||e.emit({type:"onBeforeLoad",...D})}if(p.signal.aborted){await fh(e,s);return}const b=o.href===l.href;let w=p;const x=e.matchRoutes(l,{_controller:p});dx(x);const S=h?f[1](x):void 0;if(S?w=h:h==null||h.abort(),p.signal.aborted){ls(e,x),await fh(e,s);return}e._preflight=void 0;let T;const A=()=>OP(e,k,b,()=>nb(e,k),t==null?void 0:t.sync,S),C=t!=null&&t.sync?new Promise(D=>T=D):Promise.resolve().then(A),k=[w,d,l,x,Date.now(),C.then(()=>fh(e,k))];if(e._tx=k,s){for(const D of e.stores.matches.get()){if(e._tx!==k)break;D.isFetching&&Qu(e,D,!1)}s[0].abort(),ls(e,s[3],k[3],!0)}if(e._tx!==k){ls(e,k[3]),k[3]=[],T==null||T(),await fh(e,k);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(l)}),(S||!e._committed.length&&((M=x[0])==null?void 0:M.status)!=="success"&&!x.some(D=>D._notFound))&&nb(e,k),T==null||T(A()),await k[5]}async function DP(e,t){let s=e.buildLocation(t);for(let i=0;;i++){const o=e._committed,l=new AbortController;let u,d,f;try{try{u=e.matchRoutes(s,{_controller:l}),dx(u),d=(e._preloads??(e._preloads=new Map)).set(l,u),f=await $2(e,s,u,[l,i,o,!0])}finally{d&&(d=d.delete(l),ls(e,u)),l.abort()}if(!Yu(f))return f[1];if(!d||f.length<3)return;s=f[2]}catch(h){mc(h)||console.error(h);return}}}const _P="Error preloading route! ☝️";var Z2=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var f,h;this.originalIndex=t,this._branch=void 0;const s=this.options,i=!(s!=null&&s.path)&&!(s!=null&&s.id);this.parentRoute=(h=(f=this.options).getParentRoute)==null?void 0:h.call(f),i?this._path=Yl:this.parentRoute||rx();let o=i?Yl:s==null?void 0:s.path;o&&o!=="/"&&(o=I2(o));const l=(s==null?void 0:s.id)||o,u=i?Yl:Gl((this.parentRoute.id==="__root__"?"":this.parentRoute.id)+"/"+(l??""));o==="__root__"&&(o="/");const d=u==="__root__"?"/":o===void 0?this.parentRoute.fullPath:Gl(this.parentRoute.fullPath+"/"+o);this._path=o,this._id=u,this._fullPath=d,this._to=Mi(d)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>eP({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},IP=class extends Z2{constructor(e){super(e)}},hx=class extends E.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){const s=e.getResetKey();return t.error&&t.resetKey!==s?{resetKey:s,error:0}:{resetKey:s}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){var s,i;(i=(s=this.props).onCatch)==null||i.call(s,e,t)}render(){const e=this.state.error;return e?E.createElement(this.props.errorComponent??PP,{error:e[0],reset:this.reset}):this.props.children}};function PP({error:e}){const[t,s]=E.useState(!1);return v.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[v.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),v.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(i=>!i),children:t?"Hide Error":"Show Error"})]}),v.jsx("div",{style:{height:".25rem"}}),t?v.jsx("div",{children:v.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e!=null&&e.message?v.jsx("code",{children:e.message}):null})}):null]})}var tE=()=>!0,zP=()=>!1;function LP({children:e,fallback:t=null}){return v.jsx(Sd.Fragment,{children:BP()?e:t})}function BP(e=!0){return Sd.useSyncExternalStore(UP,tE,e?zP:tE)}function UP(){return()=>{}}var W2=E.createContext(null);function Vs(e){return E.useContext(W2)}function VP(e,t){const s=e.stores.location,i=new Set;let o,l;const u=d=>{EP(e,t,d)||(o=d,i.forEach(f=>f()))};return[()=>o??s.get(),d=>(i.size||(o=s.get(),l=s.subscribe(u).unsubscribe),i.add(d),()=>{i.delete(d),i.size||(l(),o=void 0)})]}var Xu=E.createContext(void 0),FP=E.createContext(void 0);function qP({update:e,notify:t,unwatched:s}){return{link:i,unlink:o,propagate:l,checkDirty:u,shallowPropagate:d};function i(h,p,g){const b=p.depsTail;if(b!==void 0&&b.dep===h)return;const w=b!==void 0?b.nextDep:p.deps;if(w!==void 0&&w.dep===h){w.version=g,p.depsTail=w;return}const x=h.subsTail;if(x!==void 0&&x.version===g&&x.sub===p)return;const S=p.depsTail=h.subsTail={version:g,dep:h,sub:p,prevDep:b,nextDep:w,prevSub:x,nextSub:void 0};w!==void 0&&(w.prevDep=S),b!==void 0?b.nextDep=S:p.deps=S,x!==void 0?x.nextSub=S:h.subs=S}function o(h,p=h.sub){const g=h.dep,b=h.prevDep,w=h.nextDep,x=h.nextSub,S=h.prevSub;return w!==void 0?w.prevDep=b:p.depsTail=b,b!==void 0?b.nextDep=w:p.deps=w,x!==void 0?x.prevSub=S:g.subsTail=S,S!==void 0?S.nextSub=x:(g.subs=x)===void 0&&s(g),w}function l(h){let p=h.nextSub,g;e:do{const b=h.sub;let w=b.flags;if(w&60?w&12?w&4?!(w&48)&&f(h,b)?(b.flags=w|40,w&=1):w=0:b.flags=w&-9|32:w=0:b.flags=w|32,w&2&&t(b),w&1){const x=b.subs;if(x!==void 0){const S=(h=x).nextSub;S!==void 0&&(g={value:p,prev:g},p=S);continue}}if((h=p)!==void 0){p=h.nextSub;continue}for(;g!==void 0;)if(h=g.value,g=g.prev,h!==void 0){p=h.nextSub;continue e}break}while(!0)}function u(h,p){let g,b=0,w=!1;e:do{const x=h.dep,S=x.flags;if(p.flags&16)w=!0;else if((S&17)===17){if(e(x)){const T=x.subs;T.nextSub!==void 0&&d(T),w=!0}}else if((S&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(g={value:h,prev:g}),h=x.deps,p=x,++b;continue}if(!w){const T=h.nextDep;if(T!==void 0){h=T;continue}}for(;b--;){const T=p.subs,A=T.nextSub!==void 0;if(A?(h=g.value,g=g.prev):h=T,w){if(e(p)){A&&d(T),p=h.sub;continue}w=!1}else p.flags&=-33;p=h.sub;const C=h.nextDep;if(C!==void 0){h=C;continue e}}return w}while(!0)}function d(h){do{const p=h.sub,g=p.flags;(g&48)===32&&(p.flags=g|16,(g&6)===2&&t(p))}while((h=h.nextSub)!==void 0)}function f(h,p){let g=p.depsTail;for(;g!==void 0;){if(g===h)return!0;g=g.prevDep}return!1}}function HP(e,t,s){var l,u,d;const i=typeof e=="object",o=i?e:void 0;return{next:(l=i?e.next:e)==null?void 0:l.bind(o),error:(u=i?e.error:t)==null?void 0:u.bind(o),complete:(d=i?e.complete:s)==null?void 0:d.bind(o)}}const sb=[];let Vh=0;const{link:nE,unlink:GP,propagate:KP,checkDirty:J2,shallowPropagate:sE}=qP({update(e){return e._update()},notify(e){sb[ib++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,im(e))}});let hh=0,ib=0,Js,rb=0;function YP(e){try{++rb,e()}finally{--rb||ek()}}function im(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=GP(s,e)}function ek(){if(!(rb>0)){for(;hh<ib;){const e=sb[hh];sb[hh++]=void 0,e.notify()}hh=0,ib=0}}function iE(e,t){const s=typeof e=="function",i=e,o={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?0:1,get(){return Js!==void 0&&nE(o,Js,Vh),o._snapshot},subscribe(l){const u=HP(l),d={current:!1},f=$P(()=>{var h;o.get(),d.current?(Js=void 0,(h=u.next)==null||h.call(u,o._snapshot)):d.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(l){const u=Js,d=(t==null?void 0:t.compare)??Object.is;if(s)Js=o,++Vh,o.depsTail=void 0;else if(l===void 0)return!1;s&&(o.flags=5);try{const f=o._snapshot,h=typeof l=="function"?l(f):l===void 0&&s?i(f):l;return f===void 0||!d(f,h)?(o._snapshot=h,!0):!1}finally{Js=u,s&&(o.flags&=-5),im(o)}}};return s?(o.flags=17,o.get=function(){const l=o.flags;if(l&16||l&32&&J2(o.deps,o)){if(o._update()){const u=o.subs;u!==void 0&&sE(u)}}else l&32&&(o.flags=l&-33);return Js!==void 0&&nE(o,Js,Vh),o._snapshot}):o.set=function(l){if(o._update(l)){const u=o.subs;u!==void 0&&(KP(u),sE(u),ek())}},o}function $P(e){const t=()=>{const i=Js;Js=s,++Vh,s.depsTail=void 0,s.flags=6;try{return e()}finally{Js=i,s.flags&=-5,im(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const i=this.flags;i&16||i&32&&J2(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,im(this)}};return t(),s}var Xy={exports:{}},Zy={},Wy={exports:{}},Jy={};/**
19
- * @license React
20
- * use-sync-external-store-shim.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var rE;function QP(){if(rE)return Jy;rE=1;var e=wd();function t(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}var s=typeof Object.is=="function"?Object.is:t,i=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(g,b){var w=b(),x=i({inst:{value:w,getSnapshot:b}}),S=x[0].inst,T=x[1];return l(function(){S.value=w,S.getSnapshot=b,f(S)&&T({inst:S})},[g,w,b]),o(function(){return f(S)&&T({inst:S}),g(function(){f(S)&&T({inst:S})})},[g]),u(w),w}function f(g){var b=g.getSnapshot;g=g.value;try{var w=b();return!s(g,w)}catch{return!0}}function h(g,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:d;return Jy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Jy}var oE;function tk(){return oE||(oE=1,Wy.exports=QP()),Wy.exports}/**
27
- * @license React
28
- * use-sync-external-store-shim/with-selector.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var aE;function XP(){if(aE)return Zy;aE=1;var e=wd(),t=tk();function s(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var i=typeof Object.is=="function"?Object.is:s,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,f=e.useDebugValue;return Zy.useSyncExternalStoreWithSelector=function(h,p,g,b,w){var x=l(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=d(function(){function A(_){if(!C){if(C=!0,k=_,_=b(_),w!==void 0&&S.hasValue){var N=S.value;if(w(N,_))return M=N}return M=_}if(N=M,i(k,_))return N;var O=b(_);return w!==void 0&&w(N,O)?(k=_,N):(k=_,M=O)}var C=!1,k,M,D=g===void 0?null:g;return[function(){return A(p())},D===null?void 0:function(){return A(D())}]},[p,g,b,w]);var T=o(h,x[0],x[1]);return u(function(){S.hasValue=!0,S.value=T},[T]),f(T),T},Zy}var lE;function ZP(){return lE||(lE=1,Xy.exports=XP()),Xy.exports}var nk=ZP();function WP(e,t){return e===t}function Aa(e,t=i=>i,s){const i=(s==null?void 0:s.compare)??WP,o=E.useCallback(u=>{const{unsubscribe:d}=e.subscribe(u);return d},[e]),l=E.useCallback(()=>e.get(),[e]);return nk.useSyncExternalStoreWithSelector(o,l,l,t,i)}var cE={};function JP(e,t){const s=E.useRef();return i=>{const o=e!=null&&e.select?e.select(i):i;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?s.current=vo(s.current,o):o}}function Pa(e){const t=Vs(),s=E.useContext(e.from?FP:Xu),i=e.from??s,o=t.stores.getMatchStore(i),l=JP(e,t),u=Aa(o,d=>d?l(d):cE);if(u!==cE)return u;(e.shouldThrow??!0)&&rx()}function sk(e){return Pa({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ik(e){const{select:t,...s}=e;return Pa({...s,select:i=>t?t(i.loaderDeps):i.loaderDeps})}function mx(e){return Pa({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function rk(e){return Pa({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function si(e){const t=Vs();return E.useCallback(s=>t.navigate({...s,from:s.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function e5(e){const t=Vs(),s=si(),i=E.useRef(null);return sx(()=>{i.current!==e&&(s(e),i.current=e)},[t,e,s]),null}function ok(e){return Pa({...e,select:t=>e.select?e.select(t.context):t.context})}function t5(...e){const t=E.useRef(e),s=t.current;return e.forEach((i,o)=>{hr(s[o],i,!1,!0)||(s[o]=i)}),t.current}function mh(e,t){e.preloadRoute(t).catch(s=>{console.warn(s),console.warn(_P)})}function n5(e,t){const s=typeof e=="string"&&Gu(e);if(s)return t.has(s)?e:null}function s5(e,t,s,i){const o=zR(e.pathname,i),l=zR(t.pathname,i);return(s!=null&&s.exact?o!==l:!(o.startsWith(l)&&(o.length===l.length||o[l.length]==="/")))||((s==null?void 0:s.includeSearch)??!0)&&!hr(e.search,t.search,!(s!=null&&s.exact),s==null?void 0:s.explicitUndefined)?!1:!(s!=null&&s.includeHash)||e.hash===t.hash}function i5(e,t,s){var ee,ve;const i=Vs(),o=E.useRef(null),l=E.useCallback(P=>{if(o.current=P,typeof t=="function")return t(P);t&&(t.current=P)},[t]),{activeOptions:u,to:d,preload:f,preloadDelay:h,disabled:p,target:g,onClick:b,onBlur:w,onFocus:x,onMouseEnter:S,onMouseLeave:T,onTouchStart:A}=e,[C,k,M]=t5(e.search,e.params,u),D=E.useContext(Xu),_=(ve=(ee=i.stores)._linkScopes??(ee._linkScopes={}))[D]??(ve[D]=VP(i,D)),[N,O,z]=E.useMemo(()=>{const P=n5(d,i.protocolAllowlist);if(P!==void 0){const ye=[P??void 0];return[e,()=>ye]}const K={...e};let L,H,fe;const oe=()=>{const ye=_[0]();if(ye!==L){K._fromLocation=ye;const ce=i.buildLocation(K),me=c5(ce,i,p),ze=p||me&&!Gu(me)?s5(ye,ce,M,i.basepath):void 0;(!H||H[0]!==me||H[1]!==ze)&&(H=[me,ze]),L=ye}return H};return[K,oe,(M==null?void 0:M.includeHash)&&(()=>{const ye=oe();return ye[1]?fe??(fe=[ye[0],!1]):ye})]},[i,_,e.from,e.hash,e.href,d,C,k,e.state,e.mask,e.unsafeRelative,M,p]),[I,V]=E.useSyncExternalStore(_[1],O,z||O),$=V===void 0&&I,X=p||I===void 0,B=E.useRef(!1),q=e.reloadDocument||$||X?!1:f??i.options.defaultPreload,F=h??i.options.defaultPreloadDelay??0,ie=E.useCallback(P=>{const K=P==null?void 0:P.isIntersecting;if(!(K??q==="intent")){K===!1&&ph(o);return}if(!F){mh(i,N);return}o.t??(o.t=setTimeout(()=>{o.t=void 0,mh(i,N)},F))},[i,N,o,q,F]);E.useEffect(()=>{if(!q)return;q==="render"&&!B.current&&(B.current=!0,mh(i,N));let P=!0,K;return q==="viewport"&&o.current&&typeof IntersectionObserver=="function"&&(K=new IntersectionObserver(L=>{P&&ie(L.pop())},{rootMargin:"100px"}),K.observe(o.current)),()=>{P=!1,K==null||K.disconnect(),ph(o)}},[i,N,q,ie,o]);const Q=a5(e,s);if(Q.ref=t?l:o,$)return Q.href=$,Q;const ae=P=>{const K=g??P.currentTarget.getAttribute("target");!X&&!(P.metaKey||P.altKey||P.ctrlKey||P.shiftKey)&&!P.defaultPrevented&&(!K||K==="_self")&&P.button===0&&(P.preventDefault(),ph(o),i.navigate({...e,_fromLocation:N._fromLocation}))},ne=()=>{q==="intent"&&mh(i,N)},pe=()=>{q==="intent"&&ph(o)};return Q.onClick=Ll(b,ae),Q.onBlur=Ll(w,pe),Q.onFocus=Ll(x,ie),Q.onMouseEnter=Ll(S,ie),Q.onMouseLeave=Ll(T,pe),Q.onTouchStart=Ll(A,ne),l5(Q,e,V,I,X,s)}var r5={},o5={className:"active"},ak=new Set(["to","params","search","hash","state","mask","from","unsafeRelative","reloadDocument","preload","preloadDelay","preloadIntentProximity","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","ignoreBlocker","activeProps","inactiveProps","activeOptions","_asChild"]);function a5(e,t){const s={};for(const i in e)ak.has(i)||i==="type"&&t!==void 0||i==="disabled"&&t==="a"||(s[i]=e[i]);return s}function l5(e,t,s,i,o,l){const{activeProps:u,inactiveProps:d,className:f,style:h,target:p}=t,g=O2(s?u:d,{})??(s?o5:r5);Object.assign(e,g),e.href=i,l!=="a"&&(e.disabled=o),e.target=p;const b=g.style;(h||b)&&(e.style=h&&b?{...h,...b}:h||b);const w=g.className;return(f||w)&&(e.className=f?w?`${f} ${w}`:f:w),o&&(e.role="link",e["aria-disabled"]=!0),s&&(e["data-status"]="active",e["aria-current"]="page"),e}var ph=e=>{clearTimeout(e.t),e.t=void 0},Ll=(e,t)=>e?s=>s.defaultPrevented||(e(s),s.defaultPrevented||t(s)):t;function c5(e,t,s){if(s)return;const i=e.maskedLocation??e,o=i.external?i.publicHref:t.history.createHref(i.publicHref)||"/";if(!((i.external||o!==i.publicHref)&&_2(o,t.protocolAllowlist)))return o}var $n=E.memo(E.forwardRef((e,t)=>{const s=e._asChild||"a",i=i5(e,t,s),o=typeof e.children=="function"?e.children({isActive:i["data-status"]==="active"}):e.children;return E.createElement(s,i,o)}),u5);function u5(e,t){let s=0;for(const i in t)if(s++,e[i]!==t[i]&&(!ak.has(i)||!hr(e[i],t[i],!1,!0)))return!1;for(const i in e)s--;return s===0}var d5=class extends Z2{constructor(e){super(e),this.useMatch=t=>Pa({...t,from:this.id}),this.useRouteContext=t=>ok({...t,from:this.id}),this.useSearch=t=>rk({...t,from:this.id}),this.useParams=t=>mx({...t,from:this.id}),this.useLoaderDeps=t=>ik({...t,from:this.id}),this.useLoaderData=t=>sk({...t,from:this.id}),this.useNavigate=()=>si({from:this.fullPath}),this.Link=Sd.forwardRef((t,s)=>v.jsx($n,{ref:s,from:this.fullPath,...t}))}};function za(e){return new d5(e)}var f5=class extends IP{constructor(e){super(e),this.useMatch=t=>Pa({...t,from:this.id}),this.useRouteContext=t=>ok({...t,from:this.id}),this.useSearch=t=>rk({...t,from:this.id}),this.useParams=t=>mx({...t,from:this.id}),this.useLoaderDeps=t=>ik({...t,from:this.id}),this.useLoaderData=t=>sk({...t,from:this.id}),this.useNavigate=()=>si({from:this.fullPath}),this.Link=Sd.forwardRef((t,s)=>v.jsx($n,{ref:s,from:this.fullPath,...t}))}};function h5(e){return new f5(e)}function m5(e){const t=Vs(),s=`not-found-${Aa(t.stores.location,i=>i.pathname)}-${Aa(t.stores.status)}`;return v.jsx(hx,{getResetKey:()=>s,onCatch:(i,o)=>{var l;if(mc(i))(l=e.onCatch)==null||l.call(e,i,o);else throw i},errorComponent:({error:i})=>{var o;if(mc(i))return(o=e.fallback)==null?void 0:o.call(e,i);throw i},children:e.children})}function p5(){return v.jsx("p",{children:"Not Found"})}function lk(e,t,s){return t.options.notFoundComponent?v.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?v.jsx(e.options.defaultNotFoundComponent,{...s}):v.jsx(p5,{})}function Bm(e,t){const s=(t==null?void 0:t.options.pendingComponent)??e.options.defaultPendingComponent;return s?v.jsx(s,{}):null}var g5=(e,t)=>e[0]===t[0]&&e[1]===t[1],ck=(e,t,s)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||s===!1||s==="data-only"||!e.ssr,uk=E.memo(function({routeId:t}){const s=Vs(),i=s.stores.getMatchStore(t);return y5(s,Aa(i))});function y5(e,t){var b,w;const s=e.routesById[t.routeId],i=Bm(e,s),o=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,u=s.isRoot?s.options.notFoundComponent??((b=e.options.notFoundRoute)==null?void 0:b.options.component):s.options.notFoundComponent,d=t.ssr===!1||t.ssr==="data-only",f=ck(e,s,t.ssr)&&(s.options.wrapInSuspense??i??(((w=s.options.errorComponent)==null?void 0:w.preload)||d));let h=v.jsx(v5,{match:t});d&&(h=v.jsx(LP,{fallback:i,children:h})),u&&(h=v.jsx(m5,{fallback:x=>{if(x.routeId??(x.routeId=t.routeId),x.routeId!==t.routeId)throw x;return E.createElement(u,x)},children:h})),o&&(h=v.jsx(hx,{getResetKey:()=>t,errorComponent:o,onCatch:(x,S)=>{if(mc(x))throw x.routeId??(x.routeId=t.routeId),x;l==null||l(x,S)},children:h})),f&&(h=v.jsx(E.Suspense,{fallback:i,children:h}));const p=null,g=s.isRoot&&s.options.shellComponent;return g?v.jsx(Xu.Provider,{value:t.routeId,children:v.jsxs(g,{children:[h,p]})}):v.jsxs(Xu.Provider,{value:t.routeId,children:[h,p]})}var v5=E.memo(function({match:t}){const s=Vs(),i=t.routeId,o=s.routesById[i],l=E.useMemo(()=>{var f;const d=(f=o.options.remountDeps??s.options.defaultRemountDeps)==null?void 0:f({routeId:i,loaderDeps:t.loaderDeps,params:t._strictParams,search:t._strictSearch});return d?JSON.stringify(d):void 0},[i,t.loaderDeps,t._strictParams,t._strictSearch,o.options.remountDeps,s.options.defaultRemountDeps]),u=E.useMemo(()=>{const d=o.options.component??s.options.defaultComponent;return d?v.jsx(d,{},l):v.jsx(px,{})},[l,o.options.component,s.options.defaultComponent]);if(t.status==="pending"){if(s.ssr&&!ck(s,o,t.ssr))return u;if(s._tx)throw s._tx[5];return Bm(s,o)}if(t.status==="notFound")return lk(s,o,t.error);if(t.status==="error")throw t.error;return u}),px=E.memo(function(){const t=Vs(),s=E.useContext(Xu);let i,o,l;{const d=t.stores.getMatchStore(s);[i,o]=Aa(d,f=>[!!f._notFound,f.error],{compare:g5}),l=Aa(t.stores.ids,f=>f[f.indexOf(s)+1])}if(i)return lk(t,t.routesById[s],o);if(!l)return null;const u=v.jsx(uk,{routeId:l});return s===Yl?v.jsx(E.Suspense,{fallback:Bm(t),children:u}):u});function dk(e,t){const s=e[1];e.length=0,s==null||s(t)}function b5({t:e}){const t=Vs(),s=t._rendered??(t._rendered=[]);return t.startTransition=(i,o)=>new Promise(l=>{dk(s,!1),s.push(o,l),e(t),E.startTransition(i)}),sx(()=>{const i=t.history.subscribe(t.load);t.updateLatestLocation();const o=t.latestLocation,l=t.buildLocation({to:o.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Mi(o.publicHref)!==Mi(l.publicHref))return t.commitLocation({...l,replace:!0,ignoreBlocker:!0}),i;const u=t.stores.resolvedLocation.get();return(u==null?void 0:u.href)===o.href&&u.state.__TSR_key===o.state.__TSR_key?s.push(t.stores.matches.get(),d=>{d&&t.emit({type:"onRendered",...zm(u,u)})}):t._tx||t.load({sync:!0}).catch(console.error),i},[t,t.history]),null}function x5(){const e=Vs(),t=e.routesById[Yl],s=Bm(e,t),i=v.jsxs(v.Fragment,{children:[v.jsx(b5,{t:E.useState()[1]}),e.ssr?v.jsx(uE,{}):v.jsx(E.Suspense,{fallback:s,children:v.jsx(uE,{})})]});return e.options.InnerWrap?v.jsx(e.options.InnerWrap,{children:i}):i}function uE(){const e=Vs(),t=e._rendered,s=Aa(e.stores.matches,u=>t[0]??u),i=s[0],o=i==null?void 0:i.routeId;sx(()=>{t[0]===s&&dk(t,!0)},[t,s]);const l=o?v.jsx(uk,{routeId:o}):null;return e.options.disableGlobalCatchBoundary?l:v.jsx(hx,{getResetKey:()=>i,onCatch:void 0,children:l})}var w5=e=>({createMutableStore:iE,createReadonlyStore:iE,batch:YP}),S5=e=>new T5(e),T5=class extends vP{constructor(e){super(e,w5)}};function R5({router:e,children:t,...s}){j2(s)&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const i=v.jsx(W2.Provider,{value:e,children:t});return e.options.Wrap?v.jsx(e.options.Wrap,{children:i}):i}function E5({router:e,...t}){return v.jsx(R5,{router:e,...t,children:v.jsx(x5,{})})}var ev={exports:{}},Su={},tv={exports:{}},nv={};/**
35
- * @license React
36
- * scheduler.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var dE;function C5(){return dE||(dE=1,(function(e){function t(F,ie){var Q=F.length;F.push(ie);e:for(;0<Q;){var ae=Q-1>>>1,ne=F[ae];if(0<o(ne,ie))F[ae]=ie,F[Q]=ne,Q=ae;else break e}}function s(F){return F.length===0?null:F[0]}function i(F){if(F.length===0)return null;var ie=F[0],Q=F.pop();if(Q!==ie){F[0]=Q;e:for(var ae=0,ne=F.length,pe=ne>>>1;ae<pe;){var ee=2*(ae+1)-1,ve=F[ee],P=ee+1,K=F[P];if(0>o(ve,Q))P<ne&&0>o(K,ve)?(F[ae]=K,F[P]=Q,ae=P):(F[ae]=ve,F[ee]=Q,ae=ee);else if(P<ne&&0>o(K,Q))F[ae]=K,F[P]=Q,ae=P;else break e}}return ie}function o(F,ie){var Q=F.sortIndex-ie.sortIndex;return Q!==0?Q:F.id-ie.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var f=[],h=[],p=1,g=null,b=3,w=!1,x=!1,S=!1,T=!1,A=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(F){for(var ie=s(h);ie!==null;){if(ie.callback===null)i(h);else if(ie.startTime<=F)i(h),ie.sortIndex=ie.expirationTime,t(f,ie);else break;ie=s(h)}}function D(F){if(S=!1,M(F),!x)if(s(f)!==null)x=!0,_||(_=!0,$());else{var ie=s(h);ie!==null&&q(D,ie.startTime-F)}}var _=!1,N=-1,O=5,z=-1;function I(){return T?!0:!(e.unstable_now()-z<O)}function V(){if(T=!1,_){var F=e.unstable_now();z=F;var ie=!0;try{e:{x=!1,S&&(S=!1,C(N),N=-1),w=!0;var Q=b;try{t:{for(M(F),g=s(f);g!==null&&!(g.expirationTime>F&&I());){var ae=g.callback;if(typeof ae=="function"){g.callback=null,b=g.priorityLevel;var ne=ae(g.expirationTime<=F);if(F=e.unstable_now(),typeof ne=="function"){g.callback=ne,M(F),ie=!0;break t}g===s(f)&&i(f),M(F)}else i(f);g=s(f)}if(g!==null)ie=!0;else{var pe=s(h);pe!==null&&q(D,pe.startTime-F),ie=!1}}break e}finally{g=null,b=Q,w=!1}ie=void 0}}finally{ie?$():_=!1}}}var $;if(typeof k=="function")$=function(){k(V)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,B=X.port2;X.port1.onmessage=V,$=function(){B.postMessage(null)}}else $=function(){A(V,0)};function q(F,ie){N=A(function(){F(e.unstable_now())},ie)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(F){switch(b){case 1:case 2:case 3:var ie=3;break;default:ie=b}var Q=b;b=ie;try{return F()}finally{b=Q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(F,ie){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Q=b;b=F;try{return ie()}finally{b=Q}},e.unstable_scheduleCallback=function(F,ie,Q){var ae=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ae+Q:ae):Q=ae,F){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=Q+ne,F={id:p++,callback:ie,priorityLevel:F,startTime:Q,expirationTime:ne,sortIndex:-1},Q>ae?(F.sortIndex=Q,t(h,F),s(f)===null&&F===s(h)&&(S?(C(N),N=-1):S=!0,q(D,Q-ae))):(F.sortIndex=ne,t(f,F),x||w||(x=!0,_||(_=!0,$()))),F},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(F){var ie=b;return function(){var Q=b;b=ie;try{return F.apply(this,arguments)}finally{b=Q}}}})(nv)),nv}var fE;function A5(){return fE||(fE=1,tv.exports=C5()),tv.exports}var sv={exports:{}},kn={};/**
43
- * @license React
44
- * react-dom.production.js
45
- *
46
- * Copyright (c) Meta Platforms, Inc. and affiliates.
47
- *
48
- * This source code is licensed under the MIT license found in the
49
- * LICENSE file in the root directory of this source tree.
50
- */var hE;function k5(){if(hE)return kn;hE=1;var e=wd();function t(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal"),l=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function d(p,g,b){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:w==null?null:w===u?u:""+w,children:p,containerInfo:g,implementation:b}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return kn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,kn.browser=function(p){return{$$typeof:l,_reason:p}},kn.createPortal=function(p,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return d(p,g,null,b)},kn.flushSync=function(p){var g=f.T,b=i.p;try{if(f.T=null,i.p=2,p)return p()}finally{f.T=g,i.p=b,i.d.f()}},kn.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(p,g))},kn.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},kn.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var b=g.as,w=h(b,g.crossOrigin),x=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:w,integrity:x,fetchPriority:S}):b==="script"&&i.d.X(p,{crossOrigin:w,integrity:x,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},kn.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=h(g.as,g.crossOrigin);i.d.M(p,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&i.d.M(p)},kn.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,w=h(b,g.crossOrigin);i.d.L(p,b,{crossOrigin:w,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},kn.preloadModule=function(p,g){if(typeof p=="string")if(g){var b=h(g.as,g.crossOrigin);i.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else i.d.m(p)},kn.requestFormReset=function(p){i.d.r(p)},kn.unstable_batchedUpdates=function(p,g){return p(g)},kn.useFormState=function(p,g,b){return f.H.useFormState(p,g,b)},kn.useFormStatus=function(){return f.H.useHostTransitionStatus()},kn.version="19.3.1",kn}var mE;function fk(){if(mE)return sv.exports;mE=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(t){console.error(t)}}return e(),sv.exports=k5(),sv.exports}/**
51
- * @license React
52
- * react-dom-client.production.js
53
- *
54
- * Copyright (c) Meta Platforms, Inc. and affiliates.
55
- *
56
- * This source code is licensed under the MIT license found in the
57
- * LICENSE file in the root directory of this source tree.
58
- */var pE;function M5(){if(pE)return Su;pE=1;var e=A5(),t=wd(),s=fk();function i(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){for(var r=n,a=r;a&&!a.alternate;)r=a,(r.flags&4098)!==0&&(n=r.return),a=r.return;for(;r.return;)r=r.return;return r.tag===3?n:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function d(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(l(n)!==n)throw Error(i(188))}function h(n){var r=n.alternate;if(!r){if(r=l(n),r===null)throw Error(i(188));return r!==n?null:n}for(var a=n,c=r;;){var m=a.return;if(m===null)break;var y=m.alternate;if(y===null){if(c=m.return,c!==null){a=c;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===a)return f(m),n;if(y===c)return f(m),r;y=y.sibling}throw Error(i(188))}if(a.return!==c.return)a=m,c=y;else{for(var R=!1,j=m.child;j;){if(j===a){R=!0,a=m,c=y;break}if(j===c){R=!0,c=m,a=y;break}j=j.sibling}if(!R){for(j=y.child;j;){if(j===a){R=!0,a=y,c=m;break}if(j===c){R=!0,c=y,a=m;break}j=j.sibling}if(!R)throw Error(i(189))}}if(a.alternate!==c)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?n:r}function p(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=p(n),r!==null)return r;n=n.sibling}return null}function g(n,r,a,c,m,y){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&a(n,c,m,y)||(n.tag!==22||n.memoizedState===null)&&(r||n.tag!==5&&n.tag!==27)&&g(n.child,r,a,c,m,y))return!0;n=n.sibling}return!1}function b(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function w(n){var r=!1;for(n=n.return;n!==null&&(n.tag===4&&(r=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return r}function x(n){var r=[null,null],a=b(n);return a===null||S(r,n,a.child,{foundSelf:!1}),r}function S(n,r,a,c){for(;a!==null;){if(a===r)c.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(c.foundSelf)return n[1]=a,!0;n[0]=a}else if((a.tag!==22||a.memoizedState===null)&&S(n,r,a.child,c))return!0;a=a.sibling}return!1}function T(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(i(559))}}var A=null,C=null;function k(n,r,a){return n===a?!0:n===r?(A=n,!0):!1}function M(n,r,a){return n===a?(C=n,!1):n===r?(C!==null&&(A=n),!0):!1}function D(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function _(n,r,a){for(var c=0,m=n;m;m=a(m))c++;m=0;for(var y=r;y;y=a(y))m++;for(;0<c-m;)n=a(n),c--;for(;0<m-c;)r=a(r),m--;for(;c--;){if(n===r||r!==null&&n===r.alternate)return n;n=a(n),r=a(r)}return null}var N=Object.assign,O=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),ee=Symbol.for("react.legacy_hidden"),ve=Symbol.for("react.memo_cache_sentinel"),P=Symbol.for("react.view_transition"),K=Symbol.for("react.recoverable"),L=Symbol.iterator;function H(n){return n===null||typeof n!="object"?null:(n=L&&n[L]||n["@@iterator"],typeof n=="function"?n:null)}var fe=Symbol.for("react.client.reference");function oe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===fe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case V:return"Fragment";case X:return"Profiler";case $:return"StrictMode";case ie:return"Suspense";case Q:return"SuspenseList";case pe:return"Activity";case P:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case I:return"Portal";case q:return n.displayName||"Context";case B:return(n._context.displayName||"Context")+".Consumer";case F:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case ae:return r=n.displayName||null,r!==null?r:oe(n.type)||"Memo";case ne:r=n._payload,n=n._init;try{return oe(n(r))}catch{}}return null}var ye=Array.isArray,ce=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze={pending:!1,data:null,method:null,action:null},Te=[],Pe=-1;function Ae(n){return{current:n}}function Ge(n){0>Pe||(n.current=Te[Pe],Te[Pe]=null,Pe--)}function Ue(n,r){Pe++,Te[Pe]=n.current,n.current=r}var Se=Ae(null),Ye=Ae(null),xe=Ae(null),Xe=Ae(null);function We(n,r){switch(Ue(xe,r),Ue(Ye,n),Ue(Se,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?NT(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=NT(r),n=OT(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Ge(Se),Ue(Se,n)}function pt(){Ge(Se),Ge(Ye),Ge(xe)}function le(n){var r=n.memoizedState;r!==null&&(_l._currentValue=r.memoizedState,Ue(Xe,n)),r=Se.current;var a=OT(r,n.type);r!==a&&(Ue(Ye,n),Ue(Se,a))}function he(n){Ye.current===n&&(Ge(Se),Ge(Ye)),Xe.current===n&&(Ge(Xe),_l._currentValue=ze)}var Ke,Ee;function we(n){if(Ke===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);Ke=r&&r[1]||"",Ee=-1<a.stack.indexOf(`
59
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
60
- `+Ke+n+Ee}var ot=!1;function Ze(n,r){if(!n||ot)return"";ot=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(Re){var Z=Re}Reflect.construct(n,[],de)}else{try{de.call()}catch(Re){Z=Re}de=!1;try{var se=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),de=!0,new n}finally{de&&(se!==void 0?Object.defineProperty(n.prototype,"props",se):delete n.prototype.props)}}}else{try{throw Error()}catch(Re){Z=Re}(de=n())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(Re){if(Re&&Z&&typeof Re.stack=="string")return[Re.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 y=c.DetermineComponentFrameRoot(),R=y[0],j=y[1];if(R&&j){var U=R.split(`
61
- `),J=j.split(`
62
- `);for(m=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;m<J.length&&!J[m].includes("DetermineComponentFrameRoot");)m++;if(c===U.length||m===J.length)for(c=U.length-1,m=J.length-1;1<=c&&0<=m&&U[c]!==J[m];)m--;for(;1<=c&&0<=m;c--,m--)if(U[c]!==J[m]){if(c!==1||m!==1)do if(c--,m--,0>m||U[c]!==J[m]){var re=`
63
- `+U[c].replace(" at new "," at ");return n.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",n.displayName)),re}while(1<=c&&0<=m);break}}}finally{ot=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?we(a):""}function wt(n,r){switch(n.tag){case 26:case 27:case 5:return we(n.type);case 16:return we("Lazy");case 13:return n.child!==r&&r!==null?we("Suspense Fallback"):we("Suspense");case 19:return we("SuspenseList");case 0:case 15:return Ze(n.type,!1);case 11:return Ze(n.type.render,!1);case 1:return Ze(n.type,!0);case 31:return we("Activity");case 30:return we("ViewTransition");default:return""}}function on(n){try{var r="",a=null;do r+=wt(n,a),a=n,n=n.return;while(n);return r}catch(c){return`
64
- Error generating stack: `+c.message+`
65
- `+c.stack}}var Vt=Object.prototype.hasOwnProperty,Rs=e.unstable_scheduleCallback,cs=e.unstable_cancelCallback,ii=e.unstable_shouldYield,Li=e.unstable_requestPaint,Ut=e.unstable_now,Es=e.unstable_getCurrentPriorityLevel,Bi=e.unstable_ImmediatePriority,ri=e.unstable_UserBlockingPriority,Ui=e.unstable_NormalPriority,Ha=e.unstable_LowPriority,jo=e.unstable_IdlePriority,Ga=e.log,Er=e.unstable_setDisableYieldValue,be=null,Ne=null;function nt(n){if(typeof Ga=="function"&&Er(n),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(be,n)}catch{}}var gt=Math.clz32?Math.clz32:Wn,Zt=Math.log,Bn=Math.LN2;function Wn(n){return n>>>=0,n===0?32:31-(Zt(n)/Bn|0)|0}var qs=256,Vi=262144,us=4194304;function wn(n){var r=n&42;if(r!==0)return r;switch(n&-n){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 n&-n;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function oi(n,r,a){var c=n.pendingLanes;if(c===0)return 0;var m=0,y=n.suspendedLanes,R=n.pingedLanes;n=n.warmLanes;var j=c&134217727;return j!==0?(c=j&~y,c!==0?m=wn(c):(R&=j,R!==0?m=wn(R):a||(a=j&~n,a!==0&&(m=wn(a))))):(j=c&~y,j!==0?m=wn(j):R!==0?m=wn(R):a||(a=c&~n,a!==0&&(m=wn(a)))),m===0?0:r!==0&&r!==m&&(r&y)===0&&(y=m&-m,a=r&-r,y>=a||y===32&&(a&4194048)!==0)?r:m}function ai(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function Ka(n,r){(r&8)!==0&&(r|=r&32);var a=n.entangledLanes;if(a!==0)for(n=n.entanglements,a&=r;0<a;){var c=31-gt(a),m=1<<c;r|=n[c],a&=~m}return r}function _d(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Ac(){var n=us;return us<<=1,(us&62914560)===0&&(us=4194304),n}function Ya(n){for(var r=[],a=0;31>a;a++)r.push(n);return r}function Cr(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Id(n,r,a,c,m,y){var R=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var j=n.entanglements,U=n.expirationTimes,J=n.hiddenUpdates;for(a=R&~a;0<a;){var re=31-gt(a),de=1<<re;j[re]=0,U[re]=-1;var Z=J[re];if(Z!==null)for(J[re]=null,re=0;re<Z.length;re++){var se=Z[re];se!==null&&(se.lane&=-536870913)}a&=~de}c!==0&&kc(n,c,0),y!==0&&m===0&&n.tag!==0&&(n.suspendedLanes|=y&~(R&~r))}function kc(n,r,a){n.pendingLanes|=r,n.suspendedLanes&=~r;var c=31-gt(r);n.entangledLanes|=r,n.entanglements[c]=n.entanglements[c]|1073741824|a&261930}function Pd(n,r){var a=n.entangledLanes|=r;for(n=n.entanglements;a;){var c=31-gt(a),m=1<<c;m&r|n[c]&r&&(n[c]|=r),a&=~m}}function zd(n,r){var a=r&-r;return a=(a&42)!==0?1:gp(a),(a&(n.suspendedLanes|r))!==0?0:a}function gp(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function yp(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function aw(){var n=me.p;return n!==0?n:(n=window.event,n===void 0?32:mR(n.type))}function lw(n,r){var a=me.p;try{return me.p=n,r()}finally{me.p=a}}var Fi=Math.random().toString(36).slice(2),Sn="__reactFiber$"+Fi,Jn="__reactProps$"+Fi,$a="__reactContainer$"+Fi,cw="__reactEvents$"+Fi,iD="__reactListeners$"+Fi,rD="__reactHandles$"+Fi,uw="__reactResources$"+Fi,Mc="__reactMarker$"+Fi,Ld="__reactLoad$"+Fi;function Bd(n){delete n[Sn],delete n[Jn],delete n[iD],delete n[rD]}function Do(n){var r;if(r=n[Sn])return r;for(var a=n.parentNode;a;){if(r=a[$a]||a[Sn]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(n=$T(n);n!==null;){if(a=n[Sn])return a;n=$T(n)}return r}n=a,a=n.parentNode}return null}function Qa(n){if(n=n[Sn]||n[$a]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function Nc(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(i(33))}function Xa(n){var r=n[uw];return r||(r=n[uw]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function pn(n){n[Mc]=!0}function dw(n){n[Ld]=void 0}var fw=new Set,hw={};function _o(n,r){Za(n,r),Za(n+"Capture",r)}function Za(n,r){for(hw[n]=r,n=0;n<r.length;n++)fw.add(r[n])}var oD=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]*$"),mw={},pw={};function aD(n){return Vt.call(pw,n)?!0:Vt.call(mw,n)?!1:oD.test(n)?pw[n]=!0:(mw[n]=!0,!1)}var yt=!1;function gw(){var n=yt;return yt=!1,n}function Ud(n,r,a){if(aD(r))if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,a)}}function Vd(n,r,a){if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,a)}}function qi(n,r,a,c){if(c===null)n.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(r,a,c)}}function ds(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function yw(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function lD(n,r,a){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,y=c.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return m.call(this)},set:function(R){a=""+R,y.call(this,R)}}),Object.defineProperty(n,r,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(R){a=""+R},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function vp(n){if(!n._valueTracker){var r=yw(n)?"checked":"value";n._valueTracker=lD(n,r,""+n[r])}}function vw(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var a=r.getValue(),c="";return n&&(c=yw(n)?n.checked?"true":"false":n.value),n=c,n!==a?(r.setValue(n),!0):!1}var cD=/[\n"\\]/g;function Cs(n){return n.replace(cD,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function bp(n,r,a,c,m,y,R,j){n.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?n.type=R:n.removeAttribute("type"),r!=null?R==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+ds(r)):n.value!==""+ds(r)&&(n.value=""+ds(r)):R!=="submit"&&R!=="reset"||n.removeAttribute("value"),r!=null?R==="number"&&n.value==r?xp(n,ds(n.value)):xp(n,ds(r)):a!=null?xp(n,ds(a)):c!=null&&n.removeAttribute("value"),m==null&&y!=null&&(n.defaultChecked=!!y),m!=null&&(n.checked=m&&typeof m!="function"&&typeof m!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.name=""+ds(j):n.removeAttribute("name")}function bw(n,r,a,c,m,y,R,j){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),r!=null||a!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){vp(n);return}a=a!=null?""+ds(a):"",r=r!=null?""+ds(r):a,j||r===n.value||(n.value=r),n.defaultValue=r}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=j?n.checked:!!c,n.defaultChecked=!!c,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(n.name=R),vp(n)}function xp(n,r){n.defaultValue!==""+r&&(n.defaultValue=""+r)}function Wa(n,r,a,c){if(n=n.options,r){r={};for(var m=0;m<a.length;m++)r["$"+a[m]]=!0;for(a=0;a<n.length;a++)m=r.hasOwnProperty("$"+n[a].value),n[a].selected!==m&&(n[a].selected=m),m&&c&&(n[a].defaultSelected=!0)}else{for(a=""+ds(a),r=null,m=0;m<n.length;m++){if(n[m].value===a){n[m].selected=!0,c&&(n[m].defaultSelected=!0);return}r!==null||n[m].disabled||(r=n[m])}r!==null&&(r.selected=!0)}}function xw(n,r,a){if(r!=null&&(r=""+ds(r),r!==n.value&&(n.value=r),a==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=a!=null?""+ds(a):""}function ww(n,r,a,c){if(r==null){if(c!=null){if(a!=null)throw Error(i(92));if(ye(c)){if(1<c.length)throw Error(i(93));c=c[0]}a=c}a==null&&(a=""),r=a}a=ds(r),n.defaultValue=a,c=n.textContent,c===a&&c!==""&&c!==null&&(n.value=c),vp(n)}function Ja(n,r){if(r){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=r;return}}n.textContent=r}var uD=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 Sw(n,r,a){var c=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":c?n.setProperty(r,a):typeof a!="number"||a===0||uD.has(r)?r==="float"?n.cssFloat=a:n[r]=(""+a).trim():n[r]=a+"px"}function Tw(n,r,a){if(r!=null&&typeof r!="object")throw Error(i(62));if(n=n.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="",yt=!0);for(var m in r)c=r[m],r.hasOwnProperty(m)&&a[m]!==c&&(Sw(n,m,c),yt=!0)}else for(var y in r)r.hasOwnProperty(y)&&Sw(n,y,r[y])}function wp(n){if(n.indexOf("-")===-1)return!1;switch(n){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 dD=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),fD=/^[\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 Fd(n){return fD.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function li(){}var Sp=null;function Tp(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var el=null,tl=null;function Rw(n){var r=Qa(n);if(r&&(n=r.stateNode)){var a=n[Jn]||null;e:switch(n=r.stateNode,r.type){case"input":if(bp(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Cs(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var c=a[r];if(c!==n&&c.form===n.form){var m=c[Jn]||null;if(!m)throw Error(i(90));bp(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(r=0;r<a.length;r++)c=a[r],c.form===n.form&&vw(c)}break e;case"textarea":xw(n,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Wa(n,!!a.multiple,r,!1)}}}var Rp=!1;function Ew(n,r,a){if(Rp)return n(r,a);Rp=!0;try{var c=n(r);return c}finally{if(Rp=!1,(el!==null||tl!==null)&&(qf(),el&&(r=el,n=tl,tl=el=null,Rw(r),n)))for(r=0;r<n.length;r++)Rw(n[r])}}function Oc(n,r){var a=n.stateNode;if(a===null)return null;var c=a[Jn]||null;if(c===null)return null;a=c[r];e:switch(r){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)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(i(231,r,typeof a));return a}var Hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ep=!1;if(Hi)try{var jc={};Object.defineProperty(jc,"passive",{get:function(){Ep=!0}}),window.addEventListener("test",jc,jc),window.removeEventListener("test",jc,jc)}catch{Ep=!1}var Ar=null,Cp=null,qd=null;function Cw(){if(qd)return qd;var n,r=Cp,a=r.length,c,m="value"in Ar?Ar.value:Ar.textContent,y=m.length;for(n=0;n<a&&r[n]===m[n];n++);var R=a-n;for(c=1;c<=R&&r[a-c]===m[y-c];c++);return qd=m.slice(n,1<c?1-c:void 0)}function Hd(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Gd(){return!0}function Aw(){return!1}function Un(n){function r(a,c,m,y,R){this._reactName=a,this._targetInst=m,this.type=c,this.nativeEvent=y,this.target=R,this.currentTarget=null;for(var j in n)n.hasOwnProperty(j)&&(a=n[j],this[j]=a?a(y):y[j]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Gd:Aw,this.isPropagationStopped=Aw,this}return N(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Gd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Gd)},persist:function(){},isPersistent:Gd}),r}var kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kd=Un(kr),Dc=N({},kr,{view:0,detail:0}),hD=Un(Dc),Ap,kp,_c,Yd=N({},Dc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Np,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==_c&&(_c&&n.type==="mousemove"?(Ap=n.screenX-_c.screenX,kp=n.screenY-_c.screenY):kp=Ap=0,_c=n),Ap)},movementY:function(n){return"movementY"in n?n.movementY:kp}}),kw=Un(Yd),mD=N({},Yd,{dataTransfer:0}),pD=Un(mD),gD=N({},Dc,{relatedTarget:0}),Mp=Un(gD),yD=N({},kr,{animationName:0,elapsedTime:0,pseudoElement:0}),vD=Un(yD),bD=N({},kr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),xD=Un(bD),wD=N({},kr,{data:0}),Mw=Un(wD),SD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TD={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"},RD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ED(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=RD[n])?!!r[n]:!1}function Np(){return ED}var CD=N({},Dc,{key:function(n){if(n.key){var r=SD[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Hd(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?TD[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Np,charCode:function(n){return n.type==="keypress"?Hd(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Hd(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),AD=Un(CD),kD=N({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nw=Un(kD),MD=N({},kr,{submitter:0}),ND=Un(MD),OD=N({},Dc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Np}),jD=Un(OD),DD=N({},kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),_D=Un(DD),ID=N({},Yd,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),PD=Un(ID),zD=N({},kr,{newState:0,oldState:0,source:0}),LD=Un(zD),BD=[9,13,27,32],Op=Hi&&"CompositionEvent"in window,Ic=null;Hi&&"documentMode"in document&&(Ic=document.documentMode);var UD=Hi&&"TextEvent"in window&&!Ic,Ow=Hi&&(!Op||Ic&&8<Ic&&11>=Ic),jw=" ",Dw=!1;function _w(n,r){switch(n){case"keyup":return BD.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Iw(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var nl=!1;function VD(n,r){switch(n){case"compositionend":return Iw(r);case"keypress":return r.which!==32?null:(Dw=!0,jw);case"textInput":return n=r.data,n===jw&&Dw?null:n;default:return null}}function FD(n,r){if(nl)return n==="compositionend"||!Op&&_w(n,r)?(n=Cw(),qd=Cp=Ar=null,nl=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ow&&r.locale!=="ko"?null:r.data;default:return null}}var qD={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 Pw(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!qD[n.type]:r==="textarea"}function zw(n,r,a,c){el?tl?tl.push(c):tl=[c]:el=c,r=Qf(r,"onChange"),0<r.length&&(a=new Kd("onChange","change",null,a,c),n.push({event:a,listeners:r}))}var Pc=null,zc=null;function HD(n){RT(n,0)}function $d(n){var r=Nc(n);if(vw(r))return n}function Lw(n,r){if(n==="change")return r}var Bw=!1;if(Hi){var jp;if(Hi){var Dp="oninput"in document;if(!Dp){var Uw=document.createElement("div");Uw.setAttribute("oninput","return;"),Dp=typeof Uw.oninput=="function"}jp=Dp}else jp=!1;Bw=jp&&(!document.documentMode||9<document.documentMode)}function Vw(){Pc&&(Pc.detachEvent("onpropertychange",Fw),zc=Pc=null)}function Fw(n){if(n.propertyName==="value"&&$d(zc)){var r=[];zw(r,zc,n,Tp(n)),Ew(HD,r)}}function GD(n,r,a){n==="focusin"?(Vw(),Pc=r,zc=a,Pc.attachEvent("onpropertychange",Fw)):n==="focusout"&&Vw()}function KD(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return $d(zc)}function YD(n,r){if(n==="click")return $d(r)}function $D(n,r){if(n==="input"||n==="change")return $d(r)}function QD(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var fs=typeof Object.is=="function"?Object.is:QD;function Lc(n,r){if(fs(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var a=Object.keys(n),c=Object.keys(r);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var m=a[c];if(!Vt.call(r,m)||!fs(n[m],r[m]))return!1}return!0}function _p(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function qw(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Hw(n,r){var a=qw(n);n=0;for(var c;a;){if(a.nodeType===3){if(c=n+a.textContent.length,n<=r&&c>=r)return{node:a,offset:r-n};n=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=qw(a)}}function Gw(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Gw(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Kw(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=_p(n.document);r instanceof n.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)n=r.contentWindow;else break;r=_p(n.document)}return r}function Ip(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var XD=Hi&&"documentMode"in document&&11>=document.documentMode,sl=null,Pp=null,Bc=null,zp=!1;function Yw(n,r,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;zp||sl==null||sl!==_p(c)||(c=sl,"selectionStart"in c&&Ip(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}),Bc&&Lc(Bc,c)||(Bc=c,c=Qf(Pp,"onSelect"),0<c.length&&(r=new Kd("onSelect","select",null,r,a),n.push({event:r,listeners:c}),r.target=sl)))}function Io(n,r){var a={};return a[n.toLowerCase()]=r.toLowerCase(),a["Webkit"+n]="webkit"+r,a["Moz"+n]="moz"+r,a}var il={animationend:Io("Animation","AnimationEnd"),animationiteration:Io("Animation","AnimationIteration"),animationstart:Io("Animation","AnimationStart"),transitionrun:Io("Transition","TransitionRun"),transitionstart:Io("Transition","TransitionStart"),transitioncancel:Io("Transition","TransitionCancel"),transitionend:Io("Transition","TransitionEnd")},Lp={},$w={};Hi&&($w=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 Po(n){if(Lp[n])return Lp[n];if(!il[n])return n;var r=il[n],a;for(a in r)if(r.hasOwnProperty(a)&&a in $w)return Lp[n]=r[a];return n}var Qw=Po("animationend"),Xw=Po("animationiteration"),Zw=Po("animationstart"),ZD=Po("transitionrun"),WD=Po("transitionstart"),JD=Po("transitioncancel"),Ww=Po("transitionend"),Jw=new Map,Bp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Bp.push("scrollEnd");function Hs(n,r){Jw.set(n,r),_o(r,[n])}var e_=0;function Gi(n,r){if(n.name!=null&&n.name!=="auto")return n.name;if(r.autoName!==null)return r.autoName;n=$s.identifierPrefix;var a=e_++;return n="_"+n+"t_"+a.toString(32)+"_",r.autoName=n}function eS(n){if(n==null||typeof n=="string")return n;var r=null,a=Rl;if(a!==null)for(var c=0;c<a.length;c++){var m=n[a[c]];if(m!=null){if(m==="none")return"none";r=r==null?m:r+(" "+m)}}return r??n.default}function Ki(n,r){return n=eS(n),r=eS(r),r==null?n==="auto"?null:n:r==="auto"?null:r}var Qd=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},As=[],rl=0,Up=0;function Xd(){for(var n=rl,r=Up=rl=0;r<n;){var a=As[r];As[r++]=null;var c=As[r];As[r++]=null;var m=As[r];As[r++]=null;var y=As[r];if(As[r++]=null,c!==null&&m!==null){var R=c.pending;R===null?m.next=m:(m.next=R.next,R.next=m),c.pending=m}y!==0&&tS(a,m,y)}}function Zd(n,r,a,c){As[rl++]=n,As[rl++]=r,As[rl++]=a,As[rl++]=c,Up|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Vp(n,r,a,c){return Zd(n,r,a,c),Wd(n)}function zo(n,r){return Zd(n,null,null,r),Wd(n)}function tS(n,r,a){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a);for(var m=!1,y=n.return;y!==null;)y.childLanes|=a,c=y.alternate,c!==null&&(c.childLanes|=a),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(m=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,m&&r!==null&&(m=31-gt(a),n=y.hiddenUpdates,c=n[m],c===null?n[m]=[r]:c.push(r),r.lane=a|536870912),y):null}function Wd(n){if(50<au)throw au=0,Ff=null,Error(i(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var ol={};function t_(n,r,a,c){this.tag=n,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,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 es(n,r,a,c){return new t_(n,r,a,c)}function Fp(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Yi(n,r){var a=n.alternate;return a===null?(a=es(n.tag,r,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=r,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&1206910976,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,r=n.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function nS(n,r){n.flags&=1206910978;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,r=a.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Jd(n,r,a,c,m,y){var R=0;if(c=n,typeof c=="function")Fp(c)&&(R=1);else if(typeof c=="string")R=M3(n,a,Se.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(c){case pe:return n=es(31,a,r,m),n.elementType=pe,n.lanes=y,n;case V:return Lo(a.children,m,y,r);case $:R=8,m|=24;break;case X:return n=es(12,a,r,m|2),n.elementType=X,n.lanes=y,n;case ie:return n=es(13,a,r,m),n.elementType=ie,n.lanes=y,n;case Q:return n=es(19,a,r,m),n.elementType=Q,n.lanes=y,n;case ee:case P:return n=m|32,n=es(30,a,r,n),n.elementType=P,n.lanes=y,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case q:R=10;break e;case B:R=9;break e;case F:R=11;break e;case ae:R=14;break e;case ne:R=16,c=null;break e}R=29,a=Error(i(130,n===null?"null":typeof n,"")),c=null}return r=es(R,a,r,m),r.elementType=n,r.type=c,r.lanes=y,r}function Lo(n,r,a,c){return n=es(7,n,c,r),n.lanes=a,n}function qp(n,r,a){return n=es(6,n,null,r),n.lanes=a,n}function sS(n){var r=es(18,null,null,0);return r.stateNode=n,r}function Hp(n,r,a){return r=es(4,n.children!==null?n.children:[],n.key,r),r.lanes=a,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var iS=new WeakMap;function ks(n,r){if(typeof n=="object"&&n!==null){var a=iS.get(n);return a!==void 0?a:(r={value:n,source:r,stack:on(r)},iS.set(n,r),r)}return{value:n,source:r,stack:on(r)}}var al=[],ll=0,ef=null,Uc=0,Ms=[],Ns=0,Mr=null,ci=1,ui="";function $i(n,r){al[ll++]=Uc,al[ll++]=ef,ef=n,Uc=r}function rS(n,r,a){Ms[Ns++]=ci,Ms[Ns++]=ui,Ms[Ns++]=Mr,Mr=n;var c=ci;n=ui;var m=32-gt(c)-1;c&=~(1<<m),a+=1;var y=32-gt(r)+m;if(30<y){var R=m-m%5;y=(c&(1<<R)-1).toString(32),c>>=R,m-=R,ci=1<<32-gt(r)+m|a<<m|c,ui=y+n}else ci=1<<y|a<<m|c,ui=n}function tf(n){n.return!==null&&($i(n,1),rS(n,1,0))}function Gp(n){for(;n===ef;)ef=al[--ll],al[ll]=null,Uc=al[--ll],al[ll]=null;for(;n===Mr;)Mr=Ms[--Ns],Ms[Ns]=null,ui=Ms[--Ns],Ms[Ns]=null,ci=Ms[--Ns],Ms[Ns]=null}function oS(n,r){Ms[Ns++]=ci,Ms[Ns++]=ui,Ms[Ns++]=Mr,ci=r.id,ui=r.overflow,Mr=n}var gn=null,zt=null,st=!1,Nr=null,Os=!1,Kp=Error(i(519));function Or(n){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vc(ks(r,n)),Kp}function aS(n){var r=n.stateNode,a=n.type,c=n.memoizedProps;switch(r[Sn]=n,r[Jn]=c,a){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(a=0;a<cu.length;a++)lt(cu[a],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":lt("invalid",r),bw(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":lt("invalid",r);break;case"textarea":lt("invalid",r),ww(r,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||c.suppressHydrationWarning===!0||kT(r.textContent,a)?(c.popover!=null&&(lt("beforetoggle",r),lt("toggle",r)),c.onScroll!=null&&lt("scroll",r),c.onScrollEnd!=null&&lt("scrollend",r),c.onClick!=null&&(r.onclick=li),r=!0):r=!1,r||Or(n,!0)}function nf(n){for(gn=n.return;gn;)switch(gn.tag){case 5:case 31:case 13:Os=!1;return;case 27:case 3:Os=!0;return;default:gn=gn.return}}function cl(n){if(n!==gn)return!1;if(!st)return nf(n),st=!0,!1;var r=n.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||Sy(n.type,n.memoizedProps)),a=!a),a&&zt&&Or(n),nf(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));zt=YT(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));zt=YT(n)}else r===27?(r=zt,Yr(n.type)?(n=Oy,Oy=null,zt=n):zt=r):zt=gn?Ds(n.stateNode.nextSibling):null;return!0}function Bo(){zt=gn=null,st=!1}function Yp(){var n=Nr;return n!==null&&(ss===null?ss=n:ss.push.apply(ss,n),Nr=null),n}function Vc(n){Nr===null?Nr=[n]:Nr.push(n)}var $p=Ae(null),Uo=null,Qi=null;function jr(n,r,a){Ue($p,r._currentValue),r._currentValue=a}function Xi(n){n._currentValue=$p.current,Ge($p)}function sf(n,r,a){for(;n!==null;){var c=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),n===a)break;n=n.return}}function Qp(n,r,a,c){var m=n.child;for(m!==null&&(m.return=n);m!==null;){var y=m.dependencies;if(y!==null){var R=m.child;y=y.firstContext;e:for(;y!==null;){var j=y;y=m;for(var U=0;U<r.length;U++)if(j.context===r[U]){y.lanes|=a,j=y.alternate,j!==null&&(j.lanes|=a),sf(y.return,a,n),c||(R=null);break e}y=j.next}}else if(m.tag===18){if(R=m.return,R===null)throw Error(i(341));R.lanes|=a,y=R.alternate,y!==null&&(y.lanes|=a),sf(R,a,n),R=null}else m.tag===13&&m.memoizedState!==null&&m.memoizedState.dehydrated===null?(m.lanes|=a,R=m.alternate,R!==null&&(R.lanes|=a),sf(m.return,a,n),R=m.child,R=R!==null?R.sibling:null):R=m.child;if(R!==null)R.return=m;else for(R=m;R!==null;){if(R===n){R=null;break}if(m=R.sibling,m!==null){m.return=R.return,R=m;break}R=R.return}m=R}}function Vo(n,r,a,c){n=null;for(var m=r,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var R=m.alternate;if(R===null)throw Error(i(387));if(R=R.memoizedProps,R!==null){var j=m.type;fs(m.pendingProps.value,R.value)||(n!==null?n.push(j):n=[j])}}else if(m===Xe.current){if(R=m.alternate,R===null)throw Error(i(387));R.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(n!==null?n.push(_l):n=[_l])}m=m.return}return n!==null&&Qp(r,n,a,c),r.flags|=262144,n!==null}function rf(n){for(n=n.firstContext;n!==null;){if(!fs(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Fo(n){Uo=n,Qi=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Tn(n){return lS(Uo,n)}function of(n,r){return Uo===null&&Fo(n),lS(n,r)}function lS(n,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Qi===null){if(n===null)throw Error(i(308));Qi=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Qi=Qi.next=r;return a}var n_=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(a,c){n.push(c)}};this.abort=function(){r.aborted=!0,n.forEach(function(a){return a()})}},s_=e.unstable_scheduleCallback,i_=e.unstable_NormalPriority,en={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xp(){return{controller:new n_,data:new Map,refCount:0}}function Fc(n){n.refCount--,n.refCount===0&&s_(i_,function(){n.controller.abort()})}function cS(n,r){if((n.pendingLanes&4194048)!==0){var a=n.transitionTypes;for(a===null&&(a=n.transitionTypes=[]),n=0;n<r.length;n++){var c=r[n];a.indexOf(c)===-1&&a.push(c)}}}var qc=null;function r_(n){var r=n.transitionTypes;return n.transitionTypes=null,r}var Hc=null,Zp=0,qo=0,ul=null;function o_(n,r){if(Hc===null){var a=Hc=[];Zp=0,qo=hy(),ul={status:"pending",value:void 0,then:function(c){a.push(c)}}}return Zp++,r.then(uS,uS),r}function uS(){if(--Zp===0&&(qc=null,Hc!==null)){ul!==null&&(ul.status="fulfilled");var n=Hc;Hc=null,qo=0,ul=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function a_(n,r){var a=[],c={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return n.then(function(){c.status="fulfilled",c.value=r;for(var m=0;m<a.length;m++)(0,a[m])(r)},function(m){for(c.status="rejected",c.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),c}var dS=ce.S;ce.S=function(n,r){if(sT=Ut(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&o_(n,r),qc!==null)for(var a=kl;a!==null;)cS(a,qc),a=a.next;if(a=n.types,a!==null){for(var c=kl;c!==null;)cS(c,a),c=c.next;if(qo!==0){c=qc,c===null&&(c=qc=[]);for(var m=0;m<a.length;m++){var y=a[m];c.indexOf(y)===-1&&c.push(y)}}}dS!==null&&dS(n,r)};var Ho=Ae(null);function Wp(){var n=Ho.current;return n!==null?n:Pt.pooledCache}function af(n,r){r===null?Ue(Ho,Ho.current):Ue(Ho,r.pool)}function fS(){var n=Wp();return n===null?null:{parent:en._currentValue,pool:n}}var dl=Error(i(460)),Jp=Error(i(474)),lf=Error(i(542)),cf={then:function(){}};function hS(n){return n=n.status,n==="fulfilled"||n==="rejected"}function mS(n,r,a){switch(a=n[a],a===void 0?n.push(r):a!==r&&(r.then(li,li),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,gS(n),n===void 0&&!("reason"in r)?Error(i(600)):n;default:if(typeof r.status=="string")r.then(li,li);else{if(n=Pt,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=r,n.status="pending",n.then(function(c){if(r.status==="pending"){var m=r;m.status="fulfilled",m.value=c}},function(c){if(r.status==="pending"){var m=r;m.status="rejected",m.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,gS(n),n}throw Ko=r,dl}}function Go(n){try{var r=n._init;return r(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ko=a,dl):a}}var Ko=null;function pS(){if(Ko===null)throw Error(i(459));var n=Ko;return Ko=null,n}function gS(n){if(n===dl||n===lf)throw Error(i(483))}var fl=null,Gc=0;function uf(n){var r=Gc;return Gc+=1,fl===null&&(fl=[]),mS(fl,n,r)}function Dr(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function df(n,r){throw r.$$typeof===O?Error(i(525)):(n=Object.prototype.toString.call(r),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function yS(n){function r(W,Y){if(n){var te=W.deletions;te===null?(W.deletions=[Y],W.flags|=16):te.push(Y)}}function a(W,Y){if(!n)return null;for(;Y!==null;)r(W,Y),Y=Y.sibling;return null}function c(W){for(var Y=new Map;W!==null;)W.key===null?Y.set(W.index,W):Y.set(W.key,W),W=W.sibling;return Y}function m(W,Y){return W=Yi(W,Y),W.index=0,W.sibling=null,W}function y(W,Y,te){return W.index=te,n?(te=W.alternate,te!==null?(te=te.index,te<Y?(W.flags|=2,Y):te):(W.flags|=134217730,Y)):(W.flags|=1048576,Y)}function R(W){return n&&W.alternate===null&&(W.flags|=134217730),W}function j(W,Y,te,ue){return Y===null||Y.tag!==6?(Y=qp(te,W.mode,ue),Y.return=W,Y):(Y=m(Y,te),Y.return=W,Y)}function U(W,Y,te,ue){var Oe=te.type;return Oe===V?(W=re(W,Y,te.props.children,ue,te.key),Dr(W,te),W):Y!==null&&(Y.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===ne&&Go(Oe)===Y.type)?(Y=m(Y,te.props),Dr(Y,te),Y.return=W,Y):(Y=Jd(te.type,te.key,te.props,null,W.mode,ue),Dr(Y,te),Y.return=W,Y)}function J(W,Y,te,ue){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==te.containerInfo||Y.stateNode.implementation!==te.implementation?(Y=Hp(te,W.mode,ue),Y.return=W,Y):(Y=m(Y,te.children||[]),Y.return=W,Y)}function re(W,Y,te,ue,Oe){return Y===null||Y.tag!==7?(Y=Lo(te,W.mode,ue,Oe),Y.return=W,Y):(Y=m(Y,te),Y.return=W,Y)}function de(W,Y,te){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=qp(""+Y,W.mode,te),Y.return=W,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case z:return te=Jd(Y.type,Y.key,Y.props,null,W.mode,te),Dr(te,Y),te.return=W,te;case I:return Y=Hp(Y,W.mode,te),Y.return=W,Y;case ne:return Y=Go(Y),de(W,Y,te)}if(ye(Y)||H(Y))return Y=Lo(Y,W.mode,te,null),Y.return=W,Y;if(typeof Y.then=="function")return de(W,uf(Y),te);if(Y.$$typeof===q)return de(W,of(W,Y),te);df(W,Y)}return null}function Z(W,Y,te,ue){var Oe=Y!==null?Y.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Oe!==null?null:j(W,Y,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case z:return te.key===Oe?U(W,Y,te,ue):null;case I:return te.key===Oe?J(W,Y,te,ue):null;case ne:return te=Go(te),Z(W,Y,te,ue)}if(ye(te)||H(te))return Oe!==null?null:re(W,Y,te,ue,null);if(typeof te.then=="function")return Z(W,Y,uf(te),ue);if(te.$$typeof===q)return Z(W,Y,of(W,te),ue);df(W,te)}return null}function se(W,Y,te,ue,Oe){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return W=W.get(te)||null,j(Y,W,""+ue,Oe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case z:return W=W.get(ue.key===null?te:ue.key)||null,U(Y,W,ue,Oe);case I:return W=W.get(ue.key===null?te:ue.key)||null,J(Y,W,ue,Oe);case ne:return ue=Go(ue),se(W,Y,te,ue,Oe)}if(ye(ue)||H(ue))return W=W.get(te)||null,re(Y,W,ue,Oe,null);if(typeof ue.then=="function")return se(W,Y,te,uf(ue),Oe);if(ue.$$typeof===q)return se(W,Y,te,of(Y,ue),Oe);df(Y,ue)}return null}function Re(W,Y,te,ue){for(var Oe=null,dt=null,Ve=Y,$e=Y=0,sn=null;Ve!==null&&$e<te.length;$e++){Ve.index>$e?(sn=Ve,Ve=null):sn=Ve.sibling;var ht=Z(W,Ve,te[$e],ue);if(ht===null){Ve===null&&(Ve=sn);break}n&&Ve&&ht.alternate===null&&r(W,Ve),Y=y(ht,Y,$e),dt===null?Oe=ht:dt.sibling=ht,dt=ht,Ve=sn}if($e===te.length)return a(W,Ve),st&&$i(W,$e),Oe;if(Ve===null){for(;$e<te.length;$e++)Ve=de(W,te[$e],ue),Ve!==null&&(Y=y(Ve,Y,$e),dt===null?Oe=Ve:dt.sibling=Ve,dt=Ve);return st&&$i(W,$e),Oe}for(Ve=c(Ve);$e<te.length;$e++)sn=se(Ve,W,$e,te[$e],ue),sn!==null&&(n&&(ht=sn.alternate,ht!==null&&Ve.delete(ht.key===null?$e:ht.key)),Y=y(sn,Y,$e),dt===null?Oe=sn:dt.sibling=sn,dt=sn);return n&&Ve.forEach(function(Wr){return r(W,Wr)}),st&&$i(W,$e),Oe}function _e(W,Y,te,ue){if(te==null)throw Error(i(151));for(var Oe=null,dt=null,Ve=Y,$e=Y=0,sn=null,ht=te.next();Ve!==null&&!ht.done;$e++,ht=te.next()){Ve.index>$e?(sn=Ve,Ve=null):sn=Ve.sibling;var Wr=Z(W,Ve,ht.value,ue);if(Wr===null){Ve===null&&(Ve=sn);break}n&&Ve&&Wr.alternate===null&&r(W,Ve),Y=y(Wr,Y,$e),dt===null?Oe=Wr:dt.sibling=Wr,dt=Wr,Ve=sn}if(ht.done)return a(W,Ve),st&&$i(W,$e),Oe;if(Ve===null){for(;!ht.done;$e++,ht=te.next())ht=de(W,ht.value,ue),ht!==null&&(Y=y(ht,Y,$e),dt===null?Oe=ht:dt.sibling=ht,dt=ht);return st&&$i(W,$e),Oe}for(Ve=c(Ve);!ht.done;$e++,ht=te.next())ht=se(Ve,W,$e,ht.value,ue),ht!==null&&(n&&(sn=ht.alternate,sn!==null&&Ve.delete(sn.key===null?$e:sn.key)),Y=y(ht,Y,$e),dt===null?Oe=ht:dt.sibling=ht,dt=ht);return n&&Ve.forEach(function(V3){return r(W,V3)}),st&&$i(W,$e),Oe}function et(W,Y,te,ue){if(typeof te=="object"&&te!==null&&te.type===V&&te.key===null&&te.props.ref===void 0&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case z:e:{for(var Oe=te.key;Y!==null;){if(Y.key===Oe){if(Oe=te.type,Oe===V){if(Y.tag===7){a(W,Y.sibling),ue=m(Y,te.props.children),Dr(ue,te),ue.return=W,W=ue;break e}}else if(Y.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===ne&&Go(Oe)===Y.type){a(W,Y.sibling),ue=m(Y,te.props),Dr(ue,te),ue.return=W,W=ue;break e}a(W,Y);break}else r(W,Y);Y=Y.sibling}te.type===V?(ue=Lo(te.props.children,W.mode,ue,te.key),Dr(ue,te),ue.return=W,W=ue):(ue=Jd(te.type,te.key,te.props,null,W.mode,ue),Dr(ue,te),ue.return=W,W=ue)}return R(W);case I:e:{for(Oe=te.key;Y!==null;){if(Y.key===Oe)if(Y.tag===4&&Y.stateNode.containerInfo===te.containerInfo&&Y.stateNode.implementation===te.implementation){a(W,Y.sibling),ue=m(Y,te.children||[]),ue.return=W,W=ue;break e}else{a(W,Y);break}else r(W,Y);Y=Y.sibling}ue=Hp(te,W.mode,ue),ue.return=W,W=ue}return R(W);case ne:return te=Go(te),et(W,Y,te,ue)}if(ye(te))return Re(W,Y,te,ue);if(H(te)){if(Oe=H(te),typeof Oe!="function")throw Error(i(150));return te=Oe.call(te),_e(W,Y,te,ue)}if(typeof te.then=="function")return et(W,Y,uf(te),ue);if(te.$$typeof===q)return et(W,Y,of(W,te),ue);df(W,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Y!==null&&Y.tag===6?(a(W,Y.sibling),ue=m(Y,te),ue.return=W,W=ue):(a(W,Y),ue=qp(te,W.mode,ue),ue.return=W,W=ue),R(W)):a(W,Y)}return function(W,Y,te,ue){try{Gc=0;var Oe=et(W,Y,te,ue);return fl=null,Oe}catch(Ve){if(Ve===dl||Ve===lf)throw Ve;var dt=es(29,Ve,null,W.mode);return dt.lanes=ue,dt.return=W,dt}finally{}}}var Yo=yS(!0),vS=yS(!1),_r=!1;function eg(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tg(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ir(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Pr(n,r,a){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(St&2)!==0){var m=c.pending;return m===null?r.next=r:(r.next=m.next,m.next=r),c.pending=r,r=Wd(n),tS(n,null,a),r}return Zd(n,c,r,a),Wd(n)}function Kc(n,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,Pd(n,a)}}function ng(n,r){var a=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var m=null,y=null;if(a=a.firstBaseUpdate,a!==null){do{var R={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};y===null?m=y=R:y=y.next=R,a=a.next}while(a!==null);y===null?m=y=r:y=y.next=r}else m=y=r;a={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=r:n.next=r,a.lastBaseUpdate=r}var sg=!1;function Yc(){if(sg){var n=ul;if(n!==null)throw n}}function $c(n,r,a,c){sg=!1;var m=n.updateQueue;_r=!1;var y=m.firstBaseUpdate,R=m.lastBaseUpdate,j=m.shared.pending;if(j!==null){m.shared.pending=null;var U=j,J=U.next;U.next=null,R===null?y=J:R.next=J,R=U;var re=n.alternate;re!==null&&(re=re.updateQueue,j=re.lastBaseUpdate,j!==R&&(j===null?re.firstBaseUpdate=J:j.next=J,re.lastBaseUpdate=U))}if(y!==null){var de=m.baseState;R=0,re=J=U=null,j=y;do{var Z=j.lane&-536870913,se=Z!==j.lane;if(se?(ut&Z)===Z:(c&Z)===Z){Z!==0&&Z===qo&&(sg=!0),re!==null&&(re=re.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Re=n,_e=j;Z=r;var et=a;switch(_e.tag){case 1:if(Re=_e.payload,typeof Re=="function"){de=Re.call(et,de,Z);break e}de=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=_e.payload,Z=typeof Re=="function"?Re.call(et,de,Z):Re,Z==null)break e;de=N({},de,Z);break e;case 2:_r=!0}}Z=j.callback,Z!==null&&(n.flags|=64,se&&(n.flags|=8192),se=m.callbacks,se===null?m.callbacks=[Z]:se.push(Z))}else se={lane:Z,tag:j.tag,payload:j.payload,callback:j.callback,next:null},re===null?(J=re=se,U=de):re=re.next=se,R|=Z;if(j=j.next,j===null){if(j=m.shared.pending,j===null)break;se=j,j=se.next,se.next=null,m.lastBaseUpdate=se,m.shared.pending=null}}while(!0);re===null&&(U=de),m.baseState=U,m.firstBaseUpdate=J,m.lastBaseUpdate=re,y===null&&(m.shared.lanes=0),qr|=R,n.lanes=R,n.memoizedState=de}}function bS(n,r){if(typeof n!="function")throw Error(i(191,n));n.call(r)}function xS(n,r){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)bS(a[n],r)}var zr=Ae(null),ff=Ae(0);function wS(n,r){n=tr,Ue(ff,n),Ue(zr,r),tr=n|r.baseLanes}function ig(){Ue(ff,tr),Ue(zr,zr.current)}function rg(){tr=ff.current,Ge(zr),Ge(ff)}var Rn=Ae(null),_n=null;function Lr(n){var r=n.alternate;Ue(En,En.current&1),Ue(Rn,n),_n===null&&(r===null||zr.current!==null||r.memoizedState!==null)&&(_n=n)}function og(n){Ue(En,En.current),Ue(Rn,n),_n===null&&(_n=n)}function SS(n){n.tag===22?(Ue(En,En.current),Ue(Rn,n),_n===null&&(_n=n)):Br()}function Br(){Ue(En,En.current),Ue(Rn,Rn.current)}function hs(n){Ge(Rn),_n===n&&(_n=null),Ge(En)}var En=Ae(0);function Qc(n,r){Ue(Rn,Rn.current),Ue(En,r)}function ag(n){Ge(En),Ge(Rn),_n===n&&(_n=null)}function hf(n){for(var r=n;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||My(a)||Ny(a)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!=="independent"){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Zi=0,Je=null,Nt=null,tn=null,mf=!1,hl=!1,$o=!1,pf=0,Xc=0,ml=null,l_=0;function Qt(){throw Error(i(321))}function lg(n,r){if(r===null)return!1;for(var a=0;a<r.length&&a<n.length;a++)if(!fs(n[a],r[a]))return!1;return!0}function cg(n,r,a,c,m,y){return Zi=y,Je=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ce.H=n===null||n.memoizedState===null?r1:o1,$o=!1,y=a(c,m),$o=!1,hl&&(y=RS(r,a,c,m)),TS(n),y}function TS(n){ce.H=Sf;var r=Nt!==null&&Nt.next!==null;if(Zi=0,tn=Nt=Je=null,mf=!1,Xc=0,ml=null,r)throw Error(i(300));n===null||nn||(n=n.dependencies,n!==null&&rf(n)&&(nn=!0))}function RS(n,r,a,c){Je=n;var m=0;do{if(hl&&(ml=null),Xc=0,hl=!1,25<=m)throw Error(i(301));if(m+=1,tn=Nt=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}ce.H=g_,y=r(a,c)}while(hl);return y}function c_(){var n=ce.H,r=n.useState()[0];return r=typeof r.then=="function"?Zc(r):r,n=n.useState()[0],(Nt!==null?Nt.memoizedState:null)!==n&&(Je.flags|=1024),r}function ug(){var n=pf!==0;return pf=0,n}function dg(n,r,a){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~a}function fg(n){if(mf){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}mf=!1}Zi=0,tn=Nt=Je=null,hl=!1,Xc=pf=0,ml=null}function Vn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Je.memoizedState=tn=n:tn=tn.next=n,tn}function Wt(){if(Nt===null){var n=Je.alternate;n=n!==null?n.memoizedState:null}else n=Nt.next;var r=tn===null?Je.memoizedState:tn.next;if(r!==null)tn=r,Nt=n;else{if(n===null)throw Je.alternate===null?Error(i(467)):Error(i(310));Nt=n,n={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},tn===null?Je.memoizedState=tn=n:tn=tn.next=n}return tn}function gf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zc(n){var r=Xc;return Xc+=1,ml===null&&(ml=[]),n=mS(ml,n,r),r=Je,(tn===null?r.memoizedState:tn.next)===null&&(r=r.alternate,ce.H=r===null||r.memoizedState===null?r1:o1),n}function yf(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Zc(n);if(n.$$typeof===K)return;if(n.$$typeof===q)return Tn(n)}throw Error(i(438,String(n)))}function hg(n){var r=null,a=Je.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var c=Je.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(m){return m.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=gf(),Je.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(n),c=0;c<n;c++)a[c]=ve;return r.index++,a}function Wi(n,r){return typeof r=="function"?r(n):r}function vf(n){var r=Wt();return mg(r,Nt,n)}function mg(n,r,a){var c=n.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var m=n.baseQueue,y=c.pending;if(y!==null){if(m!==null){var R=m.next;m.next=y.next,y.next=R}r.baseQueue=m=y,c.pending=null}if(y=n.baseState,m===null)n.memoizedState=y;else{r=m.next;var j=R=null,U=null,J=r,re=!1;do{var de=J.lane&-536870913;if(de!==J.lane?(ut&de)===de:(Zi&de)===de){var Z=J.revertLane;if(Z===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),de===qo&&(re=!0);else if((Zi&Z)===Z){J=J.next,Z===qo&&(re=!0);continue}else de={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},U===null?(j=U=de,R=y):U=U.next=de,Je.lanes|=Z,qr|=Z;de=J.action,$o&&a(y,de),y=J.hasEagerState?J.eagerState:a(y,de)}else Z={lane:de,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},U===null?(j=U=Z,R=y):U=U.next=Z,Je.lanes|=de,qr|=de;J=J.next}while(J!==null&&J!==r);if(U===null?R=y:U.next=j,!fs(y,n.memoizedState)&&(nn=!0,re&&(a=ul,a!==null)))throw a;n.memoizedState=y,n.baseState=R,n.baseQueue=U,c.lastRenderedState=y}return m===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function pg(n){var r=Wt(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var c=a.dispatch,m=a.pending,y=r.memoizedState;if(m!==null){a.pending=null;var R=m=m.next;do y=n(y,R.action),R=R.next;while(R!==m);fs(y,r.memoizedState)||(nn=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),a.lastRenderedState=y}return[y,c]}function ES(n,r,a){var c=Je,m=Wt(),y=st;if(y){if(a===void 0)throw Error(i(407));a=a()}else a=r();var R=!fs((Nt||m).memoizedState,a);if(R&&(m.memoizedState=a,nn=!0),m=m.queue,vg(kS.bind(null,c,m,n),[n]),n=m.getSnapshot!==r||R||tn!==null&&(tn.memoizedState.tag&1)!==0,pl(n?9:8,{destroy:void 0},AS.bind(null,c,m,a,r),null),n){if(c.flags|=2048,Pt===null)throw Error(i(349));y||(Zi&127)!==0||CS(c,r,a)}return a}function CS(n,r,a){n.flags|=16384,n={getSnapshot:r,value:a},r=Je.updateQueue,r===null?(r=gf(),Je.updateQueue=r,r.stores=[n]):(a=r.stores,a===null?r.stores=[n]:a.push(n))}function AS(n,r,a,c){r.value=a,r.getSnapshot=c,MS(r)&&NS(n)}function kS(n,r,a){return a(function(){MS(r)&&NS(n)})}function MS(n){var r=n.getSnapshot;n=n.value;try{var a=r();return!fs(n,a)}catch{return!0}}function NS(n){var r=zo(n,2);r!==null&&is(r,n,2)}function gg(n){var r=Vn();if(typeof n=="function"){var a=n;if(n=a(),$o){nt(!0);try{a()}finally{nt(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wi,lastRenderedState:n},r}function OS(n,r,a,c){return n.baseState=a,mg(n,Nt,typeof c=="function"?c:Wi)}function u_(n,r,a,c,m){if(wf(n))throw Error(i(485));if(n=r.action,n!==null){var y={payload:m,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){y.listeners.push(R)}};ce.T!==null?a(!0):y.isTransition=!1,c(y),a=r.pending,a===null?(y.next=r.pending=y,jS(r,y)):(y.next=a.next,r.pending=a.next=y)}}function jS(n,r){var a=r.action,c=r.payload,m=n.state;if(r.isTransition){var y=ce.T,R={};R.types=y!==null?y.types:null,ce.T=R;try{var j=a(m,c),U=ce.S;U!==null&&U(R,j),DS(n,r,j)}catch(J){yg(n,r,J)}finally{y!==null&&R.types!==null&&(y.types=R.types),ce.T=y}}else try{y=a(m,c),DS(n,r,y)}catch(J){yg(n,r,J)}}function DS(n,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){_S(n,r,c)},function(c){return yg(n,r,c)}):_S(n,r,a)}function _S(n,r,a){r.status="fulfilled",r.value=a,IS(r),n.state=a,r=n.pending,r!==null&&(a=r.next,a===r?n.pending=null:(a=a.next,r.next=a,jS(n,a)))}function yg(n,r,a){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=a,IS(r),r=r.next;while(r!==c)}n.action=null}function IS(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function PS(n,r){return r}function zS(n,r){if(st){var a=Pt.formState;if(a!==null){e:{var c=Je;if(st){if(zt){t:{for(var m=zt,y=Os;m.nodeType!==8;){if(!y){m=null;break t}if(m=Ds(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){zt=Ds(m.nextSibling),c=m.data==="F!";break e}}Or(c)}c=!1}c&&(r=a[0])}}return a=Vn(),a.memoizedState=a.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:PS,lastRenderedState:r},a.queue=c,a=n1.bind(null,Je,c),c.dispatch=a,c=gg(!1),y=Tg.bind(null,Je,!1,c.queue),c=Vn(),m={state:r,dispatch:null,action:n,pending:null},c.queue=m,a=u_.bind(null,Je,m,y,a),m.dispatch=a,c.memoizedState=n,[r,a,!1]}function LS(n){var r=Wt();return BS(r,Nt,n)}function BS(n,r,a){if(r=mg(n,r,PS)[0],n=vf(Wi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Zc(r)}catch(R){throw R===dl?lf:R}else c=r;r=Wt();var m=r.queue,y=m.dispatch;return a!==r.memoizedState&&(Je.flags|=2048,pl(9,{destroy:void 0},d_.bind(null,m,a),null)),[c,y,n]}function d_(n,r){n.action=r}function US(n){var r=Wt(),a=Nt;if(a!==null)return BS(r,a,n);Wt(),r=r.memoizedState,a=Wt();var c=a.queue.dispatch;return a.memoizedState=n,[r,c,!1]}function pl(n,r,a,c){return n={tag:n,create:a,deps:c,inst:r,next:null},r=Je.updateQueue,r===null&&(r=gf(),Je.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=n.next=n:(c=a.next,a.next=n,n.next=c,r.lastEffect=n),n}function VS(){return Wt().memoizedState}function bf(n,r,a,c){var m=Vn();Je.flags|=n,m.memoizedState=pl(1|r,{destroy:void 0},a,c===void 0?null:c)}function xf(n,r,a,c){var m=Wt();c=c===void 0?null:c;var y=m.memoizedState.inst;Nt!==null&&c!==null&&lg(c,Nt.memoizedState.deps)?m.memoizedState=pl(r,y,a,c):(Je.flags|=n,m.memoizedState=pl(1|r,y,a,c))}function FS(n,r){bf(8390656,8,n,r)}function vg(n,r){xf(2048,8,n,r)}function f_(n){Je.flags|=4;var r=Je.updateQueue;if(r===null)r=gf(),Je.updateQueue=r,r.events=[n];else{var a=r.events;a===null?r.events=[n]:a.push(n)}}function qS(n){var r=Wt().memoizedState;return f_({ref:r,nextImpl:n}),function(){if((St&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function HS(n,r){return xf(4,2,n,r)}function GS(n,r){return xf(4,4,n,r)}function KS(n,r){if(typeof r=="function"){n=n();var a=r(n);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function YS(n,r,a){a=a!=null?a.concat([n]):null,xf(4,4,KS.bind(null,r,n),a)}function bg(){}function $S(n,r){var a=Wt();r=r===void 0?null:r;var c=a.memoizedState;return r!==null&&lg(r,c[1])?c[0]:(a.memoizedState=[n,r],n)}function QS(n,r){var a=Wt();r=r===void 0?null:r;var c=a.memoizedState;if(r!==null&&lg(r,c[1]))return c[0];if(c=n(),$o){nt(!0);try{n()}finally{nt(!1)}}return a.memoizedState=[c,r],c}function xg(n,r,a){return a===void 0||(Zi&1073741824)!==0&&(ut&261930)===0?n.memoizedState=r:(n.memoizedState=a,n=rT(),Je.lanes|=n,qr|=n,a)}function XS(n,r,a,c){return fs(a,r)?a:zr.current!==null?(n=xg(n,a,c),fs(n,r)||(nn=!0),n):(Zi&106)===0||(Zi&1073741824)!==0&&(ut&261930)===0?(nn=!0,n.memoizedState=a):(n=rT(),Je.lanes|=n,qr|=n,r)}function ZS(n,r,a,c,m){var y=me.p;me.p=y!==0&&8>y?y:8;var R=ce.T,j={};j.types=R!==null?R.types:null,ce.T=j,Tg(n,!1,r,a);try{var U=m(),J=ce.S;if(J!==null&&J(j,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=a_(U,c);Wc(n,r,re,ys(n))}else Wc(n,r,c,ys(n))}catch(de){Wc(n,r,{then:function(){},status:"rejected",reason:de},ys())}finally{me.p=y,R!==null&&j.types!==null&&(R.types=j.types),ce.T=R}}function h_(){}function wg(n,r,a,c){if(n.tag!==5)throw Error(i(476));var m=WS(n).queue;ZS(n,m,r,ze,a===null?h_:function(){return JS(n),a(c)})}function WS(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:ze,baseState:ze,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wi,lastRenderedState:ze},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wi,lastRenderedState:a},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function JS(n){var r=WS(n);r.next===null&&(r=n.alternate.memoizedState),Wc(n,r.next.queue,{},ys())}function Sg(){return Tn(_l)}function e1(){return Wt().memoizedState}function t1(){return Wt().memoizedState}function m_(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var a=ys();n=Ir(a);var c=Pr(r,n,a);c!==null&&(is(c,r,a),Kc(c,r,a)),r={cache:Xp()},n.payload=r;return}r=r.return}}function p_(n,r,a){var c=ys();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wf(n)?s1(r,a):(a=Vp(n,r,a,c),a!==null&&(is(a,n,c),i1(a,r,c)))}function n1(n,r,a){var c=ys();Wc(n,r,a,c)}function Wc(n,r,a,c){var m={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(wf(n))s1(r,m);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var R=r.lastRenderedState,j=y(R,a);if(m.hasEagerState=!0,m.eagerState=j,fs(j,R))return Zd(n,r,m,0),Pt===null&&Xd(),!1}catch{}finally{}if(a=Vp(n,r,m,c),a!==null)return is(a,n,c),i1(a,r,c),!0}return!1}function Tg(n,r,a,c){if(c={lane:2,revertLane:hy(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},wf(n)){if(r)throw Error(i(479))}else r=Vp(n,a,c,2),r!==null&&is(r,n,2)}function wf(n){var r=n.alternate;return n===Je||r!==null&&r===Je}function s1(n,r){hl=mf=!0;var a=n.pending;a===null?r.next=r:(r.next=a.next,a.next=r),n.pending=r}function i1(n,r,a){if((a&4194048)!==0){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,Pd(n,a)}}var Sf={readContext:Tn,use:yf,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt,useEffectEvent:Qt},r1={readContext:Tn,use:yf,useCallback:function(n,r){return Vn().memoizedState=[n,r===void 0?null:r],n},useContext:Tn,useEffect:FS,useImperativeHandle:function(n,r,a){a=a!=null?a.concat([n]):null,bf(4194308,4,KS.bind(null,r,n),a)},useLayoutEffect:function(n,r){return bf(4194308,4,n,r)},useInsertionEffect:function(n,r){bf(4,2,n,r)},useMemo:function(n,r){var a=Vn();r=r===void 0?null:r;var c=n();if($o){nt(!0);try{n()}finally{nt(!1)}}return a.memoizedState=[c,r],c},useReducer:function(n,r,a){var c=Vn();if(a!==void 0){var m=a(r);if($o){nt(!0);try{a(r)}finally{nt(!1)}}}else m=r;return c.memoizedState=c.baseState=m,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:m},c.queue=n,n=n.dispatch=p_.bind(null,Je,n),[c.memoizedState,n]},useRef:function(n){var r=Vn();return n={current:n},r.memoizedState=n},useState:function(n){n=gg(n);var r=n.queue,a=n1.bind(null,Je,r);return r.dispatch=a,[n.memoizedState,a]},useDebugValue:bg,useDeferredValue:function(n,r){var a=Vn();return xg(a,n,r)},useTransition:function(){var n=gg(!1);return n=ZS.bind(null,Je,n.queue,!0,!1),Vn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,a){var c=Je,m=Vn();if(st){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),Pt===null)throw Error(i(349));(ut&127)!==0||CS(c,r,a)}m.memoizedState=a;var y={value:a,getSnapshot:r};return m.queue=y,FS(kS.bind(null,c,y,n),[n]),c.flags|=2048,pl(9,{destroy:void 0},AS.bind(null,c,y,a,r),null),a},useId:function(){var n=Vn(),r=Pt.identifierPrefix;if(st){var a=ui,c=ci;a=(c&~(1<<32-gt(c)-1)).toString(32)+a,r="_"+r+"R_"+a,a=pf++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=l_++,r="_"+r+"r_"+a.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Sg,useFormState:zS,useActionState:zS,useOptimistic:function(n){var r=Vn();r.memoizedState=r.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Tg.bind(null,Je,!0,a),a.dispatch=r,[n,r]},useMemoCache:hg,useCacheRefresh:function(){return Vn().memoizedState=m_.bind(null,Je)},useEffectEvent:function(n){var r=Vn(),a={impl:n};return r.memoizedState=a,function(){if((St&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},o1={readContext:Tn,use:yf,useCallback:$S,useContext:Tn,useEffect:vg,useImperativeHandle:YS,useInsertionEffect:HS,useLayoutEffect:GS,useMemo:QS,useReducer:vf,useRef:VS,useState:function(){return vf(Wi)},useDebugValue:bg,useDeferredValue:function(n,r){var a=Wt();return XS(a,Nt.memoizedState,n,r)},useTransition:function(){var n=vf(Wi)[0],r=Wt().memoizedState;return[typeof n=="boolean"?n:Zc(n),r]},useSyncExternalStore:ES,useId:e1,useHostTransitionStatus:Sg,useFormState:LS,useActionState:LS,useOptimistic:function(n,r){var a=Wt();return OS(a,Nt,n,r)},useMemoCache:hg,useCacheRefresh:t1,useEffectEvent:qS},g_={readContext:Tn,use:yf,useCallback:$S,useContext:Tn,useEffect:vg,useImperativeHandle:YS,useInsertionEffect:HS,useLayoutEffect:GS,useMemo:QS,useReducer:pg,useRef:VS,useState:function(){return pg(Wi)},useDebugValue:bg,useDeferredValue:function(n,r){var a=Wt();return Nt===null?xg(a,n,r):XS(a,Nt.memoizedState,n,r)},useTransition:function(){var n=pg(Wi)[0],r=Wt().memoizedState;return[typeof n=="boolean"?n:Zc(n),r]},useSyncExternalStore:ES,useId:e1,useHostTransitionStatus:Sg,useFormState:US,useActionState:US,useOptimistic:function(n,r){var a=Wt();return Nt!==null?OS(a,Nt,n,r):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:hg,useCacheRefresh:t1,useEffectEvent:qS};function Rg(n,r,a,c){r=n.memoizedState,a=a(c,r),a=a==null?r:N({},r,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var Eg={enqueueSetState:function(n,r,a){n=n._reactInternals;var c=ys(),m=Ir(c);m.payload=r,a!=null&&(m.callback=a),r=Pr(n,m,c),r!==null&&(is(r,n,c),Kc(r,n,c))},enqueueReplaceState:function(n,r,a){n=n._reactInternals;var c=ys(),m=Ir(c);m.tag=1,m.payload=r,a!=null&&(m.callback=a),r=Pr(n,m,c),r!==null&&(is(r,n,c),Kc(r,n,c))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var a=ys(),c=Ir(a);c.tag=2,r!=null&&(c.callback=r),r=Pr(n,c,a),r!==null&&(is(r,n,a),Kc(r,n,a))}};function a1(n,r,a,c,m,y,R){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,y,R):r.prototype&&r.prototype.isPureReactComponent?!Lc(a,c)||!Lc(m,y):!0}function l1(n,r,a,c){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,c),r.state!==n&&Eg.enqueueReplaceState(r,r.state,null)}function Qo(n,r){var a=r;if("ref"in r){a={};for(var c in r)c!=="ref"&&(a[c]=r[c])}if(n=n.defaultProps){a===r&&(a=N({},a));for(var m in n)a[m]===void 0&&(a[m]=n[m])}return a}function c1(n){Qd(n)}function u1(n){console.error(n)}function d1(n){Qd(n)}function Tf(n,r){try{var a=n.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function f1(n,r,a){try{var c=n.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Cg(n,r,a){return a=Ir(a),a.tag=3,a.payload={element:null},a.callback=function(){Tf(n,r)},a}function h1(n){return n=Ir(n),n.tag=3,n}function m1(n,r,a,c){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var y=c.value;n.payload=function(){return m(y)},n.callback=function(){f1(r,a,c)}}var R=a.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(n.callback=function(){f1(r,a,c),typeof m!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var j=c.stack;this.componentDidCatch(c.value,{componentStack:j!==null?j:""})})}function y_(n,r,a,c,m){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=a.alternate,r!==null&&Vo(r,a,m,!0),a=Rn.current,a!==null){switch(a.tag){case 31:case 13:case 19:return _n===null?Hf():a.alternate===null&&Xt===0&&(Xt=3),a.flags&=-257,a.flags|=65536,a.lanes=m,c===cf?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([c]):r.add(c),uy(n,c,m)),!1;case 22:return a.flags|=65536,c===cf?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([c]):a.add(c)),uy(n,c,m)),!1}throw Error(i(435,a.tag))}return uy(n,c,m),Hf(),!1}if(st)return r=Rn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=m,c!==Kp&&(n=Error(i(422),{cause:c}),Vc(ks(n,a)))):(c!==Kp&&(r=Error(i(423),{cause:c}),Vc(ks(r,a))),n=n.current.alternate,n.flags|=65536,m&=-m,n.lanes|=m,c=ks(c,a),m=Cg(n.stateNode,c,m),ng(n,m),Xt!==4&&(Xt=2)),!1;var y=Error(i(520),{cause:c});if(y=ks(y,a),ou===null?ou=[y]:ou.push(y),Xt!==4&&(Xt=2),r===null)return!0;c=ks(c,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,n=m&-m,a.lanes|=n,n=Cg(a.stateNode,c,n),ng(a,n),!1;case 1:if(r=a.type,y=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Hr===null||!Hr.has(y))))return a.flags|=65536,m&=-m,a.lanes|=m,m=h1(m),m1(m,n,a,c),ng(a,m),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var Ag=Error(i(461)),nn=!1;function an(n,r,a,c){r.child=n===null?vS(r,null,a,c):Yo(r,n.child,a,c)}function p1(n,r,a,c,m){a=a.render;var y=r.ref;if("ref"in c){var R={};for(var j in c)j!=="ref"&&(R[j]=c[j])}else R=c;return Fo(r),c=cg(n,r,a,R,y,m),j=ug(),n!==null&&!nn?(dg(n,r,m),Ji(n,r,m)):(st&&j&&tf(r),r.flags|=1,an(n,r,c,m),r.child)}function g1(n,r,a,c,m){if(n===null){var y=a.type;return typeof y=="function"&&!Fp(y)&&y.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=y,y1(n,r,y,c,m)):(n=Jd(a.type,null,c,r,r.mode,m),n.ref=r.ref,n.return=r,r.child=n)}if(y=n.child,!Ig(n,m)){var R=y.memoizedProps;if(a=a.compare,a=a!==null?a:Lc,a(R,c)&&n.ref===r.ref)return Ji(n,r,m)}return r.flags|=1,n=Yi(y,c),n.ref=r.ref,n.return=r,r.child=n}function y1(n,r,a,c,m){if(n!==null){var y=n.memoizedProps;if(Lc(y,c)&&n.ref===r.ref)if(nn=!1,r.pendingProps=c=y,Ig(n,m))(n.flags&131072)!==0&&(nn=!0);else return r.lanes=n.lanes,Ji(n,r,m)}return kg(n,r,a,c,m)}function v1(n,r,a,c){var m=c.children,y=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|a:a,n!==null){for(c=r.child=n.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~y}else c=0,r.child=null;return b1(n,r,y,a,c)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&af(r,y!==null?y.cachePool:null),y!==null?wS(r,y):ig(),SS(r);else return c=r.lanes=536870912,b1(n,r,y!==null?y.baseLanes|a:a,a,c)}else y!==null?(af(r,y.cachePool),wS(r,y),Br(),r.memoizedState=null):(n!==null&&af(r,null),ig(),Br());return an(n,r,m,a),r.child}function Jc(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function b1(n,r,a,c,m){var y=Wp();return y=y===null?null:{parent:en._currentValue,pool:y},r.memoizedState={baseLanes:a,cachePool:y},n!==null&&af(r,null),ig(),SS(r),n!==null&&Vo(n,r,c,!0),r.childLanes=m,null}function Rf(n,r){return r=Ef({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function x1(n,r,a){return Yo(r,n.child,null,a),n=Rf(r,r.pendingProps),n.flags|=2,hs(r),r.memoizedState=null,n}function v_(n,r,a){var c=r.pendingProps,m=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(st){if(c.mode==="hidden")return n=Rf(r,c),r.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Jc(null,n);if(og(r),(n=zt)?(n=KT(n,Os),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Mr!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},a=sS(n),a.return=r,r.child=a,gn=r,zt=null)):n=null,n===null)throw Or(r);return r.lanes=536870912,null}return Rf(r,c)}var y=n.memoizedState;if(y!==null){var R=y.dehydrated;if(og(r),m)if(r.flags&256)r.flags&=-257,r=x1(n,r,a);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(i(558));else if(nn||Vo(n,r,a,!1),m=(a&n.childLanes)!==0,nn||m){if(zr.current===null){if(c=Pt,c!==null&&(R=zd(c,a),R!==0&&R!==y.retryLane))throw y.retryLane=R,zo(n,R),is(c,n,R),Ag;Hf()}r=x1(n,r,a)}else n=y.treeContext,zt=Ds(R.nextSibling),gn=r,st=!0,Nr=null,Os=!1,n!==null&&oS(r,n),r=Rf(r,c),r.flags|=134221824;return r}return n=Yi(n.child,{mode:c.mode,children:c.children}),n.ref=r.ref,r.child=n,n.return=r,n}function gl(n,r){var a=r.ref;if(a===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(n===null||n.ref!==a)&&(r.flags|=4194816)}}function kg(n,r,a,c,m){return Fo(r),a=cg(n,r,a,c,void 0,m),c=ug(),n!==null&&!nn?(dg(n,r,m),Ji(n,r,m)):(st&&c&&tf(r),r.flags|=1,an(n,r,a,m),r.child)}function w1(n,r,a,c,m,y){return Fo(r),r.updateQueue=null,a=RS(r,c,a,m),TS(n),c=ug(),n!==null&&!nn?(dg(n,r,y),Ji(n,r,y)):(st&&c&&tf(r),r.flags|=1,an(n,r,a,y),r.child)}function S1(n,r,a,c,m){if(Fo(r),r.stateNode===null){var y=ol,R=a.contextType;typeof R=="object"&&R!==null&&(y=Tn(R)),y=new a(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Eg,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},eg(r),R=a.contextType,y.context=typeof R=="object"&&R!==null?Tn(R):ol,y.state=r.memoizedState,R=a.getDerivedStateFromProps,typeof R=="function"&&(Rg(r,a,R,c),y.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(R=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),R!==y.state&&Eg.enqueueReplaceState(y,y.state,null),$c(r,c,y,m),Yc(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(n===null){y=r.stateNode;var j=r.memoizedProps,U=Qo(a,j);y.props=U;var J=y.context,re=a.contextType;R=ol,typeof re=="object"&&re!==null&&(R=Tn(re));var de=a.getDerivedStateFromProps;re=typeof de=="function"||typeof y.getSnapshotBeforeUpdate=="function",j=r.pendingProps!==j,re||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(j||J!==R)&&l1(r,y,c,R),_r=!1;var Z=r.memoizedState;y.state=Z,$c(r,c,y,m),Yc(),J=r.memoizedState,j||Z!==J||_r?(typeof de=="function"&&(Rg(r,a,de,c),J=r.memoizedState),(U=_r||a1(r,a,U,c,Z,J,R))?(re||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=J),y.props=c,y.state=J,y.context=R,c=U):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,tg(n,r),R=r.memoizedProps,re=Qo(a,R),y.props=re,de=r.pendingProps,Z=y.context,J=a.contextType,U=ol,typeof J=="object"&&J!==null&&(U=Tn(J)),j=a.getDerivedStateFromProps,(J=typeof j=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R!==de||Z!==U)&&l1(r,y,c,U),_r=!1,Z=r.memoizedState,y.state=Z,$c(r,c,y,m),Yc();var se=r.memoizedState;R!==de||Z!==se||_r||n!==null&&n.dependencies!==null&&rf(n.dependencies)?(typeof j=="function"&&(Rg(r,a,j,c),se=r.memoizedState),(re=_r||a1(r,a,re,c,Z,se,U)||n!==null&&n.dependencies!==null&&rf(n.dependencies))?(J||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,se,U),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,se,U)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||R===n.memoizedProps&&Z===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===n.memoizedProps&&Z===n.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=se),y.props=c,y.state=se,y.context=U,c=re):(typeof y.componentDidUpdate!="function"||R===n.memoizedProps&&Z===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===n.memoizedProps&&Z===n.memoizedState||(r.flags|=1024),c=!1)}return y=c,gl(n,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,n!==null&&c?(r.child=Yo(r,n.child,null,m),r.child=Yo(r,null,a,m)):an(n,r,a,m),r.memoizedState=y.state,n=r.child):n=Ji(n,r,m),n}function T1(n,r,a,c){return Bo(),r.flags|=256,an(n,r,a,c),r.child}var Mg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ng(n){return{baseLanes:n,cachePool:fS()}}function Og(n,r,a){return n=n!==null?n.childLanes&~a:0,r&&(n|=gs),n}function R1(n,r,a){var c=r.pendingProps,m=!1,y=(r.flags&128)!==0,R;if((R=y)||(R=n!==null&&n.memoizedState===null?!1:(En.current&2)!==0),R&&(m=!0,r.flags&=-129),R=(r.flags&32)!==0,r.flags&=-33,n===null){if(st){if(m?Lr(r):Br(),(n=zt)?(n=KT(n,Os),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Mr!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},a=sS(n),a.return=r,r.child=a,gn=r,zt=null)):n=null,n===null)throw Or(r);return Ny(n)?r.lanes=32:r.lanes=536870912,null}return y=c.children,c=c.fallback,m?(Br(),m=r.mode,y=Ef({mode:"hidden",children:y},m),c=Lo(c,m,a,null),y.return=r,c.return=r,y.sibling=c,r.child=y,c=r.child,c.memoizedState=Ng(a),c.childLanes=Og(n,R,a),r.memoizedState=Mg,Jc(null,c)):(Lr(r),jg(r,y))}var j=n.memoizedState;if(j!==null){var U=j.dehydrated;if(U!==null)return b_(n,r,y,R,c,U,j,a)}return m?(Br(),m=c.fallback,y=r.mode,j=n.child,U=j.sibling,c=Yi(j,{mode:"hidden",children:c.children}),c.subtreeFlags=j.subtreeFlags&1206910976,U!==null?m=Yi(U,m):(m=Lo(m,y,a,null),m.flags|=2),m.return=r,c.return=r,c.sibling=m,r.child=c,Jc(null,c),c=r.child,m=n.child.memoizedState,m===null?m=Ng(a):(y=m.cachePool,y!==null?(j=en._currentValue,y=y.parent!==j?{parent:j,pool:j}:y):y=fS(),m={baseLanes:m.baseLanes|a,cachePool:y}),c.memoizedState=m,c.childLanes=Og(n,R,a),r.memoizedState=Mg,Jc(n.child,c)):(Lr(r),a=n.child,n=a.sibling,a=Yi(a,{mode:"visible",children:c.children}),a.return=r,a.sibling=null,n!==null&&(R=r.deletions,R===null?(r.deletions=[n],r.flags|=16):R.push(n)),r.child=a,r.memoizedState=null,a)}function jg(n,r){return r=Ef({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Ef(n,r){return n=es(22,n,null,r),n.lanes=0,n}function Cf(n,r,a){return Yo(r,n.child,null,a),n=jg(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function b_(n,r,a,c,m,y,R,j){if(a)return r.flags&256?(Lr(r),r.flags&=-257,Cf(n,r,j)):r.memoizedState!==null?(Br(),r.child=n.child,r.flags|=128,null):(Br(),y=m.fallback,R=r.mode,m=Ef({mode:"visible",children:m.children},R),y=Lo(y,R,j,null),y.flags|=2,m.return=r,y.return=r,m.sibling=y,r.child=m,Yo(r,n.child,null,j),m=r.child,m.memoizedState=Ng(j),m.childLanes=Og(n,c,j),r.memoizedState=Mg,Jc(null,m));if(Lr(r),Ny(y)){if(c=y.nextSibling&&y.nextSibling.dataset,c)var U=c.dgst;return c=U,c!==""&&(m=Error(i(419)),m.stack="",m.digest=c,Vc({value:m,source:null,stack:null})),Cf(n,r,j)}if(nn||Vo(n,r,j,!1),c=(j&n.childLanes)!==0,nn||c){if(zr.current!==null)return Cf(n,r,j);if(c=Pt,c!==null&&(m=zd(c,j),m!==0&&m!==R.retryLane))throw R.retryLane=m,zo(n,m),is(c,n,m),Ag;return My(y)||Hf(),Cf(n,r,j)}return My(y)?(r.flags|=192,r.child=n.child,null):(n=R.treeContext,zt=Ds(y.nextSibling),gn=r,st=!0,Nr=null,Os=!1,n!==null&&oS(r,n),r=jg(r,m.children),r.flags|=134221824,r)}function E1(n,r,a){n.lanes|=r;var c=n.alternate;c!==null&&(c.lanes|=r),sf(n.return,r,a)}function C1(n){for(var r=null;n!==null;){var a=n.alternate;a!==null&&hf(a)===null&&(r=n),n=n.sibling}return r}function Af(n,r,a,c,m,y){var R=n.memoizedState;R===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:m,treeForkCount:y}:(R.isBackwards=r,R.rendering=null,R.renderingStartTime=0,R.last=c,R.tail=a,R.tailMode=m,R.treeForkCount=y)}function Dg(n){var r=n.child;for(n.child=null;r!==null;){var a=r.sibling;r.sibling=n.child,n.child=r,r=a}}function _g(n,r,a){var c=r.pendingProps,m=c.revealOrder,y=c.tail;c=c.children;var R=En.current;if(r.flags&128)return Qc(r,R),null;var j=(R&2)!==0;if(j?(R=R&1|2,r.flags|=128):R&=1,Qc(r,R),m==="backwards"&&n!==null?(Dg(n),an(n,r,c,a),Dg(n)):an(n,r,c,a),c=st?Uc:0,!j&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&E1(n,a,r);else if(n.tag===19)E1(n,a,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(m){case"backwards":a=C1(r.child),a===null?(m=r.child,r.child=null):(m=a.sibling,a.sibling=null,Dg(r)),Af(r,!0,m,null,y,c);break;case"unstable_legacy-backwards":for(a=null,m=r.child,r.child=null;m!==null;){if(n=m.alternate,n!==null&&hf(n)===null){r.child=m;break}n=m.sibling,m.sibling=a,a=m,m=n}Af(r,!0,a,null,y,c);break;case"together":Af(r,!1,null,null,void 0,c);break;case"independent":r.memoizedState=null;break;default:a=C1(r.child),a===null?(m=r.child,r.child=null):(m=a.sibling,a.sibling=null),Af(r,!1,m,a,y,c)}return r.child}function A1(n,r,a){var c=r.pendingProps;return jr(r,r.type,c.value),an(n,r,c.children,a),r.child}function Ji(n,r,a){if(n!==null&&(r.dependencies=n.dependencies),qr|=r.lanes,(a&r.childLanes)===0)if(n!==null){if(Vo(n,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(i(153));if(r.child!==null){for(n=r.child,a=Yi(n,n.pendingProps),r.child=a,a.return=r;n.sibling!==null;)n=n.sibling,a=a.sibling=Yi(n,n.pendingProps),a.return=r;a.sibling=null}return r.child}function Ig(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&rf(n)))}function x_(n,r,a){switch(r.tag){case 3:We(r,r.stateNode.containerInfo),jr(r,en,n.memoizedState.cache),Bo();break;case 27:case 5:le(r);break;case 4:We(r,r.stateNode.containerInfo);break;case 10:jr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,og(r),null;break;case 13:var c=r.memoizedState;if(c!==null){if(c.dehydrated!==null)return Lr(r),r.flags|=128,null;c=Vo(n,r,a,!1);var m=r.child.childLanes;return c||(a&m)!==0?R1(n,r,a):(Lr(r),n=Ji(n,r,a),n!==null?n.sibling:null)}Lr(r);break;case 19:if(r.flags&128)return _g(n,r,a);if(m=(n.flags&128)!==0,c=(a&r.childLanes)!==0,c||(Vo(n,r,a,!1),c=(a&r.childLanes)!==0),m){if(c)return _g(n,r,a);r.flags|=128}if(m=r.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Qc(r,En.current),c)break;return null;case 22:return r.lanes=0,v1(n,r,a,r.pendingProps);case 24:jr(r,en,n.memoizedState.cache)}return Ji(n,r,a)}function k1(n,r,a){if(n!==null)if(n.memoizedProps!==r.pendingProps)nn=!0;else{if(!Ig(n,a)&&(r.flags&128)===0)return nn=!1,x_(n,r,a);nn=(n.flags&131072)!==0}else nn=!1,st&&(r.flags&1048576)!==0&&rS(r,Uc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(n=Go(r.elementType),r.type=n,typeof n=="function")Fp(n)?(c=Qo(n,c),r.tag=1,r=S1(null,r,n,c,a)):(r.tag=0,r=kg(null,r,n,c,a));else{if(n!=null){var m=n.$$typeof;if(m===F){r.tag=11,r=p1(null,r,n,c,a);break e}else if(m===ae){r.tag=14,r=g1(null,r,n,c,a);break e}else if(m===q){r.tag=10,r.type=n,r=A1(null,r,a);break e}}throw r=oe(n)||n,Error(i(306,r,""))}}return r;case 0:return kg(n,r,r.type,r.pendingProps,a);case 1:return c=r.type,m=Qo(c,r.pendingProps),S1(n,r,c,m,a);case 3:e:{if(We(r,r.stateNode.containerInfo),n===null)throw Error(i(387));c=r.pendingProps;var y=r.memoizedState;m=y.element,tg(n,r),$c(r,c,null,a);var R=r.memoizedState;if(c=R.cache,jr(r,en,c),c!==y.cache&&Qp(r,[en],a,!0),Yc(),c=R.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:R.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=T1(n,r,c,a);break e}else if(c!==m){m=ks(Error(i(424)),r),Vc(m),r=T1(n,r,c,a);break e}else{switch(n=r.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(zt=Ds(n.firstChild),gn=r,st=!0,Nr=null,Os=!0,a=vS(r,null,c,a),r.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling}else{if(Bo(),c===m){r=Ji(n,r,a);break e}an(n,r,c,a)}r=r.child}return r;case 26:return gl(n,r),n===null?(a=JT(r.type,null,r.pendingProps,null))?r.memoizedState=a:st||(r.stateNode=jT(r.type,r.pendingProps,xe.current,r)):r.memoizedState=JT(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return le(r),n===null&&st&&(c=r.stateNode=QT(r.type,r.pendingProps,xe.current),gn=r,Os=!0,m=zt,Yr(r.type)?(Oy=m,zt=Ds(c.firstChild)):zt=m),an(n,r,r.pendingProps.children,a),gl(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&st&&((m=c=zt)&&(c=m3(c,r.type,r.pendingProps,Os),c!==null?(r.stateNode=c,gn=r,zt=Ds(c.firstChild),Os=!1,m=!0):m=!1),m||Or(r)),le(r),m=r.type,y=r.pendingProps,R=n!==null?n.memoizedProps:null,c=y.children,Sy(m,y)?c=null:R!==null&&Sy(m,R)&&(r.flags|=32),r.memoizedState!==null&&(m=cg(n,r,c_,null,null,a),_l._currentValue=m),gl(n,r),an(n,r,c,a),r.child;case 6:return n===null&&st&&((n=a=zt)&&(a=p3(a,r.pendingProps,Os),a!==null?(r.stateNode=a,gn=r,zt=null,n=!0):n=!1),n||Or(r)),null;case 13:return R1(n,r,a);case 4:return We(r,r.stateNode.containerInfo),c=r.pendingProps,n===null?r.child=Yo(r,null,c,a):an(n,r,c,a),r.child;case 11:return p1(n,r,r.type,r.pendingProps,a);case 7:return c=r.pendingProps,gl(n,r),an(n,r,c,a),r.child;case 8:return an(n,r,r.pendingProps.children,a),r.child;case 12:return an(n,r,r.pendingProps.children,a),r.child;case 10:return A1(n,r,a);case 9:return m=r.type._context,c=r.pendingProps.children,Fo(r),m=Tn(m),c=c(m),r.flags|=1,an(n,r,c,a),r.child;case 14:return g1(n,r,r.type,r.pendingProps,a);case 15:return y1(n,r,r.type,r.pendingProps,a);case 19:return _g(n,r,a);case 31:return v_(n,r,a);case 22:return v1(n,r,a,r.pendingProps);case 24:return Fo(r),c=Tn(en),n===null?(m=Wp(),m===null&&(m=Pt,y=Xp(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=a),m=y),r.memoizedState={parent:c,cache:m},eg(r),jr(r,en,m)):((n.lanes&a)!==0&&(tg(n,r),$c(r,null,null,a),Yc()),m=n.memoizedState,y=r.memoizedState,m.parent!==c?(m={parent:c,cache:c},r.memoizedState=m,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=m),jr(r,en,c)):(c=y.cache,jr(r,en,c),c!==m.cache&&Qp(r,[en],a,!0))),an(n,r,r.pendingProps.children,a),r.child;case 30:return r.stateNode===null&&(r.stateNode={autoName:null,paired:null,clones:null,ref:null}),c=r.pendingProps,c.name!=null&&c.name!=="auto"?r.flags|=n===null?18882560:18874368:st&&tf(r),n!==null&&n.memoizedProps.name!==c.name?r.flags|=4194816:gl(n,r),an(n,r,c.children,a),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function er(n){n.flags|=4}function Pg(n,r,a,c,m){var y;if((y=(n.mode&32)!==0)&&(y=a===null?sR(r,c):sR(r,c)&&(c.src!==a.src||c.srcSet!==a.srcSet)),y){if(n.flags|=16777216,(m&335544128)===m)if(n.stateNode.complete)n.flags|=8192;else if(cT())n.flags|=8192;else throw Ko=cf,Jp}else n.flags&=-16777217}function M1(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!iR(r))if(cT())n.flags|=8192;else throw Ko=cf,Jp}function kf(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ac():536870912,n.lanes|=r,wl|=r)}function eu(n,r){if(!st)switch(n.tailMode){case"visible":break;case"collapsed":for(var a=n.tail,c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null;break;default:for(r=n.tail,a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?n.tail=null:a.sibling=null}}function Lt(n){var r=n.alternate!==null&&n.alternate.child===n.child,a=0,c=0;if(r)for(var m=n.child;m!==null;)a|=m.lanes|m.childLanes,c|=m.subtreeFlags&1206910976,c|=m.flags&1206910976,m.return=n,m=m.sibling;else for(m=n.child;m!==null;)a|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=n,m=m.sibling;return n.subtreeFlags|=c,n.childLanes=a,r}function w_(n,r,a){var c=r.pendingProps;switch(Gp(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(r),null;case 1:return Lt(r),null;case 3:return a=r.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Xi(en),pt(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(cl(r)?er(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Yp())),Lt(r),null;case 26:var m=r.type,y=r.memoizedState;return n===null?(er(r),y!==null?(Lt(r),M1(r,y)):(Lt(r),Pg(r,m,null,c,a))):y?y!==n.memoizedState?(er(r),Lt(r),M1(r,y)):(Lt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==c&&er(r),Lt(r),Pg(r,m,n,c,a)),null;case 27:if(he(r),a=xe.current,m=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&er(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Lt(r),r.subtreeFlags&=-33554433,null}n=Se.current,cl(r)?aS(r):(n=QT(m,c,a),r.stateNode=n,er(r))}return Lt(r),r.subtreeFlags&=-33554433,null;case 5:if(he(r),m=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&er(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Lt(r),r.subtreeFlags&=-33554433,null}if(y=Se.current,cl(r))aS(r);else{var R=du(xe.current);switch(y){case 1:y=R.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=R.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=R.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=R.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=R.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?R.createElement("select",{is:c.is}):R.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?R.createElement(m,{is:c.is}):R.createElement(m)}}y[Sn]=r,y[Jn]=c;e:for(R=r.child;R!==null;){if(R.tag===5||R.tag===6)y.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===r)break e;for(;R.sibling===null;){if(R.return===null||R.return===r)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}r.stateNode=y;e:switch(An(y,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&&er(r)}}return Lt(r),r.subtreeFlags&=-33554433,Pg(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,a),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==c&&er(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(i(166));if(n=xe.current,cl(r)){if(n=r.stateNode,a=r.memoizedProps,c=null,m=gn,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}n[Sn]=r,n=!!(n.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||kT(n.nodeValue,a)),n||Or(r,!0)}else n=du(n).createTextNode(c),n[Sn]=r,r.stateNode=n}return Lt(r),null;case 31:if(a=r.memoizedState,n===null||n.memoizedState!==null){if(c=cl(r),a!==null){if(n===null){if(!c)throw Error(i(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Sn]=r}else Bo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Lt(r),n=!1}else a=Yp(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return r.flags&256?(hs(r),r):(hs(r),null);if((r.flags&128)!==0)throw Error(i(558))}return Lt(r),null;case 13:if(c=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(m=cl(r),c!==null&&c.dehydrated!==null){if(n===null){if(!m)throw Error(i(318));if(m=r.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[Sn]=r}else Bo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Lt(r),m=!1}else m=Yp(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=m),m=!0;if(!m)return r.flags&256?(hs(r),r):(hs(r),null)}return hs(r),(r.flags&128)!==0?(r.lanes=a,r):(a=c!==null,n=n!==null&&n.memoizedState!==null,a&&(c=r.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==m&&(c.flags|=2048)),a!==n&&a&&(r.child.flags|=8192),kf(r,r.updateQueue),Lt(r),null);case 4:return pt(),n===null&&yy(r.stateNode.containerInfo),r.flags|=67108864,Lt(r),null;case 10:return Xi(r.type),Lt(r),null;case 19:if(ag(r),c=r.memoizedState,c===null)return Lt(r),null;if(m=(r.flags&128)!==0,y=c.rendering,y===null)if(m)eu(c,!1);else{if(Xt!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(y=hf(n),y!==null){for(r.flags|=128,eu(c,!1),n=y.updateQueue,r.updateQueue=n,kf(r,n),r.subtreeFlags=0,n=a,a=r.child;a!==null;)nS(a,n),a=a.sibling;return Qc(r,En.current&1|2),st&&$i(r,c.treeForkCount),r.child}n=n.sibling}c.tail!==null&&Ut()>Uf&&(r.flags|=128,m=!0,eu(c,!1),r.lanes=4194304)}else{if(!m)if(n=hf(y),n!==null){if(r.flags|=128,m=!0,n=n.updateQueue,r.updateQueue=n,kf(r,n),eu(c,!0),c.tail===null&&c.tailMode!=="collapsed"&&c.tailMode!=="visible"&&!y.alternate&&!st)return Lt(r),null}else 2*Ut()-c.renderingStartTime>Uf&&a!==536870912&&(r.flags|=128,m=!0,eu(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(n=c.last,n!==null?n.sibling=y:r.child=y,c.last=y)}if(c.tail!==null){n=c.tail;e:{for(a=n;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return c.rendering=n,c.tail=n.sibling,c.renderingStartTime=Ut(),n.sibling=null,y=En.current,y=m?y&1|2:y&1,c.tailMode==="visible"||c.tailMode==="collapsed"||!a||st?Qc(r,y):(a=y,Ue(Rn,r),Ue(En,a),_n===null&&(_n=r)),st&&$i(r,c.treeForkCount),n}return Lt(r),null;case 22:case 23:return hs(r),rg(),c=r.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(a&536870912)!==0&&(r.flags&128)===0&&(Lt(r),r.subtreeFlags&6&&(r.flags|=8192)):Lt(r),a=r.updateQueue,a!==null&&kf(r,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==a&&(r.flags|=2048),n!==null&&Ge(Ho),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Xi(en),Lt(r),null;case 25:return null;case 30:return r.flags|=33554432,Lt(r),null}throw Error(i(156,r.tag))}function S_(n,r){switch(Gp(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Xi(en),pt(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return he(r),null;case 31:if(r.memoizedState!==null){if(hs(r),r.alternate===null)throw Error(i(340));Bo()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(hs(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Bo()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return ag(r),n=r.flags,n&65536?(r.flags=n&-65537|128,n=r.memoizedState,n!==null&&(n.rendering=null,n.tail=null),r.flags|=4,r):null;case 4:return pt(),null;case 10:return Xi(r.type),null;case 22:case 23:return hs(r),rg(),n!==null&&Ge(Ho),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Xi(en),null;case 25:return null;default:return null}}function N1(n,r){switch(Gp(r),r.tag){case 3:Xi(en),pt();break;case 26:case 27:case 5:he(r);break;case 4:pt();break;case 31:r.memoizedState!==null&&hs(r);break;case 13:hs(r);break;case 19:ag(r);break;case 10:Xi(r.type);break;case 22:case 23:hs(r),rg(),n!==null&&Ge(Ho);break;case 24:Xi(en)}}function tu(n,r){try{var a=r.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var m=c.next;a=m;do{if((a.tag&n)===n){c=void 0;var y=a.create,R=a.inst;c=y(),R.destroy=c}a=a.next}while(a!==m)}}catch(j){kt(r,r.return,j)}}function Ur(n,r,a){try{var c=r.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var y=m.next;c=y;do{if((c.tag&n)===n){var R=c.inst,j=R.destroy;if(j!==void 0){R.destroy=void 0,m=r;var U=a,J=j;try{J()}catch(re){kt(m,U,re)}}}c=c.next}while(c!==y)}}catch(re){kt(r,r.return,re)}}function O1(n){var r=n.updateQueue;if(r!==null){var a=n.stateNode;try{xS(r,a)}catch(c){kt(n,n.return,c)}}}function j1(n,r,a){a.props=Qo(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(c){kt(n,r,c)}}function di(n,r){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:var m=n.stateNode,y=Gi(n.memoizedProps,m);(m.ref===null||m.ref.name!==y)&&(m.ref=BT(y)),c=m.ref;break;case 7:if(n.stateNode===null){var R=new vs(n);g(n.child,!1,f3,R,void 0,void 0),n.stateNode=R}c=n.stateNode;break;default:c=n.stateNode}typeof a=="function"?n.refCleanup=a(c):a.current=c}}catch(j){kt(n,r,j)}}function Cn(n,r){var a=n.ref,c=n.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(m){kt(n,r,m)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){kt(n,r,m)}else a.current=null}function Mf(n,r){if((n.tag===5||n.tag===27||n.tag===6)&&n.alternate===null&&r!==null)for(var a=0;a<r.length;a++)GT(n.stateNode,r[a])}function D1(n){for(var r=n.return;r!==null&&(Lg(r)&&GT(n.stateNode,r.stateNode),!zg(r));)r=r.return}function nu(n){for(var r=n.return;r!==null&&(Lg(r)&&h3(n.stateNode,r.stateNode),!zg(r));)r=r.return}function zg(n){return n.tag===5||n.tag===3||n.tag===27}function Lg(n){return n&&n.tag===7&&n.stateNode!==null}function Bg(n){var r=n.type,a=n.memoizedProps,c=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(m){kt(n,n.return,m)}}function Ug(n,r,a){try{var c=n.stateNode;$_(c,n.type,a,r),c[Jn]=r}catch(m){kt(n,n.return,m)}}function _1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Yr(n.type)||n.tag===4}function Vg(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||_1(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Yr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Fg(n,r,a,c){var m=n.tag;if(m===5||m===6)m=n.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(m,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(m),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=li)),Mf(n,c),yt=!0;else if(m!==4&&(m===27&&(Mf(n,c),c=null,Yr(n.type)&&(a=n.stateNode,r=null)),n=n.child,n!==null))for(Fg(n,r,a,c),n=n.sibling;n!==null;)Fg(n,r,a,c),n=n.sibling}function Nf(n,r,a,c){var m=n.tag;if(m===5||m===6)m=n.stateNode,r?a.insertBefore(m,r):a.appendChild(m),Mf(n,c),yt=!0;else if(m!==4&&(m===27&&(Mf(n,c),c=null,Yr(n.type)&&(a=n.stateNode)),n=n.child,n!==null))for(Nf(n,r,a,c),n=n.sibling;n!==null;)Nf(n,r,a,c),n=n.sibling}function I1(n){var r=n.stateNode,a=n.memoizedProps;try{for(var c=n.type,m=r.attributes;m.length;)r.removeAttributeNode(m[0]);An(r,c,a),r[Sn]=n,r[Jn]=a}catch(y){kt(n,n.return,y)}}var Of=!1,ms=null;function P1(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(Of=!0)}var fi=null;function z1(){var n=fi;return fi=null,n}var ts=0;function yl(n,r,a,c,m){return ts=0,L1(n.child,r,a,c,m)}function L1(n,r,a,c,m){for(var y=!1;n!==null;){if(n.tag===5){var R=n.stateNode;if(c!==null){var j=Ey(R);c.push(j),j.view&&(y=!0)}else y||Ey(R).view&&(y=!0);Of=!0,zT(R,ts===0?r:r+"_"+ts,a),ts++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&m||L1(n.child,r,a,c,m)&&(y=!0));n=n.sibling}return y}function hi(n,r){for(;n!==null;)n.tag===5?LT(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&r||hi(n.child,r)),n=n.sibling}function jf(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(jf(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var r=n.memoizedProps;if(r.name==null||r.name==="auto")throw Error(i(544));var a=r.name;r=Ki(r.default,r.share),r!=="none"&&(yl(n,a,r,null,!1)||hi(n.child,!1))}n=n.sibling}}function qg(n,r){if(n.tag===30){var a=n.stateNode,c=n.memoizedProps,m=Gi(c,a),y=Ki(c.default,a.paired?c.share:c.enter);y!=="none"?yl(n,m,y,null,!1)?(jf(n),a.paired||r||El(n,c.onEnter)):hi(n.child,!1):jf(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)qg(n,r),n=n.sibling;else jf(n)}function Hg(n){if(ms!==null&&ms.size!==0){var r=ms;if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var a=n.memoizedProps,c=a.name;if(c!=null&&c!=="auto"){var m=r.get(c);if(m!==void 0){var y=Ki(a.default,a.share);if(y!=="none"&&(yl(n,c,y,null,!1)?(y=n.stateNode,m.paired=y,y.paired=m,El(n,a.onShare)):hi(n.child,!1)),r.delete(c),r.size===0)break}}}Hg(n)}n=n.sibling}}}function Gg(n){if(n.tag===30){var r=n.memoizedProps,a=Gi(r,n.stateNode),c=ms!==null?ms.get(a):void 0,m=Ki(r.default,c!==void 0?r.share:r.exit);m!=="none"&&(yl(n,a,m,null,!1)?c!==void 0?(m=n.stateNode,c.paired=m,m.paired=c,ms.delete(a),El(n,r.onShare)):El(n,r.onExit):hi(n.child,!1)),ms!==null&&Hg(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Gg(n),n=n.sibling;else ms!==null&&Hg(n)}function B1(n){for(n=n.child;n!==null;){if(n.tag===30){var r=n.memoizedProps,a=Gi(r,n.stateNode);r=Ki(r.default,r.update),n.flags&=-5,r!=="none"&&yl(n,a,r,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&B1(n);n=n.sibling}}function Kg(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var r=n.stateNode;r.paired!==null&&(r.paired=null,hi(n.child,!1))}Kg(n)}n=n.sibling}}function Df(n){if(n.tag===30)n.stateNode.paired=null,hi(n.child,!1),Kg(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Df(n),n=n.sibling;else Kg(n)}function U1(n){for(n=n.child;n!==null;)n.tag===30?hi(n.child,!1):(n.subtreeFlags&33554432)!==0&&U1(n),n=n.sibling}function Yg(n,r,a,c,m,y,R){for(var j=!1;r!==null;){if(r.tag===5){var U=r.stateNode;if(y!==null&&ts<y.length){var J=y[ts],re=Ey(U);(J.view||re.view)&&(j=!0);var de;if(de=(n.flags&4)===0)if(re.clip)de=!0;else{de=J.rect;var Z=re.rect;de=de.y!==Z.y||de.x!==Z.x||de.height!==Z.height||de.width!==Z.width}de&&(n.flags|=4),re.abs?re=!J.abs:(J=J.rect,re=re.rect,re=J.height!==re.height||J.width!==re.width),re&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&zT(U,ts===0?a:a+"_"+ts,m),j&&(n.flags&4)!==0||(fi===null&&(fi=[]),fi.push(U,ts===0?c:c+"_"+ts,r.memoizedProps)),ts++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&R?n.flags|=r.flags&32:Yg(n,r.child,a,c,m,y,R)&&(j=!0));r=r.sibling}return j}function V1(n,r){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,c=n.stateNode,m=Gi(a,c),y=Ki(a.default,a.update),R;R=n.memoizedState,n.memoizedState=null,c=n;var j=n.child;ts=0,m=Yg(c,j,m,m,y,R,!1),(n.flags&4)!==0&&m&&El(n,a.onUpdate)}else(n.subtreeFlags&33554432)!==0&&V1(n);n=n.sibling}}var yn=!1,Rt=!1,mi=!1,$g=!1,F1=typeof WeakSet=="function"?WeakSet:Set,vn=null,pi=!1,su=!1,_f=!1,Qg=!1;function T_(n,r,a){if(n=n.containerInfo,xy=Il,n=Kw(n),Ip(n)){if("selectionStart"in n)var c={start:n.selectionStart,end:n.selectionEnd};else e:{c=(c=n.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var y=m.anchorOffset,R=m.focusNode;m=m.focusOffset;try{c.nodeType,R.nodeType}catch{c=null;break e}var j=0,U=-1,J=-1,re=0,de=0,Z=n,se=null;t:for(;;){for(var Re;Z!==c||y!==0&&Z.nodeType!==3||(U=j+y),Z!==R||m!==0&&Z.nodeType!==3||(J=j+m),Z.nodeType===3&&(j+=Z.nodeValue.length),(Re=Z.firstChild)!==null;)se=Z,Z=Re;for(;;){if(Z===n)break t;if(se===c&&++re===y&&(U=j),se===R&&++de===m&&(J=j),(Re=Z.nextSibling)!==null)break;Z=se,se=Z.parentNode}Z=Re}c=U===-1||J===-1?null:{start:U,end:J}}else c=null}c=c||{start:0,end:0}}else c=null;for(wy={focusedElem:n,selectionRange:c},Il=!1,a=(a&335544064)===a,vn=r,r=a?9270:1024;vn!==null;){if(n=vn,a&&(c=n.deletions,c!==null))for(y=0;y<c.length;y++)a&&Gg(c[y]);if(n.alternate===null&&(n.flags&2)!==0)a&&P1(n),If(a);else{if(n.tag===22){if(c=n.alternate,n.memoizedState!==null){c!==null&&c.memoizedState===null&&a&&Gg(c),If(a);continue}else if(c!==null&&c.memoizedState!==null){a&&P1(n),If(a);continue}}c=n.child,(n.subtreeFlags&r)!==0&&c!==null?(c.return=n,vn=c):(a&&B1(n),If(a))}}ms=null}function If(n){for(;vn!==null;){var r=vn,a=n,c=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 15:break;case 1:if((m&1024)!==0&&c!==null){a=void 0,m=c.memoizedProps,c=c.memoizedState;var y=r.stateNode;try{var R=Qo(r.type,m);a=y.getSnapshotBeforeUpdate(R,c),y.__reactInternalSnapshotBeforeUpdate=a}catch(j){kt(r,r.return,j)}}break;case 3:if((m&1024)!==0){if(c=r.stateNode.containerInfo,a=c.nodeType,a===9)ky(c);else if(a===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":ky(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&c!==null&&(a=Gi(c.memoizedProps,c.stateNode),m=r.memoizedProps,m=Ki(m.default,m.update),m!=="none"&&yl(c,a,m,c.memoizedState=[],!0));break;default:if((m&1024)!==0)throw Error(i(163))}if(c=r.sibling,c!==null){c.return=r.return,vn=c;break}vn=r.return}}function q1(n,r,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:gi(n,a),c&4&&tu(5,a);break;case 1:if(gi(n,a),c&4)if(n=a.stateNode,r===null)try{n.componentDidMount()}catch(R){kt(a,a.return,R)}else{var m=Qo(a.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(m,r,n.__reactInternalSnapshotBeforeUpdate)}catch(R){kt(a,a.return,R)}}c&64&&O1(a),c&512&&di(a,a.return);break;case 3:if(gi(n,a),c&64&&(n=a.updateQueue,n!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{xS(n,r)}catch(R){kt(a,a.return,R)}}break;case 27:r===null&&c&4&&I1(a);case 26:case 5:gi(n,a),r===null&&c&4&&Bg(a),c&512&&di(a,a.return);break;case 12:gi(n,a);break;case 31:gi(n,a),c&4&&Y1(n,a);break;case 13:gi(n,a),c&4&&$1(n,a),c&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=I_.bind(null,a),g3(n,a))));break;case 22:if(c=a.memoizedState!==null||yn,!c){var y=r!==null&&r.memoizedState!==null||Rt;r=yn,m=Rt,yn=c,(Rt=y)&&!m?(c=2,(a.subtreeFlags&8772)!==0&&(c|=1),Ys(n,a,c)):gi(n,a),yn=r,Rt=m}break;case 30:gi(n,a),c&512&&di(a,a.return);break;case 7:c&512&&di(a,a.return);default:gi(n,a)}}function Xg(n,r){for(n=n.child;n!==null;)H1(n,r),n=n.sibling}function H1(n,r){switch(n.tag){case 5:case 26:try{var a=n.stateNode;if(r){var c=a.style;typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"}else{var m=n.stateNode,y=n.memoizedProps.style,R=y!=null&&y.hasOwnProperty("display")?y.display:null;m.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(U){kt(n,n.return,U)}Zg(n,r);break;case 6:try{n.stateNode.nodeValue=r?"":n.memoizedProps,yt=!0}catch(U){kt(n,n.return,U)}break;case 18:try{var j=n.stateNode;r?PT(j,!0):PT(n.stateNode,!1)}catch(U){kt(n,n.return,U)}break;case 22:case 23:n.memoizedState===null&&Xg(n,r);break;default:Xg(n,r)}}function Zg(n,r){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var a=n,c=r;switch(a.tag){case 4:H1(a,c);break e;case 22:a.memoizedState===null&&Zg(a,c);break e;default:Zg(a,c)}}n=n.sibling}}function G1(n){var r=n.alternate;r!==null&&(n.alternate=null,G1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Bd(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ft=null,ns=!1;function Gs(n,r,a){for(a=a.child;a!==null;)K1(n,r,a),a=a.sibling}function K1(n,r,a){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(be,a)}catch{}switch(a.tag){case 26:Rt||Cn(a,r),Gs(n,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!Rt&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||Cn(a,r),nu(a);var c=Ft,m=ns;Yr(a.type)&&(Ft=a.stateNode,ns=!1),Gs(n,r,a),XT(a.stateNode,a.type,a.memoizedProps),Ft=c,ns=m;break;case 5:Rt||Cn(a,r),nu(a);case 6:if(a.tag===6&&nu(a),c=Ft,m=ns,Ft=null,Gs(n,r,a),Ft=c,ns=m,Ft!==null)if(ns)try{(Ft.nodeType===9?Ft.body:Ft.nodeName==="HTML"?Ft.ownerDocument.body:Ft).removeChild(a.stateNode),yt=!0}catch(y){kt(a,r,y)}else try{Ft.removeChild(a.stateNode),yt=!0}catch(y){kt(a,r,y)}break;case 18:Ft!==null&&(ns?(n=Ft,IT(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),Pl(n)):IT(Ft,a.stateNode));break;case 4:c=Ft,m=ns,Ft=a.stateNode.containerInfo,ns=!0,Gs(n,r,a),Ft=c,ns=m;break;case 0:case 11:case 14:case 15:Ur(2,a,r),Rt||Ur(4,a,r),Gs(n,r,a);break;case 1:Rt||(Cn(a,r),c=a.stateNode,typeof c.componentWillUnmount=="function"&&j1(a,r,c)),Gs(n,r,a);break;case 21:Gs(n,r,a);break;case 22:Rt=(c=Rt)||a.memoizedState!==null,Gs(n,r,a),Rt=c;break;case 30:Cn(a,r),Gs(n,r,a);break;case 7:Rt||Cn(a,r),Gs(n,r,a);break;default:Gs(n,r,a)}}function Y1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Pl(n)}catch(a){kt(r,r.return,a)}}}function $1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Pl(n)}catch(a){kt(r,r.return,a)}}function R_(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new F1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new F1),r;default:throw Error(i(435,n.tag))}}function Pf(n,r){var a=R_(n);r.forEach(function(c){if(!a.has(c)){a.add(c);var m=P_.bind(null,n,c);c.then(m,m)}})}function Fn(n,r,a){var c=r.deletions;if(c!==null)for(var m=0;m<c.length;m++){var y=c[m],R=n,j=r,U=j;e:for(;U!==null;){switch(U.tag){case 27:if(Yr(U.type)){Ft=U.stateNode,ns=!1;break e}break;case 5:Ft=U.stateNode,ns=!1;break e;case 3:case 4:Ft=U.stateNode.containerInfo,ns=!0;break e}U=U.return}if(Ft===null)throw Error(i(160));K1(R,j,y),Ft=null,ns=!1,R=y.alternate,R!==null&&(R.return=null),y.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Q1(r,n,a),r=r.sibling}var Ks=null;function Q1(n,r,a){var c=n.alternate,m=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(m&4&&(c=n.updateQueue,c=c!==null?c.events:null,c!==null))for(var y=0;y<c.length;y++){var R=c[y];R.ref.impl=R.nextImpl}Fn(r,n,a),qn(n),m&4&&(Ur(3,n,n.return),tu(3,n),Ur(5,n,n.return));break;case 1:Fn(r,n,a),qn(n),m&512&&(Rt||c===null||Cn(c,c.return)),m&64&&yn&&(n=n.updateQueue,n!==null&&(r=n.callbacks,r!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:if(y=Ks,Fn(r,n,a),qn(n),m&512&&(Rt||c===null||Cn(c,c.return)),m&4)if(m=c!==null?c.memoizedState:null,a=n.memoizedState,c===null)if(a===null)if(n.stateNode===null)if(yn)n.stateNode=jT(n.type,n.memoizedProps,r.containerInfo,n);else{e:{r=n.type,a=n.memoizedProps,m=y.ownerDocument||y;t:switch(r){case"title":c=m.getElementsByTagName("title")[0],(!c||c[Mc]||c[Sn]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=m.createElement(r),m.head.insertBefore(c,m.querySelector("head > title"))),An(c,r,a),c[Sn]=n,pn(c),r=c;break e;case"link":if(y=nR("link","href",m).get(r+(a.href||""))){for(R=0;R<y.length;R++)if(c=y[R],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(R,1);break t}}c=m.createElement(r),An(c,r,a),m.head.appendChild(c);break;case"meta":if(y=nR("meta","content",m).get(r+(a.content||""))){for(R=0;R<y.length;R++)if(c=y[R],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(R,1);break t}}c=m.createElement(r),An(c,r,a),m.head.appendChild(c);break;default:throw Error(i(468,r))}c[Sn]=n,pn(c),r=c}n.stateNode=r}else yn||Iy(y,n.type,n.stateNode);else n.stateNode=tR(y,a,n.memoizedProps);else m!==a?(m===null?(r=c.stateNode,r===null||Rt||r.parentNode.removeChild(r)):m.count--,a===null?yn||Iy(y,n.type,n.stateNode):tR(y,a,n.memoizedProps)):a===null&&n.stateNode!==null&&Ug(n,n.memoizedProps,c.memoizedProps);break;case 27:Fn(r,n,a),qn(n),m&512&&(Rt||c===null||Cn(c,c.return)),c!==null&&m&4&&Ug(n,n.memoizedProps,c.memoizedProps);break;case 5:if(y=mi,mi=!1,Fn(r,n,a),mi=y,qn(n),m&512&&(Rt||c===null||Cn(c,c.return)),n.flags&32){r=n.stateNode;try{Ja(r,""),yt=!0}catch(re){kt(n,n.return,re)}}m&4&&n.stateNode!=null&&(r=n.memoizedProps,Ug(n,r,c!==null?c.memoizedProps:r)),m&1024&&($g=!0);break;case 6:if(Fn(r,n,a),qn(n),m&4){if(n.stateNode===null)throw Error(i(162));r=n.memoizedProps,a=n.stateNode;try{a.nodeValue=r,yt=!0}catch(re){kt(n,n.return,re)}}break;case 3:if(yt=!1,Zf=null,y=Ks,Ks=fu(r.containerInfo),Fn(r,n,a),Ks=y,qn(n),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Pl(r.containerInfo)}catch(re){kt(n,n.return,re)}$g&&($g=!1,X1(n)),yt=!1;break;case 4:m=mi,mi=yn,c=gw(),y=Ks,Ks=fu(n.stateNode.containerInfo),Fn(r,n,a),qn(n),Ks=y,yt&&su&&(_f=!0),yt=c,mi=m;break;case 12:Fn(r,n,a),qn(n);break;case 31:Fn(r,n,a),qn(n),m&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Pf(n,r)));break;case 13:Fn(r,n,a),qn(n),n.child.flags&8192&&n.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Bf=Ut()),m&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Pf(n,r)));break;case 22:y=n.memoizedState!==null,R=c!==null&&c.memoizedState!==null;var j=yn,U=Rt,J=mi;yn=j||y,mi=J||y,Rt=U||R,Fn(r,n,a),Rt=U,mi=J,yn=j,qn(n),m&8192&&(r=n.stateNode,r._visibility=y?r._visibility&-2:r._visibility|1,!y||c===null||R||yn||Rt||(r=R||Rt,a=yn,c=Rt,yn=y||yn,Rt=r,Vr(n,2),yn=a,Rt=c),!y&&mi||Xg(n,y)),m&4&&(r=n.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Pf(n,a))));break;case 19:Fn(r,n,a),qn(n),m&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Pf(n,r)));break;case 30:m&512&&(Rt||c===null||Cn(c,c.return)),m=gw(),y=su,R=(a&335544064)===a,j=n.memoizedProps,su=R&&Ki(j.default,j.update)!=="none",Fn(r,n,a),qn(n),R&&c!==null&&yt&&(n.flags|=4),su=y,yt=m;break;case 21:break;case 7:m&512&&(Rt||c===null||Cn(c,c.return)),c&&c.stateNode!==null&&(c.stateNode._fragmentFiber=n);default:Fn(r,n,a),qn(n)}}function qn(n){var r=n.flags;if(r&2){try{for(var a,c=n.return;c!==null;){if(_1(c)){a=c;break}c=c.return}c=null;for(var m=n.return;m!==null;){if(Lg(m)){var y=m.stateNode;c===null?c=[y]:c.push(y)}if(zg(m))break;m=m.return}var R=c;if(a==null)throw Error(i(160));switch(a.tag){case 27:var j=a.stateNode,U=Vg(n);Nf(n,U,j,R);break;case 5:var J=a.stateNode;a.flags&32&&(Ja(J,""),a.flags&=-33);var re=Vg(n);Nf(n,re,J,R);break;case 3:case 4:var de=a.stateNode.containerInfo,Z=Vg(n);Fg(n,Z,de,R);break;default:throw Error(i(161))}}catch(se){kt(n,n.return,se)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function X1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;X1(r),r.tag===5&&r.flags&1024&&(r=r.stateNode,Il=!0,r.reset(),Il=!1),n=n.sibling}}function vl(n,r){if(r.subtreeFlags&9270)for(r=r.child;r!==null;)Z1(r,n),r=r.sibling;else V1(r)}function Z1(n,r){var a=n.alternate;if(a===null)qg(n,!1);else switch(n.tag){case 3:if(Qg=pi=!1,z1(),vl(r,n),!pi&&!_f){if(n=fi,n!==null)for(var c=0;c<n.length;c+=3){a=n[c];var m=n[c+1];LT(a,n[c+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+m+")"})}n=r.containerInfo,n=n.nodeType===9?n.documentElement:n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName===""&&(n.style.viewTransitionName="none",n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),n.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Qg=!0}fi=null;break;case 5:vl(r,n);break;case 4:c=pi,pi=!1,vl(r,n),pi&&(_f=!0),pi=c;break;case 22:n.memoizedState===null&&(a.memoizedState!==null?qg(n,!1):vl(r,n));break;case 30:c=pi,m=z1(),pi=!1,vl(r,n),pi&&(n.flags|=4);var y=n.memoizedProps,R=n.stateNode;r=Gi(y,R),R=Gi(a.memoizedProps,R);var j=Ki(y.default,y.update);j==="none"?r=!1:(y=a.memoizedState,a.memoizedState=null,a=n.child,ts=0,r=Yg(n,a,r,R,j,y,!0),ts!==(y===null?0:y.length)&&(n.flags|=32)),(n.flags&4)!==0&&r?(El(n,n.memoizedProps.onUpdate),fi=m):m!==null&&(m.push.apply(m,fi),fi=m),pi=(n.flags&32)!==0?!0:c;break;default:vl(r,n)}}function gi(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)q1(n,r.alternate,r),r=r.sibling}function Vr(n,r){for(n=n.child;n!==null;){var a=n,c=r;switch(a.tag){case 0:case 11:case 14:case 15:Ur(4,a,a.return),Vr(a,c);break;case 1:Cn(a,a.return);var m=a.stateNode;typeof m.componentWillUnmount=="function"&&j1(a,a.return,m),Vr(a,c);break;case 27:(c&2)!==0&&XT(a.stateNode,a.type,a.memoizedProps);case 5:Cn(a,a.return),a.tag!==5&&a.tag!==27||nu(a),Vr(a,c);break;case 6:nu(a);break;case 26:Cn(a,a.return),m=a.stateNode,a.memoizedState!==null||m===null||Rt||m.parentNode.removeChild(m),Vr(a,c);break;case 22:a.memoizedState===null&&Vr(a,c);break;case 30:Cn(a,a.return),Vr(a,c);break;case 7:Cn(a,a.return);default:Vr(a,c)}n=n.sibling}}function Ys(n,r,a){for(a=(r.subtreeFlags&8772)!==0?a:a&-2,r=r.child;r!==null;){var c=r.alternate,m=n,y=r,R=y.flags,j=(a&1)!==0;switch(y.tag){case 0:case 11:case 15:Ys(m,y,a),tu(4,y);break;case 1:if(Ys(m,y,a),c=y,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(re){kt(c,c.return,re)}if(c=y,m=c.updateQueue,m!==null){var U=c.stateNode;try{var J=m.shared.hiddenCallbacks;if(J!==null)for(m.shared.hiddenCallbacks=null,m=0;m<J.length;m++)bS(J[m],U)}catch(re){kt(c,c.return,re)}}j&&R&64&&O1(y),di(y,y.return);break;case 27:(a&2)!==0&&I1(y);case 5:y.tag!==5&&y.tag!==27||D1(y),Ys(m,y,a),j&&c===null&&R&4&&Bg(y),di(y,y.return);break;case 6:D1(y);break;case 26:U=y.stateNode,y.memoizedState!==null||U===null||yn||Iy(fu(U.ownerDocument),y.type,U),Ys(m,y,a),j&&c===null&&R&4&&Bg(y),di(y,y.return);break;case 12:Ys(m,y,a);break;case 31:Ys(m,y,a),j&&R&4&&Y1(m,y);break;case 13:Ys(m,y,a),j&&R&4&&$1(m,y);break;case 22:y.memoizedState===null&&Ys(m,y,a),di(y,y.return);break;case 30:Ys(m,y,a),di(y,y.return);break;case 7:di(y,y.return);default:Ys(m,y,a)}r=r.sibling}}function Wg(n,r){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&Fc(a))}function Jg(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Fc(n))}function js(n,r,a,c){var m=(a&335544064)===a;if(r.subtreeFlags&(m?10262:10256))for(r=r.child;r!==null;)W1(n,r,a,c),r=r.sibling;else m&&U1(r)}function W1(n,r,a,c){var m=(a&335544064)===a;m&&r.alternate===null&&r.return!==null&&r.return.alternate!==null&&Df(r);var y=r.flags;switch(r.tag){case 0:case 11:case 15:js(n,r,a,c),y&2048&&tu(9,r);break;case 1:js(n,r,a,c);break;case 3:js(n,r,a,c),m&&Qg&&(n=n.containerInfo,n=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,n.style.viewTransitionName==="root"&&(n.style.viewTransitionName=""),n=n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName==="none"&&(n.style.viewTransitionName="")),y&2048&&(y=null,r.alternate!==null&&(y=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==y&&(r.refCount++,y!=null&&Fc(y)));break;case 12:if(y&2048){js(n,r,a,c),y=r.stateNode;try{var R=r.memoizedProps,j=R.id,U=R.onPostCommit;typeof U=="function"&&U(j,r.alternate===null?"mount":"update",y.passiveEffectDuration,-0)}catch(J){kt(r,r.return,J)}}else js(n,r,a,c);break;case 31:js(n,r,a,c);break;case 13:js(n,r,a,c);break;case 23:break;case 22:R=r.stateNode,j=r.alternate,r.memoizedState!==null?(m&&j!==null&&j.memoizedState===null&&Df(j),R._visibility&2?js(n,r,a,c):iu(n,r)):(m&&j!==null&&j.memoizedState!==null&&Df(r),R._visibility&2?js(n,r,a,c):(R._visibility|=2,bl(n,r,a,c,(r.subtreeFlags&10256)!==0||!1))),y&2048&&Wg(j,r);break;case 24:js(n,r,a,c),y&2048&&Jg(r.alternate,r);break;case 30:m&&(y=r.alternate,y!==null&&(hi(y.child,!0),hi(r.child,!0))),js(n,r,a,c);break;default:js(n,r,a,c)}}function bl(n,r,a,c,m){for(m=m&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=n,R=r,j=a,U=c,J=R.flags;switch(R.tag){case 0:case 11:case 15:bl(y,R,j,U,m),tu(8,R);break;case 23:break;case 22:var re=R.stateNode;R.memoizedState!==null?re._visibility&2?bl(y,R,j,U,m):iu(y,R):(re._visibility|=2,bl(y,R,j,U,m)),m&&J&2048&&Wg(R.alternate,R);break;case 24:bl(y,R,j,U,m),m&&J&2048&&Jg(R.alternate,R);break;default:bl(y,R,j,U,m)}r=r.sibling}}function iu(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=n,c=r,m=c.flags;switch(c.tag){case 22:iu(a,c),m&2048&&Wg(c.alternate,c);break;case 24:iu(a,c),m&2048&&Jg(c.alternate,c);break;default:iu(a,c)}r=r.sibling}}var Xo=8192;function Zo(n,r,a){if(n.subtreeFlags&Xo)for(n=n.child;n!==null;)J1(n,r,a),n=n.sibling}function J1(n,r,a){switch(n.tag){case 26:Zo(n,r,a),n.flags&Xo&&(n.memoizedState!==null?N3(a,Ks,n.memoizedState,n.memoizedProps):(n=n.stateNode,(r&335544128)===r&&oR(a,n)));break;case 5:Zo(n,r,a),n.flags&Xo&&(n=n.stateNode,(r&335544128)===r&&oR(a,n));break;case 3:case 4:var c=Ks;Ks=fu(n.stateNode.containerInfo),Zo(n,r,a),Ks=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=Xo,Xo=16777216,Zo(n,r,a),Xo=c):Zo(n,r,a));break;case 30:if((n.flags&Xo)!==0&&(c=n.memoizedProps.name,c!=null&&c!=="auto")){var m=n.stateNode;m.paired=null,ms===null&&(ms=new Map),ms.set(c,m)}Zo(n,r,a);break;default:Zo(n,r,a)}}function eT(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function ru(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];vn=c,nT(c,n)}eT(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)tT(n),n=n.sibling}function tT(n){switch(n.tag){case 0:case 11:case 15:ru(n),n.flags&2048&&Ur(9,n,n.return);break;case 3:ru(n);break;case 12:ru(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,zf(n)):ru(n);break;default:ru(n)}}function zf(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];vn=c,nT(c,n)}eT(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Ur(8,r,r.return),zf(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,zf(r));break;default:zf(r)}n=n.sibling}}function nT(n,r){for(;vn!==null;){var a=vn;switch(a.tag){case 0:case 11:case 15:Ur(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Fc(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,vn=c;else e:for(a=n;vn!==null;){c=vn;var m=c.sibling,y=c.return;if(G1(c),c===a){vn=null;break e}if(m!==null){m.return=y,vn=m;break e}vn=y}}}var E_={getCacheForType:function(n){var r=Tn(en),a=r.data.get(n);return a===void 0&&(a=n(),r.data.set(n,a)),a},cacheSignal:function(){return Tn(en).controller.signal}},C_=typeof WeakMap=="function"?WeakMap:Map,St=0,Pt=null,at=null,ut=0,At=0,ps=null,Fr=!1,xl=!1,ey=!1,tr=0,Xt=0,qr=0,Wo=0,Lf=0,gs=0,wl=0,ou=null,ss=null,ty=!1,Bf=0,sT=0,Uf=1/0,Vf=null,Hr=null,Ht=0,$s=null,Jo=null,yi=0,ny=0,sy=null,iT=null,Sl=null,Tl=null,Rl=null,au=0,Ff=null;function ys(){return(St&2)!==0&&ut!==0?ut&-ut:ce.T!==null?hy():aw()}function rT(){if(gs===0)if((ut&536870912)===0||st){var n=Vi;Vi<<=1,(Vi&3932160)===0&&(Vi=262144),gs=n}else gs=536870912;return n=Rn.current,n!==null&&(n.flags|=32),gs}function El(n,r){if(r!=null){var a=n.stateNode,c=a.ref;c===null&&(c=a.ref=BT(Gi(n.memoizedProps,a))),Tl===null&&(Tl=[]),Tl.push(r.bind(null,c))}}function is(n,r,a){(n===Pt&&(At===2||At===9)||n.cancelPendingCommit!==null)&&(Cl(n,0),Gr(n,ut,gs,!1)),Cr(n,a),((St&2)===0||n!==Pt)&&(n===Pt&&((St&2)===0&&(Wo|=a),Xt===4&&Gr(n,ut,gs,!1)),vi(n))}function oT(n,r,a){if((St&6)!==0)throw Error(i(327));var c=!a&&(r&127)===0&&(r&n.expiredLanes)===0||ai(n,r),m=c?M_(n,r):ry(n,r,!0),y=c;do{if(m===0){xl&&!c&&Gr(n,r,0,!1);break}else{if(a=n.current.alternate,y&&!A_(a)){m=ry(n,r,!1),y=!1;continue}if(m===2){if(y=r,n.errorRecoveryDisabledLanes&y)var R=0;else R=n.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){r=R;e:{var j=n;m=ou;var U=j.current.memoizedState.isDehydrated;if(U&&(Cl(j,R).flags|=256),R=ry(j,R,!1),R!==2&&R!==6){if(ey&&!U){j.errorRecoveryDisabledLanes|=y,Wo|=y,m=4;break e}y=ss,ss=m,y!==null&&(ss===null?ss=y:ss.push.apply(ss,y))}m=R}if(y=!1,m!==2)continue}}if(m===1){Cl(n,0),Gr(n,r,0,!0);break}e:{switch(c=n,y=m,y){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r&&(r&62914560)!==r)break;case 6:Gr(c,r,gs,!Fr);break e;case 2:ss=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(m=Bf+300-Ut(),10<m)){if(Gr(c,r,gs,!Fr),oi(c,0,!0)!==0)break e;yi=r,c.timeoutHandle=Ry(aT.bind(null,c,a,ss,Vf,ty,r,gs,Wo,wl,Fr,y,"Throttled",-0,0),m);break e}aT(c,a,ss,Vf,ty,r,gs,Wo,wl,Fr,y,null,-0,0)}}break}while(!0);vi(n)}function aT(n,r,a,c,m,y,R,j,U,J,re,de,Z,se){n.timeoutHandle=-1;var Re=r.subtreeFlags,_e=(y&335544064)===y;if(de=null,(_e||Re&8192||(Re&16785408)===16785408)&&(de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:li},ms=null,J1(r,y,de),_e&&(Re=de,_e=n.containerInfo,_e=(_e.nodeType===9?_e:_e.ownerDocument).__reactViewTransition,_e!=null&&(Re.count++,Re.waitingForViewTransition=!0,Re=pu.bind(Re),_e.finished.then(Re,Re))),Re=(y&62914560)===y?Bf-Ut():(y&4194048)===y?sT-Ut():0,Re=O3(de,Re),Re!==null)){yi=y,n.cancelPendingCommit=Re(pT.bind(null,n,r,y,a,c,m,R,j,U,J,re,de,null,Z,se)),Gr(n,y,R,!J);return}pT(n,r,y,a,c,m,R,j,U,J,re,de)}function A_(n){for(var r=n;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var m=a[c],y=m.getSnapshot;m=m.value;try{if(!fs(y(),m))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Gr(n,r,a,c){r=Ka(n,r),r&=~Lf,r&=~Wo,n.suspendedLanes|=r,n.pingedLanes&=~r,c&&(n.warmLanes|=r),c=n.expirationTimes;for(var m=r;0<m;){var y=31-gt(m),R=1<<y;c[y]=-1,m&=~R}a!==0&&kc(n,a,r)}function qf(){return(St&6)===0?(lu(0),!1):!0}function iy(){if(at!==null){if(At===0)var n=at.return;else n=at,Qi=Uo=null,fg(n),fl=null,Gc=0,n=at;for(;n!==null;)N1(n.alternate,n),n=n.return;at=null}}function Cl(n,r){var a=n.timeoutHandle;return a!==-1&&(n.timeoutHandle=-1,Z_(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),yi=0,iy(),Pt=n,at=a=Yi(n.current,null),ut=r,At=0,ps=null,Fr=!1,xl=ai(n,r),ey=!1,wl=gs=Lf=Wo=qr=Xt=0,ss=ou=null,ty=!1,tr=Ka(n,r),Xd(),a}function lT(n,r){Je=null,ce.H=Sf,r===dl||r===lf?(r=pS(),At=3):r===Jp?(r=pS(),At=4):At=r===Ag?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ps=r,at===null&&(Xt=1,Tf(n,ks(r,n.current)))}function cT(){var n=Rn.current;return n===null?!0:(ut&4194048)===ut?_n===null:(ut&62914560)===ut||(ut&536870912)!==0?n===_n:!1}function uT(){var n=ce.H;return ce.H=Sf,n===null?Sf:n}function dT(){var n=ce.A;return ce.A=E_,n}function Hf(){Xt=4,Fr||(ut&4194048)!==ut&&Rn.current!==null||(xl=!0),(qr&134217727)===0&&(Wo&134217727)===0||Pt===null||Gr(Pt,ut,gs,!1)}function ry(n,r,a){var c=St;St|=2;var m=uT(),y=dT();(Pt!==n||ut!==r)&&(Vf=null,Cl(n,r)),r=!1;var R=Xt;e:do try{if(At!==0&&at!==null){var j=at,U=ps;switch(At){case 8:iy(),R=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(r=!0);var J=At;if(At=0,ps=null,Al(n,j,U,J),a&&xl){R=0;break e}break;default:J=At,At=0,ps=null,Al(n,j,U,J)}}k_(),R=Xt;break}catch(re){lT(n,re)}while(!0);return r&&n.shellSuspendCounter++,Qi=Uo=null,St=c,ce.H=m,ce.A=y,at===null&&(Pt=null,ut=0,Xd()),R}function k_(){for(;at!==null;)fT(at)}function M_(n,r){var a=St;St|=2;var c=uT(),m=dT();Pt!==n||ut!==r?(Vf=null,Uf=Ut()+500,Cl(n,r)):xl=ai(n,r);e:do try{if(At!==0&&at!==null){r=at;var y=ps;t:switch(At){case 1:At=0,ps=null,Al(n,r,y,1);break;case 2:case 9:if(hS(y)){At=0,ps=null,hT(r);break}r=function(){At!==2&&At!==9||Pt!==n||(At=7),vi(n)},y.then(r,r);break e;case 3:At=7;break e;case 4:At=5;break e;case 7:hS(y)?(At=0,ps=null,hT(r)):(At=0,ps=null,Al(n,r,y,7));break;case 5:var R=null;switch(at.tag){case 26:R=at.memoizedState;case 5:case 27:var j=at;if(R?iR(R):j.stateNode.complete){At=0,ps=null;var U=j.sibling;if(U!==null)at=U;else{var J=j.return;J!==null?(at=J,Gf(J)):at=null}break t}}At=0,ps=null,Al(n,r,y,5);break;case 6:At=0,ps=null,Al(n,r,y,6);break;case 8:iy(),Xt=6;break e;default:throw Error(i(462))}}N_();break}catch(re){lT(n,re)}while(!0);return Qi=Uo=null,ce.H=c,ce.A=m,St=a,at!==null?0:(Pt=null,ut=0,Xd(),Xt)}function N_(){for(;at!==null&&!ii();)fT(at)}function fT(n){var r=k1(n.alternate,n,tr);n.memoizedProps=n.pendingProps,r===null?Gf(n):at=r}function hT(n){var r=n,a=r.alternate;switch(r.tag){case 15:case 0:r=w1(a,r,r.pendingProps,r.type,void 0,ut);break;case 11:r=w1(a,r,r.pendingProps,r.type.render,r.ref,ut);break;case 5:fg(r);var c=r;c===gn&&(st?(nf(c),c.tag===5&&c.stateNode!=null&&(zt=c.stateNode)):(nf(c),st=!0));default:N1(a,r),r=at=nS(r,tr),r=k1(a,r,tr)}n.memoizedProps=n.pendingProps,r===null?Gf(n):at=r}function Al(n,r,a,c){Qi=Uo=null,fg(r),fl=null,Gc=0;var m=r.return;try{if(y_(n,m,r,a,ut)){Xt=1,Tf(n,ks(a,n.current)),at=null;return}}catch(y){if(m!==null)throw at=m,y;Xt=1,Tf(n,ks(a,n.current)),at=null;return}r.flags&32768?(st||c===1?n=!0:xl||(ut&536870912)!==0?n=!1:(Fr=n=!0,(c===2||c===9||c===3||c===6)&&(c=Rn.current,c!==null&&c.tag===13&&(c.flags|=16384))),mT(r,n)):Gf(r)}function Gf(n){var r=n;do{if((r.flags&32768)!==0){mT(r,Fr);return}n=r.return;var a=w_(r.alternate,r,tr);if(a!==null){at=a;return}if(r=r.sibling,r!==null){at=r;return}at=r=n}while(r!==null);Xt===0&&(Xt=5)}function mT(n,r){do{var a=S_(n.alternate,n);if(a!==null){a.flags&=32767,at=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(n=n.sibling,n!==null)){at=n;return}at=n=a}while(n!==null);Xt=6,at=null}function pT(n,r,a,c,m,y,R,j,U,J,re,de){n.cancelPendingCommit=null;do Kf();while(Ht!==0);if((St&6)!==0)throw Error(i(327));if(r!==null){if(r===n.current)throw Error(i(177));n===Pt&&(at=Pt=null,ut=0),Jo=r,$s=n,yi=a,sy=m,iT=c,O_(n,r,a,R,j,U,de)}}function O_(n,r,a,c,m,y,R){var j=r.lanes|r.childLanes;if(ny=j,j|=Up,Id(n,a,j,c,m,y),Tl=null,(a&335544064)===a?(Rl=r_(n),c=10262):(Rl=null,c=10256),(r.subtreeFlags&c)!==0||(r.flags&c)!==0?(n.callbackNode=null,n.callbackPriority=0,z_(Ui,function(){return cy(),null})):(n.callbackNode=null,n.callbackPriority=0),Of=!1,c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=ce.T,ce.T=null,m=me.p,me.p=2,y=St,St|=4;try{T_(n,r,a)}finally{St=y,me.p=m,ce.T=c}}Ht=1,Of?Sl=s3(R,n.containerInfo,Rl,oy,ay,D_,ly,cy,j_):(oy(),ay(),ly())}function j_(n){if(Ht!==0){var r=$s.onRecoverableError;r(n,{componentStack:null})}}function D_(){Ht===3&&(Ht=0,Z1(Jo,$s),Ht=4)}function oy(){if(Ht===1){Ht=0;var n=$s,r=Jo,a=yi,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=ce.T,ce.T=null;var m=me.p;me.p=2;var y=St;St|=4;try{su=_f=!1,Q1(r,n,a),a=wy;var R=Kw(n.containerInfo),j=a.focusedElem,U=a.selectionRange;if(R!==j&&j&&j.ownerDocument&&Gw(j.ownerDocument.documentElement,j)){if(U!==null&&Ip(j)){var J=U.start,re=U.end;if(re===void 0&&(re=J),"selectionStart"in j)j.selectionStart=J,j.selectionEnd=Math.min(re,j.value.length);else{var de=j.ownerDocument||document,Z=de&&de.defaultView||window;if(Z.getSelection){var se=Z.getSelection(),Re=j.textContent.length,_e=Math.min(U.start,Re),et=U.end===void 0?_e:Math.min(U.end,Re);!se.extend&&_e>et&&(R=et,et=_e,_e=R);var W=Hw(j,_e),Y=Hw(j,et);if(W&&Y&&(se.rangeCount!==1||se.anchorNode!==W.node||se.anchorOffset!==W.offset||se.focusNode!==Y.node||se.focusOffset!==Y.offset)){var te=de.createRange();te.setStart(W.node,W.offset),se.removeAllRanges(),_e>et?(se.addRange(te),se.extend(Y.node,Y.offset)):(te.setEnd(Y.node,Y.offset),se.addRange(te))}}}}for(de=[],se=j;se=se.parentNode;)se.nodeType===1&&de.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<de.length;j++){var ue=de[j];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Il=!!xy,wy=xy=null}finally{St=y,me.p=m,ce.T=c}}n.current=r,Ht=2}}function ay(){if(Ht===2){Ht=0;var n=$s,r=Jo,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=ce.T,ce.T=null;var c=me.p;me.p=2;var m=St;St|=4;try{q1(n,r.alternate,r)}finally{St=m,me.p=c,ce.T=a}}Ht=3}}function ly(){if(Ht===4||Ht===3){Ht=0;var n=Sl;Sl=null,Li();var r=$s,a=Jo,c=yi,m=iT,y=(c&335544064)===c?10262:10256;if((a.subtreeFlags&y)!==0||(a.flags&y)!==0?Ht=5:(Ht=0,Jo=$s=null,gT(r,r.pendingLanes)),y=r.pendingLanes,y===0&&(Hr=null),yp(c),a=a.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(be,a,void 0,(a.current.flags&128)===128)}catch{}if(m!==null){a=ce.T,y=me.p,me.p=2,ce.T=null;try{for(var R=r.onRecoverableError,j=0;j<m.length;j++){var U=m[j];R(U.value,{componentStack:U.stack})}}finally{ce.T=a,me.p=y}}if(m=Tl,R=Rl,Rl=null,m!==null&&(Tl=null,R===null&&(R=[]),n!==null))for(U=0;U<m.length;U++)a=(0,m[U])(R),a!==void 0&&n.finished.finally(a);(yi&3)!==0&&Kf(),vi(r),y=r.pendingLanes,(c&261930)!==0&&(y&42)!==0?r===Ff?au++:(au=0,Ff=r):(au=0,Ff=null),lu(0)}}function gT(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Fc(r)))}function Kf(){return Sl!==null&&(Sl.skipTransition(),Sl=null),oy(),ay(),ly(),cy()}function cy(){if(Ht!==5)return!1;var n=$s,r=ny;ny=0;var a=yp(yi),c=ce.T,m=me.p;try{me.p=32>a?32:a,ce.T=null,a=sy,sy=null;var y=$s,R=yi;if(Ht=0,Jo=$s=null,yi=0,(St&6)!==0)throw Error(i(331));var j=St;if(St|=4,tT(y.current),W1(y,y.current,R,a),St=j,lu(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(be,y)}catch{}return!0}finally{me.p=m,ce.T=c,gT(n,r)}}function yT(n,r,a){r=ks(a,r),r=Cg(n.stateNode,r,2),n=Pr(n,r,2),n!==null&&(Cr(n,2),vi(n))}function kt(n,r,a){if(n.tag===3)yT(n,n,a);else for(;r!==null;){if(r.tag===3){yT(r,n,a);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Hr===null||!Hr.has(c))){n=ks(a,n),a=h1(2),c=Pr(r,a,2),c!==null&&(m1(a,c,r,n),Cr(c,2),vi(c));break}}r=r.return}}function uy(n,r,a){var c=n.pingCache;if(c===null){c=n.pingCache=new C_;var m=new Set;c.set(r,m)}else m=c.get(r),m===void 0&&(m=new Set,c.set(r,m));m.has(a)||(ey=!0,m.add(a),n=__.bind(null,n,r,a),r.then(n,n))}function __(n,r,a){var c=n.pingCache;c!==null&&c.delete(r),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,Pt===n&&(ut&a)===a&&((Xt===4||Xt===3&&(ut&62914560)===ut&&300>Ut()-Bf)&&(St&2)===0?Cl(n,0):Lf|=a,wl===ut&&(wl=0)),vi(n)}function vT(n,r){r===0&&(r=Ac()),n=zo(n,r),n!==null&&(Cr(n,r),vi(n))}function I_(n){var r=n.memoizedState,a=0;r!==null&&(a=r.retryLane),vT(n,a)}function P_(n,r){var a=0;switch(n.tag){case 31:case 13:var c=n.stateNode,m=n.memoizedState;m!==null&&(a=m.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(r),vT(n,a)}function z_(n,r){return Rs(n,r)}var kl=null,Ml=null,dy=!1,Yf=!1,fy=!1,Kr=0;function vi(n){n!==Ml&&n.next===null&&(Ml===null?kl=Ml=n:Ml=Ml.next=n),Yf=!0,dy||(dy=!0,B_())}function lu(n,r){if(!fy&&Yf){fy=!0;do for(var a=!1,c=kl;c!==null;){if(n!==0){var m=c.pendingLanes;if(m===0)var y=0;else{var R=c.suspendedLanes,j=c.pingedLanes;y=(1<<31-gt(42|n)+1)-1,y&=m&~(R&~j),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(a=!0,ST(c,y))}else y=ut,y=oi(c,c===Pt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||ai(c,y)||(a=!0,ST(c,y));c=c.next}while(a);fy=!1}}function L_(){bT()}function bT(){Yf=dy=!1;var n=0;Kr!==0&&X_()&&(n=Kr);for(var r=Ut(),a=null,c=kl;c!==null;){var m=c.next,y=xT(c,r);y===0?(c.next=null,a===null?kl=m:a.next=m,m===null&&(Ml=a)):(a=c,(n!==0||(y&3)!==0)&&(Yf=!0)),c=m}Ht!==0&&Ht!==5||lu(n),Kr!==0&&(Kr=0)}function xT(n,r){for(var a=n.suspendedLanes,c=n.pingedLanes,m=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var R=31-gt(y),j=1<<R,U=m[R];U===-1?((j&a)===0||(j&c)!==0)&&(m[R]=_d(j,r)):U<=r&&(n.expiredLanes|=j),y&=~j}if(r=Pt,a=ut,a=oi(n,n===r?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,a===0||n===r&&(At===2||At===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&cs(c),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||ai(n,a)){if(r=a&-a,r===n.callbackPriority)return r;switch(c!==null&&cs(c),yp(a)){case 2:case 8:a=ri;break;case 32:a=Ui;break;case 268435456:a=jo;break;default:a=Ui}return c=wT.bind(null,n),a=Rs(a,c),n.callbackPriority=r,n.callbackNode=a,r}return c!==null&&c!==null&&cs(c),n.callbackPriority=2,n.callbackNode=null,2}function wT(n,r){if(Ht!==0&&Ht!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(Kf()&&n.callbackNode!==a)return null;var c=ut;return c=oi(n,n===Pt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(oT(n,c,r),xT(n,Ut()),n.callbackNode!=null&&n.callbackNode===a?wT.bind(null,n):null)}function ST(n,r){if(Kf())return null;oT(n,r,!0)}function B_(){W_(function(){(St&6)!==0?Rs(Bi,L_):bT()})}function hy(){if(Kr===0){var n=qo;n===0&&(n=qs,qs<<=1,(qs&261888)===0&&(qs=256)),Kr=n}return Kr}function TT(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Fd(n)}function U_(n,r,a,c,m){if(r==="submit"&&a&&a.stateNode===m){var y=TT((m[Jn]||null).action),R=c.submitter;R&&(r=(r=R[Jn]||null)?TT(r.formAction):R.getAttribute("formAction"),r!==null&&(y=r,R=null));var j=new Kd("action","action",null,c,m);n.push({event:j,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Kr!==0){var U=new FormData(m,R);wg(a,{pending:!0,data:U,method:m.method,action:y},null,U)}}else typeof y=="function"&&(j.preventDefault(),U=new FormData(m,R),wg(a,{pending:!0,data:U,method:m.method,action:y},y,U))},currentTarget:m}]})}}for(var my=0;my<Bp.length;my++){var py=Bp[my],V_=py.toLowerCase(),F_=py[0].toUpperCase()+py.slice(1);Hs(V_,"on"+F_)}Hs(Qw,"onAnimationEnd"),Hs(Xw,"onAnimationIteration"),Hs(Zw,"onAnimationStart"),Hs("dblclick","onDoubleClick"),Hs("focusin","onFocus"),Hs("focusout","onBlur"),Hs(ZD,"onTransitionRun"),Hs(WD,"onTransitionStart"),Hs(JD,"onTransitionCancel"),Hs(Ww,"onTransitionEnd"),Za("onMouseEnter",["mouseout","mouseover"]),Za("onMouseLeave",["mouseout","mouseover"]),Za("onPointerEnter",["pointerout","pointerover"]),Za("onPointerLeave",["pointerout","pointerover"]),_o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_o("onBeforeInput",["compositionend","keypress","textInput","paste"]),_o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cu="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(" "),q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cu));function RT(n,r){r=(r&4)!==0;for(var a=0;a<n.length;a++){var c=n[a],m=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var R=c.length-1;0<=R;R--){var j=c[R],U=j.instance,J=j.currentTarget;if(j=j.listener,U!==y&&m.isPropagationStopped())break e;y=j,m.currentTarget=J;try{y(m)}catch(re){Qd(re)}m.currentTarget=null,y=U}else for(R=0;R<c.length;R++){if(j=c[R],U=j.instance,J=j.currentTarget,j=j.listener,U!==y&&m.isPropagationStopped())break e;y=j,m.currentTarget=J;try{y(m)}catch(re){Qd(re)}m.currentTarget=null,y=U}}}}function lt(n,r){var a=r[cw];a===void 0&&(a=r[cw]=new Set);var c=n+"__bubble";a.has(c)||(ET(r,n,2,!1),a.add(c))}function gy(n,r,a){var c=0;r&&(c|=4),ET(a,n,c,r)}var $f="_reactListening"+Math.random().toString(36).slice(2);function yy(n){if(!n[$f]){n[$f]=!0,fw.forEach(function(a){a!=="selectionchange"&&(q_.has(a)||gy(a,!1,n),gy(a,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[$f]||(r[$f]=!0,gy("selectionchange",!1,r))}}function ET(n,r,a,c){switch(mR(r)){case 2:var m=I3;break;case 8:m=P3;break;default:m=zy}a=m.bind(null,r,a,n),m=void 0,!Ep||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(m=!0),c?m!==void 0?n.addEventListener(r,a,{capture:!0,passive:m}):n.addEventListener(r,a,!0):m!==void 0?n.addEventListener(r,a,{passive:m}):n.addEventListener(r,a,!1)}function vy(n,r,a,c,m){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var R=c.tag;if(R===3||R===4){var j=c.stateNode.containerInfo;if(j===m)break;if(R===4)for(R=c.return;R!==null;){var U=R.tag;if((U===3||U===4)&&R.stateNode.containerInfo===m)return;R=R.return}for(;j!==null;){if(R=Do(j),R===null)return;if(U=R.tag,U===5||U===6||U===26||U===27){c=y=R;continue e}j=j.parentNode}}c=c.return}Ew(function(){var J=y,re=Tp(a),de=[];e:{var Z=Jw.get(n);if(Z!==void 0){var se=Kd,Re=n;switch(n){case"keypress":if(Hd(a)===0)break e;case"keydown":case"keyup":se=AD;break;case"focusin":Re="focus",se=Mp;break;case"focusout":Re="blur",se=Mp;break;case"beforeblur":case"afterblur":se=Mp;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=kw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=pD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=jD;break;case Qw:case Xw:case Zw:se=vD;break;case Ww:se=_D;break;case"scroll":case"scrollend":se=hD;break;case"wheel":se=PD;break;case"copy":case"cut":case"paste":se=xD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Nw;break;case"submit":se=ND;break;case"toggle":case"beforetoggle":se=LD}var _e=(r&4)!==0,et=!_e&&(n==="scroll"||n==="scrollend"),W=_e?Z!==null?Z+"Capture":null:Z;_e=[];for(var Y=J,te;Y!==null;){var ue=Y;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||W===null||(ue=Oc(Y,W),ue!=null&&_e.push(uu(Y,ue,te))),et)break;Y=Y.return}0<_e.length&&(Z=new se(Z,Re,null,a,re),de.push({event:Z,listeners:_e}))}}if((r&7)===0){e:{if(se=n==="mouseover"||n==="pointerover",Z=n==="mouseout"||n==="pointerout",se&&a!==Sp&&(Re=a.relatedTarget||a.fromElement)&&(Do(Re)||Re[$a]))break e;(Z||se)&&(Re=re.window===re?re:(se=re.ownerDocument)?se.defaultView||se.parentWindow:window,Z?(se=a.relatedTarget||a.toElement,Z=J,se=se?Do(se):null,se!==null&&(et=l(se),_e=se.tag,se!==et||_e!==5&&_e!==27&&_e!==6)&&(se=null)):(Z=null,se=J),Z!==se&&(_e=kw,ue="onMouseLeave",W="onMouseEnter",Y="mouse",(n==="pointerout"||n==="pointerover")&&(_e=Nw,ue="onPointerLeave",W="onPointerEnter",Y="pointer"),et=Z==null?Re:Nc(Z),te=se==null?Re:Nc(se),Re=new _e(ue,Y+"leave",Z,a,re),Re.target=et,Re.relatedTarget=te,ue=null,Do(re)===J&&(_e=new _e(W,Y+"enter",se,a,re),_e.target=te,_e.relatedTarget=et,ue=_e),et=ue,_e=Z&&se?_(Z,se,H_):null,Z!==null&&CT(de,Re,Z,_e,!1),se!==null&&et!==null&&CT(de,et,se,_e,!0)))}e:{if(Z=J?Nc(J):window,se=Z.nodeName&&Z.nodeName.toLowerCase(),se==="select"||se==="input"&&Z.type==="file")var Oe=Lw;else if(Pw(Z))if(Bw)Oe=$D;else{Oe=KD;var dt=GD}else se=Z.nodeName,!se||se.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?J&&wp(J.elementType)&&(Oe=Lw):Oe=YD;if(Oe&&(Oe=Oe(n,J))){zw(de,Oe,a,re);break e}dt&&dt(n,Z,J)}switch(dt=J?Nc(J):window,n){case"focusin":(Pw(dt)||dt.contentEditable==="true")&&(sl=dt,Pp=J,Bc=null);break;case"focusout":Bc=Pp=sl=null;break;case"mousedown":zp=!0;break;case"contextmenu":case"mouseup":case"dragend":zp=!1,Yw(de,a,re);break;case"selectionchange":if(XD)break;case"keydown":case"keyup":Yw(de,a,re)}var Ve;if(Op)e:{switch(n){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else nl?_w(n,a)&&($e="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&($e="onCompositionStart");$e&&(Ow&&a.locale!=="ko"&&(nl||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&nl&&(Ve=Cw()):(Ar=re,Cp="value"in Ar?Ar.value:Ar.textContent,nl=!0)),dt=Qf(J,$e),0<dt.length&&($e=new Mw($e,n,null,a,re),de.push({event:$e,listeners:dt}),Ve?$e.data=Ve:(Ve=Iw(a),Ve!==null&&($e.data=Ve)))),(Ve=UD?VD(n,a):FD(n,a))&&($e=Qf(J,"onBeforeInput"),0<$e.length&&(dt=new Mw("onBeforeInput","beforeinput",null,a,re),de.push({event:dt,listeners:$e}),dt.data=Ve)),U_(de,n,J,a,re)}RT(de,r)})}function uu(n,r,a){return{instance:n,listener:r,currentTarget:a}}function Qf(n,r){for(var a=r+"Capture",c=[];n!==null;){var m=n,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=Oc(n,a),m!=null&&c.unshift(uu(n,m,y)),m=Oc(n,r),m!=null&&c.push(uu(n,m,y))),n.tag===3)return c;n=n.return}return[]}function H_(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function CT(n,r,a,c,m){for(var y=r._reactName,R=[];a!==null&&a!==c;){var j=a,U=j.alternate,J=j.stateNode;if(j=j.tag,U!==null&&U===c)break;j!==5&&j!==26&&j!==27||J===null||(U=J,m?(J=Oc(a,y),J!=null&&R.unshift(uu(a,J,U))):m||(J=Oc(a,y),J!=null&&R.push(uu(a,J,U)))),a=a.return}R.length!==0&&n.push({event:r,listeners:R})}var G_=/\r\n?/g,K_=/\u0000|\uFFFD/g;function AT(n){return(typeof n=="string"?n:""+n).replace(G_,`
66
- `).replace(K_,"")}function kT(n,r){return r=AT(r),AT(n)===r}function Mt(n,r,a,c,m,y){switch(a){case"children":if(typeof c=="string")r==="body"||r==="textarea"&&c===""||Ja(n,c);else if(typeof c=="number"||typeof c=="bigint")r!=="body"&&Ja(n,""+c);else return;break;case"className":Vd(n,"class",c);break;case"tabIndex":Vd(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Vd(n,a,c);break;case"style":Tw(n,c,y);return;case"data":if(r!=="object"){Vd(n,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||a!=="href")){n.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=Fd(c),n.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(a,"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 y=="function"&&(a==="formAction"?(r!=="input"&&Mt(n,r,"name",m.name,m,null),Mt(n,r,"formEncType",m.formEncType,m,null),Mt(n,r,"formMethod",m.formMethod,m,null),Mt(n,r,"formTarget",m.formTarget,m,null)):(Mt(n,r,"encType",m.encType,m,null),Mt(n,r,"method",m.method,m,null),Mt(n,r,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=Fd(c),n.setAttribute(a,c);break;case"onClick":c!=null&&(n.onclick=li);return;case"onScroll":c!=null&&lt("scroll",n);return;case"onScrollEnd":c!=null&&lt("scrollend",n);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(m.children!=null)throw Error(i(60));(y!=null?y.__html:void 0)!==a&&(n.innerHTML=a)}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.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"){n.removeAttribute("xlink:href");break}a=Fd(c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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"?n.setAttribute(a,c):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":c===!0?n.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,c):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(a,c):n.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(a):n.setAttribute(a,c);break;case"popover":lt("beforetoggle",n),lt("toggle",n),Ud(n,"popover",c);break;case"xlinkActuate":qi(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":qi(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":qi(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":qi(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":qi(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":qi(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":qi(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":qi(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":qi(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Ud(n,"is",c);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=dD.get(a)||a,Ud(n,a,c);else return}yt=!0}function by(n,r,a,c,m,y){switch(a){case"style":Tw(n,c,y);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(m.children!=null)throw Error(i(60));(y!=null?y.__html:void 0)!==a&&(n.innerHTML=a)}}break;case"children":if(typeof c=="string")Ja(n,c);else if(typeof c=="number"||typeof c=="bigint")Ja(n,""+c);else return;break;case"onScroll":c!=null&&lt("scroll",n);return;case"onScrollEnd":c!=null&&lt("scrollend",n);return;case"onClick":c!=null&&(n.onclick=li);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!hw.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),y=a.slice(2,m?a.length-7:void 0),r=n[Jn]||null,r=r!=null?r[a]:null,typeof r=="function"&&n.removeEventListener(y,r,m),typeof c=="function")){typeof r!="function"&&r!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(y,c,m);break e}yt=!0,a in n?n[a]=c:c===!0?n.setAttribute(a,""):Ud(n,a,c)}return}yt=!0}function An(n,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",n),lt("load",n);var c=!1,m=!1,y;for(y in a)if(a.hasOwnProperty(y)){var R=a[y];if(R!=null)switch(y){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Mt(n,r,y,R,a,null)}}m&&Mt(n,r,"srcSet",a.srcSet,a,null),c&&Mt(n,r,"src",a.src,a,null);return;case"input":lt("invalid",n);var j=y=R=m=null,U=null,J=null;for(c in a)if(a.hasOwnProperty(c)){var re=a[c];if(re!=null)switch(c){case"name":m=re;break;case"type":R=re;break;case"checked":U=re;break;case"defaultChecked":J=re;break;case"value":y=re;break;case"defaultValue":j=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,r));break;default:Mt(n,r,c,re,a,null)}}bw(n,y,j,U,J,R,m,!1);return;case"select":lt("invalid",n),c=R=y=null;for(m in a)if(a.hasOwnProperty(m)&&(j=a[m],j!=null))switch(m){case"value":y=j;break;case"defaultValue":R=j;break;case"multiple":c=j;default:Mt(n,r,m,j,a,null)}r=y,a=R,n.multiple=!!c,r!=null?Wa(n,!!c,r,!1):a!=null&&Wa(n,!!c,a,!0);return;case"textarea":lt("invalid",n),y=m=c=null;for(R in a)if(a.hasOwnProperty(R)&&(j=a[R],j!=null))switch(R){case"value":c=j;break;case"defaultValue":m=j;break;case"children":y=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(i(91));break;default:Mt(n,r,R,j,a,null)}ww(n,c,m,y);return;case"option":for(U in a)if(a.hasOwnProperty(U)&&(c=a[U],c!=null))switch(U){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Mt(n,r,U,c,a,null)}return;case"dialog":lt("beforetoggle",n),lt("toggle",n),lt("cancel",n),lt("close",n);break;case"iframe":case"object":lt("load",n);break;case"video":case"audio":for(c=0;c<cu.length;c++)lt(cu[c],n);break;case"image":lt("error",n),lt("load",n);break;case"details":lt("toggle",n);break;case"embed":case"source":case"link":lt("error",n),lt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in a)if(a.hasOwnProperty(J)&&(c=a[J],c!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:Mt(n,r,J,c,a,null)}return;default:if(wp(r)){for(re in a)a.hasOwnProperty(re)&&(c=a[re],c!==void 0&&by(n,r,re,c,a,void 0));return}}for(j in a)a.hasOwnProperty(j)&&(c=a[j],c!=null&&Mt(n,r,j,c,a,null))}var Y_={};function $_(n,r,a,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,R=null,j=null,U=null,J=null,re=null;for(se in a){var de=a[se];if(a.hasOwnProperty(se)&&de!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":U=de;default:c.hasOwnProperty(se)||Mt(n,r,se,null,c,de)}}for(var Z in c){var se=c[Z];if(de=a[Z],c.hasOwnProperty(Z)&&(se!=null||de!=null))switch(Z){case"type":se!==de&&(yt=!0),y=se;break;case"name":se!==de&&(yt=!0),m=se;break;case"checked":se!==de&&(yt=!0),J=se;break;case"defaultChecked":se!==de&&(yt=!0),re=se;break;case"value":se!==de&&(yt=!0),R=se;break;case"defaultValue":se!==de&&(yt=!0),j=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,r));break;default:se!==de&&Mt(n,r,Z,se,c,de)}}bp(n,R,j,U,J,re,y,m);return;case"select":se=R=j=Z=null;for(y in a)if(U=a[y],a.hasOwnProperty(y)&&U!=null)switch(y){case"value":break;case"multiple":se=U;default:c.hasOwnProperty(y)||Mt(n,r,y,null,c,U)}for(m in c)if(y=c[m],U=a[m],c.hasOwnProperty(m)&&(y!=null||U!=null))switch(m){case"value":y!==U&&(yt=!0),Z=y;break;case"defaultValue":y!==U&&(yt=!0),j=y;break;case"multiple":y!==U&&(yt=!0),R=y;default:y!==U&&Mt(n,r,m,y,c,U)}r=j,a=R,c=se,Z!=null?Wa(n,!!a,Z,!1):!!c!=!!a&&(r!=null?Wa(n,!!a,r,!0):Wa(n,!!a,a?[]:"",!1));return;case"textarea":se=Z=null;for(j in a)if(m=a[j],a.hasOwnProperty(j)&&m!=null&&!c.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Mt(n,r,j,null,c,m)}for(R in c)if(m=c[R],y=a[R],c.hasOwnProperty(R)&&(m!=null||y!=null))switch(R){case"value":m!==y&&(yt=!0),Z=m;break;case"defaultValue":m!==y&&(yt=!0),se=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(i(91));break;default:m!==y&&Mt(n,r,R,m,c,y)}xw(n,Z,se);return;case"option":for(var Re in a)if(Z=a[Re],a.hasOwnProperty(Re)&&Z!=null&&!c.hasOwnProperty(Re))switch(Re){case"selected":n.selected=!1;break;default:Mt(n,r,Re,null,c,Z)}for(U in c)if(Z=c[U],se=a[U],c.hasOwnProperty(U)&&Z!==se&&(Z!=null||se!=null))switch(U){case"selected":Z!==se&&(yt=!0),n.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:Mt(n,r,U,Z,c,se)}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 _e in a)Z=a[_e],a.hasOwnProperty(_e)&&Z!=null&&!c.hasOwnProperty(_e)&&Mt(n,r,_e,null,c,Z);for(J in c)if(Z=c[J],se=a[J],c.hasOwnProperty(J)&&Z!==se&&(Z!=null||se!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,r));break;default:Mt(n,r,J,Z,c,se)}return;default:if(wp(r)){for(var et in a)Z=a[et],a.hasOwnProperty(et)&&Z!==void 0&&!c.hasOwnProperty(et)&&by(n,r,et,void 0,c,Z);for(re in c)Z=c[re],se=a[re],!c.hasOwnProperty(re)||Z===se||Z===void 0&&se===void 0||by(n,r,re,Z,c,se);return}}for(var W in a)Z=a[W],a.hasOwnProperty(W)&&Z!=null&&!c.hasOwnProperty(W)&&Mt(n,r,W,null,c,Z);for(de in c)Z=c[de],se=a[de],!c.hasOwnProperty(de)||Z===se||Z==null&&se==null||Mt(n,r,de,Z,c,se)}function MT(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q_(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var m=a[c],y=m.transferSize,R=m.initiatorType,j=m.duration;if(y&&j&&MT(R)){for(R=0,j=m.responseEnd,c+=1;c<a.length;c++){var U=a[c],J=U.startTime;if(J>j)break;var re=U.transferSize,de=U.initiatorType;re&&MT(de)&&(U=U.responseEnd,R+=re*(U<j?1:(j-J)/(U-J)))}if(--c,r+=8*(y+R)/(m.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var xy=null,wy=null;function du(n){return n.nodeType===9?n:n.ownerDocument}function NT(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function OT(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function jT(n,r,a,c){return a=du(a).createElement(n),a[Sn]=c,a[Jn]=r,An(a,n,r),pn(a),a}function Sy(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Ty=null;function X_(){var n=window.event;return n&&n.type==="popstate"?n===Ty?!1:(Ty=n,!0):(Ty=null,!1)}var Ry=typeof setTimeout=="function"?setTimeout:void 0,Z_=typeof clearTimeout=="function"?clearTimeout:void 0,DT=typeof Promise=="function"?Promise:void 0,_T=typeof requestAnimationFrame=="function"?requestAnimationFrame:Ry,W_=typeof queueMicrotask=="function"?queueMicrotask:typeof DT<"u"?function(n){return DT.resolve(null).then(n).catch(J_)}:Ry;function J_(n){setTimeout(function(){throw n})}function Yr(n){return n==="head"}function IT(n,r){var a=r,c=0;do{var m=a.nextSibling;if(n.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"||a==="/&"){if(c===0){n.removeChild(m),Pl(r);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")jy(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,jy(a);for(var y=a.firstChild;y;){var R=y.nextSibling,j=y.nodeName;y[Mc]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=R}}else a==="body"&&jy(n.ownerDocument.body);a=m}while(a);Pl(r)}function PT(n,r){var a=n;n=0;do{var c=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=c}while(a)}function zT(n,r,a){if(r=CSS.escape(r)!==r?"r-"+btoa(r).replace(/=/g,""):r,n.style.viewTransitionName=r,a!=null&&(n.style.viewTransitionClass=a),a=getComputedStyle(n),a.display==="inline"){if(r=n.getClientRects(),r.length===1)var c=1;else for(var m=c=0;m<r.length;m++){var y=r[m];0<y.width&&0<y.height&&c++}c===1&&(n=n.style,n.display=r.length===1?"inline-block":"block",n.marginTop="-"+a.paddingTop,n.marginBottom="-"+a.paddingBottom)}}function LT(n,r){n=n.style,r=r.style;var a=r!=null?r.hasOwnProperty("viewTransitionName")?r.viewTransitionName:r.hasOwnProperty("view-transition-name")?r["view-transition-name"]:null:null;n.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=r!=null?r.hasOwnProperty("viewTransitionClass")?r.viewTransitionClass:r.hasOwnProperty("view-transition-class")?r["view-transition-class"]:null:null,n.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),n.display==="inline-block"&&(r==null?n.display=n.margin="":(a=r.display,n.display=a==null||typeof a=="boolean"?"":a,a=r.margin,a!=null?n.margin=a:(a=r.hasOwnProperty("marginTop")?r.marginTop:r["margin-top"],n.marginTop=a==null||typeof a=="boolean"?"":a,r=r.hasOwnProperty("marginBottom")?r.marginBottom:r["margin-bottom"],n.marginBottom=r==null||typeof r=="boolean"?"":r)))}function e3(n,r,a){return a=a.ownerDocument.defaultView,{rect:n,abs:r.position==="absolute"||r.position==="fixed",clip:r.clipPath!=="none"||r.overflow!=="visible"||r.filter!=="none"||r.mask!=="none"||r.mask!=="none"||r.borderRadius!=="0px",view:0<=n.bottom&&0<=n.right&&n.top<=a.innerHeight&&n.left<=a.innerWidth}}function Ey(n){var r=n.getBoundingClientRect(),a=getComputedStyle(n);return e3(r,a,n)}function t3(n){return n.documentElement.clientHeight}function n3(n){this.addEventListener("load",n),this.addEventListener("error",n)}function s3(n,r,a,c,m,y,R,j,U){var J=r.nodeType===9?r:r.ownerDocument;try{var re=J.startViewTransition({update:function(){var Z=J.defaultView,se=Z.navigation&&Z.navigation.transition,Re=J.fonts.status;c();var _e=[];if(Re==="loaded"&&(t3(J),J.fonts.status==="loading"&&_e.push(J.fonts.ready)),Re=_e.length,n!==null)for(var et=n.suspenseyImages,W=0,Y=0;Y<et.length;Y++){var te=et[Y];if(!te.complete){var ue=te.getBoundingClientRect();if(0<ue.bottom&&0<ue.right&&ue.top<Z.innerHeight&&ue.left<Z.innerWidth){if(W+=rR(te),W>Wf){_e.length=Re;break}te=new Promise(n3.bind(te)),_e.push(te)}}}if(0<_e.length)return Z=Promise.race([Promise.all(_e),new Promise(function(Oe){return setTimeout(Oe,500)})]).then(m,m),(se?Promise.allSettled([se.finished,Z]):Z).then(y,y);if(m(),se)return se.finished.then(y,y);y()},types:a});J.__reactViewTransition=re;var de=[];return re.ready.then(function(){for(var Z=J.documentElement.getAnimations({subtree:!0}),se=0;se<Z.length;se++){var Re=Z[se],_e=Re.effect,et=_e.pseudoElement;if(et!=null&&et.startsWith("::view-transition")){de.push(Re),Re=_e.getKeyframes();for(var W=et=void 0,Y=!0,te=0;te<Re.length;te++){var ue=Re[te],Oe=ue.width;if(et===void 0)et=Oe;else if(et!==Oe){Y=!1;break}if(Oe=ue.height,W===void 0)W=Oe;else if(W!==Oe){Y=!1;break}delete ue.width,delete ue.height,ue.transform==="none"&&delete ue.transform}Y&&et!==void 0&&W!==void 0&&(_e.setKeyframes(Re),Y=getComputedStyle(_e.target,_e.pseudoElement),Y.width!==et||Y.height!==W)&&(Y=Re[0],Y.width=et,Y.height=W,Y=Re[Re.length-1],Y.width=et,Y.height=W,_e.setKeyframes(Re))}}R()},function(Z){J.__reactViewTransition===re&&(J.__reactViewTransition=null);try{if(typeof Z=="object"&&Z!==null)switch(Z.name){case"InvalidStateError":(Z.message==="View transition was skipped because document visibility state is hidden."||Z.message==="Skipping view transition because document visibility state has become hidden."||Z.message==="Skipping view transition because viewport size changed."||Z.message==="Transition was aborted because of invalid state")&&(Z=null)}Z!==null&&U(Z)}finally{c(),m(),R()}}),re.finished.finally(function(){for(var Z=0;Z<de.length;Z++)de[Z].cancel();J.__reactViewTransition===re&&(J.__reactViewTransition=null),j()}),re}catch{return c(),m(),R(),null}}function ea(n,r){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+r+")"}ea.prototype.animate=function(n,r){return r=typeof r=="number"?{duration:r}:N({},r),r.pseudoElement=this._selector,this._scope.animate(n,r)},ea.prototype.getAnimations=function(){for(var n=this._scope,r=this._selector,a=n.getAnimations({subtree:!0}),c=[],m=0;m<a.length;m++){var y=a[m].effect;y!==null&&y.target===n&&y.pseudoElement===r&&c.push(a[m])}return c},ea.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function BT(n){return{name:n,group:new ea("group",n),imagePair:new ea("image-pair",n),old:new ea("old",n),new:new ea("new",n)}}function vs(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}vs.prototype.addEventListener=function(n,r,a){var c=null,m=null;if(!(a!=null&&typeof a!="boolean"&&(c=a.signal||null,c!==null&&c.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var y=this._eventListeners;if(VT(y,n,r,a)===-1){var R=this,j=r;a!=null&&typeof a!="boolean"&&a.once===!0&&(j=function(U){R.removeEventListener(n,r,a),typeof r=="function"?r.call(this,U):r.handleEvent(U)}),c!==null&&(m=R.removeEventListener.bind(R,n,r,a),c.addEventListener("abort",m,{once:!0}),m=c.removeEventListener.bind(c,"abort",m)),c=Nl(a),y.push({type:n,listener:r,optionsOrUseCapture:a,attachedListener:j,cleanup:m}),g(this._fragmentFiber.child,!1,i3,n,j,c)}this._eventListeners=y}};function i3(n,r,a,c){return T(n).addEventListener(r,a,c),!1}vs.prototype.removeEventListener=function(n,r,a){var c=this._eventListeners;if(c!==null&&(r=VT(c,n,r,a),r!==-1)){var m=c[r];a=m.attachedListener;var y=m.cleanup;m=Nl(m.optionsOrUseCapture),g(this._fragmentFiber.child,!1,r3,n,a,m),c.splice(r,1),y!==null&&y()}};function r3(n,r,a,c){return T(n).removeEventListener(r,a,c),!1}function Nl(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function UT(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function VT(n,r,a,c){if(n.length===0)return-1;c=UT(c);for(var m=0;m<n.length;m++){var y=n[m];if(y.type===r&&y.listener===a&&UT(y.optionsOrUseCapture)===c)return m}return-1}vs.prototype.dispatchEvent=function(n){var r=b(this._fragmentFiber);if(r===null)return!0;r=T(r);var a=this._eventListeners;if(a!==null&&0<a.length||!n.bubbles){var c=r.nodeType===9?r.createComment(""):document.createTextNode("");if(a)for(var m=0;m<a.length;m++){var y=a[m];c.addEventListener(y.type,y.attachedListener,Nl(y.optionsOrUseCapture))}if(r.appendChild(c),n=c.dispatchEvent(n),a)for(m=0;m<a.length;m++)y=a[m],c.removeEventListener(y.type,y.attachedListener,Nl(y.optionsOrUseCapture));return r.removeChild(c),n}return r.dispatchEvent(n)},vs.prototype.focus=function(n){g(this._fragmentFiber.child,!0,FT,n,void 0,void 0)};function FT(n,r){return n.tag===6?!1:(n=T(n),y3(n,r))}vs.prototype.focusLast=function(n){var r=[];g(this._fragmentFiber.child,!0,Cy,r,void 0,void 0);for(var a=r.length-1;0<=a&&!FT(r[a],n);a--);};function Cy(n,r){return r.push(n),!1}vs.prototype.blur=function(){var n=b(this._fragmentFiber);n!==null&&(n=T(n),n=du(n).activeElement,n!==null&&g(this._fragmentFiber.child,!1,o3,n,void 0,void 0))};function o3(n,r){return n.tag===6?!1:(n=T(n),n===r||n.contains(r)?(r.blur(),!0):!1)}vs.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),g(this._fragmentFiber.child,!1,a3,n,void 0,void 0)};function a3(n,r){return n.tag===6||(n=T(n),r.observe(n)),!1}vs.prototype.unobserveUsing=function(n){var r=this._observers;if(r!==null&&r.has(n)){r.delete(n),g(this._fragmentFiber.child,!1,l3,n,void 0,void 0);for(var a=r=0;a<Qs.length;a++){var c=Qs[a];c.fragmentInstance===this&&c.observer===n?n.unobserve(c.instance):Qs[r++]=c}Qs.length=r}};function l3(n,r){return n.tag===6||(n=T(n),r.unobserve(n)),!1}var Qs=[],Ay=!1;function c3(n,r,a){Qs.push({fragmentInstance:n,observer:r,instance:a}),Ay||(Ay=!0,v3(function(){Ay=!1;var c=Qs;Qs=[];for(var m=0;m<c.length;m++){var y=c[m];y.observer.unobserve(y.instance)}}))}vs.prototype.getClientRects=function(){var n=[];return g(this._fragmentFiber.child,!1,u3,n,void 0,void 0),n};function u3(n,r){if(n.tag===6){n=n.stateNode;var a=n.ownerDocument.createRange();a.selectNodeContents(n),r.push.apply(r,a.getClientRects())}else n=T(n),r.push.apply(r,n.getClientRects());return!1}vs.prototype.getRootNode=function(n){var r=b(this._fragmentFiber);return r===null?this:T(r).getRootNode(n)},vs.prototype.compareDocumentPosition=function(n){var r=b(this._fragmentFiber);if(r===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];g(this._fragmentFiber.child,!1,Cy,a,void 0,void 0);var c=T(r);if(a.length===0){if(a=c,w(this._fragmentFiber)){e:{for(r=this._fragmentFiber.return;r!==null;){if(r.tag===4){r=r.stateNode.containerInfo;break e}if(r.tag===3||r.tag===5||r.tag===27)break;r=r.return}r=null}r!=null&&(a=r)}r=this._fragmentFiber;var m=c=a.compareDocumentPosition(n);return a===n?m=Node.DOCUMENT_POSITION_CONTAINS:c&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=x(r)[1],a===null?m=Node.DOCUMENT_POSITION_PRECEDING:(n=T(a).compareDocumentPosition(n),m=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),m|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}r=T(a[0]),m=T(a[a.length-1]);var y=w(this._fragmentFiber)?r.parentElement:c;if(y==null)return Node.DOCUMENT_POSITION_DISCONNECTED;c=y.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY,y=y.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY;var R=r.compareDocumentPosition(n),j=m.compareDocumentPosition(n),U=R&Node.DOCUMENT_POSITION_CONTAINED_BY||j&Node.DOCUMENT_POSITION_CONTAINED_BY;return j=c&&y&&R&Node.DOCUMENT_POSITION_FOLLOWING&&j&Node.DOCUMENT_POSITION_PRECEDING,r=c&&r===n||y&&m===n||U||j?Node.DOCUMENT_POSITION_CONTAINED_BY:!c&&r===n||!y&&m===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:R,r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||d3(r,this._fragmentFiber,a[0],a[a.length-1],n)?r:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function d3(n,r,a,c,m){var y=Do(m);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!y)e:{for(;y!==null;){if(y.tag===7&&(y===r||y.alternate===r)){a=!0;break e}y=y.return}a=!1}return a}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(y===null)return y=m.ownerDocument,m===y||m===y.documentElement||m===y.body;e:{for(y=r,r=b(r);y!==null;){if(!(y.tag!==5&&y.tag!==3&&y.tag!==27||y!==r&&y.alternate!==r)){y=!0;break e}y=y.return}y=!1}return y}return n&Node.DOCUMENT_POSITION_PRECEDING?((r=!!y)&&!(r=y===a)&&(r=_(a,y,D),r===null?r=!1:(g(r,!0,k,y,a),y=A,A=null,r=y!==null)),r):n&Node.DOCUMENT_POSITION_FOLLOWING?((r=!!y)&&!(r=y===c)&&(r=_(c,y,D),r===null?r=!1:(g(r,!0,M,y,c),y=A,C=A=null,r=y!==null)),r):!1}function qT(n,r){var a=n.ownerDocument.createRange();a.selectNodeContents(n),n=a.getBoundingClientRect(),window.scrollTo(window.scrollX+n.left,r?window.scrollY+n.top:window.scrollY+n.bottom-window.innerHeight)}vs.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(i(566));var r=[];g(this._fragmentFiber.child,!1,Cy,r,void 0,void 0);var a=n!==!1;if(r.length===0){var c=x(this._fragmentFiber);if(c=a?c[1]||c[0]||b(this._fragmentFiber):c[0]||c[1],c===null)return;if(c.tag===6){n=T(c),qT(n,a);return}if(c=T(c),c.nodeType!==9){if(c.nodeType===11){a="host"in c?c.host:null,a!==null&&a.scrollIntoView(n);return}c.scrollIntoView(n)}}for(c=a?r.length-1:0;c!==(a?-1:r.length);){var m=r[c];m.tag===6?(m=T(m),qT(m,a)):T(m).scrollIntoView(n),c+=a?-1:1}};function f3(n,r){return n=T(n),HT(n,r),!1}function HT(n,r){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(r)}function GT(n,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];n.addEventListener(m.type,m.attachedListener,Nl(m.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(y){for(var R=0,j=0;j<Qs.length;j++){var U=Qs[j];(U.fragmentInstance!==r||U.observer!==y||U.instance!==n)&&(Qs[R++]=U)}Qs.length=R,y.observe(n)}),HT(n,r))}function h3(n,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];n.removeEventListener(m.type,m.attachedListener,Nl(m.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(y){typeof y.rootMargin=="string"?c3(r,y,n):y.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(r))}function ky(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ky(a),Bd(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function m3(n,r,a,c){for(;n.nodeType===1;){var m=a;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[Mc])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==m.rel||n.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||n.getAttribute("title")!==(m.title==null?null:m.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(m.src==null?null:m.src)||n.getAttribute("type")!==(m.type==null?null:m.type)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=Ds(n.nextSibling),n===null)break}return null}function p3(n,r,a){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Ds(n.nextSibling),n===null))return null;return n}function KT(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Ds(n.nextSibling),n===null))return null;return n}function My(n){return n.data==="$?"||n.data==="$~"}function Ny(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function g3(n,r){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||a.readyState!=="loading")r();else{var c=function(){r(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Ds(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Oy=null;function YT(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(r===0)return Ds(n.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}n=n.nextSibling}return null}function $T(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return n;r--}else a!=="/$"&&a!=="/&"||r++}n=n.previousSibling}return null}function y3(n,r){function a(){c=!0}if(n.ownerDocument.activeElement===n)return!0;var c=!1;try{n.ownerDocument.addEventListener("focus",a,!0),(n.focus||HTMLElement.prototype.focus).call(n,r)}finally{n.ownerDocument.removeEventListener("focus",a,!0)}return c}function v3(n){_T(function(){_T(function(r){return n(r)})})}function QT(n,r,a){switch(r=du(a),n){case"html":if(n=r.documentElement,!n)throw Error(i(452));return n;case"head":if(n=r.head,!n)throw Error(i(453));return n;case"body":if(n=r.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function XT(n,r,a){for(var c in a){var m=a[c];a.hasOwnProperty(c)&&m!=null&&Mt(n,r,c,null,Y_,m)}a.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===li&&(n.onclick=null),Bd(n)}function jy(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Bd(n)}var _s=new Map,ZT=new Set;function fu(n){if(typeof n.getRootNode=="function"){var r=n.getRootNode();if(r.nodeType===9||r.nodeType===11)return r}return n.nodeType===9?n:n.ownerDocument}var nr=me.d;me.d={f:b3,r:x3,D:w3,C:S3,L:T3,m:R3,X:C3,S:E3,M:A3};function b3(){var n=nr.f(),r=qf();return n||r}function x3(n){var r=Qa(n);r!==null&&r.tag===5&&r.type==="form"?JS(r):nr.r(n)}var Ol=typeof document>"u"?null:document;function WT(n,r,a){var c=Ol;if(c&&typeof r=="string"&&r){var m=Cs(r);m='link[rel="'+n+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),ZT.has(m)||(ZT.add(m),n={rel:n,crossOrigin:a,href:r},c.querySelector(m)===null&&(r=c.createElement("link"),An(r,"link",n),pn(r),c.head.appendChild(r)))}}function w3(n){nr.D(n),WT("dns-prefetch",n,null)}function S3(n,r){nr.C(n,r),WT("preconnect",n,r)}function T3(n,r,a){nr.L(n,r,a);var c=Ol;if(c&&n&&r){var m='link[rel="preload"][as="'+Cs(r)+'"]';r==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+Cs(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+Cs(a.imageSizes)+'"]')):m+='[href="'+Cs(n)+'"]';var y=m;switch(r){case"style":y=jl(n);break;case"script":y=Dl(n)}if(!(_s.has(y)||(n=N({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:n,as:r},a),_s.set(y,n),c.querySelector(m)!==null||r==="style"&&c.querySelector(hu(y))||r==="script"&&c.querySelector(mu(y))))){var R=c.createElement("link");An(R,"link",n),r==="style"&&(R[Ld]=!0,R.onload=R.onerror=function(){dw(R)}),pn(R),c.head.appendChild(R)}}}function R3(n,r){nr.m(n,r);var a=Ol;if(a&&n){var c=r&&typeof r.as=="string"?r.as:"script",m='link[rel="modulepreload"][as="'+Cs(c)+'"][href="'+Cs(n)+'"]',y=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Dl(n)}if(!_s.has(y)&&(n=N({rel:"modulepreload",href:n},r),_s.set(y,n),a.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mu(y)))return}c=a.createElement("link"),An(c,"link",n),pn(c),a.head.appendChild(c)}}}function E3(n,r,a){nr.S(n,r,a);var c=Ol;if(c&&n){var m=Xa(c).hoistableStyles,y=jl(n);r=r||"default";var R=m.get(y);if(!R){var j={loading:0,preload:null};if(R=c.querySelector(hu(y)))j.loading=5;else{n=N({rel:"stylesheet",href:n,"data-precedence":r},a),(a=_s.get(y))&&Dy(n,a);var U=R=c.createElement("link");pn(U),An(U,"link",n),U._p=new Promise(function(J,re){U.onload=J,U.onerror=re}),U.addEventListener("load",function(){j.loading|=1}),U.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Xf(R,r,c)}R={type:"stylesheet",instance:R,count:1,state:j},m.set(y,R)}}}function C3(n,r){nr.X(n,r);var a=Ol;if(a&&n){var c=Xa(a).hoistableScripts,m=Dl(n),y=c.get(m);y||(y=a.querySelector(mu(m)),y||(n=N({src:n,async:!0},r),(r=_s.get(m))&&_y(n,r),y=a.createElement("script"),pn(y),An(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function A3(n,r){nr.M(n,r);var a=Ol;if(a&&n){var c=Xa(a).hoistableScripts,m=Dl(n),y=c.get(m);y||(y=a.querySelector(mu(m)),y||(n=N({src:n,async:!0,type:"module"},r),(r=_s.get(m))&&_y(n,r),y=a.createElement("script"),pn(y),An(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function JT(n,r,a,c){var m=(m=xe.current)?fu(m):null;if(!m)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=jl(a.href),r=Xa(m).hoistableStyles,c=r.get(a),c||(c={type:"style",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=jl(a.href);var y=Xa(m).hoistableStyles,R=y.get(n);if(R||(m=m.ownerDocument||m,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,R),(y=m.querySelector(hu(n)))?y._p||(R.instance=y,R.state.loading=5):(y=_s.get(n),y||(y={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_s.set(n,y)),k3(m,n,y,R.state))),r&&c===null)throw Error(i(528,""));return R}if(r&&c!==null)throw Error(i(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(a=Dl(a),r=Xa(m).hoistableScripts,c=r.get(a),c||(c={type:"script",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function jl(n){return'href="'+Cs(n)+'"'}function hu(n){return'link[rel="stylesheet"]['+n+"]"}function eR(n){return N({},n,{"data-precedence":n.precedence,precedence:null})}function k3(n,r,a,c){if(r=n.querySelector('link[rel="preload"][as="style"]['+r+"]")){if(r[Ld]!==!0){c.loading=1;return}}else r=n.createElement("link"),r[Ld]=!0,r.onload=r.onerror=dw.bind(null,r),An(r,"link",a),pn(r),n.head.appendChild(r);c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2})}function Dl(n){return'[src="'+Cs(n)+'"]'}function mu(n){return"script[async]"+n}function tR(n,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var c=n.querySelector('style[data-href~="'+Cs(a.href)+'"]');if(c)return r.instance=c,pn(c),c;var m=N({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),pn(c),An(c,"style",m),Xf(c,a.precedence,n),r.instance=c;case"stylesheet":m=jl(a.href);var y=n.querySelector(hu(m));if(y)return r.state.loading|=4,r.instance=y,pn(y),y;c=eR(a),(m=_s.get(m))&&Dy(c,m),y=(n.ownerDocument||n).createElement("link"),pn(y);var R=y;return R._p=new Promise(function(j,U){R.onload=j,R.onerror=U}),An(y,"link",c),r.state.loading|=4,Xf(y,a.precedence,n),r.instance=y;case"script":return y=Dl(a.src),(m=n.querySelector(mu(y)))?(r.instance=m,pn(m),m):(c=a,(m=_s.get(y))&&(c=N({},a),_y(c,m)),n=n.ownerDocument||n,m=n.createElement("script"),pn(m),An(m,"link",c),n.head.appendChild(m),r.instance=m);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Xf(c,a.precedence,n));return r.instance}function Xf(n,r,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,y=m,R=0;R<c.length;R++){var j=c[R];if(j.dataset.precedence===r)y=j;else if(y!==m)break}y?y.parentNode.insertBefore(n,y.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(n,r.firstChild))}function Dy(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function _y(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var Zf=null;function nR(n,r,a){if(Zf===null){var c=new Map,m=Zf=new Map;m.set(a,c)}else m=Zf,c=m.get(a),c||(c=new Map,m.set(a,c));if(c.has(n))return c;for(c.set(n,null),a=a.getElementsByTagName(n),m=0;m<a.length;m++){var y=a[m];if(!(y[Mc]||y[Sn]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var R=y.getAttribute(r)||"";R=n+R;var j=c.get(R);j?j.push(y):c.set(R,[y])}}return c}function Iy(n,r,a){n=n.ownerDocument||n,n.head.insertBefore(a,r==="title"?n.querySelector("head > title"):null)}function M3(n,r,a){if(a===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function sR(n,r){return n==="img"&&r.src!=null&&r.src!==""&&r.onLoad==null&&r.loading!=="lazy"}function iR(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function rR(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function oR(n,r){typeof r.decode=="function"&&(n.imgCount++,r.complete||(n.imgBytes+=rR(r),n.suspenseyImages.push(r)),n=j3.bind(n),r.decode().then(n,n))}function N3(n,r,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var m=jl(c.href),y=r.querySelector(hu(m));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=pu.bind(n),r.then(n,n)),a.state.loading|=4,a.instance=y,pn(y);return}y=r.ownerDocument||r,c=eR(c),(m=_s.get(m))&&Dy(c,m),y=y.createElement("link"),pn(y);var R=y;R._p=new Promise(function(j,U){R.onload=j,R.onerror=U}),An(y,"link",c),a.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=pu.bind(n),r.addEventListener("load",a),r.addEventListener("error",a))}}var Wf=0;function O3(n,r){return n.stylesheets&&n.count===0&&eh(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var c=setTimeout(function(){if(n.stylesheets&&eh(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+r);0<n.imgBytes&&Wf===0&&(Wf=62500*Q_());var m=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&eh(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>Wf?50:800)+r);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function aR(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)eh(n,n.stylesheets);else if(n.unsuspend){var r=n.unsuspend;n.unsuspend=null,r()}}}function pu(){this.count--,aR(this)}function j3(){this.imgCount--,aR(this)}var Jf=null;function eh(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Jf=new Map,r.forEach(D3,n),Jf=null,pu.call(n))}function D3(n,r){if(!(r.state.loading&4)){var a=Jf.get(n);if(a)var c=a.get(null);else{a=new Map,Jf.set(n,a);for(var m=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var R=m[y];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(a.set(R.dataset.precedence,R),c=R)}c&&a.set(null,c)}m=r.instance,R=m.getAttribute("data-precedence"),y=a.get(R)||c,y===c&&a.set(null,m),a.set(R,m),this.count++,c=pu.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),y?y.parentNode.insertBefore(m,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(m,n.firstChild)),r.state.loading|=4}}var _l={$$typeof:q,Provider:null,Consumer:null,_currentValue:ze,_currentValue2:ze,_threadCount:0};function _3(n,r,a,c,m,y,R,j,U){this.tag=1,this.containerInfo=n,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=Ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ya(0),this.hiddenUpdates=Ya(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.transitionTypes=null,this.incompleteTransitions=new Map}function lR(n,r,a,c,m,y,R,j,U,J,re,de){return n=new _3(n,r,a,R,U,J,re,de,j),r=1,y===!0&&(r|=24),y=es(3,null,null,r),n.current=y,y.stateNode=n,r=Xp(),r.refCount++,n.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:a,cache:r},eg(y),n}function cR(n){return n?(n=ol,n):ol}function uR(n,r,a,c,m,y){m=cR(m),c.context===null?c.context=m:c.pendingContext=m,c=Ir(r),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=Pr(n,c,r),a!==null&&(is(a,n,r),Kc(a,n,r))}function dR(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<r?a:r}}function Py(n,r){dR(n,r),(n=n.alternate)&&dR(n,r)}function fR(n){if(n.tag===13||n.tag===31){var r=zo(n,67108864);r!==null&&is(r,n,67108864),Py(n,67108864)}}function hR(n){if(n.tag===13||n.tag===31){var r=ys();r=gp(r);var a=zo(n,r);a!==null&&is(a,n,r),Py(n,r)}}var Il=!0;function I3(n,r,a,c){var m=ce.T;ce.T=null;var y=me.p;try{me.p=2,zy(n,r,a,c)}finally{me.p=y,ce.T=m}}function P3(n,r,a,c){var m=ce.T;ce.T=null;var y=me.p;try{me.p=8,zy(n,r,a,c)}finally{me.p=y,ce.T=m}}function zy(n,r,a,c){if(Il){var m=Ly(c);if(m===null)vy(n,r,c,th,a),pR(n,c);else if(L3(m,n,r,a,c))c.stopPropagation();else if(pR(n,c),r&4&&-1<z3.indexOf(n)){for(;m!==null;){var y=Qa(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var R=wn(y.pendingLanes);if(R!==0){var j=y;for(j.pendingLanes|=2,j.entangledLanes|=2;R;){var U=1<<31-gt(R);j.entanglements[1]|=U,R&=~U}vi(y),(St&6)===0&&(Uf=Ut()+500,lu(0))}}break;case 31:case 13:j=zo(y,2),j!==null&&is(j,y,2),qf(),Py(y,2)}if(y=Ly(c),y===null&&vy(n,r,c,th,a),y===m)break;m=y}m!==null&&c.stopPropagation()}else vy(n,r,c,null,a)}}function Ly(n){return n=Tp(n),By(n)}var th=null;function By(n){if(th=null,n=Do(n),n!==null){var r=l(n);if(r===null)n=null;else{var a=r.tag;if(a===13){if(n=u(r),n!==null)return n;n=null}else if(a===31){if(n=d(r),n!==null)return n;n=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return th=n,null}function mR(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Es()){case Bi:return 2;case ri:return 8;case Ui:case Ha:return 32;case jo:return 268435456;default:return 32}default:return 32}}var Uy=!1,$r=null,Qr=null,Xr=null,gu=new Map,yu=new Map,Zr=[],z3="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 pR(n,r){switch(n){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Xr=null;break;case"pointerover":case"pointerout":gu.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":yu.delete(r.pointerId)}}function vu(n,r,a,c,m,y){return n===null||n.nativeEvent!==y?(n={blockedOn:r,domEventName:a,eventSystemFlags:c,nativeEvent:y,targetContainers:[m]},r!==null&&(r=Qa(r),r!==null&&fR(r)),n):(n.eventSystemFlags|=c,r=n.targetContainers,m!==null&&r.indexOf(m)===-1&&r.push(m),n)}function L3(n,r,a,c,m){switch(r){case"focusin":return $r=vu($r,n,r,a,c,m),!0;case"dragenter":return Qr=vu(Qr,n,r,a,c,m),!0;case"mouseover":return Xr=vu(Xr,n,r,a,c,m),!0;case"pointerover":var y=m.pointerId;return gu.set(y,vu(gu.get(y)||null,n,r,a,c,m)),!0;case"gotpointercapture":return y=m.pointerId,yu.set(y,vu(yu.get(y)||null,n,r,a,c,m)),!0}return!1}function gR(n){var r=Do(n.target);if(r!==null){var a=l(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){n.blockedOn=r,lw(n.priority,function(){hR(a)});return}}else if(r===31){if(r=d(a),r!==null){n.blockedOn=r,lw(n.priority,function(){hR(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function nh(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var a=Ly(n.nativeEvent);if(a===null){a=n.nativeEvent;var c=new a.constructor(a.type,a);Sp=c,a.target.dispatchEvent(c),Sp=null}else return r=Qa(a),r!==null&&fR(r),n.blockedOn=a,!1;r.shift()}return!0}function yR(n,r,a){nh(n)&&a.delete(r)}function B3(){Uy=!1,$r!==null&&nh($r)&&($r=null),Qr!==null&&nh(Qr)&&(Qr=null),Xr!==null&&nh(Xr)&&(Xr=null),gu.forEach(yR),yu.forEach(yR)}function sh(n,r){n.blockedOn===r&&(n.blockedOn=null,Uy||(Uy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,B3)))}var ih=null;function vR(n){ih!==n&&(ih=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ih===n&&(ih=null);for(var r=0;r<n.length;r+=3){var a=n[r],c=n[r+1],m=n[r+2];if(typeof c!="function"){if(By(c||a)===null)continue;break}var y=Qa(a);y!==null&&(n.splice(r,3),r-=3,wg(y,{pending:!0,data:m,method:a.method,action:c},c,m))}}))}function Pl(n){function r(U){return sh(U,n)}$r!==null&&sh($r,n),Qr!==null&&sh(Qr,n),Xr!==null&&sh(Xr,n),gu.forEach(r),yu.forEach(r);for(var a=0;a<Zr.length;a++){var c=Zr[a];c.blockedOn===n&&(c.blockedOn=null)}for(;0<Zr.length&&(a=Zr[0],a.blockedOn===null);)gR(a),a.blockedOn===null&&Zr.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var m=a[c],y=a[c+1],R=m[Jn]||null;if(typeof y=="function")R||vR(a);else if(R){var j=null;if(y&&y.hasAttribute("formAction")){if(m=y,R=y[Jn]||null)j=R.formAction;else if(By(m)!==null)continue}else j=R.action;typeof j=="function"?a[c+1]=j:(a.splice(c,3),c-=3),vR(a)}}}function bR(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(R){return m=R})},focusReset:"manual",scroll:"manual"})}function r(){m!==null&&(m(),m=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),m!==null&&(m(),m=null)}}}function Vy(n){this._internalRoot=n}rh.prototype.render=Vy.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(i(409));var a=r.current,c=ys();uR(a,c,n,r,null,null)},rh.prototype.unmount=Vy.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;uR(n.current,2,null,n,null,null),qf(),r[$a]=null}};function rh(n){this._internalRoot=n}rh.prototype.unstable_scheduleHydration=function(n){if(n){var r=aw();n={blockedOn:null,target:n,priority:r};for(var a=0;a<Zr.length&&r!==0&&r<Zr[a].priority;a++);Zr.splice(a,0,n),a===0&&gR(n)}};var xR=t.version;if(xR!=="19.3.1")throw Error(i(527,xR,"19.3.1"));me.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=h(r),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var U3={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oh.isDisabled&&oh.supportsFiber)try{be=oh.inject(U3),Ne=oh}catch{}}return Su.createRoot=function(n,r){if(!o(n))throw Error(i(299));var a=!1,c="",m=c1,y=u1,R=d1;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(R=r.onRecoverableError)),r=lR(n,1,!1,null,null,a,c,null,m,y,R,bR),n[$a]=r.current,yy(n),new Vy(r)},Su.hydrateRoot=function(n,r,a){if(!o(n))throw Error(i(299));var c=!1,m="",y=c1,R=u1,j=d1,U=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(R=a.onCaughtError),a.onRecoverableError!==void 0&&(j=a.onRecoverableError),a.formState!==void 0&&(U=a.formState)),r=lR(n,1,!0,r,a??null,c,m,U,y,R,j,bR),r.context=cR(null),a=r.current,c=ys(),c=gp(c),m=Ir(c),m.callback=null,Pr(a,m,c),a=c,r.current.lanes=a,Cr(r,a),vi(r),n[$a]=r.current,yy(n),new rh(r)},Su.version="19.3.1",Su}var gE;function N5(){if(gE)return ev.exports;gE=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(t){console.error(t)}}return e(),ev.exports=M5(),ev.exports}var O5=N5();const j5={"app.inbox":"Inbox","app.bots":"Bots","app.rooms":"Rooms","app.settings":"Settings","app.newBot":"New Bot","app.search":"Open command menu","app.searchPlaceholder":"Search conversations","app.collapseRail":"Collapse sidebar","app.expandRail":"Expand sidebar","app.noRooms":"No rooms yet.","app.noMatches":"Nothing matches that search.","app.noMessages":"No messages yet.","app.unreadRoom":"New messages in {name}","app.theme":"Theme: {theme}","app.waiting":"{count} waiting on you","app.unread":"{count} unread","landing.kicker":"Bot workbench","landing.title":"Pick up where you left off","landing.body":"Each Bot runs a complete Scream conversation in its workspace. Work together, exchange tasks and track progress here. Bots use the shared experience library.","landing.open":"Open {name}","landing.openFallback":"Open a Bot","landing.command":"K opens the command menu","composer.suggestion1":"Run the tests and fix what fails","composer.suggestion2":"List the Bots I can work with","composer.suggestion3":"Ask me what you need before you start","composer.placeholder":"Message {name}…","composer.paused":"{name} is paused","composer.waiting":"Waiting on your decision above","composer.hint":"Enter to send · Shift+Enter for a new line","composer.send":"Send","composer.mention":"Mention a Bot","composer.mentionsTitle":"Mention","composer.mentionsHint":"↑↓ choose · Enter insert · Esc close","composer.enterToSend":"Enter to send · Shift+Enter for a new line","composer.attach":"Attach files","composer.attaching":"Uploading {count}…","composer.removeAttachment":"Remove {name}","composer.tooManyFiles":"At most {max} files per message.","composer.uploadFailed":"That file could not be attached.","composer.stop":"Stop this run","composer.sendFailed":"The message was not confirmed. Your draft is still here.","composer.stopFailed":"Could not stop this run. Check its status before trying again.","composer.cancelQueued":"Cancel queued task","composer.cancelFailed":"Could not cancel the queued task.","composer.retry":"Retry","composer.steer":"Correct this run","composer.recoveredDraft":"An unconfirmed draft was recovered. Check the transcript before resending.","composer.unconfirmed":"This request may already have been accepted. Retry the same request to check it without creating another task; new text stays in your draft.","composer.retryRequest":"Retry original request","composer.unconfirmedText":"Unconfirmed request","composer.dismissRequest":"Keep draft and dismiss notice","transcript.loadFailed":"Could not load this conversation.","transcript.retry":"Retry","transcript.copyCode":"Copy code","transcript.copied":"Copied","transcript.copyFailed":"Copy failed","transcript.expand":"Show more","transcript.collapse":"Collapse","transcript.tools":"{count} tools","transcript.toolRenderFailed":"Could not display {name}.","transcript.input":"Input","transcript.output":"Output","transcript.runFailed":"This run failed","transcript.interrupted":"This run was interrupted","run.interrupted":"interrupted","connection.connected":"Connected","connection.connecting":"Connecting…","connection.reconnecting":"Reconnecting…","connection.offline":"Offline — changes will sync after reconnecting","connection.error":"Connection failed","connection.retryIn":"Retrying in {seconds}s","connection.disconnected":"Disconnected","connection.local":"Local preview","recovery.title":"Execution was interrupted","recovery.description":"Some actions may already have happened. This conversation's queue is paused until you decide.","recovery.continue":"Continue queued tasks","recovery.retry":"Run this task again","recovery.cancel":"Cancel queued tasks","recovery.retryConfirm":"This task may already have changed files or external systems. Run it again anyway?","recovery.failed":"Could not apply the recovery decision.","common.unknownTime":"Unknown time","files.root":"Workspace root","drawer.thread":"Conversation {id}","drawer.run":"Run {id}","palette.title":"Command menu","palette.description":"Jump to a Bot, a room, the inbox or settings.","palette.search":"Search Bots, rooms and pages…","palette.noMatches":"Nothing matches “{query}”.","palette.openRoom":"Open #{name}","palette.open":"Open {name}","palette.goTo":"Go to {name}","common.retry":"Retry","common.loading":"Loading…","common.loadFailed":"Could not load this content.","files.truncated":"Preview truncated. Only the beginning of this file is shown.","files.refresh":"Refresh","files.parent":"Parent directory","files.path":"Current directory","files.readFailed":"Could not read this file.","files.listFailed":"Could not list this directory.","room.missing":"That room does not exist.","room.loading":"Loading room…","room.loadFailed":"Could not load this room.","room.waiting":"Waiting for replies…","room.replying":"replying…","room.sending":"sending…","question.otherAria":"Other answer for {id}","question.expired":"This question expired. Your answers are kept.","question.answered":"Answers submitted","bot.settings.pending":"Saved — applies before the next run","bot.settings.applyFailed":"Saved, but not applied to this conversation","bot.settings.actualWorkspace":"This conversation uses {workspace}","bot.settings.workspaceNext":"A workspace change applies to new conversations. Existing conversations keep their directory.","bot.settings.identity":"Identity","bot.settings.identityPlaceholder":"🙂","bot.settings.identityHint":"Emoji and color appear on the avatar and on this Bot's message cards.","bot.settings.hue":"Identity color","bot.settings.huePreset":"Color {hue}","bot.settings.hueReset":"Use default","bot.settings.sharedMemory":"Bots use the shared Scream experience library; this is not private Bot memory.","transcript.working":"Working","transcript.start":"Start with {name}","transcript.loading":"Loading the transcript","inbox.title":"Inbox","inbox.description":"Every decision and every hand-off that is waiting on you, across all Bots.","inbox.needsYou":"Needs you","inbox.needsYouCount":"Needs you ({count})","inbox.empty":"Nothing is waiting on you. Bots keep working until something needs a person.","inbox.handoffs":"Hand-offs","inbox.handoffsDescription":"Work one Bot handed to another. The answer lands in the other Bot's thread.","inbox.noHandoffs":"No hand-off is in flight.","inbox.openThread":"Open thread","inbox.openRoom":"Open room","settings.title":"Settings","settings.description":"One person, one machine. These are the only preferences the workbench keeps.","settings.appearance":"Appearance","settings.language":"Language","settings.languageDescription":"The interface switches immediately and is remembered here.","settings.theme":"Theme","settings.themeDescription":"System follows your desktop. The choice is remembered in this browser.","settings.light":"Light","settings.dark":"Dark","settings.system":"System","settings.opens":"Where the workbench opens","settings.opensDescription":"It reopens on the Bot you last had on screen. Forgetting that returns you to the welcome page.","settings.forget":"Forget last Bot","settings.keyboard":"Keyboard","settings.command":"Command menu","settings.commandDescription":"Jump to a Bot, a room, the inbox or this page.","settings.composer":"Composer","settings.composerDescription":"Enter sends; Shift+Enter writes a new line.","settings.transport":"Transport","settings.dataSource":"Data source","settings.dataSourceDescription":"This build runs the UI against the local Bot gateway. Threads, approvals and hand-offs are persisted by the gateway.","settings.local":"local","settings.singleUser":"Single user","settings.singleUserDescription":"No sign-in, no teams. Every Bot in the rail belongs to this machine.","settings.footer":"Scream Bot","bot.new.title":"New Bot","bot.new.description":"A Bot gets its own thread, workspace and model. It can hand work to other Bots.","bot.new.name":"Name","bot.new.role":"Role","bot.new.workspace":"Workspace","bot.new.permissions":"Permissions","bot.new.instructions":"Instructions","bot.new.namePlaceholder":"Research","bot.new.rolePlaceholder":"Investigator","bot.new.workspacePlaceholder":"~/Projects/research","bot.new.instructionsPlaceholder":"What this Bot is for, and how it should behave.","bot.new.create":"Create Bot","bot.new.cancel":"Cancel","bot.permission.bot":"Safe — reversible actions only, risky ones refused","bot.permission.auto":"Full auto — allows everything, use with care","bot.settings.title":"Bot settings","bot.settings.delete":"Delete this Bot","bot.delete":"Delete {name}","bot.deleteConfirm":"Delete {name}? Its conversations and pending decisions go with it. This cannot be undone.","bot.settings.save":"Save","bot.settings.saveChanges":"Save changes","bot.settings.cancel":"Cancel","approval.allowOnce":"Allow once","approval.allowSession":"Allow for this session","approval.deny":"Deny","approval.feedback":"Tell the Bot why (optional)","approval.pending":"Waiting on you","approval.command":"{name} wants to run a command","approval.changeFile":"{name} wants to change a file","approval.useTool":"{name} wants to use {tool}","approval.asked":"Asked {time}","approval.expired":"expired","question.submit":"Submit answers","question.other":"Something else…","question.title":"{name} needs a decision","question.paused":"the run is paused until you answer","question.many":"{count} questions","room.empty":"Nothing said yet. Mention a Bot with @name.","room.placeholder":"Message #{room} — @{bot} to address one Bot","room.send":"Send","room.new":"New room","room.newDescription":"A room is a shared transcript. Pick the Bots; @name chooses who answers.","room.name":"Room name","room.namePlaceholder":"project-room","room.members":"Members","room.membersHint":"At least one Bot. Without @, the lead Bot answers.","room.leadLabel":"Lead Bot","room.create":"Create room","room.creating":"Creating…","room.cancel":"Cancel","room.delete":"Delete room","room.deleteConfirm":"Delete this room and its shared transcript? This cannot be undone.","status.idle":"Idle","status.working":"Working","status.needs_you":"Needs you","status.paused":"Paused","status.error":"Error","cockpit.details":"Details","cockpit.openNav":"Open sidebar","cockpit.noThread":"No thread","cockpit.newConversation":"New conversation","cockpit.inbox":"Inbox","cockpit.botSettings":"Bot settings","cockpit.resumeBot":"Resume Bot","cockpit.pauseBot":"Pause Bot","cockpit.missing":"That Bot does not exist.","thread.delete":"Delete conversation","thread.deleteConfirm":"Delete this conversation? Its messages disappear from the workbench. This cannot be undone.","cockpit.activity":"Activity","cockpit.approvals":"Approvals","cockpit.files":"Files","drawer.empty":"Nothing has happened in this Bot yet.","drawer.notWaiting":"{name} is not waiting on you.","drawer.coreSession":"core session","drawer.loading":"Loading…","drawer.files":"Files","drawer.emptyWorkspace":"This workspace is empty.","transcript.scrollEnd":"Scroll to end","transcript.scrollStart":"Scroll to start","run.queued":"queued","run.running":"running","run.waiting_user":"waiting on you","run.done":"done","run.failed":"failed","run.cancelled":"cancelled","actor.person":"You","actor.system":"System","audit.botCreated":"Bot created","audit.botUpdated":"Bot updated","audit.botDeleted":"Bot deleted","audit.botPaused":"Bot paused","audit.botResumed":"Bot resumed","audit.runStarted":"Run started","audit.runDone":"Run done","audit.runFailed":"Run failed","audit.runInterrupted":"Run interrupted","audit.messagePrompted":"Message prompted","audit.threadCreated":"Thread created","audit.approvalRequested":"Approval requested","audit.approvalDecided":"Approval decided","audit.approvalExpired":"Approval expired","audit.questionRequested":"Question asked","audit.questionAnswered":"Question answered","audit.questionExpired":"Question expired","bot.new.creating":"Creating…","bot.new.roleHint":"One line, shown under the name in the rail.","bot.new.workspaceHint":"Default directory for new conversations. Tool access follows the selected permission mode.","bot.settings.description":"The Bot's identity, its workspace and what it may do without asking.","bot.settings.workspaceHint":"Changes apply to new conversations; existing conversations keep their directory. This is not a sandbox.","bot.settings.pausedTitle":"This Bot is paused","bot.settings.pauseTitle":"Pause this Bot","bot.settings.pauseDescription":"Pausing stops new runs. Threads and pending decisions stay where they are.","bot.settings.resume":"Resume","bot.settings.pause":"Pause","bot.settings.deleteDescription":"Its threads and pending decisions go with it. The workbench keeps at least one Bot.","bot.settings.deletePermanently":"Delete permanently","bot.settings.deleting":"Deleting…","bot.settings.deleteTrigger":"Delete…","bot.settings.saving":"Saving…","question.one":"One question","question.sending":"Sending…","room.lead":"{name} leads","room.noLead":"No lead Bot","room.shared":"shared transcript","room.you":"You","room.bot":"Bot","room.removedMember":"Removed member","room.viaHandoff":"via hand-off","room.messageAria":"Message #{room}","handoff.handedTo":"Handed to {name}","handoff.anotherBot":"another Bot","handoff.delivered":"Answered","handoff.failed":"Did not come back","handoff.queued":"Queued","handoff.refused":"Refused","handoff.running":"Working on it","handoff.awaiting_relay":"Answered — waiting to relay","handoff.interrupted":"Interrupted — needs confirmation","handoff.cancelled":"Cancelled","handoff.deliveredNote":"{name} answered in their own conversation; the result was relayed here.","handoff.open":"Open thread"},D5={"app.inbox":"收件箱","app.bots":"Bot","app.rooms":"群聊","app.settings":"设置","app.newBot":"新建 Bot","app.search":"打开命令菜单","app.searchPlaceholder":"搜索会话","app.collapseRail":"收起侧栏","app.expandRail":"展开侧栏","app.noRooms":"还没有群聊。","app.noMatches":"没有匹配的会话。","app.noMessages":"暂无消息。","app.unreadRoom":"{name} 有新消息","app.theme":"主题:{theme}","app.waiting":"{count} 项等你处理","app.unread":"{count} 条未读","landing.kicker":"Bot 工作台","landing.title":"从上次的地方继续","landing.body":"每个 Bot 在自己的工作区运行完整的 Scream 会话。在这里沟通、交接任务并查看进度;经验库由 Bot 共享。","landing.open":"打开 {name}","landing.openFallback":"打开一个 Bot","landing.command":"按 K 打开命令菜单","composer.suggestion1":"跑一遍测试,把失败的修掉","composer.suggestion2":"看看有哪些可以协作的 Bot","composer.suggestion3":"开始前先问我还需要什么","composer.placeholder":"给 {name} 发消息…","composer.paused":"{name} 已暂停","composer.waiting":"等你先处理上面的决定","composer.hint":"Enter 发送 · Shift+Enter 换行","composer.send":"发送","composer.mention":"提及 Bot","composer.mentionsTitle":"提及","composer.mentionsHint":"↑↓ 选择 · Enter 插入 · Esc 关闭","composer.enterToSend":"Enter 发送 · Shift+Enter 换行","composer.attach":"添加文件","composer.attaching":"正在上传 {count} 个…","composer.removeAttachment":"移除 {name}","composer.tooManyFiles":"每条消息最多 {max} 个文件。","composer.uploadFailed":"文件未能添加。","composer.stop":"停止本次运行","composer.sendFailed":"消息尚未确认接收,草稿已保留。","composer.stopFailed":"未能停止本次运行,请核对任务状态后重试。","composer.cancelQueued":"取消排队任务","composer.cancelFailed":"未能取消排队任务。","composer.retry":"重试","composer.steer":"纠正当前任务","composer.recoveredDraft":"已恢复未确认接收的草稿,请先核对会话记录再发送。","composer.unconfirmed":"此请求可能已被接收。使用原请求重试可避免创建重复任务,新输入仍保留在草稿中。","composer.retryRequest":"重试原请求","composer.unconfirmedText":"未确认请求","composer.dismissRequest":"保留草稿并关闭提示","transcript.loadFailed":"无法加载会话记录。","transcript.retry":"重试","transcript.copyCode":"复制代码","transcript.copied":"已复制","transcript.copyFailed":"复制失败","transcript.expand":"展开更多","transcript.collapse":"收起","transcript.tools":"{count} 个工具","transcript.toolRenderFailed":"无法显示 {name}。","transcript.input":"输入","transcript.output":"输出","transcript.runFailed":"本次运行失败","transcript.interrupted":"本次运行已中断","run.interrupted":"已中断","connection.connected":"已连接","connection.connecting":"正在连接…","connection.reconnecting":"正在重连…","connection.offline":"连接已断开,重连后将同步状态","connection.error":"连接失败","connection.retryIn":"{seconds} 秒后重试","connection.disconnected":"连接已断开","connection.local":"本地预览","recovery.title":"执行已中断","recovery.description":"部分操作可能已经发生。本会话的后续队列已暂停,等待你确认。","recovery.continue":"继续后续排队任务","recovery.retry":"重新执行此任务","recovery.cancel":"取消后续排队任务","recovery.retryConfirm":"此任务可能已修改文件或外部系统,仍要重新执行吗?","recovery.failed":"未能应用恢复决定。","common.unknownTime":"时间未知","files.root":"工作区根目录","drawer.thread":"会话 {id}","drawer.run":"任务 {id}","palette.title":"命令菜单","palette.description":"跳转到 Bot、群聊、收件箱或设置。","palette.search":"搜索 Bot、群聊和页面…","palette.noMatches":"没有匹配“{query}”的结果。","palette.openRoom":"打开 #{name}","palette.open":"打开 {name}","palette.goTo":"前往{name}","common.retry":"重试","common.loading":"正在加载…","common.loadFailed":"无法加载内容。","files.truncated":"预览已截断,仅显示文件开头部分。","files.refresh":"刷新","files.parent":"上级目录","files.path":"当前目录","files.readFailed":"无法读取文件。","files.listFailed":"无法列出此目录。","room.missing":"这个群聊不存在。","room.loading":"正在加载群聊…","room.loadFailed":"无法加载群聊。","room.waiting":"正在等待回复…","room.replying":"正在回复…","room.sending":"发送中…","question.otherAria":"问题 {id} 的自定义答案","question.expired":"问题已过期,你的答案已保留。","question.answered":"答案已提交","bot.settings.pending":"已保存,将在下次运行前应用","bot.settings.applyFailed":"已保存,但尚未应用到此会话","bot.settings.actualWorkspace":"本会话使用 {workspace}","bot.settings.workspaceNext":"工作区变更仅用于新会话,已有会话保留原目录。","bot.settings.identity":"身份标识","bot.settings.identityPlaceholder":"🙂","bot.settings.identityHint":"Emoji 与颜色会用于头像以及该 Bot 的消息卡片。","bot.settings.hue":"身份色","bot.settings.huePreset":"颜色 {hue}","bot.settings.hueReset":"使用默认","bot.settings.sharedMemory":"Bot 使用 Scream 共享经验库,不是每个 Bot 的私有记忆。","transcript.working":"工作中","transcript.start":"和 {name} 开始","transcript.loading":"正在加载会话","inbox.title":"收件箱","inbox.description":"所有 Bot 等你做的决定和等你接手的转交。","inbox.needsYou":"需要你","inbox.needsYouCount":"需要你({count})","inbox.empty":"现在没有等你的事。Bot 会继续工作,直到需要人介入。","inbox.handoffs":"转交","inbox.handoffsDescription":"一个 Bot 交给另一个 Bot 的活,答案会落在对方的会话里。","inbox.noHandoffs":"没有进行中的转交。","inbox.openThread":"打开会话","inbox.openRoom":"打开群聊","settings.title":"设置","settings.description":"一个人,一台机器。工作台只记住这些偏好。","settings.appearance":"外观","settings.language":"语言","settings.languageDescription":"切换后立即生效,并记住在这台浏览器里。","settings.theme":"主题","settings.themeDescription":"跟随系统会使用桌面主题;选择会记在这个浏览器里。","settings.light":"浅色","settings.dark":"深色","settings.system":"跟随系统","settings.opens":"工作台从哪打开","settings.opensDescription":"下次打开会回到你最后停留的 Bot;忘记后回到欢迎页。","settings.forget":"忘记上一个 Bot","settings.keyboard":"键盘","settings.command":"命令菜单","settings.commandDescription":"跳转到 Bot、群聊、收件箱或本页。","settings.composer":"输入框","settings.composerDescription":"Enter 发送;Shift+Enter 换行。","settings.transport":"连接","settings.dataSource":"数据源","settings.dataSourceDescription":"当前界面连接本地 Bot 网关;会话、审批和转交都由网关持久化保存。","settings.local":"本地","settings.singleUser":"单用户","settings.singleUserDescription":"没有登录,没有团队。侧栏里的每个 Bot 都属于这台机器。","settings.footer":"Scream Bot","bot.new.title":"新建 Bot","bot.new.description":"每个 Bot 有自己的会话、工作区和模型,也可以把活交给别的 Bot。","bot.new.name":"名字","bot.new.role":"职位","bot.new.workspace":"工作区","bot.new.permissions":"权限","bot.new.instructions":"角色说明","bot.new.namePlaceholder":"Research","bot.new.rolePlaceholder":"调查员","bot.new.workspacePlaceholder":"~/Projects/research","bot.new.instructionsPlaceholder":"这个 Bot 负责什么,以及它应该怎么工作。","bot.new.create":"创建 Bot","bot.new.cancel":"取消","bot.permission.bot":"安全 —— 只做可逆操作,危险操作直接拒绝","bot.permission.auto":"全自动 —— 放行一切,谨慎使用","bot.settings.title":"Bot 设置","bot.settings.delete":"删除这个 Bot","bot.delete":"删除 {name}","bot.deleteConfirm":"删除 {name}?它的会话和待处理决定会一起删除,无法恢复。","bot.settings.save":"保存","bot.settings.saveChanges":"保存修改","bot.settings.cancel":"取消","approval.allowOnce":"允许一次","approval.allowSession":"本会话允许","approval.deny":"拒绝","approval.feedback":"告诉 Bot 原因(可选)","approval.pending":"等你处理","approval.command":"{name} 想执行一条命令","approval.changeFile":"{name} 想改一个文件","approval.useTool":"{name} 想使用 {tool}","approval.asked":"{time} 请求","approval.expired":"已过期","question.submit":"提交答案","question.other":"其他…","question.title":"{name} 需要你决定","question.paused":"你回答前,这次运行会暂停","question.many":"{count} 个问题","room.empty":"还没有人说话。用 @名字 叫一个 Bot。","room.placeholder":"发到 #{room} — 用 @{bot} 指定一个 Bot","room.send":"发送","room.new":"新建群聊","room.newDescription":"群聊是一份共享会话记录。选成员;用 @名字 指定谁回答。","room.name":"群聊名称","room.namePlaceholder":"project-room","room.members":"成员","room.membersHint":"至少一个 Bot。不写 @ 时由负责的 Bot 回答。","room.leadLabel":"负责的 Bot","room.create":"创建群聊","room.creating":"创建中…","room.cancel":"取消","room.delete":"删除群聊","room.deleteConfirm":"删除这个群聊和共享记录?无法恢复。","status.idle":"空闲","status.working":"工作中","status.needs_you":"需要你","status.paused":"已暂停","status.error":"出错","cockpit.details":"详情","cockpit.openNav":"打开侧栏","cockpit.noThread":"没有会话","cockpit.newConversation":"新会话","cockpit.inbox":"收件箱","cockpit.botSettings":"Bot 设置","cockpit.resumeBot":"恢复 Bot","cockpit.pauseBot":"暂停 Bot","cockpit.missing":"这个 Bot 不存在。","thread.delete":"删除会话","thread.deleteConfirm":"删除这个会话?消息会从工作台消失,无法恢复。","cockpit.activity":"动态","cockpit.approvals":"审批","cockpit.files":"文件","drawer.empty":"这个 Bot 还没有任何动静。","drawer.notWaiting":"{name} 没有等你处理的事。","drawer.coreSession":"核心会话","drawer.loading":"加载中…","drawer.files":"文件","drawer.emptyWorkspace":"这个工作区还是空的。","transcript.scrollEnd":"回到底部","transcript.scrollStart":"回到顶部","run.queued":"排队中","run.running":"运行中","run.waiting_user":"等你决定","run.done":"已完成","run.failed":"失败","run.cancelled":"已取消","actor.person":"你","actor.system":"系统","audit.botCreated":"创建 Bot","audit.botUpdated":"更新 Bot","audit.botDeleted":"删除 Bot","audit.botPaused":"暂停 Bot","audit.botResumed":"恢复 Bot","audit.runStarted":"开始运行","audit.runDone":"运行完成","audit.runFailed":"运行失败","audit.runInterrupted":"运行中断","audit.messagePrompted":"发送消息","audit.threadCreated":"新建会话","audit.approvalRequested":"请求审批","audit.approvalDecided":"审批决定","audit.approvalExpired":"审批过期","audit.questionRequested":"提出问题","audit.questionAnswered":"回答问题","audit.questionExpired":"问题过期","bot.new.creating":"创建中…","bot.new.roleHint":"一行字,显示在侧栏名字下面。","bot.new.workspaceHint":"新会话的默认目录;工具访问范围由所选权限模式决定。","bot.settings.description":"Bot 的身份、工作区,以及哪些事可以不问就做。","bot.settings.workspaceHint":"变更仅用于新会话,已有会话保留原目录。工作区不是隔离沙箱。","bot.settings.pausedTitle":"这个 Bot 已暂停","bot.settings.pauseTitle":"暂停这个 Bot","bot.settings.pauseDescription":"暂停会停止新的运行;会话和待处理的决定都保留。","bot.settings.resume":"恢复","bot.settings.pause":"暂停","bot.settings.deleteDescription":"会话和待处理的决定会一起删除。工作台至少保留一个 Bot。","bot.settings.deletePermanently":"永久删除","bot.settings.deleting":"删除中…","bot.settings.deleteTrigger":"删除…","bot.settings.saving":"保存中…","question.one":"一个问题","question.sending":"提交中…","room.lead":"{name} 负责","room.noLead":"没有负责的 Bot","room.shared":"共享会话记录","room.you":"你","room.bot":"Bot","room.removedMember":"已移除的成员","room.viaHandoff":"转交","room.messageAria":"发到 #{room}","handoff.handedTo":"已交给 {name}","handoff.anotherBot":"另一个 Bot","handoff.delivered":"已回答","handoff.failed":"没回来","handoff.queued":"排队中","handoff.refused":"已拒绝","handoff.running":"处理中","handoff.awaiting_relay":"已回答,等待回传","handoff.interrupted":"已中断,等待确认","handoff.cancelled":"已取消","handoff.deliveredNote":"{name} 在自己的会话中完成了回答,结果已回传到这里。","handoff.open":"打开会话"},_5={en:j5,zh:D5},hk="scream.bot.lang";function I5(){if(typeof localStorage<"u"){const e=localStorage.getItem(hk);if(e==="zh"||e==="en")return e}return typeof navigator<"u"&&navigator.language.toLowerCase().startsWith("zh")?"zh":"en"}function P5(e,t){return t?e.replace(/\{(\w+)\}/g,(s,i)=>i in t?String(t[i]):s):e}const mk=E.createContext(null);function z5({children:e}){const[t,s]=E.useState(()=>I5());E.useEffect(()=>{document.documentElement.lang=t==="zh"?"zh-CN":"en";try{localStorage.setItem(hk,t)}catch{}},[t]);const i=E.useMemo(()=>({lang:t,setLang:s,t:(o,l)=>P5(_5[t][o],l)}),[t]);return v.jsx(mk.Provider,{value:i,children:e})}function mt(){const e=E.useContext(mk);if(e===null)throw new Error("useI18n must be used inside I18nProvider");return e}function gx(){const{lang:e,setLang:t}=mt(),s="rounded-md px-1.5 py-0.5 text-[11px] transition-colors border border-border";return v.jsxs("div",{className:"flex items-center gap-1",role:"group","aria-label":"Language / 语言",children:[v.jsx("button",{"aria-pressed":e==="zh",className:`${s} ${e==="zh"?"bg-sidebar-accent text-foreground":"text-muted-foreground"}`,onClick:()=>t("zh"),type:"button",children:"中文"}),v.jsx("button",{"aria-pressed":e==="en",className:`${s} ${e==="en"?"bg-sidebar-accent text-foreground":"text-muted-foreground"}`,onClick:()=>t("en"),type:"button",children:"EN"})]})}const L5=new SI({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:0}}});function B5(){return v.jsx("div",{className:"flex h-svh items-center justify-center bg-background p-8",children:v.jsx("div",{className:"text-center",children:v.jsx("p",{className:"text-muted-foreground text-sm",children:"That page does not exist."})})})}function U5(){return v.jsx(px,{})}const pk=h5({component:U5,notFoundComponent:B5});/**
67
- * @license @tabler/icons-react v3.49.0 - MIT
68
- *
69
- * This source code is licensed under the MIT license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */var V5={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
72
- * @license @tabler/icons-react v3.49.0 - MIT
73
- *
74
- * This source code is licensed under the MIT license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const xt=(e,t,s,i)=>{const o=E.forwardRef(({color:l="currentColor",size:u=24,stroke:d=2,title:f,className:h,children:p,...g},b)=>E.createElement("svg",{ref:b,...V5[e],width:u,height:u,className:["tabler-icon",`tabler-icon-${t}`,h].filter(Boolean).join(" "),strokeWidth:d,stroke:l,...g},[f&&E.createElement("title",{key:"svg-title"},f),...i.map(([w,x])=>E.createElement(w,x)),...Array.isArray(p)?p:[p]]));return o.displayName=`${s}`,o};/**
77
- * @license @tabler/icons-react v3.49.0 - MIT
78
- *
79
- * This source code is licensed under the MIT license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const F5=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]],yE=xt("outline","arrow-left","ArrowLeft",F5);/**
82
- * @license @tabler/icons-react v3.49.0 - MIT
83
- *
84
- * This source code is licensed under the MIT license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const q5=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]],vE=xt("outline","arrow-right","ArrowRight",q5);/**
87
- * @license @tabler/icons-react v3.49.0 - MIT
88
- *
89
- * This source code is licensed under the MIT license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const H5=[["path",{d:"M17 7l-10 10",key:"svg-0"}],["path",{d:"M8 7l9 0l0 9",key:"svg-1"}]],ob=xt("outline","arrow-up-right","ArrowUpRight",H5);/**
92
- * @license @tabler/icons-react v3.49.0 - MIT
93
- *
94
- * This source code is licensed under the MIT license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const G5=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],gk=xt("outline","arrow-up","ArrowUp",G5);/**
97
- * @license @tabler/icons-react v3.49.0 - MIT
98
- *
99
- * This source code is licensed under the MIT license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const K5=[["path",{d:"M7 10h14l-4 -4",key:"svg-0"}],["path",{d:"M17 14h-14l4 4",key:"svg-1"}]],Y5=xt("outline","arrows-exchange","ArrowsExchange",K5);/**
102
- * @license @tabler/icons-react v3.49.0 - MIT
103
- *
104
- * This source code is licensed under the MIT license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const $5=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],yk=xt("outline","check","Check",$5);/**
107
- * @license @tabler/icons-react v3.49.0 - MIT
108
- *
109
- * This source code is licensed under the MIT license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const Q5=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],X5=xt("outline","chevron-down","ChevronDown",Q5);/**
112
- * @license @tabler/icons-react v3.49.0 - MIT
113
- *
114
- * This source code is licensed under the MIT license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const Z5=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],W5=xt("outline","chevron-left","ChevronLeft",Z5);/**
117
- * @license @tabler/icons-react v3.49.0 - MIT
118
- *
119
- * This source code is licensed under the MIT license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const J5=[["path",{d:"M7 9a2 2 0 1 1 2 -2v10a2 2 0 1 1 -2 -2h10a2 2 0 1 1 -2 2v-10a2 2 0 1 1 2 2h-10",key:"svg-0"}]],ez=xt("outline","command","Command",J5);/**
122
- * @license @tabler/icons-react v3.49.0 - MIT
123
- *
124
- * This source code is licensed under the MIT license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const tz=[["path",{d:"M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4",key:"svg-0"}]],nz=xt("outline","corner-down-left","CornerDownLeft",tz);/**
127
- * @license @tabler/icons-react v3.49.0 - MIT
128
- *
129
- * This source code is licensed under the MIT license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const sz=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]],iz=xt("outline","file-text","FileText",sz);/**
132
- * @license @tabler/icons-react v3.49.0 - MIT
133
- *
134
- * This source code is licensed under the MIT license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const rz=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],oz=xt("outline","folder","Folder",rz);/**
137
- * @license @tabler/icons-react v3.49.0 - MIT
138
- *
139
- * This source code is licensed under the MIT license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const az=[["path",{d:"M5 9l14 0",key:"svg-0"}],["path",{d:"M5 15l14 0",key:"svg-1"}],["path",{d:"M11 4l-4 16",key:"svg-2"}],["path",{d:"M17 4l-4 16",key:"svg-3"}]],vk=xt("outline","hash","Hash",az);/**
142
- * @license @tabler/icons-react v3.49.0 - MIT
143
- *
144
- * This source code is licensed under the MIT license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const lz=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M4 13h3l3 3h4l3 -3h3",key:"svg-1"}]],bk=xt("outline","inbox","Inbox",lz);/**
147
- * @license @tabler/icons-react v3.49.0 - MIT
148
- *
149
- * This source code is licensed under the MIT license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const cz=[["path",{d:"M2 8a2 2 0 0 1 2 -2h16a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-16a2 2 0 0 1 -2 -2l0 -8",key:"svg-0"}],["path",{d:"M6 10l0 .01",key:"svg-1"}],["path",{d:"M10 10l0 .01",key:"svg-2"}],["path",{d:"M14 10l0 .01",key:"svg-3"}],["path",{d:"M18 10l0 .01",key:"svg-4"}],["path",{d:"M6 14l0 .01",key:"svg-5"}],["path",{d:"M18 14l0 .01",key:"svg-6"}],["path",{d:"M10 14l4 .01",key:"svg-7"}]],uz=xt("outline","keyboard","Keyboard",cz);/**
152
- * @license @tabler/icons-react v3.49.0 - MIT
153
- *
154
- * This source code is licensed under the MIT license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const dz=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M15 4l0 16",key:"svg-1"}]],fz=xt("outline","layout-sidebar-right","LayoutSidebarRight",dz);/**
157
- * @license @tabler/icons-react v3.49.0 - MIT
158
- *
159
- * This source code is licensed under the MIT license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const hz=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M9 4l0 16",key:"svg-1"}]],Td=xt("outline","layout-sidebar","LayoutSidebar",hz);/**
162
- * @license @tabler/icons-react v3.49.0 - MIT
163
- *
164
- * This source code is licensed under the MIT license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const mz=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M14 18h-1l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v4.5",key:"svg-2"}],["path",{d:"M19 22v.01",key:"svg-3"}],["path",{d:"M19 19a2.003 2.003 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483",key:"svg-4"}]],pz=xt("outline","message-question","MessageQuestion",mz);/**
167
- * @license @tabler/icons-react v3.49.0 - MIT
168
- *
169
- * This source code is licensed under the MIT license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const gz=[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008",key:"svg-0"}]],xk=xt("outline","moon","Moon",gz);/**
172
- * @license @tabler/icons-react v3.49.0 - MIT
173
- *
174
- * This source code is licensed under the MIT license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const yz=[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]],Zu=xt("outline","paperclip","Paperclip",yz);/**
177
- * @license @tabler/icons-react v3.49.0 - MIT
178
- *
179
- * This source code is licensed under the MIT license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const vz=[["path",{d:"M6 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12",key:"svg-0"}],["path",{d:"M14 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12",key:"svg-1"}]],bE=xt("outline","player-pause","PlayerPause",vz);/**
182
- * @license @tabler/icons-react v3.49.0 - MIT
183
- *
184
- * This source code is licensed under the MIT license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const bz=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],wk=xt("outline","player-play","PlayerPlay",bz);/**
187
- * @license @tabler/icons-react v3.49.0 - MIT
188
- *
189
- * This source code is licensed under the MIT license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const xz=[["path",{d:"M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10",key:"svg-0"}]],wz=xt("outline","player-stop","PlayerStop",xz);/**
192
- * @license @tabler/icons-react v3.49.0 - MIT
193
- *
194
- * This source code is licensed under the MIT license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const Sz=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],rm=xt("outline","plus","Plus",Sz);/**
197
- * @license @tabler/icons-react v3.49.0 - MIT
198
- *
199
- * This source code is licensed under the MIT license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const Tz=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],Sk=xt("outline","search","Search",Tz);/**
202
- * @license @tabler/icons-react v3.49.0 - MIT
203
- *
204
- * This source code is licensed under the MIT license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const Rz=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],Tk=xt("outline","settings","Settings",Rz);/**
207
- * @license @tabler/icons-react v3.49.0 - MIT
208
- *
209
- * This source code is licensed under the MIT license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const Ez=[["path",{d:"M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]],Cz=xt("outline","shield-check","ShieldCheck",Ez);/**
212
- * @license @tabler/icons-react v3.49.0 - MIT
213
- *
214
- * This source code is licensed under the MIT license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const Az=[["path",{d:"M15.065 19.732c-.95 .557 -1.98 .986 -3.065 1.268a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3c.51 1.738 .617 3.55 .333 5.303",key:"svg-0"}],["path",{d:"M19 22v.01",key:"svg-1"}],["path",{d:"M19 19a2.003 2.003 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483",key:"svg-2"}]],Rk=xt("outline","shield-question","ShieldQuestion",Az);/**
217
- * @license @tabler/icons-react v3.49.0 - MIT
218
- *
219
- * This source code is licensed under the MIT license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const kz=[["path",{d:"M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]],Ek=xt("outline","sun","Sun",kz);/**
222
- * @license @tabler/icons-react v3.49.0 - MIT
223
- *
224
- * This source code is licensed under the MIT license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const Mz=[["path",{d:"M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5",key:"svg-0"}]],Nz=xt("outline","tool","Tool",Mz);/**
227
- * @license @tabler/icons-react v3.49.0 - MIT
228
- *
229
- * This source code is licensed under the MIT license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const Oz=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],yx=xt("outline","trash","Trash",Oz);/**
232
- * @license @tabler/icons-react v3.49.0 - MIT
233
- *
234
- * This source code is licensed under the MIT license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const jz=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Sc=xt("outline","x","X",jz);function Ck(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return t>>>0}function Dz(e){let t=e.value;return t^=t<<13,t^=t>>>17,t^=t<<5,e.value=t>>>0,e.value/4294967295}function Wu(e){return Ck(e)%360}function Bs({name:e,seed:t,size:s=40,emoji:i,hue:o}){const l=Ck(t),u={value:l||1},d=o??l%360;if(i!=null&&i.length>0)return v.jsx("span",{"aria-label":e,className:"avatar-emoji inline-flex shrink-0 items-center justify-center rounded-full ring-1 ring-black/5 dark:ring-white/10",role:"img",style:{height:s,width:s,"--avatar-hue":String(d)},children:v.jsx("span",{style:{fontSize:Math.max(10,Math.round(s*.5)),lineHeight:1},children:i})});const f=[`hsl(${d} 58% 88%)`,`hsl(${(d+28)%360} 52% 58%)`,`hsl(${(d+210)%360} 45% 34%)`],h=[];for(let p=0;p<5;p+=1)for(let g=0;g<3;g+=1){const b=Dz(u);if(b<.45)continue;const w=f[Math.floor(b*10)%f.length]??f[0];h.push({color:w??f[0]??"#888",x:g,y:p}),g<2&&h.push({color:w??f[0]??"#888",x:4-g,y:p})}return v.jsx("span",{"aria-label":e,className:"inline-flex shrink-0 overflow-hidden rounded-full bg-muted ring-1 ring-black/5 dark:ring-white/10",role:"img",style:{height:s,width:s},children:v.jsxs("svg",{"aria-hidden":"true",height:s,viewBox:"0 0 5 5",width:s,xmlns:"http://www.w3.org/2000/svg",children:[v.jsx("rect",{fill:f[0],height:"5",width:"5"}),h.map((p,g)=>v.jsx("rect",{fill:p.color,height:"1",width:"1",x:p.x,y:p.y},`${p.x}-${p.y}-${g}`))]})})}function Um(){return typeof window<"u"}function Dn(e){return vx(e)?(e.nodeName||"").toLowerCase():"#document"}function $t(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wr(e){var t;return(t=(vx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vx(e){return Um()?e instanceof Node||e instanceof $t(e).Node:!1}function bt(e){return Um()?e instanceof Element||e instanceof $t(e).Element:!1}function Bt(e){return Um()?e instanceof HTMLElement||e instanceof $t(e).HTMLElement:!1}function ka(e){return!Um()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $t(e).ShadowRoot}function Rd(e){const{overflow:t,overflowX:s,overflowY:i,display:o}=Ss(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+s)&&o!=="inline"&&o!=="contents"}function _z(e){return/^(table|td|th)$/.test(Dn(e))}function Vm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Iz=/transform|translate|scale|rotate|perspective|filter/,Pz=/paint|layout|strict|content/,ta=e=>!!e&&e!=="none";let iv;function bx(e){const t=bt(e)?Ss(e):e;return ta(t.transform)||ta(t.translate)||ta(t.scale)||ta(t.rotate)||ta(t.perspective)||!xx()&&(ta(t.backdropFilter)||ta(t.filter))||Iz.test(t.willChange||"")||Pz.test(t.contain||"")}function zz(e){let t=vr(e);for(;Bt(t)&&!pr(t);){if(bx(t))return t;if(Vm(t))return null;t=vr(t)}return null}function xx(){return iv==null&&(iv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),iv}function pr(e){return/^(html|body|#document)$/.test(Dn(e))}function Ss(e){return $t(e).getComputedStyle(e)}function Fm(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vr(e){if(Dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ka(e)&&e.host||wr(e);return ka(t)?t.host:t}function Ak(e){const t=vr(e);return pr(t)?(e.ownerDocument||e).body:Bt(t)&&Rd(t)?t:Ak(t)}function Ju(e,t,s){var i;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=Ak(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=$t(o);if(l){const d=ab(u);return t.concat(u,u.visualViewport||[],Rd(o)?o:[],d&&s?Ju(d):[])}else return t.concat(o,Ju(o,[],s))}function ab(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const wx={...Q3},xE={};function bn(e,t){const s=E.useRef(xE);return s.current===xE&&(s.current=e(t)),s}const rv=wx.useInsertionEffect,Lz=rv&&rv!==wx.useLayoutEffect?rv:e=>e();function Le(e){const t=bn(Bz).current;return t.next=e,Lz(t.effect),t.trampoline}function Bz(){const e={next:void 0,callback:Uz,trampoline:(...t)=>{var s;return(s=e.callback)==null?void 0:s.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Uz(){}const Vz=()=>{},Me=typeof document<"u"?E.useLayoutEffect:Vz;function lb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const kk={};function Di(e,t,s,i,o){if(!s&&!i&&!o&&!e)return om(t);let l=om(e);return t&&(l=ju(l,t)),s&&(l=ju(l,s)),i&&(l=ju(l,i)),o&&(l=ju(l,o)),l}function Fz(e){if(e.length===0)return kk;if(e.length===1)return om(e[0]);let t=om(e[0]);for(let s=1;s<e.length;s+=1)t=ju(t,e[s]);return t}function om(e){return Nk(e)?{...e(kk)}:qz(e)}function ju(e,t){return Nk(t)?t(e):Hz(e,t)}function qz(e){const t={...e};for(const s in t){const i=t[s];Mk(s,i)&&(t[s]=Ok(i))}return t}function Hz(e,t){if(!t)return e;for(const s in t){const i=t[s];switch(s){case"style":{e[s]=lb(e.style,i);break}case"className":{e[s]=jk(e.className,i);break}default:Mk(s,i)?e[s]=Gz(e[s],i):e[s]=i}}return e}function Mk(e,t){const s=e.charCodeAt(0),i=e.charCodeAt(1),o=e.charCodeAt(2);return s===111&&i===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Nk(e){return typeof e=="function"}function Gz(e,t){return t?e?(...s)=>{const i=s[0];if(Dk(i)){const l=i;am(l);const u=t(...s);return l.baseUIHandlerPrevented||e==null||e(...s),u}const o=t(...s);return e==null||e(...s),o}:Ok(t):e}function Ok(e){return e&&((...t)=>{const s=t[0];return Dk(s)&&am(s),e(...t)})}function am(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function jk(e,t){return t?e?t+" "+e:t:e}function Dk(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Kz(e,t){return function(i,...o){const l=new URL(e);return l.searchParams.set("code",i.toString()),o.forEach(u=>l.searchParams.append("args[]",u)),`${t} error #${i}; visit ${l} for the full message.`}}const Ts=Kz("https://base-ui.com/production-error","Base UI"),Yz=E.createContext(void 0);function Sx(e=!1){const t=E.useContext(Yz);if(t===void 0&&!e)throw new Error(Ts(16));return t}function $z(e){const{focusableWhenDisabled:t,disabled:s,composite:i=!1,tabIndex:o=0,isNativeButton:l}=e,u=i&&t!==!1,d=i&&t===!1;return{props:E.useMemo(()=>{const h={onKeyDown(p){s&&t&&p.key!=="Tab"&&p.preventDefault()}};return i||(h.tabIndex=o,!l&&s&&(h.tabIndex=t?o:-1)),(l&&(t||u)||!l&&s)&&(h["aria-disabled"]=s),l&&(!t||d)&&(h.disabled=s),h},[i,s,t,u,d,l,o])}}function vt(e){return(e==null?void 0:e.ownerDocument)||document}function Fh(e,t,{detail:s=0,pointerType:i=""}={}){e.dispatchEvent(new($t(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:s,pointerType:i,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function qm(e={}){const{disabled:t=!1,focusableWhenDisabled:s,tabIndex:i=0,native:o=!0,composite:l}=e,u=E.useRef(null),d=Sx(!0),f=l??d!==void 0,{props:h}=$z({focusableWhenDisabled:s,disabled:t,composite:f,tabIndex:i,isNativeButton:o}),p=E.useCallback(()=>{const w=u.current;ov(w)&&f&&t&&h.disabled===void 0&&w.disabled&&(w.disabled=!1)},[t,h.disabled,f]);Me(p,[p]);const g=E.useCallback((w={})=>{const{onClick:x,onMouseDown:S,onKeyUp:T,onKeyDown:A,onPointerDown:C,...k}=w;return Di({onClick(M){if(t){M.preventDefault();return}x==null||x(M)},onMouseDown(M){t||S==null||S(M)},onKeyDown(M){if(t||(am(M),A==null||A(M),M.baseUIHandlerPrevented))return;const D=M.target===M.currentTarget,_=M.currentTarget,N=ov(_),O=!o&&Qz(_),z=D&&(o?N:!O),I=M.key==="Enter",V=M.key===" ",$=_.getAttribute("role"),X=($==null?void 0:$.startsWith("menuitem"))||$==="option"||$==="gridcell";if(D&&f&&V){if(M.defaultPrevented&&X)return;M.preventDefault(),(!o||N)&&(M.preventBaseUIHandler(),Fh(_,M));return}if(!z||o||!V&&!I){D&&O&&V&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),I&&(M.preventBaseUIHandler(),Fh(_,M)))},onKeyUp(M){if(!t){if(am(M),T==null||T(M),M.target===M.currentTarget&&o&&f&&ov(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!o&&!f&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),Fh(M.currentTarget,M))}},onPointerDown(M){if(t){M.preventDefault();return}C==null||C(M)}},o?{type:"button"}:{role:"button"},h,k)},[t,h,f,o]),b=Le(w=>{u.current=w,p()});return{getButtonProps:g,buttonRef:b}}function ov(e){return Bt(e)&&e.tagName==="BUTTON"}function Qz(e){return Bt(e)&&e.tagName==="A"&&!!e.href}function Ma(e,t,s,i){const o=bn(_k).current;return Zz(o,e,t,s,i)&&Ik(o,[e,t,s,i]),o.callback}function Xz(e){const t=bn(_k).current;return Wz(t,e)&&Ik(t,e),t.callback}function _k(){return{callback:null,cleanup:null,refs:[]}}function Zz(e,t,s,i,o){return e.refs[0]!==t||e.refs[1]!==s||e.refs[2]!==i||e.refs[3]!==o}function Wz(e,t){return e.refs.length!==t.length||e.refs.some((s,i)=>s!==t[i])}function Ik(e,t){if(e.refs=t,t.every(s=>s==null)){e.callback=null;return}e.callback=s=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),s!=null){const i=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=l(s);typeof u=="function"&&(i[o]=u);break}case"object":{l.current=s;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=i[o];typeof u=="function"?u():l(null);break}case"object":{l.current=null;break}}}}}}}const Jz=parseInt(E.version,10);function Tx(e){return Jz>=e}function wE(e){if(!E.isValidElement(e))return null;const t=e,s=t.props;return(Tx(19)?s==null?void 0:s.ref:t.ref)??null}function rn(){}const ed=Object.freeze([]),_t=Object.freeze({});function eL(e,t){const s={};for(const i in e){const o=e[i];if(t!=null&&t.hasOwnProperty(i)){const l=t[i](o);l!=null&&Object.assign(s,l);continue}o===!0?s[`data-${i.toLowerCase()}`]="":o&&(s[`data-${i.toLowerCase()}`]=o.toString())}return s}function tL(e,t){return typeof e=="function"?e(t):e}function nL(e,t){return typeof e=="function"?e(t):e}function xn(e,t,s={}){let i=t.render;s.enabled!==!1&&(i=Rx(i));const o=sL(t,s,i);if(s.enabled===!1)return null;const l=s.state??_t;return oL(e,i,o,l)}function sL(e,t,s){const{className:i,style:o}=e,{state:l=_t,ref:u,props:d,stateAttributesMapping:f,enabled:h=!0}=t,p=h?tL(i,l):void 0,g=h?nL(o,l):void 0,b=h?eL(l,f):_t,w=h&&d?iL(d):void 0,x=h?lb(b,w)??{}:_t;return typeof document<"u"&&(h?Array.isArray(u)?x.ref=Xz([x.ref,wE(s),...u]):x.ref=Ma(x.ref,wE(s),u):Ma(null,null)),h?(p!==void 0&&(x.className=jk(x.className,p)),g!==void 0&&(x.style=lb(x.style,g)),x):_t}function iL(e){return Array.isArray(e)?Fz(e):Di(void 0,e)}const rL=Symbol.for("react.lazy");function Rx(e){if((e==null?void 0:e.$$typeof)!==rL)return e;const t=E.Children.toArray(e)[0];return E.isValidElement(t)?t:e}function oL(e,t,s,i){if(t){if(typeof t=="function")return t(s,i);const o=Di(s,t.props);return o.ref=s.ref,E.cloneElement(t,o)}return aL(e,s)}function aL(e,t){return e==="button"?E.createElement("button",{type:"button",...t,key:t.key}):e==="img"?E.createElement("img",{alt:"",...t,key:t.key}):E.createElement(e,t)}const lL=E.forwardRef(function(t,s){const{render:i,className:o,disabled:l=!1,focusableWhenDisabled:u=!1,nativeButton:d=!0,style:f,...h}=t,{getButtonProps:p,buttonRef:g}=qm({disabled:l,focusableWhenDisabled:u,native:d});return xn("button",t,{state:{disabled:l},ref:[s,g],props:[h,p]})});function Pk(e){var t,s,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=Pk(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}function zk(){for(var e,t,s=0,i="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=Pk(e))&&(i&&(i+=" "),i+=t);return i}const SE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TE=zk,Ex=(e,t)=>s=>{var i;if((t==null?void 0:t.variants)==null)return TE(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(h=>{const p=s==null?void 0:s[h],g=l==null?void 0:l[h];if(p===null)return null;const b=SE(p)||SE(g);return o[h][b]}),d=s&&Object.entries(s).reduce((h,p)=>{let[g,b]=p;return b===void 0||(h[g]=b),h},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,p)=>{let{class:g,className:b,...w}=p;return Object.entries(w).every(x=>{let[S,T]=x;return Array.isArray(T)?T.includes({...l,...d}[S]):{...l,...d}[S]===T})?[...h,g,b]:h},[]);return TE(e,u,f,s==null?void 0:s.class,s==null?void 0:s.className)},cL=(e,t)=>{const s=new Array(e.length+t.length);for(let i=0;i<e.length;i++)s[i]=e[i];for(let i=0;i<t.length;i++)s[e.length+i]=t[i];return s},uL=(e,t)=>({classGroupId:e,validator:t}),Lk=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),lm="-",RE=[],dL="arbitrary..",fL=e=>{const t=mL(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return hL(u);const d=u.split(lm),f=d[0]===""&&d.length>1?1:0;return Bk(d,f,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const f=i[u],h=s[u];return f?h?cL(h,f):f:h||RE}return s[u]||RE}}},Bk=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],l=s.nextPart.get(o);if(l){const h=Bk(e,t+1,l);if(h)return h}const u=s.validators;if(u===null)return;const d=t===0?e.join(lm):e.slice(t).join(lm),f=u.length;for(let h=0;h<f;h++){const p=u[h];if(p.validator(d))return p.classGroupId}},hL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),i=t.slice(0,s);return i?dL+i:void 0})(),mL=e=>{const{theme:t,classGroups:s}=e;return pL(s,t)},pL=(e,t)=>{const s=Lk();for(const i in e){const o=e[i];Cx(o,s,i,t)}return s},Cx=(e,t,s,i)=>{const o=e.length;for(let l=0;l<o;l++){const u=e[l];gL(u,t,s,i)}},gL=(e,t,s,i)=>{if(typeof e=="string"){yL(e,t,s);return}if(typeof e=="function"){vL(e,t,s,i);return}bL(e,t,s,i)},yL=(e,t,s)=>{const i=e===""?t:Uk(t,e);i.classGroupId=s},vL=(e,t,s,i)=>{if(xL(e)){Cx(e(i),t,s,i);return}t.validators===null&&(t.validators=[]),t.validators.push(uL(s,e))},bL=(e,t,s,i)=>{const o=Object.entries(e),l=o.length;for(let u=0;u<l;u++){const[d,f]=o[u];Cx(f,Uk(t,d),s,i)}},Uk=(e,t)=>{let s=e;const i=t.split(lm),o=i.length;for(let l=0;l<o;l++){const u=i[l];let d=s.nextPart.get(u);d||(d=Lk(),s.nextPart.set(u,d)),s=d}return s},xL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,wL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),i=Object.create(null);const o=(l,u)=>{s[l]=u,t++,t>e&&(t=0,i=s,s=Object.create(null))};return{get(l){let u=s[l];if(u!==void 0)return u;if((u=i[l])!==void 0)return o(l,u),u},set(l,u){l in s?s[l]=u:o(l,u)}}},cb="!",EE=":",SL=[],CE=(e,t,s,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:i,isExternal:o}),TL=e=>{const{prefix:t,experimentalParseClassName:s}=e;let i=o=>{const l=[];let u=0,d=0,f=0,h;const p=o.length;for(let S=0;S<p;S++){const T=o[S];if(u===0&&d===0){if(T===EE){l.push(o.slice(f,S)),f=S+1;continue}if(T==="/"){h=S;continue}}T==="["?u++:T==="]"?u--:T==="("?d++:T===")"&&d--}const g=l.length===0?o:o.slice(f);let b=g,w=!1;g.endsWith(cb)?(b=g.slice(0,-1),w=!0):g.startsWith(cb)&&(b=g.slice(1),w=!0);const x=h&&h>f?h-f:void 0;return CE(l,w,b,x)};if(t){const o=t+EE,l=i;i=u=>u.startsWith(o)?l(u.slice(o.length)):CE(SL,!1,u,void 0,!0)}if(s){const o=i;i=l=>s({className:l,parseClassName:o})}return i},RL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,i)=>{t.set(s,1e6+i)}),s=>{const i=[];let o=[];for(let l=0;l<s.length;l++){const u=s[l],d=u[0]==="[",f=t.has(u);d||f?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(u)):o.push(u)}return o.length>0&&(o.sort(),i.push(...o)),i}},EL=e=>({cache:wL(e.cacheSize),parseClassName:TL(e),sortModifiers:RL(e),postfixLookupClassGroupIds:CL(e),...fL(e)}),CL=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let i=0;i<s.length;i++)t[s[i]]=!0;return t},AL=/\s+/,kL=(e,t)=>{const{parseClassName:s,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:u}=t,d=[],f=e.trim().split(AL);let h="";for(let p=f.length-1;p>=0;p-=1){const g=f[p],{isExternal:b,modifiers:w,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:T}=s(g);if(b){h=g+(h.length>0?" "+h:h);continue}let A=!!T,C;if(A){const N=S.substring(0,T);C=i(N);const O=C&&u[C]?i(S):void 0;O&&O!==C&&(C=O,A=!1)}else C=i(S);if(!C){if(!A){h=g+(h.length>0?" "+h:h);continue}if(C=i(S),!C){h=g+(h.length>0?" "+h:h);continue}A=!1}const k=w.length===0?"":w.length===1?w[0]:l(w).join(":"),M=x?k+cb:k,D=M+C;if(d.indexOf(D)>-1)continue;d.push(D);const _=o(C,A);for(let N=0;N<_.length;++N){const O=_[N];d.push(M+O)}h=g+(h.length>0?" "+h:h)}return h},ML=(...e)=>{let t=0,s,i,o="";for(;t<e.length;)(s=e[t++])&&(i=Vk(s))&&(o&&(o+=" "),o+=i);return o},Vk=e=>{if(typeof e=="string")return e;let t,s="";for(let i=0;i<e.length;i++)e[i]&&(t=Vk(e[i]))&&(s&&(s+=" "),s+=t);return s},NL=(e,...t)=>{let s,i,o,l;const u=f=>{const h=t.reduce((p,g)=>g(p),e());return s=EL(h),i=s.cache.get,o=s.cache.set,l=d,d(f)},d=f=>{const h=i(f);if(h)return h;const p=kL(f,s);return o(f,p),p};return l=u,(...f)=>l(ML(...f))},OL=[],ln=e=>{const t=s=>s[e]||OL;return t.isThemeGetter=!0,t.themeKey=e,t},Fk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jL=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,DL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_L=/\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$/,IL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,PL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,eo=e=>jL.test(e),it=e=>!!e&&!Number.isNaN(Number(e)),bi=e=>!!e&&Number.isInteger(Number(e)),av=e=>e.endsWith("%")&&it(e.slice(0,-1)),sr=e=>DL.test(e),Hk=()=>!0,LL=e=>_L.test(e)&&!IL.test(e),Ax=()=>!1,BL=e=>PL.test(e),UL=e=>zL.test(e),VL=e=>!je(e)&&!De(e),FL=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),qL=e=>ko(e,Yk,Ax),je=e=>Fk.test(e),na=e=>ko(e,$k,LL),AE=e=>ko(e,ZL,it),HL=e=>ko(e,Xk,Hk),GL=e=>ko(e,Qk,Ax),kE=e=>ko(e,Gk,Ax),KL=e=>ko(e,Kk,UL),gh=e=>ko(e,Zk,BL),De=e=>qk.test(e),Tu=e=>La(e,$k),YL=e=>La(e,Qk),ME=e=>La(e,Gk),$L=e=>La(e,Yk),QL=e=>La(e,Kk),yh=e=>La(e,Zk,!0),XL=e=>La(e,Xk,!0),ko=(e,t,s)=>{const i=Fk.exec(e);return i?i[1]?t(i[1]):s(i[2]):!1},La=(e,t,s=!1)=>{const i=qk.exec(e);return i?i[1]?t(i[1]):s:!1},Gk=e=>e==="position"||e==="percentage",Kk=e=>e==="image"||e==="url",Yk=e=>e==="length"||e==="size"||e==="bg-size",$k=e=>e==="length",ZL=e=>e==="number",Qk=e=>e==="family-name",Xk=e=>e==="number"||e==="weight",Zk=e=>e==="shadow",WL=()=>{const e=ln("color"),t=ln("font"),s=ln("text"),i=ln("font-weight"),o=ln("tracking"),l=ln("leading"),u=ln("breakpoint"),d=ln("container"),f=ln("spacing"),h=ln("radius"),p=ln("shadow"),g=ln("inset-shadow"),b=ln("text-shadow"),w=ln("drop-shadow"),x=ln("blur"),S=ln("perspective"),T=ln("aspect"),A=ln("ease"),C=ln("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),De,je],_=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],O=()=>[De,je,f],z=()=>[eo,"full","auto",...O()],I=()=>[bi,"none","subgrid",De,je],V=()=>["auto",{span:["full",bi,De,je]},bi,De,je],$=()=>[bi,"auto",De,je],X=()=>["auto","min","max","fr",De,je],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...O()],ie=()=>[eo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],Q=()=>[d,eo,"screen","full","dvw","lvw","svw","min","max","fit",...O()],ae=()=>[eo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],ne=()=>[e,De,je],pe=()=>[...M(),ME,kE,{position:[De,je]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ve=()=>["auto","cover","contain",$L,qL,{size:[De,je]}],P=()=>[av,Tu,na],K=()=>["","none","full",h,De,je],L=()=>["",it,Tu,na],H=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[it,av,ME,kE],ye=()=>["","none",x,De,je],ce=()=>["none",it,De,je],me=()=>["none",it,De,je],ze=()=>[it,De,je],Te=()=>[eo,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sr],breakpoint:[sr],color:[Hk],container:[sr],"drop-shadow":[sr],ease:["in","out","in-out"],font:[VL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sr],shadow:[sr],spacing:["px",it],text:[sr],"text-shadow":[sr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",eo,je,De,T]}],container:["container"],"container-type":[{"@container":["","normal","size",De,je]}],"container-named":[FL],columns:[{columns:[it,"auto",je,De,d]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:D()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[bi,"auto",De,je]}],basis:[{basis:[eo,"full","auto",d,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,eo,"auto","initial","none",je]}],grow:[{grow:["",it,De,je]}],shrink:[{shrink:["",it,De,je]}],order:[{order:[bi,"first","last","none",De,je]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[d,"screen",...ie()]}],"min-w":[{"min-w":[d,"screen","none",...ie()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh","none",...ie()]}],"font-size":[{text:["base",s,Tu,na]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,XL,HL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",av,je]}],"font-family":[{font:[YL,GL,t]}],"font-features":[{"font-features":[je]}],"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,De,je]}],"line-clamp":[{"line-clamp":[it,"none",De,AE]}],leading:[{leading:["none",l,...O()]}],"list-image":[{"list-image":["none",De,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ne()}],"text-color":[{text:ne()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",De,na]}],"text-decoration-color":[{decoration:ne()}],"underline-offset":[{"underline-offset":[it,"auto",De,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[bi,De,je]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,je]}],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",De,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:pe()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:ve()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bi,De,je],radial:["",De,je],conic:["",bi,De,je]},QL,KL]}],"bg-color":[{bg:ne()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:ne()}],"gradient-via":[{via:ne()}],"gradient-to":[{to:ne()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-bs":[{"border-bs":L()}],"border-w-be":[{"border-be":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:ne()}],"border-color-x":[{"border-x":ne()}],"border-color-y":[{"border-y":ne()}],"border-color-s":[{"border-s":ne()}],"border-color-e":[{"border-e":ne()}],"border-color-bs":[{"border-bs":ne()}],"border-color-be":[{"border-be":ne()}],"border-color-t":[{"border-t":ne()}],"border-color-r":[{"border-r":ne()}],"border-color-b":[{"border-b":ne()}],"border-color-l":[{"border-l":ne()}],"divide-color":[{divide:ne()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,De,je]}],"outline-w":[{outline:["",it,Tu,na]}],"outline-color":[{outline:ne()}],shadow:[{shadow:["","inner","none",p,yh,gh]}],"shadow-color":[{shadow:ne()}],"inset-shadow":[{"inset-shadow":["none",g,yh,gh]}],"inset-shadow-color":[{"inset-shadow":ne()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ne()}],"ring-offset-w":[{"ring-offset":[it,na]}],"ring-offset-color":[{"ring-offset":ne()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":ne()}],"text-shadow":[{"text-shadow":["none",b,yh,gh]}],"text-shadow-color":[{"text-shadow":ne()}],opacity:[{opacity:[it,De,je]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"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":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":ne()}],"mask-image-linear-to-color":[{"mask-linear-to":ne()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":ne()}],"mask-image-t-to-color":[{"mask-t-to":ne()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":ne()}],"mask-image-r-to-color":[{"mask-r-to":ne()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":ne()}],"mask-image-b-to-color":[{"mask-b-to":ne()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":ne()}],"mask-image-l-to-color":[{"mask-l-to":ne()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":ne()}],"mask-image-x-to-color":[{"mask-x-to":ne()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":ne()}],"mask-image-y-to-color":[{"mask-y-to":ne()}],"mask-image-radial":[{"mask-radial":[De,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":ne()}],"mask-image-radial-to-color":[{"mask-radial-to":ne()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":ne()}],"mask-image-conic-to-color":[{"mask-conic-to":ne()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:pe()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:ve()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,je]}],filter:[{filter:["","none",De,je]}],blur:[{blur:ye()}],brightness:[{brightness:[it,De,je]}],contrast:[{contrast:[it,De,je]}],"drop-shadow":[{"drop-shadow":["","none",w,yh,gh]}],"drop-shadow-color":[{"drop-shadow":ne()}],grayscale:[{grayscale:["",it,De,je]}],"hue-rotate":[{"hue-rotate":[it,De,je]}],invert:[{invert:["",it,De,je]}],saturate:[{saturate:[it,De,je]}],sepia:[{sepia:["",it,De,je]}],"backdrop-filter":[{"backdrop-filter":["","none",De,je]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[it,De,je]}],"backdrop-contrast":[{"backdrop-contrast":[it,De,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,De,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,De,je]}],"backdrop-invert":[{"backdrop-invert":["",it,De,je]}],"backdrop-opacity":[{"backdrop-opacity":[it,De,je]}],"backdrop-saturate":[{"backdrop-saturate":[it,De,je]}],"backdrop-sepia":[{"backdrop-sepia":["",it,De,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",De,je]}],ease:[{ease:["linear","initial",A,De,je]}],delay:[{delay:[it,De,je]}],animate:[{animate:["none",C,De,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,De,je]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[De,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],zoom:[{zoom:[bi,De,je]}],accent:[{accent:ne()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ne()}],"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",De,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ne()}],"scrollbar-track-color":[{"scrollbar-track":ne()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",De,je]}],fill:[{fill:["none",...ne()]}],"stroke-w":[{stroke:[it,Tu,na,AE]}],stroke:[{stroke:["none",...ne()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],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":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","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-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","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-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","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-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","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-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},JL=NL(WL);function ke(...e){return JL(zk(e))}const eB=Ex("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,translate,opacity] duration-150 ease-out outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Be({className:e,variant:t="default",size:s="default",render:i,nativeButton:o=i===void 0,...l}){return v.jsx(lL,{"data-slot":"button",className:ke(eB({variant:t,size:s,className:e})),nativeButton:o,render:i,...l})}function tB({className:e,...t}){return v.jsx("label",{"data-slot":"label",className:ke("flex items-center gap-2 text-xs leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Wk=E.forwardRef(function(t,s){const{className:i,render:o,orientation:l="horizontal",style:u,...d}=t;return xn("div",t,{state:{orientation:l},ref:s,props:[{role:"separator","aria-orientation":l},d]})});function vh({className:e,orientation:t="horizontal",...s}){return v.jsx(Wk,{"data-slot":"separator",orientation:t,className:ke("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...s})}function kx({className:e,...t}){return v.jsx("div",{"data-slot":"field-group",className:ke("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",e),...t})}const nB=Ex("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function os({className:e,orientation:t="vertical",...s}){return v.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:ke(nB({orientation:t}),e),...s})}function as({className:e,...t}){return v.jsx(tB,{"data-slot":"field-label",className:ke("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function td({className:e,...t}){return v.jsx("p",{"data-slot":"field-description",className:ke("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}const sB="data-valid",iB="data-invalid",rB={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},oB={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},aB={disabled:!1,...oB},lB={valid(e){return e===null?null:e?{[sB]:""}:{[iB]:""}}},cB={invalid:void 0,name:void 0,validityData:{state:rB,errors:[],error:"",value:"",initialValue:null},setValidityData:rn,disabled:void 0,setTouched:rn,setDirty:rn,setFilled:rn,setFocused:rn,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:aB,registerFieldControl:rn,validation:{getValidationProps:(e,t=_t)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:rn,getInputControl:()=>null,commit:async()=>{},change:rn}},uB=E.createContext(cB);function Mx(e=!0){const t=E.useContext(uB);if(t.setValidityData===rn&&!e)throw new Error(Ts(28));return t}const dB=E.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:rn,validationMode:"onSubmit",submitCountRef:{current:0}});function fB(){return E.useContext(dB)}function Jk(){const[,e]=E.useState({});return E.useCallback(()=>{e({})},[])}let NE=0;function hB(e,t="mui"){const s=E.useRef(void 0),i=Jk(),o=e??s.current;return E.useEffect(()=>{s.current==null&&(NE+=1,s.current=`${t}-${NE}`,e==null&&i())},[e,t,i]),o}const OE=wx.useId;function Hm(e,t){if(OE!==void 0){const s=OE();return e??(t?`${t}-${s}`:s)}return hB(e,t)}function Ro(e){return Hm(e,"base-ui")}const mB=E.createContext({controlId:void 0,registerControlId:rn,resetControlId:rn,labelId:void 0,setLabelId:rn,messageIds:[],setMessageIds:rn,getDescriptionProps:e=>e});function eM(){return E.useContext(mB)}function pB(e={}){const{id:t,enabled:s=!0}=e,{controlId:i,registerControlId:o,resetControlId:l}=eM(),u=Ro(),d=bn(()=>Symbol()),f=E.useRef(!1),h=E.useRef(!1),p=Le(()=>{!f.current||o===rn||(f.current=!1,o(d.current,void 0))});return Me(()=>{if(!s||o===rn){p();return}let g;if(t!==void 0)h.current=!0,g=t;else if(h.current)g=u;else{l();return}if(g===void 0){p();return}f.current=!0,o(d.current,g)},[t,s,o,l,u,d,p]),Me(()=>p,[p]),(s?i:void 0)??t??u}function gB(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:yB,platform:vB,maxTouchPoints:bB}=gB(),Gm=yB.toLowerCase(),nd=vB.toLowerCase(),Km=/^i(os$|p)/.test(nd)||nd==="macintel"&&bB>1,jE="android",ub=nd===jE||Gm.includes(jE),Nx=!Km&&nd.startsWith("mac");nd.startsWith("win");const xB=Nx||Km;var b2;const Sr=typeof CSS<"u"&&!!((b2=CSS.supports)!=null&&b2.call(CSS,"-webkit-backdrop-filter:none"));!Sr&&Gm.includes("firefox");!Sr&&Gm.includes("chrom");const wB=xB,Ox=/jsdom|happydom/.test(Gm);function rs(e){var s;let t=e.activeElement;for(;((s=t==null?void 0:t.shadowRoot)==null?void 0:s.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function qe(e,t){var i;if(!e||!t)return!1;const s=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(s&&ka(s)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function sd(e,t){let s=e;for(;s;){if(bt(s)&&s.matches(t))return s;s=s.assignedSlot??s.parentNode??(ka(s)?s.host:null)}return null}function zn(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const db="data-base-ui-focusable",tM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ym="ArrowLeft",$m="ArrowRight",nM="ArrowUp",jx="ArrowDown",sM="data-starting-style",SB="data-ending-style",TB={[sM]:""},RB={[SB]:""},iM={transitionStatus(e){return e==="starting"?TB:e==="ending"?RB:null}},EB="data-open",CB="data-closed",AB="data-anchor-hidden",rM="data-popup-open",kB="data-pressed",MB={[rM]:""},NB={[rM]:"",[kB]:""},OB={[EB]:""},jB={[CB]:""},DB={[AB]:""},_B={open(e){return e?MB:null}},DE={open(e){return e?NB:null}},Qm={open(e){return e?OB:jB},anchorHidden(e){return e?DB:null}},Dx={...Qm,...iM},fb="data-trigger-disabled";function cm(e,t){if(!bt(e))return!1;const s=e;if(t.hasElement(s))return!s.hasAttribute(fb);for(const[,i]of t.entries())if(qe(i,s))return!i.hasAttribute(fb);return!1}function lv(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const s=e;return s.target!=null&&t.contains(s.target)}function IB(e){return e.matches("html,body")}function Ed(e){return Bt(e)&&e.matches(tM)}function PB(e){return sd(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${tM}`)!=null}function hb(e){return e?e.getAttribute("role")==="combobox"&&Ed(e):!1}function zB(e){if(!e||Ox)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function mb(e){return e?e.hasAttribute(db)?e:e.querySelector(`[${db}]`)||e:null}function Eo(e,t,s=!0){return e.filter(o=>o.parentId===t).flatMap(o=>{var l;return[...!s||(l=o.context)!=null&&l.open?[o]:[],...Eo(e,o.id,s)]})}function _E(e,t){var o;let s=[],i=(o=e.find(l=>l.id===t))==null?void 0:o.parentId;for(;i;){const l=e.find(u=>u.id===i);i=l==null?void 0:l.parentId,l&&(s=s.concat(l))}return s}function Ti(e){e.preventDefault(),e.stopPropagation()}function LB(e){return"nativeEvent"in e}function id(e){return e.pointerType===""&&e.isTrusted?!0:ub&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function _x(e){return Ox?!1:!ub&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(ub||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function xo(e,t){const s=["mouse","pen"];return t||s.push("",void 0),s.includes(e)}function BB(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const pc=Math.min,gr=Math.max,um=Math.round,bh=Math.floor,yr=e=>({x:e,y:e}),UB={left:"right",right:"left",bottom:"top",top:"bottom"};function oM(e,t,s){return gr(e,pc(t,s))}function Co(e,t){return typeof e=="function"?e(t):e}function xs(e){return e.split("-")[0]}function _i(e){return e.split("-")[1]}function Ix(e){return e==="x"?"y":"x"}function Px(e){return e==="y"?"height":"width"}function Ps(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zx(e){return Ix(Ps(e))}function VB(e,t,s){s===void 0&&(s=!1);const i=_i(e),o=zx(e),l=Px(o);let u=o==="x"?i===(s?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=dm(u)),[u,dm(u)]}function FB(e){const t=dm(e);return[pb(e),t,pb(t)]}function pb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const IE=["left","right"],PE=["right","left"],qB=["top","bottom"],HB=["bottom","top"];function GB(e,t,s){switch(e){case"top":case"bottom":return s?t?PE:IE:t?IE:PE;case"left":case"right":return t?qB:HB;default:return[]}}function KB(e,t,s,i){const o=_i(e);let l=GB(xs(e),s==="start",i);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(pb)))),l}function dm(e){const t=xs(e);return UB[t]+e.slice(t.length)}function YB(e){var t,s,i,o;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function aM(e){return typeof e!="number"?YB(e):{top:e,right:e,bottom:e,left:e}}function fm(e){const{x:t,y:s,width:i,height:o}=e;return{width:i,height:o,top:s,left:t,right:t+i,bottom:s+o,x:t,y:s}}function gb(e,t){return t<0||t>=e.length}function cv(e,t){return Lx(e.current,{disabledIndices:t})}function zE(e,t){return Lx(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $B(e,t,s){const{decrement:i,loopFocus:o,allowEscape:l,disabledIndices:u,minIndex:d,maxIndex:f}=s,h=()=>Lx(e,{startingIndex:t,decrement:i,disabledIndices:u});let p,g=!1;if(!o)p=i?Math.max(d,h()):Math.min(f,h());else if(i?t<=d:t>=f){const b=i?-1:e.length;l&&t!==b?p=-1:(p=i?f:d,g=!0)}else p=h();return{index:gb(e,p)?-1:p,wrapped:g}}function Lx(e,{startingIndex:t=-1,decrement:s=!1,disabledIndices:i,amount:o=1}={}){let l=t;do l+=s?-o:o;while(l>=0&&l<=e.length-1&&lM(e,l,i));return l}function lM(e,t,s){if(typeof s=="function"?s(t):(s==null?void 0:s.includes(t))??!1)return!0;const o=e[t];return o?!Xm(o)||o.matches(":disabled")?!0:!s&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function QB(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Xm(e,t=e?Ss(e):null){return!e||!e.isConnected||!t||QB(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const XB='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function ZB(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const s=e.getRootNode();return ka(s)?s.host:null}function yb(e){for(const t of Array.from(e.children))if(Dn(t)==="summary")return t;return null}function WB(e,t){const s=yb(t);return!!s&&(e===s||qe(s,e))}function cM(e){const t=e?Dn(e):"";return e!=null&&e.matches(XB)&&(t!=="summary"||e.parentElement!=null&&Dn(e.parentElement)==="details"&&yb(e.parentElement)===e)&&(t!=="details"||yb(e)==null)&&(t!=="input"||e.type!=="hidden")}function Bx(e){if(!cM(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=ZB(t)){const s=t!==e,i=Dn(t)==="slot";if(t.hasAttribute("inert")||s&&Dn(t)==="details"&&!t.open&&!WB(e,t)||t.hasAttribute("hidden")||!i&&!JB(t,s))return!1}return!0}function JB(e,t){const s=Ss(e);return t?s.display!=="none":Xm(e,s)}function uM(e){const t=e.tabIndex;if(t<0){const s=Dn(e);if(s==="details"||s==="audio"||s==="video"||Bt(e)&&e.isContentEditable)return 0}return t}function uv(e){if(Dn(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function dM(e,t){const s=uv(e);if(!s)return!0;const i=t.find(o=>{const l=uv(o);return(l==null?void 0:l.name)===s.name&&l.form===s.form&&l.checked});return i?i===s:t.find(o=>{const l=uv(o);return(l==null?void 0:l.name)===s.name&&l.form===s.form})===s}function fM(e){if(Bt(e)&&Dn(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Bt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ux(e,t){fM(e).forEach(s=>{cM(s)&&t.push(s),Ux(s,t)})}function hM(e,t,s){fM(e).forEach(i=>{Bt(i)&&i.matches(t)&&s.push(i),hM(i,t,s)})}function Zm(e){return Bx(e)&&uM(e)>=0}function mM(e){const t=[];return Ux(e,t),t.filter(Bx)}function Wm(e){const t=mM(e);return t.filter(s=>uM(s)>=0&&dM(s,t))}function pM(e,t){const s=Wm(e),i=s.length;if(i===0)return;const o=rs(vt(e)),l=s.indexOf(o),u=l===-1?t===1?0:i-1:l+t;return s[u]}function gM(e){return pM(vt(e).body,1)||e}function yM(e){return pM(vt(e).body,-1)||e}function e4(e,t,s){if(!e)return null;const i=[];Ux(vt(e).body,i);const o=i.indexOf(e);if(o===-1)return null;const l=i.filter(Bx);for(let u=1;u<i.length;u+=1){const d=i[(o+t*u+i.length)%i.length];if(!qe(s,d)&&Zm(d)&&dM(d,l))return d}return i[o]}function Ql(e,t){const s=t||e.currentTarget,i=e.relatedTarget;return!i||!qe(s,i)}function t4(e){Wm(e).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function LE(e){const t=[];hM(e,"[data-tabindex]",t),t.forEach(s=>{const i=s.dataset.tabindex;delete s.dataset.tabindex,i?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")})}function Vx(e){E.useEffect(e,ed)}const Ru=0;class zi{constructor(){ge(this,"currentId",Ru);ge(this,"clear",()=>{this.currentId!==Ru&&(clearTimeout(this.currentId),this.currentId=Ru)});ge(this,"disposeEffect",()=>this.clear)}static create(){return new zi}start(t,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ru,s()},t)}isStarted(){return this.currentId!==Ru}}function Ln(){const e=bn(zi.create).current;return Vx(e.disposeEffect),e}var Tr=fk();const xh=null;class n4{constructor(){ge(this,"callbacks",[]);ge(this,"callbacksCount",0);ge(this,"nextId",1);ge(this,"startId",1);ge(this,"isScheduled",!1);ge(this,"tick",t=>{var o;this.isScheduled=!1;const s=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let l=0;l<s.length;l+=1)(o=s[l])==null||o.call(s,t)})}request(t){const s=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),s}cancel(t){const s=t-this.startId;s<0||s>=this.callbacks.length||this.callbacks[s]!==null&&(this.callbacks[s]=null,this.callbacksCount-=1)}}let wh=new n4;class Ai{constructor(){ge(this,"currentId",xh);ge(this,"cancel",()=>{this.currentId!==xh&&(wh.cancel(this.currentId),this.currentId=xh)});ge(this,"disposeEffect",()=>this.cancel)}static create(){return new Ai}static request(t){return wh.request(t)}static cancel(t){return wh.cancel(t)}request(t){this.cancel(),this.currentId=wh.request(()=>{this.currentId=xh,t()})}}function rd(){const e=bn(Ai.create).current;return Vx(e.disposeEffect),e}function ar(e){return e==null?e:"current"in e?e.current:e}function BE(e,t){return e.getAnimations(t).filter(s=>{var o;const i=(o=s.effect)==null?void 0:o.getTiming();return(i==null?void 0:i.duration)!==1/0&&(i==null?void 0:i.iterations)!==1/0})}let Sh=null;function s4(e){if(!Sh){const t=[];Sh=t,queueMicrotask(()=>{Sh=null,Tr.flushSync(()=>{for(const s of t)s()})})}Sh.push(e)}function Fx(e,t=!1,s=!1){const i=rd();return Le((o,l=null)=>{i.cancel();const u=ar(e);if(u==null)return;const d=u,f=()=>{if(!s){Tr.flushSync(o);return}s4(()=>{l!=null&&l.aborted||o()})};if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function h(){Promise.all(BE(d).map(p=>p.finished.then(rn))).then(()=>{l!=null&&l.aborted||f()},()=>{if(l!=null&&l.aborted)return;if(BE(d).some(g=>g.pending||g.playState!=="finished")){h();return}f()})}if(t){const p=sM;if(!d.hasAttribute(p)){i.request(h);return}const g=new MutationObserver(()=>{d.hasAttribute(p)||(g.disconnect(),h())});g.observe(d,{attributes:!0,attributeFilter:[p]}),l==null||l.addEventListener("abort",()=>g.disconnect(),{once:!0});return}i.request(h)})}function Jm(e){const{enabled:t=!0,open:s,ref:i,batch:o=!1,onComplete:l}=e,u=Le(l),d=Fx(i,s,o);E.useEffect(()=>{if(!t)return;const f=new AbortController;return d(u,f.signal),()=>{f.abort()}},[t,s,u,d])}function i4(e,t=!1,s=!1,i=!1){const[o,l]=E.useState(e&&t?"idle":void 0),[u,d]=E.useState(e&&!i);return e&&!u&&(d(!0),l("starting")),!e&&u&&o!=="ending"&&!s&&l("ending"),!e&&!u&&o==="ending"&&l(void 0),Me(()=>{if(!e&&u&&o!=="ending"&&s){const f=Ai.request(()=>{l("ending")});return()=>{Ai.cancel(f)}}},[e,u,o,s]),Me(()=>{if(!e||t||o===void 0)return;const f=Ai.request(()=>{l(void 0)});return()=>{Ai.cancel(f)}},[t,e,o]),Me(()=>{if(!e||!t)return;e&&u&&o!=="idle"&&l("starting");const f=Ai.request(()=>{l("idle")});return()=>{Ai.cancel(f)}},[t,e,u,o]),{mounted:u,setMounted:d,transitionStatus:o}}function r4(e,t,s){const{setFocused:i,focusOwnerRef:o}=Mx(),l=Le(u=>{(u?!e:o.current===l)&&(o.current=u&&l,i(u))});return Me(()=>{const u=t.current,d=u==null?void 0:u.getRootNode();return(d==null?void 0:d.activeElement)===u&&l(!0),()=>l(!1)},[e,t,l]),l}function o4(e,t,s,i,o=!0,l){const{registerFieldControl:u}=Mx(),d=bn(()=>Symbol());Me(()=>{const f=d.current;if(!o){u(f,void 0);return}u(f,{controlRef:e,getValue:i,id:t,name:l,value:s})},[e,o,i,t,l,u,d,s]),Me(()=>{const f=d.current;return()=>{u(f,void 0)}},[u,d])}function vM(e,t){const s=E.useRef(e),i=Le(t);Me(()=>{s.current!==e&&i(s.current),s.current=e},[e,i])}function ct(e,t,s,i){let o=!1,l=!1;const u=_t;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){l=!0},get isCanceled(){return o},get isPropagationAllowed(){return l},trigger:s,...u}}function a4(e,t,s){const i=s??_t;return{reason:e,event:t??new Event("base-ui"),...i}}const Na="none",Tc="trigger-press",hn="trigger-hover",Xl="trigger-focus",qx="outside-press",Hx="item-press",l4="close-press",gc="focus-out",ep="escape-key",hm="list-navigation",bM="keyboard",c4="pointer",u4="cancel-open",Du="sibling-open",d4="disabled",Gx="imperative-action",f4=E.forwardRef(function(t,s){const{render:i,className:o,id:l,name:u,value:d,disabled:f=!1,onValueChange:h,defaultValue:p,autoFocus:g=!1,style:b,...w}=t,{state:x,name:S,disabled:T,setTouched:A,setDirty:C,validityData:k,setFilled:M,validationMode:D,validation:_}=Mx(),{clearErrors:N,elementRef:O,submitCountRef:z}=fB(),I=T||f,V=S??u,$={...x,disabled:I},{labelId:X}=eM(),B=pB({id:l}),q=d!==void 0,F=d==null?void 0:String(d),ie=Le(()=>{var ee;return(ee=_.inputRef.current)==null?void 0:ee.value});o4(_.inputRef,B,F,ie,!I,u),Me(()=>{var ve;const ee=F??((ve=_.inputRef.current)==null?void 0:ve.value);ee!==void 0&&M(ee!=="")},[F,p,_.inputRef,M]),vM(F,()=>{F!==void 0&&(N(V),C(F!==(k.initialValue??"")),_.change(F))});const Q=E.useRef(null),ae=r4(I,Q),ne=Ln();return xn("input",t,{ref:[s,Q],state:$,props:[{id:B,disabled:I,name:V,ref:_.inputRef,"aria-labelledby":X,autoFocus:g,...q?{value:d}:{defaultValue:p},onChange(ee){const ve=ee.currentTarget.value,P=ct(Na,ee.nativeEvent);h==null||h(ve,P),!q&&(C(ve!==(k.initialValue??"")),M(ve!==""),!ee.nativeEvent.defaultPrevented&&!P.isCanceled&&(N(V),_.change(ve)))},onFocus(){ae(!0)},onBlur(ee){if(A(!0),ae(!1),D==="onBlur"){const ve=ee.currentTarget.value;_.commit(ve),q&&queueMicrotask(()=>{var K;const P=(K=_.inputRef.current)==null?void 0:K.value;P!==void 0&&P!==ve&&P!==(k.initialValue??"")&&_.commit(P)})}},onKeyDown(ee){if(ee.currentTarget.tagName==="INPUT"&&ee.key==="Enter"){A(!0);const ve=ee.currentTarget.value,P=ee.currentTarget.form;if(P&&P===O.current&&!ee.defaultPrevented){const K=ee.currentTarget,L=z.current;ne.start(0,()=>{z.current===L&&_.commit(K.value)})}else _.commit(ve)}}},w,ee=>_.getValidationProps(I,ee)],stateAttributesMapping:lB})}),h4=E.forwardRef(function(t,s){return v.jsx(f4,{ref:s,...t})});function po({className:e,type:t,...s}){return v.jsx(h4,{type:t,"data-slot":"input",className:ke("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...s})}const xM=E.createContext(void 0);function Ba(e){const t=E.useContext(xM);if(!e&&t===void 0)throw new Error(Ts(27));return t}const wM=E.forwardRef(function(t,s){const{render:i,className:o,style:l,forceRender:u=!1,...d}=t,f=Ba(),h=f.useState("open"),p=f.useState("nested"),g=f.useState("mounted"),b=f.useState("transitionStatus");return xn("div",t,{state:{open:h,transitionStatus:b},ref:[f.context.backdropRef,s],stateAttributesMapping:Dx,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:u||!p})}),SM=E.forwardRef(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,...f}=t,h=Ba(),p=h.useState("open"),{getButtonProps:g,buttonRef:b}=qm({disabled:u,native:d}),w={disabled:u};function x(S){p&&h.setOpen(!1,ct(l4,S.nativeEvent))}return xn("button",t,{state:w,ref:[s,b],props:[{onClick:x},f,g]})}),TM=E.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=Ba(),h=Ro(u);return f.useSyncedValueWithCleanup("descriptionElementId",h),xn("p",t,{ref:s,props:[{id:h},d]})});function m4(e,t){return t!=null&&!xo(t)?0:typeof e=="function"?e():e}function od(e,t,s){const i=m4(e,s);return typeof i=="number"?i:i==null?void 0:i[t]}function UE(e){return typeof e=="function"?e():e}function RM(e,t){return t||e==="click"||e==="mousedown"}function p4(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const g4=E.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new zi,currentIdRef:{current:null},currentContextRef:{current:null}});function y4(e,t){e.current=t.current}function v4(e,t={open:!1}){const{open:s}=t,i=e.useState("floatingId"),o=E.useContext(g4),{currentIdRef:l,delayRef:u,timeoutMs:d,initialDelayRef:f,currentContextRef:h,hasProvider:p,timeout:g}=o,[b,w]=E.useState(!1),x=E.useRef(s);return Me(()=>{x.current=s},[s]),Me(()=>{function S(){var T;(T=h.current)==null||T.setIsInstantPhase(!1),l.current=null,h.current=null,u.current=f.current,g.clear()}if(l.current&&!s&&l.current===i){if(w(!1),d){const T=i;return g.start(d,()=>{e.select("open")||l.current&&l.current!==T||S()}),()=>{(x.current||l.current!==T)&&g.clear()}}S()}},[s,i,l,u,d,f,h,g,e]),Me(()=>{if(!s)return;const S=h.current,T=l.current;g.clear(),h.current={onOpenChange:e.setOpen,setIsInstantPhase:w},l.current=i,u.current={open:0,close:od(f.current,"close")},T!==null&&T!==i?(w(!0),S==null||S.setIsInstantPhase(!0),S==null||S.onOpenChange(!1,ct(Na))):(w(!1),S==null||S.setIsInstantPhase(!1))},[s,i,e,l,u,f,h,g]),Me(()=>()=>{if(l.current===i){if(h.current=null,!x.current)return;l.current=null,y4(u,f),g.clear()}},[h,l,u,i,f,g]),E.useMemo(()=>({activeIdRef:l,hasProvider:p,delayRef:u,isInstantPhase:b}),[l,p,u,b])}function rt(e,t,s,i){return e.addEventListener(t,s,i),()=>{e.removeEventListener(t,s,i)}}function Ii(...e){return()=>{for(let t=0;t<e.length;t+=1){const s=e[t];s&&s()}}}function Jt(e){const t=bn(b4,e).current;return t.next=e,Me(t.effect),t}function b4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const x4={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},w4={...x4,position:"fixed",margin:0,top:0,left:0},yc=E.forwardRef(function(t,s){const[i,o]=E.useState();Me(()=>{wB&&Sr&&o("button")},[]);const l={tabIndex:0,role:i};return v.jsx("span",{...t,ref:s,style:w4,"aria-hidden":i?void 0:!0,...l,"data-base-ui-focus-guard":""})});function Zl(e){return`data-base-ui-${e}`}let Th=0;function qh(e,t={}){const{preventScroll:s=!1,sync:i=!1,shouldFocus:o}=t;cancelAnimationFrame(Th);function l(){o&&!o()||e==null||e.focus({preventScroll:s})}if(i)return l(),rn;const u=requestAnimationFrame(l);return Th=u,()=>{Th===u&&(cancelAnimationFrame(u),Th=0)}}const VE="data-base-ui-inert";let Eu=new WeakMap,Rh=new WeakSet,Cu=new WeakMap,dv=0;function EM(e){return e?ka(e)?e.host:EM(e.parentNode):null}const FE=(e,t)=>t.map(s=>{if(e.contains(s))return s;const i=EM(s);return e.contains(i)?i:null}).filter(s=>s!=null),qE=e=>{const t=new Set;return e.forEach(s=>{let i=s;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},HE=(e,t,s)=>{const i=[],o=l=>{!l||s.has(l)||Array.from(l.children).forEach(u=>{Dn(u)!=="script"&&(t.has(u)?o(u):i.push(u))})};return o(e),i};function S4(e,t,s,{mark:i=!0}){const o=FE(t,e),l=i?HE(t,qE(o),new Set(o)):[],u=[],d=[];if(s){const f=FE(t,Array.from(t.querySelectorAll("[aria-live]"))),h=o.concat(f);HE(t,qE(h),new Set(h)).forEach(g=>{const b=g.getAttribute("aria-hidden"),w=b!==null&&b!=="false",x=(Eu.get(g)||0)+1;Eu.set(g,x),u.push(g),x===1&&w&&Rh.add(g),w||g.setAttribute("aria-hidden","true")})}return i&&l.forEach(f=>{const h=(Cu.get(f)||0)+1;Cu.set(f,h),d.push(f),h===1&&f.setAttribute(VE,"")}),dv+=1,()=>{u.forEach(f=>{const h=(Eu.get(f)||0)-1;Eu.set(f,h),h||(Rh.has(f)||f.removeAttribute("aria-hidden"),Rh.delete(f))}),i&&d.forEach(f=>{const h=(Cu.get(f)||0)-1;Cu.set(f,h),h||f.removeAttribute(VE)}),dv-=1,dv||(Eu=new WeakMap,Rh=new WeakSet,Cu=new WeakMap)}}function GE(e,t={}){const{ariaHidden:s=!1,mark:i=!0}=t,o=vt(e[0]).body;return S4(e,o,s,{mark:i})}const T4=500,R4=500,E4={style:{transition:"none"}},C4="data-base-ui-click-trigger",A4={fallbackAxisSide:"none"},CM={fallbackAxisSide:"end"},k4={clipPath:"inset(50%)",position:"fixed",top:0,left:0},AM=E.createContext(null),kM=()=>E.useContext(AM),M4=Zl("portal");function MM(e={}){const{ref:t,container:s,componentProps:i=_t,elementProps:o}=e,l=Hm(),u=kM(),d=u==null?void 0:u.portalNode,[f,h]=E.useState(null),[p,g]=E.useState(null),b=Le(T=>{T!==null&&g(T)}),w=E.useRef(null);Me(()=>{if(s===null){w.current&&(w.current=null,g(null),h(null));return}const T=(s&&(vx(s)?s:s.current))??d??document.body;if(T==null){w.current&&(w.current=null,g(null),h(null));return}w.current!==T&&(w.current=T,g(null),h(T))},[s,d]);const x=xn("div",i,{ref:[t,b],props:[{id:l,[M4]:""},o]}),S=f&&x?Tr.createPortal(x,f):null;return{node:p,nodeId:E.isValidElement(x)?x.props.id:void 0,subtree:S}}const NM=E.forwardRef(function(t,s){const{render:i,className:o,style:l,children:u,container:d,portalOwnerRole:f,...h}=t,{node:p,nodeId:g,subtree:b}=MM({container:d,ref:s,componentProps:t,elementProps:h}),w=E.useRef(null),x=E.useRef(null),S=E.useRef(null),T=E.useRef(null),[A,C]=E.useState(null),k=E.useRef(!1),M=A==null?void 0:A.modal,D=A==null?void 0:A.open,_=!!A&&!A.modal&&A.open&&!!p;E.useEffect(()=>{if(!p||M)return;function O(z){p&&z.relatedTarget&&Ql(z)&&(z.type==="focusin"?k.current&&(LE(p),k.current=!1):(t4(p),k.current=!0))}return Ii(rt(p,"focusin",O,!0),rt(p,"focusout",O,!0))},[p,M]),Me(()=>{!p||D!==!0||!k.current||(LE(p),k.current=!1)},[D,p]);const N=E.useMemo(()=>({beforeOutsideRef:w,afterOutsideRef:x,beforeInsideRef:S,afterInsideRef:T,portalNode:p,setFocusManagerState:C}),[p]);return v.jsxs(E.Fragment,{children:[b,v.jsxs(AM.Provider,{value:N,children:[_&&p&&v.jsx(yc,{"data-type":"outside",ref:w,onFocus:O=>{var z;if(Ql(O,p))(z=S.current)==null||z.focus();else{const I=A?A.domReference:null,V=yM(I);V==null||V.focus()}}}),_&&p&&v.jsx("span",{role:f,"aria-owns":g,style:k4}),p&&Tr.createPortal(u,p),_&&p&&v.jsx(yc,{"data-type":"outside",ref:x,onFocus:O=>{var z;if(Ql(O,p))(z=T.current)==null||z.focus();else{const I=A?A.domReference:null,V=gM(I);V==null||V.focus(),A!=null&&A.closeOnFocusOut&&(A==null||A.onOpenChange(!1,ct(gc,O.nativeEvent)))}}})]})]})});function OM(){const e=new Map;return{emit(t,s){var i;(i=e.get(t))==null||i.forEach(o=>o(s))},on(t,s){e.has(t)||e.set(t,new Set),e.get(t).add(s)},off(t,s){var i;(i=e.get(t))==null||i.delete(s)}}}class Kx{constructor(){ge(this,"nodesRef",{current:[]});ge(this,"events",OM())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const s=this.nodesRef.current.findIndex(i=>i===t);s!==-1&&this.nodesRef.current.splice(s,1)}}const jM=E.createContext(null),DM=E.createContext(null),Ua=()=>{var e;return((e=E.useContext(jM))==null?void 0:e.id)||null},Mo=e=>{const t=E.useContext(DM);return e??t};function _M(e){const t=Hm(),s=Mo(e),i=Ua();return Me(()=>{if(!t)return;const o={id:t,parentId:i};return s==null||s.addNode(o),()=>{s==null||s.removeNode(o)}},[s,t,i]),t}function N4(e){const{children:t,id:s}=e,i=Ua();return v.jsx(jM.Provider,{value:E.useMemo(()=>({id:s,parentId:i}),[s,i]),children:t})}function O4(e){const{children:t,externalTree:s}=e,i=bn(()=>s??new Kx).current;return v.jsx(DM.Provider,{value:i,children:t})}function j4(e,t){const s=$t(zn(e));return e instanceof s.KeyboardEvent?"keyboard":e instanceof s.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||(id(e)?"keyboard":t||"mouse"):"touches"in e?"touch":e instanceof s.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const KE=20;let go=[];function Yx(){go=go.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function YE(e){Yx(),e&&Dn(e)!=="body"&&(go.push(new WeakRef(e)),go.length>KE&&(go=go.slice(-KE)))}function $E(){var e;return Yx(),(e=go[go.length-1])==null?void 0:e.deref()}function D4(e){return e?Zm(e)?e:Wm(e)[0]||e:null}function QE(e){var o;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((o=e.getAttribute("role"))!=null&&o.includes("dialog")))return;const s=mM(e).filter(l=>{const u=l.getAttribute("data-tabindex")||"";return Zm(l)||l.hasAttribute("data-tabindex")&&!u.startsWith("-")}),i=e.getAttribute("tabindex");s.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function IM(e){const{context:t,children:s,disabled:i=!1,initialFocus:o=!0,returnFocus:l=!0,explicitReturnFocus:u,restoreFocus:d=!1,modal:f=!0,closeOnFocusOut:h=!0,openInteractionType:p="",nextFocusableElement:g,previousFocusableElement:b,beforeContentFocusGuardRef:w,externalTree:x,getInsideElements:S}=e,T=t.useState("open"),A=t.useState("domReferenceElement"),C=t.useState("floatingElement"),{events:k,dataRef:M}=t.context,D=Le(()=>{var Te;return(Te=M.current.floatingContext)==null?void 0:Te.nodeId}),_=o===!1,N=hb(A)&&_,O=Jt(o),z=Jt(l),I=Jt(u),V=Jt(p),$=Jt(T),X=Mo(x),B=kM(),q=E.useRef(!1),F=E.useRef(!1),ie=E.useRef(!1),Q=E.useRef(null),ae=E.useRef(""),ne=E.useRef(""),pe=E.useRef(null),ee=E.useRef(null),ve=Ma(pe,w,B==null?void 0:B.beforeInsideRef),P=Ma(ee,B==null?void 0:B.afterInsideRef),K=Ln(),L=Ln(),H=rd(),fe=B!=null,oe=mb(C),ye=Le((Te=oe)=>Te?Wm(Te):[]),ce=Le(()=>(S==null?void 0:S().filter(Te=>Te!=null))??[]);E.useEffect(()=>{if(i||!f)return;function Te(Ae){Ae.key==="Tab"&&qe(oe,rs(vt(oe)))&&ye().length===0&&!N&&Ti(Ae)}const Pe=vt(oe);return rt(Pe,"keydown",Te)},[i,oe,f,N,ye]),E.useEffect(()=>{if(i||!T)return;const Te=vt(oe);function Pe(){ie.current=!1}function Ae(Ue){const Se=zn(Ue),Ye=ce(),xe=qe(C,Se)||qe(A,Se)||qe(B==null?void 0:B.portalNode,Se)||Ye.some(Xe=>Xe===Se||qe(Xe,Se));ie.current=!xe,ne.current=Ue.pointerType||"keyboard",sd(Se,`[${C4}]`)&&(F.current=!0,L.start(0,()=>{F.current=!1}))}function Ge(){ne.current="keyboard"}return Ii(rt(Te,"pointerdown",Ae,!0),rt(Te,"pointerup",Pe,!0),rt(Te,"pointercancel",Pe,!0),rt(Te,"keydown",Ge,!0),Pe)},[i,C,A,oe,T,B,L,ce]),E.useEffect(()=>{if(i||!h)return;const Te=vt(oe);function Pe(){F.current=!0,L.start(0,()=>{F.current=!1})}function Ae(Ye){const xe=zn(Ye);Zm(xe)&&(Q.current=xe)}function Ge(Ye){const xe=Ye.relatedTarget,Xe=Ye.currentTarget,We=zn(Ye);f&&xe==null&&We!=null&&qe(C,We)&&YE(We),queueMicrotask(()=>{const pt=D(),le=t.context.triggerElements,he=ce(),Ke=(xe==null?void 0:xe.hasAttribute(Zl("focus-guard")))&&[pe.current,ee.current,B==null?void 0:B.beforeInsideRef.current,B==null?void 0:B.afterInsideRef.current,B==null?void 0:B.beforeOutsideRef.current,B==null?void 0:B.afterOutsideRef.current,ar(b),ar(g)].includes(xe),Ee=!(qe(A,xe)||qe(C,xe)||qe(xe,C)||qe(B==null?void 0:B.portalNode,xe)||he.some(we=>we===xe||qe(we,xe))||le.hasMatchingElement(we=>qe(we,xe))||Ke||X&&(Eo(X.nodesRef.current,pt).find(we=>{var ot,Ze;return qe((ot=we.context)==null?void 0:ot.elements.floating,xe)||qe((Ze=we.context)==null?void 0:Ze.elements.domReference,xe)})||_E(X.nodesRef.current,pt).find(we=>{var ot,Ze,wt;return[(ot=we.context)==null?void 0:ot.elements.floating,mb((Ze=we.context)==null?void 0:Ze.elements.floating)].includes(xe)||((wt=we.context)==null?void 0:wt.elements.domReference)===xe})));if(Xe===A&&oe&&QE(oe),d&&Xe!==A&&!Xm(We)&&rs(Te)===Te.body){if(Bt(oe)&&(oe.focus(),d==="popup")){H.request(()=>{oe.focus()});return}const we=ye(),ot=Q.current,Ze=(ot&&we.includes(ot)?ot:null)||we[we.length-1]||oe;Bt(Ze)&&Ze.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(N||!f)&&xe&&Ee&&!F.current&&(N||xe!==$E())&&(q.current=!0,t.setOpen(!1,ct(gc,Ye)))})}function Ue(){ie.current||(M.current.insideReactTree=!0,K.start(0,()=>{M.current.insideReactTree=!1}))}const Se=Bt(A)?A:null;if(!(!C&&!Se))return Ii(Se&&rt(Se,"focusout",Ge),Se&&rt(Se,"pointerdown",Pe),C&&rt(C,"focusin",Ae),C&&rt(C,"focusout",Ge),C&&B&&rt(C,"focusout",Ue,!0))},[i,A,C,oe,f,X,B,t,h,d,ye,N,D,M,K,L,H,g,b,ce]),E.useEffect(()=>{var Xe,We,pt;if(i||!C||!T)return;const Te=Array.from(((Xe=B==null?void 0:B.portalNode)==null?void 0:Xe.querySelectorAll(`[${Zl("portal")}]`))||[]),Ae=(pt=(We=(X?_E(X.nodesRef.current,D()):[]).find(le=>{var he;return hb(((he=le.context)==null?void 0:he.elements.domReference)||null)}))==null?void 0:We.context)==null?void 0:pt.elements.domReference,Ue=[...[C,...Te,pe.current,ee.current,B==null?void 0:B.beforeOutsideRef.current,B==null?void 0:B.afterOutsideRef.current,...ce()],Ae,ar(b),ar(g),N?A:null].filter(le=>le!=null),Se=GE(Ue,{ariaHidden:f||N,mark:!1}),Ye=[C,...Te].filter(le=>le!=null),xe=GE(Ye);return()=>{xe(),Se()}},[T,i,A,C,f,B,N,X,D,g,b,ce]),Me(()=>{if(!T||i||!Bt(oe))return;ae.current="",ne.current="";const Te=vt(oe),Pe=rs(Te);queueMicrotask(()=>{const Ae=O.current,Ge=typeof Ae=="function"?Ae(V.current||""):Ae;if(Ge===void 0||Ge===!1||qe(oe,Pe))return;let Se=null;const Ye=()=>(Se==null&&(Se=ye(oe)),Se[0]||oe);let xe;Ge===!0||Ge===null?xe=Ye():xe=ar(Ge),xe=xe||Ye();const Xe=qe(oe,rs(Te)),We=M.current.openEvent,pt=(We==null?void 0:We.type)==="mousedown"&&id(We);qh(xe,{sync:pt,preventScroll:xe===oe,shouldFocus(){if(!$.current)return!1;if(Xe)return!0;const le=rs(Te);return!(le!==xe&&qe(oe,le))}})})},[i,T,oe,ye,O,V,$,M]);const me=E.useRef(null);Me(()=>{if(i||!oe){me.current=null;return}me.current&&(me.current.cancelled=!0,me.current=null);const Te=vt(oe),Pe=rs(Te),Ae=V.current==null;YE(Pe);function Ge(Se){var Ye;if(Se.open||(ae.current=j4(Se.nativeEvent,ne.current)),(Se.reason===gc&&((Ye=Se.triggerElement)!=null&&Ye.hasAttribute(Zl("focus-guard")))||Se.reason===hn&&Se.nativeEvent.type==="mouseleave")&&(q.current=!0),Se.reason===qx)if(Se.nested)q.current=!1;else if(id(Se.nativeEvent)||_x(Se.nativeEvent))q.current=!1;else{let xe=!1;vt(oe).createElement("div").focus({get preventScroll(){return xe=!0,!1}}),xe?q.current=!1:q.current=!0}}k.on("openchange",Ge);function Ue(Se){const Ye=z.current;let xe=typeof Ye=="function"?Ye(Se):Ye;if(xe===void 0||xe===!1)return null;xe===null&&(xe=!0);const Xe=A!=null&&A.isConnected?A:null,We=Pe!=null&&Pe.isConnected&&Dn(Pe)!=="body"?Pe:null;let pt=Ae?We||Xe:Xe||We;return pt||(pt=$E()||null),typeof xe=="boolean"?pt:ar(xe)||pt||null}return()=>{k.off("openchange",Ge);const Se=rs(Te),Ye=ce(),xe=qe(C,Se)||Ye.some(he=>he===Se||qe(he,Se))||X&&Eo(X.nodesRef.current,D(),!1).some(he=>{var Ke;return qe((Ke=he.context)==null?void 0:Ke.elements.floating,Se)}),Xe=z.current,We=ae.current,pt=Ue(We),le={cancelled:!1};me.current=le,queueMicrotask(()=>{me.current===le&&(me.current=null);const he=D4(pt),Ke=I.current??typeof Xe!="boolean";if(!le.cancelled&&Xe&&!q.current&&Bt(he)&&(!(!Ke&&he!==Se&&Se!==Te.body)||xe)){const Ee={preventScroll:!0};We==="keyboard"&&(Ee.focusVisible=!0),he.focus(Ee)}q.current=!1})}},[i,C,oe,z,I,V,k,X,A,D,ce]),Me(()=>{if(!Sr||T||!C)return;const Te=rs(vt(C));!Bt(Te)||!Ed(Te)||qe(C,Te)&&Te.blur()},[T,C]),Me(()=>{if(!(i||!B))return B.setFocusManagerState({modal:f,closeOnFocusOut:h,open:T,onOpenChange:t.setOpen,domReference:A}),()=>{B.setFocusManagerState(null)}},[i,B,f,T,t,h,A]),Me(()=>{if(!(i||!oe))return QE(oe),()=>{queueMicrotask(Yx)}},[i,oe]);const ze=!i&&(f?!N:!0)&&(fe||f);return v.jsxs(E.Fragment,{children:[ze&&v.jsx(yc,{"data-type":"inside",ref:ve,onFocus:Te=>{var Pe;if(f){const Ae=ye();qh(Ae[Ae.length-1])}else if(B!=null&&B.portalNode)if(q.current=!1,Ql(Te,B.portalNode)){const Ae=gM(A);Ae==null||Ae.focus()}else(Pe=ar(b??B.beforeOutsideRef))==null||Pe.focus()}}),s,ze&&v.jsx(yc,{"data-type":"inside",ref:P,onFocus:Te=>{var Pe;if(f)qh(ye()[0]);else if(B!=null&&B.portalNode)if(h&&(q.current=!0),Ql(Te,B.portalNode)){const Ae=yM(A);Ae==null||Ae.focus()}else(Pe=ar(g??B.afterOutsideRef))==null||Pe.focus()}})]})}function _4(e,t={}){const{enabled:s=!0,event:i="click",toggle:o=!0,ignoreMouse:l=!1,stickIfOpen:u=!0,touchOpenDelay:d=0,reason:f=Tc}=t,h=e.context.dataRef,p=E.useRef(void 0),g=rd(),b=Ln(),w=E.useMemo(()=>{function x(T,A,C,k){const M=ct(f,A,C);T&&k==="touch"&&d>0?b.start(d,()=>{e.setOpen(!0,M)}):e.setOpen(T,M)}function S(T,A,C){const k=h.current.openEvent,M=e.select("domReferenceElement")!==A;return T&&M||!T||!o?!0:k&&(typeof u=="function"?u():u)?!C(k.type):!1}return{onPointerDown(T){p.current=xo(T.pointerType,!0)&&_x(T.nativeEvent)?"virtual":T.pointerType},onMouseDown(T){const A=p.current,C=T.nativeEvent,k=e.select("open");if(T.button!==0||i==="click"||xo(A,!0)&&l)return;const M=S(k,T.currentTarget,O=>O==="click"||O==="mousedown"),D=zn(C),_=Ed(D);if(_||A==="virtual"){x(M,C,_?D:T.currentTarget,A);return}const N=T.currentTarget;g.request(()=>{x(M,C,N,A)})},onClick(T){if(i==="mousedown-only")return;const A=p.current;if(i==="mousedown"&&A){p.current=void 0;return}if(xo(A,!0)&&l)return;const C=e.select("open"),k=S(C,T.currentTarget,M=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");x(k,T.nativeEvent,T.currentTarget,A)},onKeyDown(){p.current=void 0}}},[h,i,l,f,e,u,o,g,b,d]);return E.useMemo(()=>s?{reference:w}:_t,[s,w])}function I4(e,t){let s=null,i=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var w;const l=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},u=t.axis==="x"||t.axis==="both",d=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(((w=t.dataRef.current.openEvent)==null?void 0:w.type)||"")&&t.pointerType!=="touch",h=t.axis==="y"?l.width:0,p=t.axis==="x"?l.height:0;let g=l.x,b=l.y;return s==null&&t.x&&u&&(s=l.x-t.x),i==null&&t.y&&d&&(i=l.y-t.y),g-=s||0,b-=i||0,(!o||f)&&(g=u&&t.x!=null?t.x:g,b=d&&t.y!=null?t.y:b),o=!0,{width:h,height:p,x:g,y:b,top:b,right:g+h,bottom:b+p,left:g}}}}function XE(e){return e!=null&&e.clientX!=null}function P4(e,t={}){const{enabled:s=!0,axis:i="both"}=t,o=e.useState("open"),l=e.useState("floatingElement"),u=e.useState("domReferenceElement"),d=e.context.dataRef,f=E.useRef(!1),h=E.useRef(null),[p,g]=E.useState(),[b,w]=E.useState([]),x=Le(k=>{e.set("positionReference",k)}),S=Le((k,M,D)=>{f.current||d.current.openEvent&&!XE(d.current.openEvent)||e.set("positionReference",I4(D??u,{x:k,y:M,axis:i,dataRef:d,pointerType:p}))}),T=Le(k=>{o?h.current||(S(k.clientX,k.clientY,k.currentTarget),w([])):S(k.clientX,k.clientY,k.currentTarget)}),A=xo(p)?l:o;E.useEffect(()=>{if(!s){x(u);return}if(!A)return;function k(){var _;(_=h.current)==null||_.call(h),h.current=null}const M=$t(l);function D(_){const N=zn(_);qe(l,N)?k():S(_.clientX,_.clientY)}return!d.current.openEvent||XE(d.current.openEvent)?h.current=rt(M,"mousemove",D):x(u),k},[A,s,l,d,u,e,S,x,b]),E.useEffect(()=>()=>{e.set("positionReference",null)},[e]),E.useEffect(()=>{s&&!l&&(f.current=!1)},[s,l]),E.useEffect(()=>{!s&&o&&(f.current=!0)},[s,o]);const C=E.useMemo(()=>{function k(M){g(M.pointerType)}return{onPointerDown:k,onPointerEnter:k,onMouseMove:T,onMouseEnter:T}},[T]);return E.useMemo(()=>s?{reference:C,trigger:C}:{},[s,C])}function z4(){return!1}function L4(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function $x(e,t={}){const{enabled:s=!0,escapeKey:i=!0,outsidePress:o=!0,outsidePressEvent:l="sloppy",referencePress:u=z4,bubbles:d,externalTree:f}=t,h=e.useState("open"),p=e.useState("floatingElement"),{dataRef:g,events:b}=e.context,w=Mo(f),x=Le(typeof o=="function"?o:()=>!1),S=typeof o=="function"?x:o,T=S!==!1,A=Le(()=>l),{escapeKey:C,outsidePress:k}=L4(d),M=E.useRef(!1),D=E.useRef(!1),_=E.useRef(!1),N=E.useRef(!1),O=E.useRef(!1),z=E.useRef(""),I=E.useRef(null),V=Ln(),$=Ln(),X=Ln(),B=Le(()=>{$.clear(),g.current.insideReactTree=!1}),q=Le(P=>{var H;const K=(H=g.current.floatingContext)==null?void 0:H.nodeId;return(w?Eo(w.nodesRef.current,K):[]).some(fe=>{var oe;return((oe=fe.context)==null?void 0:oe.open)&&!fe.context.dataRef.current[P]})}),F=Le(P=>lv(P,e.select("floatingElement"))||lv(P,e.select("domReferenceElement"))),ie=Le(P=>{u()&&e.setOpen(!1,ct(Tc,P.nativeEvent))}),Q=Le(P=>{if(!h||!s||!i||P.key!=="Escape")return;const K=LB(P)?P.nativeEvent:P;if(O.current||K.isComposing||!C&&q("__escapeKeyBubbles"))return;const L=ct(ep,K);e.setOpen(!1,L),L.isCanceled||P.preventDefault(),!C&&!L.isPropagationAllowed&&P.stopPropagation()}),ae=Le(()=>{g.current.insideReactTree=!0,$.start(0,B)}),ne=Le(P=>{if(!h||!s||P.button!==0)return;const K=zn(P.nativeEvent);qe(e.select("floatingElement"),K)&&(M.current||(M.current=!0,D.current=!1))}),pe=Le(P=>{!h||!s||(P.defaultPrevented||P.nativeEvent.defaultPrevented)&&M.current&&(D.current=!0)});E.useEffect(()=>{function P(K){K.open||(N.current=!1)}return b.on("openchange",P),()=>{b.off("openchange",P)}},[b]),E.useEffect(()=>B,[B]),E.useEffect(()=>{if(!h||!s)return h||(N.current=!1,O.current=!1,z.current="",I.current=null),B;g.current.__escapeKeyBubbles=C,g.current.__outsidePressBubbles=k;const P=new zi,K=vt(p);function L(){X.clear(),O.current=!0}function H(){O.current=!0,X.start(Sr?5:0,()=>{O.current=!1})}function fe(){_.current=!0,P.start(0,()=>{_.current=!1})}function oe(){M.current=!1,D.current=!1}function ye(){const le=z.current,he=le==="pen"||!le?"mouse":le,Ke=A(),Ee=typeof Ke=="function"?Ke():Ke;return typeof Ee=="string"?Ee:Ee[he]}function ce(le){const he=ye();return he==="intentional"&&le.type!=="click"||he==="sloppy"&&le.type==="click"}function me(le){var Ee;const he=(Ee=g.current.floatingContext)==null?void 0:Ee.nodeId,Ke=w&&Eo(w.nodesRef.current,he).some(we=>{var ot;return lv(le,(ot=we.context)==null?void 0:ot.elements.floating)});return F(le)||Ke}function ze(le){if(ce(le)){le.type!=="click"&&!F(le)&&(P.clear(),_.current=!1),B();return}if(g.current.insideReactTree){B();return}const he=zn(le),Ke=`[${Zl("inert")}]`,Ee=bt(he)?he.getRootNode():null,we=Array.from((ka(Ee)?Ee:vt(e.select("floatingElement"))).querySelectorAll(Ke)),ot=e.context.triggerElements;if(he&&(ot.hasElement(he)||ot.hasMatchingElement(wt=>qe(wt,he))))return;let Ze=bt(he)?he:null;for(;Ze&&!pr(Ze);){const wt=vr(Ze);if(pr(wt)||!bt(wt))break;Ze=wt}if(!(we.length&&bt(he)&&!IB(he)&&!qe(he,e.select("floatingElement"))&&we.every(wt=>!qe(Ze,wt)))){if(Bt(he)&&!("touches"in le)){const wt=pr(he),on=Ss(he),Vt=/auto|scroll/,Rs=wt||Vt.test(on.overflowX),cs=wt||Vt.test(on.overflowY),ii=Rs&&he.clientWidth>0&&he.scrollWidth>he.clientWidth,Li=cs&&he.clientHeight>0&&he.scrollHeight>he.clientHeight,Ut=on.direction==="rtl",Es=Li&&(Ut?le.offsetX<=he.offsetWidth-he.clientWidth:le.offsetX>he.clientWidth),Bi=ii&&le.offsetY>he.clientHeight;if(Es||Bi)return}if(!me(le)){if(ye()==="intentional"){if(le.detail!==0&&!id(le)&&!N.current)return;if(_.current){P.clear(),_.current=!1;return}}typeof S=="function"&&!S(le)||q("__outsidePressBubbles")||(e.setOpen(!1,ct(qx,le)),B())}}}function Te(le){ye()!=="sloppy"||le.pointerType==="touch"||!e.select("open")||!s||F(le)||ze(le)}function Pe(le){if(ye()!=="sloppy"||!e.select("open")||!s||F(le))return;const he=le.touches[0];he&&(I.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},V.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function Ae(le,he){const Ke=zn(le);if(!Ke)return;const Ee=rt(Ke,le.type,()=>{he(le),Ee()})}function Ge(le){z.current="touch",Ae(le,Pe)}function Ue(le){V.clear(),le.type==="pointerdown"&&(le.button===0&&(N.current=!0),z.current=le.pointerType),!(le.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&Ae(le,he=>{he.type==="pointerdown"?Te(he):ze(he)})}function Se(le){if(le.type==="pointercancel"&&(N.current=!1),!M.current)return;const he=D.current;if(oe(),ye()==="intentional"){if(le.type==="pointercancel"){he&&fe();return}if(!me(le)){if(he){fe();return}typeof S=="function"&&!S(le)||(P.clear(),_.current=!0,B())}}}function Ye(le){if(ye()!=="sloppy"||!I.current||F(le))return;const he=le.touches[0];if(!he)return;const Ke=Math.abs(he.clientX-I.current.startX),Ee=Math.abs(he.clientY-I.current.startY),we=Math.sqrt(Ke*Ke+Ee*Ee);we>5&&(I.current.dismissOnTouchEnd=!0),we>10&&(ze(le),V.clear(),I.current=null)}function xe(le){Ae(le,Ye)}function Xe(le){ye()!=="sloppy"||!I.current||F(le)||(I.current.dismissOnTouchEnd&&ze(le),V.clear(),I.current=null)}function We(le){Ae(le,Xe)}const pt=Ii(i&&Ii(rt(K,"keydown",Q),rt(K,"compositionstart",L),rt(K,"compositionend",H)),T&&Ii(rt(K,"click",Ue,!0),rt(K,"pointerdown",Ue,!0),rt(K,"pointerup",Se,!0),rt(K,"pointercancel",Se,!0),rt(K,"mousedown",Ue,!0),rt(K,"mouseup",Se,!0),rt(K,"touchstart",Ge,{capture:!0,passive:!0}),rt(K,"touchmove",xe,{capture:!0,passive:!0}),rt(K,"touchend",We,{capture:!0,passive:!0})));return()=>{pt(),P.clear(),oe(),_.current=!1}},[g,p,i,T,S,h,s,C,k,Q,B,A,q,F,w,e,V,X]);const ee=E.useMemo(()=>({onKeyDown:Q,onPointerDown:ie,onClick:ie}),[Q,ie]),ve=E.useMemo(()=>({onKeyDown:Q,onPointerDown:pe,onMouseDown:pe,onClickCapture:ae,onMouseDownCapture(P){ae(),ne(P)},onPointerDownCapture(P){ae(),ne(P)},onMouseUpCapture:ae,onTouchEndCapture:ae,onTouchMoveCapture:ae}),[Q,ae,ne,pe]);return E.useMemo(()=>s?{reference:ee,floating:ve,trigger:ee}:{},[s,ee,ve])}function PM(e){const{popupStore:t,treatPopupAsFloatingElement:s=!1,floatingRootContext:i,floatingId:o,nested:l,onOpenChange:u}=e,d=t.useState("open"),f=t.useState("activeTriggerElement"),h=t.useState(s?"popupElement":"positionerElement"),p=u;return t.useSyncedValue("floatingId",o),Me(()=>{const g={open:d,floatingId:o,referenceElement:f,floatingElement:h};bt(f)&&(g.domReferenceElement=f),i.state.positionReference===i.state.referenceElement&&(g.positionReference=f),i.update(g)},[d,o,f,h,i]),i.context.onOpenChange=p,i.context.nested=l,i}function B4(e){const{open:t,ref:s,preventUnmountOnClose:i,setPreventUnmountOnClose:o,onUnmount:l,animateInitialOpen:u}=e,d=Le(o),{mounted:f,setMounted:h,transitionStatus:p}=i4(t,!1,!1,u),g=t?!1:i;Me(()=>{t&&d(!1)},[t,d]);const b=E.useRef(f),w=E.useRef(!1),x=Jk(),S=()=>{b.current=!1,h(!1),l()};Me(()=>{b.current=f,w.current&&(w.current=!1,!t&&f&&S())});const T=Le(()=>{if(b.current){if(t){w.current=!0,x();return}S()}});return Jm({enabled:f&&!t&&!g,open:t,ref:s,onComplete(){t||T()}}),{mounted:f,transitionStatus:p,preventUnmountingOnClose:g,forceUnmount:T}}const Qx={tabIndex:-1,[db]:""};function U4(e){return t=>t==="touch"?e.current:!0}function zM(e,t=!1){const s=Hm(),i=Ua()!=null,o=bn(()=>e(s,i)).current;return PM({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:s,nested:i,onOpenChange:o.setOpen}),o}function Xx({handle:e,store:t}){return Me(()=>e.attachStore(t),[e,t]),null}function ZE(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function V4(e,t){const s=E.useRef(null);return Le(i=>{const o=s.current;if(o!==null){if(o.element===i&&o.store===t&&o.id===e)return;s.current=null;const l=o.store;l.context.triggerElements.getById(o.id)===o.element&&(l.context.triggerElements.delete(o.id),ZE(l))}i!==null&&e!==void 0&&(s.current={store:t,id:e,element:i},t.context.triggerElements.add(e,i),ZE(t))})}function Zx(e,t,s,i=!1){let o=e.preventUnmountingOnClose;t?o=!1:i&&(o=!0);const l=(s==null?void 0:s.id)??null;let u=e.activeTriggerId,d=e.activeTriggerElement;return(l||t)&&(u=l,d=s??null),{open:t,preventUnmountingOnClose:o,activeTriggerId:u,activeTriggerElement:d,openedWithoutTrigger:t?s==null:e.openedWithoutTrigger}}function LM(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function F4(e,t,s,i={}){var p,g,b;const o=s.reason,l=o===hn,u=t&&o===Xl,d=!t&&(o===Tc||o===ep),f=LM(s);if((g=(p=e.context).onOpenChange)==null||g.call(p,t,s),s.isCanceled)return;(b=i.onBeforeDispatch)==null||b.call(i),e.state.floatingRootContext.dispatchOpenChange(t,s);const h=()=>{const w=Zx(e.state,t,s.trigger,f()),x={...i.extraState,...w};u?x.instantType="focus":d?x.instantType="dismiss":l&&(x.instantType=void 0),e.update(x)};l?Tr.flushSync(h):h()}function BM(e,t,s,i){const o=s.useState("isMountedByTrigger",e),l=V4(e,s),u=Le(f=>{const h=s.select("open"),p=s.select("activeTriggerId");if(p===e){const g={activeTriggerElement:f,...h?i:null};s.update(g);return}if(p==null&&h&&!s.state.openedWithoutTrigger){const g={activeTriggerId:e??null,activeTriggerElement:f,...i};s.update(g)}}),d=Le(f=>{l(f),f&&u(f)});return Me(()=>(d(t.current),()=>d(null)),[d,t,s,e]),Me(()=>{if(o){const f={activeTriggerElement:t.current,...i};s.update(f)}},[o,s,t,...Object.values(i)]),{registerTrigger:d,isMountedByThisTrigger:o}}function Wx(e,t={}){const{closeOnActiveTriggerUnmount:s=!1}=t,i=E.useRef(null),o=e.useState("open"),l=e.useState("triggerCount"),u=e.useState("activeTriggerId"),d=e.useState("activeTriggerElement");Me(()=>{if(!o){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0),e.state.openedWithoutTrigger&&e.set("openedWithoutTrigger",!1);return}const f=e.context.triggerElements.size,h={};e.state.triggerCount!==f&&(h.triggerCount=f);const p=e.select("activeTriggerId");let g=null;if(p){const b=e.context.triggerElements.getById(p);if(b)i.current=p,b!==e.state.activeTriggerElement&&(h.activeTriggerElement=b);else{for(const[w,x]of e.context.triggerElements.entries())if(x===e.state.activeTriggerElement){h.activeTriggerId=w,h.activeTriggerElement=x,i.current=w;break}h.activeTriggerId===void 0&&(i.current===p?g=p:i.current=null)}}else i.current=null;if(!g&&!p&&!e.state.openedWithoutTrigger&&f===1){const b=e.context.triggerElements.entries().next();if(!b.done){const[w,x]=b.value;h.activeTriggerId=w,h.activeTriggerElement=x,i.current=w}}(h.triggerCount!==void 0||h.activeTriggerId!==void 0||h.activeTriggerElement!==void 0)&&e.update(h),g&&s&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===g&&!e.context.triggerElements.getById(g)){const b=ct(Na);e.setOpen(!1,b),b.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,l,u,d,s])}function Jx(e,t,s,i){const{mounted:o,transitionStatus:l,forceUnmount:u}=B4({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:d=>t.set("preventUnmountingOnClose",d),animateInitialOpen:i,onUnmount(){var d,f;t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),s==null||s(),(f=(d=t.context).onOpenChangeComplete)==null||f.call(d,!1)}});return bn(()=>(t.set("mounted",o),null)),t.useSyncedValues({mounted:o,transitionStatus:l}),{forceUnmount:u,transitionStatus:l}}function e0(e,t){e.useSyncedValues(t),Me(()=>()=>{e.update({activeTriggerProps:_t,inactiveTriggerProps:_t,popupProps:_t})},[e])}function q4(e,t){Me(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Me(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class t0{constructor(){ge(this,"idMap",new Map)}add(t,s){this.idMap.set(t,s)}delete(t){this.idMap.delete(t)}hasElement(t){for(const s of this.idMap.values())if(s===t)return!0;return!1}hasMatchingElement(t){for(const s of this.idMap.values())if(t(s))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var n0=tk();const vb=[];let bb;function H4(){return bb}function G4(e){vb.push(e)}function tp(e){const t=(s,i)=>{const o=bn(K4).current;let l;try{bb=o;for(const u of vb)u.before(o);l=e(s,i);for(const u of vb)u.after(o);o.didInitialize=!0}finally{bb=void 0}return l};return t.displayName=e.displayName||e.name,t}function UM(e){return E.forwardRef(tp(e))}function K4(){return{didInitialize:!1}}const Y4=Tx(19),$4=Y4?X4:Z4;function VM(e,t,s,i,o){return $4(e,t,s,i,o)}function Q4(e,t,s,i,o){const l=E.useCallback(()=>t(e.getSnapshot(),s,i,o),[e,t,s,i,o]);return n0.useSyncExternalStore(e.subscribe,l,l)}G4({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let s=0;s<e.syncHooks.length;s+=1){const i=e.syncHooks[s],o=i.selector(i.store.state,i.a1,i.a2,i.a3);Object.is(i.value,o)||(t=!0,i.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const s=new Set;for(const o of e.syncHooks)s.add(o.store);const i=[];for(const o of s)i.push(o.subscribe(t));return()=>{for(const o of i)o()}}),n0.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function X4(e,t,s,i,o){const l=H4();if(!l)return Q4(e,t,s,i,o);const u=l.syncIndex;l.syncIndex+=1;let d;return l.didInitialize?(d=l.syncHooks[u],(d.store!==e||d.selector!==t||!Object.is(d.a1,s)||!Object.is(d.a2,i)||!Object.is(d.a3,o))&&(d.store!==e&&(l.didChangeStore=!0),d.store=e,d.selector=t,d.a1=s,d.a2=i,d.a3=o,d.value=t(e.getSnapshot(),s,i,o))):(d={store:e,selector:t,a1:s,a2:i,a3:o,value:t(e.getSnapshot(),s,i,o)},l.syncHooks.push(d)),d.value}function Z4(e,t,s,i,o){return nk.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,l=>t(l,s,i,o))}class W4{constructor(t){ge(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));ge(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const s=this.updateTick;for(const i of this.listeners){if(s!==this.updateTick)return;i(t)}}update(t){for(const s in t)if(!Object.is(this.state[s],t[s])){this.setState({...this.state,...t});return}}set(t,s){Object.is(this.state[t],s)||this.setState({...this.state,[t]:s})}notifyAll(){const t={...this.state};this.setState(t)}use(t,s,i,o){return VM(this,t,s,i,o)}}class np extends W4{constructor(t,s={},i){super(t),this.context=s,this.selectors=i}useSyncedValue(t,s){E.useDebugValue(t);const i=this;Me(()=>{i.state[t]!==s&&i.set(t,s)},[i,t,s])}useSyncedValueWithCleanup(t,s){const i=this;Me(()=>(i.state[t]!==s&&i.set(t,s),()=>{i.set(t,void 0)}),[i,t,s])}useSyncedValues(t){const s=this,i=Object.values(t);Me(()=>{s.update(t)},[s,...i])}useControlledProp(t,s){E.useDebugValue(t);const i=this,o=s!==void 0;Me(()=>{o&&!Object.is(i.state[t],s)&&i.setState({...i.state,[t]:s})},[i,t,s,o])}select(t,s,i,o){const l=this.selectors[t];return l(this.state,s,i,o)}useState(t,s,i,o){return E.useDebugValue(t),VM(this,this.selectors[t],s,i,o)}useContextCallback(t,s){E.useDebugValue(t);const i=Le(s??rn);this.context[t]=i}useStateSetter(t){const s=E.useRef(void 0);return s.current===void 0&&(s.current=i=>{this.set(t,i)}),s.current}observe(t,s){let i;typeof t=="function"?i=t:i=this.selectors[t];let o=i(this.state);return s(o,o,this),this.subscribe(l=>{const u=i(l);if(!Object.is(o,u)){const d=o;o=u,s(u,d,this)}})}}const J4={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class eU extends np{constructor(s){const{syncOnly:i,nested:o,onOpenChange:l,triggerElements:u,...d}=s;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:l,dataRef:{current:{}},events:OM(),nested:o,triggerElements:u},J4);ge(this,"syncOpenEvent",(s,i)=>{(!s||!this.state.open||i!=null&&BB(i))&&(this.context.dataRef.current.openEvent=s?i:void 0)});ge(this,"dispatchOpenChange",(s,i)=>{this.syncOpenEvent(s,i.event);const o={open:s,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",o)});ge(this,"setOpen",(s,i)=>{var o,l,u,d;if(this.syncOnly){(l=(o=this.context).onOpenChange)==null||l.call(o,s,i);return}this.dispatchOpenChange(s,i),(d=(u=this.context).onOpenChange)==null||d.call(u,s,i)});this.syncOnly=i}}function s0(e,t,s=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new eU({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:s,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:_t,inactiveTriggerProps:_t,popupProps:_t}}const Pu=e=>e.triggerIdProp??e.activeTriggerId,mm=e=>e.openProp??e.open,WE=e=>{var s;return(((s=e.popupElement)==null?void 0:s.id)??e.floatingId)||void 0};function FM(e,t){return t!==void 0&&mm(e)&&Pu(e)===t}function tU(e,t){return FM(e,t)?!0:t!==void 0&&mm(e)&&Pu(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}const zu={open:mm,mounted:e=>e.mounted,transitionStatus:e=>mm(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Pu,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:WE,isTriggerActive:(e,t)=>t!==void 0&&Pu(e)===t,isOpenedByTrigger:(e,t)=>FM(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Pu(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>tU(e,t)?WE(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function qM(e){const t=E.useCallback(i=>e===void 0?rn:e.subscribeStore(i),[e]),s=E.useCallback(()=>e===void 0?void 0:e.store,[e]);return n0.useSyncExternalStore(t,s,()=>e==null?void 0:e.serverStore)}const fv=Nx&&Sr;function HM(e,t={}){const{enabled:s=!0,delay:i}=t,{events:o,dataRef:l}=e.context,u=E.useRef(!1),d=E.useRef(null),f=E.useRef(!0),h=Ln();E.useEffect(()=>{const g=e.select("domReferenceElement");if(!s)return;const b=$t(g);function w(){const T=e.select("domReferenceElement");!e.select("open")&&Bt(T)&&T===rs(vt(T))&&(u.current=!0,d.current=T)}function x(){f.current=!0}function S(){f.current=!1}return Ii(rt(b,"blur",w),fv&&rt(b,"keydown",x,!0),fv&&rt(b,"pointerdown",S,!0))},[e,s]),E.useEffect(()=>{if(!s)return;function g(b){if(b.reason===Tc||b.reason===ep){const w=e.select("domReferenceElement");bt(w)&&(d.current=w,u.current=!0)}}return o.on("openchange",g),()=>{o.off("openchange",g)}},[o,s,e]);const p=E.useMemo(()=>{function g(){u.current=!1,d.current=null}return{onMouseLeave(){g()},onFocus(b){const w=b.currentTarget;if(u.current){if(d.current===w)return;g()}const x=zn(b.nativeEvent);if(bt(x)){if(fv&&!b.relatedTarget){if(!f.current&&!Ed(x))return}else if(!zB(x))return}const S=cm(b.relatedTarget,e.context.triggerElements),{nativeEvent:T,currentTarget:A}=b;if(e.select("open")&&S||!i){e.setOpen(!0,ct(Xl,T,A));return}h.start(i,()=>{u.current||e.setOpen(!0,ct(Xl,T,A))})},onBlur(b){g();const w=b.relatedTarget,x=b.nativeEvent,S=bt(w)&&w.hasAttribute(Zl("focus-guard"))&&w.getAttribute("data-type")==="outside";h.start(0,()=>{var k;const T=e.select("domReferenceElement"),A=rs(vt(T));!w&&A===T||qe((k=l.current.floatingContext)==null?void 0:k.refs.floating.current,A)||qe(T,A)||S||cm(w??A,e.context.triggerElements)||e.setOpen(!1,ct(Xl,x))})}}},[l,i,e,h]);return E.useMemo(()=>s?{reference:p,trigger:p}:{},[s,p])}class i0{constructor(){ge(this,"pointerType");ge(this,"interactedInside",!1);ge(this,"handler");ge(this,"blockMouseMove",!0);ge(this,"performedPointerEventsMutation",!1);ge(this,"pointerEventsScopeElement",null);ge(this,"pointerEventsReferenceElement",null);ge(this,"pointerEventsFloatingElement",null);ge(this,"restTimeoutPending",!1);ge(this,"openChangeTimeout",new zi);ge(this,"restTimeout",new zi);ge(this,"handleCloseOptions");ge(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});ge(this,"disposeEffect",()=>this.dispose)}static create(){return new i0}}const pm=new WeakMap;function gm(e){var s,i,o;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&pm.get(t)===e&&((s=e.pointerEventsScopeElement)==null||s.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(o=e.pointerEventsFloatingElement)==null||o.style.removeProperty("pointer-events"),pm.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function GM(e,t){const{scopeElement:s,referenceElement:i,floatingElement:o}=t,l=pm.get(s);l&&l!==e&&gm(l),gm(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=s,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=o,pm.set(s,e),s.style.pointerEvents="none",i.style.pointerEvents="auto",o.style.pointerEvents="auto"}function r0(e){const t=e.context.dataRef.current,s=bn(()=>t.hoverInteractionState??i0.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=s),Vx(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function KM(e,t={}){const{enabled:s=!0,closeDelay:i=0,nodeId:o}=t,l=e.useState("open"),u=e.useState("floatingElement"),d=e.useState("domReferenceElement"),{dataRef:f}=e.context,h=Mo(),p=Ua(),g=r0(e),b=Ln(),w=Le(()=>{var T;return RM((T=f.current.openEvent)==null?void 0:T.type,g.interactedInside)}),x=Le(()=>{var T;return p4((T=f.current.openEvent)==null?void 0:T.type)}),S=Le(()=>{gm(g)});Me(()=>{l||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,S())},[l,g,S]),E.useEffect(()=>S,[S]),Me(()=>{var T,A,C,k,M;if(s&&l&&(T=g.handleCloseOptions)!=null&&T.blockPointerEvents&&x()&&bt(d)&&u){const D=d,_=u,N=vt(u),O=(C=(A=h==null?void 0:h.nodesRef.current.find($=>$.id===p))==null?void 0:A.context)==null?void 0:C.elements.floating;O&&(O.style.pointerEvents="");const z=g.pointerEventsScopeElement!==_?g.pointerEventsScopeElement:null,I=O!==_?O:null,V=((M=(k=g.handleCloseOptions)==null?void 0:k.getScope)==null?void 0:M.call(k))??z??I??sd(D,"[data-rootownerid]")??N.body;return GM(g,{scopeElement:V,referenceElement:D,floatingElement:_}),()=>{S()}}},[s,l,d,u,g,x,h,p,S]),E.useEffect(()=>{if(!s)return;function T(){return!!(h&&p&&Eo(h.nodesRef.current,p).length>0)}function A(N){const O=od(i,"close",g.pointerType),z=()=>{e.setOpen(!1,ct(hn,N)),h==null||h.events.emit("floating.closed",N)};O?g.openChangeTimeout.start(O,z):(g.openChangeTimeout.clear(),z())}function C(N){const O=zn(N);if(!PB(O)){g.interactedInside=!1;return}g.interactedInside=sd(O,"[aria-haspopup]")!=null}function k(){g.openChangeTimeout.clear(),b.clear(),h==null||h.events.off("floating.closed",D),S()}function M(N){var V;if(T()&&h){h.events.on("floating.closed",D);return}if(cm(N.relatedTarget,e.context.triggerElements))return;const O=((V=f.current.floatingContext)==null?void 0:V.nodeId)??o,z=N.relatedTarget;if(!(h&&O&&bt(z)&&Eo(h.nodesRef.current,O,!1).some($=>{var X;return qe((X=$.context)==null?void 0:X.elements.floating,z)}))){if(g.handler){g.handler(N);return}S(),x()&&!w()&&A(N)}}function D(N){!h||!p||T()||b.start(0,()=>{h.events.off("floating.closed",D),e.setOpen(!1,ct(hn,N)),h.events.emit("floating.closed",N)})}const _=u;return Ii(_&&rt(_,"mouseenter",k),_&&rt(_,"mouseleave",M),_&&rt(_,"pointerdown",C,!0),()=>{h==null||h.events.off("floating.closed",D)})},[s,u,e,f,i,o,x,w,S,g,h,p,b])}const nU={current:null};function YM(e,t={}){const{enabled:s=!0,delay:i=0,handleClose:o=null,mouseOnly:l=!1,restMs:u=0,move:d=!0,triggerElementRef:f=nU,externalTree:h,isActiveTrigger:p=!0,getHandleCloseContext:g,isClosing:b,shouldOpen:w,guardStaleOpen:x=!1}=t,{dataRef:S,events:T}=e.context,A=Mo(h),C=r0(e),k=E.useRef(!1),M=Jt(o),D=Jt(i),_=Jt(u),N=Jt(s),O=Jt(w),z=Jt(b),I=Le(()=>{var q;return RM((q=S.current.openEvent)==null?void 0:q.type,C.interactedInside)}),V=Le(()=>{var q;return((q=O.current)==null?void 0:q.call(O))!==!1}),$=Le((q,F,ie)=>{const Q=e.context.triggerElements;if(Q.hasElement(F))return!q||!qe(q,F);if(!bt(ie))return!1;const ae=ie;return Q.hasMatchingElement(ne=>qe(ne,ae))&&(!q||!qe(q,ae))}),X=Le(()=>{if(!C.handler)return;vt(e.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0}),B=Le(()=>{gm(C)});return p&&(C.handleCloseOptions=o==null?void 0:o.__options),E.useEffect(()=>X,[X]),E.useEffect(()=>{if(!s)return;function q(F){F.open?k.current=!1:(k.current=F.reason===hn,X(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return T.on("openchange",q),()=>{T.off("openchange",q)}},[s,T,C,X]),E.useEffect(()=>{if(!s)return;function q(pe,ee=!0){const ve=od(D.current,"close",C.pointerType);ve?C.openChangeTimeout.start(ve,()=>{e.setOpen(!1,ct(hn,pe)),A==null||A.events.emit("floating.closed",pe)}):ee&&(C.openChangeTimeout.clear(),e.setOpen(!1,ct(hn,pe)),A==null||A.events.emit("floating.closed",pe))}const F=f.current??(p?e.select("domReferenceElement"):null);if(!bt(F))return;function ie(pe){var Ae;if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,l&&!xo(C.pointerType))return;const ee=UE(_.current),ve=od(D.current,"open",C.pointerType),P=zn(pe),K=pe.currentTarget??null,L=e.select("domReferenceElement");let H=K;if(bt(P)&&!e.context.triggerElements.hasElement(P)){for(const Ge of e.context.triggerElements.elements())if(qe(Ge,P)){H=Ge;break}}bt(K)&&bt(L)&&!e.context.triggerElements.hasElement(K)&&qe(K,L)&&(H=L);const fe=H==null?!1:$(L,H,P),oe=e.select("open"),ye=((Ae=z.current)==null?void 0:Ae.call(z))??e.select("transitionStatus")==="ending",ce=!oe&&ye&&k.current,me=!fe&&bt(H)&&bt(L)&&qe(L,H)&&ce,ze=ee>0&&!ve,Te=fe&&(oe||ce)||me,Pe=!oe||fe;if(Te){V()&&e.setOpen(!0,ct(hn,pe,H));return}ze||(ve?C.openChangeTimeout.start(ve,()=>{Pe&&V()&&e.setOpen(!0,ct(hn,pe,H))}):Pe&&V()&&e.setOpen(!0,ct(hn,pe,H)))}function Q(pe){if(I()){B();return}X();const ee=e.select("domReferenceElement"),ve=vt(ee);C.restTimeout.clear(),C.restTimeoutPending=!1;const P=S.current.floatingContext??(g==null?void 0:g());if(cm(pe.relatedTarget,e.context.triggerElements))return;if(M.current&&P){e.select("open")||C.openChangeTimeout.clear();const L=f.current;C.handler=M.current({...P,tree:A,x:pe.clientX,y:pe.clientY,onClose(){B(),X(),N.current&&!I()&&L===e.select("domReferenceElement")&&q(pe,!0)}}),ve.addEventListener("mousemove",C.handler),C.handler(pe);return}(C.pointerType==="touch"?!qe(e.select("floatingElement"),pe.relatedTarget):!0)&&q(pe)}function ae(pe){qe(F,pe.relatedTarget)||(C.openChangeTimeout.clear(),C.restTimeout.clear(),C.restTimeoutPending=!1)}const ne=x?rt(F,"mouseout",ae):void 0;return d?Ii(rt(F,"mousemove",ie,{once:!0}),rt(F,"mouseenter",ie),rt(F,"mouseleave",Q),ne):Ii(rt(F,"mouseenter",ie),rt(F,"mouseleave",Q),ne)},[X,B,S,D,e,s,M,C,p,$,I,l,d,_,f,A,N,g,z,V,x]),E.useMemo(()=>{if(!s)return;function q(F){C.pointerType=F.pointerType}return{onPointerDown:q,onPointerEnter:q,onMouseMove(F){var P,K,L;const{nativeEvent:ie}=F,Q=F.currentTarget,ae=e.select("domReferenceElement"),ne=e.select("open"),pe=$(ae,Q,F.target);if(l&&!xo(C.pointerType))return;if(ne&&pe&&((P=C.handleCloseOptions)!=null&&P.blockPointerEvents)){const H=e.select("floatingElement");if(H){const fe=((L=(K=C.handleCloseOptions)==null?void 0:K.getScope)==null?void 0:L.call(K))??Q.ownerDocument.body;GM(C,{scopeElement:fe,referenceElement:Q,floatingElement:H})}}const ee=UE(_.current);if(ne&&!pe||ee===0||!pe&&C.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;C.restTimeout.clear();function ve(){if(C.restTimeoutPending=!1,I())return;const H=e.select("open");!C.blockMouseMove&&(!H||pe)&&V()&&e.setOpen(!0,ct(hn,ie,Q))}C.pointerType==="touch"?Tr.flushSync(()=>{ve()}):pe&&ne?ve():(C.restTimeoutPending=!0,C.restTimeout.start(ee,ve))}}},[s,C,I,$,l,e,_,V])}function JE(e){return Sr&&e.movementX===0&&e.movementY===0}function sp(e,t,s){switch(e){case"vertical":return t;case"horizontal":return s;default:return t||s}}function Eh(e,t){return sp(t,e===nM||e===jx,e===Ym||e===$m)}function hv(e,t,s){return sp(t,e===jx,s?e===Ym:e===$m)||e==="Enter"||e===" "||e===""}function sU(e,t,s){return sp(t,s?e===Ym:e===$m,e===jx)}function iU(e,t,s,i){const o=s?e===$m:e===Ym,l=e===nM;return t==="both"||t==="horizontal"&&i?e==="Escape":sp(t,o,l)}function rU(e,t){const{listRef:s,activeIndex:i,onNavigate:o=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:d=!1,loopFocus:f=!1,nested:h=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:b="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:x=!0,disabledIndices:S=void 0,orientation:T="vertical",triggerOrientation:A=T,parentOrientation:C,id:k,resetOnPointerLeave:M=!0,externalTree:D,nestedReturnFocusRef:_,grid:N}=t,O=N!=null,z=e.useState("open"),I=e.useState("floatingElement"),V=e.useState("domReferenceElement"),$=e.context.dataRef,X=mb(I),B=hb(V),q=Jt(X),F=Ua(),ie=Mo(D),Q=E.useRef(b),ae=E.useRef(u??-1),ne=E.useRef(null),pe=E.useRef(!0),ee=Le(le=>{o(ae.current===-1?null:ae.current,le)}),ve=E.useRef(!!I),P=E.useRef(z),K=E.useRef(!1),L=E.useRef(!1),H=E.useRef(null),fe=Jt(S),oe=Jt(z),ye=Jt(u),ce=Jt(M),me=rd(),ze=rd(),Te=Le(()=>{me.cancel();function le(we){g||(H.current=qh(we,{sync:K.current,preventScroll:!0}))}const he=s.current[ae.current],Ke=L.current;he&&le(he),(K.current?we=>we():we=>me.request(we))(()=>{var Ze;const we=s.current[ae.current]||he;if(!we)return;he||le(we),Ye&&(Ke||!pe.current)&&((Ze=we.scrollIntoView)==null||Ze.call(we,{block:"nearest",inline:"nearest"}))})});Me(()=>{$.current.orientation=T},[$,T]),Me(()=>{z||(ne.current=null),(!z||b!=="auto")&&(Q.current=b)},[z,b]),Me(()=>{l&&(z&&I?(ae.current=u??-1,Q.current&&u!=null&&(L.current=!0,ee())):ve.current&&(ae.current=-1,ee()))},[l,z,I,u,ee]),Me(()=>{if(l){if(!z){K.current=!1;return}if(I)if(i==null){if(K.current=!1,ye.current!=null)return;if(ve.current&&(ae.current=-1,Te()),(!P.current||!ve.current)&&Q.current&&(ne.current!=null||Q.current===!0&&ne.current==null)){let le=0;const he=()=>{s.current[0]==null?(le<2&&(le?Ee=>ze.request(Ee):queueMicrotask)(he),le+=1):(ae.current=ne.current==null||hv(ne.current,A,p)||h?cv(s):zE(s),ne.current=null,ee())};he()}}else gb(s.current,i)||(ae.current=i,Te(),L.current=!1)}},[l,z,I,i,ye,h,s,A,p,ee,Te,ze]),Me(()=>{var we,ot;if(!l||I||!ie||g||!ve.current)return;const le=ie.nodesRef.current,he=(ot=(we=le.find(Ze=>Ze.id===F))==null?void 0:we.context)==null?void 0:ot.elements.floating,Ke=rs(vt(V??he??null)),Ee=le.some(Ze=>Ze.context&&qe(Ze.context.elements.floating,Ke));he&&!Ee&&pe.current&&he.focus({preventScroll:!0})},[l,I,V,ie,F,g]),Me(()=>{P.current=z,ve.current=!!I});const Pe=i!=null,Ae=Le(le=>{if(!oe.current)return;const he=s.current.indexOf(le.currentTarget);he!==-1&&(ae.current!==he||i!==he)&&(ae.current=he,ee(le))}),Ge=Le(()=>{var le,he,Ke;return C??((Ke=(he=(le=ie==null?void 0:ie.nodesRef.current.find(Ee=>Ee.id===F))==null?void 0:le.context)==null?void 0:he.dataRef)==null?void 0:Ke.current.orientation)}),Ue=Le(()=>cv(s,fe.current)),Se=Le(le=>{if(pe.current=!1,K.current=!0,le.which===229||!oe.current&&le.currentTarget===q.current)return;if(h&&iU(le.key,T,p,O)){Eh(le.key,Ge())||Ti(le),e.setOpen(!1,ct(hm,le.nativeEvent));const we=(_==null?void 0:_.current)??V;Bt(we)&&we.focus();return}i!=null&&i!==ae.current&&!gb(s.current,i)&&(ae.current=i);const he=ae.current,Ke=cv(s,S),Ee=zE(s,S);if(B||(le.key==="Home"&&(Ti(le),ae.current=Ke,ee(le)),le.key==="End"&&(Ti(le),ae.current=Ee,ee(le))),N!=null){const we=N(le,ae.current,s,T,f,p,S,Ke,Ee);if(we!=null&&we!==ae.current&&(ae.current=we,ee(le)),T==="both")return}if(Eh(le.key,T)){Ti(le);const we=rs(le.currentTarget.ownerDocument);if(z&&!g&&qe(le.currentTarget,we)&&!s.current.some(wt=>wt!=null&&qe(wt,we))){ae.current=hv(le.key,T,p)?Ke:Ee,ee(le),i===ae.current&&Te();return}const{index:ot,wrapped:Ze}=$B(s.current,he,{decrement:!hv(le.key,T,p),loopFocus:f,allowEscape:d,disabledIndices:S,minIndex:Ke,maxIndex:Ee});Ze&&(K.current=!1),ae.current=ot,ee(le)}}),Ye=E.useMemo(()=>({onFocus(he){K.current=!0,Ae(he)},onClick({currentTarget:he}){g||he.focus({preventScroll:!0})},onMouseMove(he){JE(he)||(K.current=!0,L.current=!1,w&&Ae(he))},onPointerLeave(he){var Ee;if(!oe.current||!pe.current||he.pointerType==="touch")return;K.current=!0;const Ke=he.relatedTarget;if(!(!w||s.current.includes(Ke))&&ce.current&&((Ee=H.current)==null||Ee.call(H),H.current=null,ae.current=-1,ee(he),!g)){const we=q.current,ot=rs(vt(we));we&&qe(we,ot)&&we.focus({preventScroll:!0})}}}),[Ae,oe,q,w,s,ee,ce,g]),xe=E.useMemo(()=>g&&z&&Pe&&{"aria-activedescendant":`${k}-${i}`},[g,z,Pe,k,i]),Xe=E.useMemo(()=>({...B?{}:xe,onKeyDown(le){if(le.key==="Tab"&&le.shiftKey&&z&&!g){const he=zn(le.nativeEvent);if(he&&!qe(q.current,he))return;Ti(le);const Ke=ct(gc,le.nativeEvent);e.setOpen(!1,Ke);const Ee=(_==null?void 0:_.current)??V;!Ke.isCanceled&&Bt(Ee)&&Ee.focus();return}Se(le)},onPointerMove(le){JE(le)||(pe.current=!0)}}),[xe,Se,q,B,e,z,g,V,_]),We=E.useMemo(()=>{function le(Ee){e.setOpen(!0,ct(hm,Ee.nativeEvent,Ee.currentTarget))}function he(Ee){b==="auto"&&id(Ee.nativeEvent)&&(Q.current=!g)}function Ke(Ee){Q.current=b,b==="auto"&&_x(Ee.nativeEvent)&&(Q.current=!0)}return{onKeyDown(Ee){var Vt;const we=e.select("open");pe.current=!1;const ot=Ee.key.startsWith("Arrow"),Ze=sU(Ee.key,Ge(),p),wt=Eh(Ee.key,we?T:A),on=(h?Ze:wt)||Ee.key==="Enter"||Ee.key.trim()==="";if(g&&we&&(!h||Ed(Ee.currentTarget)))return Se(Ee);if(!(!we&&!x&&ot)){if(on){const Rs=Eh(Ee.key,Ge());ne.current=h&&Rs?null:Ee.key}if(h){Ze&&(Ti(Ee),we?(ae.current=Ue(),ee(Ee),g&&((Vt=q.current)==null||Vt.focus())):le(Ee));return}wt&&(ye.current!=null&&(ae.current=ye.current),Ti(Ee),!we&&x?le(Ee):Se(Ee),we&&ee(Ee))}},onFocus(Ee){Ee.target===Ee.currentTarget&&e.select("open")&&!g&&(ae.current=-1,ee(Ee))},onPointerDown:Ke,onPointerEnter:Ke,onMouseDown:he,onClick:he}},[Se,b,Ue,h,ee,e,x,T,A,Ge,p,ye,g,q]),pt=E.useMemo(()=>({...xe,...We}),[xe,We]);return E.useMemo(()=>l?{reference:pt,floating:Xe,item:Ye,trigger:We}:{},[l,pt,Xe,We,Ye])}function oU(e,t){const{listRef:s,elementsRef:i,activeIndex:o,onMatch:l,disabledIndices:u,onTyping:d,enabled:f=!0,resetMs:h=750,selectedIndex:p=null}=t,g=Le(d),b=e.useState("open"),w=Ln(),x=E.useRef(""),S=E.useRef(p??o??-1),T=E.useRef(null),A=Le(M=>{function D(B){return i==null?void 0:i.current[B]}function _(B){const q=D(B);return q&&!Xm(q)||q!=null&&q.matches(":disabled")?!1:u==null||!lM(ed,B,u)}function N(B,q,F=0){if(B.length===0)return-1;const ie=(F%B.length+B.length)%B.length,Q=q.toLowerCase();for(let ae=0;ae<B.length;ae+=1){const ne=(ie+ae)%B.length,pe=B[ne];if(!(!(pe!=null&&pe.toLowerCase().startsWith(Q))||!_(ne)))return ne}return-1}const O=s.current;if(x.current.length>0&&M.key===" "&&(Ti(M),g==null||g(!0)),x.current.length>0&&x.current[0]!==" "&&N(O,x.current)===-1&&M.key!==" "&&(g==null||g(!1)),O==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;b&&M.key!==" "&&(Ti(M),g==null||g(!0));const z=x.current==="";z&&(S.current=p??o??-1),O.every((B,q)=>{var F,ie;return B&&_(q)?((F=B[0])==null?void 0:F.toLowerCase())!==((ie=B[1])==null?void 0:ie.toLowerCase()):!0})&&x.current===M.key&&(x.current="",S.current=T.current),x.current+=M.key,w.start(h,()=>{x.current="",S.current=T.current,g==null||g(!1)});const $=((z?p??o??-1:S.current)??0)+1,X=N(O,x.current,$);X!==-1?(l==null||l(X,M),T.current=X):M.key!==" "&&(x.current="",g==null||g(!1))}),C=Le(M=>{const D=M.relatedTarget,_=e.select("domReferenceElement"),N=e.select("floatingElement");qe(_,D)||qe(N,D)||(w.clear(),x.current="",S.current=T.current,g==null||g(!1))});Me(()=>{!b&&p!==null||(w.clear(),T.current=null,x.current!==""&&(x.current="",g==null||g(!1)))},[b,p,w,g]);const k=E.useMemo(()=>({onKeyDown:A,onBlur:C}),[A,C]);return E.useMemo(()=>f?{reference:k,floating:k}:{},[f,k])}const eC=.1,aU=eC*eC,Ot=.5;function Ch(e,t,s,i,o,l){return i>=t!=l>=t&&e<=(o-s)*(t-i)/(l-i)+s}function Ah(e,t,s,i,o,l,u,d,f,h){let p=!1;return Ch(e,t,s,i,o,l)&&(p=!p),Ch(e,t,o,l,u,d)&&(p=!p),Ch(e,t,u,d,f,h)&&(p=!p),Ch(e,t,f,h,s,i)&&(p=!p),p}function lU(e,t,s){return e>=s.x&&e<=s.x+s.width&&t>=s.y&&t<=s.y+s.height}function kh(e,t,s,i,o,l){const u=Math.min(s,o),d=Math.max(s,o),f=Math.min(i,l),h=Math.max(i,l);return e>=u&&e<=d&&t>=f&&t<=h}function $M(e={}){const{blockPointerEvents:t=!1}=e,s=new zi,i=({x:o,y:l,placement:u,elements:d,onClose:f,nodeId:h,tree:p})=>{const g=u==null?void 0:u.split("-")[0];let b=!1,w=null,x=null,S=typeof performance<"u"?performance.now():0;function T(C,k){const M=performance.now(),D=M-S;if(w===null||x===null||D===0)return w=C,x=k,S=M,!1;const _=C-w,N=k-x,O=_*_+N*N,z=D*D*aU;return w=C,x=k,S=M,O<z}function A(){s.clear(),f()}return function(k){s.clear();const M=d.domReference,D=d.floating;if(!M||!D||g==null||o==null||l==null)return;const{clientX:_,clientY:N}=k,O=zn(k),z=k.type==="mouseleave",I=qe(D,O),V=qe(M,O);if(I&&(b=!0,!z))return;if(V&&(b=!1,!z)){b=!0;return}if(z&&bt(k.relatedTarget)&&qe(D,k.relatedTarget))return;function $(){return!!(p&&Eo(p.nodesRef.current,h).length>0)}function X(){$()||A()}if($())return;const B=M.getBoundingClientRect(),q=D.getBoundingClientRect(),F=o>q.right-q.width/2,ie=l>q.bottom-q.height/2,Q=q.width>B.width,ae=q.height>B.height,ne=(Q?B:q).left,pe=(Q?B:q).right,ee=(ae?B:q).top,ve=(ae?B:q).bottom;if(g==="top"&&l>=B.bottom-1||g==="bottom"&&l<=B.top+1||g==="left"&&o>=B.right-1||g==="right"&&o<=B.left+1){X();return}let P=!1;switch(g){case"top":P=kh(_,N,ne,B.top+1,pe,q.bottom-1);break;case"bottom":P=kh(_,N,ne,q.top+1,pe,B.bottom-1);break;case"left":P=kh(_,N,q.right-1,ve,B.left+1,ee);break;case"right":P=kh(_,N,B.right-1,ve,q.left+1,ee);break}if(P)return;if(b&&!lU(_,N,B)){X();return}if(!z&&T(_,N)){X();return}let K=!1;switch(g){case"top":{const L=Q?Ot/2:Ot*4,H=Q||F?o+L:o-L,fe=Q?o-L:F?o+L:o-L,oe=l+Ot+1,ye=F||Q?q.bottom-Ot:q.top,ce=F?Q?q.bottom-Ot:q.top:q.bottom-Ot;K=Ah(_,N,H,oe,fe,oe,q.left,ye,q.right,ce);break}case"bottom":{const L=Q?Ot/2:Ot*4,H=Q||F?o+L:o-L,fe=Q?o-L:F?o+L:o-L,oe=l-Ot,ye=F||Q?q.top+Ot:q.bottom,ce=F?Q?q.top+Ot:q.bottom:q.top+Ot;K=Ah(_,N,H,oe,fe,oe,q.left,ye,q.right,ce);break}case"left":{const L=ae?Ot/2:Ot*4,H=ae||ie?l+L:l-L,fe=ae?l-L:ie?l+L:l-L,oe=o+Ot+1,ye=ie||ae?q.right-Ot:q.left,ce=ie?ae?q.right-Ot:q.left:q.right-Ot;K=Ah(_,N,ye,q.top,ce,q.bottom,oe,H,oe,fe);break}case"right":{const L=ae?Ot/2:Ot*4,H=ae||ie?l+L:l-L,fe=ae?l-L:ie?l+L:l-L,oe=o-Ot,ye=ie||ae?q.left+Ot:q.right,ce=ie?ae?q.left+Ot:q.right:q.left+Ot;K=Ah(_,N,oe,H,oe,fe,ye,q.top,ce,q.bottom);break}}K?b||s.start(40,X):X()}};return i.__options={...e,blockPointerEvents:t},i}function tC(e,t,s){let{reference:i,floating:o}=e;const l=Ps(t),u=zx(t),d=Px(u),f=xs(t),h=l==="y",p=i.x+i.width/2-o.width/2,g=i.y+i.height/2-o.height/2,b=i[d]/2-o[d]/2;let w;switch(f){case"top":w={x:p,y:i.y-o.height};break;case"bottom":w={x:p,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:g};break;case"left":w={x:i.x-o.width,y:g};break;default:w={x:i.x,y:i.y}}const x=_i(t);return x&&(w[u]+=b*(x==="end"?1:-1)*(s&&h?-1:1)),w}async function cU(e,t){var s;t===void 0&&(t={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:b=!1,padding:w=0}=Co(t,e),x=aM(w),T=d[b?g==="floating"?"reference":"floating":g],A=fm(await l.getClippingRect({element:(s=await(l.isElement==null?void 0:l.isElement(T)))==null||s?T:T.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:h,rootBoundary:p,strategy:f})),C=g==="floating"?{x:i,y:o,width:u.floating.width,height:u.floating.height}:u.reference,k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),M=await(l.isElement==null?void 0:l.isElement(k))&&await(l.getScale==null?void 0:l.getScale(k))||{x:1,y:1},D=fm(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:C,offsetParent:k,strategy:f}):C);return{top:(A.top-D.top+x.top)/M.y,bottom:(D.bottom-A.bottom+x.bottom)/M.y,left:(A.left-D.left+x.left)/M.x,right:(D.right-A.right+x.right)/M.x}}const uU=50,dU=async(e,t,s)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=s,d=u.detectOverflow?u:{...u,detectOverflow:cU},f=await(u.isRTL==null?void 0:u.isRTL(t));let h=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:g}=tC(h,i,f),b=i,w=0;const x={};for(let S=0;S<l.length;S++){const T=l[S];if(!T)continue;const{name:A,fn:C}=T,{x:k,y:M,data:D,reset:_}=await C({x:p,y:g,initialPlacement:i,placement:b,strategy:o,middlewareData:x,rects:h,platform:d,elements:{reference:e,floating:t}});p=k??p,g=M??g,x[A]={...x[A],...D},_&&w<uU&&(w++,typeof _=="object"&&(_.placement&&(b=_.placement),_.rects&&(h=_.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:p,y:g}=tC(h,b,f)),S=-1)}return{x:p,y:g,placement:b,strategy:o,middlewareData:x}},fU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,i;const{placement:o,middlewareData:l,rects:u,initialPlacement:d,platform:f,elements:h}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...T}=Co(e,t);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const A=xs(o),C=Ps(d),k=xs(d)===d,M=await(f.isRTL==null?void 0:f.isRTL(h.floating)),D=b||(k||!S?[dm(d)]:FB(d)),_=x!=="none";!b&&_&&D.push(...KB(d,S,x,M));const N=[d,...D],O=await f.detectOverflow(t,T),z=[];let I=((i=l.flip)==null?void 0:i.overflows)||[];if(p&&z.push(O[A]),g){const B=VB(o,u,M);z.push(O[B[0]],O[B[1]])}if(I=[...I,{placement:o,overflows:z}],!z.every(B=>B<=0)){var V,$;const B=(((V=l.flip)==null?void 0:V.index)||0)+1,q=N[B];if(q&&(!(g==="alignment"?C!==Ps(q):!1)||I.every(Q=>Ps(Q.placement)===C?Q.overflows[0]>0:!0)))return{data:{index:B,overflows:I},reset:{placement:q}};let F=($=I.filter(ie=>ie.overflows[0]<=0).sort((ie,Q)=>ie.overflows[1]-Q.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(w){case"bestFit":{var X;const ie=(X=I.filter(Q=>{if(_){const ae=Ps(Q.placement);return ae===C||ae==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(ae=>ae>0).reduce((ae,ne)=>ae+ne,0)]).sort((Q,ae)=>Q[1]-ae[1])[0])==null?void 0:X[0];ie&&(F=ie);break}case"initialPlacement":F=d;break}if(o!==F)return{reset:{placement:F}}}return{}}}},QM=new Set(["left","top"]);async function hU(e,t){const{placement:s,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=xs(s),d=_i(s),f=Ps(s)==="y",h=QM.has(u)?-1:1,p=l&&f?-1:1,g=Co(t,e);let{mainAxis:b,crossAxis:w,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof x=="number"&&(w=d==="end"?x*-1:x),f?{x:w*p,y:b*h}:{x:b*h,y:w*p}}const mU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,i;const{x:o,y:l,placement:u,middlewareData:d}=t,f=await hU(t,e);return u===((s=d.offset)==null?void 0:s.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:u}}}}},pU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:i,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:C=>{let{x:k,y:M}=C;return{x:k,y:M}}},...h}=Co(e,t),p={x:s,y:i},g=await l.detectOverflow(t,h),b=Ps(o),w=Ix(b);let x=p[w],S=p[b];const T=(C,k)=>oM(k+g[C==="y"?"top":"left"],k,k-g[C==="y"?"bottom":"right"]);u&&(x=T(w,x)),d&&(S=T(b,S));const A=f.fn({...t,[w]:x,[b]:S});return{...A,data:{x:A.x-s,y:A.y-i,enabled:{[w]:u,[b]:d}}}}}},gU=function(e){return e===void 0&&(e={}),{options:e,fn(t){var s,i;const{x:o,y:l,placement:u,rects:d,middlewareData:f}=t,{offset:h=0,mainAxis:p=!0,crossAxis:g=!0}=Co(e,t),b={x:o,y:l},w=Ps(u),x=Ix(w);let S=b[x],T=b[w];const A=Co(h,t),C=typeof A=="number"?{mainAxis:A,crossAxis:0}:{mainAxis:(s=A.mainAxis)!=null?s:0,crossAxis:(i=A.crossAxis)!=null?i:0};if(p){const D=x==="y"?"height":"width",_=d.reference[x]-d.floating[D]+C.mainAxis,N=d.reference[x]+d.reference[D]-C.mainAxis;S<_?S=_:S>N&&(S=N)}if(g){var k,M;const D=x==="y"?"width":"height",_=QM.has(xs(u)),N=d.reference[w]-d.floating[D]+(_&&((k=f.offset)==null?void 0:k[w])||0)+(_?0:C.crossAxis),O=d.reference[w]+d.reference[D]+(_?0:((M=f.offset)==null?void 0:M[w])||0)-(_?C.crossAxis:0);T<N?T=N:T>O&&(T=O)}return{[x]:S,[w]:T}}}},yU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:s,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...d}=Co(e,t),f=await o.detectOverflow(t,d),h=xs(s),p=_i(s),g=Ps(s)==="y",{width:b,height:w}=i.floating;let x,S;h==="top"||h==="bottom"?(x=h,S=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(S=h,x=p==="end"?"top":"bottom");const T=w-f.top-f.bottom,A=b-f.left-f.right,C=pc(w-f[x],T),k=pc(b-f[S],A),M=t.middlewareData.shift,D=!M;let _=C,N=k;M!=null&&M.enabled.x&&(N=A),M!=null&&M.enabled.y&&(_=T),D&&!p&&(g?N=b-2*gr(f.left,f.right):_=w-2*gr(f.top,f.bottom)),await u({...t,availableWidth:N,availableHeight:_});const O=await o.getDimensions(l.floating);return b!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}};function XM(e){const t=Ss(e);let s=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=Bt(e),l=o?e.offsetWidth:s,u=o?e.offsetHeight:i,d=um(s)!==l||um(i)!==u;return d&&(s=l,i=u),{width:s,height:i,$:d}}function o0(e){return bt(e)?e:e.contextElement}function Wl(e){const t=o0(e);if(!Bt(t))return yr(1);const s=t.getBoundingClientRect(),{width:i,height:o,$:l}=XM(t);let u=(l?um(s.width):s.width)/i,d=(l?um(s.height):s.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const vU=yr(0);function ZM(e){const t=$t(e);return!xx()||!t.visualViewport?vU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bU(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===$t(e)}function Oa(e,t,s,i){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),l=o0(e);let u=yr(1);t&&(i?bt(i)&&(u=Wl(i)):u=Wl(e));const d=bU(l,s,i)?ZM(l):yr(0);let f=(o.left+d.x)/u.x,h=(o.top+d.y)/u.y,p=o.width/u.x,g=o.height/u.y;if(l&&i){const b=$t(l),w=bt(i)?$t(i):i;let x=b,S=ab(x);for(;S&&w!==x;){const T=Wl(S),A=S.getBoundingClientRect(),C=Ss(S),k=A.left+(S.clientLeft+parseFloat(C.paddingLeft))*T.x,M=A.top+(S.clientTop+parseFloat(C.paddingTop))*T.y;f*=T.x,h*=T.y,p*=T.x,g*=T.y,f+=k,h+=M,x=$t(S),S=ab(x)}}return fm({width:p,height:g,x:f,y:h})}function ip(e,t){const s=Fm(e).scrollLeft;return t?t.left+s:Oa(wr(e)).left+s}function WM(e,t){const s=e.getBoundingClientRect(),i=s.left+t.scrollLeft-ip(e,s),o=s.top+t.scrollTop;return{x:i,y:o}}function xU(e){let{elements:t,rect:s,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=wr(i),d=t?Vm(t.floating):!1;if(i===u||d&&l)return s;let f={scrollLeft:0,scrollTop:0},h=yr(1);const p=yr(0),g=Bt(i);if((g||!l)&&((Dn(i)!=="body"||Rd(u))&&(f=Fm(i)),g)){const w=Oa(i);h=Wl(i),p.x=w.x+i.clientLeft,p.y=w.y+i.clientTop}const b=u&&!g&&!l?WM(u,f):yr(0);return{width:s.width*h.x,height:s.height*h.y,x:s.x*h.x-f.scrollLeft*h.x+p.x+b.x,y:s.y*h.y-f.scrollTop*h.y+p.y+b.y}}function wU(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function SU(e){const t=Fm(e),s=e.ownerDocument.body,i=gr(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=gr(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let l=-t.scrollLeft+ip(e);const u=-t.scrollTop;return Ss(s).direction==="rtl"&&(l+=gr(e.clientWidth,s.clientWidth)-i),{width:i,height:o,x:l,y:u}}const TU=25;function RU(e,t,s){s===void 0&&(s="viewport");const i=s==="layoutViewport",o=$t(e),l=wr(e),u=o.visualViewport;let d=l.clientWidth,f=l.clientHeight,h=0,p=0;if(u){const b=!xx()||t==="fixed";i?b||(h=-u.offsetLeft,p=-u.offsetTop):(d=u.width,f=u.height,b&&(h=u.offsetLeft,p=u.offsetTop))}if(ip(l)<=0){const b=l.ownerDocument,w=b.body,x=getComputedStyle(w),S=b.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,T=Math.abs(l.clientWidth-w.clientWidth-S),A=getComputedStyle(l).scrollbarGutter==="stable both-edges"?T/2:T;A<=TU&&(d-=A)}return{width:d,height:f,x:h,y:p}}function EU(e,t){const s=Oa(e,!0,t==="fixed"),i=s.top+e.clientTop,o=s.left+e.clientLeft,l=Wl(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,f=o*l.x,h=i*l.y;return{width:u,height:d,x:f,y:h}}function nC(e,t,s){let i;if(t==="viewport"||t==="layoutViewport")i=RU(e,s,t);else if(t==="document")i=SU(wr(e));else if(bt(t))i=EU(t,s);else{const o=ZM(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fm(i)}function CU(e,t){const s=t.get(e);if(s)return s;let i=Ju(e,[],!1).filter(d=>bt(d)&&Dn(d)!=="body"),o=null;const l=Ss(e).position==="fixed";let u=l?vr(e):e;for(;bt(u)&&!pr(u);){const d=Ss(u),f=bx(u),h=o?o.position:l?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&d.position==="static")?i=i.filter(g=>g!==u):o=d,u=vr(u)}return t.set(e,i),i}function AU(e){let{element:t,boundary:s,rootBoundary:i,strategy:o}=e;const u=[...s==="clippingAncestors"?Vm(t)?[]:CU(t,this._c):[].concat(s),i],d=nC(t,u[0],o);let f=d.top,h=d.right,p=d.bottom,g=d.left;for(let b=1;b<u.length;b++){const w=nC(t,u[b],o);f=gr(w.top,f),h=pc(w.right,h),p=pc(w.bottom,p),g=gr(w.left,g)}return{width:h-g,height:p-f,x:g,y:f}}function kU(e){const{width:t,height:s}=XM(e);return{width:t,height:s}}function MU(e,t,s){const i=Bt(t),o=wr(t),l=s==="fixed",u=Oa(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=yr(0);if((i||!l)&&((Dn(t)!=="body"||Rd(o))&&(d=Fm(t)),i)){const b=Oa(t,!0,l,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!i&&o&&(f.x=ip(o));const h=o&&!i&&!l?WM(o,d):yr(0),p=u.left+d.scrollLeft-f.x-h.x,g=u.top+d.scrollTop-f.y-h.y;return{x:p,y:g,width:u.width,height:u.height}}function mv(e){return Ss(e).position==="static"}function sC(e,t){if(!Bt(e)||Ss(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return wr(e)===s&&(s=s.ownerDocument.body),s}function JM(e,t){const s=$t(e);if(Vm(e))return s;if(!Bt(e)){let o=vr(e);for(;o&&!pr(o);){if(bt(o)&&!mv(o))return o;o=vr(o)}return s}let i=sC(e,t);for(;i&&_z(i)&&mv(i);)i=sC(i,t);return i&&pr(i)&&mv(i)&&!bx(i)?s:i||zz(e)||s}const NU=async function(e){const t=this.getOffsetParent||JM,s=this.getDimensions,i=await s(e.floating);return{reference:MU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function OU(e){return Ss(e).direction==="rtl"}const jU={convertOffsetParentRelativeRectToViewportRelativeRect:xU,getDocumentElement:wr,getClippingRect:AU,getOffsetParent:JM,getElementRects:NU,getClientRects:wU,getDimensions:kU,getScale:Wl,isElement:bt,isRTL:OU};function eN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DU(e,t,s){let i=null,o;const l=wr(e);function u(){var p;clearTimeout(o),(p=i)==null||p.disconnect(),i=null}function d(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),u();const b=e.getBoundingClientRect(),{left:w,top:x,width:S,height:T}=b;if(p||t(),!S||!T)return;const A=bh(x),C=bh(l.clientWidth-(w+S)),k=bh(l.clientHeight-(x+T)),M=bh(w),_={rootMargin:-A+"px "+-C+"px "+-k+"px "+-M+"px",threshold:gr(0,pc(1,g))||1};let N=!0;function O(z){const I=z[0].intersectionRatio;if(!eN(b,e.getBoundingClientRect()))return d();if(I!==g){if(!N)return d();I?d(!1,I):o=setTimeout(()=>{d(!1,1e-7)},1e3)}N=!1}try{i=new IntersectionObserver(O,{..._,root:l.ownerDocument})}catch{i=new IntersectionObserver(O,_)}i.observe(e)}const f=$t(e),h=()=>d(s);return f.addEventListener("resize",h),d(!0),()=>{f.removeEventListener("resize",h),u()}}function iC(e,t,s,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,h=o0(e),p=o||l?[...h?Ju(h):[],...t?Ju(t):[]]:[];p.forEach(A=>{o&&A.addEventListener("scroll",s),l&&A.addEventListener("resize",s)});const g=h&&d?DU(h,s,l):null;let b=-1,w=null;u&&(w=new ResizeObserver(A=>{let[C]=A;C&&C.target===h&&w&&t&&(w.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var k;(k=w)==null||k.observe(t)})),s()}),h&&!f&&w.observe(h),t&&w.observe(t));let x,S=f?Oa(e):null;f&&T();function T(){const A=Oa(e);S&&!eN(S,A)&&s(),S=A,x=requestAnimationFrame(T)}return s(),()=>{var A;p.forEach(C=>{o&&C.removeEventListener("scroll",s),l&&C.removeEventListener("resize",s)}),g==null||g(),(A=w)==null||A.disconnect(),w=null,f&&cancelAnimationFrame(x)}}const _U=mU,IU=pU,PU=fU,zU=yU,LU=gU,BU=(e,t,s)=>{const i=new Map,o=s??{},l={...jU,...o.platform,_c:i};return dU(e,t,{...o,platform:l})};var UU=typeof document<"u",VU=function(){},Hh=UU?E.useLayoutEffect:VU;function ym(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let s,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(i=s;i--!==0;)if(!ym(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=s;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!ym(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function tN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rC(e,t){const s=tN(e);return Math.round(t*s)/s}function pv(e){const t=E.useRef(e);return Hh(()=>{t.current=e}),t}function FU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:f,open:h}=e,[p,g]=E.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[b,w]=E.useState(i);ym(b,i)||w(i);const[x,S]=E.useState(null),[T,A]=E.useState(null),C=E.useCallback(Q=>{Q!==_.current&&(_.current=Q,S(Q))},[]),k=E.useCallback(Q=>{Q!==N.current&&(N.current=Q,A(Q))},[]),M=l||x,D=u||T,_=E.useRef(null),N=E.useRef(null),O=E.useRef(p),z=f!=null,I=pv(f),V=pv(o),$=pv(h),X=E.useCallback(()=>{if(!_.current||!N.current)return;const Q={placement:t,strategy:s,middleware:b};V.current&&(Q.platform=V.current),BU(_.current,N.current,Q).then(ae=>{const ne={...ae,isPositioned:$.current!==!1};B.current&&!ym(O.current,ne)&&(O.current=ne,Tr.flushSync(()=>{g(ne)}))})},[b,t,s,V,$]);Hh(()=>{h===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(Q=>({...Q,isPositioned:!1})))},[h]);const B=E.useRef(!1);Hh(()=>(B.current=!0,()=>{B.current=!1}),[]),Hh(()=>{if(M&&(_.current=M),D&&(N.current=D),M&&D){if(I.current)return I.current(M,D,X);X()}},[M,D,X,I,z]);const q=E.useMemo(()=>({reference:_,floating:N,setReference:C,setFloating:k}),[C,k]),F=E.useMemo(()=>({reference:M,floating:D}),[M,D]),ie=E.useMemo(()=>{const Q={position:s,left:0,top:0};if(!F.floating)return Q;const ae=rC(F.floating,p.x),ne=rC(F.floating,p.y);return d?{...Q,transform:"translate("+ae+"px, "+ne+"px)",...tN(F.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ae,top:ne}},[s,d,F.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:X,refs:q,elements:F,floatingStyles:ie}),[p,X,q,F,ie])}const qU=(e,t)=>{const s=_U(e);return{name:s.name,fn:s.fn,options:[e,t]}},HU=(e,t)=>{const s=IU(e);return{name:s.name,fn:s.fn,options:[e,t]}},GU=(e,t)=>({fn:LU(e).fn,options:[e,t]}),KU=(e,t)=>{const s=PU(e);return{name:s.name,fn:s.fn,options:[e,t]}},YU=(e,t)=>{const s=zU(e);return{name:s.name,fn:s.fn,options:[e,t]}},nN=E.createContext(void 0);function $U(){const e=E.useContext(nN);if(e===void 0)throw new Error(Ts(26));return e}const QU="ArrowUp",XU="ArrowDown",ZU="ArrowLeft",WU="ArrowRight",JU="Home",e6="End",sN=new Set([QU,XU,ZU,WU,JU,e6]),t6="--nested-dialogs",n6="data-nested-dialog-open",s6={...Qm,...iM,nestedDialogOpen(e){return e?{[n6]:""}:null}},iN=E.forwardRef(function(t,s){const{render:i,className:o,style:l,finalFocus:u,initialFocus:d,...f}=t,h=Ba(),p=h.useState("descriptionElementId"),g=h.useState("disablePointerDismissal"),b=h.useState("floatingRootContext"),w=h.useState("popupProps"),x=h.useState("modal"),S=h.useState("mounted"),T=h.useState("nested"),A=h.useState("nestedOpenDialogCount"),C=h.useState("open"),k=h.useState("openMethod"),M=h.useState("titleElementId"),D=h.useState("transitionStatus"),_=h.useState("role"),N=b.useState("floatingId");$U(),Jm({open:C,ref:h.context.popupRef,onComplete(){var X,B;C&&((B=(X=h.context).onOpenChangeComplete)==null||B.call(X,!0))}});const O=d===void 0?U4(h.context.popupRef):d,z=A>0,I=h.useStateSetter("popupElement"),$=xn("div",t,{state:{open:C,nested:T,transitionStatus:D,nestedDialogOpen:z},props:[w,{id:N,"aria-labelledby":M,"aria-describedby":p,role:_,...Qx,hidden:!S,onKeyDown(X){sN.has(X.key)&&X.stopPropagation()},style:{[t6]:A}},f],ref:[s,h.context.popupRef,I],stateAttributesMapping:s6});return v.jsx(IM,{context:b,openInteractionType:k,disabled:!S,closeOnFocusOut:!g,initialFocus:O,returnFocus:u,modal:x!==!1,restoreFocus:"popup",children:$})});function rN(e){return Tx(19)?e:e?"true":void 0}const oN=E.forwardRef(function(t,s){const{cutout:i,...o}=t;let l;if(i){const u=i.getBoundingClientRect();l=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${u.left}px ${u.top}px,${u.left}px ${u.bottom}px,${u.right}px ${u.bottom}px,${u.right}px ${u.top}px,${u.left}px ${u.top}px)`}return v.jsx("div",{ref:s,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:l}})}),aN=E.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t,l=Ba(),u=l.useState("mounted"),d=l.useState("modal"),f=l.useState("open");return u||i?v.jsx(nN.Provider,{value:i,children:v.jsxs(NM,{ref:s,...o,children:[u&&d===!0&&v.jsx(oN,{ref:l.context.internalBackdropRef,inert:rN(!f)}),t.children]})}):null});let oC={},aC={},lC="";function rp(e,t){return Rd(e)?e:t}function cC(e,t,s){return/hidden|clip/.test(e.getComputedStyle(rp(t,s)).overflowY)}function i6(e){if(typeof document>"u")return!1;const t=vt(e);return $t(t).innerWidth-t.documentElement.clientWidth>0}function r6(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=vt(e),i=s.documentElement,o=s.body,l=rp(i,o),u=l.style.overflowY,d=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",l.style.overflowY="scroll";const f=l.offsetWidth;l.style.overflowY="hidden";const h=l.offsetWidth;return l.style.overflowY=u,i.style.scrollbarGutter=d,f===h}function o6(e){const t=vt(e),s=t.documentElement,i=t.body,o=rp(s,i),l={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,l)}}function a6(e){var w;const t=vt(e),s=t.documentElement,i=t.body,o=$t(s);let l=0,u=0,d=!1;const f=Ai.create();if(Sr&&(((w=o.visualViewport)==null?void 0:w.scale)??1)!==1)return()=>{};function h(){const x=o.getComputedStyle(s),S=o.getComputedStyle(i),C=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";l=s.scrollTop,u=s.scrollLeft,oC={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},lC=s.style.scrollBehavior,aC={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const k=s.scrollHeight>s.clientHeight,M=s.scrollWidth>s.clientWidth,D=x.overflowY==="scroll"||S.overflowY==="scroll",_=x.overflowX==="scroll"||S.overflowX==="scroll",N=Math.max(0,o.innerWidth-i.clientWidth),O=Math.max(0,o.innerHeight-i.clientHeight),z=parseFloat(S.marginTop)+parseFloat(S.marginBottom),I=parseFloat(S.marginLeft)+parseFloat(S.marginRight),V=rp(s,i);if(d=r6(e),d){s.style.scrollbarGutter=C,V.style.overflowY="hidden",V.style.overflowX="hidden";return}Object.assign(s.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(k||D)&&(s.style.overflowY="scroll"),(M||_)&&(s.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:z||O?`calc(100dvh - ${z+O}px)`:"100dvh",width:I||N?`calc(100vw - ${I+N}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=l,i.scrollLeft=u,s.setAttribute("data-base-ui-scroll-locked",""),s.style.scrollBehavior="unset"}function p(){Object.assign(s.style,oC),Object.assign(i.style,aC),d||(s.scrollTop=l,s.scrollLeft=u,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=lC)}function g(){p(),f.request(h)}h();const b=rt(o,"resize",g);return()=>{f.cancel(),p(),typeof o.removeEventListener=="function"&&b()}}class l6{constructor(){ge(this,"lockCount",0);ge(this,"restore",null);ge(this,"timeoutLock",zi.create());ge(this,"timeoutUnlock",zi.create());ge(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});ge(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const s=vt(t),i=s.documentElement,o=s.body,l=$t(i);if(cC(l,i,o)){const d=new l.MutationObserver(()=>{cC(l,i,o)||(d.disconnect(),this.restore=null,this.lock(t))}),f={attributes:!0};d.observe(i,f),d.observe(o,f),this.restore=()=>d.disconnect();return}const u=Km||!i6(t);this.restore=u?o6(t):a6(t)}}const c6=new l6;function lN(e=!0,t=null){Me(()=>{if(e)return c6.acquire(t)},[e,t])}function u6({store:e,parentContext:t,isDrawer:s}){const i=e.useState("open"),o=e.useState("mounted"),l=e.useState("disablePointerDismissal"),u=e.useState("modal"),d=e.useState("popupElement"),f=e.useState("floatingRootContext"),[h,p]=E.useState(0),[g,b]=E.useState(0),w=h===0,x=$x(f,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:u==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current||"button"in S&&S.button!==0)return!1;if("touches"in S){if(S.type==="touchend"){if(S.changedTouches.length!==1||S.touches.length!==0)return!1}else if(S.touches.length!==1)return!1}const T=zn(S);if(w&&!l){if(u){const A=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return A||C?A===T||C===T||qe(T,d)&&!(T!=null&&T.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:w});return lN(i&&u===!0,d),e.useContextCallback("onNestedDialogOpen",(S,T)=>{!e.select("open")&&!e.select("mounted")||(p(S),b(T))}),Me(()=>{!i&&!o&&(p(0),b(0))},[i,o]),Me(()=>(t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(h+1,g+(s?1:0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[s,i,h,g,t]),e0(e,{activeTriggerProps:x.reference,inactiveTriggerProps:x.trigger,popupProps:x.floating,nestedOpenDialogCount:h,nestedOpenDrawerCount:g}),null}const d6={...zu,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class f6 extends np{constructor(s,i,o){const l=new t0,u=h6(s,l,i,o);super(u,m6(l),d6);ge(this,"setOpen",(s,i)=>{var o,l;i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!s&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(l=(o=this.context).onOpenChange)==null||l.call(o,s,i),!i.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(s,i),this.update(Zx(this.state,s,i.trigger)))})}}function h6(e,t,s,i=!1){return{...s0(t,s,i),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function m6(e){return{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function p6(e,t){const{children:s,open:i,defaultOpen:o=!1,onOpenChange:l,onOpenChangeComplete:u,disablePointerDismissal:d=!1,modal:f=!0,actionsRef:h,handle:p,triggerId:g,defaultTriggerId:b=null}=t,w=e==="drawer",x=f,S=d,T="dialog",A=Ba(!0),C=A!=null,k={modal:x,disablePointerDismissal:S,nested:C,role:T},M=zM((I,V)=>new f6({open:o,openProp:i,activeTriggerId:b,triggerIdProp:g,...k},I,V),!0);M.useControlledProp("openProp",i),M.useControlledProp("triggerIdProp",g),M.useSyncedValues(k),M.useContextCallback("onOpenChange",l),M.useContextCallback("onOpenChangeComplete",u);const D=M.useState("open"),_=M.useState("mounted"),N=M.useState("payload");q4(M,D),Wx(M);const{forceUnmount:O}=Jx(D,M);E.useImperativeHandle(h,()=>({unmount:O,close:()=>M.setOpen(!1,ct(Gx))}),[O,M]);const z=D||_||p!=null;return v.jsxs(xM.Provider,{value:M,children:[p&&v.jsx(Xx,{handle:p,store:M}),z&&v.jsx(u6,{store:M,parentContext:A==null?void 0:A.context,isDrawer:w}),typeof s=="function"?s({payload:N}):s]})}const cN=tp(function(t){return p6("dialog",t)}),uN=E.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=Ba(),h=Ro(u);return f.useSyncedValueWithCleanup("titleElementId",h),xn("h2",t,{ref:s,props:[{id:h},d]})});function g6(e){const t=E.useRef(""),s=E.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:E.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:s}}function y6(e,t){const s=Le((l,u)=>{(typeof e=="function"?e():e)||t(u||(Km?"touch":""))}),{onClick:i,onPointerDown:o}=g6(s);return E.useMemo(()=>({onClick:i,onPointerDown:o}),[i,o])}function v6(e){const[t,s]=E.useState(null),i=y6(e,s);return vM(e,o=>{o&&!e&&s(null)}),E.useMemo(()=>({openMethod:t,triggerProps:i}),[t,i])}function Cd({...e}){return v.jsx(cN,{"data-slot":"sheet",...e})}function b6({...e}){return v.jsx(aN,{"data-slot":"sheet-portal",...e})}function x6({className:e,...t}){return v.jsx(wM,{"data-slot":"sheet-overlay",className:ke("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}const w6="data-[variant=inset]:rounded-xl data-[variant=inset]:border data-[side=right]:data-[variant=inset]:inset-y-2 data-[side=right]:data-[variant=inset]:right-2 data-[side=right]:data-[variant=inset]:h-auto data-[side=left]:data-[variant=inset]:inset-y-2 data-[side=left]:data-[variant=inset]:left-2 data-[side=left]:data-[variant=inset]:h-auto data-[side=top]:data-[variant=inset]:inset-x-2 data-[side=top]:data-[variant=inset]:top-2 data-[side=bottom]:data-[variant=inset]:inset-x-2 data-[side=bottom]:data-[variant=inset]:bottom-2";function Ad({className:e,children:t,side:s="right",variant:i="default",showCloseButton:o=!0,...l}){return v.jsxs(b6,{children:[v.jsx(x6,{}),v.jsxs(iN,{"data-slot":"sheet-content","data-side":s,"data-variant":i,className:ke("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",w6,e),...l,children:[t,o&&v.jsxs(SM,{"data-slot":"sheet-close",render:v.jsx(Be,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[v.jsx(Sc,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function a0({className:e,...t}){return v.jsx("div",{"data-slot":"sheet-header",className:ke("flex flex-col gap-0.5 p-4",e),...t})}function l0({className:e,...t}){return v.jsx("div",{"data-slot":"sheet-footer",className:ke("mt-auto flex flex-col gap-2 p-4",e),...t})}function kd({className:e,...t}){return v.jsx(uN,{"data-slot":"sheet-title",className:ke("font-heading text-base font-medium text-foreground",e),...t})}function c0({className:e,...t}){return v.jsx(TM,{"data-slot":"sheet-description",className:ke("text-sm text-muted-foreground",e),...t})}function dN({className:e,...t}){return v.jsx("textarea",{"data-slot":"textarea",className:ke("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}const Gt=6e4,ir=60*Gt,S6="mock-preview";function T6(e){const t=e.toLowerCase();return/hand ?off|delegate|research/.test(t)?"handoff":/approve|command|shell|test|run\b|build/.test(t)?"approval":/ask me|question|clarify|need to know/.test(t)?"question":"plain"}function Hn(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function uC(e){return e.trim().replace(/\/+$/,"")||"~"}class R6{constructor(){ge(this,"bots",[]);ge(this,"threads",[]);ge(this,"messages",[]);ge(this,"runs",[]);ge(this,"approvals",[]);ge(this,"questions",[]);ge(this,"handoffs",[]);ge(this,"rooms",[]);ge(this,"roomMessages",[]);ge(this,"audit",[]);ge(this,"files",new Map);ge(this,"listeners",new Set);ge(this,"timers",new Set);ge(this,"runInputs",new Map);ge(this,"promptRequests",new Map);ge(this,"roomRequests",new Map);ge(this,"threadRoots",new Map);ge(this,"scheduledRuns",new Set);ge(this,"epoch",`${S6}:${Hn("epoch")}`);ge(this,"seq",0);this.seed()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}async listBots(){const t=s=>{const i=this.threads.filter(o=>o.botId===s&&o.archivedAt===null).map(o=>o.id);return this.messages.filter(o=>i.includes(o.threadId)&&o.role!=="system").sort((o,l)=>(o.createdAt??0)-(l.createdAt??0)).at(-1)};return[...this.bots].sort((s,i)=>(i.lastActiveAt??0)-(s.lastActiveAt??0)).map(s=>{const i=t(s.id);return{...s,lastMessage:(i==null?void 0:i.content)??null,lastMessageAt:(i==null?void 0:i.createdAt)??null}})}async getBot(t){return this.bots.find(s=>s.id===t)}async createBot(t){var l;const s=Date.now(),i={avatarSeed:t.name,id:Hn("bot"),lastActiveAt:s,model:t.model,name:t.name.trim(),needsYou:0,paused:!1,permission:t.permission??"bot",rolePrompt:t.rolePrompt??"",status:"idle",thinking:t.thinking,title:((l=t.title)==null?void 0:l.trim())||"Bot",toolPolicy:t.toolPolicy??{},unread:0,workspace:uC(t.workspace)};this.bots.push(i);const o=this.addThread(i,"New conversation");return this.addMessage(o.id,"system",`Workspace: ${i.workspace}`),this.record({action:"bot.created",actor:"you",botId:i.id,decision:null,initiator:"person",threadId:null}),this.emitForBot(i.id),i}async updateBot(t,s){const i=this.requireBot(t);return s.name!==void 0&&(i.name=s.name),s.title!==void 0&&(i.title=s.title),s.rolePrompt!==void 0&&(i.rolePrompt=s.rolePrompt),s.workspace!==void 0&&(i.workspace=uC(s.workspace)),s.model!==void 0&&(i.model=s.model),s.thinking!==void 0&&(i.thinking=s.thinking),s.permission!==void 0&&(i.permission=s.permission),s.toolPolicy!==void 0&&(i.toolPolicy=s.toolPolicy),s.paused!==void 0&&(i.paused=s.paused),s.avatarEmoji!==void 0&&(i.avatarEmoji=s.avatarEmoji),s.accentHue!==void 0&&(i.accentHue=s.accentHue),this.refreshBot(i),this.emitForBot(t),i.paused||this.scheduleBot(i.id),i}async deleteBot(t){if(this.bots.length<=1)throw new Error("The workbench needs at least one Bot.");this.bots=this.bots.filter(i=>i.id!==t);const s=new Set(this.threads.filter(i=>i.botId===t).map(i=>i.id));this.threads=this.threads.filter(i=>i.botId!==t),this.messages=this.messages.filter(i=>!s.has(i.threadId)),this.approvals=this.approvals.filter(i=>i.botId!==t),this.questions=this.questions.filter(i=>i.botId!==t),this.runs=this.runs.filter(i=>i.botId!==t);for(const i of s)this.threadRoots.delete(i);this.emitForBot(t)}async setPaused(t,s){const i=this.requireBot(t);return i.paused=s,this.refreshBot(i),this.record({action:s?"bot.paused":"bot.resumed",actor:"you",botId:t,decision:null,initiator:"person",threadId:null}),this.emitForBot(t),s||this.scheduleBot(t),i}async listThreads(t){return this.threads.filter(s=>s.botId===t).sort((s,i)=>i.lastActiveAt-s.lastActiveAt)}async createThread(t,s){const i=this.requireBot(t),o=this.addThread(i,(s==null?void 0:s.title)??"New conversation");return this.emitForBot(t),o}async deleteThread(t){const s=this.requireThread(t),i=this.requireBot(s.botId);this.threads=this.threads.filter(o=>o.id!==t),this.messages=this.messages.filter(o=>o.threadId!==t),this.runs=this.runs.filter(o=>o.threadId!==t),this.approvals=this.approvals.filter(o=>o.threadId!==t),this.questions=this.questions.filter(o=>o.threadId!==t),this.threadRoots.delete(t),this.threads.some(o=>o.botId===i.id)||this.addThread(i,"New conversation"),this.refreshBot(i),this.emitForBot(i.id,t)}async listMessages(t){return this.messages.filter(s=>s.threadId===t).sort((s,i)=>(s.createdAt??Number.MAX_SAFE_INTEGER)-(i.createdAt??Number.MAX_SAFE_INTEGER))}async prompt(t,s){const i=this.requireThread(t),o=this.requireBot(i.botId);if(!s.text.trim())throw new Error("Say something first.");const l=JSON.stringify([s.text.trim(),s.mode??"queue"]),u=s.requestKey?JSON.stringify([t,s.requestKey]):void 0,d=u?this.promptRequests.get(u):void 0;if(d){if(d.body!==l)throw new Error("Request key was already used with a different prompt.");return{runId:d.runId}}if(o.paused)throw new Error(`${o.name} is paused.`);const f=this.runs.find(g=>g.threadId===t&&g.status==="running");if(s.mode==="steer"&&f)return this.addMessage(t,"user",s.text.trim(),{...s.attachments===void 0||s.attachments.length===0?{}:{attachments:s.attachments}}),u&&this.promptRequests.set(u,{body:l,runId:f.id}),this.emitForBot(o.id,t),{runId:f.id};const h=Date.now();this.addMessage(t,"user",s.text.trim(),{...s.attachments===void 0||s.attachments.length===0?{}:{attachments:s.attachments}});const p={botId:o.id,endedAt:null,error:null,id:Hn("run"),kind:"prompt",requestKey:s.requestKey??null,startedAt:h,status:"queued",threadId:t};return this.runs.push(p),this.runInputs.set(p.id,{text:s.text.trim(),mode:s.mode??"queue"}),u&&this.promptRequests.set(u,{body:l,runId:p.id}),this.addMessage(t,"user",s.text.trim()),i.lastActiveAt=h,o.lastActiveAt=h,this.refreshBot(o),this.emitRun(p),this.emitForBot(o.id,t),this.scheduleRun(p),{runId:p.id}}async interrupt(t){const s=this.runs.find(o=>o.threadId===t&&(o.status==="running"||o.status==="waiting_user"));if(!s)return;s.status="interrupted",s.error="Preview run stopped; choose a recovery decision before queued work continues.",s.endedAt=Date.now(),this.requireThread(t).blockedByRunId=s.id;for(const o of this.messages.filter(l=>l.runId===s.id))for(const l of o.toolCalls??[])l.status==="running"&&(l.status="error",l.error="Preview run stopped.",l.endedAt=Date.now());const i=this.requireBot(s.botId);for(const o of this.approvals)o.runId===s.id&&o.status==="pending"&&(o.status="expired");for(const o of this.questions)o.runId===s.id&&o.status==="pending"&&(o.status="expired");this.addMessage(t,"system","Stopped by you.",{toolCalls:[]}),this.refreshBot(i),this.emitRun(s),this.emitForBot(i.id,t)}async cancelRun(t){const s=this.requireRun(t);if(s.status==="cancelled")return;if(s.status!=="queued")throw new Error("Only queued runs can be cancelled.");s.status="cancelled",s.endedAt=Date.now();const i=this.requireBot(s.botId);this.record({action:"run.cancelled",actor:"you",botId:i.id,decision:"cancelled",initiator:"person",threadId:s.threadId}),this.refreshBot(i),this.emitRun(s),this.emitForBot(i.id,s.threadId)}async recoverRun(t,s){const i=this.requireRun(t);if(i.status!=="interrupted")throw new Error("Only interrupted runs accept recovery decisions.");if(i.recoveryDecision!==null&&i.recoveryDecision!==void 0){if(i.recoveryDecision!==s)throw new Error("Recovery decision already recorded.");const f=this.runs.find(h=>h.retryOfRunId===i.id);return f===void 0?{}:{runId:f.id}}const o=this.runInputs.get(i.id);if(s==="retry"&&!o)throw new Error("This preview run has no replayable input.");i.recoveryDecision=s,i.recoveryAt=Date.now();const l=this.requireBot(i.botId),u=this.requireThread(i.threadId);u.blockedByRunId=null;let d;if(s==="retry"&&o)d={botId:i.botId,endedAt:null,error:null,id:Hn("run"),kind:"prompt",requestKey:`retry:${i.id}`,retryOfRunId:i.id,startedAt:Date.now(),status:"queued",threadId:i.threadId},this.runs.splice(this.runs.indexOf(i)+1,0,d),this.runInputs.set(d.id,o);else if(s==="cancel_queue")for(const f of this.runs)f.threadId!==i.threadId||f.status!=="queued"||(f.status="cancelled",f.endedAt=Date.now(),this.emitRun(f));return this.record({action:"run.recovery",actor:"you",botId:l.id,decision:s,initiator:"person",threadId:u.id}),this.refreshBot(l),this.emitRun(i),d!==void 0&&this.emitRun(d),this.emitForBot(l.id,u.id),d===void 0?{}:{runId:d.id}}async markThreadRead(t){const s=this.threads.find(o=>o.id===t);if(!s||s.unread===0)return;s.unread=0;const i=this.requireBot(s.botId);this.refreshBot(i),this.emitForBot(i.id,t)}async listRuns(t){return this.runs.filter(s=>t===void 0||s.botId===t).sort((s,i)=>i.startedAt-s.startedAt)}async listHandoffs(t={}){return this.handoffs.filter(s=>(t.botId===void 0||s.fromBotId===t.botId||s.toBotId===t.botId)&&(t.threadId===void 0||s.fromThreadId===t.threadId||s.toThreadId===t.threadId)).sort((s,i)=>i.createdAt-s.createdAt).slice(0,t.limit??50)}async listInbox(){return{approvals:this.approvals.filter(t=>t.status==="pending").sort((t,s)=>s.createdAt-t.createdAt),handoffs:this.handoffs.filter(t=>t.status==="queued"||t.status==="running"||t.status==="failed").sort((t,s)=>s.createdAt-t.createdAt),questions:this.questions.filter(t=>t.status==="pending").sort((t,s)=>s.createdAt-t.createdAt)}}async decideApproval(t,s){var h;const i=this.approvals.find(p=>p.id===t);if(!i)throw new Error("That request is no longer waiting.");if(i.status!=="pending")return;i.status=s.decision==="deny"?"denied":"approved";const o=this.requireBot(i.botId),l=this.requireThread(i.threadId),u=i.runId?this.runs.find(p=>p.id===i.runId):void 0;this.record({action:"approval.decided",actor:"you",botId:o.id,decision:s.decision,initiator:"person",threadId:l.id});const d=this.messages.find(p=>{var g;return p.threadId===l.id&&(u?p.runId===u.id:!0)&&((g=p.toolCalls)==null?void 0:g.some(b=>b.name===i.toolName&&b.status==="running"))}),f=(h=d==null?void 0:d.toolCalls)==null?void 0:h.find(p=>p.name===i.toolName&&p.status==="running");s.decision==="deny"?(f&&(f.status="error",f.endedAt=Date.now(),f.error="Denied by you."),this.addMessage(l.id,"assistant","Understood — I left that alone. Tell me if a narrower command would work.")):(f&&(f.status="done",f.endedAt=Date.now(),f.output="Preview only: simulated tool output. No command ran."),this.addMessage(l.id,"assistant","Preview decision recorded. No command executed and no security permission was granted.")),u&&this.isLive(u)&&(u.status="done",u.endedAt=Date.now(),this.emitRun(u)),this.refreshBot(o),this.emit({botId:o.id,data:i,threadId:l.id,type:"approval.decided"}),this.emitForBot(o.id,l.id)}async answerQuestion(t,s){const i=this.questions.find(f=>f.id===t);if(!i)throw new Error("That question is no longer open.");if(i.status!=="pending")return;i.status="answered";const o=this.requireBot(i.botId),l=this.requireThread(i.threadId),u=Object.values(s.answers).flat().filter(Boolean).join(", ");this.addMessage(l.id,"assistant",`Noted: ${u||"no preference"}. I'll go with that.`);const d=i.runId?this.runs.find(f=>f.id===i.runId):void 0;d&&this.isLive(d)&&(d.status="done",d.endedAt=Date.now(),this.emitRun(d)),this.record({action:"question.answered",actor:"you",botId:o.id,decision:u||null,initiator:"person",threadId:l.id}),this.refreshBot(o),this.emit({botId:o.id,data:i,threadId:l.id,type:"question.answered"}),this.emitForBot(o.id,l.id)}async listRooms(){return[...this.rooms].sort((t,s)=>s.createdAt-t.createdAt).map(t=>{const s=this.roomMessages.filter(i=>i.roomId===t.id).sort((i,o)=>i.createdAt-o.createdAt).at(-1);return{...t,lastMessage:(s==null?void 0:s.content)??null,lastMessageAt:(s==null?void 0:s.createdAt)??null,lastSpeakerKind:(s==null?void 0:s.speakerKind)??null}})}async deleteRoom(t){this.rooms=this.rooms.filter(s=>s.id!==t),this.roomMessages=this.roomMessages.filter(s=>s.roomId!==t)}async createRoom(t){const s={createdAt:Date.now(),id:Hn("room"),leadBotId:t.leadBotId??t.memberIds[0]??null,memberIds:[...t.memberIds],name:t.name};return this.rooms.push(s),this.addRoomMessage(s.id,"system","Room created.","direct",null),this.emit({data:null,roomId:s.id,type:"room.message"}),s}async listRoomMessages(t){return this.roomMessages.filter(s=>s.roomId===t).sort((s,i)=>s.createdAt-i.createdAt)}async listRoomRuns(t){return this.runs.filter(s=>s.roomId===t)}async promptRoom(t,s,i){const o=i==null?void 0:i.requestKey,l=this.rooms.find(b=>b.id===t);if(!l)throw new Error("That room is gone.");const u=s.trim();if(!u)throw new Error("Say something first.");const d=o?JSON.stringify([t,o]):void 0,f=d?this.roomRequests.get(d):void 0;if(f!==void 0){if(f!==u)throw new Error("Request key was already used with a different room message.");return}d&&this.roomRequests.set(d,u),this.addRoomMessage(t,"user",u,"direct",null,i==null?void 0:i.attachments);const h=l.memberIds.map(b=>this.bots.find(w=>w.id===b)).filter(b=>b!==void 0),g=h.filter(b=>new RegExp(`(^|\\s)@${b.name.replaceAll(/[.*+?^${}()|[\]\\]/gu,"\\$&")}(?=$|\\s|[,.!?;:,。!?;:])`,"iu").test(u)).sort((b,w)=>w.name.length-b.name.length)[0]??h.find(b=>b.id===l.leadBotId);if(!g){this.addRoomMessage(t,"system","Nobody was addressed. Mention a Bot with @name, or set a lead.","direct",null);return}this.after(900,()=>{!this.rooms.includes(l)||!this.bots.includes(g)||this.addRoomMessage(t,"bot",`${g.name} here. The workbench is running against the mock transport; the room shares one transcript while each Bot keeps its own thread.`,"direct",g.id)})}async uploadAttachment(t,s,i){return this.previewAttachment(s)}async uploadRoomAttachment(t,s){return this.previewAttachment(s)}previewAttachment(t){const s=t.name.replaceAll(/[^\p{L}\p{N}._-]+/gu,"_").replace(/^[._]+/u,"")||"file";return{id:Hn("attachment"),name:s,path:`.scream-attachments/${Hn("file")}-${s}`,size:t.size,mime:t.type||"application/octet-stream"}}async listFiles(t,s,i){const{root:o,resolved:l}=this.filePath(t,s,i),u=this.files.get(o)??[],d=new Map,f=l.endsWith("/")?l:`${l}/`;if(l!==o&&!u.some(({entry:h})=>`${o}/${h.path}`===l&&h.kind==="directory"||`${o}/${h.path}`.startsWith(f)))throw new Error(`No such directory: ${l}`);for(const{entry:h}of u){const p=`${o}/${h.path}`;if(!p.startsWith(f))continue;const g=p.slice(f.length),b=g.split("/")[0];if(!b)continue;const w=`${f}${b}`;d.set(w,g.includes("/")?{path:w,kind:"directory",size:null}:{...h,path:w})}return{path:l,entries:[...d.values()].sort((h,p)=>h.kind.localeCompare(p.kind)||h.path.localeCompare(p.path))}}async readFile(t,s,i){const{root:o,resolved:l}=this.filePath(t,s,i),u=(this.files.get(o)??[]).find(g=>`${o}/${g.entry.path}`===l&&g.entry.kind==="file");if(!u)throw new Error(`No such file: ${l}`);const d=256*1024,f=new TextEncoder().encode(u.content),h=f.length>d,p=new TextDecoder().decode(f.subarray(0,d),{stream:h});return{path:l,content:p,truncated:h}}filePath(t,s,i){const o=this.requireBot(t),l=i===void 0?void 0:this.requireThread(i);if(l&&l.botId!==o.id)throw new Error("Thread does not belong to this Bot.");const u=l?this.threadRoots.get(l.id)??o.workspace:o.workspace,d=(s||".").replaceAll("\\","/"),f=d.startsWith("/")||d.startsWith("~")?d:`${u}/${d}`,h=[];for(const g of f.split("/"))!g||g==="."||(g===".."?h.pop():h.push(g));const p=`${f.startsWith("/")?"/":""}${h.join("/")}`;if(p!==u&&!p.startsWith(u.endsWith("/")?u:`${u}/`))throw new Error("Path is outside the preview workspace.");return{root:u,resolved:p}}async listActivity(t){return this.audit.filter(s=>t===void 0||s.botId===t).sort((s,i)=>i.createdAt-s.createdAt).slice(0,50)}requireRun(t){const s=this.runs.find(i=>i.id===t);if(!s)throw new Error(`Unknown run: ${t}`);return s}isLive(t){return this.runs.includes(t)&&(t.status==="running"||t.status==="waiting_user")&&this.threads.some(s=>s.id===t.threadId)&&this.bots.some(s=>s.id===t.botId)}scheduleBot(t){for(const s of this.runs.filter(i=>i.botId===t&&i.status==="queued"))this.scheduleRun(s)}scheduleRun(t){if(t.status!=="queued"||this.scheduledRuns.has(t.id))return;const s=this.threads.find(l=>l.id===t.threadId),i=this.bots.find(l=>l.id===t.botId);!s||!i||i.paused||s.blockedByRunId||this.runs.find(l=>l.threadId===s.id&&(l.status==="queued"||l.status==="running"||l.status==="waiting_user"))!==t||(this.scheduledRuns.add(t.id),this.after(120,()=>{var l;this.scheduledRuns.delete(t.id),!(!this.runs.includes(t)||t.status!=="queued"||!this.threads.includes(s)||!this.bots.includes(i)||i.paused||s.blockedByRunId)&&(t.status="running",t.dispatchStartedAt=Date.now(),this.emitRun(t),this.respond(i,s,t,T6(((l=this.runInputs.get(t.id))==null?void 0:l.text)??"")))}))}emitRun(t){var o;const s=this.threads.find(l=>l.id===t.threadId),i=this.bots.find(l=>l.id===t.botId);!s||!i||(s.runStatus=((o=this.runs.find(l=>l.threadId===s.id&&(l.status==="running"||l.status==="waiting_user"||l.status==="queued")))==null?void 0:o.status)??null,this.refreshBot(i),this.emit({type:"run.updated",botId:i.id,threadId:s.id,data:t}),this.emitForBot(i.id,s.id),this.scheduleBot(i.id))}afterRun(t,s,i){this.after(t,()=>{this.isLive(s)&&i()})}respond(t,s,i,o){if(o==="approval"){this.respondWithApproval(t,s,i);return}if(o==="handoff"){this.respondWithHandoff(t,s,i);return}if(o==="question"){this.respondWithQuestion(t,s,i);return}const l=this.addMessage(s.id,"assistant","");this.stream(t,s,i,l,"Preview response: this conversation uses the in-memory mock transport. Messages, tools and inbox decisions are simulated. No command executes, no security permission is granted, and no files are read or written.",()=>{i.status="done",i.endedAt=Date.now(),this.refreshBot(t),this.emitForBot(t.id,s.id)})}respondWithApproval(t,s,i){const o={args:{command:"pnpm -w run test:coverage"},endedAt:void 0,id:Hn("call"),name:"Bash",output:void 0,startedAt:Date.now(),status:"running"},l=this.addMessage(s.id,"assistant","",{toolCalls:[o]});this.emitForBot(t.id,s.id),l.runId=i.id,this.afterRun(700,i,()=>{const u={action:"pnpm -w run test:coverage",botId:t.id,createdAt:Date.now(),expiresAt:Date.now()+5*Gt,grantOptions:["once","session"],id:Hn("approval"),reasons:["Preview decision only — no command executes and no security permission is granted"],runId:i.id,status:"pending",threadId:s.id,toolName:"Bash"};this.approvals.push(u),i.status="waiting_user",this.emitRun(i),this.refreshBot(t),this.record({action:"approval.requested",actor:t.name,botId:t.id,decision:null,initiator:"person",threadId:s.id}),this.emit({botId:t.id,data:u,threadId:s.id,type:"approval.requested"}),this.emitForBot(t.id,s.id)})}respondWithQuestion(t,s,i){const o=this.addMessage(s.id,"assistant","");this.stream(t,s,i,o,"Before I go further, two decisions are yours.",()=>{const l={botId:t.id,createdAt:Date.now(),id:Hn("question"),items:[{allowOther:!0,header:"Workspace",id:"workspace",multiple:!1,options:[{description:"Keep the bot's files beside the app.",label:"Reuse ~/Projects/scream-code"},{description:"A clean tree, isolated from the app.",label:"Create ~/Projects/workbench"}],question:"Where should the new Bot keep its files?"},{allowOther:!0,header:"Permissions",id:"permission",multiple:!0,options:[{label:"Read files"},{label:"Write files"},{label:"Run shell commands"}],question:"Which activities should this preview describe?"}],runId:i.id,status:"pending",threadId:s.id};this.questions.push(l),i.status="waiting_user",this.refreshBot(t),this.emit({botId:t.id,data:l,threadId:s.id,type:"question.requested"}),this.emitForBot(t.id,s.id)})}respondWithHandoff(t,s,i){const o=this.bots.find(f=>f.id!==t.id&&!f.paused)??this.bots.find(f=>f.id!==t.id);if(!o){this.addMessage(s.id,"assistant","There is nobody to hand this to yet. Create a second Bot first."),i.status="done",i.endedAt=Date.now(),this.emitRun(i),this.refreshBot(t),this.emitForBot(t.id,s.id);return}const l="Audit the shell against the plan, list the components worth vendoring, and report any dependency the package is missing.",u={args:{bot:o.name,expecting:"A short audit",task:l},endedAt:void 0,id:Hn("call"),name:"message_bot",output:void 0,startedAt:Date.now(),status:"running"},d=this.addMessage(s.id,"assistant","",{toolCalls:[u]});d.runId=i.id,this.afterRun(600,i,()=>{u.status="done",u.endedAt=Date.now(),u.output=`Queued for ${o.name}.`;const f={answer:null,completedAt:null,createdAt:Date.now(),error:null,fromBotId:t.id,fromThreadId:s.id,id:Hn("handoff"),status:"queued",task:l,toBotId:o.id,toThreadId:null};this.handoffs.push(f);const h={...d,handoff:f};Object.assign(d,h),this.emit({botId:t.id,data:f,threadId:s.id,type:"handoff.updated"}),this.emitForBot(t.id,s.id),this.stream(t,s,i,void 0,`Handed the audit to ${o.name}. I'll keep working here — their answer lands in their thread, and you'll see a pointer in this one.`,()=>{i.status="done",i.endedAt=Date.now(),this.refreshBot(t),this.emitForBot(t.id,s.id),this.after(1200,()=>this.deliverHandoff(f,t,o))})})}deliverHandoff(t,s,i){if(!this.bots.includes(s)||!this.bots.includes(i)||!this.threads.some(l=>l.id===t.fromThreadId))return;t.status="running",this.emit({botId:i.id,data:t,threadId:t.fromThreadId,type:"handoff.updated"});const o=this.threads.find(l=>l.botId===i.id);if(!o){t.status="failed",t.error="Target has no thread.",this.emitForBot(s.id,t.fromThreadId);return}t.toThreadId=o.id,this.addMessage(o.id,"user",`From ${s.name}: ${t.task}`),o.lastActiveAt=Date.now(),i.lastActiveAt=Date.now(),this.refreshBot(i),this.emitForBot(i.id,o.id),this.after(2600,()=>{if(!this.bots.includes(s)||!this.bots.includes(i)||!this.threads.includes(o)||!this.threads.some(d=>d.id===t.fromThreadId))return;t.status="delivered";const l="Audit done. The shell, roster, transcript and drawers reuse the local primitives; the chat layer is ours. Two dependencies are absent from the package: `embla-carousel-react` and `@shadcn/react` — both were replaced locally rather than added.";t.answer=l,t.completedAt=Date.now(),this.addMessage(o.id,"assistant",l),o.unread+=1,this.refreshBot(i),this.addMessage(t.fromThreadId,"system",`${i.name} answered. The reply stays in their thread; open ${i.name} to read it.`);const u=this.messages.find(d=>{var f;return((f=d.handoff)==null?void 0:f.id)===t.id});u!=null&&u.handoff&&(u.handoff={...u.handoff,status:"delivered"}),this.record({action:"handoff.delivered",actor:i.name,botId:i.id,decision:null,initiator:"handoff",threadId:o.id}),this.refreshBot(s),this.emit({botId:s.id,data:t,threadId:t.fromThreadId,type:"handoff.updated"}),this.emitForBot(i.id,o.id),this.emitForBot(s.id,t.fromThreadId)})}stream(t,s,i,o,l,u){const d=o??this.addMessage(s.id,"assistant","");d.runId=i.id;let f=0;const h=()=>{if(!(!this.isLive(i)||!this.messages.includes(d))){if(f=Math.min(l.length,f+3+Math.floor(Math.random()*4)),d.content=l.slice(0,f),this.emit({botId:t.id,data:{content:d.content,messageId:d.id},threadId:s.id,type:"assistant.delta"}),f<l.length){this.after(16,h);return}this.emitForBot(t.id,s.id),u(),this.emitRun(i)}};this.after(120,h)}after(t,s){const i=setTimeout(()=>{this.timers.delete(i),s()},t);this.timers.add(i)}emitForBot(t,s){this.emit({botId:t,data:null,threadId:s,type:s?"thread.updated":"bot.updated"})}emit(t){this.seq+=1;const s=structuredClone({...t,epoch:this.epoch,seq:this.seq});for(const i of this.listeners)i(s)}record(t){this.audit.push({...t,createdAt:Date.now(),id:this.audit.length+1})}addThread(t,s){const i={archivedAt:null,botId:t.id,id:Hn("thread"),lastActiveAt:Date.now(),runStatus:null,title:s,unread:0};return this.threads.push(i),this.threadRoots.set(i.id,t.workspace),i}addMessage(t,s,i,o){const l={content:i,createdAt:Date.now(),id:Hn("message"),role:s,threadId:t,...o};return this.messages.push(l),l}addRoomMessage(t,s,i,o,l,u){const d={answeredBy:o==="handoff"?l:null,content:i,createdAt:Date.now(),id:Hn("room-message"),roomId:t,speakerId:l??"you",speakerKind:s,via:o,...u===void 0||u.length===0?{}:{attachments:u}};return this.roomMessages.push(d),this.emit({data:d,roomId:t,type:"room.message"}),d}requireBot(t){const s=this.bots.find(i=>i.id===t);if(!s)throw new Error(`Unknown Bot: ${t}`);return s}requireThread(t){const s=this.threads.find(i=>i.id===t);if(!s)throw new Error(`Unknown thread: ${t}`);return s}refreshBot(t){const s=this.approvals.filter(l=>l.botId===t.id&&l.status==="pending").length+this.questions.filter(l=>l.botId===t.id&&l.status==="pending").length+this.handoffs.filter(l=>l.fromBotId===t.id&&(l.status==="queued"||l.status==="failed")).length;t.needsYou=s,t.unread=this.threads.filter(l=>l.botId===t.id).reduce((l,u)=>l+u.unread,0);const i=this.runs.find(l=>l.botId===t.id&&(l.status==="queued"||l.status==="running"||l.status==="waiting_user")),o=t.paused?"paused":i?i.status==="waiting_user"?"needs_you":"working":"idle";t.status=o}seed(){const t=Date.now(),s={avatarSeed:"scream",id:"bot-scream",lastActiveAt:t-12*Gt,model:"default",name:"Scream",needsYou:0,paused:!1,permission:"bot",rolePrompt:"You are Scream, the lead Bot of this workbench. You plan, write code, and hand specialised work to the other Bots.",status:"idle",thinking:"medium",title:"Lead bot",toolPolicy:{handoff:!0},unread:0,workspace:"~/Projects/scream-code"},i={avatarSeed:"research",id:"bot-research",lastActiveAt:t-38*Gt,model:"default",name:"Research",needsYou:0,paused:!1,permission:"bot",rolePrompt:"You are Research. You investigate, read source, and report findings with citations to files.",status:"idle",thinking:"high",title:"Investigator",toolPolicy:{handoff:!1},unread:0,workspace:"~/Projects/research"},o={avatarSeed:"ops",id:"bot-ops",lastActiveAt:t-26*ir,model:"default",name:"Ops",needsYou:0,paused:!0,permission:"bot",rolePrompt:"You are Ops. You watch releases, run the gates, and report what is broken.",status:"paused",thinking:"low",title:"Release & infra",toolPolicy:{handoff:!1},unread:0,workspace:"~/Projects/scream-code"};this.bots.push(s,i,o);const l={archivedAt:null,botId:s.id,id:"thread-scream-main",lastActiveAt:t-12*Gt,runStatus:null,title:"Workbench from plan to UI",unread:0},u={archivedAt:null,botId:i.id,id:"thread-research-main",lastActiveAt:t-38*Gt,runStatus:null,title:"Vendor UI inventory",unread:0},d={archivedAt:null,botId:o.id,id:"thread-ops-main",lastActiveAt:t-26*ir,runStatus:null,title:"Release checklist",unread:0};this.threads.push(l,u,d),this.threadRoots.set(l.id,s.workspace),this.threadRoots.set(u.id,i.workspace),this.threadRoots.set(d.id,o.workspace),this.addMessage(l.id,"system","Mock preview only. Tools, inbox decisions and answers are simulated; no security approval is granted. Workspace: ~/Projects/scream-code.").createdAt=t-58*Gt,this.addMessage(l.id,"user","Take the workbench plan from doc to a clickable UI. Roster, chat, approvals, hand-off — all of it.").createdAt=t-56*Gt;const f={args:{path:"plans/workbench.md"},endedAt:t-52*Gt,id:"call-read-plan",name:"Read",output:"358 lines — milestones M0 to M4, UI structure, vendoring rules.",startedAt:t-53*Gt,status:"done"},h={args:{command:"pnpm exec tsc -p src/bot/ui/tsconfig.json --noEmit"},endedAt:t-44*Gt,id:"call-tsc",name:"Bash",output:"Preview fixture: simulated typecheck output; no command ran.",startedAt:t-45*Gt,status:"done"};this.addMessage(l.id,"assistant","Preview transcript with simulated tool results. Two sample inbox items demonstrate decision handling; neither grants permissions nor executes commands.",{toolCalls:[f,h]}).createdAt=t-43*Gt;const p={answer:null,completedAt:null,createdAt:t-35*Gt,error:null,fromBotId:s.id,fromThreadId:l.id,id:"handoff-seed",status:"running",task:"Audit the shell and list the components that still assume a remote platform.",toBotId:i.id,toThreadId:u.id};this.handoffs.push(p),this.addMessage(l.id,"assistant","I asked Research to audit the shell in parallel. Their answer will land in their thread.",{handoff:p,toolCalls:[]}).createdAt=t-35*Gt,this.addMessage(u.id,"user","From Scream: Audit the shell and note which pieces still assume a remote platform.").createdAt=t-34*Gt,this.addMessage(u.id,"assistant","Started the audit. The chat layer, the profile pages and the settings tabs are the parts with platform assumptions; the primitives are clean. Full report once I have read the last directory.").createdAt=t-20*Gt,u.unread=1,this.addMessage(d.id,"user","What is blocking the release?").createdAt=t-27*ir,this.addMessage(d.id,"assistant","Nothing blocking. The gates pass; the only open item is the soak test on the new stream.").createdAt=t-26*ir;const g={action:"pnpm -w run test:coverage",botId:s.id,createdAt:t-9*Gt,expiresAt:t+21*Gt,grantOptions:["once","session"],id:"approval-seed",reasons:["Preview decision only — no command executes and no security permission is granted"],runId:null,status:"pending",threadId:l.id,toolName:"Bash"};this.approvals.push(g);const b={botId:s.id,createdAt:t-8*Gt,id:"question-seed",items:[{allowOther:!0,header:"Composer",id:"composer",multiple:!1,options:[{label:"Send now"},{label:"Add to the queue"},{label:"Ask before sending"}],question:"How should Enter behave in the composer?"}],runId:null,status:"pending",threadId:l.id};this.questions.push(b);const w={createdAt:t-5*ir,id:"room-workbench",leadBotId:s.id,memberIds:[s.id,i.id],name:"Workbench"};this.rooms.push(w),this.roomMessages.push({answeredBy:null,content:"Room created for the workbench rollout.",createdAt:t-5*ir,id:"room-message-1",roomId:w.id,speakerId:"you",speakerKind:"system",via:"direct"},{answeredBy:null,content:"@Research how many primitives ended up local?",createdAt:t-4*ir,id:"room-message-2",roomId:w.id,speakerId:"you",speakerKind:"user",via:"direct"},{answeredBy:null,content:"Twenty-six. Twenty-three shared as-is, three rebuilt locally because their original packages are not dependencies here.",createdAt:t-4*ir+4e4,id:"room-message-3",roomId:w.id,speakerId:i.id,speakerKind:"bot",via:"direct"}),this.files.set(s.workspace,[{content:`import { StrictMode } from "react";
237
- import { createRoot } from "react-dom/client";
238
-
239
- createRoot(document.getElementById("root")!).render(<StrictMode>{/* app */}</StrictMode>);
240
- `,entry:{kind:"file",path:"src/bot/ui/main.tsx",size:212}},{content:`export const router = createRouter({ routeTree });
241
- `,entry:{kind:"file",path:"src/bot/ui/router.tsx",size:64}},{content:`@import "tailwindcss";
242
-
243
- :root {
244
- --brand: oklch(0.52 0.1 186);
245
- }
246
- `,entry:{kind:"file",path:"src/bot/ui/styles/tokens.css",size:78}},{content:`{
247
- "name": "scream-code",
248
- "private": true
249
- }
250
- `,entry:{kind:"file",path:"package.json",size:52}},{content:"",entry:{kind:"directory",path:"src",size:null}}]),this.files.set(i.workspace,[{content:`# Vendor audit
251
-
252
- - Shell: adapted
253
- - Chat: rewritten
254
- `,entry:{kind:"file",path:"audit.md",size:54}}]),this.audit.push({action:"bot.created",actor:"you",botId:s.id,createdAt:t-6*ir,decision:null,id:1,initiator:"person",threadId:null},{action:"handoff.queued",actor:"Scream",botId:i.id,createdAt:t-35*Gt,decision:null,id:2,initiator:"handoff",threadId:u.id},{action:"approval.requested",actor:"Scream",botId:s.id,createdAt:t-9*Gt,decision:null,id:3,initiator:"person",threadId:l.id},{action:"question.requested",actor:"Scream",botId:s.id,createdAt:t-8*Gt,decision:null,id:4,initiator:"person",threadId:l.id}),this.refreshBot(s),this.refreshBot(i),this.refreshBot(o)}}const Ao=new WeakMap,gv=new Map;function vm(e){let t=gv.get(e);return t===void 0&&(t=gv.size+1,gv.set(e,t)),t}function dC(e,t){const s=Ao.get(t);return s!==void 0&&Ao.set(e,s),e}function u0(e,t,s=0){return Ao.set(e,{version:t,generation:s}),e}function E6(e,t){if(e===void 0)return;const s=vm(t),i=Ao.get(e);if(i!==void 0&&i.generation>=s)return e;const o=[...e];return Ao.set(o,{version:0,generation:s,reset:!0}),o}function C6(e,t){const s=e===void 0?void 0:Ao.get(e),i=Ao.get(t);if(e===void 0||s===void 0)return t;if(i===void 0||i.generation<s.generation)return e;if(i.generation>s.generation||s.reset===!0)return t;const o=i.version<s.version,l=new Map(e.map(h=>[h.id,h]));let u=!1;const d=t.map(h=>{const p=l.get(h.id);return p!==void 0&&(o||(p.projectionVersion??-1)>(h.projectionVersion??-1))?(u=!0,p):h}),f=new Set(t.map(h=>h.id));for(const h of e)!f.has(h.id)&&(o||(h.projectionVersion??-1)>i.version)&&(d.push(h),u=!0);return!o&&!u?t:u0(d,o?s.version:i.version,s.generation)}function A6(e,t,s,i){const o=e===void 0?void 0:Ao.get(e),l=i===void 0?0:vm(i);if(s===void 0&&o!==void 0)return e??[];if(s!==void 0&&o!==void 0&&(l<o.generation||l===o.generation&&s<o.version))return e??[];const u=o!==void 0&&(l>o.generation||o.reset===!0)?[]:e??[],f=u.some(h=>h.id===t.id)?u.map(h=>h.id===t.id?t:h):[...u,t];return s===void 0?f:u0(f,s,l)}class k6{constructor(t){ge(this,"decoder",new TextDecoder);ge(this,"buffer","");ge(this,"offset",0);ge(this,"skipLf",!1);ge(this,"data",[]);ge(this,"event","");ge(this,"id");ge(this,"frameSize",0);this.dispatch=t}push(t){this.buffer+=this.decoder.decode(t,{stream:!0});let s=0;for(let i=this.offset;i<this.buffer.length;i+=1){const o=this.buffer[i];if(this.skipLf&&(this.skipLf=!1,o===`
255
- `)){s=i+1;continue}o!=="\r"&&o!==`
256
- `||(this.line(this.buffer.slice(s,i)),this.skipLf=o==="\r",s=i+1)}if(this.buffer=this.buffer.slice(s),this.offset=this.buffer.length,this.buffer.length+this.frameSize>1048576)throw new Zs("SSE frame exceeds size limit")}line(t){if(t===""){(this.data.length>0||this.id!==void 0)&&this.dispatch({event:this.event||"message",data:this.data.join(`
257
- `),id:this.id}),this.data=[],this.event="",this.id=void 0,this.frameSize=0;return}if(this.frameSize+=t.length,this.frameSize>1048576)throw new Zs("SSE frame exceeds size limit");if(t.startsWith(":"))return;const s=t.indexOf(":"),i=s<0?t:t.slice(0,s),o=s<0?"":t.slice(s+1),l=o.startsWith(" ")?o.slice(1):o;i==="data"?this.data.push(l):i==="event"?this.event=l:i==="id"&&!l.includes("\0")&&(this.id=l)}}class Zs extends Error{}function M6(e,t){return new Promise(s=>{if(e.aborted){s();return}const i=()=>{clearTimeout(o),e.removeEventListener("abort",i),s()},o=setTimeout(i,t);e.addEventListener("abort",i,{once:!0})})}class N6{constructor(t=""){ge(this,"listeners",new Set);ge(this,"connectionListeners",new Set);ge(this,"connection",{status:"disconnected",error:null,retryInMs:null});ge(this,"controller");ge(this,"cursor");ge(this,"requestSequence",0);ge(this,"acceptedEpoch");ge(this,"epochBarrier",0);ge(this,"retiredEpochs",new Set);ge(this,"getConnectionState",()=>this.connection);ge(this,"subscribeConnectionState",t=>(this.connectionListeners.add(t),()=>this.connectionListeners.delete(t)));this.baseUrl=t}setConnection(t,s=null,i=null){this.connection={status:t,error:s,retryInMs:i};for(const o of this.connectionListeners)o()}async request(t,s){var l;const i=new Headers(s==null?void 0:s.headers);i.has("accept")||i.set("accept","application/json"),(s==null?void 0:s.body)!==void 0&&!(s.body instanceof FormData)&&!i.has("content-type")&&i.set("content-type","application/json");const o=await fetch(`${this.baseUrl}${t}`,{...s,headers:i});if(!o.ok){let u=`Request failed (${o.status})`;try{const d=await o.json();((l=d.error)==null?void 0:l.message)!==void 0&&(u=d.error.message)}catch{}throw new Error(u)}if(o.status!==204)return await o.json()}subscribe(t){if(this.listeners.add(t),this.controller===void 0){const s=new AbortController;this.controller=s,this.pump(s)}return()=>{var s;this.listeners.delete(t),!(this.listeners.size>0)&&((s=this.controller)==null||s.abort(),this.controller=void 0,this.setConnection("disconnected"))}}acceptEpoch(t,s){if(t===this.acceptedEpoch)return vm(t);if(!(this.retiredEpochs.has(t)||s<=this.epochBarrier))return this.acceptedEpoch!==void 0&&this.retiredEpochs.add(this.acceptedEpoch),this.acceptedEpoch=t,this.epochBarrier=this.requestSequence,vm(t)}dispatchFrame(t,s){if(t.id===""&&(this.cursor=void 0),t.data===""||t.event==="ping"){t.id!==void 0&&t.id!==""&&(this.cursor=t.id);return}let i;try{i=JSON.parse(t.data)}catch{throw new Zs("Invalid JSON in event stream")}if(typeof i!="object"||i===null)throw new Zs("Invalid event stream frame");const o=i;if(typeof o.epoch!="string"||!/^[^\s:]+$/.test(o.epoch)||!Number.isSafeInteger(o.seq)||o.seq<0)throw new Zs("Event stream frame is missing its epoch/sequence watermark");const l=`${o.epoch}:${String(o.seq)}`;if(t.id!==void 0&&t.id!==""&&t.id!==l)throw new Zs("Event stream cursor does not match its watermark");const u=this.acceptedEpoch!==void 0&&this.acceptedEpoch!==o.epoch;if(this.acceptEpoch(o.epoch,s)===void 0)throw new Error("Stale event stream epoch; reconnecting");if(t.event==="snapshot")this.emit({...o,type:"resync",data:{reason:"snapshot"}});else{if(typeof o.type!="string")throw new Zs("Event stream frame has no event type");if(["assistant.delta","message.created","tool.updated"].includes(o.type)){const d=o.data,f=typeof d=="object"&&d!==null?d.version:void 0;if(!Number.isSafeInteger(f)||f<0)throw new Zs("Transcript event is missing its projection version")}u&&o.type!=="resync"&&this.emit({...o,type:"resync",data:{reason:"epoch_mismatch"}}),this.emit(i)}t.id!==""&&(this.cursor=t.id??l)}emit(t){for(const s of this.listeners)s(t)}async pump(t){var o,l,u,d;const s=t.signal;let i=0;for(;!s.aborted;){this.setConnection(i===0?"connecting":"reconnecting");let f,h=!1;try{const p=++this.requestSequence,g=await fetch(`${this.baseUrl}/api/events`,{headers:{accept:"text/event-stream",...this.cursor===void 0?{}:{"Last-Event-ID":this.cursor}},signal:s});if(s.aborted){await((o=g.body)==null?void 0:o.cancel());return}if(!g.ok){await((l=g.body)==null?void 0:l.cancel());const x=`Event stream failed (${g.status})`;throw g.status>=400&&g.status<500&&g.status!==408&&g.status!==429?new Zs(x):new Error(x)}if(g.body===null||!((u=g.headers.get("content-type"))!=null&&u.toLowerCase().startsWith("text/event-stream")))throw await((d=g.body)==null?void 0:d.cancel()),new Zs("Expected a text/event-stream response");f=g.body.getReader();const b=new k6(x=>{s.aborted||(this.dispatchFrame(x,p),h=!0)});this.setConnection("connected");const w=()=>{f==null||f.cancel().catch(()=>{})};s.addEventListener("abort",w,{once:!0});try{for(;!s.aborted;){const x=await f.read();if(x.done)break;b.push(x.value)}}finally{s.removeEventListener("abort",w)}if(s.aborted)return;throw new Error("Event stream disconnected")}catch(p){if(s.aborted)return;const g=p instanceof Error?p.message:String(p);if(p instanceof Zs){this.setConnection("error",g);return}h&&(i=0);const b=Math.min(3e4,1e3*2**Math.min(i,5));i+=1,this.setConnection("offline",g,b),await M6(s,b)}finally{await(f==null?void 0:f.cancel().catch(()=>{})),f==null||f.releaseLock()}}}async listBots(){return[...await this.request("/api/bots")]}async getBot(t){return(await this.listBots()).find(i=>i.id===t)}createBot(t){return this.request("/api/bots",{method:"POST",body:JSON.stringify(t)})}async updateBot(t,s){return(await this.request(`/api/bots/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(s)})).bot}async deleteBot(t){await this.request(`/api/bots/${encodeURIComponent(t)}`,{method:"DELETE"})}setPaused(t,s){return this.request(`/api/bots/${encodeURIComponent(t)}/${s?"pause":"resume"}`,{method:"POST"})}async listThreads(t){return[...await this.request(`/api/bots/${encodeURIComponent(t)}/threads`)]}createThread(t,s){return this.request(`/api/bots/${encodeURIComponent(t)}/threads`,{method:"POST",body:JSON.stringify(s??{})})}async deleteThread(t){await this.request(`/api/threads/${encodeURIComponent(t)}`,{method:"DELETE"})}async listMessages(t){const s=++this.requestSequence,i=await this.request(`/api/threads/${encodeURIComponent(t)}/messages`);if(i.threadId!==t||typeof i.epoch!="string"||!/^[^\s:]+$/.test(i.epoch)||!Number.isSafeInteger(i.version)||i.version<0||!Array.isArray(i.messages))throw new Error("Invalid transcript snapshot");const o=this.acceptEpoch(i.epoch,s);if(o===void 0)throw new Error("Stale transcript epoch");return u0([...i.messages],i.version,o)}prompt(t,s){return this.request(`/api/threads/${encodeURIComponent(t)}/messages`,{method:"POST",body:JSON.stringify(s)})}async interrupt(t){await this.request(`/api/threads/${encodeURIComponent(t)}/interrupt`,{method:"POST"})}async cancelRun(t){await this.request(`/api/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"})}async recoverRun(t,s){const i=await this.request(`/api/runs/${encodeURIComponent(t)}/recovery`,{method:"POST",body:JSON.stringify({decision:s})});return i.retryRun===null?{}:{runId:i.retryRun.id}}async markThreadRead(t){await this.request(`/api/threads/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({unread:!1})})}async listRuns(t){const s=t===void 0?"":`?botId=${encodeURIComponent(t)}`;return[...await this.request(`/api/runs${s}`)]}async listInbox(){const t=await this.request("/api/inbox");return{approvals:t.approvals,questions:t.questions,handoffs:t.handoffs??[]}}async listHandoffs(t={}){const s=new URLSearchParams;t.botId!==void 0&&s.set("botId",t.botId),t.threadId!==void 0&&s.set("threadId",t.threadId),t.limit!==void 0&&s.set("limit",String(t.limit));const i=s.size===0?"":`?${s.toString()}`;return[...await this.request(`/api/handoffs${i}`)]}async decideApproval(t,s){await this.request(`/api/approvals/${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify(s)})}async answerQuestion(t,s){await this.request(`/api/questions/${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify(s)})}async listRooms(){return[...await this.request("/api/rooms")]}async deleteRoom(t){await this.request(`/api/rooms/${encodeURIComponent(t)}`,{method:"DELETE"})}async createRoom(t){return this.request("/api/rooms",{method:"POST",body:JSON.stringify(t)})}async listRoomMessages(t){return[...(await this.request(`/api/rooms/${encodeURIComponent(t)}/messages`)).messages]}async listRoomRuns(t){return[...(await this.request(`/api/rooms/${encodeURIComponent(t)}/messages`)).runs]}async promptRoom(t,s,i){await this.request(`/api/rooms/${encodeURIComponent(t)}/messages`,{method:"POST",body:JSON.stringify({text:s,...(i==null?void 0:i.requestKey)===void 0?{}:{requestKey:i.requestKey},...(i==null?void 0:i.attachments)===void 0||i.attachments.length===0?{}:{attachments:i.attachments}})})}async uploadAttachment(t,s,i){const o=new FormData;o.append("file",s);const l=i===void 0?"":`?threadId=${encodeURIComponent(i)}`;return this.request(`/api/bots/${encodeURIComponent(t)}/attachments${l}`,{method:"POST",body:o})}async uploadRoomAttachment(t,s){const i=new FormData;return i.append("file",s),this.request(`/api/rooms/${encodeURIComponent(t)}/attachments`,{method:"POST",body:i})}async listFiles(t,s,i){const o=new URLSearchParams;s!==void 0&&o.set("path",s),i!==void 0&&o.set("threadId",i);const l=o.size===0?"":`?${o.toString()}`,u=await this.request(`/api/bots/${encodeURIComponent(t)}/files${l}`);return{path:u.path,entries:u.entries.map(d=>({path:d.path,kind:d.type==="dir"?"directory":"file",size:d.size}))}}async readFile(t,s,i){const o=new URLSearchParams({path:s});return i!==void 0&&o.set("threadId",i),this.request(`/api/bots/${encodeURIComponent(t)}/files?${o.toString()}`)}async listActivity(t){if(t===void 0){const i=await this.listBots();return(await Promise.all(i.map(l=>this.request(`/api/bots/${encodeURIComponent(l.id)}/audit`)))).flat().toSorted((l,u)=>u.createdAt-l.createdAt)}return[...await this.request(`/api/bots/${encodeURIComponent(t)}/audit`)]}}const O6={},j6=O6.VITE_BOT_MOCK==="1";let D6=j6?new R6:new N6;function Yt(){return D6}const Fs=()=>Yt(),He={activity:e=>["activity",e??"all"],bot:e=>["bot",e],bots:()=>["bots"],file:(e,t,s)=>["file",e,t,s??"bot"],files:(e,t,s)=>["files",e,t??"",s??"bot"],handoffs:()=>["handoffs"],inbox:()=>["inbox"],messages:e=>["messages",e],roomMessages:e=>["room-messages",e],roomRuns:e=>["room-runs",e],rooms:()=>["rooms"],runs:e=>["runs",e??"all"],threads:e=>["threads",e]},No=()=>({queryFn:()=>Fs().listBots(),queryKey:He.bots(),refetchInterval:2e3}),_6=e=>({queryFn:async()=>await Fs().getBot(e)??null,queryKey:He.bot(e),retry:!1}),I6=e=>({queryFn:()=>Fs().listThreads(e),queryKey:He.threads(e),refetchInterval:2e3}),P6=e=>({queryFn:()=>Fs().listMessages(e),queryKey:He.messages(e),structuralSharing:(t,s)=>C6(t,s),refetchInterval:1e3}),Rc=()=>({queryFn:()=>Fs().listInbox(),queryKey:He.inbox(),refetchInterval:2e3}),op=e=>({queryFn:()=>Fs().listRuns(e),queryKey:He.runs(e),refetchInterval:2e3}),ap=()=>({queryFn:()=>Fs().listRooms(),queryKey:He.rooms(),refetchInterval:2e3}),z6=e=>({queryFn:()=>Fs().listRoomMessages(e),queryKey:He.roomMessages(e),refetchInterval:1e3}),L6=e=>({queryFn:()=>Fs().listRoomRuns(e),queryKey:He.roomRuns(e),refetchInterval:1e3}),fC=(e,t,s)=>({queryFn:()=>Fs().listFiles(e,t,s),queryKey:He.files(e,t,s)}),B6=(e,t,s)=>({queryFn:()=>Fs().readFile(e,t,s),queryKey:He.file(e,t,s)}),U6=e=>({queryFn:()=>Fs().listActivity(e),queryKey:He.activity(e)}),d0="scream-bot-active";function fN(){return window.localStorage.getItem(d0)}function vc(e){window.localStorage.setItem(d0,e)}function hN(){window.localStorage.removeItem(d0)}function f0(e,t){fN()===e&&hN(),t.removeQueries({queryKey:He.bot(e)}),t.setQueryData(He.bots(),s=>s==null?void 0:s.filter(i=>i.id!==e))}const V6="h-9 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30";function F6({bot:e,open:t,onClose:s,onDeleted:i}){const o=Us(),{t:l}=mt(),[u,d]=E.useState(e.name),[f,h]=E.useState(e.title),[p,g]=E.useState(e.workspace),[b,w]=E.useState(e.rolePrompt),[x,S]=E.useState(e.permission),[T,A]=E.useState(e.avatarEmoji??""),[C,k]=E.useState(e.accentHue??null),[M,D]=E.useState(!1),_=E.useRef(null),N=E.useRef({botId:e.id,open:t});N.current={botId:e.id,open:t},E.useEffect(()=>{if(!t){_.current=null;return}_.current!==e.id&&(_.current=e.id,d(e.name),h(e.title),g(e.workspace),w(e.rolePrompt),S(e.permission),A(e.avatarEmoji??""),k(e.accentHue??null),D(!1))},[e,t]);const O=$=>{o.invalidateQueries({queryKey:He.bots()}),o.invalidateQueries({queryKey:He.bot($)}),o.invalidateQueries({queryKey:He.threads($)})},z=On({retry:!1,mutationFn:$=>Yt().updateBot($.botId,$.input),onSuccess:($,X)=>{O(X.botId)}}),I=On({retry:!1,mutationFn:$=>Yt().setPaused($.botId,$.paused),onSuccess:($,X)=>{O(X.botId)}}),V=On({retry:!1,mutationFn:$=>Yt().deleteBot($),onSuccess:async($,X)=>{f0(X,o),N.current.botId===X&&N.current.open&&s(),i(X),await o.invalidateQueries({queryKey:He.bots()}),await o.invalidateQueries({queryKey:He.inbox()})}});return v.jsx(Cd,{onOpenChange:$=>{$||s()},open:t,children:v.jsxs(Ad,{className:"gap-0 data-[side=right]:w-[calc(100%-1rem)] data-[side=right]:sm:max-w-lg",side:"right",variant:"inset",children:[v.jsxs(a0,{className:"border-b border-border pb-3",children:[v.jsx(kd,{children:e.name}),v.jsx(c0,{children:l("bot.settings.description")})]}),v.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:$=>{$.preventDefault(),!z.isPending&&z.mutate({botId:e.id,input:{accentHue:C,avatarEmoji:T.trim().length===0?null:T.trim(),name:u,permission:x,rolePrompt:b,title:f,workspace:p}})},children:[v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[v.jsxs(kx,{children:[v.jsxs(os,{children:[v.jsx(as,{htmlFor:"settings-name",children:l("bot.new.name")}),v.jsx(po,{id:"settings-name",onChange:$=>d($.target.value),value:u})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"settings-title",children:l("bot.new.role")}),v.jsx(po,{id:"settings-title",onChange:$=>h($.target.value),value:f})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"settings-emoji",children:l("bot.settings.identity")}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Bs,{emoji:T.trim().length===0?null:T.trim(),hue:C,name:u,seed:e.avatarSeed,size:44}),v.jsx(po,{className:"w-20 text-center text-lg",id:"settings-emoji",maxLength:8,onChange:$=>A($.target.value),placeholder:l("bot.settings.identityPlaceholder"),value:T}),v.jsx("input",{"aria-label":l("bot.settings.hue"),className:"min-w-0 flex-1",max:359,min:0,onChange:$=>k(Number($.target.value)),style:{accentColor:`hsl(${String(C??Wu(e.avatarSeed))} 60% 45%)`},type:"range",value:C??Wu(e.avatarSeed)})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[[0,25,45,145,175,210,260,320].map($=>v.jsx("button",{"aria-label":l("bot.settings.huePreset",{hue:$}),className:"size-5 rounded-full ring-1 ring-black/10 dark:ring-white/20",onClick:()=>k($),style:{background:`hsl(${String($)} 60% 55%)`},type:"button"},$)),v.jsx("button",{className:"text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>k(null),type:"button",children:l("bot.settings.hueReset")})]}),v.jsx(td,{children:l("bot.settings.identityHint")})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"settings-workspace",children:l("bot.new.workspace")}),v.jsx(po,{className:"font-mono text-[13px]",id:"settings-workspace",onChange:$=>g($.target.value),value:p}),v.jsx(td,{children:l("bot.settings.workspaceHint")})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"settings-permission",children:l("bot.new.permissions")}),v.jsxs("select",{className:V6,id:"settings-permission",onChange:$=>S($.target.value),value:x,children:[v.jsx("option",{value:"bot",children:l("bot.permission.bot")}),v.jsx("option",{value:"auto",children:l("bot.permission.auto")})]})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"settings-prompt",children:l("bot.new.instructions")}),v.jsx(dN,{className:"min-h-28",id:"settings-prompt",onChange:$=>w($.target.value),value:b})]})]}),v.jsx("p",{className:"mt-3 text-muted-foreground text-xs",children:l("bot.settings.sharedMemory")}),v.jsxs("div",{className:"mt-6 rounded-lg border border-border p-3",children:[v.jsx("p",{className:"font-medium text-[13px]",children:e.paused?l("bot.settings.pausedTitle"):l("bot.settings.pauseTitle")}),v.jsx("p",{className:"mt-0.5 text-[12px] text-muted-foreground",children:l("bot.settings.pauseDescription")}),v.jsx(Be,{className:"mt-2",disabled:I.isPending,onClick:()=>I.mutate({botId:e.id,paused:!e.paused}),size:"sm",type:"button",variant:"outline",children:e.paused?l("bot.settings.resume"):l("bot.settings.pause")})]}),v.jsxs("div",{className:"mt-4 rounded-lg border border-destructive/30 p-3",children:[v.jsx("p",{className:"font-medium text-[13px]",children:l("bot.settings.delete")}),v.jsx("p",{className:"mt-0.5 text-[12px] text-muted-foreground",children:l("bot.settings.deleteDescription")}),M?v.jsxs("div",{className:"mt-2 flex gap-2",children:[v.jsx(Be,{disabled:V.isPending,onClick:()=>{V.isPending||V.mutate(e.id)},size:"sm",type:"button",variant:"destructive",children:V.isPending?l("bot.settings.deleting"):l("bot.settings.deletePermanently")}),v.jsx(Be,{onClick:()=>D(!1),size:"sm",type:"button",variant:"ghost",children:l("bot.settings.cancel")})]}):v.jsx(Be,{className:"mt-2",onClick:()=>D(!0),size:"sm",type:"button",variant:"outline",children:l("bot.settings.deleteTrigger")}),V.error?v.jsx("p",{className:"mt-2 text-destructive text-xs",role:"alert",children:V.error.message}):null]}),I.error?v.jsx("p",{className:"mt-3 text-destructive text-sm",role:"alert",children:I.error.message}):null,z.error?v.jsx("p",{className:"mt-3 text-destructive text-sm",role:"alert",children:z.error.message}):null]}),v.jsx(l0,{className:"border-t border-border",children:v.jsxs("div",{className:"flex justify-end gap-2",children:[v.jsx(Be,{onClick:s,size:"sm",type:"button",variant:"ghost",children:l("bot.settings.cancel")}),v.jsx(Be,{disabled:z.isPending,size:"sm",type:"submit",children:z.isPending?l("bot.settings.saving"):l("bot.settings.saveChanges")})]})})]})]})})}const q6={error:"status.error",idle:"status.idle",needs_you:"status.needs_you",paused:"status.paused",working:"status.working"};function H6({status:e,className:t}){const s=e==="working"?"bg-brand":e==="needs_you"?"bg-warning":e==="error"?"bg-destructive":e==="paused"?"bg-muted-foreground/40":"";return s?v.jsx("span",{"aria-hidden":"true",className:ke("absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2 ring-sidebar",s,e==="working"?"animate-pulse":"",t)}):null}function mN({bot:e}){const{t}=mt(),s=e.paused?t("status.paused"):t(q6[e.status]),i=e.status==="needs_you"?"border-warning/30 bg-warning/10 text-warning":e.status==="working"?"border-brand/30 bg-brand/10 text-brand":e.status==="error"?"border-destructive/30 bg-destructive/10 text-destructive":"border-border bg-muted/60 text-muted-foreground";return v.jsxs("span",{className:ke("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[11px] font-medium",i),children:[v.jsx("span",{"aria-hidden":"true",className:ke("size-1.5 rounded-full",e.status==="needs_you"?"bg-warning":e.status==="working"?"bg-brand animate-pulse":e.status==="error"?"bg-destructive":"bg-muted-foreground/50")}),s]})}const hC={value:"",pending:null,error:null,recovered:!1,retry:null},yv="scream.bot.draft.v2:";function G6(e){if(!("attachments"in e)||!Array.isArray(e.attachments))return{};const t=e.attachments.filter(s=>{if(s===null||typeof s!="object")return!1;const i=s;return typeof i.id=="string"&&typeof i.name=="string"&&typeof i.path=="string"&&typeof i.size=="number"&&typeof i.mime=="string"});return t.length===0?{}:{attachments:t}}const ad=(e,t)=>JSON.stringify([e,t]);function bm(e,t,s){return e.trim().length>0&&!t&&!s}function K6(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}class pN{constructor(t=K6){ge(this,"states",new Map);ge(this,"listeners",new Set);ge(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));this.storage=t}get(t){var o;const s=this.states.get(t);if(s)return s;let i=hC;try{const l=(o=this.storage())==null?void 0:o.getItem(yv+t),u=l?JSON.parse(l):null;if(u&&typeof u=="object"&&"value"in u&&typeof u.value=="string"){const d="unconfirmed"in u&&u.unconfirmed===!0;let f=null;if("retry"in u&&u.retry&&typeof u.retry=="object"){const h=u.retry;"id"in h&&typeof h.id=="string"&&"text"in h&&typeof h.text=="string"&&"restore"in h&&typeof h.restore=="string"&&"mode"in h&&(h.mode==="queue"||h.mode==="steer")&&(f={id:h.id,text:h.text,restore:h.restore,mode:h.mode,...G6(h)})}i={...hC,value:u.value,recovered:d,retry:f}}}catch{}return this.states.set(t,i),i}put(t,s){var i,o;this.states.set(t,s);try{const l=s.value,u=s.pending??s.retry;l||u?(i=this.storage())==null||i.setItem(yv+t,JSON.stringify({value:l,unconfirmed:!!u||s.recovered,retry:u})):(o=this.storage())==null||o.removeItem(yv+t)}catch{}for(const l of this.listeners)l()}edit(t,s){this.put(t,{...this.get(t),value:s})}begin(t,s,i,o,l="queue",u=!0,d=[]){const f=ad(t,s),h=this.get(f);if(!bm(i,o,h.pending!==null||h.retry!==null))return null;const p=u&&h.value===i,g={id:crypto.randomUUID(),key:f,botId:t,threadId:s,text:i.trim(),mode:l,restore:i,...d.length===0?{}:{attachments:d}};return this.put(f,{value:p?"":h.value,pending:g,error:null,recovered:!1,retry:null}),g}retry(t,s,i){const o=ad(t,s),l=this.get(o);if(!l.retry||!bm(l.retry.text,i,l.pending!==null))return null;const u={...l.retry,key:o,botId:t,threadId:s};return this.put(o,{...l,pending:u,error:null}),u}finish(t,s){const i=this.get(t.key);i.pending===t&&this.put(t.key,{value:i.value,pending:null,error:s??null,recovered:!1,retry:s?t:null})}}const sa=new pN,Y6=["composer.suggestion1","composer.suggestion2","composer.suggestion3"];function $6(e){return E.createElement(Q6,{...e,key:ad(e.bot.id,e.threadId)})}function Q6({bot:e,threadId:t}){const s=Us(),{t:i}=mt(),o=ad(e.id,t),l=E.useSyncExternalStore(sa.subscribe,()=>sa.get(o)),u=l.value,d=E.useRef(null),h=(Et(op(e.id)).data??[]).filter(V=>V.threadId===t),p=h.find(V=>V.status==="running"||V.status==="waiting_user"),g=h.filter(V=>V.status==="queued"),b=(p==null?void 0:p.status)==="waiting_user",[w,x]=E.useState([]),[S,T]=E.useState(0),[A,C]=E.useState(null),k=E.useRef(null),M=V=>S===0&&bm(V,e.paused,l.pending!==null||l.retry!==null),D=(V,$)=>{s.invalidateQueries({queryKey:He.messages($)}),s.invalidateQueries({queryKey:He.runs(V)}),s.invalidateQueries({queryKey:He.threads(V)}),s.invalidateQueries({queryKey:He.bot(V)})};E.useLayoutEffect(()=>{d.current&&(d.current.style.height="auto",d.current.style.height=`${Math.min(d.current.scrollHeight,208)}px`)},[u]);const _=On({retry:!1,mutationFn:V=>Yt().prompt(V.threadId,{mode:V.mode,text:V.text,requestKey:V.id,attachments:V.attachments??[]}),onSuccess:(V,$)=>{sa.finish($),D($.botId,$.threadId)},onError:(V,$)=>{sa.finish($,V.message||i("composer.sendFailed"))}}),N=On({retry:!1,mutationFn:()=>Yt().interrupt(t),onSettled:()=>{D(e.id,t)}}),O=On({retry:!1,mutationFn:V=>Yt().cancelRun(V),onSettled:()=>{D(e.id,t)}}),z=async V=>{if(V===null||V.length===0)return;const $=Math.max(0,10-w.length),X=Array.from(V).slice(0,$);X.length<V.length&&C(i("composer.tooManyFiles",{max:10})),T(B=>B+X.length);for(const B of X)try{const q=await Yt().uploadAttachment(e.id,B,t);x(F=>[...F,q])}catch(q){C(q instanceof Error?q.message:i("composer.uploadFailed"))}finally{T(q=>Math.max(0,q-1))}k.current!==null&&(k.current.value="")},I=(V,$="queue",X=!0)=>{if(S>0)return;const B=sa.begin(e.id,t,V,e.paused,$,X,w);B!==null&&w.length>0&&x([]),B&&_.mutate(B)};return v.jsx("div",{className:"shrink-0 px-4 pb-4 md:px-8 md:pb-5",children:v.jsxs("div",{className:"mx-auto w-full max-w-3xl",children:[p?null:v.jsx("div",{className:"mb-2 flex flex-wrap gap-1.5",children:Y6.map(V=>{const $=i(V);return v.jsx("button",{className:"rounded-full border border-border bg-background px-2.5 py-1 text-[11.5px] text-muted-foreground transition-colors hover:border-foreground/25 hover:text-foreground",disabled:!M($),onClick:()=>{I($,"queue",!1)},type:"button",children:$},V)})}),v.jsxs("div",{className:ke("rounded-2xl border border-border bg-card shadow-sm transition-colors focus-within:border-foreground/20",b?"border-warning/40":""),children:[v.jsx("textarea",{"aria-label":i("composer.placeholder",{name:e.name}),className:"block max-h-52 min-h-[52px] w-full resize-none bg-transparent px-3.5 pt-3 pb-1 text-[13.5px] leading-relaxed outline-none placeholder:text-muted-foreground",onChange:V=>{sa.edit(o,V.target.value),V.target.style.height="auto",V.target.style.height=`${Math.min(V.target.scrollHeight,208)}px`},onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&!V.nativeEvent.isComposing&&(V.preventDefault(),I(u))},placeholder:e.paused?i("composer.paused",{name:e.name}):i("composer.placeholder",{name:e.name}),ref:d,rows:1,value:u}),A!==null?v.jsx("p",{className:"px-2 pb-1.5 text-[11.5px] text-destructive",role:"alert",children:A}):null,w.length>0||S>0?v.jsxs("div",{className:"flex flex-wrap gap-1.5 px-2 pb-1.5",children:[w.map(V=>v.jsxs("span",{className:"flex max-w-[220px] items-center gap-1.5 rounded-lg bg-muted px-2 py-1 text-[11.5px]",children:[v.jsx(Zu,{className:"size-3 shrink-0 text-muted-foreground"}),v.jsx("span",{className:"truncate",children:V.name}),v.jsx("button",{"aria-label":i("composer.removeAttachment",{name:V.name}),className:"text-muted-foreground hover:text-foreground",onClick:()=>x($=>$.filter(X=>X.id!==V.id)),type:"button",children:v.jsx(Sc,{className:"size-3"})})]},V.id)),S>0?v.jsx("span",{className:"rounded-lg bg-muted px-2 py-1 text-[11.5px] text-muted-foreground",children:i("composer.attaching",{count:S})}):null]}):null,v.jsxs("div",{className:"flex items-center gap-2 px-2 pb-2",children:[v.jsx(Be,{"aria-label":i("composer.attach"),className:"h-7 px-2 text-muted-foreground",disabled:S>0,onClick:()=>{var V;return(V=k.current)==null?void 0:V.click()},size:"sm",variant:"ghost",children:v.jsx(Zu,{className:"size-4"})}),v.jsx("input",{className:"hidden",multiple:!0,onChange:V=>{z(V.target.files)},ref:k,type:"file"}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-[10.5px] text-muted-foreground",children:i(b?"composer.waiting":"composer.enterToSend")}),p?v.jsx(Be,{"aria-label":i("composer.stop"),disabled:N.isPending,onClick:()=>{N.mutate()},size:"icon-sm",variant:"outline",children:v.jsx(wz,{className:"size-4"})}):null,(p==null?void 0:p.status)==="running"?v.jsx(Be,{className:"h-7 px-2 text-[12px]",disabled:!M(u),onClick:()=>{I(u,"steer")},size:"sm",variant:"ghost",children:i("composer.steer")}):null,v.jsx(Be,{"aria-label":i("composer.send"),className:"rounded-full",disabled:!M(u),onClick:()=>{I(u)},size:"icon-sm",children:v.jsx(gk,{className:"size-4"})})]})]}),g.map(V=>v.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx("span",{children:i("run.queued")}),v.jsx(Be,{disabled:O.isPending,onClick:()=>{O.mutate(V.id)},size:"sm",variant:"ghost",children:i("composer.cancelQueued")})]},V.id)),l.retry?v.jsxs("section",{"aria-label":i("composer.unconfirmedText"),className:"mt-2 rounded-lg border border-border bg-muted/40 p-2.5 text-xs","data-slot":"unconfirmed-prompt",children:[v.jsx("p",{className:"text-muted-foreground",role:"status",children:i("composer.unconfirmed")}),l.recovered?v.jsx("p",{className:"mt-1 text-muted-foreground",children:i("composer.recoveredDraft")}):null,v.jsx("pre",{className:"my-2 max-h-32 overflow-auto whitespace-pre-wrap break-words font-mono",children:l.retry.restore}),v.jsx(Be,{disabled:!bm(l.retry.text,e.paused,l.pending!==null),onClick:()=>{const V=sa.retry(e.id,t,e.paused);V&&_.mutate(V)},size:"sm",variant:"outline",children:i("composer.retryRequest")})]}):null,l.error?v.jsxs("p",{className:"mt-2 text-destructive text-xs",role:"alert",children:[i("composer.sendFailed"),": ",l.error]}):null,N.error?v.jsxs("p",{className:"mt-2 text-destructive text-xs",role:"alert",children:[i("composer.stopFailed"),": ",N.error.message]}):null,O.error?v.jsxs("p",{className:"mt-2 text-destructive text-xs",role:"alert",children:[i("composer.cancelFailed"),": ",O.error.message]}):null]})})}function X6({icon:e,label:t,detail:s,running:i,refused:o,failed:l,children:u}){const d=o?"text-destructive":l?"text-amber-600 dark:text-amber-500":"text-muted-foreground",f=v.jsxs("span",{className:`inline-flex min-w-0 max-w-full items-baseline gap-1.5 text-sm ${d} ${i?"tool-line-running":""}`,children:[e?v.jsx("span",{className:"shrink-0 self-center",children:e}):null,v.jsx("span",{className:"shrink-0",children:o?`Blocked: ${t}`:l?`${t}, didn't work`:t}),s?v.jsx("span",{className:"truncate opacity-70",children:s}):null]});return u?v.jsxs("details",{className:"tool-line my-1.5 min-w-0",children:[v.jsxs("summary",{className:"flex cursor-pointer list-none items-baseline gap-1.5",children:[v.jsx("span",{"aria-hidden":!0,className:"tool-line-chevron shrink-0 text-xs text-muted-foreground transition-transform",children:"▸"}),f]}),v.jsx("div",{className:"mt-2 max-h-80 overflow-auto border-l pl-3 text-xs [&_h1]:text-sm [&_h2]:text-xs [&_h3]:text-xs [&_h4]:text-xs [&_h1]:font-medium [&_h2]:font-medium [&_h3]:font-medium",children:u})]}):v.jsx("div",{className:"my-1.5",children:f})}const gN=E.createContext(null);function Z6(){const e=E.useContext(gN);if(!e)throw new Error("useMessageScroller must be used within a MessageScroller.");return e}function yN({children:e}){const t=E.useRef(null),[s,i]=E.useState(!0),[o,l]=E.useState(!0),u=E.useRef(!0),d=E.useCallback(()=>{const g=t.current;if(!g)return;const w=g.scrollHeight-g.scrollTop-g.clientHeight<24;u.current=w,i(w),l(g.scrollTop<24)},[]),f=E.useCallback((g="smooth")=>{const b=t.current;b&&(b.scrollTo({behavior:g,top:b.scrollHeight}),u.current=!0)},[]),h=E.useCallback((g="smooth")=>{var b;(b=t.current)==null||b.scrollTo({behavior:g,top:0})},[]);E.useEffect(()=>{const g=t.current;if(!g)return;const b=new ResizeObserver(()=>{u.current&&(g.scrollTop=g.scrollHeight),d()});b.observe(g);for(const w of g.children)b.observe(w);return g.addEventListener("scroll",d,{passive:!0}),()=>{b.disconnect(),g.removeEventListener("scroll",d)}},[d]);const p=E.useMemo(()=>({atEnd:s,atStart:o,scrollToEnd:f,scrollToStart:h}),[s,o,f,h]);return v.jsx(gN.Provider,{value:p,children:v.jsx(vN.Provider,{value:t,children:e})})}const vN=E.createContext(null);function bN({className:e,children:t,...s}){return v.jsx("div",{"data-slot":"message-scroller",className:ke("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...s,children:t})}function xN({className:e,...t}){const s=E.useContext(vN);return v.jsx("div",{ref:s,"data-slot":"message-scroller-viewport",tabIndex:0,className:ke("size-full min-h-0 min-w-0 overflow-y-auto overscroll-contain",e),...t})}function wN({className:e,...t}){return v.jsx("div",{"data-slot":"message-scroller-content",className:ke("flex h-max min-h-full flex-col gap-6",e),...t})}function to({className:e,...t}){return v.jsx("div",{"data-slot":"message-scroller-item",className:ke("min-w-0 shrink-0",e),...t})}function SN({className:e,direction:t="end",children:s,...i}){const{t:o}=mt(),{atEnd:l,atStart:u,scrollToEnd:d,scrollToStart:f}=Z6(),h=t==="end"?!l:!u;return v.jsxs("button",{type:"button","data-slot":"message-scroller-button","data-active":h,className:ke("absolute inset-x-0 mx-auto z-10 grid size-7 place-items-center rounded-full border border-border bg-background text-foreground shadow-sm transition-[translate,scale,opacity] duration-200","data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0",t==="end"?"bottom-4":"top-4",e),onClick:()=>{t==="end"?d():f()},...i,children:[s??v.jsx("span",{"aria-hidden":!0,className:"text-xs",children:t==="end"?"↓":"↑"}),v.jsx("span",{className:"sr-only",children:o(t==="end"?"transcript.scrollEnd":"transcript.scrollStart")})]})}const mC=[{limit:6e4,divisor:1e3,unit:"second"},{limit:36e5,divisor:6e4,unit:"minute"},{limit:864e5,divisor:36e5,unit:"hour"},{limit:6048e5,divisor:864e5,unit:"day"},{limit:Number.POSITIVE_INFINITY,divisor:6048e5,unit:"week"}],W6=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});function bc(e){const t=new Date(e).getTime();if(!Number.isFinite(t))return e;const s=Date.now()-t,i=mC.find(({limit:o})=>Math.abs(s)<o)??mC.at(-1);return i?W6.format(-Math.round(s/i.divisor),i.unit):e}function J6(e,t,s){const i=e.toolName.toLowerCase();return/bash|shell|exec/.test(i)?s("approval.command",{name:t}):/write|edit|patch/.test(i)?s("approval.changeFile",{name:t}):s("approval.useTool",{name:t,tool:e.toolName})}function h0({approval:e,botName:t}){const s=Us(),{t:i}=mt(),o=On({mutationFn:u=>Yt().decideApproval(e.id,{decision:u}),onSettled:()=>{s.invalidateQueries({queryKey:He.inbox()}),s.invalidateQueries({queryKey:He.messages(e.threadId)}),s.invalidateQueries({queryKey:He.bots()})}}),l=e.expiresAt<Date.now();return v.jsx("div",{className:"mt-3 rounded-xl border border-warning/35 bg-warning/[0.05] p-3.5",children:v.jsxs("div",{className:"flex items-start gap-2.5",children:[v.jsx("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-md bg-warning/15 text-warning",children:v.jsx(Rk,{className:"size-4"})}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("p",{className:"font-medium text-[13px]",children:J6(e,t,i)}),v.jsxs("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:[i("approval.asked",{time:bc(new Date(e.createdAt).toISOString())}),l?` · ${i("approval.expired")}`:""]}),v.jsx("pre",{className:"mt-2 overflow-x-auto whitespace-pre-wrap break-all rounded-md border border-border bg-background/70 px-2.5 py-2 font-mono text-[11.5px] leading-relaxed",children:e.action}),e.reasons.length?v.jsx("ul",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[11.5px] text-muted-foreground",children:e.reasons.map(u=>v.jsxs("li",{className:"flex items-center gap-1",children:[v.jsx("span",{"aria-hidden":!0,className:"size-1 rounded-full bg-muted-foreground/50"}),u]},u))}):null,o.error?v.jsx("p",{className:"mt-2 text-destructive text-xs",role:"alert",children:o.error.message}):null,v.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[v.jsxs(Be,{disabled:o.isPending||l,onClick:()=>o.mutate("allow_once"),size:"sm",children:[v.jsx(Cz,{className:"size-3.5"}),i("approval.allowOnce")]}),e.grantOptions.includes("session")?v.jsx(Be,{disabled:o.isPending||l,onClick:()=>o.mutate("allow_session"),size:"sm",variant:"outline",children:i("approval.allowSession")}):null,v.jsx(Be,{disabled:o.isPending||l,onClick:()=>o.mutate("deny"),size:"sm",variant:"ghost",children:i("approval.deny")})]})]})]})})}const eV={awaiting_relay:"border-warning/30 bg-warning/10 text-warning",cancelled:"border-border bg-muted/60 text-muted-foreground",delivered:"border-success/30 bg-success/10 text-success",failed:"border-destructive/30 bg-destructive/10 text-destructive",interrupted:"border-warning/30 bg-warning/10 text-warning",queued:"border-border bg-muted/60 text-muted-foreground",refused:"border-warning/30 bg-warning/10 text-warning",running:"border-brand/30 bg-brand/10 text-brand"},tV={awaiting_relay:"handoff.awaiting_relay",cancelled:"handoff.cancelled",delivered:"handoff.delivered",failed:"handoff.failed",interrupted:"handoff.interrupted",queued:"handoff.queued",refused:"handoff.refused",running:"handoff.running"};function TN({handoff:e}){var u;const t=Et(No()),s=si(),{t:i}=mt(),o=(u=t.data)==null?void 0:u.find(d=>d.id===e.toBotId),l=!!e.toThreadId;return v.jsx("div",{className:"mt-2 rounded-xl border border-border bg-card p-3",children:v.jsxs("div",{className:"flex items-start gap-2.5",children:[v.jsx("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground",children:v.jsx(Y5,{className:"size-4"})}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx("span",{className:"font-medium text-[13px]",children:i("handoff.handedTo",{name:(o==null?void 0:o.name)??i("handoff.anotherBot")})}),v.jsx("span",{className:ke("rounded-full border px-1.5 py-0.5 text-[10px] font-medium",eV[e.status]),children:i(tV[e.status])}),v.jsx("span",{className:"text-[11px] text-muted-foreground",children:bc(new Date(e.createdAt).toISOString())})]}),v.jsx("p",{className:"mt-1 text-[13px] text-muted-foreground leading-relaxed",children:e.task}),e.error?v.jsx("p",{className:"mt-1 text-destructive text-xs",children:e.error}):null,e.status==="delivered"?v.jsx("p",{className:"mt-1.5 text-[12px] text-muted-foreground",children:i("handoff.deliveredNote",{name:(o==null?void 0:o.name)??i("handoff.anotherBot")})}):null]}),l&&o?v.jsxs(Be,{onClick:()=>void s({params:{botId:o.id,threadId:e.toThreadId??""},to:"/bots/$botId/threads/$threadId"}),size:"sm",variant:"outline",children:[i("landing.open",{name:o.name}),v.jsx(ob,{className:"size-3.5"})]}):null]})})}function nV({className:e,...t}){return v.jsx("form",{"data-slot":"questionnaire",className:ke("flex w-full min-w-0 flex-col gap-4",e),...t})}function sV({className:e,...t}){return v.jsx("fieldset",{"data-slot":"questionnaire-item",className:ke("flex min-w-0 flex-col gap-3 border-0 p-0 outline-none",e),...t})}function iV({className:e,...t}){return v.jsx("legend",{"data-slot":"questionnaire-title",className:ke("font-heading text-base leading-snug font-medium text-pretty",e),...t})}function rV({className:e,...t}){return v.jsx("div",{"data-slot":"questionnaire-choices",className:ke("grid min-w-0 gap-2",e),...t})}function oV({className:e,type:t="radio",checked:s,disabled:i,name:o,onChange:l,value:u,children:d,...f}){return v.jsxs("label",{"data-slot":"questionnaire-choice",className:ke("group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start gap-2.5 rounded-lg border border-input bg-transparent px-3 py-2.5 text-start text-sm transition-colors select-none","hover:bg-muted/50 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-3 has-[>input:focus-visible]:ring-ring/50","has-[>input:checked]:border-primary/40 has-[>input:checked]:bg-muted",e),...f,children:[v.jsx("input",{checked:s,className:"sr-only",disabled:i,name:o,onChange:l,type:t,value:u}),v.jsx("span",{"aria-hidden":"true",className:ke("pointer-events-none relative mt-0.5 flex size-4 shrink-0 items-center justify-center border border-input bg-transparent",t==="radio"?"rounded-full":"rounded-[4px]","group-has-[>input:checked]/questionnaire-choice:border-primary group-has-[>input:checked]/questionnaire-choice:bg-primary group-has-[>input:checked]/questionnaire-choice:text-primary-foreground"),children:v.jsx(yk,{className:"hidden size-3 group-has-[>input:checked]/questionnaire-choice:block"})}),v.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 leading-snug",children:d})]})}function aV({className:e,...t}){return v.jsx("span",{"data-slot":"questionnaire-choice-description",className:ke("text-muted-foreground",e),...t})}function lV({className:e,...t}){return v.jsx("input",{"data-slot":"questionnaire-input",className:ke("h-8 min-h-11 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-[color,box-shadow,background-color] outline-none sm:min-h-0 md:text-sm","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50","placeholder:text-muted-foreground dark:bg-input/30",e),...t})}function cV({itemId:e,onChange:t,value:s}){const{t:i}=mt();return v.jsx(lV,{"aria-label":i("question.otherAria",{id:e}),onChange:o=>t(o.target.value),placeholder:i("question.other"),value:s})}function uV({answers:e,item:t,onOther:s,onToggle:i,other:o,disabled:l,name:u}){return v.jsxs(sV,{disabled:l,children:[v.jsx(iV,{children:t.question}),v.jsx(rV,{children:t.options.map(d=>{const f=e.includes(d.label);return v.jsxs(oV,{checked:f,name:u,value:d.label,onChange:()=>i(d.label),type:t.multiple?"checkbox":"radio",children:[d.label,d.description?v.jsx(aV,{children:d.description}):null]},d.label)})}),t.allowOther?v.jsx(cV,{itemId:t.id,onChange:s,value:o}):null]})}function m0(e){return v.jsx(dV,{...e},e.question.id)}function dV({botName:e,question:t}){const s=Us(),{t:i}=mt(),[o,l]=E.useState({}),[u,d]=E.useState({}),f=E.useRef(!1),h=On({retry:!1,onError:()=>{f.current=!1},mutationFn:x=>Yt().answerQuestion(t.id,{answers:x}),onSettled:()=>{s.invalidateQueries({queryKey:He.inbox()}),s.invalidateQueries({queryKey:He.messages(t.threadId)}),s.invalidateQueries({queryKey:He.runs(t.botId)}),s.invalidateQueries({queryKey:He.bots()})}}),p=(x,S)=>{x.multiple||d(T=>({...T,[x.id]:""})),l(T=>{const A=T[x.id]??[],C=x.multiple?A.includes(S)?A.filter(k=>k!==S):[...A,S]:A.includes(S)?[]:[S];return{...T,[x.id]:C}})},g=t.items.every(x=>(o[x.id]??[]).length>0||(u[x.id]??"").trim().length>0),b=t.status!=="pending"||h.isPending||h.isSuccess,w=()=>{if(!g||b||f.current)return;f.current=!0;const x={};for(const S of t.items){const T=o[S.id]??[],A=S.allowOther?(u[S.id]??"").trim():"",C=A?[...T,A]:T;x[S.id]=S.multiple?C:C[0]??""}h.mutate(x)};return v.jsxs("div",{className:"mt-3 rounded-xl border border-brand/30 bg-brand/[0.04] p-3.5",children:[v.jsxs("div",{className:"mb-3 flex items-start gap-2.5",children:[v.jsx("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-md bg-brand/15 text-brand",children:v.jsx(pz,{className:"size-4"})}),v.jsxs("div",{children:[v.jsx("p",{className:"font-medium text-[13px]",children:i("question.title",{name:e})}),v.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[t.items.length===1?i("question.one"):i("question.many",{count:t.items.length})," ","· ",t.status==="expired"?i("question.expired"):t.status==="answered"||h.isSuccess?i("question.answered"):i("question.paused")]})]})]}),v.jsxs(nV,{onSubmit:x=>{x.preventDefault(),!(!g||h.isPending)&&w()},children:[t.items.map(x=>v.jsx(uV,{answers:o[x.id]??[],disabled:b,name:`${t.id}:${x.id}`,item:x,onOther:S=>{d(T=>({...T,[x.id]:S})),!x.multiple&&S.trim()&&l(T=>({...T,[x.id]:[]}))},onToggle:S=>p(x,S),other:u[x.id]??""},x.id)),h.error?v.jsx("p",{className:"text-destructive text-xs",role:"alert",children:h.error.message}):null,v.jsx("div",{className:"flex items-center justify-end gap-2",children:v.jsx(Be,{disabled:!g||b,size:"sm",type:"submit",children:h.isPending?i("question.sending"):i("question.submit")})})]})]})}function p0(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Va=p0();function RN(e){Va=e}var Lu={exec:()=>null};function Ct(e,t=""){let s=typeof e=="string"?e:e.source;const i={replace:(o,l)=>{let u=typeof l=="string"?l:l.source;return u=u.replace(Xn.caret,"$1"),s=s.replace(o,u),i},getRegex:()=>new RegExp(s,t)};return i}var Xn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},fV=/^(?:[ \t]*(?:\n|$))+/,hV=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mV=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Md=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pV=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,g0=/(?:[*+-]|\d{1,9}[.)])/,EN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,CN=Ct(EN).replace(/bull/g,g0).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),gV=Ct(EN).replace(/bull/g,g0).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y0=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yV=/^[^\n]+/,v0=/(?!\s*\])(?:\\.|[^\[\]\\])+/,vV=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",v0).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bV=Ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,g0).getRegex(),lp="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",b0=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xV=Ct("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",b0).replace("tag",lp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),AN=Ct(y0).replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lp).getRegex(),wV=Ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",AN).getRegex(),x0={blockquote:wV,code:hV,def:vV,fences:mV,heading:pV,hr:Md,html:xV,lheading:CN,list:bV,newline:fV,paragraph:AN,table:Lu,text:yV},pC=Ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lp).getRegex(),SV={...x0,lheading:gV,table:pC,paragraph:Ct(y0).replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pC).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lp).getRegex()},TV={...x0,html:Ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",b0).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Lu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(y0).replace("hr",Md).replace("heading",` *#{1,6} *[^
258
- ]`).replace("lheading",CN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},RV=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,EV=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kN=/^( {2,}|\\)\n(?!\s*$)/,CV=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cp=/[\p{P}\p{S}]/u,w0=/[\s\p{P}\p{S}]/u,MN=/[^\s\p{P}\p{S}]/u,AV=Ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,w0).getRegex(),NN=/(?!~)[\p{P}\p{S}]/u,kV=/(?!~)[\s\p{P}\p{S}]/u,MV=/(?:[^\s\p{P}\p{S}]|~)/u,NV=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ON=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,OV=Ct(ON,"u").replace(/punct/g,cp).getRegex(),jV=Ct(ON,"u").replace(/punct/g,NN).getRegex(),jN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",DV=Ct(jN,"gu").replace(/notPunctSpace/g,MN).replace(/punctSpace/g,w0).replace(/punct/g,cp).getRegex(),_V=Ct(jN,"gu").replace(/notPunctSpace/g,MV).replace(/punctSpace/g,kV).replace(/punct/g,NN).getRegex(),IV=Ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,MN).replace(/punctSpace/g,w0).replace(/punct/g,cp).getRegex(),PV=Ct(/\\(punct)/,"gu").replace(/punct/g,cp).getRegex(),zV=Ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),LV=Ct(b0).replace("(?:-->|$)","-->").getRegex(),BV=Ct("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",LV).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xm=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,UV=Ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",xm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),DN=Ct(/^!?\[(label)\]\[(ref)\]/).replace("label",xm).replace("ref",v0).getRegex(),_N=Ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",v0).getRegex(),VV=Ct("reflink|nolink(?!\\()","g").replace("reflink",DN).replace("nolink",_N).getRegex(),S0={_backpedal:Lu,anyPunctuation:PV,autolink:zV,blockSkip:NV,br:kN,code:EV,del:Lu,emStrongLDelim:OV,emStrongRDelimAst:DV,emStrongRDelimUnd:IV,escape:RV,link:UV,nolink:_N,punctuation:AV,reflink:DN,reflinkSearch:VV,tag:BV,text:CV,url:Lu},FV={...S0,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace("label",xm).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xm).getRegex()},xb={...S0,emStrongRDelimAst:_V,emStrongLDelim:jV,url:Ct(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},qV={...xb,br:Ct(kN).replace("{2,}","*").getRegex(),text:Ct(xb.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Mh={normal:x0,gfm:SV,pedantic:TV},Au={normal:S0,gfm:xb,breaks:qV,pedantic:FV},HV={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},gC=e=>HV[e];function wi(e,t){if(t){if(Xn.escapeTest.test(e))return e.replace(Xn.escapeReplace,gC)}else if(Xn.escapeTestNoEncode.test(e))return e.replace(Xn.escapeReplaceNoEncode,gC);return e}function yC(e){try{e=encodeURI(e).replace(Xn.percentDecode,"%")}catch{return null}return e}function vC(e,t){var l;const s=e.replace(Xn.findPipe,(u,d,f)=>{let h=!1,p=d;for(;--p>=0&&f[p]==="\\";)h=!h;return h?"|":" |"}),i=s.split(Xn.splitPipe);let o=0;if(i[0].trim()||i.shift(),i.length>0&&!((l=i.at(-1))!=null&&l.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(Xn.slashPipe,"|");return i}function ku(e,t,s){const i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function GV(e,t){if(e.indexOf(t[1])===-1)return-1;let s=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])s++;else if(e[i]===t[1]&&(s--,s<0))return i;return s>0?-2:-1}function bC(e,t,s,i,o){const l=t.href,u=t.title||null,d=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;const f={type:e[0].charAt(0)==="!"?"image":"link",raw:s,href:l,title:u,text:d,tokens:i.inlineTokens(d)};return i.state.inLink=!1,f}function KV(e,t,s){const i=e.match(s.other.indentCodeCompensation);if(i===null)return t;const o=i[1];return t.split(`
259
- `).map(l=>{const u=l.match(s.other.beginningSpace);if(u===null)return l;const[d]=u;return d.length>=o.length?l.slice(o.length):l}).join(`
260
- `)}var wm=class{constructor(e){ge(this,"options");ge(this,"rules");ge(this,"lexer");this.options=e||Va}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:ku(s,`
261
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],i=KV(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){const i=ku(s,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(s=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ku(t[0],`
262
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let s=ku(t[0],`
263
- `).split(`
264
- `),i="",o="";const l=[];for(;s.length>0;){let u=!1;const d=[];let f;for(f=0;f<s.length;f++)if(this.rules.other.blockquoteStart.test(s[f]))d.push(s[f]),u=!0;else if(!u)d.push(s[f]);else break;s=s.slice(f);const h=d.join(`
265
- `),p=h.replace(this.rules.other.blockquoteSetextReplace,`
266
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
267
- ${h}`:h,o=o?`${o}
268
- ${p}`:p;const g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,l,!0),this.lexer.state.top=g,s.length===0)break;const b=l.at(-1);if((b==null?void 0:b.type)==="code")break;if((b==null?void 0:b.type)==="blockquote"){const w=b,x=w.raw+`
269
- `+s.join(`
270
- `),S=this.blockquote(x);l[l.length-1]=S,i=i.substring(0,i.length-w.raw.length)+S.raw,o=o.substring(0,o.length-w.text.length)+S.text;break}else if((b==null?void 0:b.type)==="list"){const w=b,x=w.raw+`
271
- `+s.join(`
272
- `),S=this.list(x);l[l.length-1]=S,i=i.substring(0,i.length-b.raw.length)+S.raw,o=o.substring(0,o.length-w.raw.length)+S.raw,s=x.substring(l.at(-1).raw.length).split(`
273
- `);continue}}return{type:"blockquote",raw:i,tokens:l,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim();const i=s.length>1,o={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");const l=this.rules.other.listItemRegex(s);let u=!1;for(;e;){let f=!1,h="",p="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;h=t[0],e=e.substring(h.length);let g=t[2].split(`
274
- `,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),b=e.split(`
275
- `,1)[0],w=!g.trim(),x=0;if(this.options.pedantic?(x=2,p=g.trimStart()):w?x=t[1].length+1:(x=t[2].search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=g.slice(x),x+=t[1].length),w&&this.rules.other.blankLine.test(b)&&(h+=b+`
276
- `,e=e.substring(b.length+1),f=!0),!f){const A=this.rules.other.nextBulletRegex(x),C=this.rules.other.hrRegex(x),k=this.rules.other.fencesBeginRegex(x),M=this.rules.other.headingBeginRegex(x),D=this.rules.other.htmlBeginRegex(x);for(;e;){const _=e.split(`
277
- `,1)[0];let N;if(b=_,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),N=b):N=b.replace(this.rules.other.tabCharGlobal," "),k.test(b)||M.test(b)||D.test(b)||A.test(b)||C.test(b))break;if(N.search(this.rules.other.nonSpaceChar)>=x||!b.trim())p+=`
278
- `+N.slice(x);else{if(w||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(g)||M.test(g)||C.test(g))break;p+=`
279
- `+b}!w&&!b.trim()&&(w=!0),h+=_+`
280
- `,e=e.substring(_.length+1),g=N.slice(x)}}o.loose||(u?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(u=!0));let S=null,T;this.options.gfm&&(S=this.rules.other.listIsTask.exec(p),S&&(T=S[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!S,checked:T,loose:!1,text:p,tokens:[]}),o.raw+=h}const d=o.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let f=0;f<o.items.length;f++)if(this.lexer.state.top=!1,o.items[f].tokens=this.lexer.blockTokens(o.items[f].text,[]),!o.loose){const h=o.items[f].tokens.filter(g=>g.type==="space"),p=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=p}if(o.loose)for(let f=0;f<o.items.length;f++)o.items[f].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const s=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:i,title:o}}}table(e){var u;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const s=vC(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(u=t[3])!=null&&u.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
281
- `):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===i.length){for(const d of i)this.rules.other.tableAlignRight.test(d)?l.align.push("right"):this.rules.other.tableAlignCenter.test(d)?l.align.push("center"):this.rules.other.tableAlignLeft.test(d)?l.align.push("left"):l.align.push(null);for(let d=0;d<s.length;d++)l.header.push({text:s[d],tokens:this.lexer.inline(s[d]),header:!0,align:l.align[d]});for(const d of o)l.rows.push(vC(d,l.header.length).map((f,h)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:l.align[h]})));return l}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===`
282
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const l=ku(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{const l=GV(t[2],"()");if(l===-2)return;if(l>-1){const d=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,d).trim(),t[3]=""}}let i=t[2],o="";if(this.options.pedantic){const l=this.rules.other.pedanticHrefTitle.exec(i);l&&(i=l[1],o=l[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),bC(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const i=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[i.toLowerCase()];if(!o){const l=s[0].charAt(0);return{type:"text",raw:l,text:l}}return bC(s,o,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const l=[...i[0]].length-1;let u,d,f=l,h=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+l);(i=p.exec(t))!=null;){if(u=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!u)continue;if(d=[...u].length,i[3]||i[4]){f+=d;continue}else if((i[5]||i[6])&&l%3&&!((l+d)%3)){h+=d;continue}if(f-=d,f>0)continue;d=Math.min(d,d+f+h);const g=[...i[0]][0].length,b=e.slice(0,l+i.index+g+d);if(Math.min(l,d)%2){const x=b.slice(1,-1);return{type:"em",raw:b,text:x,tokens:this.lexer.inlineTokens(x)}}const w=b.slice(2,-2);return{type:"strong",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(s),o=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return i&&o&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let s,i;return t[2]==="@"?(s=t[1],i="mailto:"+s):(s=t[1],i=s),{type:"link",raw:t[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let i,o;if(t[2]==="@")i=t[0],o="mailto:"+i;else{let l;do l=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(l!==t[0]);i=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}},Ni=class wb{constructor(t){ge(this,"tokens");ge(this,"options");ge(this,"state");ge(this,"tokenizer");ge(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Va,this.options.tokenizer=this.options.tokenizer||new wm,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:Xn,block:Mh.normal,inline:Au.normal};this.options.pedantic?(s.block=Mh.pedantic,s.inline=Au.pedantic):this.options.gfm&&(s.block=Mh.gfm,this.options.breaks?s.inline=Au.breaks:s.inline=Au.gfm),this.tokenizer.rules=s}static get rules(){return{block:Mh,inline:Au}}static lex(t,s){return new wb(s).lex(t)}static lexInline(t,s){return new wb(s).inlineTokens(t)}lex(t){t=t.replace(Xn.carriageReturn,`
283
- `),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){const i=this.inlineQueue[s];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],i=!1){var o,l,u;for(this.options.pedantic&&(t=t.replace(Xn.tabCharGlobal," ").replace(Xn.spaceLine,""));t;){let d;if((l=(o=this.options.extensions)==null?void 0:o.block)!=null&&l.some(h=>(d=h.call({lexer:this},t,s))?(t=t.substring(d.raw.length),s.push(d),!0):!1))continue;if(d=this.tokenizer.space(t)){t=t.substring(d.raw.length);const h=s.at(-1);d.raw.length===1&&h!==void 0?h.raw+=`
284
- `:s.push(d);continue}if(d=this.tokenizer.code(t)){t=t.substring(d.raw.length);const h=s.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=`
285
- `+d.raw,h.text+=`
286
- `+d.text,this.inlineQueue.at(-1).src=h.text):s.push(d);continue}if(d=this.tokenizer.fences(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.heading(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.hr(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.blockquote(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.list(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.html(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.def(t)){t=t.substring(d.raw.length);const h=s.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=`
287
- `+d.raw,h.text+=`
288
- `+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title});continue}if(d=this.tokenizer.table(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.lheading(t)){t=t.substring(d.raw.length),s.push(d);continue}let f=t;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0;const p=t.slice(1);let g;this.options.extensions.startBlock.forEach(b=>{g=b.call({lexer:this},p),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(f))){const h=s.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=`
289
- `+d.raw,h.text+=`
290
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):s.push(d),i=f.length!==t.length,t=t.substring(d.raw.length);continue}if(d=this.tokenizer.text(t)){t=t.substring(d.raw.length);const h=s.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=`
291
- `+d.raw,h.text+=`
292
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):s.push(d);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}inlineTokens(t,s=[]){var d,f,h;let i=t,o=null;if(this.tokens.links){const p=Object.keys(this.tokens.links);if(p.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)p.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,u="";for(;t;){l||(u=""),l=!1;let p;if((f=(d=this.options.extensions)==null?void 0:d.inline)!=null&&f.some(b=>(p=b.call({lexer:this},t,s))?(t=t.substring(p.raw.length),s.push(p),!0):!1))continue;if(p=this.tokenizer.escape(t)){t=t.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.tag(t)){t=t.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.link(t)){t=t.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(p.raw.length);const b=s.at(-1);p.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=p.raw,b.text+=p.text):s.push(p);continue}if(p=this.tokenizer.emStrong(t,i,u)){t=t.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.codespan(t)){t=t.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.br(t)){t=t.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.del(t)){t=t.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.autolink(t)){t=t.substring(p.raw.length),s.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(t))){t=t.substring(p.raw.length),s.push(p);continue}let g=t;if((h=this.options.extensions)!=null&&h.startInline){let b=1/0;const w=t.slice(1);let x;this.options.extensions.startInline.forEach(S=>{x=S.call({lexer:this},w),typeof x=="number"&&x>=0&&(b=Math.min(b,x))}),b<1/0&&b>=0&&(g=t.substring(0,b+1))}if(p=this.tokenizer.inlineText(g)){t=t.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(u=p.raw.slice(-1)),l=!0;const b=s.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=p.raw,b.text+=p.text):s.push(p);continue}if(t){const b="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return s}},Sm=class{constructor(e){ge(this,"options");ge(this,"parser");this.options=e||Va}space(e){return""}code({text:e,lang:t,escaped:s}){var l;const i=(l=(t||"").match(Xn.notSpaceStart))==null?void 0:l[0],o=e.replace(Xn.endingNewline,"")+`
293
- `;return i?'<pre><code class="language-'+wi(i)+'">'+(s?o:wi(o,!0))+`</code></pre>
294
- `:"<pre><code>"+(s?o:wi(o,!0))+`</code></pre>
295
- `}blockquote({tokens:e}){return`<blockquote>
296
- ${this.parser.parse(e)}</blockquote>
297
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
298
- `}hr(e){return`<hr>
299
- `}list(e){const t=e.ordered,s=e.start;let i="";for(let u=0;u<e.items.length;u++){const d=e.items[u];i+=this.listitem(d)}const o=t?"ol":"ul",l=t&&s!==1?' start="'+s+'"':"";return"<"+o+l+`>
300
- `+i+"</"+o+`>
301
- `}listitem(e){var s;let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?((s=e.tokens[0])==null?void 0:s.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+wi(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
302
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
303
- `}table(e){let t="",s="";for(let o=0;o<e.header.length;o++)s+=this.tablecell(e.header[o]);t+=this.tablerow({text:s});let i="";for(let o=0;o<e.rows.length;o++){const l=e.rows[o];s="";for(let u=0;u<l.length;u++)s+=this.tablecell(l[u]);i+=this.tablerow({text:s})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
304
- <thead>
305
- `+t+`</thead>
306
- `+i+`</table>
307
- `}tablerow({text:e}){return`<tr>
308
- ${e}</tr>
309
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>
310
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${wi(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:s}){const i=this.parser.parseInline(s),o=yC(e);if(o===null)return i;e=o;let l='<a href="'+e+'"';return t&&(l+=' title="'+wi(t)+'"'),l+=">"+i+"</a>",l}image({href:e,title:t,text:s,tokens:i}){i&&(s=this.parser.parseInline(i,this.parser.textRenderer));const o=yC(e);if(o===null)return wi(s);e=o;let l=`<img src="${e}" alt="${s}"`;return t&&(l+=` title="${wi(t)}"`),l+=">",l}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:wi(e.text)}},T0=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},fr=class Sb{constructor(t){ge(this,"options");ge(this,"renderer");ge(this,"textRenderer");this.options=t||Va,this.options.renderer=this.options.renderer||new Sm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new T0}static parse(t,s){return new Sb(s).parse(t)}static parseInline(t,s){return new Sb(s).parseInline(t)}parse(t,s=!0){var o,l;let i="";for(let u=0;u<t.length;u++){const d=t[u];if((l=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&l[d.type]){const h=d,p=this.options.extensions.renderers[h.type].call({parser:this},h);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type)){i+=p||"";continue}}const f=d;switch(f.type){case"space":{i+=this.renderer.space(f);continue}case"hr":{i+=this.renderer.hr(f);continue}case"heading":{i+=this.renderer.heading(f);continue}case"code":{i+=this.renderer.code(f);continue}case"table":{i+=this.renderer.table(f);continue}case"blockquote":{i+=this.renderer.blockquote(f);continue}case"list":{i+=this.renderer.list(f);continue}case"html":{i+=this.renderer.html(f);continue}case"paragraph":{i+=this.renderer.paragraph(f);continue}case"text":{let h=f,p=this.renderer.text(h);for(;u+1<t.length&&t[u+1].type==="text";)h=t[++u],p+=`
311
- `+this.renderer.text(h);s?i+=this.renderer.paragraph({type:"paragraph",raw:p,text:p,tokens:[{type:"text",raw:p,text:p,escaped:!0}]}):i+=p;continue}default:{const h='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}parseInline(t,s=this.renderer){var o,l;let i="";for(let u=0;u<t.length;u++){const d=t[u];if((l=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&l[d.type]){const h=this.options.extensions.renderers[d.type].call({parser:this},d);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(d.type)){i+=h||"";continue}}const f=d;switch(f.type){case"escape":{i+=s.text(f);break}case"html":{i+=s.html(f);break}case"link":{i+=s.link(f);break}case"image":{i+=s.image(f);break}case"strong":{i+=s.strong(f);break}case"em":{i+=s.em(f);break}case"codespan":{i+=s.codespan(f);break}case"br":{i+=s.br(f);break}case"del":{i+=s.del(f);break}case"text":{i+=s.text(f);break}default:{const h='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}},Lv,Gh=(Lv=class{constructor(e){ge(this,"options");ge(this,"block");this.options=e||Va}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ni.lex:Ni.lexInline}provideParser(){return this.block?fr.parse:fr.parseInline}},ge(Lv,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Lv),YV=class{constructor(...e){ge(this,"defaults",p0());ge(this,"options",this.setOptions);ge(this,"parse",this.parseMarkdown(!0));ge(this,"parseInline",this.parseMarkdown(!1));ge(this,"Parser",fr);ge(this,"Renderer",Sm);ge(this,"TextRenderer",T0);ge(this,"Lexer",Ni);ge(this,"Tokenizer",wm);ge(this,"Hooks",Gh);this.use(...e)}walkTokens(e,t){var i,o;let s=[];for(const l of e)switch(s=s.concat(t.call(this,l)),l.type){case"table":{const u=l;for(const d of u.header)s=s.concat(this.walkTokens(d.tokens,t));for(const d of u.rows)for(const f of d)s=s.concat(this.walkTokens(f.tokens,t));break}case"list":{const u=l;s=s.concat(this.walkTokens(u.items,t));break}default:{const u=l;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[u.type]?this.defaults.extensions.childTokens[u.type].forEach(d=>{const f=u[d].flat(1/0);s=s.concat(this.walkTokens(f,t))}):u.tokens&&(s=s.concat(this.walkTokens(u.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const i={...s};if(i.async=this.defaults.async||i.async||!1,s.extensions&&(s.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const l=t.renderers[o.name];l?t.renderers[o.name]=function(...u){let d=o.renderer.apply(this,u);return d===!1&&(d=l.apply(this,u)),d}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=t[o.level];l?l.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),i.extensions=t),s.renderer){const o=this.defaults.renderer||new Sm(this.defaults);for(const l in s.renderer){if(!(l in o))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const u=l,d=s.renderer[u],f=o[u];o[u]=(...h)=>{let p=d.apply(o,h);return p===!1&&(p=f.apply(o,h)),p||""}}i.renderer=o}if(s.tokenizer){const o=this.defaults.tokenizer||new wm(this.defaults);for(const l in s.tokenizer){if(!(l in o))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const u=l,d=s.tokenizer[u],f=o[u];o[u]=(...h)=>{let p=d.apply(o,h);return p===!1&&(p=f.apply(o,h)),p}}i.tokenizer=o}if(s.hooks){const o=this.defaults.hooks||new Gh;for(const l in s.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const u=l,d=s.hooks[u],f=o[u];Gh.passThroughHooks.has(l)?o[u]=h=>{if(this.defaults.async)return Promise.resolve(d.call(o,h)).then(g=>f.call(o,g));const p=d.call(o,h);return f.call(o,p)}:o[u]=(...h)=>{let p=d.apply(o,h);return p===!1&&(p=f.apply(o,h)),p}}i.hooks=o}if(s.walkTokens){const o=this.defaults.walkTokens,l=s.walkTokens;i.walkTokens=function(u){let d=[];return d.push(l.call(this,u)),o&&(d=d.concat(o.call(this,u))),d}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ni.lex(e,t??this.defaults)}parser(e,t){return fr.parse(e,t??this.defaults)}parseMarkdown(e){return(s,i)=>{const o={...i},l={...this.defaults,...o},u=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&o.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));l.hooks&&(l.hooks.options=l,l.hooks.block=e);const d=l.hooks?l.hooks.provideLexer():e?Ni.lex:Ni.lexInline,f=l.hooks?l.hooks.provideParser():e?fr.parse:fr.parseInline;if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(s):s).then(h=>d(h,l)).then(h=>l.hooks?l.hooks.processAllTokens(h):h).then(h=>l.walkTokens?Promise.all(this.walkTokens(h,l.walkTokens)).then(()=>h):h).then(h=>f(h,l)).then(h=>l.hooks?l.hooks.postprocess(h):h).catch(u);try{l.hooks&&(s=l.hooks.preprocess(s));let h=d(s,l);l.hooks&&(h=l.hooks.processAllTokens(h)),l.walkTokens&&this.walkTokens(h,l.walkTokens);let p=f(h,l);return l.hooks&&(p=l.hooks.postprocess(p)),p}catch(h){return u(h)}}}onError(e,t){return s=>{if(s.message+=`
312
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+wi(s.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(s);throw s}}},ja=new YV;function jt(e,t){return ja.parse(e,t)}jt.options=jt.setOptions=function(e){return ja.setOptions(e),jt.defaults=ja.defaults,RN(jt.defaults),jt};jt.getDefaults=p0;jt.defaults=Va;jt.use=function(...e){return ja.use(...e),jt.defaults=ja.defaults,RN(jt.defaults),jt};jt.walkTokens=function(e,t){return ja.walkTokens(e,t)};jt.parseInline=ja.parseInline;jt.Parser=fr;jt.parser=fr.parse;jt.Renderer=Sm;jt.TextRenderer=T0;jt.Lexer=Ni;jt.lexer=Ni.lex;jt.Tokenizer=wm;jt.Hooks=Gh;jt.parse=jt;jt.options;jt.setOptions;jt.use;jt.walkTokens;jt.parseInline;fr.parse;Ni.lex;function $V(e){return Ni.lex(e,{gfm:!0})}function QV(e){const t=e.trim();if(!(!t||/[\u0000-\u0020\u007F]/.test(t)||/[\\]/.test(t)||t.startsWith("//"))){if(t.startsWith("#"))return t;try{const s=new URL(t);return["https:","http:","mailto:"].includes(s.protocol)?t:void 0}catch{return}}}function Bl(e){const t={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};return e.replaceAll(/&(#x[\da-f]+|#\d+|amp|lt|gt|quot|apos|nbsp);/gi,(s,i)=>{var l;if(!i.startsWith("#"))return t[i.toLowerCase()]??s;const o=((l=i[1])==null?void 0:l.toLowerCase())==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):"�"})}function XV({content:e,language:t}){const{t:s}=mt(),[i,o]=E.useState("idle");return v.jsxs("div",{className:"my-3 min-w-0 overflow-hidden rounded-lg border border-border bg-muted/40",children:[v.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border px-3 py-1.5 text-[11px] text-muted-foreground",children:[v.jsx("span",{className:"font-mono",children:t==null?void 0:t.split(/\s/)[0]}),v.jsx("button",{type:"button",className:"hover:text-foreground",onClick:()=>{(async()=>{try{await navigator.clipboard.writeText(e),o("done")}catch{o("failed")}})()},children:s(i==="done"?"transcript.copied":"transcript.copyCode")})]}),v.jsx("pre",{className:"max-h-96 overflow-auto p-3 font-mono text-[12px] leading-relaxed",children:v.jsx("code",{children:e})}),i==="failed"?v.jsx("p",{className:"px-3 pb-2 text-xs text-destructive",role:"alert",children:s("transcript.copyFailed")}):null]})}function bs(e){return e.map((t,s)=>v.jsx(E.Fragment,{children:ZV(t)},s))}function ZV(e){switch(e.type){case"space":case"def":return null;case"html":return e.text;case"text":return e.tokens?bs(e.tokens):Bl(e.text);case"escape":return Bl(e.text);case"br":return v.jsx("br",{});case"hr":return v.jsx("hr",{className:"my-3 border-border"});case"strong":return v.jsx("strong",{children:bs(e.tokens)});case"em":return v.jsx("em",{children:bs(e.tokens)});case"del":return v.jsx("del",{children:bs(e.tokens)});case"codespan":return v.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.9em]",children:Bl(e.text)});case"code":return v.jsx(XV,{content:e.text,language:e.lang});case"paragraph":return v.jsx("p",{className:"my-2 whitespace-pre-wrap break-words first:mt-0 last:mb-0",children:bs(e.tokens)});case"heading":{const t=`h${Math.min(6,Math.max(1,e.depth))}`;return v.jsx(t,{className:"mt-4 mb-2 font-semibold text-[1.05em] first:mt-0",children:bs(e.tokens)})}case"blockquote":return v.jsx("blockquote",{className:"my-3 border-l-2 border-border pl-3 text-muted-foreground",children:bs(e.tokens)});case"list":{const t=e.ordered?"ol":"ul";return v.jsx(t,{className:ke("my-2 space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),start:e.ordered&&typeof e.start=="number"?e.start:void 0,children:e.items.map((s,i)=>v.jsxs("li",{children:[s.task?v.jsx("input",{"aria-label":Bl(s.text),checked:!!s.checked,disabled:!0,readOnly:!0,type:"checkbox",className:"mr-2"}):null,bs(s.tokens)]},i))})}case"list_item":return v.jsx("li",{children:bs(e.tokens)});case"link":case"image":{const t=QV(Bl(e.href)),s=e.type==="image"?Bl(e.text):bs(e.tokens);return t?v.jsx("a",{className:"break-words underline underline-offset-2 hover:no-underline",href:t,rel:"noreferrer noopener",target:"_blank",title:e.title??void 0,children:s}):v.jsx("span",{children:s})}case"table":return v.jsx("div",{className:"my-3 max-w-full overflow-x-auto rounded-md border border-border",children:v.jsxs("table",{className:"w-full border-collapse text-left text-[12.5px]",children:[v.jsx("thead",{className:"bg-muted/40",children:v.jsx("tr",{children:e.header.map((t,s)=>v.jsx("th",{className:"border-b border-border px-3 py-2 font-medium",style:{textAlign:e.align[s]??void 0},children:bs(t.tokens)},s))})}),v.jsx("tbody",{children:e.rows.map((t,s)=>v.jsx("tr",{className:"border-b border-border last:border-b-0",children:t.map((i,o)=>v.jsx("td",{className:"px-3 py-2",style:{textAlign:e.align[o]??void 0},children:bs(i.tokens)},o))},s))})]})})}}const Tm=E.memo(function({content:t,className:s}){const i=E.useMemo(()=>$V(t),[t]);return v.jsx("div",{className:ke("min-w-0 text-[13.5px] leading-relaxed",s),children:bs(i)})});class WV extends E.Component{constructor(){super(...arguments);ge(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}}function JV({name:e,children:t}){const{t:s}=mt();return v.jsx(WV,{fallback:v.jsx("p",{className:"my-2 text-xs text-destructive",role:"alert",children:s("transcript.toolRenderFailed",{name:e})}),children:t})}function eF(e){if(e!==void 0)return typeof e=="string"?e:JSON.stringify(e,null,2)}function xC({content:e,markdown:t=!1}){const{t:s}=mt(),i=E.useId(),[o,l]=E.useState(!1),u=e.split(`
313
- `).slice(0,16).join(`
314
- `).slice(0,1800),d=u.length<e.length,f=d&&!o?`${u}
315
- …`:e;return v.jsxs("div",{className:"min-w-0",children:[v.jsx("div",{id:i,children:t?v.jsx(Tm,{content:f}):v.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words rounded-md border border-border bg-muted/40 p-2.5 font-mono text-[11.5px] leading-relaxed",children:f})}),d?v.jsx("button",{"aria-controls":i,"aria-expanded":o,className:"mt-1 text-xs text-muted-foreground underline underline-offset-2",onClick:()=>{l(!o)},type:"button",children:s(o?"transcript.collapse":"transcript.expand")}):null]})}function tF({call:e}){const{t}=mt(),s=eF(e.args),i=e.status==="running"?"run.running":e.status==="error"?"run.failed":"run.done";return v.jsxs("details",{className:"tool-line my-1.5 min-w-0",children:[v.jsxs("summary",{className:"flex cursor-pointer list-none items-baseline gap-1.5 text-xs text-muted-foreground",children:[v.jsx("span",{"aria-hidden":!0,className:"tool-line-chevron shrink-0 transition-transform",children:"▸"}),v.jsx("span",{className:e.status==="running"?"tool-line-running":void 0,children:e.name}),v.jsx("span",{className:e.status==="error"?"text-destructive":void 0,children:t(i)})]}),v.jsxs("div",{className:"mt-2 space-y-2 border-l border-border pl-3",children:[s!==void 0?v.jsxs("section",{children:[v.jsx("h4",{className:"mb-1 text-xs text-muted-foreground",children:t("transcript.input")}),v.jsx(xC,{content:s})]}):null,e.output!==void 0?v.jsxs("section",{children:[v.jsx("h4",{className:"mb-1 text-xs text-muted-foreground",children:t("transcript.output")}),v.jsx(xC,{content:e.output,markdown:!0})]}):null,e.error?v.jsx("p",{className:"whitespace-pre-wrap break-words text-xs text-destructive",role:"alert",children:e.error}):null]})]})}function nF({calls:e}){const{t}=mt(),s=e.map(l=>v.jsx(JV,{name:l.name,children:v.jsx(tF,{call:l})},l.id));if(e.length===0)return null;if(e.length===1)return v.jsx("div",{className:"mt-1",children:s});const i=e.some(l=>l.status==="running"),o=e.some(l=>l.status==="error");return v.jsxs("details",{className:"tool-line my-1.5 min-w-0",children:[v.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground",children:[v.jsx("span",{"aria-hidden":!0,className:"tool-line-chevron shrink-0 transition-transform",children:"▸"}),v.jsx(Nz,{"aria-hidden":!0,className:"size-3.5"}),v.jsx("span",{className:i?"tool-line-running":void 0,children:t("transcript.tools",{count:e.length})}),o?v.jsx("span",{className:"text-destructive",children:t("run.failed")}):i?v.jsx("span",{children:t("run.running")}):null]}),v.jsx("div",{className:"mt-2 border-l border-border pl-3",children:s})]})}function IN({attachments:e,align:t="start"}){return e===void 0||e.length===0?null:v.jsx("div",{className:t==="end"?"mt-1.5 flex flex-wrap justify-end gap-1.5":"mt-1.5 flex flex-wrap gap-1.5",children:e.map(s=>v.jsxs("span",{className:"flex max-w-[240px] items-center gap-1.5 rounded-lg bg-muted px-2 py-1 text-[11.5px]",title:s.path,children:[v.jsx(Zu,{className:"size-3 shrink-0 text-muted-foreground"}),v.jsx("span",{className:"truncate",children:s.name})]},s.id))})}const sF=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"});function iF(){const{t:e}=mt();return v.jsx("span",{"aria-label":e("transcript.working"),className:"flex items-center gap-1 py-1.5",children:[0,1,2].map(t=>v.jsx("span",{className:"typing-dot size-1.5 rounded-full bg-muted-foreground",style:{animationDelay:`${t*.15}s`}},t))})}function rF({bot:e,message:t}){var i;if(t.role==="system")return v.jsx("div",{className:"flex justify-center py-1",children:v.jsx("p",{className:"max-w-[90%] text-center text-[11.5px] text-muted-foreground/80",children:t.content})});if(t.role==="user")return v.jsx("div",{className:"flex justify-end",children:v.jsxs("div",{className:"max-w-[85%]",children:[v.jsx("div",{className:"rounded-2xl rounded-br-md bg-secondary px-3.5 py-2 text-[13.5px] text-secondary-foreground leading-relaxed whitespace-pre-wrap",children:t.content}),v.jsx(IN,{align:"end",attachments:t.attachments})]})});const s=e.accentHue??Wu(e.avatarSeed);return v.jsxs("div",{className:"flex min-w-0 gap-2.5",children:[v.jsx(Bs,{emoji:e.avatarEmoji,hue:e.accentHue,name:e.name,seed:e.avatarSeed,size:26}),v.jsxs("div",{className:"bot-card min-w-0 flex-1 rounded-xl px-3 py-2",style:{"--bot-hue":String(s)},children:[v.jsxs("div",{className:"flex items-baseline gap-2",children:[v.jsx("span",{className:"font-medium text-[12.5px]",children:e.name}),t.createdAt!==null&&t.createdAt>0?v.jsx("time",{className:"text-[11px] text-muted-foreground",children:sF.format(t.createdAt)}):null]}),t.content?v.jsx(Tm,{className:"mt-1",content:t.content}):null,(i=t.toolCalls)!=null&&i.length?v.jsx(nF,{calls:t.toolCalls}):null,t.handoff?v.jsx(TN,{handoff:t.handoff}):null]})]})}function oF({bot:e,threadId:t}){var S,T,A;const s=Et(P6(t)),i=Et(Rc()),o=Et(op(e.id)),{t:l}=mt(),u=(((S=i.data)==null?void 0:S.approvals)??[]).filter(C=>C.threadId===t),d=(((T=i.data)==null?void 0:T.questions)??[]).filter(C=>C.threadId===t),f=s.data??[],h=f.some(C=>C.role!=="system"),p=f.at(-1),g=(o.data??[]).filter(C=>C.threadId===t),b=g.find(C=>C.status==="running"||C.status==="waiting_user"),w=g.toSorted((C,k)=>k.startedAt-C.startedAt)[0],x=(b==null?void 0:b.status)==="running"&&(!p||p.role!=="assistant"||!p.content.trim()&&!((A=p.toolCalls)!=null&&A.some(C=>C.status==="running")));return v.jsx(yN,{children:v.jsxs(bN,{className:"min-h-0 flex-1",children:[v.jsx(xN,{className:"px-4 md:px-8",children:v.jsxs(wN,{className:"mx-auto w-full max-w-2xl py-7",children:[!h&&!b&&!s.isPending&&!s.isError?v.jsxs("div",{className:"flex flex-col items-center gap-3 py-20 text-center",children:[v.jsx(Bs,{name:e.name,seed:e.avatarSeed,size:44}),v.jsxs("div",{children:[v.jsx("p",{className:"font-medium text-[15px]",children:l("transcript.start",{name:e.name})}),v.jsxs("p",{className:"mt-1 max-w-sm text-[13px] text-muted-foreground",children:[e.title," · ",e.workspace]})]})]}):null,f.filter(C=>{var k;return C.role!=="assistant"||C.content.length>0||(((k=C.toolCalls)==null?void 0:k.length)??0)>0||C.handoff!==void 0}).map(C=>v.jsx(to,{children:v.jsx(rF,{bot:e,message:C})},C.id)),x?v.jsx(to,{children:v.jsxs("div",{className:"flex gap-2.5",children:[v.jsx(Bs,{name:e.name,seed:e.avatarSeed,size:26}),v.jsx(iF,{})]})}):null,d.map(C=>v.jsx(to,{children:v.jsx(m0,{botName:e.name,question:C})},C.id)),u.map(C=>v.jsx(to,{children:v.jsx(h0,{approval:C,botName:e.name})},C.id)),w&&(w.error||w.status==="interrupted")?v.jsx(to,{children:v.jsxs("p",{className:"whitespace-pre-wrap break-words text-xs text-destructive",role:"alert",children:[l(w.status==="interrupted"?"transcript.interrupted":w.status==="cancelled"?"run.cancelled":"transcript.runFailed"),w.error?`: ${w.error}`:""]})}):null,s.isError?v.jsx(to,{children:v.jsxs("div",{className:"text-xs text-destructive",role:"alert",children:[v.jsxs("p",{children:[l("transcript.loadFailed"),": ",s.error.message]}),v.jsx("button",{className:"mt-1 underline underline-offset-2",disabled:s.isFetching,onClick:()=>{s.refetch()},type:"button",children:l("transcript.retry")})]})}):null,i.isError?v.jsx(to,{children:v.jsx("p",{className:"text-xs text-destructive",role:"alert",children:i.error.message})}):null,s.isPending?v.jsx(to,{children:v.jsx(X6,{label:l("transcript.loading"),running:!0})}):null]})}),v.jsx(SN,{})]})},`${e.id}:${t}`)}function PN({run:e,roomId:t}){const{t:s}=mt(),i=Us(),o=On({retry:!1,mutationFn:d=>Yt().recoverRun(d.runId,d.decision),onSuccess:async(d,f)=>{await Promise.all([i.invalidateQueries({queryKey:He.runs(f.botId)}),i.invalidateQueries({queryKey:He.threads(f.botId)}),i.invalidateQueries({queryKey:He.messages(f.threadId)}),...t===void 0?[]:[i.invalidateQueries({queryKey:He.roomMessages(t)})],i.invalidateQueries({queryKey:He.inbox()}),i.invalidateQueries({queryKey:He.bots()})])}}),l=d=>{o.isPending||o.isSuccess||e.status!=="interrupted"||e.recoveryDecision||o.mutate({runId:e.id,botId:e.botId,threadId:e.threadId,decision:d})},u=o.isPending||o.isSuccess||e.status!=="interrupted"||!!e.recoveryDecision;return v.jsxs("section",{className:"mx-4 mb-3 rounded-xl border border-warning/40 bg-warning/5 p-3","aria-label":s("recovery.title"),children:[v.jsx("h2",{className:"font-medium text-sm",children:s("recovery.title")}),v.jsx("p",{className:"mt-1 text-muted-foreground text-xs",children:s("recovery.description")}),e.error?v.jsx("p",{className:"mt-1 break-words text-xs",children:e.error}):null,o.error?v.jsxs("p",{className:"mt-2 text-destructive text-xs",role:"alert",children:[s("recovery.failed")," ",o.error.message]}):null,v.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[v.jsx(Be,{disabled:u,size:"sm",onClick:()=>l("continue_queue"),children:s("recovery.continue")}),v.jsx(Be,{disabled:u,size:"sm",variant:"outline",onClick:()=>{!u&&window.confirm(s("recovery.retryConfirm"))&&l("retry")},children:s("recovery.retry")}),v.jsx(Be,{disabled:u,size:"sm",variant:"ghost",onClick:()=>l("cancel_queue"),children:s("recovery.cancel")})]})]})}const zN=E.createContext({});function R0(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const aF=typeof window<"u",Tb=aF?E.useLayoutEffect:E.useEffect,E0=E.createContext(null);function C0(e,t){e.indexOf(t)===-1&&e.push(t)}function Rm(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const Rr=(e,t,s)=>s>t?t:s<e?e:s;let up=()=>{};const br={},A0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),LN=e=>typeof e=="object"&&e!==null,k0=e=>/^0[^.\s]+$/u.test(e);function BN(e){let t;return()=>(t===void 0&&(t=e()),t)}const ni=e=>e,Nd=(...e)=>e.reduce((t,s)=>i=>s(t(i))),ld=(e,t,s)=>{const i=t-e;return i?(s-e)/i:1};class Em{constructor(){this.subscriptions=[]}add(t){return C0(this.subscriptions,t),()=>this.remove(t)}remove(t){Rm(this.subscriptions,t)}notify(t,s,i){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,s,i);else for(let l=0;l<o;l++){const u=this.subscriptions[l];u&&u(t,s,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ls=e=>e*1e3,zs=e=>e/1e3,UN=(e,t)=>t?e*(1e3/t):0,VN=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,lF=1e-7,cF=12;function uF(e,t,s,i,o){let l,u,d=0;do u=t+(s-t)/2,l=VN(u,i,o)-e,l>0?s=u:t=u;while(Math.abs(l)>lF&&++d<cF);return u}function Od(e,t,s,i){if(e===t&&s===i)return ni;const o=l=>uF(l,0,1,e,s);return l=>l===0||l===1?l:VN(o(l),t,i)}const FN=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qN=e=>t=>1-e(1-t),HN=Od(.33,1.53,.69,.99),M0=qN(HN),GN=FN(M0),KN=e=>e>=1?1:(e*=2)<1?.5*M0(e):.5*(2-Math.pow(2,-10*(e-1))),N0=e=>1-Math.sin(Math.acos(e)),YN=qN(N0),$N=FN(N0),dF=Od(.42,0,1,1),fF=Od(0,0,.58,1),O0=Od(.42,0,.58,1),hF=e=>Array.isArray(e)&&typeof e[0]!="number",QN=e=>Array.isArray(e)&&typeof e[0]=="number",mF={linear:ni,easeIn:dF,easeInOut:O0,easeOut:fF,circIn:N0,circInOut:$N,circOut:YN,backIn:M0,backInOut:GN,backOut:HN,anticipate:KN},pF=e=>typeof e=="string",wC=e=>{if(QN(e)){up(e.length===4);const[t,s,i,o]=e;return Od(t,s,i,o)}else if(pF(e))return mF[e];return e},dn={delta:0,timestamp:0,isProcessing:!1};let Kh;function gF(){Kh=void 0}const Nn={now:()=>(Kh===void 0&&Nn.set(dn.isProcessing||br.useManualTiming?dn.timestamp:performance.now()),Kh),set:e=>{Kh=e,queueMicrotask(gF)}},Jl=e=>Math.round(e*1e5)/1e5,XN=e=>t=>typeof t=="string"&&t.startsWith(e),ZN=XN("--"),yF=XN("var(--"),j0=e=>yF(e)?vF.test(e.split("/*")[0].trim()):!1,vF=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function SC(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ec={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},cd={...Ec,transform:e=>Rr(0,1,e)},Nh={...Ec,default:1},D0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bF(e){return e==null}const xF=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,_0=(e,t)=>s=>!!(typeof s=="string"&&xF.test(s)&&s.startsWith(e)||t&&!bF(s)&&Object.prototype.hasOwnProperty.call(s,t)),WN=(e,t,s)=>i=>{if(typeof i!="string")return i;const[o,l,u,d]=i.match(D0);return{[e]:parseFloat(o),[t]:parseFloat(l),[s]:parseFloat(u),alpha:d!==void 0?parseFloat(d):1}},wF=e=>Rr(0,255,e),vv={...Ec,transform:e=>Math.round(wF(e))},da={test:_0("rgb","red"),parse:WN("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:i=1})=>"rgba("+vv.transform(e)+", "+vv.transform(t)+", "+vv.transform(s)+", "+Jl(cd.transform(i))+")"};function SF(e){let t="",s="",i="",o="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),i=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),i=e.substring(3,4),o=e.substring(4,5),t+=t,s+=s,i+=i,o+=o),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}}const Rb={test:_0("#"),parse:SF,transform:da.transform},jd=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),lr=jd("deg"),Pi=jd("%"),Ie=jd("px"),TF=jd("vh"),RF=jd("vw"),TC={...Pi,parse:e=>Pi.parse(e)/100,transform:e=>Pi.transform(e*100)},Fl={test:_0("hsl","hue"),parse:WN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:i=1})=>"hsla("+Math.round(e)+", "+Pi.transform(Jl(t))+", "+Pi.transform(Jl(s))+", "+Jl(cd.transform(i))+")"},fn={test:e=>da.test(e)||Rb.test(e)||Fl.test(e),parse:e=>da.test(e)?da.parse(e):Fl.test(e)?Fl.parse(e):Rb.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?da.transform(e):Fl.transform(e),getAnimatableNone:e=>{const t=fn.parse(e);return t.alpha=0,fn.transform(t)}},EF=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,JN=new RegExp(D0.source),eO=new RegExp(EF.source,"i");function CF(e){return isNaN(e)&&typeof e=="string"&&(JN.test(e)||eO.test(e))}const tO="number",nO="color",AF="var",kF="var(",RC="${}",MF=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function NF(e){const t=e.toString();return JN.test(t)||eO.test(t)}function ud(e){const t=e.toString(),s=[],i={color:[],number:[],var:[]},o=[];let l=0;const d=t.replace(MF,f=>(fn.test(f)?(i.color.push(l),o.push(nO),s.push(fn.parse(f))):f.startsWith(kF)?(i.var.push(l),o.push(AF),s.push(f)):(i.number.push(l),o.push(tO),s.push(parseFloat(f))),++l,RC)).split(RC);return{values:s,split:d,indexes:i,types:o}}function OF(e){return ud(e).values}function sO({split:e,types:t}){const s=e.length;return i=>{let o="";for(let l=0;l<s;l++)if(o+=e[l],i[l]!==void 0){const u=t[l];u===tO?o+=Jl(i[l]):u===nO?o+=fn.transform(i[l]):o+=i[l]}return o}}function jF(e){return sO(ud(e))}const DF=e=>typeof e=="number"?0:fn.test(e)?fn.getAnimatableNone(e):e,_F=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:DF(e);function IF(e){const t=ud(e);return sO(t)(t.values.map((i,o)=>_F(i,t.split[o])))}const ws={test:CF,parse:OF,createTransformer:jF,getAnimatableNone:IF};function bv(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function PF({hue:e,saturation:t,lightness:s,alpha:i}){e/=360,t/=100,s/=100;let o=0,l=0,u=0;if(!t)o=l=u=s;else{const d=s<.5?s*(1+t):s+t-s*t,f=2*s-d;o=bv(f,d,e+1/3),l=bv(f,d,e),u=bv(f,d,e-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(u*255),alpha:i}}function Cm(e,t){return s=>s>0?t:e}const Dt=(e,t,s)=>e+(t-e)*s,xv=(e,t,s)=>{const i=e*e,o=s*(t*t-i)+i;return o<0?0:Math.sqrt(o)},zF=[Rb,da,Fl],LF=e=>zF.find(t=>t.test(e));function EC(e){const t=LF(e);if(!t)return!1;let s=t.parse(e);return t===Fl&&(s=PF(s)),s}const CC=(e,t)=>{const s=EC(e),i=EC(t);if(!s||!i)return Cm(e,t);const o={...s};return l=>(o.red=xv(s.red,i.red,l),o.green=xv(s.green,i.green,l),o.blue=xv(s.blue,i.blue,l),o.alpha=Dt(s.alpha,i.alpha,l),da.transform(o))},Eb=new Set(["none","hidden"]);function BF(e,t){return Eb.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function UF(e,t){return s=>Dt(e,t,s)}function I0(e){return typeof e=="number"?UF:typeof e=="string"?j0(e)?Cm:fn.test(e)?CC:qF:Array.isArray(e)?iO:typeof e=="object"?fn.test(e)?CC:VF:Cm}function iO(e,t){const s=[...e],i=s.length,o=e.map((l,u)=>I0(l)(l,t[u]));return l=>{for(let u=0;u<i;u++)s[u]=o[u](l);return s}}function VF(e,t){const s={...e,...t},i={};for(const o in s)e[o]!==void 0&&t[o]!==void 0&&(i[o]=I0(e[o])(e[o],t[o]));return o=>{for(const l in i)s[l]=i[l](o);return s}}function FF(e,t){const s=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const l=t.types[o],u=e.indexes[l][i[l]],d=e.values[u]??0;s[o]=d,i[l]++}return s}const qF=(e,t)=>{const s=ws.createTransformer(t),i=ud(e),o=ud(t);return i.indexes.var.length===o.indexes.var.length&&i.indexes.color.length===o.indexes.color.length&&i.indexes.number.length>=o.indexes.number.length?Eb.has(e)&&!o.values.length||Eb.has(t)&&!i.values.length?BF(e,t):Nd(iO(FF(i,o),o.values),s):Cm(e,t)},AC=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function HF(e,t){const s=AC.exec(e);if(!s)return;const i=AC.exec(t);if(!i||s[2]!==i[2])return;const o=s[2],l=parseFloat(s[1]),u=parseFloat(i[1]);return d=>Jl(Dt(l,u,d))+o}function P0(e,t,s){if(typeof e=="number"&&typeof t=="number"&&typeof s=="number")return Dt(e,t,s);if(typeof e=="string"&&typeof t=="string"){const o=HF(e,t);if(o)return o}return I0(e)(e,t)}const Oh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function GF(e){let t=new Set,s=new Set,i=!1,o=!1;const l=new Set;let u={delta:0,timestamp:0,isProcessing:!1};function d(h){l.has(h)&&(s.add(h),e()),h(u)}const f={schedule:(h,p=!1,g=!1)=>{const w=g&&i?t:s;return p&&l.add(h),w.add(h),h},cancel:h=>{s.delete(h),l.delete(h)},process:h=>{if(u=h,i){o=!0;return}i=!0;const p=t;t=s,s=p,t.forEach(d),t.clear(),i=!1,o&&(o=!1,f.process(h))}};return f}const KF=40;function rO(e,t,s={delta:0,timestamp:0,isProcessing:!1}){let i=!1,o=!0;const l=()=>i=!0,u=Oh.reduce((k,M)=>(k[M]=GF(l),k),{}),{setup:d,read:f,resolveKeyframes:h,preUpdate:p,update:g,preRender:b,render:w,postRender:x}=u,S=()=>{const k=br.useManualTiming,M=k?s.timestamp:performance.now();i=!1,k||(s.delta=o?1e3/60:Math.max(Math.min(M-s.timestamp,KF),1)),s.timestamp=M,s.isProcessing=!0,d.process(s),f.process(s),h.process(s),p.process(s),g.process(s),b.process(s),w.process(s),x.process(s),s.isProcessing=!1,i&&t&&(o=!1,e(S))},T=()=>{i=!0,o=!0,s.isProcessing||e(S)};return{schedule:Oh.reduce((k,M)=>{const D=u[M];return k[M]=(_,N=!1,O=!1)=>(i||T(),D.schedule(_,N,O)),k},{}),cancel:k=>{for(let M=0;M<Oh.length;M++)u[Oh[M]].cancel(k)},state:s,steps:u}}const{schedule:It,cancel:xr,steps:wv}=rO(typeof requestAnimationFrame<"u"?requestAnimationFrame:ni,!0,dn),YF=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>It.update(t,s),stop:()=>xr(t),now:()=>dn.isProcessing?dn.timestamp:Nn.now()}},oO=(e,t,s=10)=>{let i="";const o=Math.max(Math.round(t/s),2);for(let l=0;l<o;l++)i+=Math.round(e(l/(o-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},z0=2e4;function L0(e,t=50,s=z0,i){let o=0,l=e.next(o);for(;!l.done&&o<s;)o+=t,l=e.next(o);return o>=s?1/0:o}function $F(e,t=100,s){const i=s({...e,keyframes:[0,t]}),o=Math.min(L0(i),z0);return{type:"keyframes",ease:l=>i.next(o*l).value/t,duration:zs(o)}}const Mn={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},aO=e=>e<0?1/Math.max(1+e,Mn.minDamping):Math.max(1-e,Mn.minDamping);function lO(e,t){if(!(e>1))return 1;const s=Math.sqrt(e*e-1),i=e-s,o=e+s,l=2*s*Math.exp(-t)*(1+t);return cO(u=>o*Math.exp(-i*u)-i*Math.exp(-o*u)-l,u=>Math.exp(-o*u)-Math.exp(-i*u),t)/t}function Cb(e,t){return e*Math.sqrt(1-t*t)}const QF=12;function cO(e,t,s){let i=s;for(let o=1;o<QF;o++)i=i-e(i)/t(i);return i}const Sv=.001;function XF({duration:e=Mn.duration,bounce:t=Mn.bounce}){let s,i;const o=aO(t);e=Rr(Mn.minDuration,Mn.maxDuration,zs(e)),o<1?(s=h=>{const p=h*o,g=p*e,b=Cb(h,o),w=Math.exp(-g);return Sv-p/b*w},i=h=>{const g=h*o*e,b=o*o*h*h*e,w=Math.exp(-g),x=Cb(h*h,o);return(-s(h)+Sv>0?-1:1)*-b*w/x}):(s=h=>{const p=Math.exp(-h*e),g=h*e+1;return-Sv+p*g},i=h=>{const p=Math.exp(-h*e),g=-h*(e*e);return p*g});const l=5/e,u=cO(s,i,l),d=u*lO(o,u*e),f=d*d;return{stiffness:f,damping:o*2*Math.sqrt(f),duration:Ls(e)}}const Ab=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Tv(e,t){if(Ab(e,t))return e}function ZF(e){const t=Tv(e.stiffness),s=Tv(e.damping,!0),i=Tv(e.mass),o={...e,stiffness:t??Mn.stiffness,damping:s??Mn.damping,mass:i??Mn.mass,isResolvedFromDuration:!1,isTimeDefined:(t??s??i)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(o.isTimeDefined){if(e.visualDuration){const l=aO(e.bounce||0),u=2*Math.PI/(e.visualDuration*1.2)*lO(l,2*Math.PI/1.2);o.stiffness=u*u,o.damping=2*l*Math.sqrt(o.stiffness)}else Object.assign(o,XF(o)),o.isResolvedFromDuration=!0;(!Ab(o.stiffness)||!Ab(o.damping,!0))&&(o.stiffness=Mn.stiffness,o.damping=Mn.damping)}return o}function Am(e=Mn.visualDuration,t=Mn.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,i=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:d,mass:f,duration:h,isResolvedFromDuration:p,isTimeDefined:g}=ZF({...s}),b=N=>g?0:-zs(N),w=d/(2*Math.sqrt(u*f)),x=zs(Math.sqrt(u/f)),S=w*x,T={target:o,delta:o-i,velocity:b(s.velocity||0)||0,restSpeed:0,restDelta:0},A=()=>{const N=Math.abs(T.delta)<5;T.restSpeed=s.restSpeed||(N?Mn.restSpeed.granular:Mn.restSpeed.default),T.restDelta=s.restDelta||(N?Mn.restDelta.granular:Mn.restDelta.default)};A();let C,k,M;if(w<1){const N=Cb(x,w),O={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};M=()=>{O.A=(T.velocity+S*T.delta)/N,O.sinC=S*O.A+T.delta*N,O.cosC=S*T.delta-O.A*N};const z=I=>{I!==O.t&&(O.t=I,O.env=Math.exp(-S*I),O.sin=Math.sin(N*I),O.cos=Math.cos(N*I))};C=I=>(z(I),T.target-O.env*(O.A*O.sin+T.delta*O.cos)),k=I=>(z(I),O.env*(O.sinC*O.sin+O.cosC*O.cos))}else if(w===1){C=O=>T.target-Math.exp(-x*O)*(T.delta+(T.velocity+x*T.delta)*O);const N={C:0};M=()=>{N.C=T.velocity+x*T.delta},k=O=>Math.exp(-x*O)*(x*N.C*O-T.velocity)}else{const N=x*Math.sqrt(w*w-1),O=S-N,z=S+N,I=g?1/0:300/N,V=(X,B)=>Math.exp(B>I?-X*I-S*(B-I):-X*B),$={S:0,F:0};M=()=>{const X=(T.velocity+S*T.delta)/N;$.S=(T.delta+X)/2,$.F=(T.delta-X)/2},C=X=>T.target-$.S*V(O,X)-$.F*V(z,X),k=X=>O*$.S*V(O,X)+z*$.F*V(z,X)}M();const D=p&&h||null,_={calculatedDuration:D,retarget:(N,O)=>{T.target=N[N.length-1],T.delta=T.target-N[0],T.velocity=b(O),s.restSpeed&&s.restDelta||A(),_.calculatedDuration=D,l.done=!1,M()},velocity:N=>Ls(k(N)),next:N=>{const O=C(N);if(p)l.done=N>=h;else{const z=Ls(k(N));l.done=Math.abs(z)<=T.restSpeed&&Math.abs(T.target-O)<=T.restDelta}return l.value=l.done?T.target:O,l},toString:()=>{const N=Math.min(L0(_),z0),O=oO(z=>_.next(N*z).value,N,30);return N+"ms "+O},toTransition:()=>{}};return _}Am.applyToOptions=e=>{const t=$F(e,100,Am);return e.ease=t.ease,e.duration=Ls(t.duration),e.type="keyframes",e};function kb({keyframes:e,velocity:t=0,power:s=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:u,min:d,max:f,restDelta:h=.5,restSpeed:p}){const g=e[0],b={done:!1,value:g},w=N=>N<d||N>f,x=N=>d===void 0?f:f===void 0||Math.abs(d-N)<Math.abs(f-N)?d:f;let S=s*t;const T=g+S,A=u===void 0?T:u(T);A!==T&&(S=A-g);const C=N=>-S*Math.exp(-N/i),k=N=>{const O=C(N);b.done=Math.abs(O)<=h,b.value=b.done?A:A+O};let M,D;const _=N=>{w(b.value)&&(M=N,D=Am({keyframes:[b.value,x(b.value)],velocity:-C(N)/i*1e3,damping:o,stiffness:l,restDelta:h,restSpeed:p}))};return _(0),{calculatedDuration:null,next:N=>{let O=!1;return!D&&M===void 0&&(O=!0,k(N),_(N)),M!==void 0&&N>=M?D.next(N-M):(!O&&k(N),b)}}}function WF(e,t,s){const i=[],o=s||br.mix||P0,l=e.length-1;for(let u=0;u<l;u++){let d=o(e[u],e[u+1]);if(t){const f=Array.isArray(t)?t[u]||ni:t;d=Nd(f,d)}i.push(d)}return i}function uO(e,t,{clamp:s=!0,ease:i,mixer:o}={}){const l=e.length;if(up(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const u=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=WF(t,i,o),f=d.length,h=p=>{if(u&&p<e[0])return t[0];let g=0;if(f>1)for(;g<e.length-2&&!(p<e[g+1]);g++);const b=ld(e[g],e[g+1],p);return d[g](b)};return s?p=>h(Rr(e[0],e[l-1],p)):h}function JF(e,t){const s=e[e.length-1];for(let i=1;i<=t;i++){const o=ld(0,t,i);e.push(Dt(s,1,o))}}function eq(e){const t=[0];return JF(t,e.length-1),t}function tq(e,t){return e.map(s=>s*t)}function nq(e,t){return e.map(()=>t||O0).splice(0,e.length-1)}function Bu({duration:e=300,keyframes:t,times:s,ease:i="easeInOut"}){const o=hF(i)?i.map(wC):wC(i)||O0,l={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(o)&&(!s||s.length!==2||s[0]===0&&s[1]===1)){const[f,h]=t,p=f===h?void 0:(br.mix||P0)(f,h);return{calculatedDuration:e,next:g=>(l.value=p?p(o(e>0?Rr(0,1,g/e):1)):h,l.done=g>=e,l)}}const u=tq(s&&s.length===t.length?s:eq(t),e),d=uO(u,t,{ease:Array.isArray(o)?o:nq(t,o)});return{calculatedDuration:e,next:f=>(l.value=d(f),l.done=f>=e,l)}}const sq=5;function iq(e,t,s){const i=Math.max(t-sq,0);return UN(s-e(i),t-i)}function rq(e,t,s=0){return t<=0?s:e.velocity?e.velocity(t):iq(i=>e.next(i).value,t,e.next(t).value)}const oq=e=>e!==null;function dp(e,{repeat:t,repeatType:s="loop"},i,o=1){const l=e.filter(oq),d=o<0||t&&s!=="loop"&&t%2===1?0:l.length-1;return!d||i===void 0?l[d]:i}const aq={decay:kb,inertia:kb,tween:Bu,keyframes:Bu,spring:Am};function dO(e){typeof e.type=="string"&&(e.type=aq[e.type])}function fO(e,t){return{kind:e,animation:t,timestamp:Nn.now(),frameTimestamp:dn.timestamp,frameIsProcessing:dn.isProcessing}}function hO(e,t,s){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...fO("animation-start",e),options:s?{...t,...s}:t})}catch{}}function lq(e,t){const s=globalThis.__MOTION_INSPECT__;if(s)try{s({...fO("layout-animation-start",e),node:t})}catch{}}class B0{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){var t;this.isResolved=!0,(t=this._resolve)==null||t.call(this)}then(t,s){return this.finished.then(t,s)}}const cq=e=>e/100;class km extends B0{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var i,o;const{motionValue:s}=this.options;s&&s.updatedAt!==Nn.now()&&this.tick(Nn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(i=this.options).onStop)==null||o.call(i))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause(),hO(this,this.options)}initAnimation(){const{options:t}=this;dO(t);const{type:s=Bu,repeat:i=0,repeatDelay:o=0,repeatType:l,velocity:u=0}=t;let{keyframes:d}=t;const f=s||Bu;f!==Bu&&typeof d[0]!="number"&&(this.mixKeyframes=Nd(cq,P0(d[0],d[1])),d=[0,100]);const h=f(d===t.keyframes?t:{...t,keyframes:d});l==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...d].reverse(),velocity:-u})),h.calculatedDuration===null&&(h.calculatedDuration=L0(h));const{calculatedDuration:p}=h;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(i+1)-o,this.generator=h}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:i,totalDuration:o,mixKeyframes:l,mirroredGenerator:u,resolvedDuration:d,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:h=0,keyframes:p,repeat:g,repeatType:b,repeatDelay:w,type:x,onUpdate:S,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const A=this.currentTime-h*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?A<0:A>o;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let k=this.currentTime,M=i;if(g){const O=Math.min(this.currentTime,o)/d;let z=Math.floor(O),I=O%1;!I&&O>=1&&(I=1),I===1&&z--,z=Math.min(z,g+1),!!(z%2)&&(b==="reverse"?(I=1-I,w&&(I-=w/d)):b==="mirror"&&(M=u)),k=Rr(0,1,I)*d}let D;C?(this.delayState.value=p[0],D=this.delayState):D=M.next(k),l&&!C&&(D.value=l(D.value));let{done:_}=D;!C&&f!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return N&&x!==kb&&(D.value=dp(p,this.options,T,this.speed)),S&&S(D.value),N&&this.finish(),D}then(t,s){return this.finished.then(t,s)}get duration(){return zs(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+zs(t)}get time(){return zs(this.currentTime)}set time(t){t=Ls(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return rq(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(Nn.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=zs(this.currentTime))}play(){var o,l;if(this.isStopped)return;const{driver:t=YF,startTime:s}=this.options;this.driver||(this.driver=t(u=>this.tick(u))),(l=(o=this.options).onPlay)==null||l.call(o);const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=s??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Nn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(t=this.options).onComplete)==null||s.call(t)}cancel(){var t,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(t=this.options).onCancel)==null||s.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),t.observe(this)}}const uq=new Set(["brightness","contrast","saturate","opacity"]);function dq(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=s.match(D0)||[];if(!i)return e;const o=s.replace(i,"");let l=uq.has(t)?1:0;return i!==s&&(l*=100),t+"("+l+o+")"}const fq=/\b([a-z-]*)\(.*?\)/gu,Mb={...ws,getAnimatableNone:e=>{const t=e.match(fq);return t?t.map(dq).join(" "):e}},Nb={...ws,getAnimatableNone:e=>{const t=ws.parse(e);return ws.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},kC={...Ec,transform:Math.round},hq={rotate:lr,pathRotation:lr,rotateX:lr,rotateY:lr,rotateZ:lr,scale:Nh,scaleX:Nh,scaleY:Nh,scaleZ:Nh,skew:lr,skewX:lr,skewY:lr,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:cd,originX:TC,originY:TC,originZ:Ie},Mm={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,inset:Ie,insetBlock:Ie,insetBlockStart:Ie,insetBlockEnd:Ie,insetInline:Ie,insetInlineStart:Ie,insetInlineEnd:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,paddingBlock:Ie,paddingBlockStart:Ie,paddingBlockEnd:Ie,paddingInline:Ie,paddingInlineStart:Ie,paddingInlineEnd:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,marginBlock:Ie,marginBlockStart:Ie,marginBlockEnd:Ie,marginInline:Ie,marginInlineStart:Ie,marginInlineEnd:Ie,fontSize:Ie,backgroundPositionX:Ie,backgroundPositionY:Ie,...hq,zIndex:kC,fillOpacity:cd,strokeOpacity:cd,numOctaves:kC},mq={...Mm,color:fn,backgroundColor:fn,outlineColor:fn,fill:fn,stroke:fn,borderColor:fn,borderTopColor:fn,borderRightColor:fn,borderBottomColor:fn,borderLeftColor:fn,filter:Mb,WebkitFilter:Mb,mask:Nb,WebkitMask:Nb},mO=e=>mq[e],pq=new Set([Mb,Nb]);function U0(e,t){let s=mO(e);return pq.has(s)||(s=ws),s.getAnimatableNone?s.getAnimatableNone(t):void 0}function gq(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const fa=e=>e*180/Math.PI,Ob=e=>{const t=fa(Math.atan2(e[1],e[0]));return jb(t)},yq={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ob,rotateZ:Ob,skewX:e=>fa(Math.atan(e[1])),skewY:e=>fa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},jb=e=>(e=e%360,e<0&&(e+=360),e),MC=Ob,NC=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),OC=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),vq={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:NC,scaleY:OC,scale:e=>(NC(e)+OC(e))/2,rotateX:e=>jb(fa(Math.atan2(e[6],e[5]))),rotateY:e=>jb(fa(Math.atan2(-e[2],e[0]))),rotateZ:MC,rotate:MC,skewX:e=>fa(Math.atan(e[4])),skewY:e=>fa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function dd(e){return e.includes("scale")?1:0}function Db(e,t){if(!e||e==="none")return dd(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(s)i=vq,o=s;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=yq,o=d}if(!o)return dd(t);const l=i[t],u=o[1].split(",").map(xq);return typeof l=="function"?l(u):u[l]}const bq=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return Db(s,t)};function xq(e){return parseFloat(e.trim())}const Cc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wo=new Set([...Cc,"pathRotation"]),jC=e=>e===Ec||e===Ie,wq=new Set(["x","y","z"]),Sq=Cc.filter(e=>!wq.has(e));function Tq(e){const t=[];return Sq.forEach(s=>{const i=e.getValue(s);if(i!==void 0){const o=i.get(),l=s.startsWith("scale")?1:0;if(o===l)return;t.push([s,o]),i.set(l)}}),t}const Rq=new Set(["bottom","right"]);function DC(e,t,s,i,o,l){const u=parseFloat(e);if(!isNaN(u))return u;const{min:d,max:f}=t()[s],h=f-d;return l==="border-box"?h:h-parseFloat(i)-parseFloat(o)}const Ta={width:({width:e,paddingLeft:t="0",paddingRight:s="0",boxSizing:i},o)=>DC(e,o,"x",t,s,i),height:({height:e,paddingTop:t="0",paddingBottom:s="0",boxSizing:i},o)=>DC(e,o,"y",t,s,i),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:s}=t();return parseFloat(e)+(s.max-s.min)},right:({left:e},t)=>{const{x:s}=t();return parseFloat(e)+(s.max-s.min)},x:({transform:e})=>Db(e,"x"),y:({transform:e})=>Db(e,"y")};Ta.translateX=Ta.x;Ta.translateY=Ta.y;const Ra=new Set;let _b=!1,Ib=!1,Pb=!1;function pO(){if(Ib){const e=[],t=new Set,s=new Set;Ra.forEach(o=>{o.needsMeasurement&&(e.push(o),t.add(o.element),Rq.has(o.name)&&s.add(o.element))});const i=new Map;s.forEach(o=>{const l=Tq(o);l.length&&(i.set(o,l),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();const l=i.get(o);l&&l.forEach(([u,d])=>{var f;(f=o.getValue(u))==null||f.set(d)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Ib=!1,_b=!1,Ra.forEach(e=>e.complete(Pb)),Ra.clear()}function gO(){Ra.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ib=!0)})}function Eq(){Pb=!0,gO(),pO(),Pb=!1}function Cq(e,t,s){if(typeof e=="string"){if(A0(e)||k0(e))return parseFloat(e);if(!ws.test(e)&&ws.test(s))return U0(t,s)}return e??void 0}class V0{constructor(t,s,i,o,l,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=i,this.motionValue=o,this.element=l,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(Ra.add(this),_b||(_b=!0,It.read(gO),It.resolveKeyframes(pO))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:i,motionValue:o}=this;if(t[0]===null){const l=o==null?void 0:o.get(),u=t[t.length-1];if(l!==void 0)t[0]=l;else if(i&&s){const d=Cq(i.readValue(s,u),s,u);d!==void 0&&(t[0]=d)}t[0]===void 0&&(t[0]=u),o&&l===void 0&&o.set(t[0])}gq(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ra.delete(this)}cancel(){this.state==="scheduled"&&(Ra.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Aq=e=>e.startsWith("--");function yO(e,t,s){Aq(t)?e.style.setProperty(t,s):e.style[t]=s}const kq={};function vO(e,t){const s=BN(e);return()=>kq[t]??s()}const Mq=vO(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),bO=vO(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_u=([e,t,s,i])=>`cubic-bezier(${e}, ${t}, ${s}, ${i})`,_C={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_u([0,.65,.55,1]),circOut:_u([.55,0,1,.45]),backIn:_u([.31,.01,.66,-.59]),backOut:_u([.33,1.53,.69,.99])};function xO(e,t){if(e)return typeof e=="function"?bO()?oO(e,t):"ease-out":QN(e)?_u(e):Array.isArray(e)?e.map(s=>xO(s,t)||_C.easeOut):_C[e]}function Nq(e,t,s,{delay:i=0,duration:o=300,repeat:l=0,repeatType:u="loop",ease:d="easeOut",times:f}={},h=void 0){const p={[t]:s};f&&(p.offset=f);const g=xO(d,o);Array.isArray(g)&&(p.easing=g);const b={delay:i,duration:o,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:l+1,direction:u==="reverse"?"alternate":"normal"};return h&&(b.pseudoElement=h),e.animate(p,b)}function wO(e){return typeof e=="function"&&"applyToOptions"in e}function Oq({type:e,...t}){return wO(e)&&bO()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class SO extends B0{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:i,keyframes:o,pseudoElement:l,allowFlatten:u=!1,finalKeyframe:d,onComplete:f}=t;this.isPseudoElement=!!l,this.allowFlatten=u,this.options=t,up(typeof t.type!="string");const h=Oq(t);this.animation=Nq(s,i,o,h,l),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const p=dp(o,this.options,d,this.speed);this.updateMotionValue&&this.updateMotionValue(p),yO(s,i,p),this.animation.cancel()}f==null||f(),this.notifyFinished()},hO(this,t,h)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,s;(s=(t=this.animation).finish)==null||s.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var s,i,o;const t=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(i=this.animation).commitStyles)==null||o.call(i))}get duration(){var s,i;const t=((i=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:i.call(s).duration)||0;return zs(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+zs(t)}get time(){return zs(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ls(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:s,observe:i,...o}){var l;return this.allowFlatten&&((l=this.animation.effect)==null||l.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Mq()?(this.animation.timeline=t,Object.assign(this.animation,o),s==null||s(this.animation),ni):i(this)}}const TO={anticipate:KN,backInOut:GN,circInOut:$N};function jq(e){return e in TO}function Dq(e){typeof e.ease=="string"&&jq(e.ease)&&(e.ease=TO[e.ease])}const Rv=10;class _q extends SO{constructor(t){Dq(t),dO(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:i,onComplete:o,element:l,...u}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const d=new km({...u,autoplay:!1}),f=Math.max(Rv,Nn.now()-this.startTime),h=Rr(0,Rv,f-Rv),p=d.sample(f).value,{name:g}=this.options;l&&g&&yO(l,g,p),s.setWithVelocity(d.sample(Math.max(0,f-h)).value,p,h),d.stop()}}const IC=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ws.test(e)||e==="0")&&!e.startsWith("url("));function Iq(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function Pq(e,t,s,i){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],u=IC(o,t),d=IC(l,t);return!u||!d?!1:Iq(e)||(s==="spring"||wO(s))&&i}function zb(e){e.duration=0,e.type="keyframes"}const Lb=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),zq=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Lq(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&zq.test(e[t]))return!0;return!1}const PC=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bq=BN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Uq(e){var g;const{motionValue:t,name:s,repeatDelay:i,repeatType:o,damping:l,type:u,keyframes:d}=e;if(!s||!(Lb.has(s)||PC.has(s)))return!1;const f=(g=t==null?void 0:t.owner)==null?void 0:g.current;if(!(f instanceof HTMLElement)&&!(f instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:p}=t.owner.getProps();return Bq()&&(Lb.has(s)||PC.has(s)&&Lq(d))&&(s!=="transform"||!p)&&!h&&!i&&o!=="mirror"&&l!==0&&u!=="inertia"}const Vq=40;class Fq extends B0{constructor(t){var f;super(),this.stop=()=>{var h,p;this._animation&&(this._animation.stop(),(h=this.stopTimeline)==null||h.call(this)),(p=this.keyframeResolver)==null||p.cancel()},this.createdAt=Nn.now();const{keyframes:s,name:i,motionValue:o,element:l}=t,u=t;u.autoplay??(u.autoplay=!0),u.delay??(u.delay=0),u.type??(u.type="keyframes"),u.repeat??(u.repeat=0),u.repeatDelay??(u.repeatDelay=0),u.repeatType??(u.repeatType="loop");const d=(l==null?void 0:l.KeyframeResolver)||V0;this.keyframeResolver=new d(s,(h,p,g)=>this.onKeyframesResolved(h,p,u,!g),i,o,l),(f=this.keyframeResolver)==null||f.scheduleResolve()}onKeyframesResolved(t,s,i,o){var T,A;this.keyframeResolver=void 0;const{name:l,type:u,velocity:d,delay:f,isHandoff:h,onUpdate:p}=i;this.resolvedAt=Nn.now();let g=!0;Pq(t,l,u,d)||(g=!1,(br.instantAnimations||!f)&&(p==null||p(dp(t,i,s))),t[0]=t[t.length-1],zb(i),i.repeat=0);const b=o?this.resolvedAt?this.resolvedAt-this.createdAt>Vq?this.resolvedAt:this.createdAt:this.createdAt:void 0,{onComplete:w}=i;i.startTime??(i.startTime=b),i.finalKeyframe=s,i.keyframes=t,i.onComplete=()=>{w==null||w(),this.notifyFinished()};const x=g&&!h&&Uq(i);let S;if(x){i.element=(A=(T=i.motionValue)==null?void 0:T.owner)==null?void 0:A.current;try{S=new _q(i)}catch{S=new km(i)}}else S=new km(i);this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this._animation.finished:super.finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Eq()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function RO(e,t,s,i=0,o=1){const l=Array.from(e).sort((h,p)=>h.sortNodePosition(p)).indexOf(t),u=e.size,d=(u-1)*i;return typeof s=="function"?s(l,u):o===1?l*i:d-l*i}const zC=30,qq=e=>!isNaN(parseFloat(e)),Uu={current:void 0};class Hq{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const o=Nn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=Nn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=qq(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){var i;return t==="change"?this.onChangeSubscribe(s):((i=this.events)[t]||(i[t]=new Em)).add(s)}onChangeSubscribe(t){const{events:s}=this;return!s.change&&!this.changeSubscriber?this.changeSubscriber=t:(s.change||(s.change=new Em,s.change.add(this.changeSubscriber),this.changeSubscriber=void 0),s.change.add(t)),()=>{var i;this.changeSubscriber===t?this.changeSubscriber=void 0:(i=s.change)==null||i.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){It.read(()=>{var t;!this.changeSubscriber&&!((t=this.events.change)!=null&&t.getSize())&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,i){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){var i;const{current:t,changeSubscriber:s}=this;s?s(t):(i=this.events.change)==null||i.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Uu.current&&Uu.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Nn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>zC)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,zC);return UN(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{var l;this.hasAnimated=!0;let i=!1,o;o=t(()=>{var u;i=!0,(u=this.events.animationComplete)==null||u.notify(),this.animation===o&&this.clearAnimation(),s()}),i||(this.animation=o),(l=this.events.animationStart)==null||l.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){var t,s;(t=this.dependents)==null||t.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Da(e,t){return new Hq(e,t)}function EO(e,t){if(e!=null&&e.inherit&&t){const{inherit:s,...i}=e;return{...t,...i}}return e}function F0(e,t){const s=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return s!==e?EO(s,e):s}const Gq={type:"spring",stiffness:500,damping:25,restSpeed:10},Kq=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Yq={type:"keyframes",duration:.8},$q={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Qq=(e,{keyframes:t})=>t.length>2?Yq:wo.has(e)?e.startsWith("scale")?Kq(t[1]):Gq:$q,Xq=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Zq(e){for(const t in e)if(!Xq.has(t))return!0;return!1}const q0=(e,t,s,i={},o,l)=>u=>{const d=F0(i,e)||{},f=d.delay||i.delay||0;let{elapsed:h=0}=i;h=h-Ls(f);const p={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-h,onUpdate:b=>{t.set(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{u(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:l?void 0:o};Zq(d)||Object.assign(p,Qq(e,p)),p.duration&&(p.duration=Ls(p.duration)),p.repeatDelay&&(p.repeatDelay=Ls(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let g=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(zb(p),p.delay===0&&(g=!0)),(br.instantAnimations||br.skipAnimations||o!=null&&o.shouldSkipAnimations||d.skipAnimations)&&(g=!0,zb(p),p.delay=0),p.allowFlatten=!d.type&&!d.ease,g&&!l&&t.get()!==void 0){const b=dp(p.keyframes,d);if(b!==void 0){It.update(()=>{p.onUpdate(b),p.onComplete()});return}}return d.isSync?new km(p):new Fq(p)},Wq=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jq(e){const t=Wq.exec(e);if(!t)return[,];const[,s,i,o]=t;return[`--${s??i}`,o]}function CO(e,t,s=1){const[i,o]=Jq(e);if(!i)return;const l=window.getComputedStyle(t).getPropertyValue(i);if(l){const u=l.trim();return A0(u)?parseFloat(u):u}return j0(o)?CO(o,t,s+1):o}function eH(e){const t=[{},{}];return e==null||e.values.forEach((s,i)=>{t[0][i]=s.get(),t[1][i]=s.getVelocity()}),t}function AO(e,t,s,i){const o=l=>typeof l=="function"?l(s!==void 0?s:e.custom,...eH(i)):l;return t=o(t),typeof t=="string"&&(t=e.variants&&e.variants[t]),o(t)}function Ea(e,t,s){return AO(e.getProps(),t,s,e)}const kO=(e,t)=>{var s;return t==="exit"?(s=e.presenceContext)==null?void 0:s.custom:void 0},MO=new Set(["width","height","top","left","right","bottom",...Cc]),tH=e=>Array.isArray(e);function nH(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Da(s))}function sH(e){return tH(e)?e[e.length-1]||0:e}function iH(e,t){const s=Ea(e,t);let{transitionEnd:i={},transition:o={},...l}=s||{};l={...l,...i};for(const u in l){const d=sH(l[u]);nH(e,u,d)}}const jn=e=>!!(e&&e.getVelocity);function rH(e){return!!(jn(e)&&e.add)}function Bb(e,t){const s=e.getValue("willChange");if(rH(s))return s.add(t);if(!s&&br.WillChange){const i=new br.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function H0(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const oH="framerAppearId",NO="data-"+H0(oH);function OO(e){return e.props[NO]}const aH=typeof window<"u";function lH({protectedKeys:e,needsAnimating:t},s){const i=s in e&&!t[s];return t[s]=!1,i}function jO(e,t,{delay:s=0,transitionOverride:i,type:o}={}){var x;let{transition:l,transitionEnd:u,...d}=t;const f=e.getDefaultTransition();l=l?EO(l,f):f;const h=l==null?void 0:l.reduceMotion,p=l==null?void 0:l.skipAnimations;i&&(l=i);const g=[],b=o&&((x=e.animationState)==null?void 0:x.getState()[o]),w=l==null?void 0:l.path;w&&w.animateVisualElement(e,d,l,s,g);for(const S in d){const T=e.getValue(S,e.latestValues[S]??null),A=d[S];if(A===void 0||b&&lH(b,S))continue;const C={delay:s,...F0(l||{},S)};p&&(C.skipAnimations=!0);const k=T.get();if(k!==void 0&&!T.isAnimating()&&!Array.isArray(A)&&A===k&&!C.velocity){It.update(()=>T.set(A));continue}let M=!1;if(aH&&window.MotionHandoffAnimation){const N=OO(e);if(N){const O=window.MotionHandoffAnimation(N,S,It);O!==null&&(C.startTime=O,M=!0)}}Bb(e,S);const D=h??e.shouldReduceMotion;T.start(q0(S,T,A,D&&MO.has(S)?{type:!1}:C,e,M));const _=T.animation;_&&g.push(_)}if(u){const S=()=>It.update(()=>{u&&iH(e,u)});g.length?Promise.all(g).then(S):S()}return g}function Ub(e,t,s={}){const i=Ea(e,t,kO(e,s.type)),o=s.transitionOverride||((i==null?void 0:i.transition)??(e.getDefaultTransition()||{})),l=()=>Promise.all(i?jO(e,i,s):[]),u=(f=0)=>{const{variantChildren:h}=e,{delayChildren:p=0,staggerChildren:g,staggerDirection:b}=o,w=[];return h==null||h.forEach(x=>{x.notify("AnimationStart",t),w.push(Ub(x,t,{...s,delay:f+(typeof p=="function"?0:p)+RO(h,x,p,g,b)}).then(()=>x.notify("AnimationComplete",t)))}),Promise.all(w)},{when:d}=o;return d?d==="beforeChildren"?l().then(()=>u()):u().then(l):Promise.all([l(),u(s.delay)])}function cH(e,t,s={}){return e.notify("AnimationStart",t),(Array.isArray(t)?Promise.all(t.map(o=>Ub(e,o,s))):typeof t=="string"?Ub(e,t,s):Promise.all(jO(e,Ea(e,t,s.custom),s))).then(()=>{e.notify("AnimationComplete",t)})}const uH={test:e=>e==="auto",parse:e=>e},dH=e=>t=>t.test(e),fH=[Ec,Ie,Pi,lr,RF,TF,uH],LC=e=>fH.find(dH(e));function hH(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||k0(e):!0}const mH=new Set(["auto","none","0"]);function pH(e,t,s){let i=0,o;for(;i<e.length&&!o;){const l=e[i];typeof l=="string"&&!mH.has(l)&&NF(l)&&(o=e[i]),i++}if(o&&s)for(const l of t)e[l]!==o&&(e[l]=U0(s,o))}class gH extends V0{constructor(t,s,i,o,l){super(t,s,i,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:i}=this;if(!s||!s.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let g=t[p];if(typeof g=="string"&&(g=g.trim(),j0(g))){const b=CO(g,s.current);b!==void 0&&(t[p]=b),p===t.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!MO.has(i)||t.length!==2)return;const[o,l]=t;if(typeof o=="number"&&typeof l=="number")return;const u=LC(o),d=LC(l),f=SC(o),h=SC(l);if(f!==h&&Ta[i]){this.needsMeasurement=!0;return}if(u!==d)if(jC(u)&&jC(d))for(let p=0;p<t.length;p++){const g=t[p];typeof g=="string"&&(t[p]=parseFloat(g))}else Ta[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,i=[];for(let o=0;o<t.length;o++)(t[o]===null||hH(t[o]))&&i.push(o);i.length&&pH(t,i,s)}measure(){const{element:t,name:s}=this;return Ta[s](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){var l;const{element:t,unresolvedKeyframes:s,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),s[0]=this.measuredOrigin;const o=s[s.length-1];o!==void 0&&((l=this.motionValue)==null||l.jump(o,!1))}measureEndState(){var l,u;const{element:t,unresolvedKeyframes:s}=this;if(!t||!t.current)return;(l=this.motionValue)==null||l.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=this.measure(),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([d,f])=>{t.getValue(d).set(f)}),this.resolveNoneKeyframes()}}const G0=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function yH(e){return LN(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function K0(e){return LN(e)&&"ownerSVGElement"in e}const Vb=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function DO(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const o=(s==null?void 0:s[e])??i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(i=>i!=null)}const vH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bH=Cc.length;function xH(e,t,s){let i="",o=!0;for(let u=0;u<bH;u++){const d=Cc[u],f=e[d];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(d.startsWith("scale")?1:0);else{const p=parseFloat(f);h=d.startsWith("scale")?p===1:p===0}if(!h||s){const p=Vb(f,Mm[d]);if(!h){o=!1;const g=vH[d]||d;i+=`${g}(${p}) `}s&&(t[d]=p)}}const l=e.pathRotation;return l&&(o=!1,i+=`rotate(${Vb(l,Mm.pathRotation)}) `),i=i.trim(),s?i=s(t,o?"":i):o&&(i="none"),i}function Y0(e,t,s){const{style:i,vars:o,transformOrigin:l}=e;let u=!1,d=!1;for(const f in t){const h=t[f];if(wo.has(f)){u=!0;continue}else if(ZN(f)){o[f]=h;continue}else{const p=Vb(h,Mm[f]);f.startsWith("origin")?(d=!0,l[f]=p):i[f]=p}}if(t.transform||(u||s?i.transform=xH(t,e.transform,s):i.transform&&(i.transform="none")),d){const{originX:f="50%",originY:h="50%",originZ:p=0}=l;i.transformOrigin=`${f} ${h} ${p}`}}const wH={offset:"stroke-dashoffset",array:"stroke-dasharray"},SH={offset:"strokeDashoffset",array:"strokeDasharray"};function TH(e,t,s=1,i=0,o=!0){e.pathLength=1;const l=o?wH:SH;e[l.offset]=`${-i}`,e[l.array]=`${t} ${s}`}const _O=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function IO(e,{attrX:t,attrY:s,attrScale:i,pathLength:o,pathSpacing:l=1,pathOffset:u=0,...d},f,h,p){if(Y0(e,d,h),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:b}=e;for(const w of _O)g[w]!==void 0&&(b[w]=g[w],delete g[w]);(b.transform||g.transformOrigin)&&(b.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),b.transform&&(b.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),s!==void 0&&(g.y=s),i!==void 0&&(g.scale=i),o!==void 0&&TH(g,o,l,u,!1)}function PO({top:e,left:t,right:s,bottom:i}){return{x:{min:t,max:s},y:{min:e,max:i}}}function RH({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function EH(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}function Ev(e){return e===void 0||e===1}function Fb({scale:e,scaleX:t,scaleY:s}){return!Ev(e)||!Ev(t)||!Ev(s)}function la(e){return Fb(e)||zO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zO(e){return BC(e.x)||BC(e.y)}function BC(e){return e&&e!=="0%"}function Nm(e,t,s){const i=e-s,o=t*i;return s+o}function UC(e,t,s,i,o){return o!==void 0&&(e=Nm(e,o,i)),Nm(e,s,i)+t}function qb(e,t=0,s=1,i,o){e.min=UC(e.min,t,s,i,o),e.max=UC(e.max,t,s,i,o)}function LO(e,{x:t,y:s}){qb(e.x,t.translate,t.scale,t.originPoint),qb(e.y,s.translate,s.scale,s.originPoint)}const VC=.999999999999,FC=1.0000000000001;function CH(e,t,s,i=!1){var d;const o=s.length;if(!o)return;t.x=t.y=1;let l,u;for(let f=0;f<o;f++){l=s[f],u=l.projectionDelta;const{visualElement:h}=l.options;h&&h.props.style&&h.props.style.display==="contents"||(i&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(ki(e.x,-l.scroll.offset.x),ki(e.y,-l.scroll.offset.y)),u&&(t.x*=u.x.scale,t.y*=u.y.scale,LO(e,u)),i&&la(l.latestValues)&&Yh(e,l.latestValues,(d=l.layout)==null?void 0:d.layoutBox))}t.x<FC&&t.x>VC&&(t.x=1),t.y<FC&&t.y>VC&&(t.y=1)}function ki(e,t){e.min+=t,e.max+=t}function qC(e,t,s,i,o=.5){const l=Dt(e.min,e.max,o);qb(e,t,s,l,i)}function HC(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Yh(e,t,s){const i=s??e;qC(e.x,HC(t.x,i.x),t.scaleX,t.scale,t.originX),qC(e.y,HC(t.y,i.y),t.scaleY,t.scale,t.originY)}function BO(e,t){return PO(EH(e.getBoundingClientRect(),t))}function AH(e,t,s){const i=BO(e,s),{scroll:o}=t;return o&&(ki(i.x,o.offset.x),ki(i.y,o.offset.y)),i}const{schedule:$0}=rO(queueMicrotask,!1),Ws={x:!1,y:!1};function UO(){return Ws.x||Ws.y}function kH(e){return e==="x"||e==="y"?Ws[e]?null:(Ws[e]=!0,()=>{Ws[e]=!1}):Ws.x||Ws.y?null:(Ws.x=Ws.y=!0,()=>{Ws.x=Ws.y=!1})}function VO(e,t){const s=DO(e),i=new AbortController,o={passive:!0,...t,signal:i.signal};return[s,o,()=>i.abort()]}function MH(e){return!(e.pointerType==="touch"||UO())}function NH(e,t,s={}){const[i,o,l]=VO(e,s);return i.forEach(u=>{let d=!1,f=!1,h;const p=()=>{u.removeEventListener("pointerleave",x)},g=T=>{h&&(h(T),h=void 0),p()},b=T=>{d=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),f&&(f=!1,g(T))},w=()=>{d=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},x=T=>{if(T.pointerType!=="touch"){if(d){f=!0;return}g(T)}},S=T=>{if(!MH(T))return;f=!1;const A=t(u,T);typeof A=="function"&&(h=A,u.addEventListener("pointerleave",x,o))};u.addEventListener("pointerenter",S,o),u.addEventListener("pointerdown",w,o)}),l}const FO=(e,t)=>t?e===t?!0:FO(e,t.parentElement):!1,Q0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,OH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function jH(e){return OH.has(e.tagName)||e.isContentEditable===!0}const DH=new Set(["INPUT","SELECT","TEXTAREA"]);function _H(e){return DH.has(e.tagName)||e.isContentEditable===!0}const $h=new WeakSet;function GC(e){return t=>{t.key==="Enter"&&e(t)}}function Cv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const IH=(e,t)=>{const s=e.currentTarget;if(!s)return;const i=GC(()=>{if($h.has(s))return;Cv(s,"down");const o=GC(()=>{Cv(s,"up")}),l=()=>Cv(s,"cancel");s.addEventListener("keyup",o,t),s.addEventListener("blur",l,t)});s.addEventListener("keydown",i,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),t)};function KC(e){return Q0(e)&&!UO()}const YC=new WeakSet;function PH(e,t,s={}){const[i,o,l]=VO(e,s),u=d=>{const f=d.currentTarget;if(!KC(d)||YC.has(d))return;$h.add(f),s.stopPropagation&&YC.add(d);const h=t(f,d),p={...o,capture:!0},g=(x,S)=>{window.removeEventListener("pointerup",b,p),window.removeEventListener("pointercancel",w,p),$h.has(f)&&$h.delete(f),KC(x)&&typeof h=="function"&&h(x,{success:S})},b=x=>{g(x,f===window||f===document||s.useGlobalTarget||FO(f,x.target))},w=x=>{g(x,!1)};window.addEventListener("pointerup",b,p),window.addEventListener("pointercancel",w,p)};return i.forEach(d=>{(s.useGlobalTarget?window:d).addEventListener("pointerdown",u,o),yH(d)&&(d.addEventListener("focus",h=>IH(h,o)),!jH(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),l}const Qh=new WeakMap;let so;const qO=(e,t,s)=>(i,o)=>o&&o[0]?o[0][e+"Size"]:K0(i)&&"getBBox"in i?i.getBBox()[t]:i[s],zH=qO("inline","width","offsetWidth"),LH=qO("block","height","offsetHeight");function BH({target:e,borderBoxSize:t}){var s;(s=Qh.get(e))==null||s.forEach(i=>{i(e,{get width(){return zH(e,t)},get height(){return LH(e,t)}})})}function UH(e){e.forEach(BH)}function VH(){typeof ResizeObserver>"u"||(so=new ResizeObserver(UH))}function FH(e,t){so||VH();const s=DO(e);return s.forEach(i=>{let o=Qh.get(i);o||(o=new Set,Qh.set(i,o)),o.add(t),so==null||so.observe(i)}),()=>{s.forEach(i=>{const o=Qh.get(i);o==null||o.delete(t),o!=null&&o.size||so==null||so.unobserve(i)})}}const Xh=new Set;let ql;function qH(){ql=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xh.forEach(t=>t(e))},window.addEventListener("resize",ql)}function HH(e){return Xh.add(e),ql||qH(),()=>{Xh.delete(e),!Xh.size&&typeof ql=="function"&&(window.removeEventListener("resize",ql),ql=void 0)}}function $C(e,t){return typeof e=="function"?HH(e):FH(e,t)}function GH(e){return K0(e)&&e.tagName==="svg"}function KH(...e){const t=!Array.isArray(e[0]),s=t?0:-1,i=e[0+s],o=e[1+s],l=e[2+s],u=e[3+s],d=uO(o,l,u);return t?d(i):d}const QC=e=>typeof e=="number"?e:parseFloat(e),XC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Hl=()=>({x:XC(),y:XC()}),ZC=()=>({min:0,max:0}),un=()=>({x:ZC(),y:ZC()}),YH=new WeakMap;function fp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function fd(e){return typeof e=="string"||Array.isArray(e)}const X0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],WC=["initial",...X0];function hp(e){if(fp(e.animate))return!0;for(let t=0;t<WC.length;t++)if(fd(e[WC[t]]))return!0;return!1}function HO(e){return!!(hp(e)||e.variants)}function $H(e,t,s){for(const i in t){const o=t[i],l=s[i];if(jn(o))e.addValue(i,o);else if(jn(l))e.addValue(i,Da(o,{owner:e}));else if(l!==o)if(e.hasValue(i)){const u=e.getValue(i);u.liveStyle===!0?u.jump(o):u.hasAnimated||u.set(o)}else{const u=e.getStaticValue(i);e.addValue(i,Da(u!==void 0?u:o,{owner:e}))}}for(const i in s)t[i]===void 0&&e.removeValue(i);return t}const Om={current:null},Z0={current:!1},QH=typeof window<"u";function GO(){if(Z0.current=!0,!!QH)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Om.current=e.matches;e.addEventListener("change",t),t()}else Om.current=!1}const JC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let jm={};function KO(e){jm=e}function XH(){return jm}class ZH{scrapeMotionValuesFromProps(t,s,i){return{}}constructor({parent:t,props:s,presenceContext:i,reducedMotionConfig:o,skipAnimations:l,blockInitialAnimation:u,visualState:d},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=V0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const w=Nn.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,It.render(this.render,!1,!0))};const{latestValues:h,renderState:p}=d;this.latestValues=h,this.baseTarget={...h},this.initialValues=s.initial?{...h}:{},this.renderState=p,this.parent=t,this.props=s,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=l,this.options=f,this.blockInitialAnimation=!!u,this.isControllingVariants=hp(s),this.isVariantNode=HO(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...b}=this.scrapeMotionValuesFromProps(s,{},this);for(const w in b){const x=b[w];h[w]!==void 0&&jn(x)&&x.set(h[w])}}mount(t){var s,i;if(this.hasBeenMounted)for(const o in this.initialValues)(s=this.values.get(o))==null||s.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];if(this.current=t,YH.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.isVariantNode&&!this.isControllingVariants){let o=this;do o=o.props.inherit!==!1&&o.parent;while(o&&!o.isVariantNode);if(o){const{variantChildren:l}=o;l.add(this),this.removeFromVariantTree=()=>l.delete(this)}}this.values.forEach((o,l)=>this.bindToMotionValue(l,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Z0.current||GO(),this.shouldReduceMotion=Om.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),xr(this.notifyUpdate),xr(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const i=this.features[s];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&Lb.has(t)&&this.current instanceof HTMLElement){const{factory:u,keyframes:d,times:f,ease:h,duration:p}=s.accelerate,g=new SO({element:this.current,name:t,keyframes:d,times:f,ease:h,duration:Ls(p)}),b=u(g);this.valueSubscriptions.set(t,()=>{b(),g.cancel()});return}const i=wo.has(t);i&&this.onBindTransform&&this.onBindTransform();const o=s.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&It.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{o(),l&&l()})}sortNodePosition(t){return!this.current||!t.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in jm){const s=jm[t];if(!s)continue;const{isEnabled:i,Feature:o}=s;if(!this.features[t]&&o&&i(this.props)&&(this.features[t]=new o(this)),this.features[t]){const l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):un()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let i=0;i<JC.length;i++){const o=JC[i];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const l="on"+o,u=t[l];u&&(this.propEventSubscriptions[o]=this.on(o,u))}this.prevMotionValues=$H(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,s){const i=this.values.get(t);if(s!==i){i&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s);const o=s.get();o!==void 0&&(this.latestValues[t]=o)}}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){var o;if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&s!==void 0&&(i=Da(s??((o=this.getDefaultValue)==null?void 0:o.call(this,t)),{owner:this}),this.addValue(t,i)),i}readValue(t,s){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(A0(i)||k0(i))?i=parseFloat(i):typeof i!="number"&&!ws.test(i)&&ws.test(s)&&(i=U0(t,s)),this.setBaseTarget(t,jn(i)?i.get():i)),jn(i)?i.get():i}setBaseTarget(t,s){this.baseTarget[t]=s}on(t,s){return this.events[t]||(this.events[t]=new Em),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){$0.render(this.render)}}class YO extends ZH{constructor(){super(...arguments),this.KeyframeResolver=gH}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const i=t.style;return i?i[s]:void 0}removeValueFromRenderState(t,{vars:s,style:i}){delete s[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;jn(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Oo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function $O(e,{style:t,vars:s},i,o){const l=e.style;let u;for(u in t)l[u]=t[u];o==null||o.applyProjectionStyles(l,i);for(u in s)l.setProperty(u,s[u])}const hd={};function QO(e,{layout:t,layoutId:s}){return wo.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!hd[e]||e==="opacity")}function W0(e,t,s){var u;const i=e.style,o=t==null?void 0:t.style,l={};if(!i)return l;for(const d in i)(jn(i[d])||o&&jn(o[d])||QO(d,e)||((u=s==null?void 0:s.getValue(d))==null?void 0:u.liveStyle)!==void 0)&&(l[d]=i[d]);return l}function WH(e){return window.getComputedStyle(e)}class JH extends YO{constructor(){super(...arguments),this.type="html",this.renderInstance=$O}mount(t){up(!!t.style),super.mount(t)}readValueFromInstance(t,s){var i;if(wo.has(s))return(i=this.projection)!=null&&i.isProjecting?dd(s):bq(t,s);{const o=WH(t),l=(ZN(s)?o.getPropertyValue(s):o[s])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(t,{transformPagePoint:s}){return BO(t,s)}build(t,s,i){Y0(t,s,i.transformTemplate)}scrapeMotionValuesFromProps(t,s,i){return W0(t,s,i)}}const XO=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ZO=e=>typeof e=="string"&&e.toLowerCase()==="svg";function e8(e,t,s,i){$O(e,t,void 0,i);for(const o in t.attrs)e.setAttribute(XO.has(o)?o:H0(o),t.attrs[o])}function WO(e,t,s){const i=W0(e,t,s);for(const o in e)if(jn(e[o])||jn(t[o])){const l=Cc.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;i[l]=e[o]}return i}class t8 extends YO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=un}getBaseTargetFromProps(t,s){return wo.has(s)?super.getBaseTargetFromProps(t,s)??dd(s):t[s]}getDefaultValue(t){return wo.has(t)?this.latestValues[t]??dd(t):void 0}readValueFromInstance(t,s){if(wo.has(s)){const i=mO(s);return i&&i.default||0}if(_O.includes(s)){const o=getComputedStyle(t)[s];if(typeof o=="string"&&o)return o.trim()}return s=XO.has(s)?s:H0(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,i){return WO(t,s,i)}build(t,s,i){IO(t,s,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,s,i,o){e8(t,s,i,o)}mount(t){this.isSVGTag=ZO(t.tagName),super.mount(t)}}function JO(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let i=0;i<s;i++)if(t[i]!==e[i])return!1;return!0}const n8=[...X0].reverse();function s8(e){let t=d=>Promise.all(d.map(({animation:f,options:h})=>cH(e,f,h))),s=eA(),i=!0,o=!1;function l(d){var C;const{props:f,parent:h,manuallyAnimateOnMount:p}=e,g=i||o,b=[],w=new Set;let x={},S=1/0,T=e;do T=T.props.inherit!==!1&&T.parent;while(T&&!T.isControllingVariants);if(n8.forEach((k,M)=>{var Q,ae;const D=s[k],_=f[k],N=T&&T.props[k],O=_!==void 0?_:fd(N)||N===!1?N:void 0,z=fd(O),I=k===d?D.isActive:null;I===!1&&(S=M);const V=z&&_===void 0&&!(g&&p);if(D.protectedKeys={...x},!D.isActive&&I===null||!O&&!D.prevProp||fp(O)||typeof O=="boolean")return;if(k==="exit"&&D.isActive&&I!==!0){x={...x,...D.prevResolvedValues};return}const $=i8(D.prevProp,O);let X=$||z&&(I&&!V||M>S),B=!1;const q=Array.isArray(O)?O:[O];let F={};if(I!==!1)for(const ne of q){const{transition:pe,transitionEnd:ee,...ve}=Ea(e,ne,kO(e,k))||{};F={...F,...ve,...ee}}const{prevResolvedValues:ie}=D;for(const ne in{...ie,...F}){if(ne in x)continue;const pe=F[ne],ee=ie[ne],ve=Array.isArray(pe)&&Array.isArray(ee)?!JO(pe,ee)||$:pe!==ee;if(ve&&pe==null)w.add(ne);else if(ve||pe!==void 0&&w.has(ne)){X=!0,w.delete(ne)&&(B=!0),D.needsAnimating[ne]=!0;const P=e.getValue(ne);P&&(P.liveStyle=!1)}else D.protectedKeys[ne]=!0}if(D.prevProp=O,D.prevResolvedValues=F,D.isActive&&(x={...x,...F}),X&&(!(V&&$)||B))for(const ne of q){const pe={type:k};if(typeof ne=="string"&&g&&p&&(h!=null&&h.enteringChildren)){const ee=(ae=(Q=Ea(h,ne))==null?void 0:Q.transition)==null?void 0:ae.delayChildren;pe.delay=RO(h.enteringChildren,e,ee)}b.push({animation:ne,options:pe})}}),w.size){const{initial:k}=f,M={},D=typeof k!="boolean"&&Ea(e,Array.isArray(k)?k[0]:k,(C=e.presenceContext)==null?void 0:C.custom);D&&D.transition&&(M.transition=D.transition),w.forEach(_=>{const N=e.getValue(_);N&&(N.liveStyle=!0);const O=D&&!Array.isArray(k)?D[_]:void 0,z=e.getBaseTargetFromProps(f,_);M[_]=(O!==void 0?O:z!==void 0&&!jn(z)?z:e.initialValues[_]===void 0?e.baseTarget[_]:void 0)??null}),b.push({animation:M})}const A=g&&e.blockInitialAnimation||i&&!p&&(f.initial===!1||f.initial===f.animate);return i=o=!1,!A&&b.length?t(b):Promise.resolve()}function u(d,f){var p;if(s[d].isActive===f)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(g=>{var b;return(b=g.animationState)==null?void 0:b.setActive(d,f)}),s[d].isActive=f;const h=l(d);for(const g in s)s[g].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:d=>{t=d(e)},getState:()=>s,reset:()=>{s=eA(),o=!0}}}function i8(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!JO(t,e):!1}function eA(){const e={};for(const t of X0)e[t]={isActive:t==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function Hb(e,t){e.min=t.min,e.max=t.max}function Xs(e,t){Hb(e.x,t.x),Hb(e.y,t.y)}function tA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const ej=1e-4,r8=1-ej,o8=1+ej,tj=.01,a8=0-tj,l8=0+tj;function Zn(e){return e.max-e.min}function c8(e,t,s){return Math.abs(e-t)<=s}function nA(e,t,s,i=.5){e.origin=i,e.originPoint=Dt(t.min,t.max,e.origin),e.scale=Zn(s)/Zn(t),e.translate=Dt(s.min,s.max,e.origin)-e.originPoint,(e.scale>=r8&&e.scale<=o8||isNaN(e.scale))&&(e.scale=1),(e.translate>=a8&&e.translate<=l8||isNaN(e.translate))&&(e.translate=0)}function Vu(e,t,s,i){nA(e.x,t.x,s.x,i?i.originX:void 0),nA(e.y,t.y,s.y,i?i.originY:void 0)}function sA(e,t,s,i=0){const o=i?Dt(s.min,s.max,i):s.min;e.min=o+t.min,e.max=e.min+Zn(t)}function u8(e,t,s,i){sA(e.x,t.x,s.x,i==null?void 0:i.x),sA(e.y,t.y,s.y,i==null?void 0:i.y)}function iA(e,t,s,i=0){const o=i?Dt(s.min,s.max,i):s.min;e.min=t.min-o,e.max=e.min+Zn(t)}function Dm(e,t,s,i){iA(e.x,t.x,s.x,i==null?void 0:i.x),iA(e.y,t.y,s.y,i==null?void 0:i.y)}function rA(e,t,s,i,o){return e-=t,e=Nm(e,1/s,i),o!==void 0&&(e=Nm(e,1/o,i)),e}function d8(e,t=0,s=1,i=.5,o,l=e,u=e){if(Pi.test(t)&&(t=parseFloat(t),t=Dt(u.min,u.max,t/100)-u.min),typeof t!="number")return;let d=Dt(l.min,l.max,i);e===l&&(d-=t),e.min=rA(e.min,t,s,d,o),e.max=rA(e.max,t,s,d,o)}function oA(e,t,[s,i,o],l,u){d8(e,t[s],t[i],t[o],t.scale,l,u)}const f8=["x","scaleX","originX"],h8=["y","scaleY","originY"];function aA(e,t,s,i){oA(e.x,t,f8,s?s.x:void 0,i?i.x:void 0),oA(e.y,t,h8,s?s.y:void 0,i?i.y:void 0)}function lA(e){return e.translate===0&&e.scale===1}function nj(e){return lA(e.x)&&lA(e.y)}function cA(e,t){return e.min===t.min&&e.max===t.max}function m8(e,t){return cA(e.x,t.x)&&cA(e.y,t.y)}function uA(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sj(e,t){return uA(e.x,t.x)&&uA(e.y,t.y)}function dA(e){return Zn(e.x)/Zn(e.y)}function fA(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Si(e){return[e("x"),e("y")]}function hA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Mu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ie.test(e))e=parseFloat(e);else return e;const s=hA(e,t.target.x),i=hA(e,t.target.y);return`${s}% ${i}%`}},p8={correct:(e,{treeScale:t,projectionDelta:s})=>{const i=e,o=ws.parse(e);if(o.length>5)return i;const l=ws.createTransformer(e),u=typeof o[0]!="number"?1:0,d=s.x.scale*t.x,f=s.y.scale*t.y;o[0+u]/=d,o[1+u]/=f;const h=Dt(d,f,.5);return typeof o[2+u]=="number"&&(o[2+u]/=h),typeof o[3+u]=="number"&&(o[3+u]/=h),l(o)}};function g8(e,t,s){let i="";const o=e.x.translate/t.x,l=e.y.translate/t.y,u=(s==null?void 0:s.z)||0;if((o||l||u)&&(i=`translate3d(${o}px, ${l}px, ${u}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:h,rotate:p,pathRotation:g,rotateX:b,rotateY:w,skewX:x,skewY:S}=s;h&&(i=`perspective(${h}px) ${i}`),p&&(i+=`rotate(${p}deg) `),g&&(i+=`rotate(${g}deg) `),b&&(i+=`rotateX(${b}deg) `),w&&(i+=`rotateY(${w}deg) `),x&&(i+=`skewX(${x}deg) `),S&&(i+=`skewY(${S}deg) `)}const d=e.x.scale*t.x,f=e.y.scale*t.y;return(d!==1||f!==1)&&(i+=`scale(${d}, ${f})`),i||"none"}const y8=G0.length,mA=e=>typeof e=="number"||Ie.test(e);function v8(e,t,s,i,o,l){o?(e.opacity=Dt(0,s.opacity??1,b8(i)),e.opacityExit=Dt(t.opacity??1,0,x8(i))):l&&(e.opacity=Dt(t.opacity??1,s.opacity??1,i));for(let u=0;u<y8;u++){const d=G0[u];let f=pA(t,d),h=pA(s,d);if(f===void 0&&h===void 0)continue;f||(f=0),h||(h=0),f===0||h===0||mA(f)===mA(h)?(e[d]=Math.max(Dt(QC(f),QC(h),i),0),(Pi.test(h)||Pi.test(f))&&(e[d]+="%")):e[d]=h}(t.rotate||s.rotate)&&(e.rotate=Dt(t.rotate||0,s.rotate||0,i))}function pA(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const b8=ij(0,.5,YN),x8=ij(.5,.95,ni);function ij(e,t,s){return i=>i<e?0:i>t?1:s(ld(e,t,i))}function w8(e,t,s){const i=jn(e)?e:Da(e);return i.start(q0("",i,t,s)),i.animation}function md(e,t,s,i={passive:!0}){return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s,i)}const S8=(e,t)=>e.depth-t.depth;class T8{constructor(){this.children=[],this.isDirty=!1}add(t){C0(this.children,t),this.isDirty=!0}remove(t){Rm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(S8),this.isDirty=!1,this.children.forEach(t)}}function R8(e,t){const s=Nn.now(),i=({timestamp:o})=>{const l=o-s;l>=t&&(xr(i),e(l-t))};return It.setup(i,!0),()=>xr(i)}function Zh(e){return jn(e)?e.get():e}class E8{constructor(){this.members=[]}add(t){C0(this.members,t);for(let s=this.members.length-1;s>=0;s--){const i=this.members[s];if(i===t||i===this.lead||i===this.prevLead)continue;const o=i.instance;(!o||o.isConnected===!1)&&!i.snapshot&&(Rm(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(Rm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){var s;for(let i=this.members.indexOf(t)-1;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1&&((s=o.instance)==null?void 0:s.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,s){var o;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:l}=i.options,{layoutDependency:u}=t.options;(l===void 0||l!==u)&&(t.resumeFrom=i,s&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var s,i,o,l,u;(i=(s=t.options).onExitComplete)==null||i.call(s),(u=(o=t.resumingFrom)==null?void 0:(l=o.options).onExitComplete)==null||u.call(l)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const C8={borderRadius:{...Mu,applyTo:[...G0]},borderTopLeftRadius:Mu,borderTopRightRadius:Mu,borderBottomLeftRadius:Mu,borderBottomRightRadius:Mu,boxShadow:p8},Wh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(hd,{...C8,...hd});const Av=["","X","Y","Z"],A8=1e3;let k8=0;function kv(e,t,s,i){const{latestValues:o}=t;o[e]&&(s[e]=o[e],t.setStaticValue(e,0),i&&(i[e]=0))}function rj(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=OO(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:o,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",It,!(o||l))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&rj(i)}function oj({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(u={},d=t==null?void 0:t()){this.id=k8++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(O8),this.nodes.forEach(L8),this.nodes.forEach(B8),this.nodes.forEach(j8)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new T8)}addEventListener(u,d){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new Em),this.eventHandlers.get(u).add(d)}notifyListeners(u,...d){const f=this.eventHandlers.get(u);f&&f.notify(...d)}hasListeners(u){return this.eventHandlers.has(u)}mount(u){if(this.instance)return;this.isSVG=K0(u)&&!GH(u),this.instance=u;const{layoutId:d,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||d)&&(this.isLayoutDirty=!0),e){let p,g=0;const b=()=>this.root.updateBlockedByResize=!1;It.read(()=>{g=window.innerWidth}),e(u,()=>{const w=window.innerWidth;w!==g&&(g=w,this.root.updateBlockedByResize=!0,p&&p(),p=R8(b,250),Wh.hasAnimatedSinceResize&&(Wh.hasAnimatedSinceResize=!1,this.nodes.forEach(vA)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:g,hasRelativeLayoutChanged:b,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||h.getDefaultTransition()||H8,{onLayoutAnimationStart:S,onLayoutAnimationComplete:T}=h.getProps(),A=!this.targetLayout||!sj(this.targetLayout,w),C=!g&&b;if(this.options.layoutRoot||this.resumeFrom||C||g&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...F0(x,"layout"),onPlay:S,onComplete:T};(h.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(p,C,k.path)}else g||vA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),xr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(U8),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&rj(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const g=this.path[p];g.shouldResetTransform=!0,(typeof g.latestValues.x=="string"||typeof g.latestValues.y=="string")&&(g.isLayoutDirty=!0),g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:d,layout:f}=this.options;if(d===void 0&&!f)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const f=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),f&&this.nodes.forEach(_8),this.nodes.forEach(gA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(yA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(I8),this.nodes.forEach(P8),this.nodes.forEach(z8),this.nodes.forEach(M8),this.nodes.forEach(N8)):this.nodes.forEach(yA),this.clearAllSnapshots();const d=Nn.now();dn.delta=Rr(0,1e3/60,d-dn.timestamp),dn.timestamp=d,dn.isProcessing=!0,wv.update.process(dn),wv.preRender.process(dn),wv.render.process(dn),dn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(D8),this.sharedNodes.forEach(V8)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,It.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){It.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zn(this.snapshot.measuredBox.x)&&!Zn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f<this.path.length;f++)this.path[f].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected=un()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(d=!1),d&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:f,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!o)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!nj(this.projectionDelta),f=this.getTransformTemplate(),h=f?f(this.latestValues,""):void 0,p=h!==this.prevTransformTemplateValue;u&&this.instance&&(d||la(this.latestValues)||p)&&(o(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const d=this.measurePageBox();let f=this.removeElementScroll(d);return u&&(f=this.removeTransform(f)),G8(f),{animationId:this.root.animationId,measuredBox:d,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){var h;const{visualElement:u}=this.options;if(!u)return un();const d=u.measureViewportBox();if(!(((h=this.scroll)==null?void 0:h.wasRoot)||this.path.some(K8))){const{scroll:p}=this.root;p&&(ki(d.x,p.offset.x),ki(d.y,p.offset.y))}return d}removeElementScroll(u){var f;const d=un();if(Xs(d,u),(f=this.scroll)!=null&&f.wasRoot)return d;for(let h=0;h<this.path.length;h++){const p=this.path[h],{scroll:g,options:b}=p;p!==this.root&&g&&b.layoutScroll&&(g.wasRoot&&Xs(d,u),ki(d.x,g.offset.x),ki(d.y,g.offset.y))}return d}applyTransform(u,d=!1,f){var p,g;const h=f||un();Xs(h,u);for(let b=0;b<this.path.length;b++){const w=this.path[b];!d&&w.options.layoutScroll&&w.scroll&&w!==w.root&&(ki(h.x,-w.scroll.offset.x),ki(h.y,-w.scroll.offset.y)),la(w.latestValues)&&Yh(h,w.latestValues,(p=w.layout)==null?void 0:p.layoutBox)}return la(this.latestValues)&&Yh(h,this.latestValues,(g=this.layout)==null?void 0:g.layoutBox),h}removeTransform(u){var f;const d=un();Xs(d,u);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!la(p.latestValues))continue;let g;p.instance&&(Fb(p.latestValues)&&p.updateSnapshot(),g=un(),Xs(g,p.measurePageBox())),aA(d,p.latestValues,(f=p.snapshot)==null?void 0:f.layoutBox,g)}return la(this.latestValues)&&aA(d,this.latestValues),d}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==dn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var w;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;if(!(u||f&&this.isSharedProjectionDirty||this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:g}=this.options;if(!this.layout||!(p||g))return;this.resolvedRelativeTargetAt=dn.timestamp;const b=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=un(),this.targetWithTransforms=un()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),u8(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Xs(this.target,this.layout.layoutBox),LO(this.target,this.targetDelta)):Xs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Fb(this.parent.latestValues)||zO(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(u,d,f){this.relativeParent=u,this.forceRelativeParentToResolveTarget(),this.relativeTarget=un(),this.relativeTargetOrigin=un(),Dm(this.relativeTargetOrigin,d,f,this.options.layoutAnchor||void 0),Xs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const u=this.getLead(),d=!!this.resumingFrom||this!==u;let f=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===dn.timestamp&&(f=!1),f)return;const{layout:h,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||p))return;Xs(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,b=this.treeScale.y;CH(this.layoutCorrected,this.treeScale,this.path,d),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=un());const{target:w}=u;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(tA(this.prevProjectionDelta.x,this.projectionDelta.x),tA(this.prevProjectionDelta.y,this.projectionDelta.y)),Vu(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==b||!fA(this.projectionDelta.x,this.prevProjectionDelta.x)||!fA(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var d;if((d=this.options.visualElement)==null||d.scheduleRender(),u){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Hl(),this.projectionDelta=Hl(),this.projectionDeltaWithTransform=Hl()}setAnimationOrigin(u,d=!1,f){const h=this.snapshot,p=h?h.latestValues:{},g={...this.latestValues},b=Hl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const w=un(),x=h?h.source:void 0,S=this.layout?this.layout.source:void 0,T=x!==S,A=this.getStack(),C=!A||A.members.length<=1,k=!!(T&&!C&&this.options.crossfade===!0&&!this.path.some(q8));this.animationProgress=0;let M;const D=f==null?void 0:f.interpolateProjection(u);this.mixTargetDelta=_=>{const N=_/1e3,O=D==null?void 0:D(N);O?(b.x.translate=O.x,b.x.scale=Dt(u.x.scale,1,N),b.x.origin=u.x.origin,b.x.originPoint=u.x.originPoint,b.y.translate=O.y,b.y.scale=Dt(u.y.scale,1,N),b.y.origin=u.y.origin,b.y.originPoint=u.y.originPoint):(bA(b.x,u.x,N),bA(b.y,u.y,N)),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Dm(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),F8(this.relativeTarget,this.relativeTargetOrigin,w,N),M&&m8(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=un()),Xs(M,this.relativeTarget)),T&&(this.animationValues=g,v8(g,p,this.latestValues,N,k,C)),O&&O.rotate!==void 0&&(this.animationValues||(this.animationValues=g),this.animationValues.pathRotation=O.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){var d,f,h;this.notifyListeners("animationStart"),(d=this.currentAnimation)==null||d.stop(),(h=(f=this.resumingFrom)==null?void 0:f.currentAnimation)==null||h.stop(),this.pendingAnimation&&(xr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=It.update(()=>{Wh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Da(0)),this.motionValue.jump(0,!1),this.currentAnimation=w8(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),lq(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(A8),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead(),{targetWithTransforms:d,layout:f,latestValues:h}=u;let{target:p}=u;if(!(!d||!p||!f)){if(this!==u&&this.layout&&f&&aj(this.options.animationType,this.layout.layoutBox,f.layoutBox)){p=this.target||un();const g=Zn(this.layout.layoutBox.x);p.x.min=u.target.x.min,p.x.max=p.x.min+g;const b=Zn(this.layout.layoutBox.y);p.y.min=u.target.y.min,p.y.max=p.y.min+b}Xs(d,p),Yh(d,h),Vu(this.projectionDeltaWithTransform,this.layoutCorrected,d,h)}}registerSharedNode(u,d){this.sharedNodes.has(u)||this.sharedNodes.set(u,new E8),this.sharedNodes.get(u).add(d);const h=d.options.initialPromotionConfig;d.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(d):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var d;const{layoutId:u}=this.options;return u?((d=this.getStack())==null?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:u}=this.options;return u?(d=this.getStack())==null?void 0:d.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:d,preserveFollowOpacity:f}={}){const h=this.getStack();h&&h.promote(this,f),u&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let d=!1;const{latestValues:f}=u;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(d=!0),!d)return;const h={};f.z&&kv("z",u,h,this.animationValues);for(let p=0;p<Av.length;p++)kv(`rotate${Av[p]}`,u,h,this.animationValues),kv(`skew${Av[p]}`,u,h,this.animationValues);u.render();for(const p in h)u.setStaticValue(p,h[p]),this.animationValues&&(this.animationValues[p]=h[p]);u.scheduleRender()}applyProjectionStyles(u,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){u.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,u.visibility="",u.opacity="",u.pointerEvents=Zh(d==null?void 0:d.pointerEvents)||"",u.transform=f?f(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(u.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,u.pointerEvents=Zh(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!la(this.latestValues)&&(u.transform=f?f({},""):"none",this.hasProjected=!1);return}u.visibility="";const p=h.animationValues||h.latestValues;this.applyTransformsToTarget();let g=g8(this.projectionDeltaWithTransform,this.treeScale,p);f&&(g=f(p,g)),u.transform=g;const{x:b,y:w}=this.projectionDelta;u.transformOrigin=`${b.origin*100}% ${w.origin*100}% 0`,h.animationValues?u.opacity=h===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:u.opacity=h===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const x in hd){if(p[x]===void 0)continue;const{correct:S,applyTo:T,isCSSVariable:A}=hd[x],C=g==="none"?p[x]:S(p[x],h);if(T){const k=T.length;for(let M=0;M<k;M++)u[T[M]]=C}else A?this.options.visualElement.renderState.vars[x]=C:u[x]=C}this.options.layoutId&&(u.pointerEvents=h===this?Zh(d==null?void 0:d.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var d;return(d=u.currentAnimation)==null?void 0:d.stop()}),this.root.nodes.forEach(gA),this.root.sharedNodes.clear()}}}function M8(e){e.updateLayout()}function N8(e){var s;const t=((s=e.resumeFrom)==null?void 0:s.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:o}=e.layout,{animationType:l}=e.options,u=t.source!==e.layout.source;if(l==="size")Si(g=>{const b=u?t.measuredBox[g]:t.layoutBox[g],w=Zn(b);b.min=i[g].min,b.max=b.min+w});else if(l==="x"||l==="y"){const g=l==="x"?"y":"x";Hb(u?t.measuredBox[g]:t.layoutBox[g],i[g])}else aj(l,t.layoutBox,i)&&Si(g=>{const b=u?t.measuredBox[g]:t.layoutBox[g],w=Zn(i[g]);b.max=b.min+w,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+w)});const d=Hl();Vu(d,i,t.layoutBox);const f=Hl();u?Vu(f,e.applyTransform(o,!0),t.measuredBox):Vu(f,i,t.layoutBox);const h=!nj(d);let p=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:b,layout:w}=g;if(b&&w){const x=e.options.layoutAnchor||void 0,S=un();Dm(S,t.layoutBox,b.layoutBox,x);const T=un();Dm(T,i,w.layoutBox,x),sj(S,T)||(p=!0),g.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=S,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:f,layoutDelta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function O8(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function j8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function D8(e){e.clearSnapshot()}function gA(e){e.clearMeasurements()}function _8(e){e.isLayoutDirty=!0,e.updateLayout()}function yA(e){e.isLayoutDirty=!1}function I8(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function P8(e){var t;e.relativeTarget&&((t=e.relativeParent)!=null&&t.isLayoutDirty)&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function z8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function vA(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function L8(e){e.resolveTargetDelta()}function B8(e){e.calcProjection()}function U8(e){e.resetSkewAndRotation()}function V8(e){e.removeLeadSnapshot()}function bA(e,t,s){e.translate=Dt(t.translate,0,s),e.scale=Dt(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function xA(e,t,s,i){e.min=Dt(t.min,s.min,i),e.max=Dt(t.max,s.max,i)}function F8(e,t,s,i){xA(e.x,t.x,s.x,i),xA(e.y,t.y,s.y,i)}function q8(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const H8={duration:.45,ease:[.4,0,.1,1]},wA=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),SA=wA("applewebkit/")&&!wA("chrome/")?Math.round:ni;function TA(e){e.min=SA(e.min),e.max=SA(e.max)}function G8(e){TA(e.x),TA(e.y)}function aj(e,t,s){return e==="position"||e==="preserve-aspect"&&!c8(dA(t),dA(s),.2)}function K8(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Y8=oj({attachResizeListener:(e,t)=>md(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Mv={current:void 0},lj=oj({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Mv.current){const e=new Y8({});e.mount(window),e.setOptions({layoutScroll:!0}),Mv.current=e}return Mv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),J0=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function $8(e=!0){const t=E.useContext(E0);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:i,register:o}=t,l=E.useId();E.useEffect(()=>{if(e)return o(l)},[e]);const u=E.useCallback(()=>e&&i&&i(l),[l,i,e]);return!s&&i?[!1,u]:[!0]}const cj=E.createContext({strict:!1}),RA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let EA=!1;function Q8(){if(EA)return;const e={};for(const t in RA)e[t]={isEnabled:s=>RA[t].some(i=>!!s[i])};KO(e),EA=!0}function uj(){return Q8(),XH()}function X8(e){const t=uj();for(const s in e)t[s]={...t[s],...e[s]};KO(t)}const mp=E.createContext({});function Z8(e,t){if(hp(e)){const{initial:s,animate:i}=e;return{initial:s===!1||fd(s)?s:void 0,animate:fd(i)?i:void 0}}return e.inherit!==!1?t:{}}function W8(e){const{initial:t,animate:s}=Z8(e,E.useContext(mp));return E.useMemo(()=>({initial:t,animate:s}),[CA(t),CA(s)])}function CA(e){return Array.isArray(e)?e.join(" "):e}const ew=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dj(e,t,s){for(const i in t)!jn(t[i])&&!QO(i,s)&&(e[i]=t[i])}function J8({transformTemplate:e},t){return E.useMemo(()=>{const s=ew();return Y0(s,t,e),Object.assign({},s.vars,s.style)},[t])}function e7(e,t){const s=e.style||{},i={};return dj(i,s,e),Object.assign(i,J8(e,t)),i}function t7(e,t){const s={},i=e7(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=i,s}const fj=()=>({...ew(),attrs:{}});function n7(e,t,s,i){const o=E.useMemo(()=>{const l=fj();return IO(l,t,ZO(i),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};dj(l,e.style,e),o.style={...l,...o.style}}return o}const s7=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function _m(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||s7.has(e)}function i7(e,t){return e.startsWith("on")?!_m(e):(t==null?void 0:t(e))??!_m(e)}function r7(e,t,s,i){const o={};for(const l in e)l==="values"&&typeof e.values=="object"||jn(e[l])||(i7(l,i)||s===!0&&_m(l)||!t&&!_m(l)||e.draggable&&l.startsWith("onDrag"))&&(o[l]=e[l]);return o}const o7=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function tw(e){return typeof e!="string"||e.includes("-")?!1:!!(o7.indexOf(e)>-1||/[A-Z]/u.test(e))}function a7(e,t,s,{latestValues:i},o,l=!1,u,d){const h=(u??tw(e)?n7:t7)(t,i,o,e),p=r7(t,typeof e=="string",l,d),g=e!==E.Fragment?{...p,...h,ref:s}:{},{children:b}=t,w=E.useMemo(()=>jn(b)?b.get():b,[b]);return E.createElement(e,{...g,children:w})}function l7({scrapeMotionValuesFromProps:e,createRenderState:t},s,i,o){return{latestValues:c7(s,i,o,e),renderState:t()}}function c7(e,t,s,i){const o={},l=i(e,{});for(const b in l)o[b]=Zh(l[b]);let{initial:u,animate:d}=e;const f=hp(e),h=HO(e);t&&h&&!f&&e.inherit!==!1&&(u===void 0&&(u=t.initial),d===void 0&&(d=t.animate));let p=s?s.initial===!1:!1;p=p||u===!1;const g=p?d:u;if(g&&typeof g!="boolean"&&!fp(g)){const b=Array.isArray(g)?g:[g];for(let w=0;w<b.length;w++){const x=AO(e,b[w]);if(x){const{transitionEnd:S,transition:T,...A}=x;for(const C in A){let k=A[C];if(Array.isArray(k)){const M=p?k.length-1:0;k=k[M]}k!==null&&(o[C]=k)}for(const C in S)o[C]=S[C]}}}return o}const hj=e=>(t,s)=>{const i=E.useContext(mp),o=E.useContext(E0),l=()=>l7(e,t,i,o);return s?l():R0(l)},u7=hj({scrapeMotionValuesFromProps:W0,createRenderState:ew}),d7=hj({scrapeMotionValuesFromProps:WO,createRenderState:fj}),f7=Symbol.for("motionComponentSymbol");function h7(e,t,s){const i=E.useRef(s);E.useInsertionEffect(()=>{i.current=s});const o=E.useRef(null);return E.useCallback(l=>{var d;l&&((d=e.onMount)==null||d.call(e,l)),t&&(l?t.mount(l):t.unmount());const u=i.current;if(typeof u=="function")if(l){const f=u(l);typeof f=="function"&&(o.current=f)}else o.current?(o.current(),o.current=null):u(l);else u&&(u.current=l)},[t])}const mj=E.createContext({});function Vl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function m7(e,t,s,i,o,l){var k,M;const{visualElement:u}=E.useContext(mp),d=E.useContext(cj),f=E.useContext(E0),h=E.useContext(J0),p=h.reducedMotion,g=h.skipAnimations,b=E.useRef(null),w=E.useRef(!1);i=i||d.renderer,!b.current&&i&&(b.current=i(e,{visualState:t,parent:u,props:s,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p,skipAnimations:g,isSVG:l}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const x=b.current,S=E.useContext(mj);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&p7(b.current,s,o,S);const T=E.useRef(!1);E.useInsertionEffect(()=>{x&&T.current&&x.update(s,f)});const A=s[NO],C=E.useRef(!!A&&typeof window<"u"&&!((k=window.MotionHandoffIsComplete)!=null&&k.call(window,A))&&((M=window.MotionHasOptimisedAnimation)==null?void 0:M.call(window,A)));return Tb(()=>{var D;!w.current||!x||((D=x.animationState)==null||D.animateChanges(),x.enteringChildren=void 0)},[]),Tb(()=>{w.current=!0,x&&(T.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),C.current&&x.animationState&&x.animationState.animateChanges())}),E.useEffect(()=>{x&&(!C.current&&x.animationState&&x.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var D;(D=window.MotionHandoffMarkAsComplete)==null||D.call(window,A)}),C.current=!1),x.enteringChildren=void 0)}),x}function p7(e,t,s,i){const{layoutId:o,layout:l,drag:u,dragConstraints:d,layoutScroll:f,layoutRoot:h,layoutAnchor:p,layoutCrossfade:g}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:pj(e.parent)),e.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!u||d&&Vl(d),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:i,crossfade:g,layoutScroll:f,layoutRoot:h,layoutAnchor:p})}function pj(e){if(e)return e.options.allowProjection!==!1?e.projection:pj(e.parent)}function Nv(e,{forwardMotionProps:t=!1,type:s}={},i,o){i&&X8(i);const l=s?s==="svg":tw(e),u=l?d7:u7;function d(h,p){let g;const b={...E.useContext(J0),...h,layoutId:g7(h)},{isStatic:w,isValidProp:x}=b,S=W8(h),T=u(h,w);if(!w&&typeof window<"u"){y7();const A=v7(b);g=A.MeasureLayout,S.visualElement=m7(e,T,b,o,A.ProjectionNode,l)}return v.jsxs(mp.Provider,{value:S,children:[g&&S.visualElement?v.jsx(g,{visualElement:S.visualElement,...b}):null,a7(e,h,h7(T,S.visualElement,p),T,w,t,l,x)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=E.forwardRef(d);return f[f7]=e,f}function g7({layoutId:e}){const t=E.useContext(zN).id;return t&&e!==void 0?t+"-"+e:e}function y7(e,t){E.useContext(cj).strict}function v7(e){const t=uj(),{drag:s,layout:i}=t;if(!s&&!i)return{};const o={...s,...i};return{MeasureLayout:s!=null&&s.isEnabled(e)||i!=null&&i.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function b7(e,t){if(typeof Proxy>"u")return Nv;const s=new Map,i=(l,u)=>Nv(l,u,e,t),o=(l,u)=>i(l,u);return new Proxy(o,{get:(l,u)=>u==="create"?i:(s.has(u)||s.set(u,Nv(u,void 0,e,t)),s.get(u))})}const x7=(e,t)=>t.isSVG??tw(e)?new t8(t):new JH(t,{allowProjection:e!==E.Fragment});class w7 extends Oo{constructor(t){super(t),t.animationState||(t.animationState=s8(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let S7=0;class T7 extends Oo{constructor(){super(...arguments),this.id=S7++}update(){var f;const{presenceContext:t,prevPresenceContext:s,animationState:i}=this.node;if(!t||!i)return;const{isPresent:o,onExitComplete:l}=t,u=s==null?void 0:s.isPresent;if(o===u)return;if(o&&u===!1){if(this.exit===!0){const{initial:h}=this.node.getProps();if(h&&!Array.isArray(h)){const{transition:p,transitionEnd:g,...b}=Ea(this.node,h)||{};for(const w in b)(f=this.node.getValue(w))==null||f.jump(b[w])}this.node.blockInitialAnimation=!1,i.reset(),i.animateChanges()}else i.setActive("exit",!1);this.exit=void 0;return}const d=this.exit=i.setActive("exit",!o);l&&!o&&d.then(()=>{this.exit===d&&(this.exit=!0,l(this.id))})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const R7={animation:{Feature:w7},exit:{Feature:T7}};function pp(e){return{point:{x:e.pageX,y:e.pageY}}}const E7=e=>t=>Q0(t)&&e(t,pp(t));function Fu(e,t,s,i){return md(e,t,E7(s),i)}const gj=({current:e})=>e?e.ownerDocument.defaultView:null,AA=(e,t)=>Math.abs(e-t);function C7(e,t){const s=AA(e.x,t.x),i=AA(e.y,t.y);return Math.sqrt(s**2+i**2)}const kA=new Set(["auto","scroll"]);class yj{constructor(t,s,{transformPagePoint:i,contextWindow:o=window,dragSnapToOrigin:l=!1,distanceThreshold:u=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=jh(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Ov(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,T=C7(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!T)return;const{point:A}=x;this.history.push({...A,timestamp:Nn.now()});const{onStart:C,onMove:k}=this.handlers;S||(C&&C(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,x)},this.handlePointerMove=(x,S)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=S,this.lastMoveEventInfo=jh(S,this.transformPagePoint),this.hasPendingMove=!0,It.update(this.updatePoint,!0)},this.handlePointerUp=(x,S)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:T,onSessionEnd:A,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=Ov(x.type==="pointercancel"?this.lastMoveEventInfo:jh(S,this.transformPagePoint),this.history);this.startEvent&&T&&T(x,k),A&&A(x,k)},!Q0(t))return;this.dragSnapToOrigin=l,this.handlers=s,this.transformPagePoint=i,this.distanceThreshold=u,this.contextWindow=o||window;const f=pp(t),h=jh(f,this.transformPagePoint),{point:p}=h,{timestamp:g}=dn;this.history=[{...p,timestamp:g}];const{onSessionStart:b}=s;b&&b(t,Ov(h,this.history));const w={passive:!0,capture:!0};this.removeListeners=Nd(Fu(this.contextWindow,"pointermove",this.handlePointerMove,w),Fu(this.contextWindow,"pointerup",this.handlePointerUp,w),Fu(this.contextWindow,"pointercancel",this.handlePointerUp,w)),d&&this.startScrollTracking(d)}startScrollTracking(t){let s=t.parentElement;for(;s;){const i=getComputedStyle(s);(kA.has(i.overflowX)||kA.has(i.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const i=t===window,o=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:o.x-s.x,y:o.y-s.y};l.x===0&&l.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,o),It.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),xr(this.updatePoint)}}function jh(e,t){return t?{point:t(e.point)}:e}function MA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ov({point:e},t){return{point:e,delta:MA(e,vj(t)),offset:MA(e,A7(t)),velocity:k7(t,.1)}}function A7(e){return e[0]}function vj(e){return e[e.length-1]}function k7(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,i=null;const o=vj(e);for(;s>=0&&(i=e[s],!(o.timestamp-i.timestamp>Ls(t)));)s--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&o.timestamp-i.timestamp>Ls(t)*2&&(i=e[1]);const l=zs(o.timestamp-i.timestamp);if(l===0)return{x:0,y:0};const u={x:(o.x-i.x)/l,y:(o.y-i.y)/l};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function M7(e,{min:t,max:s},i){return t!==void 0&&e<t?e=i?Dt(t,e,i.min):Math.max(e,t):s!==void 0&&e>s&&(e=i?Dt(s,e,i.max):Math.min(e,s)),e}function NA(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function N7(e,{top:t,left:s,bottom:i,right:o}){return{x:NA(e.x,s,o),y:NA(e.y,t,i)}}function OA(e,t){let s=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,i]=[i,s]),{min:s,max:i}}function O7(e,t){return{x:OA(e.x,t.x),y:OA(e.y,t.y)}}function j7(e,t){let s=.5;const i=Zn(e),o=Zn(t);return o>i?s=ld(t.min,t.max-i,e.min):i>o&&(s=ld(e.min,e.max-o,t.min)),Rr(0,1,s)}function D7(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const Gb=.35;function _7(e=Gb){return e===!1?e=0:e===!0&&(e=Gb),{x:jA(e,"left","right"),y:jA(e,"top","bottom")}}function jA(e,t,s){return{min:DA(e,t),max:DA(e,s)}}function DA(e,t){return typeof e=="number"?e:e[t]||0}const I7=new WeakMap;class P7{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=un(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:i}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=g=>{s&&this.snapToCursor(g),this.stopAnimation()},u=(g,b)=>{const{drag:w,dragPropagation:x,onDragStart:S}=this.getProps();if(w&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=kH(w),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Si(A=>{let C=this.getAxisMotionValue(A).get()||0;if(Pi.test(C)){const{projection:k}=this.visualElement;if(k&&k.layout){const M=k.layout.layoutBox[A];M&&(C=Zn(M)*(parseFloat(C)/100))}}this.originPoint[A]=C}),S&&It.update(()=>S(g,b),!1,!0),Bb(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},d=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b;const{dragPropagation:w,dragDirectionLock:x,onDirectionLock:S,onDrag:T}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:A}=b;if(x&&this.currentDirection===null){this.currentDirection=L7(A),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",b.point,A),this.updateAxis("y",b.point,A),this.visualElement.render(),T&&It.update(()=>T(g,b),!1,!0)},f=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b,this.stop(g,b),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new yj(t,{onSessionStart:l,onStart:u,onMove:d,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:i,contextWindow:gj(this.visualElement),element:this.visualElement.current})}stop(t,s){const i=t||this.latestPointerEvent,o=s||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!i)return;const{velocity:u}=o;this.startAnimation(u);const{onDragEnd:d}=this.getProps();d&&It.postRender(()=>d(i,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,i){const{drag:o}=this.getProps();if(!i||!Dh(t,o,this.currentDirection))return;const l=this.getAxisMotionValue(t);let u=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(u=M7(u,this.constraints[t],this.elastic[t])),l.set(u)}resolveConstraints(){var l;const{dragConstraints:t,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(l=this.visualElement.projection)==null?void 0:l.layout,o=this.constraints;t&&Vl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=N7(i.layoutBox,t):this.constraints=!1,this.elastic=_7(s),o!==this.constraints&&!Vl(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Si(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=D7(i.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Vl(t))return!1;const i=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const l=AH(i,o.root,this.visualElement.getTransformPagePoint());let u=O7(o.layout.layoutBox,l);if(s){const d=s(RH(u));this.hasMutatedConstraints=!!d,d&&(u=PO(d))}return u}startAnimation(t){const{drag:s,dragMomentum:i,dragElastic:o,dragTransition:l,dragSnapToOrigin:u,onDragTransitionEnd:d}=this.getProps(),f=this.constraints||{},h=Si(p=>{if(!Dh(p,s,this.currentDirection))return;let g=f&&f[p]||{};(u===!0||u===p)&&(g={min:0,max:0});const b=o?200:1e6,w=o?40:1e7,x={type:"inertia",velocity:i?t[p]:0,bounceStiffness:b,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...l,...g};return this.startAxisValueAnimation(p,x)});return Promise.all(h).then(d)}startAxisValueAnimation(t,s){const i=this.getAxisMotionValue(t);return Bb(this.visualElement,t),i.start(q0(t,i,0,s,this.visualElement,!1))}stopAnimation(){Si(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps()[s];return o||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:s}){var d;const{drag:i}=this.getProps(),o={x:t,y:s},l=((d=this.visualElement.getTransformPagePoint())==null?void 0:d(o))||o,u=this.visualElement.measureViewportBox();Si(f=>{if(!Dh(f,i,this.currentDirection))return;const h=this.getAxisMotionValue(f),{min:p,max:g}=u[f];h.set((h.get()||0)+l[f]-Dt(p,g,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:i}=this.visualElement;if(!Vl(s)||!i||!this.constraints)return;this.stopAnimation();const o=this.constraints,l={x:0,y:0};Si(d=>{const f=this.getAxisMotionValue(d).get();l[d]=j7({min:f,max:f},o[d])});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Si(d=>{const f=this.getAxisMotionValue(d);if(!Dh(d,t,null)||!f.get())return;const{min:h,max:p}=this.constraints[d];f.set(Dt(h,p,l[d]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;I7.set(this.visualElement,this);const t=this.visualElement.current,s=Fu(t,"pointerdown",h=>{const{drag:p,dragListener:g=!0}=this.getProps(),b=h.target,w=b!==t&&_H(b);p&&g&&!w&&this.start(h)});let i;const o=()=>{const{dragConstraints:h}=this.getProps();Vl(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=z7(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,u=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),It.read(o);const d=md(window,"resize",()=>this.scalePositionWithinConstraints()),f=l.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(Si(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=h[g].translate,b.set(b.get()+h[g].translate))}),this.visualElement.render())}));return()=>{d(),s(),u(),f&&f(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:i=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:u=Gb,dragMomentum:d=!0}=t;return{...t,drag:s,dragDirectionLock:i,dragPropagation:o,dragConstraints:l,dragElastic:u,dragMomentum:d}}}function _A(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function z7(e,t,s){const i=$C(e,_A(s)),o=$C(t,_A(s));return()=>{i(),o()}}function Dh(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function L7(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class B7 extends Oo{constructor(t){super(t),this.removeGroupControls=ni,this.removeListeners=ni,this.controls=new P7(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ni}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const jv=e=>(t,s)=>{e&&It.update(()=>e(t,s),!1,!0)};class U7 extends Oo{constructor(){super(...arguments),this.removePointerDownListener=ni}onPointerDown(t){this.session=new yj(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gj(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:i,onPanEnd:o}=this.node.getProps();return{onSessionStart:jv(t),onStart:jv(s),onMove:jv(i),onEnd:(l,u)=>{delete this.session,o&&It.postRender(()=>o(l,u))}}}mount(){this.removePointerDownListener=Fu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Dv=!1;class V7 extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i,layoutId:o}=this.props,{projection:l}=t;l&&(s.group&&s.group.add(l),i&&i.register&&o&&i.register(l),Dv&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:i,drag:o,isPresent:l}=this.props,{projection:u}=i;return u&&(u.isPresent=l,t.layoutDependency!==s&&u.setOptions({...u.options,layoutDependency:s}),Dv=!0,o||t.layoutDependency!==s||s===void 0||t.isPresent!==l?u.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?u.promote():u.relegate()||It.postRender(()=>{const d=u.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=s,i.root.didUpdate(),$0.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i}=this.props,{projection:o}=t;Dv=!0,o&&(o.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(o),i&&i.deregister&&i.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bj(e){const[t,s]=$8(),i=E.useContext(zN);return v.jsx(V7,{...e,layoutGroup:i,switchLayoutGroup:E.useContext(mj),isPresent:t,safeToRemove:s})}const F7={pan:{Feature:U7},drag:{Feature:B7,ProjectionNode:lj,MeasureLayout:bj}};function IA(e,t,s){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",s==="Start");const o="onHover"+s,l=i[o];l&&It.postRender(()=>l(t,pp(t)))}class q7 extends Oo{mount(){const{current:t}=this.node;t&&(this.unmount=NH(t,(s,i)=>(IA(this.node,i,"Start"),o=>IA(this.node,o,"End"))))}unmount(){}}class H7 extends Oo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Nd(md(this.node.current,"focus",()=>this.onFocus()),md(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function PA(e,t,s){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",s==="Start");const o="onTap"+(s==="End"?"":s),l=i[o];l&&It.postRender(()=>l(t,pp(t)))}class G7 extends Oo{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:i}=this.node.props;this.unmount=PH(t,(o,l)=>(PA(this.node,l,"Start"),(u,{success:d})=>PA(this.node,u,d?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const Kb=new WeakMap,_v=new WeakMap,K7=e=>{const t=Kb.get(e.target);t&&t(e)},Y7=e=>{e.forEach(K7)};function $7({root:e,...t}){const s=e||document;_v.has(s)||_v.set(s,{});const i=_v.get(s),o=JSON.stringify(t);return i[o]||(i[o]=new IntersectionObserver(Y7,{root:e,...t})),i[o]}function Q7(e,t,s){const i=$7(t);return Kb.set(e,s),i.observe(e),()=>{Kb.delete(e),i.unobserve(e)}}const X7={some:0,all:1};class Z7 extends Oo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var f;(f=this.stopObserver)==null||f.call(this);const{viewport:t={}}=this.node.getProps(),{root:s,margin:i,amount:o="some",once:l}=t,u={root:s?s.current:void 0,rootMargin:i,threshold:typeof o=="number"?o:X7[o]},d=h=>{const{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,l&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),w=p?g:b;w&&w(h)};this.stopObserver=Q7(this.node.current,u,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(W7(t,s))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function W7({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const J7={inView:{Feature:Z7},tap:{Feature:G7},focus:{Feature:H7},hover:{Feature:q7}},e9={layout:{ProjectionNode:lj,MeasureLayout:bj}},t9={...R7,...J7,...F7,...e9},n9=b7(t9,x7);function xj(e){const t=R0(()=>Da(e)),{isStatic:s}=E.useContext(J0);if(s){const[,i]=E.useState(e);E.useEffect(()=>t.on("change",i),[])}return t}function wj(e,t){const s=xj(t()),i=()=>s.set(t());return i(),Tb(()=>{const o=()=>It.preRender(i,!1,!0),l=e.map(u=>u.on("change",o));return()=>{l.forEach(u=>u()),xr(i)}}),s}function s9(e){Uu.current=[],e();const t=wj(Uu.current,e);return Uu.current=void 0,t}function zA(e,t,s,i){if(typeof e=="function")return s9(e);const l=typeof t=="function"?t:KH(t,s,i),u=Array.isArray(e)?LA(e,l):LA([e],([f])=>l(f)),d=Array.isArray(e)?void 0:e.accelerate;return d&&!d.isTransformed&&typeof t!="function"&&Array.isArray(s)&&(i==null?void 0:i.clamp)!==!1&&(u.accelerate={...d,times:[0,...t,1],keyframes:[s[0],...s,s[s.length-1]],isTransformed:!0}),u}function LA(e,t){const s=R0(()=>[]);return wj(e,()=>{s.length=0;const i=e.length;for(let o=0;o<i;o++)s[o]=e[o].get();return t(s)})}function Sj(){!Z0.current&&GO();const[e]=E.useState(Om.current);return e}const qu=n9,BA=[.23,1,.32,1],i9=.3,r9=400,o9=400,a9=.18,l9=.12,c9="translateY(8px)";function u9({open:e,onClose:t,title:s,detail:i,detailWidth:o=r9,children:l}){const u=Sj(),d=E.useRef(null),[f,h]=E.useState(!0);return E.useLayoutEffect(()=>{const p=d.current;if(!p)return;const g=w=>h(w<o+o9);g(p.getBoundingClientRect().width);const b=new ResizeObserver(([w])=>{w&&g(w.contentRect.width)});return b.observe(p),()=>b.disconnect()},[o]),v.jsxs("div",{ref:d,className:"flex h-full min-h-0",children:[v.jsx("div",{className:"flex flex-1 min-w-0 flex-col",children:l}),f?v.jsx(Cd,{open:e,onOpenChange:p=>{p||t()},children:v.jsxs(Ad,{className:"gap-0",style:{width:`min(${o}px, 100vw)`,maxWidth:"100vw"},children:[v.jsx(kd,{className:"h-12 shrink-0 px-4 pr-12 flex items-center",children:s??"Details"}),v.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e?i:null})]})}):v.jsx(qu.div,{animate:{width:e?o:0},className:"shrink-0 overflow-hidden",initial:!1,transition:{duration:u?0:i9,ease:BA},children:v.jsxs("div",{className:"flex h-full flex-col bg-sidebar border-l border-border",style:{width:o},children:[v.jsxs("div",{className:"h-12 shrink-0 sticky top-0 flex flex-row items-center justify-between px-2 gap-2",children:[v.jsx("div",{className:"flex min-w-0 w-full items-center gap-1.5",children:s}),v.jsx("div",{className:"flex flex-row gap-1.5",children:v.jsx(Be,{"aria-label":"Close details",onClick:t,variant:"ghost",size:"icon",children:v.jsx(Sc,{className:"size-4.5"})})})]}),e?v.jsx(qu.div,{animate:{opacity:1,transform:"translateY(0px)"},className:"flex-1 min-h-0 overflow-y-auto",initial:{opacity:0,transform:u?"none":c9},transition:{delay:u?0:l9,duration:a9,ease:BA},children:i}):null]})})]})}const Tj=E.createContext({openRail:()=>{}}),d9=Tj.Provider;function nw(){return E.useContext(Tj)}function Iv(e){return typeof e=="number"&&e>0&&Number.isFinite(new Date(e).getTime())?e:null}function xi(e,t){if(e===null||typeof e!="object")return;const s=e[t];return typeof s=="string"&&s.length>0?s:void 0}function f9(e,t){const s=new Set(e.map(o=>o.id)),i=o=>o.action.startsWith("run.")&&s.has(xi(o.payload,"runId")??"");return[...e.map(o=>{var l,u;return{kind:"run",id:`run-${o.id}`,run:o,at:Iv(o.endedAt)??Iv(o.startedAt),error:o.error??xi((l=t.find(d=>i(d)&&xi(d.payload,"runId")===o.id&&xi(d.payload,"error")))==null?void 0:l.payload,"error"),roomId:xi(o.origin,"roomId")??xi((u=t.find(d=>i(d)&&xi(d.payload,"runId")===o.id&&xi(d.payload,"roomId")))==null?void 0:u.payload,"roomId")}}),...t.filter(o=>!i(o)).map(o=>({kind:"audit",id:`audit-${o.id}`,entry:o,at:Iv(o.createdAt),error:xi(o.payload,"error"),roomId:xi(o.payload,"roomId")}))].sort((o,l)=>(l.at??0)-(o.at??0))}function h9(e,t){var u;const s=e.replace(/\/+$/,"")||"/",i=s==="/"?"/":`${s}/`;if(t===s)return[{path:s,label:s}];if(!t.startsWith(i))return[{path:s,label:s}];const o=t.slice(i.length).split("/").filter(Boolean),l=[{path:s,label:s}];for(const d of o){if(d===".."||d===".")return[{path:s,label:s}];const f=((u=l[l.length-1])==null?void 0:u.path)??s;l.push({path:`${f==="/"?"":f}/${d}`,label:d})}return l}function m9(e){return e.split("/").filter(Boolean).at(-1)??e}const p9=[{id:"activity",key:"cockpit.activity"},{id:"approvals",key:"cockpit.approvals"},{id:"files",key:"cockpit.files"}];function Rj(e,t){switch(e){case"cancelled":return t("run.cancelled");case"done":return t("run.done");case"failed":return t("run.failed");case"interrupted":return t("run.interrupted");case"queued":return t("run.queued");case"running":return t("run.running");case"waiting_user":return t("run.waiting_user")}}function g9(e,t){return{"approval.decided":t("audit.approvalDecided"),"approval.expired":t("audit.approvalExpired"),"approval.requested":t("audit.approvalRequested"),"bot.created":t("audit.botCreated"),"bot.deleted":t("audit.botDeleted"),"bot.paused":t("audit.botPaused"),"bot.resumed":t("audit.botResumed"),"bot.updated":t("audit.botUpdated"),"message.prompted":t("audit.messagePrompted"),"question.answered":t("audit.questionAnswered"),"question.expired":t("audit.questionExpired"),"question.requested":t("audit.questionRequested"),"run.cancelled":t("run.cancelled"),"run.done":t("audit.runDone"),"run.error":t("run.failed"),"run.failed":t("audit.runFailed"),"run.interrupted":t("audit.runInterrupted"),"run.started":t("audit.runStarted"),"thread.created":t("audit.threadCreated")}[e]??e.replaceAll("."," ")}function y9(e,t){switch(e){case"queued":case"running":case"waiting_user":case"done":case"failed":case"cancelled":case"interrupted":return Rj(e,t);case"allow_once":return t("approval.allowOnce");case"allow_session":return t("approval.allowSession");case"deny":return t("approval.deny");case"expired":return t("approval.expired");case"answered":return t("audit.questionAnswered");default:return e}}function v9(e,t){return e==="person"?t("actor.person"):e==="system"?t("actor.system"):e}const b9={cancelled:"text-muted-foreground",done:"text-success",failed:"text-destructive",interrupted:"text-warning",queued:"text-muted-foreground",running:"text-brand",waiting_user:"text-warning"};function yo({error:e,retry:t,message:s}){const{t:i}=mt();return v.jsxs("div",{className:"px-3 py-3 text-xs",role:e?"alert":"status",children:[v.jsx("p",{className:e?"text-destructive":"text-muted-foreground",children:s??i(e?"common.loadFailed":"common.loading")}),e?v.jsx("p",{className:"mt-1 break-words text-destructive",children:e.message}):null,e&&t?v.jsx(Be,{className:"mt-2",onClick:t,size:"sm",variant:"outline",children:i("common.retry")}):null]})}function Yb({botId:e,threadId:t,label:s}){const i="break-all text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline";return t?v.jsx($n,{className:i,params:{botId:e,threadId:t},to:"/bots/$botId/threads/$threadId",children:s}):v.jsx($n,{className:i,params:{botId:e},to:"/bots/$botId",children:s})}function x9({bot:e}){const t=Et(op(e.id)),s=Et(U6(e.id)),i=Et(No()),{t:o}=mt(),l=f9(t.data??[],s.data??[]),u=t.error??s.error,d=t.isPending||s.isPending;return v.jsxs(v.Fragment,{children:[u?v.jsx(yo,{error:u,retry:()=>{t.refetch(),s.refetch()}}):null,d?v.jsx(yo,{}):null,!u&&!d&&l.length===0?v.jsx("p",{className:"px-3 py-6 text-muted-foreground text-sm",children:o("drawer.empty")}):null,v.jsx("ol",{className:"flex flex-col gap-0.5 px-2 pb-6",children:l.map(f=>{var w,x,S,T;const h=f.kind==="run"?f.run.botId:f.entry.botId,p=f.kind==="run"?f.run.threadId:f.entry.threadId,g=f.roomId,b=((x=(w=i.data)==null?void 0:w.find(A=>A.id===h))==null?void 0:x.name)??(h===e.id?e.name:h);return v.jsxs("li",{className:"flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-muted/50",children:[v.jsx("span",{className:ke("mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-muted",f.kind==="run"?b9[f.run.status]:"text-muted-foreground"),children:f.kind==="run"?f.run.status==="done"?v.jsx(yk,{className:"size-3"}):f.run.status==="failed"||f.run.status==="interrupted"?v.jsx(Sc,{className:"size-3"}):v.jsx(wk,{className:"size-2.5"}):v.jsx("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-current"})}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("p",{className:"break-all text-[12.5px]",children:f.kind==="run"?`${o("drawer.run",{id:f.run.id})} · ${Rj(f.run.status,o)}`:g9(f.entry.action,o)}),v.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[f.kind==="audit"?`${((T=(S=i.data)==null?void 0:S.find(A=>A.id===f.entry.actor))==null?void 0:T.name)??v9(f.entry.actor,o)} · `:"",f.at===null?o("common.unknownTime"):v.jsx("time",{dateTime:new Date(f.at).toISOString(),children:bc(new Date(f.at).toISOString())})]}),h?v.jsx(Yb,{botId:h,threadId:p,label:`${b}${p?` · ${o("drawer.thread",{id:p})}`:""}`}):null,g?v.jsxs($n,{className:"ml-2 text-[11px] underline",params:{roomId:g},to:"/rooms/$roomId",children:["#",g]}):null,f.error?v.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words text-destructive text-xs",children:f.error}):null,f.kind==="audit"&&f.entry.decision?v.jsx("p",{className:"text-[11px] text-muted-foreground",children:y9(f.entry.decision,o)}):null]})]},f.id)})})]})}function w9({bot:e}){var l,u;const t=Et(Rc()),{t:s}=mt(),i=(((l=t.data)==null?void 0:l.approvals)??[]).filter(d=>d.botId===e.id&&d.status==="pending"&&d.expiresAt>Date.now()),o=(((u=t.data)==null?void 0:u.questions)??[]).filter(d=>d.botId===e.id&&d.status==="pending");return t.isPending?v.jsx(yo,{}):t.error?v.jsx(yo,{error:t.error,retry:()=>{t.refetch()}}):!i.length&&!o.length?v.jsx("p",{className:"px-3 py-6 text-muted-foreground text-sm",children:s("drawer.notWaiting",{name:e.name})}):v.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-6",children:[o.map(d=>v.jsxs("div",{children:[v.jsx(Yb,{botId:e.id,threadId:d.threadId,label:s("inbox.openThread")}),v.jsx(m0,{botName:e.name,question:d})]},d.id)),i.map(d=>v.jsxs("div",{children:[v.jsx(Yb,{botId:e.id,threadId:d.threadId,label:s("inbox.openThread")}),v.jsx(h0,{approval:d,botName:e.name})]},d.id))]})}function S9({bot:e,threadId:t}){var T,A,C,k,M,D,_;const{t:s}=mt(),[i,o]=E.useState(),[l,u]=E.useState(null),d=Et(fC(e.id,void 0,t)),f=Et(fC(e.id,i,t)),h=Et({...B6(e.id,l??"",t),enabled:l!==null}),p=((T=f.data)==null?void 0:T.path)??i??((A=d.data)==null?void 0:A.path),g=d.data&&p?h9(d.data.path,p):[],b=(C=g.at(-2))==null?void 0:C.path,w=N=>{u(null),o(N)},x=()=>{f.refetch(),l!==null&&h.refetch()},S=(k=f.data)==null?void 0:k.entries.find(N=>N.path===l);return v.jsxs("div",{className:"flex min-h-0 flex-col pb-6",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-1 px-2 py-1",children:[l!==null?v.jsxs(Be,{onClick:()=>u(null),size:"sm",variant:"ghost",children:[v.jsx(yE,{className:"size-3.5"}),s("drawer.files")]}):b?v.jsxs(Be,{onClick:()=>w(b),size:"sm",variant:"ghost",children:[v.jsx(yE,{className:"size-3.5"}),s("files.parent")]}):null,v.jsx(Be,{className:"ml-auto",disabled:f.isFetching||l!==null&&h.isFetching,onClick:x,size:"sm",variant:"ghost",children:s("files.refresh")})]}),g.length>0?v.jsx("nav",{"aria-label":s("files.path"),className:"flex flex-wrap items-center gap-1 px-3 pb-2 font-mono text-[11px] text-muted-foreground",children:g.map((N,O)=>v.jsxs("span",{className:"min-w-0 break-all",children:[O>0?v.jsx("span",{"aria-hidden":!0,className:"px-1",children:"/"}):null,v.jsx("button",{"aria-current":O===g.length-1?"location":void 0,className:"text-left hover:text-foreground hover:underline",onClick:()=>w(N.path),title:N.path,type:"button",children:O===0?s("files.root"):N.label})]},N.path))}):null,p?v.jsx("p",{className:"break-all px-3 pb-2 font-mono text-[11px] text-muted-foreground",children:p}):null,l!==null?v.jsxs(v.Fragment,{children:[v.jsxs("p",{className:"break-all px-3 pb-2 font-mono text-[11.5px]",children:[((M=h.data)==null?void 0:M.path)??l,(S==null?void 0:S.size)!==null&&(S==null?void 0:S.size)!==void 0?v.jsxs("span",{className:"ml-2 text-muted-foreground",children:[S.size," B"]}):null]}),h.isFetching?v.jsx(yo,{}):null,h.error?v.jsx(yo,{error:h.error,message:s("files.readFailed"),retry:()=>{h.refetch()}}):null,h.data?v.jsxs(v.Fragment,{children:[h.data.truncated?v.jsx("p",{className:"px-3 pb-2 text-warning text-xs",role:"status",children:s("files.truncated")}):null,v.jsx("pre",{className:"mx-2 overflow-auto rounded-md border border-border bg-muted/40 p-2.5 font-mono text-[11.5px] leading-relaxed",children:h.data.content})]}):null]}):v.jsxs(v.Fragment,{children:[f.isFetching?v.jsx(yo,{}):null,f.error||d.error?v.jsx(yo,{error:f.error??d.error,message:s("files.listFailed"),retry:()=>{d.refetch(),f.refetch()}}):null,!f.error&&!d.error&&!f.isPending&&((D=f.data)==null?void 0:D.entries.length)===0?v.jsx("p",{className:"px-3 py-4 text-muted-foreground text-sm",children:s("drawer.emptyWorkspace")}):null,v.jsx("ul",{className:"flex flex-col gap-px px-2",children:(((_=f.data)==null?void 0:_.entries)??[]).map(N=>v.jsx("li",{children:v.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted/60",onClick:()=>N.kind==="directory"?w(N.path):u(N.path),title:N.path,type:"button",children:[N.kind==="directory"?v.jsx(oz,{className:"size-4 shrink-0 text-muted-foreground"}):v.jsx(iz,{className:"size-4 shrink-0 text-muted-foreground"}),v.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:m9(N.path)}),N.size!==null&&N.kind==="file"?v.jsxs("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:[N.size," B"]}):null]})},N.path))})]})]})}function T9({bot:e,threadId:t}){var d,f;const[s,i]=E.useState("activity"),o=Et(Rc()),{t:l}=mt(),u=(o.error?0:((d=o.data)==null?void 0:d.approvals.filter(h=>h.botId===e.id&&h.status==="pending"&&h.expiresAt>Date.now()).length)??0)+(o.error?0:((f=o.data)==null?void 0:f.questions.filter(h=>h.botId===e.id&&h.status==="pending").length)??0);return v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[v.jsx("div",{className:"flex shrink-0 items-center gap-1 px-2 pb-2",children:p9.map(h=>v.jsxs("button",{"aria-pressed":s===h.id,className:ke("flex items-center gap-1.5 rounded-md px-2 py-1 text-[12px] transition-colors",s===h.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i(h.id),type:"button",children:[h.id==="approvals"?v.jsx(Rk,{className:"size-3.5"}):null,l(h.key),h.id==="approvals"&&u>0?v.jsx("span",{className:"rounded-full bg-warning/15 px-1 text-[10px] text-warning tabular-nums",children:u}):null]},h.id))}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[s==="activity"?v.jsx(x9,{bot:e}):null,s==="approvals"?v.jsx(w9,{bot:e}):null,s==="files"?v.jsx(S9,{bot:e,threadId:t},`${e.id}:${t??"bot"}`):null]})]})}const Ej=E.createContext(void 0);function R9(e){const t=E.useContext(Ej);if(t===void 0)throw new Error(Ts(33));return t}const sw=E.createContext(void 0);function Fa(e){const t=E.useContext(sw);if(t===void 0&&!e)throw new Error(Ts(36));return t}const E9=E.createContext(void 0);function iw(e=!0){const t=E.useContext(E9);if(t===void 0&&!e)throw new Error(Ts(25));return t}const Cj=E.createContext(null);function Aj(e="root"){const t=E.useContext(Cj),s=E.useContext(sw);return t===null||s===void 0?null:(e==="submenu-trigger"?s.virtualFocus||s.parentVirtualFocus:s.virtualFocus)?t:null}const C9={visible:!0,ref:null};function A9(){return C9}function k9(e,t,s="root"){const i=Aj(s),l=((s==="submenu-trigger"?i==null?void 0:i.useSubmenuTrigger:i==null?void 0:i.useItem)??A9)({label:e.label,children:e.children,render:e.render}),u=Ma(t,l.ref);return{visible:l.visible,ref:u,props:l.props}}function M9(e){e.preventDefault()}function N9(e){const{closeOnClick:t,highlighted:s,id:i,nodeId:o,store:l,typingRef:u,itemRef:d,itemMetadata:f}=e,h=Fa(),p=iw(!0),g=f.type==="submenu-trigger",b=g?h.parentVirtualFocus:h.virtualFocus,x=(g&&h.parent.type==="menu"?h.parent.store:h.store).useState("webkitAriaSelected",s),{events:S}=l.useState("floatingTreeRoot"),T=l.useState("open"),A=p!==void 0,C=!b&&T&&s?0:-1;return E.useMemo(()=>({id:i,role:"menuitem",tabIndex:C,"aria-selected":x,onMouseDown:b?M9:void 0,onKeyDown(k){k.key===" "&&(u!=null&&u.current)&&k.preventDefault()},onMouseMove(k){o&&S.emit("itemhover",{nodeId:o,target:k.currentTarget})},onClick(k){t&&S.emit("close",{domEvent:k.nativeEvent,reason:Hx})},onMouseUp(k){if(p){const M=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,A&&M&&Math.abs(k.clientX-M.x)<=1&&Math.abs(k.clientY-M.y)<=1||A&&!Nx&&k.button===2)return}d.current&&l.context.allowMouseUpTriggerRef.current&&(!A||k.button===2)&&f.type==="regular-item"&&Fh(d.current,k,{detail:1,pointerType:"mouse"})}}),[t,C,i,S,o,l.context.allowMouseUpTriggerRef,u,d,p,A,f.type,x,b])}const O9={type:"regular-item"};function j9(e){const{closeOnClick:t,disabled:s,highlighted:i,id:o,store:l,typingRef:u=l.context.typingRef,nativeButton:d,itemMetadata:f,nodeId:h}=e,p=E.useRef(null),{getButtonProps:g,buttonRef:b}=qm({disabled:s,focusableWhenDisabled:!0,native:d,composite:!0}),w=N9({closeOnClick:t,highlighted:i,id:o,nodeId:h,store:l,typingRef:u,itemRef:p,itemMetadata:f}),x=E.useCallback(T=>Di(w,{onMouseEnter(A){f.type==="submenu-trigger"&&f.setActive(A.nativeEvent)}},T,g),[w,g,f]),S=Ma(p,b);return E.useMemo(()=>({getItemProps:x,itemRef:S}),[x,S])}const kj=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function D9(){return E.useContext(kj)}function Mj(e={}){const{guess:t,label:s,metadata:i,textRef:o,index:l}=e,{register:u,unregister:d,subscribeMapChange:f,nextIndexRef:h}=D9(),p=E.useRef(-1),[g,b]=E.useState(l==null&&t?()=>{if(p.current===-1){const T=h.current;h.current+=1,p.current=T}return p.current}:-1),w=l??g,x=E.useRef(null),S=E.useCallback(T=>{const A=x.current;A&&d(A),x.current=T,T&&u(T,{metadata:i??null,index:l??null,label:s,textRef:o})},[l,u,d,i,s,o]);return Me(()=>{if(l==null)return f(T=>{var C;const A=x.current?(C=T.get(x.current))==null?void 0:C.index:null;A!=null&&b(A)})},[l,f]),{ref:S,index:w}}const _9=E.forwardRef(function(t,s){const{render:i,className:o,id:l,label:u,nativeButton:d=!1,disabled:f=!1,closeOnClick:h=!0,style:p,...g}=t,{store:b}=Fa(),w=Mj({guess:!0,label:u}),x=Ro(l),S=b.useState("disabled"),T=b.useState("isActive",w.index),A=b.useState("floatingNodeId"),C=b.useState("itemProps"),k=f||S,{getItemProps:M,itemRef:D}=j9({closeOnClick:h,disabled:k,highlighted:T,id:x,store:b,nativeButton:d,nodeId:A,itemMetadata:O9});return xn("div",t,{state:{disabled:k,highlighted:T},props:[C,g,M],ref:[D,s,w.ref]})}),I9=E.forwardRef(function(t,s){const i=k9(t,s);return i.visible?v.jsx(_9,{...t,ref:i.ref}):null}),P9=E.createContext(void 0);function z9(e){return E.useContext(P9)}function rw(e){return e==="starting"?E4:_t}const L9=E.createContext(void 0);function B9(){return E.useContext(L9)}function U9(e,t){const s=Rx(e.render);if(E.isValidElement(s)){const i=s.props;if(Object.hasOwn(i,"id"))return i.id??""}return e.id??t}function V9(e,t,s){const i=U9(e,t),o=i===t?void 0:i,l=E.useCallback(u=>s==null?void 0:s(u?o:void 0),[o,s]);return[i,l]}function F9(e,t,s){const i=Rx(e.render),o=E.isValidElement(i)?i.props:void 0,l=e["aria-label"]??(o==null?void 0:o["aria-label"]);let u=e["aria-labelledby"]??(o==null?void 0:o["aria-labelledby"]);return u==null&&!l&&(u=t?t.id||void 0:s||void 0),u}const q9=E.forwardRef(function(t,s){var Te;const{render:i,className:o,style:l,finalFocus:u,id:d,initialFocus:f,...h}=t,{store:p,defaultFloatingId:g,setRenderedFloatingId:b,virtualFocus:w,orientation:x}=Fa(),S=B9(),{side:T,align:A}=R9(),C=z9()!=null,k=p.useState("open"),M=p.useState("transitionStatus"),D=p.useState("popupProps"),_=p.useState("mounted"),N=p.useState("instantType"),O=p.useState("activeTriggerElement"),z=p.useState("parent"),I=p.useState("lastOpenChangeReason"),V=p.useState("rootId"),$=p.useState("floatingRootContext"),X=p.useState("floatingTreeRoot"),B=p.useState("closeDelay"),q=p.useState("hoverEnabled"),F=p.useState("disabled"),ie=p.useState("openMethod"),Q=p.useState("activeTriggerId"),ae=p.useState("listElement"),[ne,pe]=V9(t,g,b),ee=F9(t,O,Q),ve=z.type==="menu"?S:void 0,P=z.type==="context-menu";let K=f??z.type!=="menu";f===void 0&&ae&&z.type!=="menu"&&(K=()=>p.state.activeIndex!==null?!1:ae),Jm({open:k,ref:p.context.popupRef,onComplete(){var Pe,Ae;k&&((Ae=(Pe=p.context).onOpenChangeComplete)==null||Ae.call(Pe,!0))}}),E.useEffect(()=>{function Pe(Ae){p.setOpen(!1,ct(Ae.reason,Ae.domEvent))}return X.events.on("close",Pe),()=>{X.events.off("close",Pe)}},[X.events,p]),KM($,{enabled:q&&!F&&!P&&z.type!=="menubar",closeDelay:B});const L=p.useStateSetter("popupElement"),H=((Te=E.useContext(Cj))==null?void 0:Te.useParentHandoff)??G9,{parentVirtualFocusRef:fe,handleFocus:oe}=H(p,z,k,w),ye={transitionStatus:M,side:T,align:A,open:k,nested:z.type==="menu",instant:N},ce=xn("div",t,{state:ye,ref:[s,p.context.popupRef,L,pe],stateAttributesMapping:Dx,props:[D,{id:ne,...ae?{role:"presentation"}:{role:"menu","aria-orientation":x==="horizontal"?"horizontal":void 0,"aria-labelledby":ee},onKeyDown(Pe){var Ae;(Ae=ve==null?void 0:ve.onPopupKeyDown)==null||Ae.call(ve,Pe),C&&sN.has(Pe.key)&&Pe.stopPropagation()},onFocus:oe},rw(M),h,{"data-rootownerid":V}]});let me=z.type===void 0||P;(O||z.type==="menubar"&&I!==qx)&&(me=!0);const ze=(ve==null?void 0:ve.getReturnElement)??fe;return v.jsx(IM,{context:$,openInteractionType:ie,modal:P,disabled:!_,returnFocus:u??ze??me,explicitReturnFocus:u===void 0&&ze?!1:void 0,initialFocus:K,restoreFocus:!0,getInsideElements:z.type===void 0?()=>[p.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:z.type!=="menubar"?X:void 0,previousFocusableElement:O,nextFocusableElement:z.type===void 0?p.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:p.context.beforeContentFocusGuardRef,children:ce})}),H9={parentVirtualFocusRef:void 0,handleFocus:void 0};function G9(){return H9}const K9=E.forwardRef(function(t,s){var o;const i=((o=Aj())==null?void 0:o.Popup)??q9;return v.jsx(i,{...t,ref:s})}),Nj=E.createContext(void 0);function Y9(){const e=E.useContext(Nj);if(e===void 0)throw new Error(Ts(32));return e}const $9=E.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t,{store:l,parent:u}=Fa();if(!(l.useState("mounted")||i))return null;const h=u.type==="menu"||u.type==="menubar"?"group":void 0;return v.jsx(Nj.Provider,{value:i,children:v.jsx(NM,{ref:s,...o,portalOwnerRole:h})})});function Q9(e){const{nodeId:t,externalTree:s,rootContext:i}=e,o=i.useState("referenceElement"),l=i.useState("floatingElement"),u=i.useState("domReferenceElement"),d=i.useState("open"),f=i.useState("floatingId"),[h,p]=E.useState(null),g=E.useRef(null),b=Mo(s),w=E.useMemo(()=>({reference:o,floating:l,domReference:u}),[o,l,u]),x=FU({...e,elements:{...w,...h&&{reference:h}}}),S=E.useCallback(k=>{const M=bt(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;p(M),x.refs.setReference(M)},[x.refs]),T=E.useMemo(()=>({...x.refs,setPositionReference:S,domReference:g}),[x.refs,S]),A=E.useMemo(()=>({...x.elements,domReference:u}),[x.elements,u]),C=E.useMemo(()=>({...x,dataRef:i.context.dataRef,open:d,onOpenChange:i.setOpen,events:i.context.events,floatingId:f,refs:T,elements:A,nodeId:t,rootStore:i}),[x,T,A,t,i,d,f]);return Me(()=>{u&&(g.current=u)},[u]),Me(()=>{i.context.dataRef.current.floatingContext=C;const k=b==null?void 0:b.nodesRef.current.find(M=>M.id===t);k&&(k.context=C)}),E.useMemo(()=>({...x,context:C,refs:T,elements:A,rootStore:i}),[x,T,A,C,i])}const X9=E.createContext(void 0);function Oj(){const e=E.useContext(X9);return(e==null?void 0:e.direction)??"ltr"}const Z9=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:f}=t,{element:h,padding:p=0}=Co(e,t)||{};if(h==null)return{};const g=aM(p),b={x:s,y:i},w=zx(o),x=Px(w),S=await u.getDimensions(h),T=w==="y",A=T?"top":"left",C=T?"bottom":"right",k=T?"clientHeight":"clientWidth",M=l.reference[x]+l.reference[w]-b[w]-l.floating[x],D=b[w]-l.reference[w],_=d.floating[k]||l.floating[x],N=M/2-D/2,O=_/2-S[x]/2-1,z=Math.min(g[A],O),I=Math.min(g[C],O),V=z,$=_-S[x]-I,X=_/2-S[x]/2+N,B=oM(V,X,$),q=!f.arrow&&_i(o)!=null&&X!==B&&l.reference[x]/2-(X<V?z:I)-S[x]/2<0,F=q?X<V?X-V:X-$:0;return{[w]:b[w]+F,data:{[w]:B,centerOffset:X-B-F,...q&&{alignmentOffset:F}},reset:q}}}),W9=(e,t)=>{const{name:s,fn:i}=Z9(e);return{name:s,fn:i,options:[e,t]}},J9={name:"hide",async fn(e){const{width:t,height:s,x:i,y:o}=e.rects.reference,l=t===0&&s===0&&i===0&&o===0,u=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:u.top-s>=0||u.right-t>=0||u.bottom-s>=0||u.left-t>=0||l}}}},eG={sideX:"left",sideY:"top"},tG="--available-width",nG="--available-height",sG="--anchor-width",iG="--anchor-height",rG="--transform-origin",UA=tG,VA=nG;function jj(e,t,s){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?s?"inline-start":"inline-end":"right",bottom:"bottom",left:i?s?"inline-end":"inline-start":"left"}[t]}function FA(e,t,s){const{rects:i,placement:o}=e;return{side:jj(t,xs(o),s),align:_i(o)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Dj(e){return oG(e,Q9)}function oG(e,t){var Ga,Er;const{anchor:s,positionMethod:i="absolute",side:o="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,collisionBoundary:f,collisionPadding:h=5,sticky:p=!1,arrowPadding:g=5,disableAnchorTracking:b=!1,inline:w,keepMounted:x=!1,floatingRootContext:S,mounted:T,collisionAvoidance:A,shift:C,nodeId:k,adaptiveOrigin:M,lazyFlip:D=!1,externalTree:_}=e,N=A.side||"flip",O=A.align||"flip",z=A.fallbackAxisSide||"end",I=(C==null?void 0:C.crossAxis)??!1,V=C==null?void 0:C.rootBoundary,$=typeof s=="function"?s:void 0,X=Le($),B=$?X:s,q=Jt(s),F=Jt(T),Q=Oj()==="rtl",[ae,ne]=E.useState(null);!T&&ae!==null&&ne(null);const pe=D==="placement",ee=ae?xs(ae):null,ve=ae&&pe?_i(ae)||"center":null,P=ee||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Q?"left":"right","inline-start":Q?"right":"left"}[o],K=ve||u,L=K==="center"?P:`${P}-${K}`;let H=h;typeof H=="number"?H={top:H,right:H,bottom:H,left:H}:H&&(H={top:H.top||0,right:H.right||0,bottom:H.bottom||0,left:H.left||0});const fe=1,oe=o==="bottom"?fe:0,ye=o==="top"?fe:0,ce=o==="right"?fe:0,me=o==="left"?fe:0,ze={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:H},Te=E.useRef(null),Pe=Jt(l),Ae=Jt(d),Ge=typeof l!="function"?l:0,Ue=typeof d!="function"?d:0,Se=[];w&&Se.push(w),Se.push(qU(be=>{const Ne=FA(be,o,Q),nt=typeof Pe.current=="function"?Pe.current(Ne):Pe.current,gt=typeof Ae.current=="function"?Ae.current(Ne):Ae.current;return{mainAxis:nt,crossAxis:gt,alignmentAxis:gt}},[Ge,Ue,Q,o]));const Ye=O==="none"&&N!=="shift",xe=!Ye&&(p||I||N==="shift"),Xe=N==="none"?null:KU({...ze,padding:{top:H.top+fe+oe,right:H.right+fe+me,bottom:H.bottom+fe+ye,left:H.left+fe+ce},mainAxis:!I&&N==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),We=Ye?null:HU({...ze,rootBoundary:V,mainAxis:O!=="none",crossAxis:xe,limiter:p||I?void 0:GU(be=>{if(!Te.current)return{};const{width:Ne,height:nt}=Te.current.getBoundingClientRect(),gt=Ps(xs(be.placement)),Zt=gt==="y"?Ne:nt,Bn=gt==="y"?H.left+H.right:H.top+H.bottom;return{offset:Zt/2+Bn/2}})},[ze,p,I,V,H,O]);N==="shift"||O==="shift"||K==="center"?Se.push(We,Xe):Se.push(Xe,We),Se.push(YU({...ze,apply({elements:{floating:be},availableWidth:Ne,availableHeight:nt,rects:gt}){if(!F.current)return;const Zt=be.style;Zt.setProperty(UA,`${Ne}px`),Zt.setProperty(VA,`${nt}px`);const Bn=$t(be).devicePixelRatio||1,{x:Wn,y:qs,width:Vi,height:us}=gt.reference,wn=(Math.round((Wn+Vi)*Bn)-Math.round(Wn*Bn))/Bn,oi=(Math.round((qs+us)*Bn)-Math.round(qs*Bn))/Bn;Zt.setProperty(sG,`${wn}px`),Zt.setProperty(iG,`${oi}px`)}}),W9(be=>({element:Te.current||vt(be.elements.floating).createElement("div"),padding:Te.current?g:0}),[g]),{name:"transformOrigin",fn(be){var _d,Ac,Ya,Cr,Id,kc;const{elements:{floating:Ne},middlewareData:nt,placement:gt,platform:Zt,rects:Bn,y:Wn}=be,qs=xs(gt),Vi=_i(gt),us=Ps(qs)==="y",wn=Te.current,oi=typeof l=="function"?l(FA(be,o,Q)):l;let ai;if(!wn&&Vi&&Math.abs(us?((_d=nt.shift)==null?void 0:_d.x)||0:((Ac=nt.shift)==null?void 0:Ac.y)||0)<=1)ai=Vi==="start"===(us&&((Ya=Zt.isRTL)==null?void 0:Ya.call(Zt,Ne))===!0)?"100%":"0%";else{const Pd=us?((Cr=nt.arrow)==null?void 0:Cr.x)||0:((Id=nt.arrow)==null?void 0:Id.y)||0,zd=us?(wn==null?void 0:wn.clientWidth)||0:(wn==null?void 0:wn.clientHeight)||0;ai=`${Pd+zd/2}px`}let Ka=qs==="top"||qs==="left"?`calc(100% + ${oi}px)`:`${-oi}px`;return xe&&us&&Math.abs(((kc=nt.shift)==null?void 0:kc.y)||0)>oi&&(Ka=`${Bn.reference.y+Bn.reference.height/2-Wn}px`),Ne.style.setProperty(rG,us?`${ai} ${Ka}`:`${Ka} ${ai}`),{}}},J9,M),Me(()=>{!T&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[T,S]);const pt=E.useMemo(()=>({ancestorScroll:!b,elementResize:!b&&typeof ResizeObserver<"u",layoutShift:!b&&typeof IntersectionObserver<"u"}),[b]),{refs:le,elements:he,x:Ke,y:Ee,middlewareData:we,update:ot,placement:Ze,context:wt,isPositioned:on,floatingStyles:Vt}=t({rootContext:S,open:x?T:void 0,placement:L,middleware:Se,strategy:i,whileElementsMounted:x?void 0:(...be)=>iC(...be,pt),nodeId:k,externalTree:_}),{sideX:Rs,sideY:cs}=we.adaptiveOrigin||eG,ii=on?i:"fixed",Li=E.useMemo(()=>{let be;return on?M?be={position:ii,[Rs]:Ke,[cs]:Ee}:be={...Vt,position:ii}:be={position:ii,top:0,left:0},be[UA]="100vw",be[VA]="100vh",on||(be.opacity=0),be},[M,ii,Rs,Ke,cs,Ee,Vt,on]),Ut=E.useRef(null);Me(()=>{if(!T)return;const be=q.current,Ne=typeof be=="function"?be():be,gt=(qA(Ne)?Ne.current:Ne)||null||null;gt!==Ut.current&&(le.setPositionReference(gt),Ut.current=gt)},[T,le,B,q]),E.useEffect(()=>{if(!T)return;const be=q.current;typeof be!="function"&&qA(be)&&be.current!==Ut.current&&(le.setPositionReference(be.current),Ut.current=be.current)},[T,le,B,q]),E.useEffect(()=>{if(x&&T&&he.reference&&he.floating)return iC(he.reference,he.floating,ot,pt)},[x,T,he,ot,pt]);const Es=xs(Ze),Bi=jj(o,Es,Q),ri=_i(Ze)||"center",Ui=!!((Ga=we.hide)!=null&&Ga.referenceHidden);Me(()=>{D&&T&&on&&(Es!==P||pe&&ri!==K)&&ne(Ze)},[D,pe,T,on,Ze,Es,ri,P,K]);const Ha=E.useMemo(()=>{var be,Ne;return{position:"absolute",top:(be=we.arrow)==null?void 0:be.y,left:(Ne=we.arrow)==null?void 0:Ne.x}},[we.arrow]),jo=((Er=we.arrow)==null?void 0:Er.centerOffset)!==0;return E.useMemo(()=>({positionerStyles:Li,arrowStyles:Ha,arrowRef:Te,arrowUncentered:jo,side:Bi,align:ri,physicalSide:Es,anchorHidden:Ui,refs:le,context:wt,isPositioned:on,update:ot}),[Li,Ha,Te,jo,Bi,ri,Es,Ui,le,wt,on,ot])}function qA(e){return e!=null&&"current"in e}function aG(e){const{children:t,elementsRef:s,labelsRef:i,onMapChange:o}=e,l=Le(o),[,u]=E.useState(0),d=bn(cG).current,f=bn(lG).current,h=E.useRef(0),p=E.useRef(!0),g=E.useRef(null),b=E.useRef(null),w=Le(()=>{p.current||(p.current=!0,u(D=>D+1))}),x=Le((D,_)=>{f.set(D,_),w()}),S=Le(D=>{f.delete(D),w()}),T=Le(D=>{const _=new Map;return s.current.length=0,i&&(i.current.length=0),D.forEach(N=>{var O,z;_.set(N.element,{...N.registration.metadata??{},index:N.index}),s.current[N.index]=N.element,i&&(i.current[N.index]=N.registration.label!==void 0?N.registration.label:((z=(O=N.registration.textRef)==null?void 0:O.current)==null?void 0:z.textContent)??N.element.textContent)}),h.current=s.current.length,_});function A(D){var O;if((O=b.current)==null||O.disconnect(),b.current=null,typeof MutationObserver!="function"||D.length<2)return;const _=new MutationObserver(z=>{if(!fG(z))return;let I=null;for(const V of D)if(V.isConnected){if(I&&_j(I,V)>0){_.disconnect(),w();return}I=V}});b.current=_;const N=new Set;for(let z=1;z<D.length;z+=1){const I=dG(D[z-1],D[z]);I&&N.add(I)}N.forEach(z=>_.observe(z,{childList:!0}))}const C=Le(()=>{const[D,_]=uG(f),N=T(D),O=g.current,z=!O||O.length!==D.length||D.some((I,V)=>{const $=O[V];return I.index!==$.index||I.element!==$.element||I.registration.index!==$.registration.index||I.registration.metadata!==$.registration.metadata});A(_),g.current=D,p.current=!1,z&&(d.forEach(I=>I(N)),l(N))});Me(()=>(!p.current&&g.current&&T(g.current),()=>{s.current=[],i&&(i.current=[])}),[s,i,T]),Me(()=>{p.current&&C()}),Me(()=>()=>{var D;(D=b.current)==null||D.disconnect(),p.current=!0},[]);const k=Le(D=>(d.add(D),()=>{d.delete(D)})),M=E.useMemo(()=>({register:x,unregister:S,subscribeMapChange:k,nextIndexRef:h}),[x,S,k,h]);return v.jsx(kj.Provider,{value:M,children:t})}function lG(){return new Map}function cG(){return new Set}function uG(e){const t=new Set,s=[],i=[];e.forEach((l,u)=>{if(!u.isConnected)return;const d=l.index,f={index:d??-1,element:u,registration:l};d===null?i.push(f):d>=0&&(t.add(d),s.push(f))});let o=0;return i.sort((l,u)=>_j(l.element,u.element)),i.forEach(l=>{for(;t.has(o);)o+=1;l.index=o,s.push(l),o+=1}),t.size>0&&s.sort((l,u)=>l.index-u.index),[s,i.map(l=>l.element)]}function dG(e,t){let s=e.parentElement;for(;s&&!s.contains(t);)s=s.parentElement;return s}function fG(e){for(const t of e)for(let s=0;s<t.removedNodes.length;s+=1)if(t.removedNodes[s].isConnected)return!0;return!1}function _j(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function hG(e){const{store:t,domReference:s,positionerElement:i,open:o}=e,l=E.useRef(null),u=E.useRef(null),d=Fx(i);Me(()=>{var f;o||((f=u.current)==null||f.abort(),u.current=null,t.state.instantType==="trigger-change"&&t.set("instantType",void 0))},[o,t]),Me(()=>{const f=s,h=l.current;if(f&&(l.current=f),!h||!f||f===h||!t.select("open"))return;t.set("instantType",void 0);const p=new AbortController;return u.current=p,d(()=>{t.select("open")&&t.set("instantType","trigger-change")},p.signal),()=>{p.abort()}},[s,d,t])}function Ij(e,t,{styles:s,transitionStatus:i,props:o,refs:l,hidden:u,inert:d=!1}){const f={...s};return d&&(f.pointerEvents="none"),xn("div",e,{state:t,ref:l,props:[{role:"presentation",hidden:u,style:f},rw(i),o],stateAttributesMapping:Qm})}const mG=20;function pG(e,t,s,i){const[o,l]=E.useState(!1);Me(()=>{if(!e||!t||s==null){l(!1);return}const u=vt(s).documentElement.clientWidth,d=s.offsetWidth;l(u>0&&d>0&&d>=u-mG)},[e,t,s]),lN(e&&(!t||o),i)}const gG=E.forwardRef(function(t,s){var Ye;const{anchor:i,positionMethod:o="absolute",className:l,render:u,side:d,align:f,sideOffset:h=0,alignOffset:p=0,collisionBoundary:g="clipping-ancestors",collisionPadding:b=5,arrowPadding:w=5,sticky:x=!1,disableAnchorTracking:S=!1,collisionAvoidance:T=A4,style:A,...C}=t,{store:k,virtualFocus:M,syncHighlightedItem:D}=Fa(),_=Y9(),N=iw(!0),O=k.useState("parent"),z=k.useState("floatingRootContext"),I=k.useState("floatingTreeRoot"),V=k.useState("mounted"),$=k.useState("open"),X=k.useState("modal"),B=k.useState("openMethod"),q=k.useState("activeTriggerElement"),F=k.useState("transitionStatus"),ie=k.useState("positionerElement"),Q=k.useState("instantType"),ae=k.useState("adaptiveOrigin"),ne=k.useState("lastOpenChangeReason"),pe=k.useState("floatingNodeId"),ee=k.useState("floatingParentNodeId"),ve=z.useState("domReferenceElement");let P=i,K=h,L=p,H=f,fe=T;O.type==="context-menu"&&(P=i??((Ye=O.context)==null?void 0:Ye.anchor),H=H??"start",!d&&H!=="center"&&(L=t.alignOffset??2,K=t.sideOffset??-5));let oe=d,ye=H;O.type==="menu"?(oe=oe??"inline-end",ye=ye??"start",fe=t.collisionAvoidance??CM):O.type==="menubar"&&(oe=oe??(O.context.orientation==="vertical"?"inline-end":"bottom"),ye=ye??"start");const ce=O.type==="context-menu",me=Dj({anchor:P,floatingRootContext:z,positionMethod:N?"fixed":o,mounted:V,side:oe,sideOffset:K,align:ye,alignOffset:L,arrowPadding:ce?0:w,collisionBoundary:g,collisionPadding:b,sticky:x,nodeId:pe,keepMounted:_,disableAnchorTracking:S,collisionAvoidance:fe,shift:ce?{crossAxis:!("side"in fe&&fe.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:I,adaptiveOrigin:ae,lazyFlip:M?"placement":!1});E.useEffect(()=>{function xe(Xe){Xe.open&&(Xe.parentNodeId===pe&&k.set("hoverEnabled",!1),Xe.nodeId!==pe&&Xe.parentNodeId===k.select("floatingParentNodeId")&&k.setOpen(!1,ct(Du)))}return I.events.on("menuopenchange",xe),()=>{I.events.off("menuopenchange",xe)}},[k,I.events,pe]),E.useEffect(()=>{if(k.select("floatingParentNodeId")==null)return;function xe(Xe){if(Xe.open||Xe.nodeId!==k.select("floatingParentNodeId"))return;const We=Xe.reason??Du;k.setOpen(!1,ct(We))}return I.events.on("menuopenchange",xe),()=>{I.events.off("menuopenchange",xe)}},[I.events,k]);const ze=Ln();E.useEffect(()=>{$||ze.clear()},[$,ze]),E.useEffect(()=>{function xe(Xe){if(!(!$||Xe.nodeId!==k.select("floatingParentNodeId")))if(Xe.target&&q&&q!==Xe.target){const We=k.select("closeDelay");We>0?ze.isStarted()||ze.start(We,()=>{k.setOpen(!1,ct(Du))}):k.setOpen(!1,ct(Du))}else ze.clear()}return I.events.on("itemhover",xe),()=>{I.events.off("itemhover",xe)}},[I.events,$,q,k,ze]),E.useEffect(()=>{const xe={open:$,nodeId:pe,parentNodeId:ee,reason:k.select("lastOpenChangeReason")};I.events.emit("menuopenchange",xe)},[I.events,$,k,pe,ee]),hG({store:k,domReference:ve,positionerElement:ie,open:$});const Te={open:$,side:me.side,align:me.align,anchorHidden:me.anchorHidden,nested:O.type==="menu",instant:Q},Pe=O.type==="menubar"&&O.context.modal;pG($&&(Pe||X&&ne!==hn),B==="touch",ie,q);const Ge=Ij(t,Te,{styles:me.positionerStyles,transitionStatus:F,props:C,refs:[s,k.useStateSetter("positionerElement")],hidden:!V,inert:!$}),Ue=V&&O.type!=="menu"&&(O.type!=="menubar"&&X&&ne!==hn||O.type==="menubar"&&O.context.modal);let Se=null;return O.type==="menubar"?Se=O.context.contentElement:O.type===void 0&&(Se=q),v.jsxs(Ej.Provider,{value:me,children:[Ue&&v.jsx(oN,{ref:O.type==="context-menu"||O.type==="nested-context-menu"?O.context.internalBackdropRef:null,inert:rN(!$),cutout:Se}),v.jsx(N4,{id:pe,children:v.jsx(aG,{elementsRef:k.context.itemDomElements,labelsRef:k.context.itemLabels,onMapChange:D,children:Ge})})]})}),yG=E.createContext(null);function Pj(e){return E.useContext(yG)}function vG(e){return e==null?Na:e.type.startsWith("key")?bM:e.type.startsWith("mouse")||e.type.startsWith("pointer")?c4:Na}const bG={...zu,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{var i;const s=zu.triggerPopupId(e,t);return s?((i=e.listElement)==null?void 0:i.id)||s:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Sr&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>{var t;return((t=e.highlightedItem)==null?void 0:t.id)||void 0},isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType==="trigger-change"&&!zu.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class xG extends np{constructor(t,s,i=!1){const o=new t0,l=SG(o,s,i,t);super(l,wG(o),bG),this.observe("parent",u=>{u.type==="menu"?this.context.allowMouseUpTriggerRef=u.store.context.allowMouseUpTriggerRef:u.type!==void 0&&(this.context.allowMouseUpTriggerRef=u.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){const t=this.state.parent;if(t.type!=="menu")return;let s=t.store.select("rootId"),i=t.store.select("floatingTreeRoot"),o=t.store.select("keyboardEventRelay");return t.store.subscribe(()=>{const l=t.store.select("rootId"),u=t.store.select("floatingTreeRoot"),d=t.store.select("keyboardEventRelay");s===l&&i===u&&o===d||(s=l,i=u,o=d,this.notifyAll())})}setOpen(t,s){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:s})}setActiveIndex(t,s,i){if(this.state.activeIndex!==t){const l=(t===null?void 0:this.context.itemDomElements.current[t])===this.context.reportedItem;this.context.highlightReason=l?"none":s,this.context.highlightEvent=l?void 0:i}this.set("activeIndex",t)}highlightItem(t,s,i){const o=this.context.itemDomElements.current.indexOf(t);o>-1&&this.setActiveIndex(o,s,i)}}function wG(e){return{positionerRef:E.createRef(),popupRef:E.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:E.createRef(),beforeTriggerFocusGuardRef:E.createRef(),beforeContentFocusGuardRef:E.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function SG(e,t,s=!1,i){return{...s0(e,t,s),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:_t,inputProps:_t,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Kx,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:_t,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...i}}const HA=E.createContext(null);function zj(e,t){return(e===Tc||e===Hx)&&(t==null?void 0:t.detail)===0}function TG(e,t){return e===hm||zj(e,t)}const RG=tp(function(t){const{children:s,open:i,onOpenChange:o,onOpenChangeComplete:l,onItemHighlighted:u,defaultOpen:d=!1,disabled:f=!1,modal:h,loopFocus:p=!0,orientation:g="vertical",actionsRef:b,closeParentOnEsc:w=!1,handle:x,triggerId:S,defaultTriggerId:T=null,highlightItemOnHover:A=!0,isSubmenu:C=!1,virtualFocus:k=!1,virtualFocusRef:M,allowEscape:D=!0,resetOnPointerLeave:_=!0}=t,N=iw(!0),O=Fa(!0),z=Pj(!0),I=O==null?void 0:O.store,V=(O==null?void 0:O.virtualFocus)??!1,$=E.useMemo(()=>C&&I?{type:"menu",store:I}:z?{type:"menubar",context:z}:N&&!I?{type:"context-menu",context:N}:{type:void 0},[N,I,z,C]),X=Ro(),B=Ro(),[q,F]=E.useState(void 0),ie=(q??B)||void 0,Q=Ua(),ae=$.type==="menu"?$.store:void 0,ne=(i??d)&&(ae==null?void 0:ae.state.transitionStatus)==="starting",pe=bn(()=>ne?ae==null?void 0:ae.state.instantType:void 0).current,ee=bn(()=>{const be=new xG({open:d,openProp:i,activeTriggerId:T,triggerIdProp:S,parent:$,disabled:f,highlightItemOnHover:A,modal:$.type===void 0?h:void 0,rootId:X,instantType:pe},ie,Q!=null);return be.context.virtualFocusRef=M,be}).current;ee.useControlledProp("openProp",i),ee.useControlledProp("triggerIdProp",S),ee.useContextCallback("onOpenChangeComplete",l);const ve=ee.useState("floatingTreeRoot"),P=_M(ve),K=ee.useState("open"),L=ee.useState("activeTriggerElement"),H=ee.useState("positionerElement"),fe=ee.useState("hoverEnabled"),oe=ee.useState("disabled"),ye=ee.useState("lastOpenChangeReason"),ce=ee.useState("parent"),me=ee.useState("activeIndex"),ze=ee.useState("keyboardOpen"),Te=ee.useState("payload"),Pe=ee.useState("floatingParentNodeId"),Ae=E.useRef(null),Ge=E.useRef(ce.type!=="context-menu"),Ue=Ln(),Se=E.useRef(!0),Ye=Ln(),xe=Pe!=null,{openMethod:Xe,triggerProps:We}=v6(K);ee.useSyncedValues({disabled:f,highlightItemOnHover:A,modal:ce.type===void 0?h:void 0,openMethod:Xe,rootId:X}),Wx(ee);const{forceUnmount:pt,transitionStatus:le}=Jx(K,ee,()=>{ee.set("allowMouseEnter",!1)},ne),he=Fx(ee.context.popupRef);E.useEffect(()=>{if(pe===void 0)return;const be=()=>{ee.state.instantType===pe&&ee.set("instantType",void 0)};if(!K){be();return}if(le!==void 0)return;if(ee.context.popupRef.current==null){be();return}const Ne=new AbortController;return he(be,Ne.signal),()=>{Ne.abort()}},[pe,K,le,he,ee]),Me(()=>{N&&!O?ee.update({parent:{type:"context-menu",context:N},floatingNodeId:P,floatingParentNodeId:Q}):(O||!ee.select("activeTriggerElement"))&&ee.update({floatingNodeId:P,floatingParentNodeId:Q})},[N,O,P,Q,L,ee]),E.useEffect(()=>{if(K||(Ae.current=null),ce.type==="context-menu"){if(!K){Ue.clear(),Ge.current=!1;return}Ue.start(500,()=>{Ge.current=!0})}},[Ue,K,ce.type]),Me(()=>{!K&&!fe&&ee.set("hoverEnabled",!0)},[K,fe,ee]);const Ke=Le((be,Ne)=>{const nt=Ne.reason;if(!be&&!ee.select("open")||K===be&&Ne.trigger===L&&ye===nt)return;const gt=LM(Ne);if(!be&&Ne.trigger==null&&(Ne.trigger=L??void 0),o==null||o(be,Ne),Ne.isCanceled)return;ee.state.floatingRootContext.dispatchOpenChange(be,Ne);const Zt=Ne.event;if(be===!1&&nt!==Hx&&(Zt==null?void 0:Zt.type)==="click"&&Zt.pointerType==="touch"&&!Se.current)return;be&&nt===Xl?(Se.current=!1,Ye.start(300,()=>{Se.current=!0})):(Se.current=!0,Ye.clear());const Bn=!be&&(nt===ep||nt==null);Ae.current=Ne.event;const Wn=Zx(ee.state,be,Ne.trigger,gt());Wn.openChangeReason=nt,Wn.keyboardOpen=be&&TG(nt,Zt),ce.type==="menubar"&&(nt===Xl||nt===gc||nt===hn||nt===hm||nt===Du)?Wn.instantType="group":zj(nt,Zt)?Wn.instantType="click":Bn?Wn.instantType="dismiss":Wn.instantType=void 0,ee.update(Wn)}),Ee=PM({popupStore:ee,floatingRootContext:ee.state.floatingRootContext,floatingId:ie,nested:Q!=null,onOpenChange:Ke}),we=Ee.context.events;Me(()=>{const be=({open:Ne,eventDetails:nt})=>Ke(Ne,nt);return we.on("setOpen",be),()=>{we==null||we.off("setOpen",be)}},[we,Ke]),Me(()=>ee.subscribeToParentMenu(),[ee]);const ot=E.useCallback(()=>{ee.setOpen(!1,ct(Gx))},[ee]);E.useImperativeHandle(b,()=>({unmount:pt,close:ot}),[pt,ot]);let Ze;ce.type==="context-menu"&&(Ze=ce.context),E.useImperativeHandle(Ze==null?void 0:Ze.positionerRef,()=>H,[H]),E.useImperativeHandle(Ze==null?void 0:Ze.actionsRef,()=>({setOpen:Ke}),[Ke]);const wt=$x(Ee,{enabled:!oe,bubbles:{escapeKey:w&&ce.type==="menu"},outsidePress(){var be;return ce.type!=="context-menu"||((be=Ae.current)==null?void 0:be.type)==="contextmenu"?!0:Ge.current},externalTree:xe?ve:void 0}),on=Oj(),Vt=rU(Ee,{enabled:!oe,listRef:ee.context.itemDomElements,activeIndex:me,virtual:k,nested:ce.type==="menubar"||!k&&ce.type!==void 0,parentOrientation:ce.type==="menubar"?ce.context.orientation:void 0,loopFocus:p,focusItemOnOpen:k?ze:void 0,allowEscape:k&&p&&D,orientation:g,triggerOrientation:k?"vertical":g,rtl:on==="rtl",disabledIndices:ed,onNavigate(be,Ne){ee.setActiveIndex(be,vG(Ne),Ne==null?void 0:Ne.nativeEvent)},openOnArrowKeyDown:ce.type!=="context-menu"&&!(k&&C),externalTree:!k&&xe?ve:void 0,nestedReturnFocusRef:ae==null?void 0:ae.context.virtualFocusRef,focusItemOnHover:A,resetOnPointerLeave:_}),Rs=E.useCallback(be=>{ee.context.typingRef.current=be},[ee]),cs=oU(Ee,{enabled:!oe&&!k,listRef:ee.context.itemLabels,elementsRef:ee.context.itemDomElements,activeIndex:me,resetMs:T4,onMatch:(be,Ne)=>{K&&be!==me&&ee.setActiveIndex(be,bM,Ne.nativeEvent)},onTyping:Rs}),ii=Le(u),Li=E.useRef(-1),Ut=Le(()=>{const be=ee.state.activeIndex,Ne=be===null?void 0:ee.context.itemDomElements.current[be]??void 0;if((Ne==null?void 0:Ne.isConnected)===!1)return;const nt=Ne===void 0?-1:be;if(Li.current===nt&&ee.context.reportedItem===Ne)return;Li.current=nt,ee.context.reportedItem=Ne,k&&ee.set("highlightedItem",Ne);const{highlightReason:gt,highlightEvent:Zt}=ee.context;ee.context.highlightReason=Na,ee.context.highlightEvent=void 0,u&&ii(Ne,a4(gt,Zt,{label:Ne===void 0?void 0:ee.context.itemLabels.current[nt]??void 0}))});Me(()=>{Ut()},[me,Ut]);const Es=E.useMemo(()=>{if(!k)return Vt.reference;if(!Vt.trigger)return _t;const{onFocus:be,...Ne}=Vt.trigger;return Ne},[k,Vt.reference,Vt.trigger]);ee.useSyncedValue("inputProps",k?Vt.reference??_t:_t);const Bi=E.useMemo(()=>{const be=Di(cs.reference,Es,wt.reference,{onMouseMove(){ee.set("allowMouseEnter",!0)}},We);return be["aria-haspopup"]="menu",be["aria-expanded"]=K,be},[ee,cs.reference,Es,wt.reference,We,K]),ri=E.useMemo(()=>{const be=Di(Vt.trigger,wt.trigger,We);return be["aria-haspopup"]="menu",be["aria-expanded"]=!1,be},[Vt.trigger,wt.trigger,We]);bn(()=>(ee.update({inactiveTriggerProps:ri}),null));const Ui=E.useMemo(()=>Di(Qx,{onMouseMove(){ee.set("allowMouseEnter",!0),ce.type==="menu"&&ee.set("hoverEnabled",!1)},onClick(){ee.select("hoverEnabled")&&ee.set("hoverEnabled",!1)},onKeyDown(be){const Ne=ee.select("keyboardEventRelay");Ne&&!be.isPropagationStopped()&&Ne(be)}},cs.floating,Vt.floating,wt.floating),[ce.type,ee,cs.floating,Vt.floating,wt.floating]),Ha=Vt.item??_t;e0(ee,{floatingRootContext:Ee,activeTriggerProps:Bi,inactiveTriggerProps:ri,popupProps:Ui,itemProps:Ha});const jo=E.useMemo(()=>({store:ee,parent:$,orientation:g,loopFocus:p,allowEscape:D,defaultFloatingId:B,setRenderedFloatingId:F,virtualFocus:k,parentVirtualFocus:V,syncHighlightedItem:Ut}),[ee,$,g,p,D,B,k,V,Ut]),Ga=typeof s=="function"?s({payload:Te}):s;let Er=v.jsxs(sw.Provider,{value:jo,children:[x&&v.jsx(Xx,{handle:x,store:ee}),Ga]});return(ce.type===void 0||ce.type==="context-menu")&&(Er=v.jsx(O4,{externalTree:ve,children:Er})),Er});function EG(e){const t=E.useContext(HA);if(t===null)return v.jsx(RG,{...e});const s=t.Root;return v.jsx(HA.Provider,{value:null,children:v.jsx(s,{...t.options,...e})})}const _h=5;function CG(e,t){const s=AG(t);return e.clientX>=s.left-_h&&e.clientX<=s.right+_h&&e.clientY>=s.top-_h&&e.clientY<=s.bottom+_h}function AG(e){const t=e.getBoundingClientRect(),s=$t(e);if(Ox)return t;const i=s.getComputedStyle(e,"::before"),o=s.getComputedStyle(e,"::after");if(!(i.content!=="none"||o.content!=="none"))return t;const u=parseFloat(i.width)||0,d=parseFloat(i.height)||0,f=parseFloat(o.width)||0,h=parseFloat(o.height)||0,p=Math.max(t.width,u,f),g=Math.max(t.height,d,h),b=p-t.width,w=g-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-w/2,bottom:t.bottom+w/2}}function kG(e={}){const{highlightItemOnHover:t,highlightedIndex:s,onHighlightedIndexChange:i}=Sx(),{ref:o,index:l}=Mj(e),u=s===l,d=E.useRef(null),f=Ma(o,d);return{compositeProps:{tabIndex:u?0:-1,onFocus(){i(l)},onMouseMove(){const p=d.current;if(!t||!p)return;const g=p.hasAttribute("disabled")||p.ariaDisabled==="true";!u&&!g&&p.focus()}},compositeRef:f,index:l}}function MG(e){const{render:t,className:s,style:i,state:o=_t,props:l=ed,refs:u=ed,metadata:d,stateAttributesMapping:f,tag:h="div",...p}=e,{compositeProps:g,compositeRef:b}=kG({metadata:d});return xn(h,e,{state:o,ref:[b,...u],props:[g,...l,p],stateAttributesMapping:f})}function Lj(e){if(Bt(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!pr(e))return Lj(vr(e))}function NG(e,t){function s(l,u,d){var h;const f=l.currentTarget;Tr.flushSync(()=>{e.setOpen(!1,ct(gc,l.nativeEvent,f))}),(h=e4(f.isConnected?f:t.current,u,d))==null||h.focus()}function i(l){s(l,-1,e.select("positionerElement"))}function o(l){var d;const u=e.select("positionerElement");u&&Ql(l,u)?(d=e.context.beforeContentFocusGuardRef.current)==null||d.focus():s(l,1,u)}return{handlePreFocusGuardFocus:i,handleFocusTargetFocus:o}}function OG(e){const{enabled:t=!0,mouseDownAction:s,open:i}=e,o=E.useRef(!1);return E.useMemo(()=>t?{onMouseDown:l=>{(s==="open"&&!i||s==="close"&&i)&&(o.current=!0,vt(l.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:l=>{o.current&&(o.current=!1,l.preventBaseUIHandler())}}:_t,[t,s,i])}const jG=UM(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,id:f,openOnHover:h,delay:p=100,closeDelay:g=0,handle:b,payload:w,...x}=t,S=Fa(!0),A=qM(b)??(S==null?void 0:S.store);if(!A)throw new Error(Ts(85));const C=Ro(f),k=A.useState("isTriggerActive",C),M=A.useState("floatingRootContext"),D=A.useState("isOpenedByTrigger",C),_=A.useState("triggerControlsId",C),N=E.useRef(null),O=_G(),z=Sx(!0),I=Mo(),V=E.useMemo(()=>I??new Kx,[I]),$=_M(V),X=Ua(),{registerTrigger:B,isMountedByThisTrigger:q}=BM(C,N,A,{payload:w,closeDelay:g,parent:O,floatingTreeRoot:V,floatingNodeId:$,floatingParentNodeId:X,keyboardEventRelay:z==null?void 0:z.relayKeyboardEvent}),F=O.type==="menubar",ie=A.useState("disabled"),Q=u||ie||F&&O.context.disabled,{getButtonProps:ae,buttonRef:ne}=qm({disabled:Q,native:d});E.useEffect(()=>{!D&&O.type===void 0&&(A.context.allowMouseUpTriggerRef.current=!1)},[A,D,O.type]);const pe=E.useRef(null),ee=Ln(),ve=Le(Ye=>{if(!pe.current)return;ee.clear(),A.context.allowMouseUpTriggerRef.current=!1;const xe=Ye.target;qe(pe.current,xe)||qe(A.select("positionerElement"),xe)||xe===pe.current||xe!=null&&Lj(xe)===A.select("rootId")||CG(Ye,pe.current)||V.events.emit("close",{domEvent:Ye,reason:u4})});E.useEffect(()=>{const Ye=vt(pe.current);if(D&&A.select("lastOpenChangeReason")===hn)return Ye.addEventListener("mouseup",ve,{once:!0}),()=>{Ye.removeEventListener("mouseup",ve)}},[D,ve,A]);const P=F&&O.context.hasSubmenuOpen,L=YM(M,{enabled:(h??P)&&!Q&&(!F||P&&!q),handleClose:$M({blockPointerEvents:!F}),mouseOnly:!0,move:!1,restMs:O.type===void 0?p:void 0,delay:{close:g},triggerElementRef:N,externalTree:V,isActiveTrigger:k,isClosing:()=>A.select("transitionStatus")==="ending"}),H=DG(D,A.select("lastOpenChangeReason")),fe=_4(M,{enabled:!Q,event:D&&F?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:O.type===void 0?H:!1}),oe=HM(M,{enabled:!Q&&P}),ye=OG({open:D,enabled:F,mouseDownAction:"open"}),ce=E.useMemo(()=>Di(oe.reference,fe.reference),[oe.reference,fe.reference]),me=A.useState("triggerProps",q),ze=A.useState("filterTriggerProps"),{handlePreFocusGuardFocus:Te,handleFocusTargetFocus:Pe}=NG(A,N),Ae={disabled:Q,open:D},Ge=[pe,s,ne,B,N],Ue=[ce,L??_t,me,{"aria-haspopup":"menu","aria-controls":_,id:C,onMouseDown:Ye=>{if(A.select("open"))return;ee.start(200,()=>{A.context.allowMouseUpTriggerRef.current=!0}),vt(Ye.currentTarget).addEventListener("mouseup",ve,{once:!0})}},ze,F?{role:"menuitem"}:{},ye,x,ae],Se=xn("button",t,{enabled:!F,stateAttributesMapping:DE,state:Ae,ref:Ge,props:Ue});return F?v.jsx(MG,{tag:"button",render:i,className:o,style:l,state:Ae,refs:Ge,props:Ue,stateAttributesMapping:DE}):D?v.jsxs(E.Fragment,{children:[v.jsx(yc,{ref:A.context.beforeTriggerFocusGuardRef,onFocus:Te},`${C}-pre-focus-guard`),v.jsx(E.Fragment,{children:Se},C),v.jsx(yc,{ref:A.context.triggerFocusTargetRef,onFocus:Pe},`${C}-post-focus-guard`)]}):v.jsx(E.Fragment,{children:Se},C)});function DG(e,t){const s=Ln(),[i,o]=E.useState(!1);return Me(()=>{e&&t===hn?(o(!0),s.start(R4,()=>{o(!1)})):e||(s.clear(),o(!1))},[e,t,s]),i}function _G(){const e=Pj();return E.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}function IG({...e}){return v.jsx(EG,{"data-slot":"dropdown-menu",...e})}function PG({...e}){return v.jsx(jG,{"data-slot":"dropdown-menu-trigger",...e})}function zG({align:e="start",alignOffset:t=0,side:s="bottom",sideOffset:i=4,className:o,...l}){return v.jsx($9,{children:v.jsx(gG,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:s,sideOffset:i,children:v.jsx(K9,{"data-slot":"dropdown-menu-content",className:ke("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...l})})})}function Pv({className:e,inset:t,variant:s="default",...i}){return v.jsx(I9,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:ke("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...i})}function LG({className:e,...t}){return v.jsx(Wk,{"data-slot":"dropdown-menu-separator",className:ke("-mx-1 my-1 h-px bg-border",e),...t})}async function BG(e,{botId:t,threadId:s}){await e.deleteThread(s);try{const i=await e.listThreads(t),o=i.length>0?i:[await e.createThread(t)];return{botId:t,threadId:s,threads:o}}catch{return{botId:t,threadId:s,threads:void 0}}}async function UG(e,t,s){const i=He.threads(t.botId);await e.cancelQueries({queryKey:i}),e.setQueryData(i,l=>t.threads??(l==null?void 0:l.filter(u=>u.id!==t.threadId))),e.removeQueries({queryKey:He.messages(t.threadId)}),t.threads===void 0&&e.invalidateQueries({queryKey:i});const o=`/bots/${encodeURIComponent(t.botId)}/threads/${encodeURIComponent(t.threadId)}`;s.getPathname()===o&&await s.navigateToBot(t.botId)}function VG(e){return v.jsx(FG,{...e},e.botId)}function FG({botId:e,threadId:t,onDrawerChange:s,drawerOpen:i}){var O,z,I,V,$,X;const o=Et(_6(e)),l=Et(I6(e)),u=Et(Rc()),d=Et(op(e)),f=Us(),h=si(),p=Vs(),{openRail:g}=nw(),{t:b}=mt(),[w,x]=E.useState(!1),S=t?(O=l.data)==null?void 0:O.find(B=>B.id===t):(z=l.data)==null?void 0:z[0];E.useEffect(()=>{o.data&&vc(o.data.id)},[o.data]),E.useEffect(()=>{if(!o.isSuccess||o.data!==null)return;f0(e,f);const B=p.state.location.pathname,q=`/bots/${encodeURIComponent(e)}`;(B===q||B.startsWith(`${q}/`))&&h({to:"/"})},[o.isSuccess,o.data,e,h,f,p]);const T=S==null?void 0:S.id,A=(S==null?void 0:S.unread)??0;E.useEffect(()=>{!T||A===0||Yt().markThreadRead(T)},[T,A]);const C=On({mutationFn:B=>Yt().createThread(B),onSuccess:async(B,q)=>{await f.invalidateQueries({queryKey:He.threads(q)});const F=p.state.location.pathname,ie=`/bots/${encodeURIComponent(q)}`;F!==ie&&!F.startsWith(`${ie}/`)||await h({params:{botId:q,threadId:B.id},to:"/bots/$botId/threads/$threadId"})}}),k=On({mutationFn:B=>BG(Yt(),B),onSuccess:B=>UG(f,B,{getPathname:()=>p.state.location.pathname,navigateToBot:q=>h({params:{botId:q},to:"/bots/$botId"})})}),M=On({mutationFn:B=>Yt().setPaused(B.botId,B.paused),onSuccess:(B,q)=>{f.invalidateQueries({queryKey:He.bot(q.botId)}),f.invalidateQueries({queryKey:He.bots()})}}),D=(((I=u.data)==null?void 0:I.approvals.filter(B=>B.botId===e&&B.status==="pending"&&B.expiresAt>Date.now()).length)??0)+(((V=u.data)==null?void 0:V.questions.filter(B=>B.botId===e&&B.status==="pending").length)??0),_=v.jsx(Be,{"aria-label":b("cockpit.openNav"),className:"lg:hidden",onClick:g,size:"sm",variant:"outline",children:b("cockpit.openNav")});if(o.isPending)return v.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3",children:[_,v.jsx("p",{role:"status",children:b("common.loading")})]});if(o.error)return v.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8",children:[_,v.jsx("p",{className:"text-destructive text-sm",role:"alert",children:o.error.message}),v.jsx(Be,{onClick:()=>void o.refetch(),size:"sm",variant:"outline",children:b("common.retry")})]});if(o.data===null||!o.data)return v.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:v.jsx("p",{className:"text-destructive text-sm",role:"alert",children:b("cockpit.missing")})});const N=o.data;return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex min-h-0 w-full min-w-0 flex-1 *:min-w-0 *:flex-1",children:v.jsx(u9,{detail:v.jsx(T9,{bot:N,threadId:S==null?void 0:S.id}),onClose:()=>s(!1),open:i,title:v.jsx("span",{className:"font-medium text-[13px]",children:b("cockpit.details")}),detailWidth:330,children:v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[v.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-border px-3 md:px-4",children:[v.jsx(Be,{"aria-label":b("cockpit.openNav"),className:"lg:hidden",onClick:g,size:"icon-sm",variant:"ghost",children:v.jsx(Td,{className:"size-4.5"})}),v.jsx(Bs,{name:N.name,seed:N.avatarSeed,size:28}),v.jsxs("div",{className:"min-w-0 max-w-[45%]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"truncate font-medium text-[14px]",children:N.name}),v.jsx(mN,{bot:N})]}),v.jsx("p",{className:"hidden truncate font-mono text-[10.5px] text-muted-foreground xl:block",children:(S==null?void 0:S.workspace)??N.workspace})]}),v.jsx("div",{className:"ml-1 flex min-w-0 flex-1 items-center",children:v.jsxs(IG,{children:[v.jsxs(PG,{render:v.jsx(Be,{className:"w-full justify-between",size:"sm",variant:"ghost"}),children:[v.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-[12.5px] text-muted-foreground",children:(S==null?void 0:S.title)??b("cockpit.noThread")}),v.jsx(X5,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),v.jsxs(zG,{align:"start",className:"w-64",children:[(l.data??[]).map(B=>v.jsx(Pv,{render:v.jsx($n,{params:{botId:e,threadId:B.id},to:"/bots/$botId/threads/$threadId"}),children:v.jsx("span",{className:"truncate",children:B.title})},B.id)),v.jsx(LG,{}),v.jsxs(Pv,{disabled:S===void 0||k.isPending,onClick:()=>{S!==void 0&&window.confirm(b("thread.deleteConfirm"))&&k.mutate({botId:e,threadId:S.id})},children:[v.jsx(yx,{}),b("thread.delete")]}),v.jsxs(Pv,{disabled:C.isPending,onClick:()=>C.mutate(e),children:[v.jsx(rm,{}),b("cockpit.newConversation")]})]})]})}),v.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[v.jsx(Be,{"aria-label":N.paused?b("cockpit.resumeBot"):b("cockpit.pauseBot"),disabled:M.isPending,onClick:()=>M.mutate({botId:N.id,paused:!N.paused}),size:"icon-sm",variant:"ghost",children:N.paused?v.jsx(wk,{className:"size-4"}):v.jsx(bE,{className:"size-4"})}),v.jsx(Be,{"aria-label":b("cockpit.newConversation"),disabled:C.isPending,onClick:()=>C.mutate(e),size:"icon-sm",variant:"ghost",children:v.jsx(rm,{className:"size-4"})}),v.jsxs($n,{"aria-label":b("cockpit.inbox"),className:"relative hidden items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground md:inline-flex",to:"/inbox",children:[v.jsx(bk,{className:"size-4.5"}),D>0?v.jsx("span",{className:"absolute -top-0.5 -right-0.5 grid size-3.5 place-items-center rounded-full bg-warning text-[9px] font-semibold text-background",children:D}):null]}),v.jsx(Be,{"aria-label":b("cockpit.details"),onClick:()=>s(!i),size:"icon-sm",variant:i?"secondary":"ghost",children:v.jsx(fz,{className:"size-4.5"})}),v.jsx(Be,{"aria-label":b("cockpit.botSettings"),onClick:()=>x(!0),size:"icon-sm",variant:"ghost",children:v.jsx(Tk,{className:"size-4.5"})})]})]}),[C.error,k.error,M.error].filter(Boolean).map((B,q)=>v.jsx("p",{className:"px-4 py-2 text-destructive text-xs",role:"alert",children:B==null?void 0:B.message},q)),N.paused?v.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-4 py-2 text-[12.5px] text-muted-foreground",children:[v.jsx(bE,{className:"size-3.5"}),b("composer.paused",{name:N.name})]}):null,S?v.jsxs(v.Fragment,{children:[v.jsx(oF,{bot:N,threadId:S.id}),($=d.data)!=null&&$.find(B=>B.id===S.blockedByRunId)?v.jsx(PN,{run:d.data.find(B=>B.id===S.blockedByRunId)},S.blockedByRunId):null,v.jsx($6,{bot:N,threadId:S.id})]}):v.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-muted-foreground text-sm",children:[v.jsx("p",{role:l.isError?"alert":void 0,children:l.isPending?b("common.loading"):((X=l.error)==null?void 0:X.message)??b("cockpit.noThread")}),l.isError?v.jsx(Be,{variant:"outline",onClick:()=>void l.refetch(),children:b("common.retry")}):null,l.isPending?null:v.jsx(Be,{disabled:C.isPending,onClick:()=>C.mutate(e),children:b("cockpit.newConversation")})]})]})})}),v.jsx(F6,{bot:N,onClose:()=>x(!1),onDeleted:B=>{const q=p.state.location.pathname,F=`/bots/${encodeURIComponent(B)}`;(q===F||q.startsWith(`${F}/`))&&h({to:"/"})},open:w})]})}const GA={2:[[0,0],[.32,.32]],3:[[.22,0],[0,.44],[.44,.44]]};function Bj({people:e,size:t=32}){const s=e.slice(0,3);if(s.length===0)return null;const[i]=s;if(i===void 0)return null;if(s.length===1)return v.jsx(Bs,{emoji:i.emoji,hue:i.hue,name:i.name,seed:i.seed,size:t});const o=GA[s.length]??GA[2],l=t*(s.length===2?.68:.56),u=Math.max(1,t*.05);return v.jsx("span",{"aria-hidden":"true",className:"relative inline-block shrink-0",style:{width:t,height:t},children:s.map((d,f)=>{const[h,p]=o[f]??[0,0],g=o.slice(f+1).map(([w,x])=>{const S=(w-h)*t+l/2,T=(x-p)*t+l/2,A=l/2+u;return`radial-gradient(circle at ${S}px ${T}px, transparent ${A}px, #000 ${A+.5}px)`}),b={position:"absolute",left:h*t,top:p*t,width:l,height:l,...g.length>0?{WebkitMaskImage:g.join(", "),maskImage:g.join(", "),WebkitMaskComposite:"source-in",maskComposite:"intersect"}:{}};return v.jsx("span",{style:b,children:v.jsx(Bs,{emoji:d.emoji,hue:d.hue,name:d.name,seed:d.seed,size:l})},`${d.seed}-${String(f)}`)})})}function qG({open:e,onOpenChange:t,onCreated:s}){const{t:i}=mt(),o=Us(),l=Et(No()),[u,d]=E.useState(""),[f,h]=E.useState([]),[p,g]=E.useState(""),b=On({mutationFn:()=>Yt().createRoom({name:u.trim(),memberIds:f,...p.length>0?{leadBotId:p}:{}}),onSuccess:S=>{o.invalidateQueries({queryKey:ap().queryKey}),s==null||s(S),t(!1),d(""),h([]),g("")}}),w=S=>{h(T=>{const A=T.includes(S)?T.filter(C=>C!==S):[...T,S];return A.includes(p)||g(A[0]??""),A})},x=u.trim().length>0&&f.length>0&&!b.isPending;return v.jsx(Cd,{onOpenChange:t,open:e,children:v.jsxs(Ad,{className:"flex w-full flex-col gap-0 sm:max-w-md",children:[v.jsxs(a0,{children:[v.jsx(kd,{children:i("room.new")}),v.jsx(c0,{children:i("room.newDescription")})]}),v.jsxs("form",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4",onSubmit:S=>{S.preventDefault(),x&&b.mutate()},children:[v.jsxs(kx,{children:[v.jsxs(os,{children:[v.jsx(as,{htmlFor:"room-name",children:i("room.name")}),v.jsx(po,{id:"room-name",onChange:S=>d(S.target.value),placeholder:i("room.namePlaceholder"),value:u})]}),v.jsxs(os,{children:[v.jsx(as,{children:i("room.members")}),v.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:(l.data??[]).map(S=>{const T=f.includes(S.id);return v.jsx("button",{"aria-pressed":T,className:`rounded-lg border px-2.5 py-1.5 text-left text-[12px] transition-colors ${T?"border-foreground/40 bg-sidebar-accent text-foreground":"border-border text-muted-foreground hover:border-foreground/25 hover:text-foreground"}`,onClick:()=>w(S.id),type:"button",children:S.name},S.id)})}),v.jsx(td,{children:i("room.membersHint")})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"room-lead",children:i("room.leadLabel")}),v.jsx("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-[13px]",id:"room-lead",onChange:S=>g(S.target.value),value:p,children:f.map(S=>{var A;const T=(A=l.data)==null?void 0:A.find(C=>C.id===S);return v.jsx("option",{value:S,children:(T==null?void 0:T.name)??S},S)})})]})]}),v.jsxs(l0,{className:"mt-auto flex flex-row justify-end gap-2",children:[v.jsx(Be,{onClick:()=>t(!1),size:"sm",type:"button",variant:"ghost",children:i("room.cancel")}),v.jsx(Be,{disabled:!x,size:"sm",type:"submit",children:b.isPending?i("room.creating"):i("room.create")})]})]})]})})}function HG(){return typeof navigator>"u"?!1:/Mac|iPhone|iPad|iPod/i.test(navigator.userAgent)}function Uj(e){return HG()?`⌘${e.toUpperCase()}`:`Ctrl ${e.toUpperCase()}`}const Vj=e=>`scream.room.read.${e}`;function GG(e){try{window.localStorage.setItem(Vj(e),String(Date.now()))}catch{}}function KG(e){if(e.lastSpeakerKind!=="bot"||e.lastMessageAt===null||e.lastMessageAt===void 0)return!1;try{const t=Number(window.localStorage.getItem(Vj(e.id))??0);return e.lastMessageAt>t}catch{return!1}}const Fj="scream-bot-theme",qj="(prefers-color-scheme: dark)";function Im(){const e=window.localStorage.getItem(Fj);return e==="light"||e==="dark"||e==="system"?e:"system"}function $b(e){const t=e==="dark"||e==="system"&&window.matchMedia(qj).matches;document.documentElement.classList.toggle("dark",t),document.documentElement.style.colorScheme=t?"dark":"light"}function Hj(e){window.localStorage.setItem(Fj,e),$b(e)}function YG(){$b(Im());const e=window.matchMedia(qj),t=()=>{Im()==="system"&&$b("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function KA({action:e,children:t}){return v.jsxs("div",{className:"mt-5 mb-1 flex h-7 items-center justify-between px-2",children:[v.jsx("span",{className:"font-medium text-[11px] text-muted-foreground/80 uppercase tracking-[0.14em]",children:t}),e]})}const Ih="group flex min-h-[50px] items-center gap-2.5 rounded-lg px-2 py-1.5 transition-colors hover:bg-sidebar-accent/70",YA="truncate text-[13px] leading-5",$A="truncate text-[12px] leading-4 text-muted-foreground",QA="shrink-0 text-[11px] text-muted-foreground/70 tabular-nums";function $G({collapsed:e=!1,onNavigate:t,onNewBot:s,onOpenPalette:i,onToggleCollapsed:o}){var O,z;const l=Et(No()),u=Et(ap()),d=Et(Rc()),{t:f}=mt(),[h,p]=E.useState(""),g=h.trim().toLowerCase(),b=E.useMemo(()=>g.length===0?l.data??[]:(l.data??[]).filter(I=>I.name.toLowerCase().includes(g)||I.title.toLowerCase().includes(g)||(I.lastMessage??"").toLowerCase().includes(g)),[l.data,g]),w=E.useMemo(()=>g.length===0?u.data??[]:(u.data??[]).filter(I=>I.name.toLowerCase().includes(g)||(I.lastMessage??"").toLowerCase().includes(g)),[g,u.data]),[x,S]=E.useState(()=>Im()),[T,A]=E.useState(!1),C=Us(),k=si(),M=mx({strict:!1}),D=On({mutationFn:I=>Yt().deleteBot(I),onSuccess:async(I,V)=>{f0(V,C),M.botId===V&&await k({to:"/"}),await C.invalidateQueries({queryKey:He.bots()}),await C.invalidateQueries({queryKey:He.inbox()})},onError:I=>{window.alert(I instanceof Error?I.message:String(I))}}),_=(((O=d.data)==null?void 0:O.approvals.length)??0)+(((z=d.data)==null?void 0:z.questions.length)??0),N=()=>{const I=x==="system"?"light":x==="light"?"dark":"system";S(I),Hj(I)};return v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("div",{className:ke("flex h-14 shrink-0 items-center gap-2",e?"justify-center px-2":"px-3"),children:[v.jsxs($n,{"aria-label":"Scream",className:"flex min-w-0 items-center gap-2 rounded-md",onClick:t,to:"/",children:[v.jsx("span",{className:"grid size-6 shrink-0 place-items-center rounded-md bg-primary font-bold text-[13px] text-primary-foreground",children:"S"}),e?null:v.jsx("span",{className:"truncate font-semibold text-[15px] tracking-tight",children:"Scream"})]}),e?null:v.jsx("button",{"aria-label":f("app.search"),className:"ml-auto flex items-center gap-1 rounded-md border border-border bg-background/60 px-1.5 py-1 text-[11px] text-muted-foreground transition-colors hover:text-foreground",onClick:i,type:"button",children:Uj("K")}),o===void 0?null:v.jsx("button",{"aria-label":f(e?"app.expandRail":"app.collapseRail"),className:ke("grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground",e?"":"ml-0.5"),onClick:o,title:f(e?"app.expandRail":"app.collapseRail"),type:"button",children:v.jsx(Td,{className:"size-4"})})]}),v.jsx("div",{className:ke("shrink-0 px-2 pb-1",e&&"hidden"),children:v.jsxs("label",{className:"flex h-9 items-center gap-2 rounded-lg bg-background/60 px-2.5 ring-1 ring-border/70 focus-within:ring-foreground/20",children:[v.jsx(Sk,{className:"size-3.5 text-muted-foreground",stroke:1.8}),v.jsx("input",{"aria-label":f("app.searchPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-[12.5px] outline-none placeholder:text-muted-foreground",onChange:I=>p(I.target.value),placeholder:f("app.searchPlaceholder"),type:"search",value:h})]})}),v.jsxs("nav",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-4",children:[v.jsxs($n,{activeProps:{className:"bg-sidebar-accent"},className:ke(Ih,"mt-1",e&&"justify-center px-0"),onClick:t,title:f("app.inbox"),to:"/inbox",children:[v.jsxs("span",{className:"relative",children:[v.jsx(bk,{className:"size-4.5 text-muted-foreground",stroke:1.8}),e&&_>0?v.jsx("span",{className:"absolute -top-1 -right-1 size-2 rounded-full bg-warning ring-2 ring-sidebar"}):null]}),e?null:v.jsx("span",{className:"text-sm",children:f("app.inbox")}),_>0&&!e?v.jsx("span",{className:"ml-auto rounded-full bg-warning/15 px-1.5 font-medium text-[11px] text-warning tabular-nums",children:_}):null]}),e?v.jsx("div",{className:"my-2 h-px bg-sidebar-border/70"}):null,e?null:v.jsx(KA,{action:v.jsx("button",{"aria-label":f("app.newBot"),className:"grid size-6 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground",onClick:s,type:"button",children:v.jsx(rm,{className:"size-4"})}),children:f("app.bots")}),v.jsx("ul",{className:"flex flex-col gap-0.5",children:b.map(I=>v.jsxs("li",{className:"group/row relative",children:[v.jsxs($n,{activeProps:{className:"bg-sidebar-accent"},className:ke(Ih,e?"justify-center px-0":"pr-9"),onClick:()=>{vc(I.id),t==null||t()},params:{botId:I.id},title:e?I.name:void 0,to:"/bots/$botId",children:[v.jsxs("span",{className:"relative shrink-0",children:[v.jsx(Bs,{emoji:I.avatarEmoji,hue:I.accentHue,name:I.name,seed:I.avatarSeed,size:32}),v.jsx(H6,{status:I.status}),e&&(I.unread>0||I.needsYou>0)?v.jsx("span",{"aria-label":f("app.unread",{count:I.unread+I.needsYou}),className:"absolute -top-0.5 -right-0.5 size-2 rounded-full bg-brand ring-2 ring-sidebar"}):null]}),v.jsxs("span",{className:ke("flex min-w-0 flex-1 flex-col leading-tight",e&&"hidden"),children:[v.jsxs("span",{className:"flex items-baseline gap-1.5",children:[v.jsx("span",{className:ke(YA,"min-w-0 flex-1",I.paused?"text-muted-foreground":"text-foreground"),children:I.name}),I.lastMessageAt?v.jsx("span",{className:QA,children:bc(new Date(I.lastMessageAt).toISOString())}):null]}),v.jsxs("span",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:ke($A,"min-w-0 flex-1"),children:I.lastMessage??I.title}),I.unread>0?v.jsx("span",{"aria-label":f("app.unread",{count:I.unread}),className:"size-1.5 shrink-0 rounded-full bg-brand"}):null]})]}),I.needsYou>0&&!e?v.jsx("span",{"aria-label":f("app.waiting",{count:I.needsYou}),className:"rounded-full bg-warning/15 px-1.5 py-0.5 font-medium text-[10px] text-warning tabular-nums",children:I.needsYou}):null]}),v.jsx("button",{"aria-label":f("bot.delete",{name:I.name}),className:ke("absolute top-1/2 right-1.5 grid size-6 -translate-y-1/2 place-items-center rounded-md text-muted-foreground opacity-100 transition-opacity pointer-fine:opacity-0 hover:bg-destructive/10 hover:text-destructive focus-visible:opacity-100 group-hover/row:opacity-100 disabled:opacity-40",e&&"hidden"),disabled:D.isPending,onClick:()=>{window.confirm(f("bot.deleteConfirm",{name:I.name}))&&D.mutate(I.id)},title:f("bot.delete",{name:I.name}),type:"button",children:v.jsx(yx,{className:"size-3.5"})})]},I.id))}),e?v.jsx("div",{className:"my-2 h-px bg-sidebar-border/70"}):null,e?null:v.jsx(KA,{action:v.jsx(Be,{"aria-label":f("room.new"),onClick:()=>A(!0),size:"icon-sm",variant:"ghost",children:v.jsx(rm,{})}),children:f("app.rooms")}),v.jsxs("ul",{className:"flex flex-col gap-0.5",children:[w.map(I=>{const V=I.memberIds.map(X=>{var B;return(B=l.data)==null?void 0:B.find(q=>q.id===X)}).filter(X=>!!X).map(X=>({name:X.name,seed:X.avatarSeed,emoji:X.avatarEmoji,hue:X.accentHue})),$=KG(I);return v.jsx("li",{children:v.jsxs($n,{activeProps:{className:"bg-sidebar-accent"},className:ke(Ih,e&&"justify-center px-0"),onClick:t,params:{roomId:I.id},title:e?I.name:void 0,to:"/rooms/$roomId",children:[V.length>0?v.jsx(Bj,{people:V,size:32}):v.jsx("span",{className:"grid size-8 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground",children:v.jsx(vk,{className:"size-4",stroke:1.8})}),v.jsxs("span",{className:ke("flex min-w-0 flex-1 flex-col leading-tight",e&&"hidden"),children:[v.jsxs("span",{className:"flex items-baseline gap-1.5",children:[v.jsx("span",{className:ke(YA,"min-w-0 flex-1"),children:I.name}),I.lastMessageAt?v.jsx("span",{className:QA,children:bc(new Date(I.lastMessageAt).toISOString())}):null]}),v.jsxs("span",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:ke($A,"min-w-0 flex-1"),children:I.lastMessage??f("app.noMessages")}),$?v.jsx("span",{"aria-label":f("app.unreadRoom",{name:I.name}),className:"size-1.5 shrink-0 rounded-full bg-brand"}):null]})]})]})},I.id)}),w.length===0?v.jsx("p",{className:"px-2 py-1 text-[12px] text-muted-foreground",children:g.length>0?f("app.noMatches"):f("app.noRooms")}):null]})]}),v.jsxs("div",{className:ke("flex shrink-0 items-center gap-1 border-t border-sidebar-border px-2 py-2",e&&"justify-center"),children:[v.jsxs($n,{activeProps:{className:"bg-sidebar-accent"},className:ke(Ih,e?"px-1.5":"flex-1"),onClick:t,title:f("app.settings"),to:"/settings",children:[v.jsx(Tk,{className:"size-4.5 text-muted-foreground",stroke:1.8}),e?null:v.jsx("span",{className:"text-[13px]",children:f("app.settings")})]}),e?null:v.jsx(gx,{}),v.jsx(Be,{"aria-label":f("app.theme",{theme:x}),onClick:N,size:"icon-sm",variant:"ghost",children:x==="dark"?v.jsx(xk,{className:"size-4"}):v.jsx(Ek,{className:"size-4"})})]}),v.jsx(qG,{onOpenChange:A,open:T})]})}const QG="h-9 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30";function XG({open:e,onClose:t,onCreated:s}){const{t:i}=mt(),[o,l]=E.useState(""),[u,d]=E.useState(""),[f,h]=E.useState("~"),[p,g]=E.useState(""),[b,w]=E.useState("bot"),x=On({mutationFn:()=>Yt().createBot({name:o,permission:b,rolePrompt:p.trim()||`You are ${o.trim()||"a Bot"}. Help the person with whatever they bring you, clearly and briefly.`,title:u,workspace:f}),onSuccess:T=>{s(T),l(""),d(""),g("")}}),S=o.trim().length>0&&f.trim().length>0&&!x.isPending;return v.jsx(Cd,{onOpenChange:T=>{T||t()},open:e,children:v.jsxs(Ad,{className:"gap-0 data-[side=right]:w-[calc(100%-1rem)] data-[side=right]:sm:max-w-lg",side:"right",variant:"inset",children:[v.jsxs(a0,{className:"border-b border-border pb-3",children:[v.jsx(kd,{children:i("bot.new.title")}),v.jsx(c0,{children:i("bot.new.description")})]}),v.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:T=>{T.preventDefault(),S&&x.mutate()},children:[v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[v.jsxs(kx,{children:[v.jsxs(os,{children:[v.jsx(as,{htmlFor:"bot-name",children:i("bot.new.name")}),v.jsx(po,{autoFocus:!0,id:"bot-name",onChange:T=>l(T.target.value),placeholder:i("bot.new.namePlaceholder"),value:o})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"bot-title",children:i("bot.new.role")}),v.jsx(po,{id:"bot-title",onChange:T=>d(T.target.value),placeholder:i("bot.new.rolePlaceholder"),value:u}),v.jsx(td,{children:i("bot.new.roleHint")})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"bot-workspace",children:i("bot.new.workspace")}),v.jsx(po,{className:"font-mono text-[13px]",id:"bot-workspace",onChange:T=>h(T.target.value),placeholder:i("bot.new.workspacePlaceholder"),value:f}),v.jsx(td,{children:i("bot.new.workspaceHint")})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"bot-permission",children:i("bot.new.permissions")}),v.jsxs("select",{className:QG,id:"bot-permission",onChange:T=>w(T.target.value),value:b,children:[v.jsx("option",{value:"bot",children:i("bot.permission.bot")}),v.jsx("option",{value:"auto",children:i("bot.permission.auto")})]})]}),v.jsxs(os,{children:[v.jsx(as,{htmlFor:"bot-prompt",children:i("bot.new.instructions")}),v.jsx(dN,{className:"min-h-28",id:"bot-prompt",onChange:T=>g(T.target.value),placeholder:i("bot.new.instructionsPlaceholder"),value:p})]})]}),x.error?v.jsx("p",{className:"mt-3 text-destructive text-sm",role:"alert",children:x.error.message}):null]}),v.jsx(l0,{className:"border-t border-border",children:v.jsxs("div",{className:"flex justify-end gap-2",children:[v.jsx(Be,{onClick:t,size:"sm",type:"button",variant:"ghost",children:i("bot.new.cancel")}),v.jsx(Be,{disabled:!S,size:"sm",type:"submit",children:x.isPending?i("bot.new.creating"):i("bot.new.create")})]})})]})]})})}function ZG({...e}){return v.jsx(cN,{"data-slot":"dialog",...e})}function WG({...e}){return v.jsx(aN,{"data-slot":"dialog-portal",...e})}function JG({className:e,...t}){return v.jsx(wM,{"data-slot":"dialog-overlay",className:ke("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function eK({className:e,overlayClassName:t,children:s,showCloseButton:i=!0,...o}){return v.jsxs(WG,{children:[v.jsx(JG,{className:t,forceRender:t!==void 0}),v.jsxs(iN,{"data-slot":"dialog-content",className:ke("-translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2 z-50 flex max-h-[85svh] w-[calc(100%-2rem)] max-w-lg flex-col gap-4 rounded-xl border border-border bg-popover p-5 text-sm text-popover-foreground shadow-lg transition duration-150 ease-out data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-starting-style:scale-[0.98] data-starting-style:opacity-0",e),...o,children:[s,i&&v.jsxs(SM,{"data-slot":"dialog-close",render:v.jsx(Be,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[v.jsx(Sc,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function tK({className:e,...t}){return v.jsx(uN,{"data-slot":"dialog-title",className:ke("font-heading font-medium text-base text-foreground",e),...t})}function nK({className:e,...t}){return v.jsx(TM,{"data-slot":"dialog-description",className:ke("text-muted-foreground text-sm text-pretty",e),...t})}function sK({open:e,onOpenChange:t}){const s=Et(No()),i=Et(ap()),o=si(),{t:l}=mt(),u=E.useId(),[d,f]=E.useState(""),[h,p]=E.useState(0),g=E.useRef(null),w=E.useMemo(()=>{const A=()=>t(!1);return[{hint:l("app.inbox"),id:"inbox",label:l("palette.goTo",{name:l("app.inbox")}),run:()=>{A(),o({to:"/inbox"})}},...(s.error?[]:s.data??[]).map(C=>({hint:C.title||l("app.bots"),id:`bot-${C.id}`,label:l("palette.open",{name:C.name}),run:()=>{A(),vc(C.id),o({params:{botId:C.id},to:"/bots/$botId"})}})),...(i.error?[]:i.data??[]).map(C=>({hint:l("app.rooms"),id:`room-${C.id}`,label:l("palette.openRoom",{name:C.name}),run:()=>{A(),o({params:{roomId:C.id},to:"/rooms/$roomId"})}})),{hint:l("app.settings"),id:"settings",label:l("palette.goTo",{name:l("app.settings")}),run:()=>{A(),o({to:"/settings"})}}]},[s.data,s.error,o,t,i.data,i.error,l]).filter(A=>`${A.label} ${A.hint}`.toLowerCase().includes(d.trim().toLowerCase())),x=Math.min(h,Math.max(0,w.length-1)),S=s.error??i.error,T=s.isPending||i.isPending;return E.useEffect(()=>{p(0)},[d,e]),E.useEffect(()=>{var A,C,k;(k=(C=(A=g.current)==null?void 0:A.querySelector('[aria-selected="true"]'))==null?void 0:C.scrollIntoView)==null||k.call(C,{block:"nearest"})},[x]),E.useEffect(()=>{e&&f("")},[e]),v.jsx(ZG,{onOpenChange:t,open:e,children:v.jsxs(eK,{className:"top-[12%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0",showCloseButton:!1,children:[v.jsx(tK,{className:"sr-only",children:l("palette.title")}),v.jsx(nK,{className:"sr-only",children:l("palette.description")}),v.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[v.jsx(Sk,{className:"size-4 text-muted-foreground"}),v.jsx("input",{"aria-activedescendant":w.length>0?`${u}-${x}`:void 0,"aria-autocomplete":"list","aria-controls":u,"aria-expanded":e,"aria-label":l("palette.search"),autoFocus:!0,role:"combobox",className:"h-11 flex-1 bg-transparent text-[13.5px] outline-none placeholder:text-muted-foreground",onChange:A=>f(A.target.value),onKeyDown:A=>{var C;A.nativeEvent.isComposing||(A.key==="ArrowDown"?(A.preventDefault(),p(w.length?(x+1)%w.length:0)):A.key==="ArrowUp"?(A.preventDefault(),p(w.length?(x-1+w.length)%w.length:0)):A.key==="Enter"&&(A.preventDefault(),(C=w[x])==null||C.run()))},placeholder:l("palette.search"),value:d})]}),T?v.jsx("p",{className:"px-3 py-2 text-muted-foreground text-xs",role:"status",children:l("common.loading")}):null,S?v.jsxs("div",{className:"px-3 py-2 text-destructive text-xs",role:"alert",children:[v.jsxs("p",{children:[l("common.loadFailed")," ",S.message]}),v.jsx(Be,{className:"mt-2",onClick:()=>{s.refetch(),i.refetch()},size:"sm",variant:"outline",children:l("common.retry")})]}):null,v.jsx("div",{"aria-label":l("palette.title"),className:"max-h-[320px] overflow-y-auto p-1.5",id:u,ref:g,role:"listbox",children:w.length===0?!T&&!S?v.jsx("p",{className:"px-3 py-6 text-center text-muted-foreground text-sm",children:l("palette.noMatches",{query:d.trim()})}):null:w.map((A,C)=>v.jsxs("button",{"aria-selected":C===x,id:`${u}-${C}`,role:"option",className:ke("flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-[13px] transition-colors",C===x?"bg-muted":"hover:bg-muted/60"),onClick:A.run,onMouseEnter:()=>p(C),type:"button",children:[v.jsx("span",{className:"min-w-0 flex-1 truncate",children:A.label}),v.jsx("span",{className:"text-[11px] text-muted-foreground",children:A.hint}),C===x?v.jsx(nz,{className:"size-3.5 text-muted-foreground"}):null]},A.id))})]})})}function iK(e){return"getConnectionState"in e&&typeof e.getConnectionState=="function"&&"subscribeConnectionState"in e&&typeof e.subscribeConnectionState=="function"}const rK={status:"local",error:null,retryInMs:null},XA=()=>rK,oK=()=>()=>{};function Gj(){const e=Yt(),t=iK(e)?e:void 0;return E.useSyncExternalStore(t?s=>t.subscribeConnectionState(s):oK,t?()=>t.getConnectionState():XA,XA)}const aK=["bots","bot","threads","messages","runs","inbox","handoffs","rooms","room-messages","room-runs","activity","files","file"];function Pm(e){return typeof e=="object"&&e!==null?e:void 0}function lK(e,t){if(e.threadId===void 0)return;const s=Pm(e.data);if(s===void 0)return;const i=typeof s.version=="number"&&Number.isSafeInteger(s.version)&&s.version>=0?s.version:void 0,o=Pm(s.message)??(e.type==="message.created"?s:void 0);if(o!==void 0&&typeof o.id=="string"&&o.threadId===e.threadId&&typeof o.content=="string"&&["assistant","user","system"].includes(String(o.role)))return{message:o,...i===void 0?{}:{version:i}};if(e.type==="assistant.delta"&&typeof s.messageId=="string"&&typeof s.content=="string"){const l=t==null?void 0:t.find(d=>d.id===s.messageId);return{message:{...l,id:s.messageId,threadId:e.threadId,role:"assistant",content:s.content,createdAt:(l==null?void 0:l.createdAt)??null},...i===void 0?{}:{version:i}}}}const xc=new Map,Qb=new Set;function ow(e){var s;const t=[...((s=xc.get(e))==null?void 0:s.values())??[]];for(const i of Qb)i(e,t)}function ZA(e){var t;return[...((t=xc.get(e))==null?void 0:t.values())??[]]}function cK(e){return Qb.add(e),()=>{Qb.delete(e)}}function uK(e){xc.delete(e)&&ow(e)}function dK(e,t){const s=xc.get(e)??new Map;s.set(t.botId,t),xc.set(e,s),ow(e)}function fK(e,t){const s=xc.get(e);s===void 0||!s.delete(t)||ow(e)}function hK(e,t){const s=i=>{e.invalidateQueries({queryKey:i})};if(t.type==="resync"){for(const[i,o]of e.getQueriesData({queryKey:["messages"]})){const l=E6(o,t.epoch);if(l===void 0||l===o)continue;const u=e.setQueryData(i,l);u!==void 0&&dC(u,l)}for(const i of aK)s([i]);return}if(t.threadId!==void 0&&["assistant.delta","message.created","tool.updated"].includes(t.type)){const i=He.messages(t.threadId),o=lK(t,e.getQueryData(i));if(o!==void 0){let l;const u=e.setQueryData(i,d=>(l=A6(d,o.message,o.version,t.epoch),l));if(u!==void 0&&l!==void 0&&dC(u,l),t.type==="assistant.delta")return}}if(t.type==="room.delta"&&t.roomId!==void 0){const i=Pm(t.data);i!==void 0&&typeof i.botId=="string"&&typeof i.content=="string"&&dK(t.roomId,{botId:i.botId,messageId:typeof i.messageId=="string"?i.messageId:"",content:i.content});return}if(t.type==="room.message"&&t.roomId!==void 0){const i=Pm(t.data);i!==void 0&&typeof i.speakerId=="string"&&fK(t.roomId,i.speakerId)}t.roomId!==void 0&&(s(He.roomMessages(t.roomId)),s(He.roomRuns(t.roomId)),s(He.rooms())),t.botId!==void 0&&(s(He.bot(t.botId)),s(He.threads(t.botId)),s(["files",t.botId]),s(["file",t.botId])),t.threadId!==void 0&&s(He.messages(t.threadId)),(t.type==="bot.updated"||t.type==="thread.updated")&&s(He.bots()),["run.updated","tool.updated","approval.requested","approval.decided","question.requested","question.answered","handoff.updated","bot.updated"].includes(t.type)&&(s(He.inbox()),s(["runs"]),s(["activity"]),s(He.handoffs()))}function mK(){const e=Us();E.useEffect(()=>Yt().subscribe(t=>{hK(e,t)}),[e])}const WA="scream.rail.collapsed";function pK({children:e}){mK();const t=Gj(),{t:s}=mt(),i=si(),[o,l]=E.useState(!1),[u,d]=E.useState(()=>{try{return window.localStorage.getItem(WA)==="1"}catch{return!1}}),f=()=>{d(x=>{const S=!x;try{window.localStorage.setItem(WA,S?"1":"0")}catch{}return S})},[h,p]=E.useState(!1),[g,b]=E.useState(!1);E.useEffect(()=>{const x=S=>{(S.metaKey||S.ctrlKey)&&S.key.toLowerCase()==="k"&&(S.preventDefault(),b(T=>!T))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[]);const w=(x,S)=>v.jsx($G,{collapsed:x,onNavigate:()=>l(!1),onNewBot:()=>{l(!1),p(!0)},onOpenPalette:()=>{l(!1),b(!0)},...S===void 0?{}:{onToggleCollapsed:S}});return v.jsxs(d9,{value:{openRail:()=>l(!0)},children:[v.jsxs("div",{className:"flex h-svh overflow-hidden bg-background",children:[v.jsx("aside",{className:ke("hidden shrink-0 border-sidebar-border border-r bg-sidebar transition-[width] duration-150 lg:block",u?"w-[76px]":"w-[340px]"),children:w(u,f)}),v.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[t.status!=="connected"&&t.status!=="local"?v.jsxs("div",{className:"shrink-0 border-b border-border bg-muted/40 px-4 py-1 text-muted-foreground text-xs",role:"status",title:t.error??void 0,children:[s(`connection.${t.status}`),t.retryInMs!==null?` · ${s("connection.retryIn",{seconds:Math.ceil(t.retryInMs/1e3)})}`:null,t.error?` — ${t.error}`:null]}):null,e]})]}),v.jsx(Cd,{onOpenChange:l,open:o,children:v.jsxs(Ad,{className:"w-[84vw] max-w-[320px] gap-0 bg-sidebar p-0",side:"left",children:[v.jsx(kd,{className:"sr-only",children:s("cockpit.openNav")}),w(!1)]})}),v.jsx(XG,{onClose:()=>p(!1),onCreated:x=>{p(!1),vc(x.id),i({params:{botId:x.id},to:"/bots/$botId"})},open:h}),v.jsx(sK,{onOpenChange:b,open:g})]})}const qa=za({component:gK,getParentRoute:()=>pk,id:"_shell"});function gK(){return v.jsx(pK,{children:v.jsx(px,{})})}const Kj=za({component:yK,getParentRoute:()=>qa,path:"/bots/$botId"}),Yj=za({component:vK,getParentRoute:()=>qa,path:"/bots/$botId/threads/$threadId"});function yK(){const{botId:e}=Kj.useParams();return v.jsx($j,{botId:e})}function vK(){const{botId:e,threadId:t}=Yj.useParams();return v.jsx($j,{botId:e,threadId:t})}function $j({botId:e,threadId:t}){const[s,i]=E.useState(()=>window.matchMedia("(min-width: 1024px)").matches);return v.jsx(VG,{botId:e,drawerOpen:s,onDrawerChange:i,threadId:t})}const JA={done:{accent:"success",glow:.7,hueRotate:0,intensity:.4,motif:"ping",pulseSeconds:.65,reactivity:0,saturation:1,scale:1.1,speed:.8,tumble:.02,turbulence:.08},error:{accent:"danger",glow:.25,hueRotate:0,intensity:.5,motif:"fault",pulseSeconds:.9,reactivity:0,saturation:.3,scale:.96,speed:1,tumble:0,turbulence:.55},idle:{accent:null,glow:.15,hueRotate:0,intensity:.3,motif:"breathe",pulseSeconds:4.5,reactivity:0,saturation:.75,scale:.94,speed:.6,tumble:.012,turbulence:.14},listening:{accent:null,glow:.6,hueRotate:0,intensity:.75,motif:"receive",pulseSeconds:1.6,reactivity:1,saturation:1.05,scale:1.06,speed:1,tumble:.03,turbulence:.42},streaming:{accent:null,glow:.45,hueRotate:-10,intensity:.6,motif:"pulse",pulseSeconds:1.25,reactivity:.6,saturation:1,scale:1.02,speed:1.4,tumble:.06,turbulence:.5},thinking:{accent:null,glow:.35,hueRotate:18,intensity:1,motif:"scan",pulseSeconds:1.1,reactivity:.15,saturation:1,scale:1,speed:2.4,tumble:.14,turbulence:.95}},bK=e=>JA[e??"idle"]??JA.idle,xK=e=>typeof e=="object"&&e!==null&&"get"in e,wK=e=>{const t=xj(0),s=typeof e=="number"?e:null;return E.useEffect(()=>{s!==null&&t.set(s)},[s,t]),xK(e)?e:t},Ul=50,e2=30,SK=100,TK=.008,RK=1,EK=.015,CK=4,AK=.004,kK=1.2,MK=.008,NK=1.5,OK=.004,jK=.05,DK=.008,_K=.1,IK=.004,PK=.5,zK=.008,LK=2,BK="0%",UK="5%",VK="15%",FK="25%",qK=1.1,HK=1.2,GK=1.3,KK=.45,YK=.12,$K=[0,-3,3,0],QK=.18,t2=[.645,.045,.355,1],XK=.28,ZK=.7,WK=.06,JK=1.5,eY=12,tY=[1,1.035,1],nY=5.5,n2={bounce:.1,duration:.25,type:"spring"},sY=({size:e="192px",className:t,colors:s,animationDuration:i=20,amplitude:o,state:l="idle"})=>{const u=Sj(),d=wK(o),f=bK(l),p={...{bg:"oklch(92% 0.03 300)",c1:"oklch(68% 0.21 350)",c2:"oklch(70% 0.18 210)",c3:"oklch(66% 0.2 285)",c4:"oklch(72% 0.19 325)"},...s},g=p.c2,b=Number.parseInt(e.replace("px",""),10),w=b<Ul?Math.max(b*TK,RK):Math.max(b*EK,CK),x=b<Ul?Math.max(b*AK,kK):Math.max(b*MK,NK),S=b<Ul?Math.max(b*OK,jK):Math.max(b*DK,_K),T=b<Ul?Math.max(b*IK,PK):Math.max(b*zK,LK),C=(X=>X<e2?BK:X<Ul?UK:X<SK?VK:FK)(b),M=(X=>X<e2?qK:X<Ul?Math.max(x*HK,GK):x)(b),D=u?0:f.reactivity,_=zA(d,X=>{const B=1-X*D*KK;return`${w*B}px`}),N=zA(d,X=>f.scale+X*D*YK),O=u?i:i/f.speed,z=Math.max(b*WK,JK),I=eY/(1+f.speed)*2,V=()=>u?{scale:1,x:0}:l==="error"?{scale:1,x:$K}:f.motif==="breathe"?{scale:tY,x:0}:{scale:1,x:0},$=()=>u?{duration:0}:l==="error"?{duration:QK,ease:t2}:f.motif==="breathe"?{duration:nY,ease:t2,repeat:Number.POSITIVE_INFINITY}:n2;return v.jsxs(qu.div,{animate:V(),className:ke("relative",t),style:{"--orb-size":e,height:e,width:e},transition:$(),children:[v.jsx(qu.div,{animate:{opacity:f.glow*ZK},className:"absolute rounded-full",style:{background:`radial-gradient(circle at 50% 50%, ${g} 0%, transparent 64%)`,filter:`blur(calc(var(--orb-size) * ${XK}))`,inset:"-12%"},transition:u?{duration:0}:n2}),v.jsxs(qu.div,{className:"agent-orb",style:{"--animation-duration":`${O}s`,"--bg":p.bg,"--blur-amount":_,"--c1":p.c1,"--c2":p.c2,"--c3":p.c3,"--c4":p.c4,"--contrast-amount":M,"--dot-size":`${S}px`,"--drift-duration":`${I}s`,"--mask-radius":C,"--rim":`${z}px`,"--shadow-spread":`${T}px`,filter:`saturate(${f.saturation}) hue-rotate(${f.hueRotate}deg)`,height:"100%",scale:N,width:"100%"},children:[v.jsx("span",{"aria-hidden":"true",className:"agent-orb-layer agent-orb-sheen"}),v.jsx("span",{"aria-hidden":"true",className:"agent-orb-layer agent-orb-rim"}),v.jsx("style",{children:`
316
- @property --angle {
317
- syntax: "<angle>";
318
- inherits: false;
319
- initial-value: 0deg;
320
- }
321
-
322
- .agent-orb {
323
- display: grid;
324
- grid-template-areas: "stack";
325
- overflow: hidden;
326
- border-radius: 50%;
327
- position: relative;
328
- isolation: isolate;
329
- }
330
-
331
- .agent-orb::before,
332
- .agent-orb::after,
333
- .agent-orb > .agent-orb-layer {
334
- content: "";
335
- display: block;
336
- grid-area: stack;
337
- width: 100%;
338
- height: 100%;
339
- border-radius: 50%;
340
- }
341
-
342
- /* Glassy highlight that drifts, so the sheen never sits still enough to
343
- read as a printed-on gradient. */
344
- .agent-orb-sheen {
345
- background:
346
- radial-gradient(circle at 30% 24%, hsl(0 0% 100% / 0.32), transparent 34%),
347
- radial-gradient(circle at 72% 80%, hsl(0 0% 100% / 0.07), transparent 48%);
348
- mix-blend-mode: screen;
349
- animation: agent-drift var(--drift-duration) ease-in-out infinite alternate;
350
- }
351
-
352
- /* Lit top edge, shaded bottom, thin inner ring. */
353
- .agent-orb-rim {
354
- box-shadow:
355
- inset 0 0 0 1px hsl(0 0% 100% / 0.16),
356
- inset 0 calc(var(--rim) * 1) calc(var(--rim) * 2) hsl(0 0% 100% / 0.22),
357
- inset 0 calc(var(--rim) * -1.2) calc(var(--rim) * 2.4) hsl(0 0% 0% / 0.4);
358
- pointer-events: none;
359
- }
360
-
361
- @keyframes agent-drift {
362
- 0% { transform: translate(-6%, -4%) scale(1.05); }
363
- 100% { transform: translate(7%, 6%) scale(1.12); }
364
- }
365
-
366
- .agent-orb::before {
367
- background:
368
- conic-gradient(
369
- from calc(var(--angle) * 2) at 25% 70%,
370
- var(--c3),
371
- transparent 20% 80%,
372
- var(--c3)
373
- ),
374
- conic-gradient(
375
- from calc(var(--angle) * 2) at 45% 75%,
376
- var(--c2),
377
- transparent 30% 60%,
378
- var(--c2)
379
- ),
380
- conic-gradient(
381
- from calc(var(--angle) * -3) at 80% 20%,
382
- var(--c1),
383
- transparent 40% 60%,
384
- var(--c1)
385
- ),
386
- conic-gradient(
387
- from calc(var(--angle) * 1.5) at 60% 35%,
388
- var(--c4),
389
- transparent 25% 75%,
390
- var(--c4)
391
- ),
392
- conic-gradient(
393
- from calc(var(--angle) * 2) at 15% 5%,
394
- var(--c2),
395
- transparent 10% 90%,
396
- var(--c2)
397
- ),
398
- conic-gradient(
399
- from calc(var(--angle) * 1) at 20% 80%,
400
- var(--c1),
401
- transparent 10% 90%,
402
- var(--c1)
403
- ),
404
- conic-gradient(
405
- from calc(var(--angle) * -2) at 85% 10%,
406
- var(--c3),
407
- transparent 20% 80%,
408
- var(--c3)
409
- );
410
- box-shadow: inset var(--bg) 0 0 var(--shadow-spread)
411
- calc(var(--shadow-spread) * 0.2);
412
- /* The saturate() pass is what keeps the colour alive after the blur
413
- and the overlaid dot pattern have both eaten into it. */
414
- filter: blur(var(--blur-amount)) contrast(var(--contrast-amount))
415
- saturate(1.4);
416
- animation: rotate var(--animation-duration) linear infinite;
417
- }
418
-
419
- .agent-orb::after {
420
- background-image: radial-gradient(
421
- circle at center,
422
- var(--bg) var(--dot-size),
423
- transparent var(--dot-size)
424
- );
425
- background-size: calc(var(--dot-size) * 2) calc(var(--dot-size) * 2);
426
- backdrop-filter: blur(calc(var(--blur-amount) * 2))
427
- contrast(calc(var(--contrast-amount) * 2));
428
- mix-blend-mode: overlay;
429
- }
430
-
431
- /* Apply mask only when radius is greater than 0 */
432
- .agent-orb[style*="--mask-radius: 0%"]::after {
433
- mask-image: none;
434
- }
435
-
436
- .agent-orb:not([style*="--mask-radius: 0%"])::after {
437
- mask-image: radial-gradient(
438
- black var(--mask-radius),
439
- transparent 75%
440
- );
441
- }
442
-
443
- @keyframes rotate {
444
- to {
445
- --angle: 360deg;
446
- }
447
- }
448
-
449
- @media (prefers-reduced-motion: reduce) {
450
- .agent-orb::before,
451
- .agent-orb-sheen {
452
- animation: none;
453
- }
454
- }
455
- `})]})]})},iY=za({component:rY,getParentRoute:()=>qa,path:"/"});function rY(){var l,u,d,f;const e=Et(No()),t=si(),{t:s}=mt(),i=fN(),o=(l=e.data)==null?void 0:l.find(h=>h.id===i);return o?v.jsx(e5,{params:{botId:o.id},replace:!0,to:"/bots/$botId"}):v.jsxs("div",{className:"relative flex min-h-0 flex-1 justify-center overflow-y-auto px-5 py-10 md:px-8 md:py-14",children:[v.jsx("div",{className:"absolute top-4 right-4",children:v.jsx(gx,{})}),v.jsxs("div",{className:"w-full max-w-2xl",children:[v.jsxs("div",{className:"flex items-center gap-3.5",children:[v.jsx(sY,{colors:{bg:"#0b1f1e",c1:"#3fb8a8",c2:"#0f766e",c3:"#134e4a",c4:"#99f6e4"},size:"52px",state:"idle"}),v.jsxs("div",{children:[v.jsx("p",{className:"font-medium text-[11px] text-muted-foreground uppercase tracking-[0.16em]",children:s("landing.kicker")}),v.jsx("h1",{className:"font-semibold text-2xl tracking-tight",children:s("landing.title")})]})]}),v.jsx("p",{className:"mt-4 max-w-prose text-[13.5px] text-muted-foreground leading-relaxed",children:s("landing.body")}),v.jsx("div",{className:"mt-8 grid gap-2 sm:grid-cols-2",children:(e.data??[]).map(h=>v.jsxs("button",{className:"group flex items-start gap-3 rounded-xl border border-border bg-card p-3 text-left transition-colors hover:border-foreground/20",onClick:()=>{vc(h.id),t({params:{botId:h.id},to:"/bots/$botId"})},type:"button",children:[v.jsx(Bs,{name:h.name,seed:h.avatarSeed,size:34}),v.jsxs("span",{className:"min-w-0 flex-1",children:[v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"truncate font-medium text-[13.5px]",children:h.name}),v.jsx(mN,{bot:h})]}),v.jsxs("span",{className:"mt-0.5 block truncate text-[11.5px] text-muted-foreground",children:[h.title?`${h.title} · `:"",h.workspace]})]}),v.jsx(vE,{className:"mt-1 size-4 shrink-0 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5 group-hover:text-foreground"})]},h.id))}),v.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-3",children:[v.jsxs(Be,{disabled:!((u=e.data)!=null&&u.length),onClick:()=>{var p;const h=(p=e.data)==null?void 0:p[0];h&&(vc(h.id),t({params:{botId:h.id},to:"/bots/$botId"}))},children:[s("landing.open",{name:((f=(d=e.data)==null?void 0:d[0])==null?void 0:f.name)??s("landing.openFallback")}),v.jsx(vE,{className:"size-3.5"})]}),v.jsxs("span",{className:"flex items-center gap-1.5 text-[11.5px] text-muted-foreground",children:[v.jsx(ez,{className:"size-3.5"}),s("landing.command")]})]})]})]})}function oY(e){return xn(e.defaultTagName??"div",e,e)}const Qj=E.createContext(void 0);function Dd(e){const t=E.useContext(Qj);if(t===void 0&&!e)throw new Error(Ts(72));return t}const aY={...zu,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class lY extends np{constructor(s,i,o){const l=new t0;super(cY(s,l,i,o),uY(l),aY);ge(this,"setOpen",(s,i)=>{F4(this,s,i,{extraState:{openChangeReason:i.reason}})})}cancelPendingOpen(s){this.state.floatingRootContext.dispatchOpenChange(!1,ct(Tc,s))}}function cY(e,t,s,i=!1){return{...s0(t,s,i),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function uY(e){return{popupRef:E.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const dY=tp(function(t){const{disabled:s=!1,defaultOpen:i=!1,open:o,disableHoverablePopup:l=!1,trackCursorAxis:u="none",actionsRef:d,onOpenChange:f,onOpenChangeComplete:h,handle:p,triggerId:g,defaultTriggerId:b=null,children:w}=t,x=zM((V,$)=>new lY({open:i,openProp:o,activeTriggerId:b,triggerIdProp:g},V,$));x.useControlledProp("openProp",o),x.useControlledProp("triggerIdProp",g),x.useContextCallback("onOpenChange",f),x.useContextCallback("onOpenChangeComplete",h);const S=x.useState("open"),T=!s&&S,A=x.useState("activeTriggerId"),C=x.useState("mounted"),k=x.useState("payload");x.useSyncedValues({trackCursorAxis:u,disableHoverablePopup:l,disabled:s}),Wx(x,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:D}=Jx(T,x),_=x.useState("isInstantPhase"),N=x.useState("instantType"),O=x.useState("lastOpenChangeReason"),z=E.useRef(null);Me(()=>{S&&s&&x.setOpen(!1,ct(d4))},[S,s,x]),Me(()=>{D==="ending"&&O===Na||D!=="ending"&&_?(N!=="delay"&&(z.current=N),x.set("instantType","delay")):z.current!==null&&(x.set("instantType",z.current),z.current=null)},[D,_,O,N,x]),Me(()=>{T&&A==null&&x.set("payload",void 0)},[x,A,T]),E.useImperativeHandle(d,()=>({unmount:M,close:()=>x.setOpen(!1,ct(Gx))}),[M,x]);const I=T||C||!s&&u!=="none";return v.jsxs(Qj.Provider,{value:x,children:[p&&v.jsx(Xx,{handle:p,store:x}),I&&v.jsx(fY,{store:x,disabled:s,trackCursorAxis:u}),typeof w=="function"?w({payload:k}):w]})});function fY({store:e,disabled:t,trackCursorAxis:s}){const i=e.useState("floatingRootContext"),o=$x(i,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),l=P4(i,{enabled:!t&&s!=="none",axis:s==="none"?void 0:s}),u=E.useMemo(()=>Di(l.reference,o.reference),[l.reference,o.reference]);return e0(e,{activeTriggerProps:u,inactiveTriggerProps:u,popupProps:o.floating??_t}),null}const hY=E.createContext(void 0);function mY(){return E.useContext(hY)}const pY=600,s2="data-base-ui-tooltip-trigger";function i2(e){const t=zn(e);return bt(t)?t:null}const gY=UM(function(t,s){const{render:i,className:o,style:l,handle:u,payload:d,disabled:f,delay:h,closeOnClick:p=!0,closeDelay:g,id:b,...w}=t,x=Dd(!0),T=qM(u)??x;if(!T)throw new Error(Ts(82));const A=Ro(b),C=T.useState("isTriggerActive",A),k=T.useState("isOpenedByTrigger",A),M=T.useState("floatingRootContext"),D=E.useRef(null),_=g??0,{registerTrigger:N,isMountedByThisTrigger:O}=BM(A,D,T,{payload:d,closeOnClick:p,closeDelay:_}),z=mY(),{activeIdRef:I,delayRef:V,isInstantPhase:$,hasProvider:X}=v4(M,{open:k}),B=r0(M);T.useSyncedValue("isInstantPhase",$);const q=T.useState("disabled"),F=f??q,ie=Jt(F),Q=T.useState("trackCursorAxis"),ae=T.useState("disableHoverablePopup"),ne=E.useRef(!1),pe=Ln(),ee=E.useRef(void 0);function ve(){return X&&I.current!=null?0:h??z??pY}function P(me){const ze=D.current;if(!ze||!me)return!1;const Te=sd(me,`[${s2}]`);return Te!==null&&Te!==ze&&qe(ze,Te)}function K(me){const ze=P(me);return ne.current=ze,ze&&(B.openChangeTimeout.clear(),B.restTimeout.clear(),B.restTimeoutPending=!1,pe.clear()),ze}const L=YM(M,{enabled:!F,mouseOnly:!0,move:!1,handleClose:!ae&&Q!=="both"?$M():null,restMs:ve,delay(){return g==null&&X?{close:od(V.current,"close")}:{close:_}},triggerElementRef:D,isActiveTrigger:C,isClosing:()=>T.select("transitionStatus")==="ending",shouldOpen(){return!ne.current}}),H=HM(M,{enabled:!F}).reference,fe=me=>{const ze=ne.current,Te=i2(me),Pe=K(Te),Ae=D.current,Ge=Ae&&Te&&qe(Ae,Te);if(Pe&&T.select("open")&&T.select("lastOpenChangeReason")===hn){T.setOpen(!1,ct(hn,me));return}if(ze&&!Pe&&Ge&&!ie.current&&!T.select("open")&&Ae&&xo(ee.current)){const Ue=()=>{!ne.current&&!ie.current&&!T.select("open")&&T.setOpen(!0,ct(hn,me,Ae))},Se=ve();Se===0?(pe.clear(),Ue()):pe.start(Se,Ue)}},oe=T.useState("appliedTriggerProps",O||Q!=="none");return xn("button",t,{state:{open:k},ref:[s,N,D],props:[L,H,oe,{onMouseOver(me){fe(me.nativeEvent)},onFocus(me){P(i2(me.nativeEvent))&&me.preventBaseUIHandler()},onMouseLeave(){ne.current=!1,pe.clear(),ee.current=void 0},onPointerEnter(me){ee.current=me.pointerType},onPointerDown(me){ee.current=me.pointerType,T.set("closeOnClick",p),p&&!T.select("open")&&T.cancelPendingOpen(me.nativeEvent)},onClick(me){p&&!T.select("open")&&T.cancelPendingOpen(me.nativeEvent)},id:A,[fb]:F?"":void 0,[s2]:F?void 0:""},w],stateAttributesMapping:_B})}),Xj=E.createContext(void 0);function yY(){const e=E.useContext(Xj);if(e===void 0)throw new Error(Ts(70));return e}const vY=E.forwardRef(function(t,s){const{children:i,container:o,className:l,render:u,style:d,...f}=t,{node:h,subtree:p}=MM({container:o,ref:s,componentProps:t,elementProps:f});return!p&&!h?null:v.jsxs(E.Fragment,{children:[p,h&&Tr.createPortal(i,h)]})}),bY=E.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t;return Dd().useState("mounted")||i?v.jsx(Xj.Provider,{value:i,children:v.jsx(vY,{ref:s,...o})}):null}),Zj=E.createContext(void 0);function Wj(){const e=E.useContext(Zj);if(e===void 0)throw new Error(Ts(71));return e}const xY=E.forwardRef(function(t,s){const{render:i,className:o,anchor:l,positionMethod:u="absolute",side:d="top",align:f="center",sideOffset:h=0,alignOffset:p=0,collisionBoundary:g="clipping-ancestors",collisionPadding:b=5,arrowPadding:w=5,sticky:x=!1,disableAnchorTracking:S=!1,collisionAvoidance:T=CM,style:A,...C}=t,k=Dd(),M=yY(),D=k.useState("open"),_=k.useState("mounted"),N=k.useState("trackCursorAxis"),O=k.useState("disableHoverablePopup"),z=k.useState("floatingRootContext"),I=k.useState("instantType"),V=k.useState("transitionStatus"),$=k.useState("adaptiveOrigin"),X=Dj({anchor:l,positionMethod:u,floatingRootContext:z,mounted:_,side:d,sideOffset:h,align:f,alignOffset:p,collisionBoundary:g,collisionPadding:b,sticky:x,arrowPadding:w,disableAnchorTracking:S,keepMounted:M,collisionAvoidance:T,adaptiveOrigin:$}),B=E.useMemo(()=>({open:D,side:X.side,align:X.align,anchorHidden:X.anchorHidden,instant:N!=="none"?"tracking-cursor":I}),[D,X.side,X.align,X.anchorHidden,N,I]),q=Ij(t,B,{styles:X.positionerStyles,transitionStatus:V,props:C,refs:[s,k.useStateSetter("positionerElement")],hidden:!_,inert:!D||N==="both"||O});return v.jsx(Zj.Provider,{value:X,children:q})}),wY=E.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=Dd(),{side:f,align:h}=Wj(),p=d.useState("open"),g=d.useState("instantType"),b=d.useState("transitionStatus"),w=d.useState("popupProps"),x=d.useState("floatingRootContext"),S=d.useState("disabled"),T=d.useState("closeDelay");Jm({open:p,ref:d.context.popupRef,onComplete(){var M,D;p&&((D=(M=d.context).onOpenChangeComplete)==null||D.call(M,!0))}}),KM(x,{enabled:!S,closeDelay:T});const A=d.useStateSetter("popupElement");return xn("div",t,{state:{open:p,side:f,align:h,instant:g,transitionStatus:b},ref:[s,d.context.popupRef,A],props:[Qx,w,rw(b),u],stateAttributesMapping:Dx})}),SY=E.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=Dd(),{arrowRef:f,side:h,align:p,arrowUncentered:g,arrowStyles:b}=Wj(),w=d.useState("open"),x=d.useState("instantType");return xn("div",t,{state:{open:w,side:h,align:p,uncentered:g,instant:x},ref:[s,f],props:[{style:b,"aria-hidden":!0},u],stateAttributesMapping:Qm})});function TY({...e}){return v.jsx(dY,{"data-slot":"tooltip",...e})}function RY({...e}){return v.jsx(gY,{"data-slot":"tooltip-trigger",...e})}function EY({className:e,side:t="top",sideOffset:s=4,align:i="center",alignOffset:o=0,children:l,...u}){return v.jsx(bY,{children:v.jsx(xY,{align:i,alignOffset:o,side:t,sideOffset:s,className:"isolate z-50",children:v.jsxs(wY,{"data-slot":"tooltip-content",className:ke("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...u,children:[l,v.jsx(SY,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const CY=E.createContext(null);function Jj(){return E.useContext(CY)}const AY=Uj("B");function eD(){const e=Jj();if(!e)return!1;const t=e.isMobile?e.openMobile:e.open;return e.isMobile||!t}function kY({className:e}){const t=Jj(),s=eD();if(!t||!s)return null;const{isMobile:i,open:o,openMobile:l,toggleSidebar:u}=t,d=(i?l:o)?"Hide sidebar":"Show sidebar";return v.jsxs(TY,{children:[v.jsx(RY,{render:v.jsx(Be,{"aria-label":d,className:ke("text-muted-foreground",e),onClick:u,size:"icon",variant:"ghost",children:v.jsx(Td,{className:"size-4.5"})})}),v.jsxs(EY,{side:"bottom",children:[d,v.jsx("span",{className:"text-background/60",children:AY})]})]})}const MY={prose:"max-w-3xl",wide:"max-w-5xl"};function tD({action:e,children:t,className:s,description:i,title:o,width:l="prose",backButton:u}){const d=eD(),f=d||!!u;return v.jsxs(v.Fragment,{children:[f?v.jsxs("div",{className:"max-w-7xl w-full h-14 flex items-center gap-1 px-3",children:[d?v.jsx(kY,{}):null,!!u&&v.jsxs(Be,{variant:"ghost",render:h=>v.jsx($n,{...u.linkProps,...h}),children:[v.jsx(W5,{}),u.label]})]}):null,v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:v.jsxs("div",{className:ke("mx-auto flex w-full flex-col px-4 pb-12",f?"pt-8":"pt-12",MY[l],s),children:[v.jsxs("header",{className:"flex flex-col gap-2",children:[v.jsxs("div",{className:"flex flex-row items-center justify-between gap-4",children:[v.jsx("h1",{className:"font-bold text-2xl",children:o}),e]}),i?v.jsx("p",{className:"max-w-prose text-pretty text-muted-foreground text-sm leading-relaxed",children:i}):null]}),t]})})]})}function Hu({action:e,children:t,className:s,description:i,title:o}){return v.jsxs("section",{className:ke("mt-12",s),children:[o?v.jsxs("div",{className:"flex min-h-8 flex-row items-center justify-between gap-4",children:[v.jsx("h2",{className:"font-bold text-lg",children:o}),e]}):null,i?v.jsx("p",{className:"mt-1 max-w-prose text-pretty text-muted-foreground text-sm leading-relaxed",children:i}):null,t]})}function zv({children:e,className:t}){return v.jsx("div",{className:ke("mt-4 overflow-hidden rounded-lg border border-border bg-card dark:border-transparent","[&_[data-slot=item]]:rounded-none",t),children:e})}function r2({children:e}){return v.jsx("p",{className:"mt-4 text-muted-foreground text-sm",children:e})}const NY=za({component:OY,getParentRoute:()=>qa,path:"/inbox"});function OY(){var f,h,p;const e=Et(Rc()),t=Et(No()),s=g=>{var b;return(b=t.data)==null?void 0:b.find(w=>w.id===g)},i=((f=e.data)==null?void 0:f.approvals)??[],o=((h=e.data)==null?void 0:h.questions)??[],l=((p=e.data)==null?void 0:p.handoffs)??[],u=i.length+o.length,{t:d}=mt();return v.jsxs(tD,{description:d("inbox.description"),title:d("inbox.title"),children:[v.jsx(Hu,{title:u>0?d("inbox.needsYouCount",{count:u}):d("inbox.needsYou"),children:u===0?v.jsx(r2,{children:d("inbox.empty")}):v.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[o.map(g=>{const b=s(g.botId);return b?v.jsxs("div",{children:[v.jsx(o2,{botId:b.id,botName:b.name,threadId:g.threadId,roomId:g.roomId??void 0}),v.jsx(m0,{botName:b.name,question:g})]},g.id):null}),i.map(g=>{const b=s(g.botId);return b?v.jsxs("div",{children:[v.jsx(o2,{botId:b.id,botName:b.name,threadId:g.threadId,roomId:g.roomId??void 0}),v.jsx(h0,{approval:g,botName:b.name})]},g.id):null})]})}),v.jsx(Hu,{description:d("inbox.handoffsDescription"),title:d("inbox.handoffs"),children:l.length===0?v.jsx(r2,{children:d("inbox.noHandoffs")}):v.jsx("div",{className:"mt-4 flex flex-col gap-2",children:l.map(g=>v.jsx(TN,{handoff:g},g.id))})})]})}function o2({botId:e,botName:t,threadId:s,roomId:i}){const{t:o}=mt();return v.jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[v.jsx("span",{className:"font-medium text-[11px] text-muted-foreground uppercase tracking-[0.12em]",children:t}),i!==void 0?v.jsxs($n,{className:"flex items-center gap-1 text-[11.5px] text-muted-foreground hover:text-foreground",params:{roomId:i},to:"/rooms/$roomId",children:[o("inbox.openRoom"),v.jsx(ob,{className:"size-3"})]}):v.jsxs($n,{className:"flex items-center gap-1 text-[11.5px] text-muted-foreground hover:text-foreground",params:{botId:e,threadId:s},to:"/bots/$botId/threads/$threadId",children:[o("inbox.openThread"),v.jsx(ob,{className:"size-3"})]})]})}function jY({activeIndex:e,candidates:t,onPick:s}){const{t:i}=mt();return t.length===0?null:v.jsxs("div",{"aria-label":i("composer.mentionsTitle"),className:"absolute bottom-full left-0 z-10 mb-2 w-72 overflow-hidden rounded-xl border border-border bg-popover p-1 shadow-lg",id:"room-mention-listbox",role:"listbox",children:[v.jsx("p",{className:"px-2 pt-1 pb-1.5 text-[10.5px] text-muted-foreground uppercase tracking-[0.12em]",children:i("composer.mentionsTitle")}),t.map((o,l)=>v.jsxs("button",{"aria-selected":l===e,id:`room-mention-${String(l)}`,className:ke("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-[13px]",l===e?"bg-muted":"hover:bg-muted/60"),onMouseDown:u=>{u.preventDefault(),s(o)},role:"option",type:"button",children:[v.jsx(Bs,{emoji:o.emoji,hue:o.hue,name:o.name,seed:o.seed,size:22}),v.jsx("span",{className:"min-w-0 flex-1 truncate",children:o.name})]},o.id)),v.jsx("p",{className:"border-t border-border/60 px-2 pt-1.5 pb-1 text-[10.5px] text-muted-foreground",children:i("composer.mentionsHint")})]})}const a2=/\s/;function DY(e,t){const s=Math.min(Math.max(t,0),e.length);let i=s-1;for(;i>=0;){const o=e[i]??"";if(o==="@"){const l=i===0?"":e[i-1]??"";return i>0&&!a2.test(l)?null:{query:e.slice(i+1,s),start:i,end:s}}if(a2.test(o))return null;i-=1}return null}function _Y(e,t,s){const i=e.slice(0,t.start),o=e.slice(t.end).replace(/^\s+/,""),l=`@${s} `;return{value:`${i}${l}${o}`,caret:i.length+l.length}}function IY(e,t){const s=t.trim().toLowerCase();if(s.length===0)return[...e];const i=[],o=[];for(const l of e){const u=l.name.toLowerCase();u.startsWith(s)?i.push(l):u.includes(s)&&o.push(l)}return[...i,...o]}const rr=new pN(()=>{}),nD=za({component:PY,getParentRoute:()=>qa,path:"/rooms/$roomId"});function PY(){const{roomId:e}=nD.useParams();return v.jsx(zY,{roomId:e},e)}function zY({roomId:e}){var pe,ee,ve,P,K;const t=nw(),s=si(),i=Et(ap()),o=Et(No()),l=Et(z6(e)),u=Et(L6(e)),[d,f]=E.useState(()=>ZA(e)),[h,p]=E.useState(null);E.useEffect(()=>(f(ZA(e)),p(null),cK((L,H)=>{L===e&&f(H)})),[e]),E.useEffect(()=>{var L;h!==null&&(L=l.data)!=null&&L.some(H=>H.speakerKind==="user"&&H.content===h)&&p(null)},[l.data,h]),E.useEffect(()=>{!(u.data??[]).some(H=>H.status==="queued"||H.status==="running"||H.status==="waiting_user")&&d.length>0&&uK(e)},[d.length,e,u.data]);const g=Us(),{t:b}=mt(),w=ad("room",e),x=E.useSyncExternalStore(rr.subscribe,()=>rr.get(w)),S=x.value,T=E.useRef(null),A=(pe=i.data)==null?void 0:pe.find(L=>L.id===e),C=((A==null?void 0:A.memberIds)??[]).map(L=>{var H;return(H=o.data)==null?void 0:H.find(fe=>fe.id===L)}).filter(L=>!!L),k=C.find(L=>L.id===(A==null?void 0:A.leadBotId)),[M,D]=E.useState(null),[_,N]=E.useState([]),[O,z]=E.useState(0),[I,V]=E.useState(null),$=E.useRef(null),X=(k==null?void 0:k.id)??((ee=C[0])==null?void 0:ee.id);E.useEffect(()=>{GG(e)},[e]);const B=On({mutationFn:()=>Yt().deleteRoom(e),onSuccess:async()=>{g.setQueryData(He.rooms(),L=>L==null?void 0:L.filter(H=>H.id!==e)),await s({to:"/"}),await g.invalidateQueries({queryKey:He.rooms()})}}),q=On({retry:!1,mutationFn:L=>Yt().promptRoom(L.threadId,L.text,{requestKey:L.id,attachments:L.attachments??[]}),onSuccess:(L,H)=>{rr.finish(H),g.invalidateQueries({queryKey:He.roomMessages(H.threadId)})},onError:(L,H)=>{p(null),rr.finish(H,L.message||b("composer.sendFailed"))}}),F=()=>{if(O>0)return;const L=rr.begin("room",e,S,!1,"queue",!0,_);L&&(N([]),p(L.text),q.mutate(L))},ie=async L=>{if(L===null||L.length===0||X===void 0)return;const H=Math.max(0,10-_.length),fe=Array.from(L).slice(0,H);fe.length<L.length&&V(b("composer.tooManyFiles",{max:10})),z(oe=>oe+fe.length);for(const oe of fe)try{const ye=await Yt().uploadRoomAttachment(e,oe);N(ce=>[...ce,ye])}catch(ye){V(ye instanceof Error?ye.message:b("composer.uploadFailed"))}finally{z(ye=>Math.max(0,ye-1))}$.current!==null&&($.current.value="")},Q=E.useMemo(()=>{if(M===null)return[];const L=C.map(H=>({id:H.id,name:H.name,seed:H.avatarSeed,emoji:H.avatarEmoji,hue:H.accentHue}));return IY(L,M.token.query).slice(0,6)},[C,M]),ae=L=>{if(M===null)return;const H=_Y(S,M.token,L.name);rr.edit(w,H.value),D(null),requestAnimationFrame(()=>{const fe=T.current;fe!==null&&(fe.focus(),fe.setSelectionRange(H.caret,H.caret))})},ne=()=>{const L=T.current,H=(L==null?void 0:L.selectionStart)??S.length,fe=`${S.slice(0,H)}@${S.slice(H)}`;rr.edit(w,fe),D({index:0,token:{end:H+1,query:"",start:H}}),requestAnimationFrame(()=>{const oe=T.current;oe!==null&&(oe.focus(),oe.setSelectionRange(H+1,H+1))})};return A?v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[v.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-border px-4",children:[v.jsx(Be,{"aria-label":b("cockpit.openNav"),className:"lg:hidden",onClick:t.openRail,size:"icon-sm",variant:"ghost",children:v.jsx(Td,{className:"size-4"})}),v.jsx(vk,{className:"size-4 text-muted-foreground"}),v.jsx("h1",{className:"font-medium text-[14px]",children:A.name}),v.jsx("div",{className:"ml-1 flex items-center",title:k?b("room.lead",{name:k.name}):b("room.noLead"),children:v.jsx(Bj,{people:C.map(L=>({name:L.name,seed:L.avatarSeed,emoji:L.avatarEmoji,hue:L.accentHue})),size:22})}),v.jsxs("span",{className:"sr-only",children:[C.map(L=>L.name).join(", "),k?` · ${b("room.lead",{name:k.name})}`:""]}),v.jsx(Be,{"aria-label":b("room.delete"),className:"ml-auto",onClick:()=>{window.confirm(b("room.deleteConfirm"))&&(B.isPending||B.mutate())},size:"icon-sm",variant:"ghost",children:v.jsx(yx,{})})]}),l.error?v.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-destructive text-xs",children:[b("common.loadFailed")," ",l.error.message,v.jsx(Be,{onClick:()=>void l.refetch(),size:"sm",variant:"ghost",children:b("common.retry")})]}):null,l.isPending?v.jsx("p",{className:"p-4 text-muted-foreground text-sm",children:b("common.loading")}):null,B.error?v.jsx("p",{className:"p-4 text-destructive text-xs",role:"alert",children:B.error.message}):null,(u.data??[]).filter(L=>L.status==="interrupted").map(L=>v.jsx(PN,{roomId:e,run:L},`recovery-${L.id}`)),(u.data??[]).filter(L=>L.status!=="done"&&L.status!=="cancelled").length>0?v.jsx("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-4 py-1.5 text-muted-foreground text-[11.5px]",children:(u.data??[]).filter(L=>L.status!=="done"&&L.status!=="cancelled").map(L=>{var H,fe;return v.jsxs("span",{className:"rounded-full bg-muted px-2 py-0.5",children:[((fe=(H=o.data)==null?void 0:H.find(oe=>oe.id===L.botId))==null?void 0:fe.name)??L.botId,": ",b(`run.${L.status}`)]},L.id)})}):null,v.jsx(yN,{children:v.jsx(bN,{children:v.jsxs(xN,{children:[v.jsxs(wN,{className:"mx-auto w-full max-w-2xl gap-5 px-4 py-7 md:px-8",children:[(l.data??[]).map(L=>{var me;if(L.speakerKind==="system")return v.jsx("p",{className:"text-center text-[11.5px] text-muted-foreground/80",children:L.content},L.id);const H=(me=o.data)==null?void 0:me.find(ze=>ze.id===L.speakerId),fe=L.speakerKind==="user",oe=(H==null?void 0:H.name)??L.answeredBy??b("room.removedMember"),ye=(H==null?void 0:H.avatarSeed)??L.speakerId,ce=(H==null?void 0:H.accentHue)??Wu(ye);return v.jsxs("div",{className:fe?"flex justify-end":"flex min-w-0 gap-2.5",children:[fe?null:v.jsx(Bs,{emoji:H==null?void 0:H.avatarEmoji,hue:H==null?void 0:H.accentHue,name:oe,seed:ye,size:26}),v.jsxs("div",{className:fe?"max-w-[85%]":"bot-card min-w-0 flex-1 rounded-xl px-3 py-2",style:fe?void 0:{"--bot-hue":String(ce)},children:[v.jsxs("div",{className:fe?"flex items-baseline justify-end gap-2":"flex items-baseline gap-2",children:[v.jsx("span",{className:"font-medium text-[12.5px]",children:fe?b("room.you"):oe}),L.via==="handoff"?v.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:b("room.viaHandoff")}):null,v.jsx("time",{className:"text-[11px] text-muted-foreground",children:L.createdAt>0?bc(new Date(L.createdAt).toISOString()):b("common.unknownTime")})]}),fe?v.jsx("p",{className:"mt-1 rounded-2xl rounded-br-md bg-secondary px-3.5 py-2 text-[13.5px] leading-relaxed whitespace-pre-wrap",children:L.content}):v.jsx(Tm,{content:L.content,className:"mt-1"}),v.jsx(IN,{align:fe?"end":"start",attachments:L.attachments})]})]},L.id)}),h!==null?v.jsx("div",{className:"flex justify-end opacity-70",children:v.jsxs("div",{className:"max-w-[85%]",children:[v.jsxs("div",{className:"flex items-baseline justify-end gap-2",children:[v.jsx("span",{className:"font-medium text-[12.5px]",children:b("room.you")}),v.jsx("span",{className:"text-[11px] text-muted-foreground",children:b("room.sending")})]}),v.jsx("p",{className:"mt-1 rounded-2xl rounded-br-md bg-secondary px-3.5 py-2 text-[13.5px] leading-relaxed whitespace-pre-wrap",children:h})]})},"pending-user"):null,d.map(L=>{var ye;const H=(ye=o.data)==null?void 0:ye.find(ce=>ce.id===L.botId),fe=(H==null?void 0:H.avatarSeed)??L.botId,oe=(H==null?void 0:H.accentHue)??Wu(fe);return v.jsxs("div",{className:"flex min-w-0 gap-2.5",children:[v.jsx(Bs,{emoji:H==null?void 0:H.avatarEmoji,hue:H==null?void 0:H.accentHue,name:(H==null?void 0:H.name)??b("room.bot"),seed:fe,size:26}),v.jsxs("div",{className:"bot-card min-w-0 flex-1 rounded-xl px-3 py-2",style:{"--bot-hue":String(oe)},children:[v.jsxs("div",{className:"flex items-baseline gap-2",children:[v.jsx("span",{className:"font-medium text-[12.5px]",children:(H==null?void 0:H.name)??b("room.bot")}),v.jsx("span",{className:"animate-pulse text-[11px] text-muted-foreground",children:b("room.replying")})]}),v.jsx(Tm,{content:L.content,className:"mt-1 opacity-80"})]})]},`live-${L.botId}`)}),d.length===0&&(q.isPending||(u.data??[]).some(L=>L.status==="queued"||L.status==="running"||L.status==="waiting_user"))?v.jsxs("p",{className:"flex items-center gap-2 py-2 text-muted-foreground text-xs",role:"status",children:[v.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-muted-foreground"}),b("room.waiting")]}):null,((P=l.data)==null?void 0:P.length)===0&&h===null&&d.length===0?v.jsx("p",{className:"py-16 text-center text-muted-foreground text-sm",children:b("room.empty")}):null]}),v.jsx(SN,{})]})})}),v.jsxs("div",{className:"shrink-0 px-4 pb-4 md:px-8 md:pb-5",children:[v.jsxs("div",{className:"relative mx-auto w-full max-w-2xl",children:[M!==null?v.jsx(jY,{activeIndex:M.index,candidates:Q,onPick:ae}):null,v.jsxs("div",{className:"rounded-2xl border border-border bg-card p-2 shadow-sm focus-within:border-foreground/20",children:[I!==null?v.jsx("p",{className:"px-1 pb-1.5 text-[11.5px] text-destructive",role:"alert",children:I}):null,_.length>0||O>0?v.jsxs("div",{className:"flex flex-wrap gap-1.5 px-1 pb-1.5",children:[_.map(L=>v.jsxs("span",{className:"flex max-w-[220px] items-center gap-1.5 rounded-lg bg-muted px-2 py-1 text-[11.5px]",children:[v.jsx(Zu,{className:"size-3 shrink-0 text-muted-foreground"}),v.jsx("span",{className:"truncate",children:L.name}),v.jsx("button",{"aria-label":b("composer.removeAttachment",{name:L.name}),className:"text-muted-foreground hover:text-foreground",onClick:()=>N(H=>H.filter(fe=>fe.id!==L.id)),type:"button",children:v.jsx(Sc,{className:"size-3"})})]},L.id)),O>0?v.jsx("span",{className:"rounded-lg bg-muted px-2 py-1 text-[11.5px] text-muted-foreground",children:b("composer.attaching",{count:O})}):null]}):null,v.jsx("textarea",{"aria-activedescendant":M!==null&&Q.length>0?`room-mention-${String(M.index)}`:void 0,"aria-autocomplete":"list","aria-controls":"room-mention-listbox","aria-expanded":M!==null&&Q.length>0,role:"combobox","aria-label":b("room.messageAria",{room:A.name}),className:"block max-h-40 min-h-[36px] w-full resize-none bg-transparent px-1.5 py-1.5 text-[13.5px] leading-relaxed outline-none placeholder:text-muted-foreground",onChange:L=>{const H=L.target.value;rr.edit(w,H);const fe=L.target.selectionStart??H.length,oe=DY(H,fe);D(oe===null?null:{index:0,token:oe})},onKeyDown:L=>{const H=L.nativeEvent.isComposing;if(M!==null&&Q.length>0&&!H){if(L.key==="ArrowDown"){L.preventDefault(),D({index:Math.min(M.index+1,Q.length-1),token:M.token});return}if(L.key==="ArrowUp"){L.preventDefault(),D({index:Math.max(M.index-1,0),token:M.token});return}if(L.key==="Escape"){L.preventDefault(),D(null);return}if((L.key==="Enter"||L.key==="Tab")&&!L.shiftKey){const fe=Q[M.index]??Q[0];if(fe!==void 0){L.preventDefault(),ae(fe);return}}}L.key==="Enter"&&!L.shiftKey&&!L.nativeEvent.isComposing&&(L.preventDefault(),F())},placeholder:b("room.placeholder",{room:A.name,bot:((K=C[0])==null?void 0:K.name)??b("room.bot")}),ref:T,rows:1,value:S}),v.jsxs("div",{className:"flex items-center gap-1 px-0.5 pt-1",children:[v.jsx(Be,{"aria-label":b("composer.attach"),className:"h-7 px-2 text-muted-foreground",disabled:X===void 0||O>0,onClick:()=>{var L;return(L=$.current)==null?void 0:L.click()},size:"sm",variant:"ghost",children:v.jsx(Zu,{className:"size-4"})}),v.jsx("input",{className:"hidden",multiple:!0,onChange:L=>{ie(L.target.files)},ref:$,type:"file"}),v.jsx(Be,{"aria-label":b("composer.mention"),className:"h-7 px-2 font-medium text-[13px] text-muted-foreground",onClick:ne,size:"sm",variant:"ghost",children:"@"}),v.jsx("span",{className:"ml-auto hidden text-[10.5px] text-muted-foreground sm:inline",children:b("composer.enterToSend")}),v.jsx(Be,{"aria-label":b("room.send"),className:"rounded-full",disabled:!S.trim()||O>0||x.pending!==null||x.retry!==null,onClick:F,size:"icon-sm",children:v.jsx(gk,{className:"size-4"})})]})]})]}),x.retry?v.jsxs("section",{"aria-label":b("composer.unconfirmedText"),className:"mt-2 rounded-lg border border-border p-2 text-xs",children:[v.jsx("p",{role:"status",children:b("composer.unconfirmed")}),v.jsx("pre",{className:"my-2 whitespace-pre-wrap break-words",children:x.retry.restore}),v.jsx(Be,{disabled:x.pending!==null,onClick:()=>{const L=rr.retry("room",e,!1);L&&(p(L.text),q.mutate(L))},size:"sm",variant:"outline",children:b("composer.retryRequest")})]}):null,x.error?v.jsx("p",{className:"mt-2 text-destructive text-xs",role:"alert",children:x.error}):null]})]}):v.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-muted-foreground text-sm",children:[v.jsx(Be,{className:"lg:hidden",onClick:t.openRail,variant:"outline",children:b("cockpit.openNav")}),v.jsx("p",{role:i.error?"alert":void 0,children:i.isPending?b("room.loading"):((ve=i.error)==null?void 0:ve.message)??b("room.missing")}),i.error?v.jsx(Be,{onClick:()=>void i.refetch(),children:b("common.retry")}):null]})}const LY=Ex("group/item flex w-full flex-wrap items-center rounded-lg border dark:border-transparent text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [a]:transition-colors [a]:hover:bg-muted",{variants:{variant:{default:"border-transparent",outline:"border-border",muted:"border-transparent bg-muted/50"},size:{default:"gap-2.5 px-3 py-2.5",sm:"gap-2.5 px-3 py-2.5",xs:"gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0"}},defaultVariants:{variant:"default",size:"default"}});function ia({className:e,variant:t="default",size:s="default",render:i,...o}){return oY({defaultTagName:"div",props:Di({className:ke(LY({variant:t,size:s,className:e}))},o),render:i,state:{slot:"item",variant:t,size:s}})}function ra({className:e,...t}){return v.jsx("div",{"data-slot":"item-content",className:ke("flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none",e),...t})}function oa({className:e,...t}){return v.jsx("div",{"data-slot":"item-title",className:ke("line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4",e),...t})}function aa({className:e,...t}){return v.jsx("p",{"data-slot":"item-description",className:ke("line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}const BY=za({component:VY,getParentRoute:()=>qa,path:"/settings"}),UY=[{id:"light",key:"settings.light"},{id:"dark",key:"settings.dark"},{id:"system",key:"settings.system"}];function VY(){const[e,t]=E.useState(()=>Im()),s=si(),{openRail:i}=nw(),o=Gj(),{t:l}=mt();return v.jsxs(tD,{action:v.jsx(Be,{"aria-label":l("cockpit.openNav"),className:"lg:hidden",onClick:i,size:"icon-sm",variant:"ghost",children:v.jsx(Td,{className:"size-4"})}),description:l("settings.description"),title:l("settings.title"),children:[v.jsx(Hu,{title:l("settings.appearance"),children:v.jsxs(zv,{children:[v.jsxs(ia,{size:"sm",children:[v.jsxs(ra,{children:[v.jsx(oa,{children:l("settings.language")}),v.jsx(aa,{children:l("settings.languageDescription")})]}),v.jsx("div",{className:"p-2",children:v.jsx(gx,{})})]}),v.jsx(vh,{}),v.jsxs(ia,{size:"sm",children:[v.jsxs(ra,{children:[v.jsx(oa,{children:l("settings.theme")}),v.jsx(aa,{children:l("settings.themeDescription")})]}),v.jsx("div",{className:"flex items-center gap-1 p-2",children:UY.map(u=>v.jsx(Be,{onClick:()=>{t(u.id),Hj(u.id)},size:"sm",variant:e===u.id?"secondary":"ghost",children:l(u.key)},u.id))})]}),v.jsx(vh,{}),v.jsxs(ia,{size:"sm",children:[v.jsxs(ra,{children:[v.jsx(oa,{children:l("settings.opens")}),v.jsx(aa,{children:l("settings.opensDescription")})]}),v.jsx("div",{className:"p-2",children:v.jsx(Be,{onClick:()=>{hN(),s({to:"/"})},size:"sm",variant:"outline",children:l("settings.forget")})})]})]})}),v.jsx(Hu,{title:l("settings.keyboard"),children:v.jsxs(zv,{children:[v.jsxs(ia,{size:"sm",children:[v.jsxs(ra,{children:[v.jsx(oa,{children:l("settings.command")}),v.jsx(aa,{children:l("settings.commandDescription")})]}),v.jsxs("div",{className:"flex items-center gap-1.5 px-3 text-muted-foreground",children:[v.jsx(uz,{className:"size-4"}),v.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:"⌘K"})]})]}),v.jsx(vh,{}),v.jsx(ia,{size:"sm",children:v.jsxs(ra,{children:[v.jsx(oa,{children:l("settings.composer")}),v.jsx(aa,{children:l("settings.composerDescription")})]})})]})}),v.jsx(Hu,{title:l("settings.transport"),children:v.jsxs(zv,{children:[v.jsxs(ia,{size:"sm",children:[v.jsxs(ra,{children:[v.jsx(oa,{children:l("settings.dataSource")}),v.jsx(aa,{children:l("settings.dataSourceDescription")})]}),v.jsx("span",{className:"mx-3 rounded-full border border-border px-2 py-0.5 text-[11px] text-muted-foreground",children:l(`connection.${o.status}`)})]}),v.jsx(vh,{}),v.jsx(ia,{size:"sm",children:v.jsxs(ra,{children:[v.jsx(oa,{children:l("settings.singleUser")}),v.jsx(aa,{children:l("settings.singleUserDescription")})]})})]})}),v.jsxs("p",{className:"mt-10 flex items-center gap-1.5 text-[11.5px] text-muted-foreground",children:[e==="dark"?v.jsx(xk,{className:"size-3.5"}):v.jsx(Ek,{className:"size-3.5"}),l("settings.footer")]})]})}const FY=pk.addChildren([qa.addChildren([iY,Kj,Yj,NY,nD,BY])]),qY=S5({defaultPreload:"intent",routeTree:FY});YG();const sD=document.getElementById("root");if(!sD)throw new Error("The workbench is missing its root element.");O5.createRoot(sD).render(v.jsx(E.StrictMode,{children:v.jsx(X3,{client:L5,children:v.jsx(z5,{children:v.jsx(E5,{router:qY})})})}));