@dudousxd/nestjs-durable-dashboard 0.57.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ var XN=Object.defineProperty;var P0=e=>{throw TypeError(e)};var ZN=(e,t,n)=>t in e?XN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>ZN(e,typeof t!="symbol"?t+"":t,n),ef=(e,t,n)=>t.has(e)||P0("Cannot "+n);var D=(e,t,n)=>(ef(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?P0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),te=(e,t,n,r)=>(ef(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pe=(e,t,n)=>(ef(e,t,"access private method"),n);var La=(e,t,n,r)=>({set _(s){te(e,t,s,n)},get _(){return D(e,t,r)}});function JN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Pw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iw={exports:{}},Ju={},jw={exports:{}},Ne={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 wa=Symbol.for("react.element"),eR=Symbol.for("react.portal"),tR=Symbol.for("react.fragment"),nR=Symbol.for("react.strict_mode"),rR=Symbol.for("react.profiler"),sR=Symbol.for("react.provider"),oR=Symbol.for("react.context"),iR=Symbol.for("react.forward_ref"),lR=Symbol.for("react.suspense"),aR=Symbol.for("react.memo"),cR=Symbol.for("react.lazy"),I0=Symbol.iterator;function uR(e){return e===null||typeof e!="object"?null:(e=I0&&e[I0]||e["@@iterator"],typeof e=="function"?e:null)}var Ow={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_w=Object.assign,Mw={};function $i(e,t,n){this.props=e,this.context=t,this.refs=Mw,this.updater=n||Ow}$i.prototype.isReactComponent={};$i.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};$i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Aw(){}Aw.prototype=$i.prototype;function om(e,t,n){this.props=e,this.context=t,this.refs=Mw,this.updater=n||Ow}var im=om.prototype=new Aw;im.constructor=om;_w(im,$i.prototype);im.isPureReactComponent=!0;var j0=Array.isArray,zw=Object.prototype.hasOwnProperty,lm={current:null},Dw={key:!0,ref:!0,__self:!0,__source:!0};function $w(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)zw.call(t,r)&&!Dw.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];s.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:wa,type:e,key:o,ref:i,props:s,_owner:lm.current}}function dR(e,t){return{$$typeof:wa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function am(e){return typeof e=="object"&&e!==null&&e.$$typeof===wa}function fR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var O0=/\/+/g;function tf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fR(""+e.key):t.toString(36)}function Pc(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case wa:case eR:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+tf(i,0):r,j0(s)?(n="",e!=null&&(n=e.replace(O0,"$&/")+"/"),Pc(s,t,n,"",function(c){return c})):s!=null&&(am(s)&&(s=dR(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(O0,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",j0(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+tf(o,l);i+=Pc(o,t,n,a,s)}else if(a=uR(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+tf(o,l++),i+=Pc(o,t,n,a,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Ha(e,t,n){if(e==null)return e;var r=[],s=0;return Pc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function hR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Vt={current:null},Ic={transition:null},pR={ReactCurrentDispatcher:Vt,ReactCurrentBatchConfig:Ic,ReactCurrentOwner:lm};function Fw(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:Ha,forEach:function(e,t,n){Ha(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ha(e,function(){t++}),t},toArray:function(e){return Ha(e,function(t){return t})||[]},only:function(e){if(!am(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=$i;Ne.Fragment=tR;Ne.Profiler=rR;Ne.PureComponent=om;Ne.StrictMode=nR;Ne.Suspense=lR;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pR;Ne.act=Fw;Ne.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=_w({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=lm.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)zw.call(t,a)&&!Dw.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:wa,type:e.type,key:s,ref:o,props:r,_owner:i}};Ne.createContext=function(e){return e={$$typeof:oR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:sR,_context:e},e.Consumer=e};Ne.createElement=$w;Ne.createFactory=function(e){var t=$w.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:iR,render:e}};Ne.isValidElement=am;Ne.lazy=function(e){return{$$typeof:cR,_payload:{_status:-1,_result:e},_init:hR}};Ne.memo=function(e,t){return{$$typeof:aR,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=Ic.transition;Ic.transition={};try{e()}finally{Ic.transition=t}};Ne.unstable_act=Fw;Ne.useCallback=function(e,t){return Vt.current.useCallback(e,t)};Ne.useContext=function(e){return Vt.current.useContext(e)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(e){return Vt.current.useDeferredValue(e)};Ne.useEffect=function(e,t){return Vt.current.useEffect(e,t)};Ne.useId=function(){return Vt.current.useId()};Ne.useImperativeHandle=function(e,t,n){return Vt.current.useImperativeHandle(e,t,n)};Ne.useInsertionEffect=function(e,t){return Vt.current.useInsertionEffect(e,t)};Ne.useLayoutEffect=function(e,t){return Vt.current.useLayoutEffect(e,t)};Ne.useMemo=function(e,t){return Vt.current.useMemo(e,t)};Ne.useReducer=function(e,t,n){return Vt.current.useReducer(e,t,n)};Ne.useRef=function(e){return Vt.current.useRef(e)};Ne.useState=function(e){return Vt.current.useState(e)};Ne.useSyncExternalStore=function(e,t,n){return Vt.current.useSyncExternalStore(e,t,n)};Ne.useTransition=function(){return Vt.current.useTransition()};Ne.version="18.3.1";jw.exports=Ne;var S=jw.exports;const Lw=Pw(S),mR=JN({__proto__:null,default:Lw},[S]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 gR=S,xR=Symbol.for("react.element"),yR=Symbol.for("react.fragment"),vR=Object.prototype.hasOwnProperty,wR=gR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bR={key:!0,ref:!0,__self:!0,__source:!0};function Hw(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)vR.call(t,r)&&!bR.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:xR,type:e,key:o,ref:i,props:s,_owner:wR.current}}Ju.Fragment=yR;Ju.jsx=Hw;Ju.jsxs=Hw;Iw.exports=Ju;var d=Iw.exports;const Bw=S.createContext(void 0),mo=e=>{const t=S.useContext(Bw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},U6=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(Bw.Provider,{value:e,children:t})),SR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Jr,sm,gw,kR=(gw=class{constructor(){oe(this,Jr,SR);oe(this,sm,!1)}setTimeoutProvider(e){te(this,Jr,e)}setTimeout(e,t){return D(this,Jr).setTimeout(e,t)}clearTimeout(e){D(this,Jr).clearTimeout(e)}setInterval(e,t){return D(this,Jr).setInterval(e,t)}clearInterval(e){D(this,Jr).clearInterval(e)}},Jr=new WeakMap,sm=new WeakMap,gw);const Ds=new kR;function ER(e){setTimeout(e,0)}const CR=typeof window>"u"||"Deno"in globalThis;function Ot(){}function NR(e,t){return typeof e=="function"?e(t):e}function Vw(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ww(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tt(e,t){return typeof e=="function"?e(t):e}function _0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==cm(i,t.options))return!1}else if(!xi(t.queryKey,i))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function M0(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ro(t.options.mutationKey)!==ro(o))return!1}else if(!xi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function cm(e,t){return((t==null?void 0:t.queryKeyHashFn)||ro)(e)}function ro(e){return JSON.stringify(e,(t,n)=>rh(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function xi(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)){for(let r=0;r<t.length;r++)if(!xi(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!xi(e[r],t[r]))return!1;return!0}return!1}const RR=Object.prototype.hasOwnProperty;function um(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=A0(e)&&A0(t);if(!r&&!(rh(e)&&rh(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),i=o.length,l=r?new Array(i):{};let a=0;for(let c=0;c<i;c++){const u=r?c:o[c],f=e[u],h=t[u];if(f===h){l[u]=f,(r?c<s:RR.call(e,u))&&a++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){l[u]=h;continue}const p=um(f,h,n+1);l[u]=p,p===f&&a++}return s===i&&a===s?e:l}function xl(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function A0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rh(e){if(!z0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!z0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function z0(e){return Object.prototype.toString.call(e)==="[object Object]"}function TR(e){return new Promise(t=>{Ds.setTimeout(t,e)})}function sh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?um(e,t):t}function PR(e){return e}function IR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function jR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const dm=Symbol();function Uw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===dm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fm(e,t){return typeof e=="function"?e(...t):!!e}function OR(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}let _R=()=>CR;const hm=()=>_R();var go=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(){}},Bs,es,ni,xw,MR=(xw=class extends go{constructor(){super();oe(this,Bs);oe(this,es);oe(this,ni);te(this,ni,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,es)||this.setEventListener(D(this,ni))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,es))==null||t.call(this),te(this,es,void 0))}setEventListener(t){var n;te(this,ni,t),(n=D(this,es))==null||n.call(this),te(this,es,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){D(this,Bs)!==t&&(te(this,Bs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,Bs)=="boolean"?D(this,Bs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Bs=new WeakMap,es=new WeakMap,ni=new WeakMap,xw);const pm=new MR,AR=ER;function zR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=AR;const o=l=>{t?e.push(l):s(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||i()}return a},batchCalls:l=>(...a)=>{o(()=>{l(...a)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const rt=zR();var ri,ts,si,yw,DR=(yw=class extends go{constructor(){super();oe(this,ri,!0);oe(this,ts);oe(this,si);te(this,si,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){D(this,ts)||this.setEventListener(D(this,si))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,ts))==null||t.call(this),te(this,ts,void 0))}setEventListener(t){var n;te(this,si,t),(n=D(this,ts))==null||n.call(this),te(this,ts,t(this.setOnline.bind(this)))}setOnline(t){D(this,ri)!==t&&(te(this,ri,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return D(this,ri)}},ri=new WeakMap,ts=new WeakMap,si=new WeakMap,yw);const Qc=new DR;function $R(e){return Math.min(1e3*2**e,3e4)}function qw(e){return(e??"online")==="online"?Qc.isOnline():!0}var oh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Kw(e){let t=!1,n=0,r,s="pending",o,i;const l=new Promise((m,y)=>{o=m,i=y});l.catch(Ot);const a=()=>s!=="pending",c=m=>{var y;if(!a()){const w=new oh(m);x(w),(y=e.onCancel)==null||y.call(e,w)}},u=()=>{t=!0},f=()=>{t=!1},h=()=>pm.isFocused()&&(e.networkMode==="always"||Qc.isOnline())&&e.canRun(),p=()=>qw(e.networkMode)&&e.canRun(),v=m=>{a()||(r==null||r(),s="resolved",o(m))},x=m=>{a()||(r==null||r(),s="rejected",i(m))},b=()=>new Promise(m=>{var y;r=w=>{(a()||h())&&m(w)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;r=void 0,a()||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(a())return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(w){m=Promise.reject(w)}Promise.resolve(m).then(v).catch(w=>{var P;if(a())return;const k=e.retry??(hm()?0:3),N=e.retryDelay??$R,E=typeof N=="function"?N(n,w):N,C=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,w);if(t||!C){x(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),TR(E).then(()=>h()?void 0:b()).then(()=>{t?x(w):g()})})};return{promise:l,status:()=>s,cancel:c,continue:()=>(r==null||r(),l),cancelRetry:u,continueRetry:f,canStart:p,start:()=>(p()?g():b().then(g),l)}}var Vs,vw,Yw=(vw=class{constructor(){oe(this,Vs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vw(this.gcTime)&&te(this,Vs,Ds.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hm()?1/0:3e5))}clearGcTimeout(){D(this,Vs)!==void 0&&(Ds.clearTimeout(D(this,Vs)),te(this,Vs,void 0))}},Vs=new WeakMap,vw);function FR(e){return{onFetch:(t,n)=>{var u,f,h,p,v;const r=t.options,s=(h=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],i=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let x=!1;const b=y=>{OR(y,()=>t.signal,()=>x=!0)},g=Uw(t.options,t.fetchOptions),m=async(y,w,k)=>{if(x)return Promise.reject(t.signal.reason);if(w==null&&y.pages.length)return Promise.resolve(y);const E=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:w,direction:k?"backward":"forward",meta:t.options.meta};return b(z),z})(),C=await g(E),{maxPages:P}=t.options,I=k?jR:IR;return{pages:I(y.pages,C,P),pageParams:I(y.pageParams,w,P)}};if(s&&o.length){const y=s==="backward",w=y?Gw:ih,k={pages:o,pageParams:i};l=await m(k,w(r,k),y)}else{const y=e??o.length;do{const w=a===0?i[0]??r.initialPageParam:ih(r,l);if(a>0&&w==null)break;l=await m(l,w),a++}while(a<y)}return l};t.options.persister?t.fetchFn=()=>{var x,b;return(b=(x=t.options).persister)==null?void 0:b.call(x,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function ih(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Gw(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function LR(e,t){return t?ih(e,t)!=null:!1}function HR(e,t){return!t||!e.getPreviousPageParam?!1:Gw(e,t)!=null}var oi,Ws,ii,yn,Us,pt,da,qs,Mn,hr,ww,BR=(ww=class extends Yw{constructor(t){super();oe(this,Mn);oe(this,oi);oe(this,Ws);oe(this,ii);oe(this,yn);oe(this,Us);oe(this,pt);oe(this,da);oe(this,qs);te(this,qs,!1),te(this,da,t.defaultOptions),this.setOptions(t.options),this.observers=[],te(this,Us,t.client),te(this,yn,D(this,Us).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,te(this,Ws,$0(this.options)),this.state=t.state??D(this,Ws),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return D(this,oi)}get promise(){var t;return(t=D(this,pt))==null?void 0:t.promise}setOptions(t){if(this.options={...D(this,da),...t},t!=null&&t._type&&te(this,oi,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=$0(this.options);n.data!==void 0&&(this.setState(D0(n.data,n.dataUpdatedAt)),te(this,Ws,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,yn).remove(this)}setData(t,n){const r=sh(this.state.data,t,this.options);return pe(this,Mn,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){pe(this,Mn,hr).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=D(this,pt))==null?void 0:r.promise;return(s=D(this,pt))==null||s.cancel(t),n?n.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return D(this,Ws)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>tt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>tt(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:!Ww(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,pt))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,pt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,yn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(D(this,pt)&&(D(this,qs)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?D(this,pt).cancel({revert:!0}):D(this,pt).cancelRetry()),this.scheduleGc()),D(this,yn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,Mn,hr).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,f,h,p,v,x,b,g,m,y,w;if(this.state.fetchStatus!=="idle"&&((c=D(this,pt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,pt))return D(this,pt).continueRetry(),D(this,pt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(N=>N.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(te(this,qs,!0),r.signal)})},o=()=>{const k=Uw(this.options,n),E=(()=>{const C={client:D(this,Us),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return te(this,qs,!1),this.options.persister?this.options.persister(k,E,this):k(E)},l=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,Us),state:this.state,fetchFn:o};return s(k),k})();(u=D(this,oi)==="infinite"?FR(this.options.pages):this.options.behavior)==null||u.onFetch(l,this),te(this,ii,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&pe(this,Mn,hr).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const a=te(this,pt,Kw({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:k=>{k instanceof oh&&k.revert&&this.setState({...D(this,ii),fetchStatus:"idle"}),r.abort()},onFail:(k,N)=>{pe(this,Mn,hr).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{pe(this,Mn,hr).call(this,{type:"pause"})},onContinue:()=>{pe(this,Mn,hr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const k=await a.start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(v=(p=D(this,yn).config).onSuccess)==null||v.call(p,k,this),(b=(x=D(this,yn).config).onSettled)==null||b.call(x,k,this.state.error,this),k}catch(k){if(k instanceof oh){if(k.silent)return D(this,pt).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw pe(this,Mn,hr).call(this,{type:"error",error:k}),(m=(g=D(this,yn).config).onError)==null||m.call(g,k,this),(w=(y=D(this,yn).config).onSettled)==null||w.call(y,this.state.data,k,this),k}finally{D(this,pt)===a&&te(this,pt,void 0),this.scheduleGc()}}},oi=new WeakMap,Ws=new WeakMap,ii=new WeakMap,yn=new WeakMap,Us=new WeakMap,pt=new WeakMap,da=new WeakMap,qs=new WeakMap,Mn=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Qw(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...D0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return te(this,ii,t.manual?s:void 0),s;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),rt.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),D(this,yn).notify({query:this,type:"updated",action:t})})},ww);function Qw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function D0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Dt,Te,fa,$t,Ks,li,yr,ha,ai,ci,Ys,Gs,ns,ui,Ae,al,lh,ah,ch,uh,dh,fh,hh,ph,bw,ed=(bw=class extends go{constructor(t,n){super();oe(this,Ae);oe(this,Dt);oe(this,Te);oe(this,fa);oe(this,$t);oe(this,Ks);oe(this,li);oe(this,yr);oe(this,ha);oe(this,ai);oe(this,ci);oe(this,Ys);oe(this,Gs);oe(this,ns);oe(this,ui,new Set);this.options=n,te(this,Dt,t),te(this,yr,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,Te).addObserver(this),F0(D(this,Te),this.options)?pe(this,Ae,al).call(this):this.updateResult(),pe(this,Ae,dh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mh(D(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mh(D(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,Ae,fh).call(this),pe(this,Ae,hh).call(this),D(this,Te).removeObserver(this)}setOptions(t){const n=this.options,r=D(this,Te);if(this.options=D(this,Dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tt(this.options.enabled,D(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,Ae,ph).call(this),D(this,Te).setOptions(this.options),n._defaulted&&!xl(this.options,n)&&D(this,Dt).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Te),observer:this});const s=this.hasListeners();s&&L0(D(this,Te),r,this.options,n)&&pe(this,Ae,al).call(this),this.updateResult(),s&&(D(this,Te)!==r||tt(this.options.enabled,D(this,Te))!==tt(n.enabled,D(this,Te))||tt(this.options.staleTime,D(this,Te))!==tt(n.staleTime,D(this,Te)))&&pe(this,Ae,ah).call(this);const o=pe(this,Ae,ch).call(this);s&&(D(this,Te)!==r||tt(this.options.enabled,D(this,Te))!==tt(n.enabled,D(this,Te))||o!==D(this,ns))&&pe(this,Ae,uh).call(this,o)}getOptimisticResult(t){const n=D(this,Dt).getQueryCache().build(D(this,Dt),t),r=this.createResult(n,t);return xl(this.getCurrentResult(),r)||(te(this,$t,r),te(this,li,this.options),te(this,Ks,D(this,Te).state)),r}getCurrentResult(){return D(this,$t)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){D(this,ui).add(t)}getCurrentQuery(){return D(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=D(this,Dt).defaultQueryOptions(t),r=D(this,Dt).getQueryCache().build(D(this,Dt),n);let s=()=>{},o;const i=new Promise(l=>{o=l,s=D(this,Dt).getQueryCache().subscribe(a=>{a.type==="updated"&&a.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return o==null||o(l),l}).finally(()=>{s()}),i])}fetch(t){return pe(this,Ae,al).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,$t)))}createResult(t,n){var N;const r=D(this,Te),s=this.options,o=D(this,$t),i=D(this,Ks),l=D(this,li),a=t!==r?t.state:D(this,fa),{state:c}=t;let u={...c},f=!1,h;if(n._optimisticResults){const E=this.hasListeners(),C=!E&&F0(t,n),P=E&&L0(t,r,n,s);(C||P)&&(u={...u,...Qw(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:p,errorUpdatedAt:v,status:x}=u;h=u.data;let b=!1;if(n.placeholderData!==void 0&&h===void 0&&x==="pending"){let E;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(E=o.data,b=!0):E=typeof n.placeholderData=="function"?n.placeholderData((N=D(this,ci))==null?void 0:N.state.data,D(this,ci)):n.placeholderData,E!==void 0&&(x="success",h=sh(o==null?void 0:o.data,E,n),f=!0)}if(n.select&&h!==void 0&&!b)if(o&&h===(i==null?void 0:i.data)&&n.select===D(this,ha))h=D(this,ai);else try{te(this,ha,n.select),h=n.select(h),h=sh(o==null?void 0:o.data,h,n),te(this,ai,h),te(this,yr,null)}catch(E){te(this,yr,E)}else h===void 0&&te(this,yr,null);D(this,yr)&&(p=D(this,yr),h=D(this,ai),v=Date.now(),x="error",f=!1);const g=u.fetchStatus==="fetching",m=x==="pending",y=x==="error",w=m&&g,k=h!==void 0;return{status:x,fetchStatus:u.fetchStatus,isPending:m,isSuccess:x==="success",isError:y,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:v,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!m,isLoadingError:y&&!k,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:y&&k,isStale:mm(t,n),refetch:this.refetch,isEnabled:tt(n.enabled,t)!==!1}}updateResult(){const t=D(this,$t),n=this.createResult(D(this,Te),this.options);if(te(this,Ks,D(this,Te).state),te(this,li,this.options),D(this,Ks).data!==void 0&&te(this,ci,D(this,Te)),xl(n,t))return;te(this,$t,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!D(this,ui).size)return!0;const l=new Set(i??D(this,ui));return this.options.throwOnError&&l.add("error"),Object.keys(D(this,$t)).some(a=>{const c=a;return D(this,$t)[c]!==t[c]&&l.has(c)})})();rt.batch(()=>{s&&this.listeners.forEach(o=>{o(D(this,$t))}),D(this,Dt).getQueryCache().notify({query:D(this,Te),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,Ae,dh).call(this)}},Dt=new WeakMap,Te=new WeakMap,fa=new WeakMap,$t=new WeakMap,Ks=new WeakMap,li=new WeakMap,yr=new WeakMap,ha=new WeakMap,ai=new WeakMap,ci=new WeakMap,Ys=new WeakMap,Gs=new WeakMap,ns=new WeakMap,ui=new WeakMap,Ae=new WeakSet,al=function(t){pe(this,Ae,ph).call(this);let n=D(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ot)),n},lh=function(t){return!hm()&&tt(this.options.enabled,D(this,Te))!==!1&&Vw(t)},ah=function(){pe(this,Ae,fh).call(this);const t=tt(this.options.staleTime,D(this,Te));if(D(this,$t).isStale||!pe(this,Ae,lh).call(this,t))return;const n=Ww(D(this,$t).dataUpdatedAt,t)+1;te(this,Ys,Ds.setTimeout(()=>{D(this,$t).isStale||this.updateResult()},n))},ch=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Te)):this.options.refetchInterval)??!1},uh=function(t){pe(this,Ae,hh).call(this),te(this,ns,t),!(D(this,ns)===0||!pe(this,Ae,lh).call(this,D(this,ns)))&&te(this,Gs,Ds.setInterval(()=>{(this.options.refetchIntervalInBackground||pm.isFocused())&&pe(this,Ae,al).call(this)},D(this,ns)))},dh=function(){pe(this,Ae,ah).call(this),pe(this,Ae,uh).call(this,pe(this,Ae,ch).call(this))},fh=function(){D(this,Ys)!==void 0&&(Ds.clearTimeout(D(this,Ys)),te(this,Ys,void 0))},hh=function(){D(this,Gs)!==void 0&&(Ds.clearInterval(D(this,Gs)),te(this,Gs,void 0))},ph=function(){const t=D(this,Dt).getQueryCache().build(D(this,Dt),this.options);if(t===D(this,Te))return;const n=D(this,Te);te(this,Te,t),te(this,fa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},bw);function VR(e,t){return tt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&tt(t.retryOnMount,e)===!1)}function F0(e,t){return VR(e,t)||e.state.data!==void 0&&mh(e,t,t.refetchOnMount)}function mh(e,t,n){if(tt(t.enabled,e)!==!1&&tt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&mm(e,t)}return!1}function L0(e,t,n,r){return(e!==t||tt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&mm(e,n)}function mm(e,t){return tt(t.enabled,e)!==!1&&e.isStaleByTime(tt(t.staleTime,e))}var WR=class extends ed{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var p,v;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:o,isError:i,isRefetchError:l}=r,a=(v=(p=n.fetchMeta)==null?void 0:p.fetchMore)==null?void 0:v.direction,c=i&&a==="forward",u=s&&a==="forward",f=i&&a==="backward",h=s&&a==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:LR(t,n.data),hasPreviousPage:HR(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!c&&!f,isRefetching:o&&!u&&!h}}},pa,Zn,It,Qs,Jn,qr,Sw,UR=(Sw=class extends Yw{constructor(t){super();oe(this,Jn);oe(this,pa);oe(this,Zn);oe(this,It);oe(this,Qs);te(this,pa,t.client),this.mutationId=t.mutationId,te(this,It,t.mutationCache),te(this,Zn,[]),this.state=t.state||Xw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Zn).includes(t)||(D(this,Zn).push(t),this.clearGcTimeout(),D(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){te(this,Zn,D(this,Zn).filter(n=>n!==t)),this.scheduleGc(),D(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Zn).length||(this.state.status==="pending"?this.scheduleGc():D(this,It).remove(this))}continue(){var t;return((t=D(this,Qs))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var l,a,c,u,f,h,p,v,x,b,g,m,y,w,k,N,E,C;const n=()=>{pe(this,Jn,qr).call(this,{type:"continue"})},r={client:D(this,pa),meta:this.options.meta,mutationKey:this.options.mutationKey},s=te(this,Qs,Kw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,I)=>{pe(this,Jn,qr).call(this,{type:"failed",failureCount:P,error:I})},onPause:()=>{pe(this,Jn,qr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,It).canRun(this)})),o=this.state.status==="pending",i=!s.canStart();try{if(o)n();else{pe(this,Jn,qr).call(this,{type:"pending",variables:t,isPaused:i}),D(this,It).config.onMutate&&await D(this,It).config.onMutate(t,this,r);const I=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,r));I!==this.state.context&&pe(this,Jn,qr).call(this,{type:"pending",context:I,variables:t,isPaused:i})}const P=await s.start();return await((u=(c=D(this,It).config).onSuccess)==null?void 0:u.call(c,P,t,this.state.context,this,r)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,P,t,this.state.context,r)),await((v=(p=D(this,It).config).onSettled)==null?void 0:v.call(p,P,null,this.state.variables,this.state.context,this,r)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,P,null,t,this.state.context,r)),pe(this,Jn,qr).call(this,{type:"success",data:P}),P}catch(P){try{await((m=(g=D(this,It).config).onError)==null?void 0:m.call(g,P,t,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((w=(y=this.options).onError)==null?void 0:w.call(y,P,t,this.state.context,r))}catch(I){Promise.reject(I)}try{await((N=(k=D(this,It).config).onSettled)==null?void 0:N.call(k,void 0,P,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((C=(E=this.options).onSettled)==null?void 0:C.call(E,void 0,P,t,this.state.context,r))}catch(I){Promise.reject(I)}throw pe(this,Jn,qr).call(this,{type:"error",error:P}),P}finally{D(this,Qs)===s&&te(this,Qs,void 0),D(this,It).runNext(this)}}},pa=new WeakMap,Zn=new WeakMap,It=new WeakMap,Qs=new WeakMap,Jn=new WeakSet,qr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),rt.batch(()=>{D(this,Zn).forEach(r=>{r.onMutationUpdate(t)}),D(this,It).notify({mutation:this,type:"updated",action:t})})},Sw);function Xw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vr,An,ma,kw,qR=(kw=class extends go{constructor(t={}){super();oe(this,vr);oe(this,An);oe(this,ma);this.config=t,te(this,vr,new Set),te(this,An,new Map),te(this,ma,0)}build(t,n,r){const s=new UR({client:t,mutationCache:this,mutationId:++La(this,ma)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){D(this,vr).add(t);const n=Ba(t);if(typeof n=="string"){const r=D(this,An).get(n);r?r.push(t):D(this,An).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,vr).delete(t)){const n=Ba(t);if(typeof n=="string"){const r=D(this,An).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&D(this,An).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=Ba(t);if(typeof n=="string"){const s=(r=D(this,An).get(n))==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r,s;const n=Ba(t);return typeof n=="string"?((s=(r=D(this,An).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){rt.batch(()=>{D(this,vr).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,vr).clear(),D(this,An).clear()})}getAll(){return Array.from(D(this,vr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>M0(n,r))}findAll(t={}){return this.getAll().filter(n=>M0(t,n))}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return rt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ot))))}},vr=new WeakMap,An=new WeakMap,ma=new WeakMap,kw);function Ba(e){var t;return(t=e.options.scope)==null?void 0:t.id}var wr,rs,jt,br,rr,cl,gh,Ew,KR=(Ew=class extends go{constructor(n,r){super();oe(this,rr);oe(this,wr);oe(this,rs);oe(this,jt);oe(this,br);te(this,wr,n),this.setOptions(r),this.bindMethods(),pe(this,rr,cl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=D(this,wr).defaultMutationOptions(n),xl(this.options,r)||D(this,wr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,jt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ro(r.mutationKey)!==ro(this.options.mutationKey)?this.reset():((s=D(this,jt))==null?void 0:s.state.status)==="pending"&&D(this,jt).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&D(this,jt)&&(D(this,jt).addObserver(this),pe(this,rr,cl).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=D(this,jt))==null||n.removeObserver(this)}onMutationUpdate(n){pe(this,rr,cl).call(this),pe(this,rr,gh).call(this,n)}getCurrentResult(){return D(this,rs)}reset(){var n;(n=D(this,jt))==null||n.removeObserver(this),te(this,jt,void 0),pe(this,rr,cl).call(this),pe(this,rr,gh).call(this)}mutate(n,r){var s;return te(this,br,r),(s=D(this,jt))==null||s.removeObserver(this),te(this,jt,D(this,wr).getMutationCache().build(D(this,wr),this.options)),D(this,jt).addObserver(this),D(this,jt).execute(n)}},wr=new WeakMap,rs=new WeakMap,jt=new WeakMap,br=new WeakMap,rr=new WeakSet,cl=function(){var r;const n=((r=D(this,jt))==null?void 0:r.state)??Xw();te(this,rs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},gh=function(n){rt.batch(()=>{var r,s,o,i,l,a,c,u;if(D(this,br)&&this.hasListeners()){const f=D(this,rs).variables,h=D(this,rs).context,p={client:D(this,wr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=D(this,br)).onSuccess)==null||s.call(r,n.data,f,h,p)}catch(v){Promise.reject(v)}try{(i=(o=D(this,br)).onSettled)==null||i.call(o,n.data,null,f,h,p)}catch(v){Promise.reject(v)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=D(this,br)).onError)==null||a.call(l,n.error,f,h,p)}catch(v){Promise.reject(v)}try{(u=(c=D(this,br)).onSettled)==null||u.call(c,void 0,n.error,f,h,p)}catch(v){Promise.reject(v)}}}this.listeners.forEach(f=>{f(D(this,rs))})})},Ew);function H0(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}var di,Ft,fi,Xs,sn,Zs,ga,xa,ya,va,xt,xh,yh,Zw,vh,wh,bh,Cw,YR=(Cw=class extends go{constructor(t,n,r){super();oe(this,xt);oe(this,di);oe(this,Ft);oe(this,fi);oe(this,Xs);oe(this,sn);oe(this,Zs);oe(this,ga);oe(this,xa);oe(this,ya);oe(this,va,[]);te(this,di,t),te(this,Xs,r),te(this,fi,[]),te(this,sn,[]),te(this,Ft,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&D(this,sn).forEach(t=>{t.subscribe(n=>{pe(this,xt,wh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,D(this,sn).forEach(t=>{t.destroy()})}setQueries(t,n){te(this,fi,t),te(this,Xs,n),rt.batch(()=>{const r=D(this,sn),s=pe(this,xt,vh).call(this,D(this,fi));s.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const o=s.map(f=>f.observer),i=o.map(f=>f.getCurrentResult()),l=r.length!==o.length,a=o.some((f,h)=>f!==r[h]),c=l||a,u=c?!0:i.some((f,h)=>{const p=D(this,Ft)[h];return!p||!xl(f,p)});!c&&!u||(c&&(te(this,va,s),te(this,sn,o)),te(this,Ft,i),this.hasListeners()&&(c&&(H0(r,o).forEach(f=>{f.destroy()}),H0(o,r).forEach(f=>{f.subscribe(h=>{pe(this,xt,wh).call(this,f,h)})})),pe(this,xt,bh).call(this)))})}getCurrentResult(){return D(this,Ft)}getQueries(){return D(this,sn).map(t=>t.getCurrentQuery())}getObservers(){return D(this,sn)}getOptimisticResult(t,n){const r=pe(this,xt,vh).call(this,t),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>pe(this,xt,yh).call(this,i??s,n,o),()=>pe(this,xt,xh).call(this,s,r)]}},di=new WeakMap,Ft=new WeakMap,fi=new WeakMap,Xs=new WeakMap,sn=new WeakMap,Zs=new WeakMap,ga=new WeakMap,xa=new WeakMap,ya=new WeakMap,va=new WeakMap,xt=new WeakSet,xh=function(t,n){const r=new Set;return n.map((s,o)=>{const i=t[o];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,l=>{r.has(l)||(r.add(l),n.forEach(a=>{a.observer.trackProp(l)}))})})},yh=function(t,n,r){if(n){const s=D(this,ya),o=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,l)=>i!==s[l]));return(D(this,Ft)!==D(this,xa)||o||n!==D(this,ga))&&(te(this,ga,n),te(this,xa,D(this,Ft)),r!==void 0&&te(this,ya,r),te(this,Zs,um(D(this,Zs),n(t)))),D(this,Zs)}return t},Zw=function(){var t;return!((t=D(this,Xs))!=null&&t.combine)||D(this,sn).some((n,r)=>{var s;return n.options.suspense&&((s=D(this,Ft)[r])==null?void 0:s.data)===void 0})},vh=function(t){const n=new Map;D(this,sn).forEach(s=>{const o=s.options.queryHash;if(!o)return;const i=n.get(o);i?i.push(s):n.set(o,[s])});const r=[];return t.forEach(s=>{var l;const o=D(this,di).defaultQueryOptions(s),i=((l=n.get(o.queryHash))==null?void 0:l.shift())??new ed(D(this,di),o);r.push({defaultedQueryOptions:o,observer:i})}),r},wh=function(t,n){const r=D(this,sn).indexOf(t);r!==-1&&(te(this,Ft,D(this,Ft).slice()),D(this,Ft)[r]=n,pe(this,xt,bh).call(this))},bh=function(){var t;if(this.hasListeners()){const n=pe(this,xt,Zw).call(this),r=D(this,Zs),s=n?r:pe(this,xt,yh).call(this,pe(this,xt,xh).call(this,D(this,Ft),D(this,va)),(t=D(this,Xs))==null?void 0:t.combine);(n||r!==s)&&rt.batch(()=>{this.listeners.forEach(o=>{o(D(this,Ft))})})}},Cw),er,Nw,GR=(Nw=class extends go{constructor(t={}){super();oe(this,er);this.config=t,te(this,er,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??cm(s,n);let i=this.get(o);return i||(i=new BR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){D(this,er).has(t.queryHash)||(D(this,er).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,er).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,er).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,er).get(t)}getAll(){return[...D(this,er).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>_0(t,r)):n}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){rt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},er=new WeakMap,Nw),Ge,ss,os,hi,pi,is,mi,gi,Rw,K6=(Rw=class{constructor(e={}){oe(this,Ge);oe(this,ss);oe(this,os);oe(this,hi);oe(this,pi);oe(this,is);oe(this,mi);oe(this,gi);te(this,Ge,e.queryCache||new GR),te(this,ss,e.mutationCache||new qR),te(this,os,e.defaultOptions||{}),te(this,hi,new Map),te(this,pi,new Map),te(this,is,0)}mount(){La(this,is)._++,D(this,is)===1&&(te(this,mi,pm.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Ge).onFocus())})),te(this,gi,Qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Ge).onOnline())})))}unmount(){var e,t;La(this,is)._--,D(this,is)===0&&((e=D(this,mi))==null||e.call(this),te(this,mi,void 0),(t=D(this,gi))==null||t.call(this),te(this,gi,void 0))}isFetching(e){return D(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,ss).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Ge).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,Ge).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(tt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return D(this,Ge).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),s=(i=D(this,Ge).get(r.queryHash))==null?void 0:i.state.data,o=NR(t,s);if(o!==void 0)return D(this,Ge).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return rt.batch(()=>D(this,Ge).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Ge).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,Ge);rt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,Ge);return rt.batch(()=>{const r=n.findAll(e),s=new Set(r);return r.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>s.has(o)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=rt.batch(()=>D(this,Ge).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ot).catch(Ot)}invalidateQueries(e,t={}){return rt.batch(()=>(D(this,Ge).findAll(e).forEach(n=>{n.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=rt.batch(()=>D(this,Ge).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Ot)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ot)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Ge).build(this,t),r=n.isStaleByTime(tt(t.staleTime,n))?await n.fetch(t):n.state.data,s=t.select;return s?s(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Ge).build(this,t);return n.isStaleByTime(tt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ot).catch(Ot)}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(Ot).catch(Ot)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Qc.isOnline()?D(this,ss).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,Ge)}getMutationCache(){return D(this,ss)}getDefaultOptions(){return D(this,os)}setDefaultOptions(e){te(this,os,e)}setQueryDefaults(e,t){D(this,hi).set(ro(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,hi).values()],n={};return t.forEach(r=>{xi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){D(this,pi).set(ro(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,pi).values()],n={};return t.forEach(r=>{xi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,os).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cm(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===dm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,os).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,Ge).clear(),D(this,ss).clear()}},Ge=new WeakMap,ss=new WeakMap,os=new WeakMap,hi=new WeakMap,pi=new WeakMap,is=new WeakMap,mi=new WeakMap,gi=new WeakMap,Rw);const Jw=S.createContext(!1),eb=()=>S.useContext(Jw);Jw.Provider;function QR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const XR=S.createContext(QR()),tb=()=>S.useContext(XR),nb=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?fm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},rb=e=>{S.useEffect(()=>{e.clearReset()},[e])},sb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||fm(n,[e.error,r])),ob=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Sh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ib=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gm({queries:e,...t},n){const r=mo(),s=eb(),o=tb(),i=t.subscribed!==!1,l=S.useMemo(()=>e.map(x=>{const b=r.defaultQueryOptions(x);return b._optimisticResults=s?"isRestoring":i?"optimistic":void 0,b}),[e,r,s,i]);l.forEach(x=>{ob(x);const b=r.getQueryCache().get(x.queryHash);nb(x,o,b)}),rb(o);const[a]=S.useState(()=>new YR(r,l,t)),[c,u,f]=a.getOptimisticResult(l,t.combine),h=!s&&i;S.useSyncExternalStore(S.useCallback(x=>h?a.subscribe(rt.batchCalls(x)):Ot,[a,h]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),S.useEffect(()=>{a.setQueries(l,t)},[l,t,a]);const p=c.some((x,b)=>Sh(l[b],x))?c.flatMap((x,b)=>{const g=l[b];if(g&&Sh(g,x)){const m=new ed(r,g);return ib(g,m,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const v=c.find((x,b)=>{const g=l[b];return g&&sb({result:x,errorResetBoundary:o,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(v)throw v.error;return u(f())}function lb(e,t,n){const r=eb(),s=tb(),o=mo(),i=o.defaultQueryOptions(e),l=o.getQueryCache().get(i.queryHash),a=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":a?"optimistic":void 0,ob(i),nb(i,s,l),rb(s);const[c]=S.useState(()=>new t(o,i)),u=c.getOptimisticResult(i),f=!r&&a;if(S.useSyncExternalStore(S.useCallback(h=>{const p=f?c.subscribe(rt.batchCalls(h)):Ot;return c.updateResult(),p},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setOptions(i)},[i,c]),Sh(i,u))throw ib(i,c,s);if(sb({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw u.error;return i.notifyOnChangeProps?u:c.trackResult(u)}function Xt(e,t){return lb(e,ed)}function mr(e,t){const n=mo(),[r]=S.useState(()=>new KR(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const s=S.useSyncExternalStore(S.useCallback(i=>r.subscribe(rt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=S.useCallback((...i)=>{r.mutate(i[0],i[1]).catch(Ot)},[r]);if(s.error&&fm(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function ZR(e,t){return lb(e,WR)}var ab={exports:{}},pn={},cb={exports:{}},ub={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(T,M){var _=T.length;T.push(M);e:for(;0<_;){var U=_-1>>>1,L=T[U];if(0<s(L,M))T[U]=M,T[_]=L,_=U;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var M=T[0],_=T.pop();if(_!==M){T[0]=_;e:for(var U=0,L=T.length,K=L>>>1;U<K;){var W=2*(U+1)-1,q=T[W],H=W+1,G=T[H];if(0>s(q,_))H<L&&0>s(G,q)?(T[U]=G,T[H]=_,U=H):(T[U]=q,T[W]=_,U=W);else if(H<L&&0>s(G,_))T[U]=G,T[H]=_,U=H;else break e}}return M}function s(T,M){var _=T.sortIndex-M.sortIndex;return _!==0?_:T.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],c=[],u=1,f=null,h=3,p=!1,v=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(T){for(var M=n(c);M!==null;){if(M.callback===null)r(c);else if(M.startTime<=T)r(c),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(c)}}function w(T){if(x=!1,y(T),!v)if(n(a)!==null)v=!0,O(k);else{var M=n(c);M!==null&&F(w,M.startTime-T)}}function k(T,M){v=!1,x&&(x=!1,g(C),C=-1),p=!0;var _=h;try{for(y(M),f=n(a);f!==null&&(!(f.expirationTime>M)||T&&!z());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var L=U(f.expirationTime<=M);M=e.unstable_now(),typeof L=="function"?f.callback=L:f===n(a)&&r(a),y(M)}else r(a);f=n(a)}if(f!==null)var K=!0;else{var W=n(c);W!==null&&F(w,W.startTime-M),K=!1}return K}finally{f=null,h=_,p=!1}}var N=!1,E=null,C=-1,P=5,I=-1;function z(){return!(e.unstable_now()-I<P)}function $(){if(E!==null){var T=e.unstable_now();I=T;var M=!0;try{M=E(!0,T)}finally{M?A():(N=!1,E=null)}}else N=!1}var A;if(typeof m=="function")A=function(){m($)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,j=R.port2;R.port1.onmessage=$,A=function(){j.postMessage(null)}}else A=function(){b($,0)};function O(T){E=T,N||(N=!0,A())}function F(T,M){C=b(function(){T(e.unstable_now())},M)}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(T){T.callback=null},e.unstable_continueExecution=function(){v||p||(v=!0,O(k))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var M=3;break;default:M=h}var _=h;h=M;try{return T()}finally{h=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,M){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var _=h;h=T;try{return M()}finally{h=_}},e.unstable_scheduleCallback=function(T,M,_){var U=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?U+_:U):_=U,T){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=_+L,T={id:u++,callback:M,priorityLevel:T,startTime:_,expirationTime:L,sortIndex:-1},_>U?(T.sortIndex=_,t(c,T),n(a)===null&&T===n(c)&&(x?(g(C),C=-1):x=!0,F(w,_-U))):(T.sortIndex=L,t(a,T),v||p||(v=!0,O(k))),T},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(T){var M=h;return function(){var _=h;h=M;try{return T.apply(this,arguments)}finally{h=_}}}})(ub);cb.exports=ub;var JR=cb.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var eT=S,un=JR;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var db=new Set,Ol={};function xo(e,t){yi(e,t),yi(e+"Capture",t)}function yi(e,t){for(Ol[e]=t,e=0;e<t.length;e++)db.add(t[e])}var Ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kh=Object.prototype.hasOwnProperty,tT=/^[: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]*$/,B0={},V0={};function nT(e){return kh.call(V0,e)?!0:kh.call(B0,e)?!1:tT.test(e)?V0[e]=!0:(B0[e]=!0,!1)}function rT(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sT(e,t,n,r){if(t===null||typeof t>"u"||rT(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Wt(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ct[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ct[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ct[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ct[e]=new Wt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ct[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ct[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ct[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ct[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ct[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var xm=/[\-:]([a-z])/g;function ym(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(xm,ym);Ct[t]=new Wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xm,ym);Ct[t]=new Wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xm,ym);Ct[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ct[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ct.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ct[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function vm(e,t,n,r){var s=Ct.hasOwnProperty(t)?Ct[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(sT(t,n,s,r)&&(n=null),r||s===null?nT(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Dr=eT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Va=Symbol.for("react.element"),jo=Symbol.for("react.portal"),Oo=Symbol.for("react.fragment"),wm=Symbol.for("react.strict_mode"),Eh=Symbol.for("react.profiler"),fb=Symbol.for("react.provider"),hb=Symbol.for("react.context"),bm=Symbol.for("react.forward_ref"),Ch=Symbol.for("react.suspense"),Nh=Symbol.for("react.suspense_list"),Sm=Symbol.for("react.memo"),Kr=Symbol.for("react.lazy"),pb=Symbol.for("react.offscreen"),W0=Symbol.iterator;function Ki(e){return e===null||typeof e!="object"?null:(e=W0&&e[W0]||e["@@iterator"],typeof e=="function"?e:null)}var Je=Object.assign,nf;function ul(e){if(nf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);nf=t&&t[1]||""}return`
34
+ `+nf+e}var rf=!1;function sf(e,t){if(!e||rf)return"";rf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
+ `),o=r.stack.split(`
36
+ `),i=s.length-1,l=o.length-1;1<=i&&0<=l&&s[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==o[l]){var a=`
37
+ `+s[i].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{rf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ul(e):""}function oT(e){switch(e.tag){case 5:return ul(e.type);case 16:return ul("Lazy");case 13:return ul("Suspense");case 19:return ul("SuspenseList");case 0:case 2:case 15:return e=sf(e.type,!1),e;case 11:return e=sf(e.type.render,!1),e;case 1:return e=sf(e.type,!0),e;default:return""}}function Rh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Oo:return"Fragment";case jo:return"Portal";case Eh:return"Profiler";case wm:return"StrictMode";case Ch:return"Suspense";case Nh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hb:return(e.displayName||"Context")+".Consumer";case fb:return(e._context.displayName||"Context")+".Provider";case bm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sm:return t=e.displayName||null,t!==null?t:Rh(e.type)||"Memo";case Kr:t=e._payload,e=e._init;try{return Rh(e(t))}catch{}}return null}function iT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Rh(t);case 8:return t===wm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ws(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lT(e){var t=mb(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wa(e){e._valueTracker||(e._valueTracker=lT(e))}function gb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mb(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Th(e,t){var n=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function U0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ws(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function xb(e,t){t=t.checked,t!=null&&vm(e,"checked",t,!1)}function Ph(e,t){xb(e,t);var n=ws(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ih(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ih(e,t.type,ws(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function q0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ih(e,t,n){(t!=="number"||Xc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var dl=Array.isArray;function qo(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ws(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function jh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return Je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function K0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(dl(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ws(n)}}function yb(e,t){var n=ws(t.value),r=ws(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Y0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vb(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Oh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ua,wb=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ua=Ua||document.createElement("div"),Ua.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ua.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _l(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aT=["Webkit","ms","Moz","O"];Object.keys(yl).forEach(function(e){aT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yl[t]=yl[e]})});function bb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yl.hasOwnProperty(e)&&yl[e]?(""+t).trim():t+"px"}function Sb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=bb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var cT=Je({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _h(e,t){if(t){if(cT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function Mh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ah=null;function km(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zh=null,Ko=null,Yo=null;function G0(e){if(e=ka(e)){if(typeof zh!="function")throw Error(J(280));var t=e.stateNode;t&&(t=od(t),zh(e.stateNode,e.type,t))}}function kb(e){Ko?Yo?Yo.push(e):Yo=[e]:Ko=e}function Eb(){if(Ko){var e=Ko,t=Yo;if(Yo=Ko=null,G0(e),t)for(e=0;e<t.length;e++)G0(t[e])}}function Cb(e,t){return e(t)}function Nb(){}var of=!1;function Rb(e,t,n){if(of)return e(t,n);of=!0;try{return Cb(e,t,n)}finally{of=!1,(Ko!==null||Yo!==null)&&(Nb(),Eb())}}function Ml(e,t){var n=e.stateNode;if(n===null)return null;var r=od(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(J(231,t,typeof n));return n}var Dh=!1;if(Ir)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){Dh=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{Dh=!1}function uT(e,t,n,r,s,o,i,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var vl=!1,Zc=null,Jc=!1,$h=null,dT={onError:function(e){vl=!0,Zc=e}};function fT(e,t,n,r,s,o,i,l,a){vl=!1,Zc=null,uT.apply(dT,arguments)}function hT(e,t,n,r,s,o,i,l,a){if(fT.apply(this,arguments),vl){if(vl){var c=Zc;vl=!1,Zc=null}else throw Error(J(198));Jc||(Jc=!0,$h=c)}}function yo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Tb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Q0(e){if(yo(e)!==e)throw Error(J(188))}function pT(e){var t=e.alternate;if(!t){if(t=yo(e),t===null)throw Error(J(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Q0(s),e;if(o===r)return Q0(s),t;o=o.sibling}throw Error(J(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i)throw Error(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function Pb(e){return e=pT(e),e!==null?Ib(e):null}function Ib(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ib(e);if(t!==null)return t;e=e.sibling}return null}var jb=un.unstable_scheduleCallback,X0=un.unstable_cancelCallback,mT=un.unstable_shouldYield,gT=un.unstable_requestPaint,ct=un.unstable_now,xT=un.unstable_getCurrentPriorityLevel,Em=un.unstable_ImmediatePriority,Ob=un.unstable_UserBlockingPriority,eu=un.unstable_NormalPriority,yT=un.unstable_LowPriority,_b=un.unstable_IdlePriority,td=null,sr=null;function vT(e){if(sr&&typeof sr.onCommitFiberRoot=="function")try{sr.onCommitFiberRoot(td,e,void 0,(e.current.flags&128)===128)}catch{}}var Hn=Math.clz32?Math.clz32:ST,wT=Math.log,bT=Math.LN2;function ST(e){return e>>>=0,e===0?32:31-(wT(e)/bT|0)|0}var qa=64,Ka=4194304;function fl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=fl(l):(o&=i,o!==0&&(r=fl(o)))}else i=n&~s,i!==0?r=fl(i):o!==0&&(r=fl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Hn(t),s=1<<n,r|=e[n],t&=~s;return r}function kT(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ET(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Hn(o),l=1<<i,a=s[i];a===-1?(!(l&n)||l&r)&&(s[i]=kT(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}function Fh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Mb(){var e=qa;return qa<<=1,!(qa&4194240)&&(qa=64),e}function lf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ba(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Hn(t),e[t]=n}function CT(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Hn(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function Cm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Hn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Le=0;function Ab(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zb,Nm,Db,$b,Fb,Lh=!1,Ya=[],us=null,ds=null,fs=null,Al=new Map,zl=new Map,Qr=[],NT="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 submit".split(" ");function Z0(e,t){switch(e){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":ds=null;break;case"mouseover":case"mouseout":fs=null;break;case"pointerover":case"pointerout":Al.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zl.delete(t.pointerId)}}function Gi(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=ka(t),t!==null&&Nm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function RT(e,t,n,r,s){switch(t){case"focusin":return us=Gi(us,e,t,n,r,s),!0;case"dragenter":return ds=Gi(ds,e,t,n,r,s),!0;case"mouseover":return fs=Gi(fs,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Al.set(o,Gi(Al.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,zl.set(o,Gi(zl.get(o)||null,e,t,n,r,s)),!0}return!1}function Lb(e){var t=$s(e.target);if(t!==null){var n=yo(t);if(n!==null){if(t=n.tag,t===13){if(t=Tb(n),t!==null){e.blockedOn=t,Fb(e.priority,function(){Db(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ah=r,n.target.dispatchEvent(r),Ah=null}else return t=ka(n),t!==null&&Nm(t),e.blockedOn=n,!1;t.shift()}return!0}function J0(e,t,n){jc(e)&&n.delete(t)}function TT(){Lh=!1,us!==null&&jc(us)&&(us=null),ds!==null&&jc(ds)&&(ds=null),fs!==null&&jc(fs)&&(fs=null),Al.forEach(J0),zl.forEach(J0)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,Lh||(Lh=!0,un.unstable_scheduleCallback(un.unstable_NormalPriority,TT)))}function Dl(e){function t(s){return Qi(s,e)}if(0<Ya.length){Qi(Ya[0],e);for(var n=1;n<Ya.length;n++){var r=Ya[n];r.blockedOn===e&&(r.blockedOn=null)}}for(us!==null&&Qi(us,e),ds!==null&&Qi(ds,e),fs!==null&&Qi(fs,e),Al.forEach(t),zl.forEach(t),n=0;n<Qr.length;n++)r=Qr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Qr.length&&(n=Qr[0],n.blockedOn===null);)Lb(n),n.blockedOn===null&&Qr.shift()}var Go=Dr.ReactCurrentBatchConfig,nu=!0;function PT(e,t,n,r){var s=Le,o=Go.transition;Go.transition=null;try{Le=1,Rm(e,t,n,r)}finally{Le=s,Go.transition=o}}function IT(e,t,n,r){var s=Le,o=Go.transition;Go.transition=null;try{Le=4,Rm(e,t,n,r)}finally{Le=s,Go.transition=o}}function Rm(e,t,n,r){if(nu){var s=Hh(e,t,n,r);if(s===null)xf(e,t,r,ru,n),Z0(e,r);else if(RT(s,e,t,n,r))r.stopPropagation();else if(Z0(e,r),t&4&&-1<NT.indexOf(e)){for(;s!==null;){var o=ka(s);if(o!==null&&zb(o),o=Hh(e,t,n,r),o===null&&xf(e,t,r,ru,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else xf(e,t,r,null,n)}}var ru=null;function Hh(e,t,n,r){if(ru=null,e=km(r),e=$s(e),e!==null)if(t=yo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Tb(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ru=e,null}function Hb(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(xT()){case Em:return 1;case Ob:return 4;case eu:case yT:return 16;case _b:return 536870912;default:return 16}default:return 16}}var ls=null,Tm=null,Oc=null;function Bb(){if(Oc)return Oc;var e,t=Tm,n=t.length,r,s="value"in ls?ls.value:ls.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[o-r];r++);return Oc=s.slice(e,1<r?1-r:void 0)}function _c(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ga(){return!0}function ex(){return!1}function mn(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ga:ex,this.isPropagationStopped=ex,this}return Je(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ga)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ga)},persist:function(){},isPersistent:Ga}),t}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pm=mn(Fi),Sa=Je({},Fi,{view:0,detail:0}),jT=mn(Sa),af,cf,Xi,nd=Je({},Sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Im,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Xi&&(Xi&&e.type==="mousemove"?(af=e.screenX-Xi.screenX,cf=e.screenY-Xi.screenY):cf=af=0,Xi=e),af)},movementY:function(e){return"movementY"in e?e.movementY:cf}}),tx=mn(nd),OT=Je({},nd,{dataTransfer:0}),_T=mn(OT),MT=Je({},Sa,{relatedTarget:0}),uf=mn(MT),AT=Je({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),zT=mn(AT),DT=Je({},Fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$T=mn(DT),FT=Je({},Fi,{data:0}),nx=mn(FT),LT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HT={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"},BT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BT[e])?!!t[e]:!1}function Im(){return VT}var WT=Je({},Sa,{key:function(e){if(e.key){var t=LT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_c(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?HT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Im,charCode:function(e){return e.type==="keypress"?_c(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_c(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),UT=mn(WT),qT=Je({},nd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rx=mn(qT),KT=Je({},Sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Im}),YT=mn(KT),GT=Je({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),QT=mn(GT),XT=Je({},nd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ZT=mn(XT),JT=[9,13,27,32],jm=Ir&&"CompositionEvent"in window,wl=null;Ir&&"documentMode"in document&&(wl=document.documentMode);var eP=Ir&&"TextEvent"in window&&!wl,Vb=Ir&&(!jm||wl&&8<wl&&11>=wl),sx=" ",ox=!1;function Wb(e,t){switch(e){case"keyup":return JT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ub(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _o=!1;function tP(e,t){switch(e){case"compositionend":return Ub(t);case"keypress":return t.which!==32?null:(ox=!0,sx);case"textInput":return e=t.data,e===sx&&ox?null:e;default:return null}}function nP(e,t){if(_o)return e==="compositionend"||!jm&&Wb(e,t)?(e=Bb(),Oc=Tm=ls=null,_o=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Vb&&t.locale!=="ko"?null:t.data;default:return null}}var rP={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 ix(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rP[e.type]:t==="textarea"}function qb(e,t,n,r){kb(r),t=su(t,"onChange"),0<t.length&&(n=new Pm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var bl=null,$l=null;function sP(e){r1(e,0)}function rd(e){var t=zo(e);if(gb(t))return e}function oP(e,t){if(e==="change")return t}var Kb=!1;if(Ir){var df;if(Ir){var ff="oninput"in document;if(!ff){var lx=document.createElement("div");lx.setAttribute("oninput","return;"),ff=typeof lx.oninput=="function"}df=ff}else df=!1;Kb=df&&(!document.documentMode||9<document.documentMode)}function ax(){bl&&(bl.detachEvent("onpropertychange",Yb),$l=bl=null)}function Yb(e){if(e.propertyName==="value"&&rd($l)){var t=[];qb(t,$l,e,km(e)),Rb(sP,t)}}function iP(e,t,n){e==="focusin"?(ax(),bl=t,$l=n,bl.attachEvent("onpropertychange",Yb)):e==="focusout"&&ax()}function lP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rd($l)}function aP(e,t){if(e==="click")return rd(t)}function cP(e,t){if(e==="input"||e==="change")return rd(t)}function uP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vn=typeof Object.is=="function"?Object.is:uP;function Fl(e,t){if(Vn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!kh.call(t,s)||!Vn(e[s],t[s]))return!1}return!0}function cx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ux(e,t){var n=cx(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cx(n)}}function Gb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qb(){for(var e=window,t=Xc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xc(e.document)}return t}function Om(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function dP(e){var t=Qb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gb(n.ownerDocument.documentElement,n)){if(r!==null&&Om(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=ux(n,o);var i=ux(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fP=Ir&&"documentMode"in document&&11>=document.documentMode,Mo=null,Bh=null,Sl=null,Vh=!1;function dx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vh||Mo==null||Mo!==Xc(r)||(r=Mo,"selectionStart"in r&&Om(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sl&&Fl(Sl,r)||(Sl=r,r=su(Bh,"onSelect"),0<r.length&&(t=new Pm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mo)))}function Qa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ao={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionend:Qa("Transition","TransitionEnd")},hf={},Xb={};Ir&&(Xb=document.createElement("div").style,"AnimationEvent"in window||(delete Ao.animationend.animation,delete Ao.animationiteration.animation,delete Ao.animationstart.animation),"TransitionEvent"in window||delete Ao.transitionend.transition);function sd(e){if(hf[e])return hf[e];if(!Ao[e])return e;var t=Ao[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Xb)return hf[e]=t[n];return e}var Zb=sd("animationend"),Jb=sd("animationiteration"),e1=sd("animationstart"),t1=sd("transitionend"),n1=new Map,fx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Rs(e,t){n1.set(e,t),xo(t,[e])}for(var pf=0;pf<fx.length;pf++){var mf=fx[pf],hP=mf.toLowerCase(),pP=mf[0].toUpperCase()+mf.slice(1);Rs(hP,"on"+pP)}Rs(Zb,"onAnimationEnd");Rs(Jb,"onAnimationIteration");Rs(e1,"onAnimationStart");Rs("dblclick","onDoubleClick");Rs("focusin","onFocus");Rs("focusout","onBlur");Rs(t1,"onTransitionEnd");yi("onMouseEnter",["mouseout","mouseover"]);yi("onMouseLeave",["mouseout","mouseover"]);yi("onPointerEnter",["pointerout","pointerover"]);yi("onPointerLeave",["pointerout","pointerover"]);xo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xo("onBeforeInput",["compositionend","keypress","textInput","paste"]);xo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="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(" "),mP=new Set("cancel close invalid load scroll toggle".split(" ").concat(hl));function hx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,hT(r,t,void 0,e),e.currentTarget=null}function r1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==o&&s.isPropagationStopped())break e;hx(s,l,c),o=a}else for(i=0;i<r.length;i++){if(l=r[i],a=l.instance,c=l.currentTarget,l=l.listener,a!==o&&s.isPropagationStopped())break e;hx(s,l,c),o=a}}}if(Jc)throw e=$h,Jc=!1,$h=null,e}function Ue(e,t){var n=t[Yh];n===void 0&&(n=t[Yh]=new Set);var r=e+"__bubble";n.has(r)||(s1(t,e,2,!1),n.add(r))}function gf(e,t,n){var r=0;t&&(r|=4),s1(n,e,r,t)}var Xa="_reactListening"+Math.random().toString(36).slice(2);function Ll(e){if(!e[Xa]){e[Xa]=!0,db.forEach(function(n){n!=="selectionchange"&&(mP.has(n)||gf(n,!1,e),gf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xa]||(t[Xa]=!0,gf("selectionchange",!1,t))}}function s1(e,t,n,r){switch(Hb(t)){case 1:var s=PT;break;case 4:s=IT;break;default:s=Rm}n=s.bind(null,t,n,e),s=void 0,!Dh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function xf(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var a=i.tag;if((a===3||a===4)&&(a=i.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;i=i.return}for(;l!==null;){if(i=$s(l),i===null)return;if(a=i.tag,a===5||a===6){r=o=i;continue e}l=l.parentNode}}r=r.return}Rb(function(){var c=o,u=km(n),f=[];e:{var h=n1.get(e);if(h!==void 0){var p=Pm,v=e;switch(e){case"keypress":if(_c(n)===0)break e;case"keydown":case"keyup":p=UT;break;case"focusin":v="focus",p=uf;break;case"focusout":v="blur",p=uf;break;case"beforeblur":case"afterblur":p=uf;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=tx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=_T;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=YT;break;case Zb:case Jb:case e1:p=zT;break;case t1:p=QT;break;case"scroll":p=jT;break;case"wheel":p=ZT;break;case"copy":case"cut":case"paste":p=$T;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=rx}var x=(t&4)!==0,b=!x&&e==="scroll",g=x?h!==null?h+"Capture":null:h;x=[];for(var m=c,y;m!==null;){y=m;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,g!==null&&(w=Ml(m,g),w!=null&&x.push(Hl(m,w,y)))),b)break;m=m.return}0<x.length&&(h=new p(h,v,null,n,u),f.push({event:h,listeners:x}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Ah&&(v=n.relatedTarget||n.fromElement)&&($s(v)||v[jr]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(v=n.relatedTarget||n.toElement,p=c,v=v?$s(v):null,v!==null&&(b=yo(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=c),p!==v)){if(x=tx,w="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(x=rx,w="onPointerLeave",g="onPointerEnter",m="pointer"),b=p==null?h:zo(p),y=v==null?h:zo(v),h=new x(w,m+"leave",p,n,u),h.target=b,h.relatedTarget=y,w=null,$s(u)===c&&(x=new x(g,m+"enter",v,n,u),x.target=y,x.relatedTarget=b,w=x),b=w,p&&v)t:{for(x=p,g=v,m=0,y=x;y;y=Po(y))m++;for(y=0,w=g;w;w=Po(w))y++;for(;0<m-y;)x=Po(x),m--;for(;0<y-m;)g=Po(g),y--;for(;m--;){if(x===g||g!==null&&x===g.alternate)break t;x=Po(x),g=Po(g)}x=null}else x=null;p!==null&&px(f,h,p,x,!1),v!==null&&b!==null&&px(f,b,v,x,!0)}}e:{if(h=c?zo(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var k=oP;else if(ix(h))if(Kb)k=cP;else{k=lP;var N=iP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=aP);if(k&&(k=k(e,c))){qb(f,k,n,u);break e}N&&N(e,h,c),e==="focusout"&&(N=h._wrapperState)&&N.controlled&&h.type==="number"&&Ih(h,"number",h.value)}switch(N=c?zo(c):window,e){case"focusin":(ix(N)||N.contentEditable==="true")&&(Mo=N,Bh=c,Sl=null);break;case"focusout":Sl=Bh=Mo=null;break;case"mousedown":Vh=!0;break;case"contextmenu":case"mouseup":case"dragend":Vh=!1,dx(f,n,u);break;case"selectionchange":if(fP)break;case"keydown":case"keyup":dx(f,n,u)}var E;if(jm)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else _o?Wb(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Vb&&n.locale!=="ko"&&(_o||C!=="onCompositionStart"?C==="onCompositionEnd"&&_o&&(E=Bb()):(ls=u,Tm="value"in ls?ls.value:ls.textContent,_o=!0)),N=su(c,C),0<N.length&&(C=new nx(C,e,null,n,u),f.push({event:C,listeners:N}),E?C.data=E:(E=Ub(n),E!==null&&(C.data=E)))),(E=eP?tP(e,n):nP(e,n))&&(c=su(c,"onBeforeInput"),0<c.length&&(u=new nx("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=E))}r1(f,t)})}function Hl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function su(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Ml(e,n),o!=null&&r.unshift(Hl(e,o,s)),o=Ml(e,t),o!=null&&r.push(Hl(e,o,s))),e=e.return}return r}function Po(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function px(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,a=l.alternate,c=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&c!==null&&(l=c,s?(a=Ml(n,o),a!=null&&i.unshift(Hl(n,a,l))):s||(a=Ml(n,o),a!=null&&i.push(Hl(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var gP=/\r\n?/g,xP=/\u0000|\uFFFD/g;function mx(e){return(typeof e=="string"?e:""+e).replace(gP,`
38
+ `).replace(xP,"")}function Za(e,t,n){if(t=mx(t),mx(e)!==t&&n)throw Error(J(425))}function ou(){}var Wh=null,Uh=null;function qh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kh=typeof setTimeout=="function"?setTimeout:void 0,yP=typeof clearTimeout=="function"?clearTimeout:void 0,gx=typeof Promise=="function"?Promise:void 0,vP=typeof queueMicrotask=="function"?queueMicrotask:typeof gx<"u"?function(e){return gx.resolve(null).then(e).catch(wP)}:Kh;function wP(e){setTimeout(function(){throw e})}function yf(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Dl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Dl(t)}function hs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Li=Math.random().toString(36).slice(2),nr="__reactFiber$"+Li,Bl="__reactProps$"+Li,jr="__reactContainer$"+Li,Yh="__reactEvents$"+Li,bP="__reactListeners$"+Li,SP="__reactHandles$"+Li;function $s(e){var t=e[nr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jr]||n[nr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xx(e);e!==null;){if(n=e[nr])return n;e=xx(e)}return t}e=n,n=e.parentNode}return null}function ka(e){return e=e[nr]||e[jr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function od(e){return e[Bl]||null}var Gh=[],Do=-1;function Ts(e){return{current:e}}function qe(e){0>Do||(e.current=Gh[Do],Gh[Do]=null,Do--)}function We(e,t){Do++,Gh[Do]=e.current,e.current=t}var bs={},At=Ts(bs),Zt=Ts(!1),so=bs;function vi(e,t){var n=e.type.contextTypes;if(!n)return bs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Jt(e){return e=e.childContextTypes,e!=null}function iu(){qe(Zt),qe(At)}function yx(e,t,n){if(At.current!==bs)throw Error(J(168));We(At,t),We(Zt,n)}function o1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(J(108,iT(e)||"Unknown",s));return Je({},n,r)}function lu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bs,so=At.current,We(At,e),We(Zt,Zt.current),!0}function vx(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=o1(e,t,so),r.__reactInternalMemoizedMergedChildContext=e,qe(Zt),qe(At),We(At,e)):qe(Zt),We(Zt,n)}var xr=null,id=!1,vf=!1;function i1(e){xr===null?xr=[e]:xr.push(e)}function kP(e){id=!0,i1(e)}function Ps(){if(!vf&&xr!==null){vf=!0;var e=0,t=Le;try{var n=xr;for(Le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}xr=null,id=!1}catch(s){throw xr!==null&&(xr=xr.slice(e+1)),jb(Em,Ps),s}finally{Le=t,vf=!1}}return null}var $o=[],Fo=0,au=null,cu=0,wn=[],bn=0,oo=null,Sr=1,kr="";function Ms(e,t){$o[Fo++]=cu,$o[Fo++]=au,au=e,cu=t}function l1(e,t,n){wn[bn++]=Sr,wn[bn++]=kr,wn[bn++]=oo,oo=e;var r=Sr;e=kr;var s=32-Hn(r)-1;r&=~(1<<s),n+=1;var o=32-Hn(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,Sr=1<<32-Hn(t)+s|n<<s|r,kr=o+e}else Sr=1<<o|n<<s|r,kr=e}function _m(e){e.return!==null&&(Ms(e,1),l1(e,1,0))}function Mm(e){for(;e===au;)au=$o[--Fo],$o[Fo]=null,cu=$o[--Fo],$o[Fo]=null;for(;e===oo;)oo=wn[--bn],wn[bn]=null,kr=wn[--bn],wn[bn]=null,Sr=wn[--bn],wn[bn]=null}var cn=null,an=null,Ke=!1,$n=null;function a1(e,t){var n=kn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function wx(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,cn=e,an=hs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,cn=e,an=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=oo!==null?{id:Sr,overflow:kr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=kn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,cn=e,an=null,!0):!1;default:return!1}}function Qh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xh(e){if(Ke){var t=an;if(t){var n=t;if(!wx(e,t)){if(Qh(e))throw Error(J(418));t=hs(n.nextSibling);var r=cn;t&&wx(e,t)?a1(r,n):(e.flags=e.flags&-4097|2,Ke=!1,cn=e)}}else{if(Qh(e))throw Error(J(418));e.flags=e.flags&-4097|2,Ke=!1,cn=e}}}function bx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;cn=e}function Ja(e){if(e!==cn)return!1;if(!Ke)return bx(e),Ke=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qh(e.type,e.memoizedProps)),t&&(t=an)){if(Qh(e))throw c1(),Error(J(418));for(;t;)a1(e,t),t=hs(t.nextSibling)}if(bx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){an=hs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}an=null}}else an=cn?hs(e.stateNode.nextSibling):null;return!0}function c1(){for(var e=an;e;)e=hs(e.nextSibling)}function wi(){an=cn=null,Ke=!1}function Am(e){$n===null?$n=[e]:$n.push(e)}var EP=Dr.ReactCurrentBatchConfig;function Zi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(J(309));var r=n.stateNode}if(!r)throw Error(J(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=s.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,e))}return e}function ec(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Sx(e){var t=e._init;return t(e._payload)}function u1(e){function t(g,m){if(e){var y=g.deletions;y===null?(g.deletions=[m],g.flags|=16):y.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function s(g,m){return g=xs(g,m),g.index=0,g.sibling=null,g}function o(g,m,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<m?(g.flags|=2,m):y):(g.flags|=2,m)):(g.flags|=1048576,m)}function i(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,m,y,w){return m===null||m.tag!==6?(m=Nf(y,g.mode,w),m.return=g,m):(m=s(m,y),m.return=g,m)}function a(g,m,y,w){var k=y.type;return k===Oo?u(g,m,y.props.children,w,y.key):m!==null&&(m.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Kr&&Sx(k)===m.type)?(w=s(m,y.props),w.ref=Zi(g,m,y),w.return=g,w):(w=Lc(y.type,y.key,y.props,null,g.mode,w),w.ref=Zi(g,m,y),w.return=g,w)}function c(g,m,y,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=Rf(y,g.mode,w),m.return=g,m):(m=s(m,y.children||[]),m.return=g,m)}function u(g,m,y,w,k){return m===null||m.tag!==7?(m=eo(y,g.mode,w,k),m.return=g,m):(m=s(m,y),m.return=g,m)}function f(g,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Nf(""+m,g.mode,y),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Va:return y=Lc(m.type,m.key,m.props,null,g.mode,y),y.ref=Zi(g,null,m),y.return=g,y;case jo:return m=Rf(m,g.mode,y),m.return=g,m;case Kr:var w=m._init;return f(g,w(m._payload),y)}if(dl(m)||Ki(m))return m=eo(m,g.mode,y,null),m.return=g,m;ec(g,m)}return null}function h(g,m,y,w){var k=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:l(g,m,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Va:return y.key===k?a(g,m,y,w):null;case jo:return y.key===k?c(g,m,y,w):null;case Kr:return k=y._init,h(g,m,k(y._payload),w)}if(dl(y)||Ki(y))return k!==null?null:u(g,m,y,w,null);ec(g,y)}return null}function p(g,m,y,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(y)||null,l(m,g,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Va:return g=g.get(w.key===null?y:w.key)||null,a(m,g,w,k);case jo:return g=g.get(w.key===null?y:w.key)||null,c(m,g,w,k);case Kr:var N=w._init;return p(g,m,y,N(w._payload),k)}if(dl(w)||Ki(w))return g=g.get(y)||null,u(m,g,w,k,null);ec(m,w)}return null}function v(g,m,y,w){for(var k=null,N=null,E=m,C=m=0,P=null;E!==null&&C<y.length;C++){E.index>C?(P=E,E=null):P=E.sibling;var I=h(g,E,y[C],w);if(I===null){E===null&&(E=P);break}e&&E&&I.alternate===null&&t(g,E),m=o(I,m,C),N===null?k=I:N.sibling=I,N=I,E=P}if(C===y.length)return n(g,E),Ke&&Ms(g,C),k;if(E===null){for(;C<y.length;C++)E=f(g,y[C],w),E!==null&&(m=o(E,m,C),N===null?k=E:N.sibling=E,N=E);return Ke&&Ms(g,C),k}for(E=r(g,E);C<y.length;C++)P=p(E,g,C,y[C],w),P!==null&&(e&&P.alternate!==null&&E.delete(P.key===null?C:P.key),m=o(P,m,C),N===null?k=P:N.sibling=P,N=P);return e&&E.forEach(function(z){return t(g,z)}),Ke&&Ms(g,C),k}function x(g,m,y,w){var k=Ki(y);if(typeof k!="function")throw Error(J(150));if(y=k.call(y),y==null)throw Error(J(151));for(var N=k=null,E=m,C=m=0,P=null,I=y.next();E!==null&&!I.done;C++,I=y.next()){E.index>C?(P=E,E=null):P=E.sibling;var z=h(g,E,I.value,w);if(z===null){E===null&&(E=P);break}e&&E&&z.alternate===null&&t(g,E),m=o(z,m,C),N===null?k=z:N.sibling=z,N=z,E=P}if(I.done)return n(g,E),Ke&&Ms(g,C),k;if(E===null){for(;!I.done;C++,I=y.next())I=f(g,I.value,w),I!==null&&(m=o(I,m,C),N===null?k=I:N.sibling=I,N=I);return Ke&&Ms(g,C),k}for(E=r(g,E);!I.done;C++,I=y.next())I=p(E,g,C,I.value,w),I!==null&&(e&&I.alternate!==null&&E.delete(I.key===null?C:I.key),m=o(I,m,C),N===null?k=I:N.sibling=I,N=I);return e&&E.forEach(function($){return t(g,$)}),Ke&&Ms(g,C),k}function b(g,m,y,w){if(typeof y=="object"&&y!==null&&y.type===Oo&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Va:e:{for(var k=y.key,N=m;N!==null;){if(N.key===k){if(k=y.type,k===Oo){if(N.tag===7){n(g,N.sibling),m=s(N,y.props.children),m.return=g,g=m;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Kr&&Sx(k)===N.type){n(g,N.sibling),m=s(N,y.props),m.ref=Zi(g,N,y),m.return=g,g=m;break e}n(g,N);break}else t(g,N);N=N.sibling}y.type===Oo?(m=eo(y.props.children,g.mode,w,y.key),m.return=g,g=m):(w=Lc(y.type,y.key,y.props,null,g.mode,w),w.ref=Zi(g,m,y),w.return=g,g=w)}return i(g);case jo:e:{for(N=y.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(g,m.sibling),m=s(m,y.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=Rf(y,g.mode,w),m.return=g,g=m}return i(g);case Kr:return N=y._init,b(g,m,N(y._payload),w)}if(dl(y))return v(g,m,y,w);if(Ki(y))return x(g,m,y,w);ec(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(g,m.sibling),m=s(m,y),m.return=g,g=m):(n(g,m),m=Nf(y,g.mode,w),m.return=g,g=m),i(g)):n(g,m)}return b}var bi=u1(!0),d1=u1(!1),uu=Ts(null),du=null,Lo=null,zm=null;function Dm(){zm=Lo=du=null}function $m(e){var t=uu.current;qe(uu),e._currentValue=t}function Zh(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Qo(e,t){du=e,zm=Lo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gt=!0),e.firstContext=null)}function Rn(e){var t=e._currentValue;if(zm!==e)if(e={context:e,memoizedValue:t,next:null},Lo===null){if(du===null)throw Error(J(308));Lo=e,du.dependencies={lanes:0,firstContext:e}}else Lo=Lo.next=e;return t}var Fs=null;function Fm(e){Fs===null?Fs=[e]:Fs.push(e)}function f1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Fm(t)):(n.next=s.next,s.next=n),t.interleaved=n,Or(e,r)}function Or(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yr=!1;function Lm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function h1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Cr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ps(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Oe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Or(e,n)}return s=r.interleaved,s===null?(t.next=t,Fm(r)):(t.next=s.next,s.next=t),r.interleaved=t,Or(e,n)}function Mc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cm(e,n)}}function kx(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fu(e,t,n,r){var s=e.updateQueue;Yr=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var a=l,c=a.next;a.next=null,i===null?o=c:i.next=c,i=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==i&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(o!==null){var f=s.baseState;i=0,u=c=a=null,l=o;do{var h=l.lane,p=l.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,x=l;switch(h=t,p=n,x.tag){case 1:if(v=x.payload,typeof v=="function"){f=v.call(p,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,h=typeof v=="function"?v.call(p,f,h):v,h==null)break e;f=Je({},f,h);break e;case 2:Yr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=p,a=f):u=u.next=p,i|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(u===null&&(a=f),s.baseState=a,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);lo|=i,e.lanes=i,e.memoizedState=f}}function Ex(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(J(191,s));s.call(r)}}}var Ea={},or=Ts(Ea),Vl=Ts(Ea),Wl=Ts(Ea);function Ls(e){if(e===Ea)throw Error(J(174));return e}function Hm(e,t){switch(We(Wl,t),We(Vl,e),We(or,Ea),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Oh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Oh(t,e)}qe(or),We(or,t)}function Si(){qe(or),qe(Vl),qe(Wl)}function p1(e){Ls(Wl.current);var t=Ls(or.current),n=Oh(t,e.type);t!==n&&(We(Vl,e),We(or,n))}function Bm(e){Vl.current===e&&(qe(or),qe(Vl))}var Qe=Ts(0);function hu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var wf=[];function Vm(){for(var e=0;e<wf.length;e++)wf[e]._workInProgressVersionPrimary=null;wf.length=0}var Ac=Dr.ReactCurrentDispatcher,bf=Dr.ReactCurrentBatchConfig,io=0,Ze=null,mt=null,vt=null,pu=!1,kl=!1,Ul=0,CP=0;function Tt(){throw Error(J(321))}function Wm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}function Um(e,t,n,r,s,o){if(io=o,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ac.current=e===null||e.memoizedState===null?PP:IP,e=n(r,s),kl){o=0;do{if(kl=!1,Ul=0,25<=o)throw Error(J(301));o+=1,vt=mt=null,t.updateQueue=null,Ac.current=jP,e=n(r,s)}while(kl)}if(Ac.current=mu,t=mt!==null&&mt.next!==null,io=0,vt=mt=Ze=null,pu=!1,t)throw Error(J(300));return e}function qm(){var e=Ul!==0;return Ul=0,e}function Xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ze.memoizedState=vt=e:vt=vt.next=e,vt}function Tn(){if(mt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=vt===null?Ze.memoizedState:vt.next;if(t!==null)vt=t,mt=e;else{if(e===null)throw Error(J(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},vt===null?Ze.memoizedState=vt=e:vt=vt.next=e}return vt}function ql(e,t){return typeof t=="function"?t(e):t}function Sf(e){var t=Tn(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=mt,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=i=null,a=null,c=o;do{var u=c.lane;if((io&u)===u)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=f,i=r):a=a.next=f,Ze.lanes|=u,lo|=u}c=c.next}while(c!==null&&c!==o);a===null?i=r:a.next=l,Vn(r,t.memoizedState)||(Gt=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,Ze.lanes|=o,lo|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function kf(e){var t=Tn(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);Vn(o,t.memoizedState)||(Gt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function m1(){}function g1(e,t){var n=Ze,r=Tn(),s=t(),o=!Vn(r.memoizedState,s);if(o&&(r.memoizedState=s,Gt=!0),r=r.queue,Km(v1.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,Kl(9,y1.bind(null,n,r,s,t),void 0,null),wt===null)throw Error(J(349));io&30||x1(n,t,s)}return s}function x1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function y1(e,t,n,r){t.value=n,t.getSnapshot=r,w1(t)&&b1(e)}function v1(e,t,n){return n(function(){w1(t)&&b1(e)})}function w1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vn(e,n)}catch{return!0}}function b1(e){var t=Or(e,1);t!==null&&Bn(t,e,1,-1)}function Cx(e){var t=Xn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ql,lastRenderedState:e},t.queue=e,e=e.dispatch=TP.bind(null,Ze,e),[t.memoizedState,e]}function Kl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function S1(){return Tn().memoizedState}function zc(e,t,n,r){var s=Xn();Ze.flags|=e,s.memoizedState=Kl(1|t,n,void 0,r===void 0?null:r)}function ld(e,t,n,r){var s=Tn();r=r===void 0?null:r;var o=void 0;if(mt!==null){var i=mt.memoizedState;if(o=i.destroy,r!==null&&Wm(r,i.deps)){s.memoizedState=Kl(t,n,o,r);return}}Ze.flags|=e,s.memoizedState=Kl(1|t,n,o,r)}function Nx(e,t){return zc(8390656,8,e,t)}function Km(e,t){return ld(2048,8,e,t)}function k1(e,t){return ld(4,2,e,t)}function E1(e,t){return ld(4,4,e,t)}function C1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function N1(e,t,n){return n=n!=null?n.concat([e]):null,ld(4,4,C1.bind(null,t,e),n)}function Ym(){}function R1(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function T1(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function P1(e,t,n){return io&21?(Vn(n,t)||(n=Mb(),Ze.lanes|=n,lo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gt=!0),e.memoizedState=n)}function NP(e,t){var n=Le;Le=n!==0&&4>n?n:4,e(!0);var r=bf.transition;bf.transition={};try{e(!1),t()}finally{Le=n,bf.transition=r}}function I1(){return Tn().memoizedState}function RP(e,t,n){var r=gs(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},j1(e))O1(t,n);else if(n=f1(e,t,n,r),n!==null){var s=Bt();Bn(n,e,r,s),_1(n,t,r)}}function TP(e,t,n){var r=gs(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(j1(e))O1(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(s.hasEagerState=!0,s.eagerState=l,Vn(l,i)){var a=t.interleaved;a===null?(s.next=s,Fm(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=f1(e,t,s,r),n!==null&&(s=Bt(),Bn(n,e,r,s),_1(n,t,r))}}function j1(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function O1(e,t){kl=pu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cm(e,n)}}var mu={readContext:Rn,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},PP={readContext:Rn,useCallback:function(e,t){return Xn().memoizedState=[e,t===void 0?null:t],e},useContext:Rn,useEffect:Nx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zc(4194308,4,C1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zc(4194308,4,e,t)},useInsertionEffect:function(e,t){return zc(4,2,e,t)},useMemo:function(e,t){var n=Xn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=RP.bind(null,Ze,e),[r.memoizedState,e]},useRef:function(e){var t=Xn();return e={current:e},t.memoizedState=e},useState:Cx,useDebugValue:Ym,useDeferredValue:function(e){return Xn().memoizedState=e},useTransition:function(){var e=Cx(!1),t=e[0];return e=NP.bind(null,e[1]),Xn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ze,s=Xn();if(Ke){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),wt===null)throw Error(J(349));io&30||x1(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Nx(v1.bind(null,r,o,e),[e]),r.flags|=2048,Kl(9,y1.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Xn(),t=wt.identifierPrefix;if(Ke){var n=kr,r=Sr;n=(r&~(1<<32-Hn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ul++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=CP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},IP={readContext:Rn,useCallback:R1,useContext:Rn,useEffect:Km,useImperativeHandle:N1,useInsertionEffect:k1,useLayoutEffect:E1,useMemo:T1,useReducer:Sf,useRef:S1,useState:function(){return Sf(ql)},useDebugValue:Ym,useDeferredValue:function(e){var t=Tn();return P1(t,mt.memoizedState,e)},useTransition:function(){var e=Sf(ql)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:m1,useSyncExternalStore:g1,useId:I1,unstable_isNewReconciler:!1},jP={readContext:Rn,useCallback:R1,useContext:Rn,useEffect:Km,useImperativeHandle:N1,useInsertionEffect:k1,useLayoutEffect:E1,useMemo:T1,useReducer:kf,useRef:S1,useState:function(){return kf(ql)},useDebugValue:Ym,useDeferredValue:function(e){var t=Tn();return mt===null?t.memoizedState=e:P1(t,mt.memoizedState,e)},useTransition:function(){var e=kf(ql)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:m1,useSyncExternalStore:g1,useId:I1,unstable_isNewReconciler:!1};function _n(e,t){if(e&&e.defaultProps){t=Je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Jh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ad={isMounted:function(e){return(e=e._reactInternals)?yo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bt(),s=gs(e),o=Cr(r,s);o.payload=t,n!=null&&(o.callback=n),t=ps(e,o,s),t!==null&&(Bn(t,e,s,r),Mc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bt(),s=gs(e),o=Cr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ps(e,o,s),t!==null&&(Bn(t,e,s,r),Mc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bt(),r=gs(e),s=Cr(n,r);s.tag=2,t!=null&&(s.callback=t),t=ps(e,s,r),t!==null&&(Bn(t,e,r,n),Mc(t,e,r))}};function Rx(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!Fl(n,r)||!Fl(s,o):!0}function M1(e,t,n){var r=!1,s=bs,o=t.contextType;return typeof o=="object"&&o!==null?o=Rn(o):(s=Jt(t)?so:At.current,r=t.contextTypes,o=(r=r!=null)?vi(e,s):bs),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ad,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Tx(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ad.enqueueReplaceState(t,t.state,null)}function ep(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Lm(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=Rn(o):(o=Jt(t)?so:At.current,s.context=vi(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Jh(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ad.enqueueReplaceState(s,s.state,null),fu(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ki(e,t){try{var n="",r=t;do n+=oT(r),r=r.return;while(r);var s=n}catch(o){s=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:e,source:t,stack:s,digest:null}}function Ef(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function tp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var OP=typeof WeakMap=="function"?WeakMap:Map;function A1(e,t,n){n=Cr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xu||(xu=!0,dp=r),tp(e,t)},n}function z1(e,t,n){n=Cr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){tp(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){tp(e,t),typeof r!="function"&&(ms===null?ms=new Set([this]):ms.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Px(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new OP;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=qP.bind(null,e,t,n),t.then(e,e))}function Ix(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function jx(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Cr(-1,1),t.tag=2,ps(n,t,1))),n.lanes|=1),e)}var _P=Dr.ReactCurrentOwner,Gt=!1;function Lt(e,t,n,r){t.child=e===null?d1(t,null,n,r):bi(t,e.child,n,r)}function Ox(e,t,n,r,s){n=n.render;var o=t.ref;return Qo(t,s),r=Um(e,t,n,r,o,s),n=qm(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_r(e,t,s)):(Ke&&n&&_m(t),t.flags|=1,Lt(e,t,r,s),t.child)}function _x(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!ng(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,D1(e,t,o,r,s)):(e=Lc(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:Fl,n(i,r)&&e.ref===t.ref)return _r(e,t,s)}return t.flags|=1,e=xs(o,r),e.ref=t.ref,e.return=t,t.child=e}function D1(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Fl(o,r)&&e.ref===t.ref)if(Gt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Gt=!0);else return t.lanes=e.lanes,_r(e,t,s)}return np(e,t,n,r,s)}function $1(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},We(Bo,on),on|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,We(Bo,on),on|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,We(Bo,on),on|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,We(Bo,on),on|=r;return Lt(e,t,s,n),t.child}function F1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function np(e,t,n,r,s){var o=Jt(n)?so:At.current;return o=vi(t,o),Qo(t,s),n=Um(e,t,n,r,o,s),r=qm(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_r(e,t,s)):(Ke&&r&&_m(t),t.flags|=1,Lt(e,t,n,s),t.child)}function Mx(e,t,n,r,s){if(Jt(n)){var o=!0;lu(t)}else o=!1;if(Qo(t,s),t.stateNode===null)Dc(e,t),M1(t,n,r),ep(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var a=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Rn(c):(c=Jt(n)?so:At.current,c=vi(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&Tx(t,i,r,c),Yr=!1;var h=t.memoizedState;i.state=h,fu(t,r,i,s),a=t.memoizedState,l!==r||h!==a||Zt.current||Yr?(typeof u=="function"&&(Jh(t,n,u,r),a=t.memoizedState),(l=Yr||Rx(t,n,l,r,h,a,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),i.props=r,i.state=a,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,h1(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:_n(t.type,l),i.props=c,f=t.pendingProps,h=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=Rn(a):(a=Jt(n)?so:At.current,a=vi(t,a));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||h!==a)&&Tx(t,i,r,a),Yr=!1,h=t.memoizedState,i.state=h,fu(t,r,i,s);var v=t.memoizedState;l!==f||h!==v||Zt.current||Yr?(typeof p=="function"&&(Jh(t,n,p,r),v=t.memoizedState),(c=Yr||Rx(t,n,c,r,h,v,a)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,v,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,v,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),i.props=r,i.state=v,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return rp(e,t,n,r,o,s)}function rp(e,t,n,r,s,o){F1(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&vx(t,n,!1),_r(e,t,o);r=t.stateNode,_P.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=bi(t,e.child,null,o),t.child=bi(t,null,l,o)):Lt(e,t,l,o),t.memoizedState=r.state,s&&vx(t,n,!0),t.child}function L1(e){var t=e.stateNode;t.pendingContext?yx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yx(e,t.context,!1),Hm(e,t.containerInfo)}function Ax(e,t,n,r,s){return wi(),Am(s),t.flags|=256,Lt(e,t,n,r),t.child}var sp={dehydrated:null,treeContext:null,retryLane:0};function op(e){return{baseLanes:e,cachePool:null,transitions:null}}function H1(e,t,n){var r=t.pendingProps,s=Qe.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),We(Qe,s&1),e===null)return Xh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=dd(i,r,0,null),e=eo(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=op(n),t.memoizedState=sp,e):Gm(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return MP(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var a={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=xs(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=xs(l,o):(o=eo(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?op(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=sp,r}return o=e.child,e=o.sibling,r=xs(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Gm(e,t){return t=dd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function tc(e,t,n,r){return r!==null&&Am(r),bi(t,e.child,null,n),e=Gm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function MP(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=Ef(Error(J(422))),tc(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=dd({mode:"visible",children:r.children},s,0,null),o=eo(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&bi(t,e.child,null,i),t.child.memoizedState=op(i),t.memoizedState=sp,o);if(!(t.mode&1))return tc(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(J(419)),r=Ef(o,r,void 0),tc(e,t,i,r)}if(l=(i&e.childLanes)!==0,Gt||l){if(r=wt,r!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,Or(e,s),Bn(r,e,s,-1))}return tg(),r=Ef(Error(J(421))),tc(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=KP.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,an=hs(s.nextSibling),cn=t,Ke=!0,$n=null,e!==null&&(wn[bn++]=Sr,wn[bn++]=kr,wn[bn++]=oo,Sr=e.id,kr=e.overflow,oo=t),t=Gm(t,r.children),t.flags|=4096,t)}function zx(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zh(e.return,t,n)}function Cf(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function B1(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Lt(e,t,r.children,n),r=Qe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zx(e,n,t);else if(e.tag===19)zx(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(We(Qe,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&hu(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Cf(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&hu(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Cf(t,!0,n,null,o);break;case"together":Cf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Dc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _r(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),lo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=xs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function AP(e,t,n){switch(t.tag){case 3:L1(t),wi();break;case 5:p1(t);break;case 1:Jt(t.type)&&lu(t);break;case 4:Hm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;We(uu,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(We(Qe,Qe.current&1),t.flags|=128,null):n&t.child.childLanes?H1(e,t,n):(We(Qe,Qe.current&1),e=_r(e,t,n),e!==null?e.sibling:null);We(Qe,Qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return B1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),We(Qe,Qe.current),r)break;return null;case 22:case 23:return t.lanes=0,$1(e,t,n)}return _r(e,t,n)}var V1,ip,W1,U1;V1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ip=function(){};W1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ls(or.current);var o=null;switch(n){case"input":s=Th(e,s),r=Th(e,r),o=[];break;case"select":s=Je({},s,{value:void 0}),r=Je({},r,{value:void 0}),o=[];break;case"textarea":s=jh(e,s),r=jh(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ou)}_h(n,r);var i;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ol.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var a=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||a&&a.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in a)a.hasOwnProperty(i)&&l[i]!==a[i]&&(n||(n={}),n[i]=a[i])}else n||(o||(o=[]),o.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(o=o||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ol.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&Ue("scroll",e),o||l===a||(o=[])):(o=o||[]).push(c,a))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};U1=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ji(e,t){if(!Ke)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zP(e,t,n){var r=t.pendingProps;switch(Mm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(t),null;case 1:return Jt(t.type)&&iu(),Pt(t),null;case 3:return r=t.stateNode,Si(),qe(Zt),qe(At),Vm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ja(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$n!==null&&(pp($n),$n=null))),ip(e,t),Pt(t),null;case 5:Bm(t);var s=Ls(Wl.current);if(n=t.type,e!==null&&t.stateNode!=null)W1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return Pt(t),null}if(e=Ls(or.current),Ja(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[nr]=t,r[Bl]=o,e=(t.mode&1)!==0,n){case"dialog":Ue("cancel",r),Ue("close",r);break;case"iframe":case"object":case"embed":Ue("load",r);break;case"video":case"audio":for(s=0;s<hl.length;s++)Ue(hl[s],r);break;case"source":Ue("error",r);break;case"img":case"image":case"link":Ue("error",r),Ue("load",r);break;case"details":Ue("toggle",r);break;case"input":U0(r,o),Ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ue("invalid",r);break;case"textarea":K0(r,o),Ue("invalid",r)}_h(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Za(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Za(r.textContent,l,e),s=["children",""+l]):Ol.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Ue("scroll",r)}switch(n){case"input":Wa(r),q0(r,o,!0);break;case"textarea":Wa(r),Y0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ou)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vb(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[nr]=t,e[Bl]=r,V1(e,t,!1,!1),t.stateNode=e;e:{switch(i=Mh(n,r),n){case"dialog":Ue("cancel",e),Ue("close",e),s=r;break;case"iframe":case"object":case"embed":Ue("load",e),s=r;break;case"video":case"audio":for(s=0;s<hl.length;s++)Ue(hl[s],e);s=r;break;case"source":Ue("error",e),s=r;break;case"img":case"image":case"link":Ue("error",e),Ue("load",e),s=r;break;case"details":Ue("toggle",e),s=r;break;case"input":U0(e,r),s=Th(e,r),Ue("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Je({},r,{value:void 0}),Ue("invalid",e);break;case"textarea":K0(e,r),s=jh(e,r),Ue("invalid",e);break;default:s=r}_h(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?Sb(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&wb(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&_l(e,a):typeof a=="number"&&_l(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ol.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Ue("scroll",e):a!=null&&vm(e,o,a,i))}switch(n){case"input":Wa(e),q0(e,r,!1);break;case"textarea":Wa(e),Y0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ws(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?qo(e,!!r.multiple,o,!1):r.defaultValue!=null&&qo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ou)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Pt(t),null;case 6:if(e&&t.stateNode!=null)U1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Ls(Wl.current),Ls(or.current),Ja(t)){if(r=t.stateNode,n=t.memoizedProps,r[nr]=t,(o=r.nodeValue!==n)&&(e=cn,e!==null))switch(e.tag){case 3:Za(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Za(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[nr]=t,t.stateNode=r}return Pt(t),null;case 13:if(qe(Qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ke&&an!==null&&t.mode&1&&!(t.flags&128))c1(),wi(),t.flags|=98560,o=!1;else if(o=Ja(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(J(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(J(317));o[nr]=t}else wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pt(t),o=!1}else $n!==null&&(pp($n),$n=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Qe.current&1?gt===0&&(gt=3):tg())),t.updateQueue!==null&&(t.flags|=4),Pt(t),null);case 4:return Si(),ip(e,t),e===null&&Ll(t.stateNode.containerInfo),Pt(t),null;case 10:return $m(t.type._context),Pt(t),null;case 17:return Jt(t.type)&&iu(),Pt(t),null;case 19:if(qe(Qe),o=t.memoizedState,o===null)return Pt(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Ji(o,!1);else{if(gt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=hu(e),i!==null){for(t.flags|=128,Ji(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return We(Qe,Qe.current&1|2),t.child}e=e.sibling}o.tail!==null&&ct()>Ei&&(t.flags|=128,r=!0,Ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=hu(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ji(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Ke)return Pt(t),null}else 2*ct()-o.renderingStartTime>Ei&&n!==1073741824&&(t.flags|=128,r=!0,Ji(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ct(),t.sibling=null,n=Qe.current,We(Qe,r?n&1|2:n&1),t):(Pt(t),null);case 22:case 23:return eg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function DP(e,t){switch(Mm(t),t.tag){case 1:return Jt(t.type)&&iu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),qe(Zt),qe(At),Vm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bm(t),null;case 13:if(qe(Qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Qe),null;case 4:return Si(),null;case 10:return $m(t.type._context),null;case 22:case 23:return eg(),null;case 24:return null;default:return null}}var nc=!1,_t=!1,$P=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Ho(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function lp(e,t,n){try{n()}catch(r){nt(e,t,r)}}var Dx=!1;function FP(e,t){if(Wh=nu,e=Qb(),Om(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,c=0,u=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=i+s),f!==o||r!==0&&f.nodeType!==3||(a=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===s&&(l=i),h===o&&++u===r&&(a=i),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uh={focusedElem:e,selectionRange:n},nu=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,b=v.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:_n(t.type,x),b);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(w){nt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return v=Dx,Dx=!1,v}function El(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&lp(t,n,o)}s=s.next}while(s!==r)}}function cd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ap(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function q1(e){var t=e.alternate;t!==null&&(e.alternate=null,q1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nr],delete t[Bl],delete t[Yh],delete t[bP],delete t[SP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function K1(e){return e.tag===5||e.tag===3||e.tag===4}function $x(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||K1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ou));else if(r!==4&&(e=e.child,e!==null))for(cp(e,t,n),e=e.sibling;e!==null;)cp(e,t,n),e=e.sibling}function up(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(up(e,t,n),e=e.sibling;e!==null;)up(e,t,n),e=e.sibling}var bt=null,zn=!1;function Br(e,t,n){for(n=n.child;n!==null;)Y1(e,t,n),n=n.sibling}function Y1(e,t,n){if(sr&&typeof sr.onCommitFiberUnmount=="function")try{sr.onCommitFiberUnmount(td,n)}catch{}switch(n.tag){case 5:_t||Ho(n,t);case 6:var r=bt,s=zn;bt=null,Br(e,t,n),bt=r,zn=s,bt!==null&&(zn?(e=bt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):bt.removeChild(n.stateNode));break;case 18:bt!==null&&(zn?(e=bt,n=n.stateNode,e.nodeType===8?yf(e.parentNode,n):e.nodeType===1&&yf(e,n),Dl(e)):yf(bt,n.stateNode));break;case 4:r=bt,s=zn,bt=n.stateNode.containerInfo,zn=!0,Br(e,t,n),bt=r,zn=s;break;case 0:case 11:case 14:case 15:if(!_t&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&lp(n,t,i),s=s.next}while(s!==r)}Br(e,t,n);break;case 1:if(!_t&&(Ho(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){nt(n,t,l)}Br(e,t,n);break;case 21:Br(e,t,n);break;case 22:n.mode&1?(_t=(r=_t)||n.memoizedState!==null,Br(e,t,n),_t=r):Br(e,t,n);break;default:Br(e,t,n)}}function Fx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $P),t.forEach(function(r){var s=YP.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function On(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:bt=l.stateNode,zn=!1;break e;case 3:bt=l.stateNode.containerInfo,zn=!0;break e;case 4:bt=l.stateNode.containerInfo,zn=!0;break e}l=l.return}if(bt===null)throw Error(J(160));Y1(o,i,s),bt=null,zn=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){nt(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)G1(t,e),t=t.sibling}function G1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(On(t,e),Gn(e),r&4){try{El(3,e,e.return),cd(3,e)}catch(x){nt(e,e.return,x)}try{El(5,e,e.return)}catch(x){nt(e,e.return,x)}}break;case 1:On(t,e),Gn(e),r&512&&n!==null&&Ho(n,n.return);break;case 5:if(On(t,e),Gn(e),r&512&&n!==null&&Ho(n,n.return),e.flags&32){var s=e.stateNode;try{_l(s,"")}catch(x){nt(e,e.return,x)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&xb(s,o),Mh(l,i);var c=Mh(l,o);for(i=0;i<a.length;i+=2){var u=a[i],f=a[i+1];u==="style"?Sb(s,f):u==="dangerouslySetInnerHTML"?wb(s,f):u==="children"?_l(s,f):vm(s,u,f,c)}switch(l){case"input":Ph(s,o);break;case"textarea":yb(s,o);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?qo(s,!!o.multiple,p,!1):h!==!!o.multiple&&(o.defaultValue!=null?qo(s,!!o.multiple,o.defaultValue,!0):qo(s,!!o.multiple,o.multiple?[]:"",!1))}s[Bl]=o}catch(x){nt(e,e.return,x)}}break;case 6:if(On(t,e),Gn(e),r&4){if(e.stateNode===null)throw Error(J(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(x){nt(e,e.return,x)}}break;case 3:if(On(t,e),Gn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Dl(t.containerInfo)}catch(x){nt(e,e.return,x)}break;case 4:On(t,e),Gn(e);break;case 13:On(t,e),Gn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Zm=ct())),r&4&&Fx(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(_t=(c=_t)||u,On(t,e),_t=c):On(t,e),Gn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(ae=e,u=e.child;u!==null;){for(f=ae=u;ae!==null;){switch(h=ae,p=h.child,h.tag){case 0:case 11:case 14:case 15:El(4,h,h.return);break;case 1:Ho(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(x){nt(r,n,x)}}break;case 5:Ho(h,h.return);break;case 22:if(h.memoizedState!==null){Hx(f);continue}}p!==null?(p.return=h,ae=p):Hx(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=f.stateNode,a=f.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=bb("display",i))}catch(x){nt(e,e.return,x)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(x){nt(e,e.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:On(t,e),Gn(e),r&4&&Fx(e);break;case 21:break;default:On(t,e),Gn(e)}}function Gn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(K1(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(_l(s,""),r.flags&=-33);var o=$x(e);up(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=$x(e);cp(e,l,i);break;default:throw Error(J(161))}}catch(a){nt(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function LP(e,t,n){ae=e,Q1(e)}function Q1(e,t,n){for(var r=(e.mode&1)!==0;ae!==null;){var s=ae,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||nc;if(!i){var l=s.alternate,a=l!==null&&l.memoizedState!==null||_t;l=nc;var c=_t;if(nc=i,(_t=a)&&!c)for(ae=s;ae!==null;)i=ae,a=i.child,i.tag===22&&i.memoizedState!==null?Bx(s):a!==null?(a.return=i,ae=a):Bx(s);for(;o!==null;)ae=o,Q1(o),o=o.sibling;ae=s,nc=l,_t=c}Lx(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ae=o):Lx(e)}}function Lx(e){for(;ae!==null;){var t=ae;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:_t||cd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!_t)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:_n(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Ex(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ex(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Dl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}_t||t.flags&512&&ap(t)}catch(h){nt(t,t.return,h)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function Hx(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ae=n;break}ae=t.return}}function Bx(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{cd(4,t)}catch(a){nt(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){nt(t,s,a)}}var o=t.return;try{ap(t)}catch(a){nt(t,o,a)}break;case 5:var i=t.return;try{ap(t)}catch(a){nt(t,i,a)}}}catch(a){nt(t,t.return,a)}if(t===e){ae=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ae=l;break}ae=t.return}}var HP=Math.ceil,gu=Dr.ReactCurrentDispatcher,Qm=Dr.ReactCurrentOwner,Cn=Dr.ReactCurrentBatchConfig,Oe=0,wt=null,ut=null,Et=0,on=0,Bo=Ts(0),gt=0,Yl=null,lo=0,ud=0,Xm=0,Cl=null,Yt=null,Zm=0,Ei=1/0,gr=null,xu=!1,dp=null,ms=null,rc=!1,as=null,yu=0,Nl=0,fp=null,$c=-1,Fc=0;function Bt(){return Oe&6?ct():$c!==-1?$c:$c=ct()}function gs(e){return e.mode&1?Oe&2&&Et!==0?Et&-Et:EP.transition!==null?(Fc===0&&(Fc=Mb()),Fc):(e=Le,e!==0||(e=window.event,e=e===void 0?16:Hb(e.type)),e):1}function Bn(e,t,n,r){if(50<Nl)throw Nl=0,fp=null,Error(J(185));ba(e,n,r),(!(Oe&2)||e!==wt)&&(e===wt&&(!(Oe&2)&&(ud|=n),gt===4&&Xr(e,Et)),en(e,r),n===1&&Oe===0&&!(t.mode&1)&&(Ei=ct()+500,id&&Ps()))}function en(e,t){var n=e.callbackNode;ET(e,t);var r=tu(e,e===wt?Et:0);if(r===0)n!==null&&X0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&X0(n),t===1)e.tag===0?kP(Vx.bind(null,e)):i1(Vx.bind(null,e)),vP(function(){!(Oe&6)&&Ps()}),n=null;else{switch(Ab(r)){case 1:n=Em;break;case 4:n=Ob;break;case 16:n=eu;break;case 536870912:n=_b;break;default:n=eu}n=sS(n,X1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function X1(e,t){if($c=-1,Fc=0,Oe&6)throw Error(J(327));var n=e.callbackNode;if(Xo()&&e.callbackNode!==n)return null;var r=tu(e,e===wt?Et:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=vu(e,r);else{t=r;var s=Oe;Oe|=2;var o=J1();(wt!==e||Et!==t)&&(gr=null,Ei=ct()+500,Js(e,t));do try{WP();break}catch(l){Z1(e,l)}while(!0);Dm(),gu.current=o,Oe=s,ut!==null?t=0:(wt=null,Et=0,t=gt)}if(t!==0){if(t===2&&(s=Fh(e),s!==0&&(r=s,t=hp(e,s))),t===1)throw n=Yl,Js(e,0),Xr(e,r),en(e,ct()),n;if(t===6)Xr(e,r);else{if(s=e.current.alternate,!(r&30)&&!BP(s)&&(t=vu(e,r),t===2&&(o=Fh(e),o!==0&&(r=o,t=hp(e,o))),t===1))throw n=Yl,Js(e,0),Xr(e,r),en(e,ct()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:As(e,Yt,gr);break;case 3:if(Xr(e,r),(r&130023424)===r&&(t=Zm+500-ct(),10<t)){if(tu(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Bt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Kh(As.bind(null,e,Yt,gr),t);break}As(e,Yt,gr);break;case 4:if(Xr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Hn(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*HP(r/1960))-r,10<r){e.timeoutHandle=Kh(As.bind(null,e,Yt,gr),r);break}As(e,Yt,gr);break;case 5:As(e,Yt,gr);break;default:throw Error(J(329))}}}return en(e,ct()),e.callbackNode===n?X1.bind(null,e):null}function hp(e,t){var n=Cl;return e.current.memoizedState.isDehydrated&&(Js(e,t).flags|=256),e=vu(e,t),e!==2&&(t=Yt,Yt=n,t!==null&&pp(t)),e}function pp(e){Yt===null?Yt=e:Yt.push.apply(Yt,e)}function BP(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!Vn(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xr(e,t){for(t&=~Xm,t&=~ud,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Hn(t),r=1<<n;e[n]=-1,t&=~r}}function Vx(e){if(Oe&6)throw Error(J(327));Xo();var t=tu(e,0);if(!(t&1))return en(e,ct()),null;var n=vu(e,t);if(e.tag!==0&&n===2){var r=Fh(e);r!==0&&(t=r,n=hp(e,r))}if(n===1)throw n=Yl,Js(e,0),Xr(e,t),en(e,ct()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,As(e,Yt,gr),en(e,ct()),null}function Jm(e,t){var n=Oe;Oe|=1;try{return e(t)}finally{Oe=n,Oe===0&&(Ei=ct()+500,id&&Ps())}}function ao(e){as!==null&&as.tag===0&&!(Oe&6)&&Xo();var t=Oe;Oe|=1;var n=Cn.transition,r=Le;try{if(Cn.transition=null,Le=1,e)return e()}finally{Le=r,Cn.transition=n,Oe=t,!(Oe&6)&&Ps()}}function eg(){on=Bo.current,qe(Bo)}function Js(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,yP(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(Mm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&iu();break;case 3:Si(),qe(Zt),qe(At),Vm();break;case 5:Bm(r);break;case 4:Si();break;case 13:qe(Qe);break;case 19:qe(Qe);break;case 10:$m(r.type._context);break;case 22:case 23:eg()}n=n.return}if(wt=e,ut=e=xs(e.current,null),Et=on=t,gt=0,Yl=null,Xm=ud=lo=0,Yt=Cl=null,Fs!==null){for(t=0;t<Fs.length;t++)if(n=Fs[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=s,r.next=i}n.pending=r}Fs=null}return e}function Z1(e,t){do{var n=ut;try{if(Dm(),Ac.current=mu,pu){for(var r=Ze.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}pu=!1}if(io=0,vt=mt=Ze=null,kl=!1,Ul=0,Qm.current=null,n===null||n.return===null){gt=1,Yl=t,ut=null;break}e:{var o=e,i=n.return,l=n,a=t;if(t=Et,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Ix(i);if(p!==null){p.flags&=-257,jx(p,i,l,o,t),p.mode&1&&Px(o,c,t),t=p,a=c;var v=t.updateQueue;if(v===null){var x=new Set;x.add(a),t.updateQueue=x}else v.add(a);break e}else{if(!(t&1)){Px(o,c,t),tg();break e}a=Error(J(426))}}else if(Ke&&l.mode&1){var b=Ix(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),jx(b,i,l,o,t),Am(ki(a,l));break e}}o=a=ki(a,l),gt!==4&&(gt=2),Cl===null?Cl=[o]:Cl.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=A1(o,a,t);kx(o,g);break e;case 1:l=a;var m=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ms===null||!ms.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=z1(o,l,t);kx(o,w);break e}}o=o.return}while(o!==null)}tS(n)}catch(k){t=k,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function J1(){var e=gu.current;return gu.current=mu,e===null?mu:e}function tg(){(gt===0||gt===3||gt===2)&&(gt=4),wt===null||!(lo&268435455)&&!(ud&268435455)||Xr(wt,Et)}function vu(e,t){var n=Oe;Oe|=2;var r=J1();(wt!==e||Et!==t)&&(gr=null,Js(e,t));do try{VP();break}catch(s){Z1(e,s)}while(!0);if(Dm(),Oe=n,gu.current=r,ut!==null)throw Error(J(261));return wt=null,Et=0,gt}function VP(){for(;ut!==null;)eS(ut)}function WP(){for(;ut!==null&&!mT();)eS(ut)}function eS(e){var t=rS(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?tS(e):ut=t,Qm.current=null}function tS(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=DP(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{gt=6,ut=null;return}}else if(n=zP(n,t,on),n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);gt===0&&(gt=5)}function As(e,t,n){var r=Le,s=Cn.transition;try{Cn.transition=null,Le=1,UP(e,t,n,r)}finally{Cn.transition=s,Le=r}return null}function UP(e,t,n,r){do Xo();while(as!==null);if(Oe&6)throw Error(J(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(J(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(CT(e,o),e===wt&&(ut=wt=null,Et=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||rc||(rc=!0,sS(eu,function(){return Xo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Cn.transition,Cn.transition=null;var i=Le;Le=1;var l=Oe;Oe|=4,Qm.current=null,FP(e,n),G1(n,e),dP(Uh),nu=!!Wh,Uh=Wh=null,e.current=n,LP(n),gT(),Oe=l,Le=i,Cn.transition=o}else e.current=n;if(rc&&(rc=!1,as=e,yu=s),o=e.pendingLanes,o===0&&(ms=null),vT(n.stateNode),en(e,ct()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(xu)throw xu=!1,e=dp,dp=null,e;return yu&1&&e.tag!==0&&Xo(),o=e.pendingLanes,o&1?e===fp?Nl++:(Nl=0,fp=e):Nl=0,Ps(),null}function Xo(){if(as!==null){var e=Ab(yu),t=Cn.transition,n=Le;try{if(Cn.transition=null,Le=16>e?16:e,as===null)var r=!1;else{if(e=as,as=null,yu=0,Oe&6)throw Error(J(331));var s=Oe;for(Oe|=4,ae=e.current;ae!==null;){var o=ae,i=o.child;if(ae.flags&16){var l=o.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(ae=c;ae!==null;){var u=ae;switch(u.tag){case 0:case 11:case 15:El(8,u,o)}var f=u.child;if(f!==null)f.return=u,ae=f;else for(;ae!==null;){u=ae;var h=u.sibling,p=u.return;if(q1(u),u===c){ae=null;break}if(h!==null){h.return=p,ae=h;break}ae=p}}}var v=o.alternate;if(v!==null){var x=v.child;if(x!==null){v.child=null;do{var b=x.sibling;x.sibling=null,x=b}while(x!==null)}}ae=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,ae=i;else e:for(;ae!==null;){if(o=ae,o.flags&2048)switch(o.tag){case 0:case 11:case 15:El(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,ae=g;break e}ae=o.return}}var m=e.current;for(ae=m;ae!==null;){i=ae;var y=i.child;if(i.subtreeFlags&2064&&y!==null)y.return=i,ae=y;else e:for(i=m;ae!==null;){if(l=ae,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:cd(9,l)}}catch(k){nt(l,l.return,k)}if(l===i){ae=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ae=w;break e}ae=l.return}}if(Oe=s,Ps(),sr&&typeof sr.onPostCommitFiberRoot=="function")try{sr.onPostCommitFiberRoot(td,e)}catch{}r=!0}return r}finally{Le=n,Cn.transition=t}}return!1}function Wx(e,t,n){t=ki(n,t),t=A1(e,t,1),e=ps(e,t,1),t=Bt(),e!==null&&(ba(e,1,t),en(e,t))}function nt(e,t,n){if(e.tag===3)Wx(e,e,n);else for(;t!==null;){if(t.tag===3){Wx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ms===null||!ms.has(r))){e=ki(n,e),e=z1(t,e,1),t=ps(t,e,1),e=Bt(),t!==null&&(ba(t,1,e),en(t,e));break}}t=t.return}}function qP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Bt(),e.pingedLanes|=e.suspendedLanes&n,wt===e&&(Et&n)===n&&(gt===4||gt===3&&(Et&130023424)===Et&&500>ct()-Zm?Js(e,0):Xm|=n),en(e,t)}function nS(e,t){t===0&&(e.mode&1?(t=Ka,Ka<<=1,!(Ka&130023424)&&(Ka=4194304)):t=1);var n=Bt();e=Or(e,t),e!==null&&(ba(e,t,n),en(e,n))}function KP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nS(e,n)}function YP(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),nS(e,n)}var rS;rS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gt=!1,AP(e,t,n);Gt=!!(e.flags&131072)}else Gt=!1,Ke&&t.flags&1048576&&l1(t,cu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dc(e,t),e=t.pendingProps;var s=vi(t,At.current);Qo(t,n),s=Um(null,t,r,e,s,n);var o=qm();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jt(r)?(o=!0,lu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Lm(t),s.updater=ad,t.stateNode=s,s._reactInternals=t,ep(t,r,e,n),t=rp(null,t,r,!0,o,n)):(t.tag=0,Ke&&o&&_m(t),Lt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=QP(r),e=_n(r,e),s){case 0:t=np(null,t,r,e,n);break e;case 1:t=Mx(null,t,r,e,n);break e;case 11:t=Ox(null,t,r,e,n);break e;case 14:t=_x(null,t,r,_n(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_n(r,s),np(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_n(r,s),Mx(e,t,r,s,n);case 3:e:{if(L1(t),e===null)throw Error(J(387));r=t.pendingProps,o=t.memoizedState,s=o.element,h1(e,t),fu(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=ki(Error(J(423)),t),t=Ax(e,t,r,n,s);break e}else if(r!==s){s=ki(Error(J(424)),t),t=Ax(e,t,r,n,s);break e}else for(an=hs(t.stateNode.containerInfo.firstChild),cn=t,Ke=!0,$n=null,n=d1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wi(),r===s){t=_r(e,t,n);break e}Lt(e,t,r,n)}t=t.child}return t;case 5:return p1(t),e===null&&Xh(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,qh(r,s)?i=null:o!==null&&qh(r,o)&&(t.flags|=32),F1(e,t),Lt(e,t,i,n),t.child;case 6:return e===null&&Xh(t),null;case 13:return H1(e,t,n);case 4:return Hm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bi(t,null,r,n):Lt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_n(r,s),Ox(e,t,r,s,n);case 7:return Lt(e,t,t.pendingProps,n),t.child;case 8:return Lt(e,t,t.pendingProps.children,n),t.child;case 12:return Lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,We(uu,r._currentValue),r._currentValue=i,o!==null)if(Vn(o.value,i)){if(o.children===s.children&&!Zt.current){t=_r(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Cr(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Zh(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(J(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Zh(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Lt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Qo(t,n),s=Rn(s),r=r(s),t.flags|=1,Lt(e,t,r,n),t.child;case 14:return r=t.type,s=_n(r,t.pendingProps),s=_n(r.type,s),_x(e,t,r,s,n);case 15:return D1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_n(r,s),Dc(e,t),t.tag=1,Jt(r)?(e=!0,lu(t)):e=!1,Qo(t,n),M1(t,r,s),ep(t,r,s,n),rp(null,t,r,!0,e,n);case 19:return B1(e,t,n);case 22:return $1(e,t,n)}throw Error(J(156,t.tag))};function sS(e,t){return jb(e,t)}function GP(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kn(e,t,n,r){return new GP(e,t,n,r)}function ng(e){return e=e.prototype,!(!e||!e.isReactComponent)}function QP(e){if(typeof e=="function")return ng(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bm)return 11;if(e===Sm)return 14}return 2}function xs(e,t){var n=e.alternate;return n===null?(n=kn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Lc(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")ng(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Oo:return eo(n.children,s,o,t);case wm:i=8,s|=8;break;case Eh:return e=kn(12,n,t,s|2),e.elementType=Eh,e.lanes=o,e;case Ch:return e=kn(13,n,t,s),e.elementType=Ch,e.lanes=o,e;case Nh:return e=kn(19,n,t,s),e.elementType=Nh,e.lanes=o,e;case pb:return dd(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fb:i=10;break e;case hb:i=9;break e;case bm:i=11;break e;case Sm:i=14;break e;case Kr:i=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=kn(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function eo(e,t,n,r){return e=kn(7,e,r,t),e.lanes=n,e}function dd(e,t,n,r){return e=kn(22,e,r,t),e.elementType=pb,e.lanes=n,e.stateNode={isHidden:!1},e}function Nf(e,t,n){return e=kn(6,e,null,t),e.lanes=n,e}function Rf(e,t,n){return t=kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XP(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lf(0),this.expirationTimes=lf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lf(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function rg(e,t,n,r,s,o,i,l,a){return e=new XP(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=kn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lm(o),e}function ZP(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:jo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function oS(e){if(!e)return bs;e=e._reactInternals;e:{if(yo(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var n=e.type;if(Jt(n))return o1(e,n,t)}return t}function iS(e,t,n,r,s,o,i,l,a){return e=rg(n,r,!0,e,s,o,i,l,a),e.context=oS(null),n=e.current,r=Bt(),s=gs(n),o=Cr(r,s),o.callback=t??null,ps(n,o,s),e.current.lanes=s,ba(e,s,r),en(e,r),e}function fd(e,t,n,r){var s=t.current,o=Bt(),i=gs(s);return n=oS(n),t.context===null?t.context=n:t.pendingContext=n,t=Cr(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ps(s,t,i),e!==null&&(Bn(e,s,i,o),Mc(e,s,i)),i}function wu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ux(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sg(e,t){Ux(e,t),(e=e.alternate)&&Ux(e,t)}function JP(){return null}var lS=typeof reportError=="function"?reportError:function(e){console.error(e)};function og(e){this._internalRoot=e}hd.prototype.render=og.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));fd(e,t,null,null)};hd.prototype.unmount=og.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ao(function(){fd(null,e,null,null)}),t[jr]=null}};function hd(e){this._internalRoot=e}hd.prototype.unstable_scheduleHydration=function(e){if(e){var t=$b();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Qr.length&&t!==0&&t<Qr[n].priority;n++);Qr.splice(n,0,e),n===0&&Lb(e)}};function ig(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function pd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function qx(){}function eI(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=wu(i);o.call(c)}}var i=iS(t,r,e,0,null,!1,!1,"",qx);return e._reactRootContainer=i,e[jr]=i.current,Ll(e.nodeType===8?e.parentNode:e),ao(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=wu(a);l.call(c)}}var a=rg(e,0,!1,null,null,!1,!1,"",qx);return e._reactRootContainer=a,e[jr]=a.current,Ll(e.nodeType===8?e.parentNode:e),ao(function(){fd(t,a,n,r)}),a}function md(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var a=wu(i);l.call(a)}}fd(t,i,e,s)}else i=eI(n,t,e,s,r);return wu(i)}zb=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fl(t.pendingLanes);n!==0&&(Cm(t,n|1),en(t,ct()),!(Oe&6)&&(Ei=ct()+500,Ps()))}break;case 13:ao(function(){var r=Or(e,1);if(r!==null){var s=Bt();Bn(r,e,1,s)}}),sg(e,1)}};Nm=function(e){if(e.tag===13){var t=Or(e,134217728);if(t!==null){var n=Bt();Bn(t,e,134217728,n)}sg(e,134217728)}};Db=function(e){if(e.tag===13){var t=gs(e),n=Or(e,t);if(n!==null){var r=Bt();Bn(n,e,t,r)}sg(e,t)}};$b=function(){return Le};Fb=function(e,t){var n=Le;try{return Le=e,t()}finally{Le=n}};zh=function(e,t,n){switch(t){case"input":if(Ph(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=od(r);if(!s)throw Error(J(90));gb(r),Ph(r,s)}}}break;case"textarea":yb(e,n);break;case"select":t=n.value,t!=null&&qo(e,!!n.multiple,t,!1)}};Cb=Jm;Nb=ao;var tI={usingClientEntryPoint:!1,Events:[ka,zo,od,kb,Eb,Jm]},el={findFiberByHostInstance:$s,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nI={bundleType:el.bundleType,version:el.version,rendererPackageName:el.rendererPackageName,rendererConfig:el.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pb(e),e===null?null:e.stateNode},findFiberByHostInstance:el.findFiberByHostInstance||JP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sc.isDisabled&&sc.supportsFiber)try{td=sc.inject(nI),sr=sc}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tI;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ig(t))throw Error(J(200));return ZP(e,t,null,n)};pn.createRoot=function(e,t){if(!ig(e))throw Error(J(299));var n=!1,r="",s=lS;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=rg(e,1,!1,null,null,n,!1,r,s),e[jr]=t.current,Ll(e.nodeType===8?e.parentNode:e),new og(t)};pn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=Pb(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return ao(e)};pn.hydrate=function(e,t,n){if(!pd(t))throw Error(J(200));return md(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!ig(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=lS;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=iS(t,null,e,1,n??null,s,!1,o,i),e[jr]=t.current,Ll(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new hd(t)};pn.render=function(e,t,n){if(!pd(t))throw Error(J(200));return md(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!pd(e))throw Error(J(40));return e._reactRootContainer?(ao(function(){md(null,null,e,!1,function(){e._reactRootContainer=null,e[jr]=null})}),!0):!1};pn.unstable_batchedUpdates=Jm;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!pd(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return md(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function aS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aS)}catch(e){console.error(e)}}aS(),ab.exports=pn;var dn=ab.exports,rI,Kx=dn;rI=Kx.createRoot,Kx.hydrateRoot;function sI(e){return typeof e=="object"?e.key:e}function oI(e,t){const n=e.length;return new Proxy(e,{get(r,s,o){if(typeof s=="string"){const i=s.charCodeAt(0);if(i>=48&&i<=57){const l=+s;if(Number.isInteger(l)&&l>=0&&l<n){let a=r[l];if(typeof a!="object"){const c=t[l*2];a=r[l]={index:l,key:a,start:c,size:t[l*2+1],end:c+t[l*2+1],lane:0}}return a}}if(s==="length")return n}return Reflect.get(r,s,o)}})}function Io(e,t,n){let r=n.initialDeps??[],s,o=!0;function i(){const l=e();return(l.length!==r.length||l.some((c,u)=>r[u]!==c))&&(r=l,s=t(...l),n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(s),o=!1),s}return i.updateDeps=l=>{r=l},i}function Yx(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Gx=(e,t)=>Math.abs(e-t)<1.01,iI=(e,t,n)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)},{cancel:()=>{e.clearTimeout(r)}})};let tl;const Tf=()=>{if(tl!==void 0)return tl;if(typeof navigator>"u")return tl=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return tl=!0;const e=navigator.maxTouchPoints;return tl=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Qx=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},lI=e=>e,aI=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(r);for(let o=0;o<r;o++)s[o]=t+o;return s},cI=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:l,height:a}=i;t({width:Math.round(l),height:Math.round(a)})};if(s(Qx(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const l=()=>{const a=i[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(Qx(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},bu={passive:!0},uI=typeof window>"u"?!0:"onscrollend"in window,dI=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e.options.useScrollendEvent&&uI;let i=0;const l=o?null:iI(s,()=>t(n(r),!1),e.options.isScrollingResetDelay),a=f=>()=>{i=n(r),l==null||l(),t(i,f)},c=a(!0),u=a(!1);return r.addEventListener("scroll",c,bu),o&&r.addEventListener("scrollend",u,bu),()=>{r.removeEventListener("scroll",c),o&&r.removeEventListener("scrollend",u),l==null||l.cancel()}},fI=(e,t)=>dI(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),hI=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),s=n.options.getItemKey(r);return n.itemSizeCache.get(s)??n.options.estimateSize(r)}if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),s=n.options.getItemKey(r),o=n.itemSizeCache.get(s);if(o!==void 0)return o}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},pI=(e,{adjustments:t=0,behavior:n},r)=>{var s,o;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},mI=pI;function gI(e,t,n,r){if(t===0)return!1;const s=r(0),o=new Set;let i=0;for(;i<e;){const a=n(i);if(a===s)break;o.add(a),i++}const l=e-i;if(l===0||l>=t)return!1;for(let a=0;a<l;a++)if(r(a)!==n(i+a))return!1;for(let a=l;a<t;a++)if(o.has(r(a)))return!1;return!0}class xI{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{const l=o.target,a=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l);for(const[c,u]of this.elementsCache)if(u===l){this.elementsCache.delete(c);break}return}this.isIndexInRange(a)&&this.shouldMeasureDuringScroll(a)&&this.resizeItem(a,this.options.measureElement(l,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var r;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lI,rangeExtractor:aI,onChange:()=>{},measureElement:hI,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const f in n){const h=n[f];h!==void 0&&(s[f]=h)}const o=this.options;let i=null,l=null,a=!1;if(o!==void 0&&o.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const f=o.count,h=s.count,p=this.getMeasurements(),v=((r=this._singleLaneMeasurements)==null?void 0:r.items)??p,x=w=>sI(v[w]),b=f>0?x(0):null,g=f>0?x(f-1):null;if(h!==f||f>0&&h>0&&(s.getItemKey(0)!==b||s.getItemKey(h-1)!==g)){a=!0;const w=f>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;w&&(i=[w.key,this.getScrollOffset()-w.start]);const k=s.followOnAppend===!0?"auto":s.followOnAppend||null;k&&h>0&&this.isAtEnd(o.scrollEndThreshold)&&(f===0||s.getItemKey(h-1)!==g)&&(h>f||gI(f,h,x,s.getItemKey))&&(l=k)}}this.options=s,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,u=0;if(i&&this.scrollOffset!==null){const[f,h]=i,p=this.getMeasurements(),{count:v,getItemKey:x}=this.options;let b=0;for(;b<v&&x(b)!==f;)b++;if(b<v){const g=p[b];if(g){const m=Math.max(0,g.start+h);!l&&m!==this.scrollOffset&&(u=m-this.scrollOffset,this.scrollOffset=m,c=!0)}}}(c||l)&&(this.pendingScrollAnchor=[c?i[0]:null,c?i[1]:0,l,u])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Io(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n,r;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}if(this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,l)=>{if(l&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===i?this.scrollDirection:a<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Tf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,bu),i.addEventListener("touchend",a,bu),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,l,a,c]=o;i!==null&&!a&&(Tf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?c!==0&&(this._iosDeferredAdjustment+=c):((r=this.scrollState)==null?void 0:r.behavior)==="smooth"&&!Gx(this.getScrollOffset()-c,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:n,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=n>s+.5?{target:n,maxAtWrite:s}:null,this._scrollToOffset(n,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Io(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,s,o,i,l,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=Io(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c},u)=>{var f;const h=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const m of this.laneAssignments.keys())m>=n&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),l===1){const m=n*2;let y=(f=this._singleLaneMeasurements)==null?void 0:f.flat;if(!y||y.length<m){const E=new Float64Array(m);y&&p>0&&E.set(y.subarray(0,p*2)),y=E}const w=p===0?new Array(n):this._singleLaneMeasurements.items.slice();let k;if(p===0)k=r+s;else{const E=p-1;k=y[E*2]+y[E*2+1]+c}for(let E=p;E<n;E++){const C=o(E);w[E]=C;const P=h.get(C),I=typeof P=="number"?P:this.options.estimateSize(E);y[E*2]=k,y[E*2+1]=I,k+=I+c}this._singleLaneMeasurements={flat:y,items:w};const N=oI(w,y);return this.measurementsCache=N,N}const v=this.measurementsCache.slice(0,p),x=new Array(l).fill(void 0),b=new Float64Array(l);let g=0;for(let m=0;m<p;m++){const y=v[m];y&&(x[y.lane]===void 0&&g++,x[y.lane]=m,b[y.lane]=y.end)}for(let m=p;m<n;m++){const y=o(m),w=this.laneAssignments.get(m);let k,N;const E=a==="estimate"||h.has(y);if(w!==void 0&&this.options.lanes>1){k=w;const z=x[k],$=z!==void 0?v[z]:void 0;N=$?$.end+c:r+s}else if(g===l){let z=0,$=b[0],A=x[0];for(let R=1;R<l;R++){const j=b[R];(j<$||j===$&&x[R]<A)&&(z=R,$=j,A=x[R])}k=z,N=$+c,E&&this.laneAssignments.set(m,k)}else k=m%this.options.lanes,N=r+s,E&&this.laneAssignments.set(m,k);const C=h.get(y),P=typeof C=="number"?C:this.options.estimateSize(m),I=N+P;v[m]={index:m,start:N,size:P,end:I,key:y,lane:k},x[k]===void 0&&g++,x[k]=m,b[k]=I}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Io(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>n.length===0||r===0?(this.range=null,null):(this.range=vI(n,r,s,o,o===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Io(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-o),l=Math.min(this.options.count-1,s+o);return n>=i&&n<=l}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,l)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(l))});return}const r=this.indexFromElement(n);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s,o,i;if(!this.isIndexInRange(n))return;let l,a,c;const u=(s=this._singleLaneMeasurements)==null?void 0:s.flat;if(this.options.lanes===1&&u!=null)c=this.options.getItemKey(n),a=u[n*2],l=u[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;c=p.key,a=p.start,l=p.size}const f=this.itemSizeCache.get(c)??l,h=r-f;if(h!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,v=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,g=!this.itemSizeCache.has(c)?a<x:a+f<=x&&this.scrollDirection!=="backward",m=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:c,start:a,size:l,end:a+l,lane:0},h,this):g);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(c,r),this.itemSizeCacheVersion++;let y=!1;p?y=this.applyScrollAdjustment(this.getTotalSize()-v):m&&(y=this.applyScrollAdjustment(h)),this.notify(y),this._retryClampedAdjustment()}},this.getVirtualItems=Io(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let o=0,i=n.length;o<i;o++){const l=n[o],a=r[l];s.push(a)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{var r;const s=this.getMeasurements();if(s.length===0)return;const o=(r=this._singleLaneMeasurements)==null?void 0:r.flat,i=this.options.lanes===1&&o!=null,l=cS(0,s.length-1,i?a=>o[a*2]:a=>Yx(s[a]).start,n);return Yx(s[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(s-o)/2:r==="end"&&(n-=o);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const l=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,l]=o,a=this.now();this.scrollState={index:n,align:l,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n,r;const s=this.getMeasurements();let o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=(n=this._singleLaneMeasurements)==null?void 0:n.flat;l!=null?o=l[i*2]+l[i*2+1]:o=((r=s[i])==null?void 0:r.end)??0}else{const i=Array(this.options.lanes).fill(null);let l=s.length-1;for(;l>=0&&i.some(a=>a===null);){const a=s[l];i[a.lane]===null&&(i[a.lane]=a.end),l--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){if(t===0)return!1;if(Tf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=t,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+t,s=this.scrollElement,o=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=o!==null&&r>o+.5?{target:r,maxAtWrite:o}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&Gx(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,i){const l=this.getSize()||600,a=Math.abs(s-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&a>l;this.scrollState.lastTargetOffset=s,c||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const cS=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,o=n(s);if(o<r)e=s+1;else if(o>r)t=s-1;else return s}return e>0?e-1:0};function yI(e,t,n){let r=0;for(;r<=t;){const s=(r+t)/2|0,o=e[s*2];if(o<n)r=s+1;else if(o>n)t=s-1;else return s}return r>0?r-1:0}function vI(e,t,n,r,s){const o=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:o};if(r===1&&s!==null){const c=yI(s,o,n);let u=c;const f=n+t;for(;u<o&&s[u*2]+s[u*2+1]<f;)u++;return{startIndex:c,endIndex:u}}let l=cS(0,o,c=>e[c].start,n),a=l;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<o&&c.some(f=>f<n+t);){const f=e[a];c[f.lane]=f.end,a++}const u=Array(r).fill(n+t);for(;l>=0&&u.some(f=>f>=n);){const f=e[l];u[f.lane]=f.start,l--}l=Math.max(0,l-l%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:l,endIndex:a}}const Pf=typeof document<"u"?S.useLayoutEffect:S.useEffect;function wI({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=S.useReducer(f=>f+1,0)[1],o=S.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=n;const i=S.useRef(!1),l=f=>{const h=o.current;if(!h.enabled||!h.container)return;const p=f.getTotalSize();if(p!==h.lastSize){h.lastSize=p;const v=f.options.horizontal?"width":"height";h.container.style[v]=`${p}px`}},a=f=>{const h=o.current;if(!h.enabled||!h.container)return;l(f);const p=!!f.options.horizontal,v=h.mode==="transform",x=p?"left":"top",b=f.options.scrollMargin,g=f.getVirtualItems();for(const m of g){const y=m.start-b,w=f.elementsCache.get(m.key);w&&h.lastPositions.get(w)!==y&&(h.lastPositions.set(w,y),v?w.style.transform=p?`translate3d(${y}px, 0, 0)`:`translate3d(0, ${y}px, 0)`:w.style[x]=`${y}px`)}},c={...r,onChange:(f,h)=>{var p;const v=o.current;let x=!0;if(v.enabled){a(f);const b=f.range,g=v.prevRange;x=!g||g.isScrolling!==f.isScrolling||g.startIndex!==(b==null?void 0:b.startIndex)||g.endIndex!==(b==null?void 0:b.endIndex),x&&(v.prevRange=b?{startIndex:b.startIndex,endIndex:b.endIndex,isScrolling:f.isScrolling}:null)}x&&(e&&h&&!i.current?dn.flushSync(s):s()),(p=r.onChange)==null||p.call(r,f,h)}},[u]=S.useState(()=>{const f=new xI(c),h=f.measureElement;return f.measureElement=p=>{i.current=!0;try{h(p)}finally{i.current=!1}},Object.assign(f,{containerRef:p=>{const v=o.current;if(v.container=p,v.lastSize=null,p&&v.enabled){const x=f.getTotalSize();v.lastSize=x;const b=f.options.horizontal?"width":"height";p.style[b]=`${x}px`}}})});return u.setOptions(c),Pf(()=>u._didMount(),[]),Pf(()=>(l(u),u._willUpdate())),Pf(()=>{a(u)}),u}function lg(e){return wI({observeElementRect:cI,observeElementOffset:fI,scrollToFn:mI,...e})}function Sn(e){return encodeURIComponent(String(e))}function Vo(e,t){const n=[],r=s=>t!=null&&t.prefix?`${t.prefix}[${Sn(s)}]`:Sn(s);for(const[s,o]of Object.entries(e))if(o!=null)if(Array.isArray(o))for(const i of o)n.push(`${r(s)}[]=${Sn(i)}`);else if(typeof o=="object")for(const[i,l]of Object.entries(o))l!=null&&n.push(`${r(s)}[${Sn(i)}]=${Sn(l)}`);else n.push(`${r(s)}=${Sn(o)}`);return n.join("&")}function uS(e,t){const n=[];return mp(e,(t==null?void 0:t.prefix)??"where",n),n.join("&")}function bI(e){var s;const t=[],{where:n,...r}=e.filter??{};if(n!=null&&n.length&&t.push(uS(n,{prefix:"filter[where]"})),t.push(Vo(r,{prefix:"filter"})),e.search&&t.push(`search=${Sn(e.search)}`),(s=e.sort)!=null&&s.length){const o=e.sort.map(i=>`${i.direction==="desc"?"-":""}${i.field}`).join(",");t.push(`sort=${Sn(o)}`)}for(const o of["include","distinct","extent"]){const i=e[o];i!=null&&i.length&&t.push(Vo({[o]:i}))}return e.groupByCount&&t.push(Vo({groupByCount:e.groupByCount})),e.paginate&&t.push(Vo({paginate:e.paginate})),t.filter(Boolean).join("&")}function mp(e,t,n){for(let r=0;r<e.length;r++){const s=e[r],o=`${t}[${r}]`;if(s.field!==void 0&&n.push(`${o}[field]=${Sn(s.field)}`),s.operator!==void 0&&n.push(`${o}[operator]=${Sn(s.operator)}`),s.value!==void 0)if(Array.isArray(s.value))for(let i=0;i<s.value.length;i++)n.push(`${o}[value][${i}]=${Sn(s.value[i])}`);else n.push(`${o}[value]=${Sn(s.value)}`);s.AND&&s.AND.length>0&&mp(s.AND,`${o}[AND]`,n),s.OR&&s.OR.length>0&&mp(s.OR,`${o}[OR]`,n)}}const SI=["equals","notEquals","contains","notContains","iContains","startsWith","endsWith","gt","gte","lt","lte","between","notBetween","in","notIn","isAnyOf","isEmpty","isNotEmpty","isNull","isNotNull","exists","notExists"],kI=["equals","notEquals","gt","gte","lt","lte"],EI=["contains","notContains","iContains","startsWith","endsWith"],CI=["in","notIn","isAnyOf"],NI=["between","notBetween"],RI=["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"],TI=["gt","gte","lt","lte"],PI=new Set(kI),II=new Set(EI),jI=new Set(CI),OI=new Set(NI),gp=new Set(RI),_I=new Set(TI);function oc(e,t){if(!gp.has(e)){if(II.has(e)){if(typeof t!="string")throw new Error(`Operator "${e}" expects a string value.`);return}if(OI.has(e)){if(!Array.isArray(t)||t.length!==2)throw new Error(`Operator "${e}" expects [low, high] tuple.`);return}if(jI.has(e)){if(!Array.isArray(t))throw new Error(`Operator "${e}" expects an array value.`);return}if(PI.has(e)){if(Array.isArray(t))throw new Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`);return}}}function MI(e){if(!_I.has(e))throw new Error(`Operator "${e}" should use where() (replace), not add(). add() is for range operators (gt, gte, lt, lte) on the same field.`)}class Su{constructor(){ge(this,"conditions",[]);ge(this,"groups",[]);ge(this,"extra",{});ge(this,"includes",[]);ge(this,"searchTerm");ge(this,"sorts",[]);ge(this,"distinctFields",[]);ge(this,"extentFields",[]);ge(this,"groupByCountSpec");ge(this,"pagination");ge(this,"version",0);ge(this,"snapshot",null);ge(this,"listeners",new Set);ge(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));ge(this,"getSnapshot",()=>(this.snapshot===null&&(this.snapshot=this.build()),this.snapshot))}where(t,n,r){if(this.conditions=this.conditions.filter(s=>s.field!==t),r!==void 0){const s=n;oc(s,r),this.conditions.push({field:t,operator:s,value:gp.has(s)?void 0:r})}else Array.isArray(n)?this.conditions.push({field:t,operator:"in",value:n}):typeof n=="string"&&["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"].includes(n)?(oc(n,void 0),this.conditions.push({field:t,operator:n,value:void 0})):this.conditions.push({field:t,operator:"equals",value:n});return this.notify(),this}whereDynamic(t,n,r){if(!SI.includes(n))throw new Error(`Unknown filter operator "${String(n)}".`);return oc(n,r),this.conditions=this.conditions.filter(s=>s.field!==t),this.conditions.push({field:t,operator:n,value:gp.has(n)?void 0:r}),this.notify(),this}fromFilters(t,n){for(const r of t)r.field&&((n==null?void 0:n.skip)!==void 0&&r.field===n.skip||this.whereDynamic(r.field,r.operator,r.value));return this}add(t,n,r){return MI(n),oc(n,r),this.conditions.push({field:t,operator:n,value:r}),this.notify(),this}remove(t){return this.conditions=this.conditions.filter(n=>n.field!==t),this.notify(),this}clear(){return this.conditions=[],this.groups.length=0,this.extra={},this.includes=[],this.searchTerm=void 0,this.sorts=[],this.distinctFields=[],this.extentFields=[],this.groupByCountSpec=void 0,this.pagination=void 0,this.notify(),this}or(t){const n=new Su;return t(n),this.groups.push({type:"OR",conditions:n.conditions}),this.notify(),this}and(t){const n=new Su;return t(n),this.groups.push({type:"AND",conditions:n.conditions}),this.notify(),this}equals(t,n){return this.where(t,"equals",n)}notEquals(t,n){return this.where(t,"notEquals",n)}contains(t,n){return this.where(t,"contains",n)}in(t,n){return this.where(t,"in",n)}notIn(t,n){return this.where(t,"notIn",n)}between(t,n,r){return this.where(t,"between",[n,r])}gt(t,n){return this.where(t,"gt",n)}gte(t,n){return this.where(t,"gte",n)}lt(t,n){return this.where(t,"lt",n)}lte(t,n){return this.where(t,"lte",n)}isNull(t){return this.where(t,"isNull")}isNotNull(t){return this.where(t,"isNotNull")}isEmpty(t){return this.where(t,"isEmpty")}isNotEmpty(t){return this.where(t,"isNotEmpty")}startsWith(t,n){return this.where(t,"startsWith",n)}endsWith(t,n){return this.where(t,"endsWith",n)}addGte(t,n){return this.add(t,"gte",n)}addLte(t,n){return this.add(t,"lte",n)}addGt(t,n){return this.add(t,"gt",n)}addLt(t,n){return this.add(t,"lt",n)}set(t,n){return this.extra[t]=n,this.notify(),this}include(...t){for(const n of t)typeof n=="string"&&(this.includes.includes(n)||this.includes.push(n));return this.notify(),this}search(t){return typeof t!="string"?this:(this.searchTerm=t,this.notify(),this)}distinct(...t){for(const n of t)typeof n=="string"&&(this.distinctFields.includes(n)||this.distinctFields.push(n));return this.notify(),this}extent(...t){for(const n of t)typeof n=="string"&&(this.extentFields.includes(n)||this.extentFields.push(n));return this.notify(),this}groupByCount(t,n){return this.groupByCountSpec={field:t,...(n==null?void 0:n.bucket)!==void 0&&{bucket:n.bucket},...(n==null?void 0:n.limit)!==void 0&&{limit:n.limit},...(n==null?void 0:n.offset)!==void 0&&{offset:n.offset},...(n==null?void 0:n.search)!==void 0&&{search:n.search}},this.notify(),this}sort(t,n="asc"){return this.sorts=this.sorts.filter(r=>r.field!==t),this.sorts.push({field:t,direction:n}),this.notify(),this}sortDesc(t){return this.sort(t,"desc")}sortAsc(t){return this.sort(t,"asc")}sortDynamic(t,n){return this.sort(t,n)}page(t,n=25){return this.pagination={page:t,size:n},this.notify(),this}notify(){this.version++,this.snapshot=null;for(const t of this.listeners)t()}getVersion(){return this.version}build(){const t=[];for(const r of this.conditions)t.push({field:r.field,operator:r.operator,value:r.value});for(const r of this.groups){const s=r.conditions.map(o=>({field:o.field,operator:o.operator,value:o.value}));r.type==="OR"?t.push({field:"",operator:"equals",value:void 0,OR:s}):t.push({field:"",operator:"equals",value:void 0,AND:s})}const n={...this.extra,filter:{where:t}};return this.includes.length>0&&(n.include=[...this.includes]),this.searchTerm!==void 0&&(n.search=this.searchTerm),this.sorts.length>0&&(n.sort=[...this.sorts]),this.distinctFields.length>0&&(n.distinct=[...this.distinctFields]),this.extentFields.length>0&&(n.extent=[...this.extentFields]),this.groupByCountSpec!==void 0&&(n.groupByCount={...this.groupByCountSpec}),this.pagination!==void 0&&(n.paginate={...this.pagination}),n}toQueryString(){const t=[];let n;if(this.groups.length===0){const s=this.toFlatObject();n=Vo(Object.fromEntries(Object.entries(s).map(([o,i])=>[`filter[${o}]`,i])))}else n=uS(this.build().filter.where);if(n&&t.push(n),this.includes.length>0&&t.push(`include=${encodeURIComponent(this.includes.join(","))}`),this.searchTerm!==void 0&&t.push(`search=${encodeURIComponent(this.searchTerm)}`),this.sorts.length>0){const s=this.sorts.map(o=>o.direction==="desc"?`-${o.field}`:o.field).join(",");t.push(`sort=${encodeURIComponent(s)}`)}this.distinctFields.length>0&&t.push(`distinct=${encodeURIComponent(this.distinctFields.join(","))}`),this.extentFields.length>0&&t.push(`extent=${encodeURIComponent(this.extentFields.join(","))}`),this.pagination!==void 0&&(t.push(`page=${encodeURIComponent(String(this.pagination.page))}`),t.push(`size=${encodeURIComponent(String(this.pagination.size))}`));const r=Vo(this.extra);return r&&t.push(r),t.join("&")}toFlatObject(){const t={};for(const n of this.conditions)if(n.operator==="equals")t[n.field]=n.value;else if(n.operator==="in")t[n.field]=n.value;else{const r=t[n.field];r!=null&&typeof r=="object"&&!Array.isArray(r)?r[n.operator]=n.value:t[n.field]={[n.operator]:n.value}}return t}}function AI(){return new Su}const zI={eq:"equals",ne:"notEquals",gt:"gt",gte:"gte",lt:"lt",lte:"lte",in:"in"};function Xx(e){return e==="true"?!0:e==="false"?!1:e!==""&&!Number.isNaN(Number(e))?Number(e):e}function ic(e,t={},n){const r=AI(),s=(i,l)=>{if(l!==void 0){if(Array.isArray(l)){if(l.length===0)return;l.length===1?r.where(i,"equals",l[0]):r.where(i,"in",l);return}l!==""&&r.where(i,"equals",l)}};s("status",e.status),s("workflow",e.workflow),s("tag",e.tag),s("namespace",e.namespace),e.origin===null?r.where("origin","isNull",!0):e.origin&&r.where("origin","equals",e.origin);for(const i of e.attr??[]){const[l,a,...c]=i.split(":"),u=a?zI[a]:void 0;if(!l||!u||c.length===0)continue;const f=c.join(":");r.where(`attr.${l}`,u,a==="in"?f.split("|").filter(Boolean).map(Xx):Xx(f))}const o=r.build();return bI({...o,filter:{...o.filter,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset}},...n&&{groupByCount:n}})}function DI(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function ag(e){const t=new Map,n=[];for(const s of e){const o=s.subId??s.name??s.process;if(o===void 0){n.push(s);continue}const i=t.get(o),l=i??{id:o,name:s.name??o,phases:[],logs:[]};i||t.set(o,l),s.name!==void 0&&(l.name=s.name),s.group!==void 0&&(l.group=s.group),s.status!==void 0?(l.terminal=s,l.status=s.status):s.phase!==void 0?l.phases.push(s):l.logs.push(s)}return{subs:[...t.values()].map(s=>{var u;const o=[...s.phases,...s.logs],i=[...o,...s.terminal?[s.terminal]:[]].map(f=>f.at),l=i.length?i.reduce((f,h)=>h<f?h:f,Number.POSITIVE_INFINITY):void 0,c=DI((u=s.terminal)==null?void 0:u.data)??(s.terminal&&l!==void 0&&o.length>0?s.terminal.at-l:void 0);return{...s,startedAt:l,durationMs:c}}),stepLogs:n}}const dS={kind:"all"},gd="app";function Hi(e){const t=e==null?void 0:e.trim();return t||void 0}function $I(e){return Hi(e)===void 0}function Ca(e){const t=Hi(e);if(t===void 0)return gd;const n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)||t}function FI(e,t){return e.kind!==t.kind?!1:e.kind==="origin"&&t.kind==="origin"?e.origin===t.origin:!0}function fS(e){return e.kind==="origin"?`origin:${e.origin}`:e.kind}function LI(e,t){if(t.kind==="all")return!0;const n=Hi(e.origin);return t.kind==="unknown"?n===void 0:n===t.origin}const cg="The app's own workflows: runs with no package origin, i.e. not declared by any library (e.g. registerRemote, convention routing, or runs from before origins were stamped).";function HI(e){const t=new Map;let n=0,r=0;for(const o of e){r+=o.count;const i=Hi(o.origin??void 0);if(i===void 0){n+=o.count;continue}t.set(i,(t.get(i)??0)+o.count)}const s=[{filter:dS,label:"all",title:"Every origin, including runs that have none",count:r}];for(const o of[...t.keys()].sort())s.push({filter:{kind:"origin",origin:o},label:Ca(o),title:o,count:t.get(o)??0});return n>0&&s.push({filter:{kind:"unknown"},label:gd,title:cg,count:n}),s}function BI(e){return e.some(t=>t.filter.kind==="origin")}function VI(e){return e.reduce((t,n)=>t+($I(n.origin??void 0)?n.count:0),0)}function WI(e){return e.anyFilter?e.origin.kind==="unknown"?{message:e.unknownCount>0?"No app runs match the other filters.":"Every run here comes from a package — none are the app's own."}:e.origin.kind==="origin"&&e.unknownCount>0?{message:`No runs from ${Ca(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:"No runs match these filters."}:{message:"No runs yet."}}const Zx="compensate:";function UI(e){return e.startsWith(Zx)?e.slice(Zx.length):e}function qI(e){const t=[],n=[];for(const r of e)r.seq<0?n.push(r):t.push(r);return n.sort((r,s)=>s.seq-r.seq),{body:t,compensations:n}}function KI(e){let t=0,n=0,r=0;for(const s of e)s.status==="completed"?t++:s.status==="failed"?n++:r++;return{total:e.length,done:t,failed:n,pending:r}}const YI=10*60*1e3;function GI(e,t){if(e.kind!=="remote"||e.status!=="pending")return!1;const n=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return t-n>YI}const hS=["running","suspended","cancelling"],QI=new Set(hS);function xp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function If(e,t){const n=xp(e),r=t.filter(i=>xp(i.group)===n),s=r.some(i=>i.depth>0),o=r.some(i=>i.liveWorkers.length>0);return s&&!o}function XI(e){var n;const t=(n=e.match(/^runwait:(.+)#[^#]*#\d+$/))==null?void 0:n[1];return t?`run ${t}`:e.startsWith("wh:")?`webhook ${e}`:e.startsWith("child:")?`child ${e.slice(6)}`:`signal ${e}`}function ZI(e,t){var s;const n=(s=e.tags)==null?void 0:s.find(o=>o.startsWith("singleton:"));return n?t.filter(o=>{var i;return QI.has(o.status)&&((i=o.tags)==null?void 0:i.includes(n))}).sort((o,i)=>o.createdAt.localeCompare(i.createdAt)||o.id.localeCompare(i.id))[0]:void 0}function JI(e){return`${e.on} ${e.name}`}function pS(e,t){var s,o;if(e.status!=="suspended")return e.status==="pending"&&If(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:e.status==="blocked"?{status:"no-worker",detail:e.workflow}:{status:e.status};const n=ZI(e,t.runs);if(n&&n.id!==e.id)return{status:"queued",detail:`behind leader ${n.id.slice(0,8)}`};const r=(s=t.timeline)==null?void 0:s.find(i=>i.status==="pending"||i.status==="running");if(r){if(r.name.startsWith(`signal:child:${e.id}.onError.`)){const i=(o=r.input)==null?void 0:o.workflow;return{status:"awaiting",detail:typeof i=="string"?`failure handler ${i}`:"failure handler"}}return r.kind==="signal"?{status:"awaiting",detail:XI(r.name)}:r.kind==="sleep"?{status:"sleeping"}:r.workerGroup&&If(r.workerGroup,t.health)?{status:"no-worker",detail:xp(r.workerGroup)}:{status:"running"}}return e.waiting?{status:"awaiting",detail:JI(e.waiting)}:If(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:{status:"running"}}function ej(e,t){return e.status!=="suspended"?e.status:t!=null&&t.some(n=>n.status==="pending"||n.status==="running")?"running":e.wakeAt!=null?"sleeping":t?"awaiting":"running"}function tj(){return typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}function mS(){return typeof window<"u"&&window.__DURABLE_API__?window.__DURABLE_API__:`${tj()}/api`}const yp=new Set;function Y6(e){return yp.add(e),()=>yp.delete(e)}class nj extends Error{constructor(t){super(t===401?"Not signed in to the console.":"No access to the console."),this.status=t,this.name="ConsoleAccessError"}}async function rj(e){const t=e.status,n=await e.json().catch(()=>{});if(t===401&&typeof(n==null?void 0:n.redirectTo)=="string"&&typeof window<"u")window.location.href=n.redirectTo;else for(const r of yp)r({status:t});throw new nj(t)}async function ft(e,t){const n=await fetch(mS()+e,t);if(n.status===401||n.status===403)return rj(n);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const $e={runs(e,t,n,r){const s=ic({status:e??(r==null?void 0:r.statuses),tag:t,attr:n,namespace:r==null?void 0:r.namespace,origin:r==null?void 0:r.origin},{limit:r==null?void 0:r.limit,offset:r==null?void 0:r.offset});return ft(s?`/runs?${s}`:"/runs")},facets(e,t,n){const r=ic({tag:e,attr:t,namespace:n});return ft(r?`/runs/facets?${r}`:"/runs/facets")},values(e,t={},n){var s;const r=ic(t,{},{field:e,...(n==null?void 0:n.limit)&&{limit:n.limit},...(n==null?void 0:n.offset)&&{offset:n.offset},...((s=n==null?void 0:n.search)==null?void 0:s.trim())&&{search:n.search.trim()}});return ft(`/runs/values?${r}`)},run(e){return ft(`/runs/${encodeURIComponent(e)}`)},fanMembers(e,t,n={}){const r=new URLSearchParams;n.offset!==void 0&&r.set("offset",String(n.offset)),n.limit!==void 0&&r.set("limit",String(n.limit)),n.failed&&r.set("failed","true");const s=r.toString(),o=`/runs/${encodeURIComponent(e)}/fans/${encodeURIComponent(t)}`;return ft(s?`${o}?${s}`:o)},workers(){return ft("/workers")},schedules(){return ft("/schedules")},pauseSchedule(e){return ft(`/schedules/${encodeURIComponent(e)}/pause`,{method:"POST"})},resumeSchedule(e){return ft(`/schedules/${encodeURIComponent(e)}/resume`,{method:"POST"})},triggerSchedule(e){return ft(`/schedules/${encodeURIComponent(e)}/trigger`,{method:"POST"})},topology(){return ft("/topology")},retry(e){return ft(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},retryWithInput(e,t){return ft(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})},bulk(e,t){const n=ic(t);return ft(`/bulk/${e}${n?`?${n}`:""}`,{method:"POST"})},cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return ft(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})},workflowLifecycle(e){return ft(`/workflows/${encodeURIComponent(e)}/lifecycle`)},republishLifecycle(e,t){return ft(`/runs/${encodeURIComponent(e)}/republish-lifecycle`,{method:"POST",...t!==void 0?{headers:{"Content-Type":"application/json"},body:JSON.stringify({subscriber:t})}:{}})},continue(e){return ft(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})},redispatch(e){return ft(`/runs/${encodeURIComponent(e)}/redispatch`,{method:"POST"})},streamRun(e,t){const n=new EventSource(`${mS()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}},sj=200;class oj{constructor(t=sj){ge(this,"events",[]);ge(this,"pushed",0);ge(this,"listeners",new Set);ge(this,"snapshot",()=>this.events);ge(this,"subscribe",t=>(this.listeners.add(t),()=>this.listeners.delete(t)));this.limit=t}push(t){this.pushed+=1;const n=[...this.events,{id:this.pushed,event:t}];this.events=n.length>this.limit?n.slice(n.length-this.limit):n;for(const r of this.listeners)r()}}function ku(e){const t=e.lastIndexOf("@");return t===-1?"default":e.slice(t+1)}function Eu(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function ij(e){const t=new Map;for(const r of e){const s=ku(r.group),o=t.get(s);o?o.push(r):t.set(s,[r])}return[...t.entries()].map(([r,s])=>{const o=new Set;let i=0,l=0;for(const a of s){i+=a.depth,a.depth>0&&a.liveWorkers.length===0&&(l+=1);for(const c of a.liveWorkers)o.add(c.instanceId)}return{partition:r,workerCount:o.size,handlerCount:s.length,totalDepth:i,starvedCount:l}}).sort((r,s)=>r.partition==="default"?-1:s.partition==="default"?1:r.partition.localeCompare(s.partition))}function lj(e,t){if(!e)return t;const n=new Map(e.timeline.map(r=>[r.seq,r]));return{...t,timeline:t.timeline.map(r=>{var o,i;if((r.status==="pending"||r.status==="running")&&(((o=r.events)==null?void 0:o.length)??0)===0){const l=(i=n.get(r.seq))==null?void 0:i.events;if(l!=null&&l.length)return{...r,events:l}}return r})}}function aj(e,t,n){if(!e)return e;const r=e.timeline.findIndex(i=>i.seq===t),s=e.timeline[r];if(s===void 0)return e;const o=[...e.timeline];return o[r]={...s,events:[...s.events??[],n]},{...e,timeline:o}}function cj(e){var n,r;const t=new Map;for(const s of e)for(const o of s.liveWorkers){const i=Eu(o.group),l=t.get(o.instanceId);if(l===void 0){t.set(o.instanceId,{instanceId:o.instanceId,partition:ku(o.group),runtime:(n=o.status)==null?void 0:n.runtime,handlers:new Set([i]),status:o.status,lastBeatAt:o.lastBeatAt});continue}l.handlers.add(i),o.lastBeatAt>=l.lastBeatAt&&(l.lastBeatAt=o.lastBeatAt,l.partition=ku(o.group),l.runtime=(r=o.status)==null?void 0:r.runtime,l.status=o.status)}return[...t.values()].map(s=>({instanceId:s.instanceId,partition:s.partition,runtime:s.runtime,handlers:[...s.handlers].sort((o,i)=>o.localeCompare(i)),status:s.status,lastBeatAt:s.lastBeatAt})).sort((s,o)=>s.partition!==o.partition?s.partition==="default"?-1:o.partition==="default"?1:s.partition.localeCompare(o.partition):s.instanceId.localeCompare(o.instanceId))}function uj(e){const t=new Set,n=new Set;for(const r of e){if(r.kind!=="workflow")continue;const s=Eu(r.group);r.depth>0&&t.add(s),r.liveWorkers.length>0&&n.add(s)}return[...t].filter(r=>!n.has(r)).sort()}function dj(e){const t=new Set,n=new Set,r=new Set;for(const o of e){for(const i of o.liveWorkers)t.add(i.instanceId);o.kind==="workflow"?n.add(Eu(o.group)):o.kind==="step"&&r.add(Eu(o.group))}const s=e.filter(o=>o.depth>0&&o.liveWorkers.length===0).sort((o,i)=>i.depth-o.depth);return{queueCount:e.length,workflowCount:n.size,stepCount:r.size,workerCount:t.size,starved:s,allDraining:s.length===0}}function fj(e,t,n=Date.now){let r=Number.NEGATIVE_INFINITY,s;const o=()=>{s=void 0,r=n(),e()};return{call(){if(s!==void 0)return;const i=r+t-n();i<=0?o():s=setTimeout(o,i)},cancel(){s!==void 0&&clearTimeout(s),s=void 0}}}const Wn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function gS(e){return d.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[d.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),d.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function hj(e){return d.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"9"}),d.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function pj(e){return d.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"13",r:"8"}),d.jsx("path",{d:"M12 13V9M9 2h6"})]})}function mj(e){return d.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"2"}),d.jsx("path",{d:"M7.8 7.8a6 6 0 0 0 0 8.4M16.2 16.2a6 6 0 0 0 0-8.4M5 5a10 10 0 0 0 0 14M19 19a10 10 0 0 0 0-14"})]})}function ug(e){return d.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:d.jsx("path",{d:"m4 12 5 5L20 6"})})}function Ss(e){return d.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:d.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function gj(e){return d.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[d.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function jf(e){return d.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:d.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function Cu(e){return d.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:d.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function xj(e){return d.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:d.jsx("path",{d:"M6 4l14 8-14 8z"})})}function dg(e){return d.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[d.jsx("circle",{cx:"6",cy:"5",r:"2"}),d.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),d.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const yj={local:gS,remote:hj,sleep:pj,signal:mj,child:dg};function fg(e){return yj[e]??gS}const vp={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function xS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=xS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=xS(e))&&(r&&(r+=" "),r+=t);return r}const Jx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ey=yS,vS=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ey(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const u=n==null?void 0:n[c],f=o==null?void 0:o[c];if(u===null)return null;const h=Jx(u)||Jx(f);return s[c][h]}),l=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...p}=u;return Object.entries(p).every(v=>{let[x,b]=v;return Array.isArray(b)?b.includes({...o,...l}[x]):{...o,...l}[x]===b})?[...c,f,h]:c},[]);return ey(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},vj=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},wj=(e,t)=>({classGroupId:e,validator:t}),wS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Nu="-",ty=[],bj="arbitrary..",Sj=e=>{const t=Ej(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return kj(i);const l=i.split(Nu),a=l[0]===""&&l.length>1?1:0;return bS(l,a,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const a=r[i],c=n[i];return a?c?vj(c,a):a:c||ty}return n[i]||ty}}},bS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const c=bS(e,t+1,o);if(c)return c}const i=n.validators;if(i===null)return;const l=t===0?e.join(Nu):e.slice(t).join(Nu),a=i.length;for(let c=0;c<a;c++){const u=i[c];if(u.validator(l))return u.classGroupId}},kj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?bj+r:void 0})(),Ej=e=>{const{theme:t,classGroups:n}=e;return Cj(n,t)},Cj=(e,t)=>{const n=wS();for(const r in e){const s=e[r];hg(s,n,r,t)}return n},hg=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];Nj(i,t,n,r)}},Nj=(e,t,n,r)=>{if(typeof e=="string"){Rj(e,t,n);return}if(typeof e=="function"){Tj(e,t,n,r);return}Pj(e,t,n,r)},Rj=(e,t,n)=>{const r=e===""?t:SS(t,e);r.classGroupId=n},Tj=(e,t,n,r)=>{if(Ij(e)){hg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(wj(n,e))},Pj=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[l,a]=s[i];hg(a,SS(t,l),n,r)}},SS=(e,t)=>{let n=e;const r=t.split(Nu),s=r.length;for(let o=0;o<s;o++){const i=r[o];let l=n.nextPart.get(i);l||(l=wS(),n.nextPart.set(i,l)),n=l}return n},Ij=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,jj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},wp="!",ny=":",Oj=[],ry=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),_j=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,l=0,a=0,c;const u=s.length;for(let x=0;x<u;x++){const b=s[x];if(i===0&&l===0){if(b===ny){o.push(s.slice(a,x)),a=x+1;continue}if(b==="/"){c=x;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const f=o.length===0?s:s.slice(a);let h=f,p=!1;f.endsWith(wp)?(h=f.slice(0,-1),p=!0):f.startsWith(wp)&&(h=f.slice(1),p=!0);const v=c&&c>a?c-a:void 0;return ry(o,p,h,v)};if(t){const s=t+ny,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):ry(Oj,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},Mj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const i=n[o],l=i[0]==="[",a=t.has(i);l||a?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},Aj=e=>({cache:jj(e.cacheSize),parseClassName:_j(e),sortModifiers:Mj(e),postfixLookupClassGroupIds:zj(e),...Sj(e)}),zj=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Dj=/\s+/,$j=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],a=e.trim().split(Dj);let c="";for(let u=a.length-1;u>=0;u-=1){const f=a[u],{isExternal:h,modifiers:p,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:b}=n(f);if(h){c=f+(c.length>0?" "+c:c);continue}let g=!!b,m;if(g){const E=x.substring(0,b);m=r(E);const C=m&&i[m]?r(x):void 0;C&&C!==m&&(m=C,g=!1)}else m=r(x);if(!m){if(!g){c=f+(c.length>0?" "+c:c);continue}if(m=r(x),!m){c=f+(c.length>0?" "+c:c);continue}g=!1}const y=p.length===0?"":p.length===1?p[0]:o(p).join(":"),w=v?y+wp:y,k=w+m;if(l.indexOf(k)>-1)continue;l.push(k);const N=s(m,g);for(let E=0;E<N.length;++E){const C=N[E];l.push(w+C)}c=f+(c.length>0?" "+c:c)}return c},Fj=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=kS(n))&&(s&&(s+=" "),s+=r);return s},kS=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=kS(e[r]))&&(n&&(n+=" "),n+=t);return n},Lj=(e,...t)=>{let n,r,s,o;const i=a=>{const c=t.reduce((u,f)=>f(u),e());return n=Aj(c),r=n.cache.get,s=n.cache.set,o=l,l(a)},l=a=>{const c=r(a);if(c)return c;const u=$j(a,n);return s(a,u),u};return o=i,(...a)=>o(Fj(...a))},Hj=[],ht=e=>{const t=n=>n[e]||Hj;return t.isThemeGetter=!0,t},ES=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,CS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Vj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wj=/\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$/,Uj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Kj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vr=e=>Bj.test(e),be=e=>!!e&&!Number.isNaN(Number(e)),Qn=e=>!!e&&Number.isInteger(Number(e)),Of=e=>e.endsWith("%")&&be(e.slice(0,-1)),ur=e=>Vj.test(e),NS=()=>!0,Yj=e=>Wj.test(e)&&!Uj.test(e),pg=()=>!1,Gj=e=>qj.test(e),Qj=e=>Kj.test(e),Xj=e=>!ie(e)&&!le(e),Zj=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)),Jj=e=>Is(e,PS,pg),ie=e=>ES.test(e),Os=e=>Is(e,IS,Yj),sy=e=>Is(e,l2,be),e2=e=>Is(e,OS,NS),t2=e=>Is(e,jS,pg),oy=e=>Is(e,RS,pg),n2=e=>Is(e,TS,Qj),lc=e=>Is(e,_S,Gj),le=e=>CS.test(e),nl=e=>vo(e,IS),r2=e=>vo(e,jS),iy=e=>vo(e,RS),s2=e=>vo(e,PS),o2=e=>vo(e,TS),ac=e=>vo(e,_S,!0),i2=e=>vo(e,OS,!0),Is=(e,t,n)=>{const r=ES.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},vo=(e,t,n=!1)=>{const r=CS.exec(e);return r?r[1]?t(r[1]):n:!1},RS=e=>e==="position"||e==="percentage",TS=e=>e==="image"||e==="url",PS=e=>e==="length"||e==="size"||e==="bg-size",IS=e=>e==="length",l2=e=>e==="number",jS=e=>e==="family-name",OS=e=>e==="number"||e==="weight",_S=e=>e==="shadow",a2=()=>{const e=ht("color"),t=ht("font"),n=ht("text"),r=ht("font-weight"),s=ht("tracking"),o=ht("leading"),i=ht("breakpoint"),l=ht("container"),a=ht("spacing"),c=ht("radius"),u=ht("shadow"),f=ht("inset-shadow"),h=ht("text-shadow"),p=ht("drop-shadow"),v=ht("blur"),x=ht("perspective"),b=ht("aspect"),g=ht("ease"),m=ht("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...w(),le,ie],N=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],C=()=>[le,ie,a],P=()=>[Vr,"full","auto",...C()],I=()=>[Qn,"none","subgrid",le,ie],z=()=>["auto",{span:["full",Qn,le,ie]},Qn,le,ie],$=()=>[Qn,"auto",le,ie],A=()=>["auto","min","max","fr",le,ie],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...C()],F=()=>[Vr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],T=()=>[Vr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],M=()=>[Vr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],_=()=>[e,le,ie],U=()=>[...w(),iy,oy,{position:[le,ie]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",s2,Jj,{size:[le,ie]}],W=()=>[Of,nl,Os],q=()=>["","none","full",c,le,ie],H=()=>["",be,nl,Os],G=()=>["solid","dashed","dotted","double"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[be,Of,iy,oy],Q=()=>["","none",v,le,ie],Z=()=>["none",be,le,ie],V=()=>["none",be,le,ie],X=()=>[be,le,ie],ee=()=>[Vr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ur],breakpoint:[ur],color:[NS],container:[ur],"drop-shadow":[ur],ease:["in","out","in-out"],font:[Xj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ur],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ur],shadow:[ur],spacing:["px",be],text:[ur],"text-shadow":[ur],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vr,ie,le,b]}],container:["container"],"container-type":[{"@container":["","normal","size",le,ie]}],"container-named":[Zj],columns:[{columns:[be,ie,le,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Qn,"auto",le,ie]}],basis:[{basis:[Vr,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[be,Vr,"auto","initial","none",ie]}],grow:[{grow:["",be,le,ie]}],shrink:[{shrink:["",be,le,ie]}],order:[{order:[Qn,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[l,"screen",...F()]}],"min-w":[{"min-w":[l,"screen","none",...F()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,nl,Os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,i2,e2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Of,ie]}],"font-family":[{font:[r2,t2,t]}],"font-features":[{"font-features":[ie]}],"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:[s,le,ie]}],"line-clamp":[{"line-clamp":[be,"none",le,sy]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",le,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[be,"from-font","auto",le,Os]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[be,"auto",le,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Qn,le,ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ie]}],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",le,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qn,le,ie],radial:["",le,ie],conic:[Qn,le,ie]},o2,n2]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[be,le,ie]}],"outline-w":[{outline:["",be,nl,Os]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",u,ac,lc]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",f,ac,lc]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[be,Os]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",h,ac,lc]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[be,le,ie]}],"mix-blend":[{"mix-blend":[...B(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":B()}],"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":[be]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[le,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[be]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:Q()}],brightness:[{brightness:[be,le,ie]}],contrast:[{contrast:[be,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",p,ac,lc]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",be,le,ie]}],"hue-rotate":[{"hue-rotate":[be,le,ie]}],invert:[{invert:["",be,le,ie]}],saturate:[{saturate:[be,le,ie]}],sepia:[{sepia:["",be,le,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ie]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[be,le,ie]}],"backdrop-contrast":[{"backdrop-contrast":[be,le,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",be,le,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[be,le,ie]}],"backdrop-invert":[{"backdrop-invert":["",be,le,ie]}],"backdrop-opacity":[{"backdrop-opacity":[be,le,ie]}],"backdrop-saturate":[{"backdrop-saturate":[be,le,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",be,le,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[be,"initial",le,ie]}],ease:[{ease:["linear","initial",g,le,ie]}],delay:[{delay:[be,le,ie]}],animate:[{animate:["none",m,le,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,le,ie]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:X()}],"skew-x":[{"skew-x":X()}],"skew-y":[{"skew-y":X()}],transform:[{transform:[le,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],zoom:[{zoom:[Qn,le,ie]}],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",le,ie]}],"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":_()}],"scrollbar-track-color":[{"scrollbar-track":_()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",le,ie]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[be,nl,Os,sy]}],stroke:[{stroke:["none",..._()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},c2=Lj(a2);function st(...e){return c2(yS(e))}const MS=vS("inline-flex items-center gap-1.5 rounded border px-1.5 text-[10px] leading-relaxed",{variants:{variant:{outline:"border-line bg-zinc-800/40 text-zinc-400",tenant:"border-sky-500/30 bg-sky-500/10 text-sky-300",origin:"border-teal-500/30 bg-teal-500/10 text-teal-300","origin-unknown":"border-line bg-zinc-800/40 italic text-zinc-500",attr:"border-indigo-500/30 bg-indigo-500/10 text-indigo-300",danger:"border-rose-500/40 bg-rose-500/10 text-rose-300",warn:"border-warn/40 bg-warn/10 text-warn",status:"border-transparent px-0 uppercase tracking-wider"}},defaultVariants:{variant:"outline"}}),Xe=S.forwardRef(({className:e,variant:t,...n},r)=>d.jsx("span",{ref:r,className:st(MS({variant:t}),e),...n}));Xe.displayName="Badge";const u2=vS("inline-flex items-center justify-center gap-1.5 rounded-md border font-medium transition-colors disabled:pointer-events-none disabled:opacity-30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",{variants:{variant:{outline:"border-line text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100",ghost:"border-transparent text-zinc-500 hover:text-zinc-200",quiet:"border-line text-zinc-500 hover:text-zinc-200",brand:"border-brand/30 bg-brand/10 text-brand hover:bg-brand/20",warn:"border-warn/40 bg-warn/10 text-warn hover:bg-warn/20",info:"border-sky-500/30 bg-sky-500/10 text-sky-300 hover:bg-sky-500/20",alt:"border-indigo-500/30 bg-indigo-500/10 text-indigo-300 hover:bg-indigo-500/20",danger:"border-rose-500/30 bg-rose-500/10 text-rose-300 hover:bg-rose-500/20",chip:"border-line bg-zinc-800/40 text-zinc-400 hover:border-zinc-500"},size:{sm:"px-3 py-1.5 text-xs uppercase tracking-wide",xs:"px-1.5 py-0.5 text-[10px]",chip:"px-2.5 py-1 text-xs",icon:"h-7 w-7 shrink-0 p-0"}},defaultVariants:{variant:"outline",size:"sm"}}),Se=S.forwardRef(({className:e,variant:t,size:n,type:r,...s},o)=>d.jsx("button",{ref:o,type:r??"button",className:st(u2({variant:t,size:n}),e),...s}));Se.displayName="Button";const mg=S.forwardRef(({className:e,...t},n)=>d.jsx("input",{ref:n,className:st("mono w-full bg-transparent py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none disabled:opacity-50",e),...t}));mg.displayName="Input";const ly={};function Pn(e,t){const n=S.useRef(ly);return n.current===ly&&(n.current=e(t)),n}const bp=[];let Sp;function d2(){return Sp}function f2(e){bp.push(e)}function xd(e){const t=(n,r)=>{const s=Pn(h2).current;let o;try{Sp=s;for(const i of bp)i.before(s);o=e(n,r);for(const i of bp)i.after(s);s.didInitialize=!0}finally{Sp=void 0}return o};return t.displayName=e.displayName||e.name,t}function AS(e){return S.forwardRef(xd(e))}function h2(){return{didInitialize:!1}}function gg(){}const Gl=Object.freeze([]),kt=Object.freeze({});function xg(e){S.useEffect(e,Gl)}const rl=0;class In{constructor(){ge(this,"currentId",rl);ge(this,"clear",()=>{this.currentId!==rl&&(clearTimeout(this.currentId),this.currentId=rl)});ge(this,"disposeEffect",()=>this.clear)}static create(){return new In}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=rl,n()},t)}isStarted(){return this.currentId!==rl}}function Mr(){const e=Pn(In.create).current;return xg(e.disposeEffect),e}const p2=()=>{},fe=typeof document<"u"?S.useLayoutEffect:p2;function m2(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:g2,platform:x2,maxTouchPoints:y2}=m2(),yd=g2.toLowerCase(),Ql=x2.toLowerCase(),vd=/^i(os$|p)/.test(Ql)||Ql==="macintel"&&y2>1,ay="android",kp=Ql===ay||yd.includes(ay),zS=!vd&&Ql.startsWith("mac");Ql.startsWith("win");const v2=zS||vd;var Tw;const wo=typeof CSS<"u"&&!!((Tw=CSS.supports)!=null&&Tw.call(CSS,"-webkit-backdrop-filter:none"));!wo&&yd.includes("firefox");!wo&&yd.includes("chrom");const w2=v2,DS=/jsdom|happydom/.test(yd);function b2(e){e.preventDefault(),e.stopPropagation()}function S2(e){return"nativeEvent"in e}function $S(e){return e.pointerType===""&&e.isTrusted?!0:kp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function FS(e){return DS?!1:!kp&&e.width===0&&e.height===0||kp&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ys(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function k2(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function wd(){return typeof window<"u"}function Nt(e){return yg(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $r(e){var t;return(t=(yg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yg(e){return wd()?e instanceof Node||e instanceof ot(e).Node:!1}function Ce(e){return wd()?e instanceof Element||e instanceof ot(e).Element:!1}function Ve(e){return wd()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function Ci(e){return!wd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function Na(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=fn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function E2(e){return/^(table|td|th)$/.test(Nt(e))}function bd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const C2=/transform|translate|scale|rotate|perspective|filter/,N2=/paint|layout|strict|content/,_s=e=>!!e&&e!=="none";let _f;function vg(e){const t=Ce(e)?fn(e):e;return _s(t.transform)||_s(t.translate)||_s(t.scale)||_s(t.rotate)||_s(t.perspective)||!wg()&&(_s(t.backdropFilter)||_s(t.filter))||C2.test(t.willChange||"")||N2.test(t.contain||"")}function R2(e){let t=ks(e);for(;Ve(t)&&!vs(t);){if(vg(t))return t;if(bd(t))return null;t=ks(t)}return null}function wg(){return _f==null&&(_f=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_f}function vs(e){return/^(html|body|#document)$/.test(Nt(e))}function fn(e){return ot(e).getComputedStyle(e)}function Sd(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ks(e){if(Nt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ci(e)&&e.host||$r(e);return Ci(t)?t.host:t}function LS(e){const t=ks(e);return vs(t)?(e.ownerDocument||e).body:Ve(t)&&Na(t)?t:LS(t)}function Xl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=LS(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=ot(s);if(o){const l=Ep(i);return t.concat(i,i.visualViewport||[],Na(s)?s:[],l&&n?Xl(l):[])}else return t.concat(s,Xl(s,[],n))}function Ep(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vn(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function xe(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Ci(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Mt(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const Cp="data-base-ui-focusable",HS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",BS="data-starting-style",T2="data-ending-style",P2={[BS]:""},I2={[T2]:""},bg={transitionStatus(e){return e==="starting"?P2:e==="ending"?I2:null}},j2="data-open",O2="data-closed",_2="data-anchor-hidden",VS="data-popup-open",M2="data-pressed",A2={[VS]:""},z2={[VS]:"",[M2]:""},D2={[j2]:""},$2={[O2]:""},F2={[_2]:""},WS={open(e){return e?A2:null}},L2={open(e){return e?z2:null}},Sg={open(e){return e?D2:$2},anchorHidden(e){return e?F2:null}},kg={...Sg,...bg},Np="data-trigger-disabled";function Ru(e,t){if(!Ce(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(Np);for(const[,r]of t.entries())if(xe(r,n))return!r.hasAttribute(Np);return!1}function Mf(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function H2(e){return e.matches("html,body")}function kd(e){return Ve(e)&&e.matches(HS)}function B2(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${HS}`))!=null}function cy(e){return e?e.getAttribute("role")==="combobox"&&kd(e):!1}function V2(e){if(!e||DS)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function uy(e){return e?e.hasAttribute(Cp)?e:e.querySelector(`[${Cp}]`)||e:null}function W2(e,t){return t!=null&&!ys(t)?0:typeof e=="function"?e():e}function co(e,t,n){const r=W2(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function dy(e){return typeof e=="function"?e():e}function US(e,t){return t||e==="click"||e==="mousedown"}function U2(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const Ed="none",Es="trigger-press",St="trigger-hover",Hc="trigger-focus",qS="outside-press",KS="close-press",Zl="focus-out",Cd="escape-key",YS="disabled",fy="missing",hy="initial",Eg="imperative-action";function Me(e,t,n,r){let s=!1,o=!1;const i=r??kt;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}const GS=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new In,currentIdRef:{current:null},currentContextRef:{current:null}});function q2(e,t){e.current=t.current}function K2(e){const{children:t,delay:n,timeoutMs:r=0}=e,s=S.useRef(n),o=S.useRef(n),i=S.useRef(null),l=S.useRef(null),a=Mr();return fe(()=>{if(o.current=n,!i.current){s.current=n;return}s.current={open:co(s.current,"open"),close:co(n,"close")}},[n,i,s,o]),d.jsx(GS.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:a}),[r,a]),children:t})}function Y2(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),o=S.useContext(GS),{currentIdRef:i,delayRef:l,timeoutMs:a,initialDelayRef:c,currentContextRef:u,hasProvider:f,timeout:h}=o,[p,v]=S.useState(!1),x=S.useRef(n);return fe(()=>{x.current=n},[n]),fe(()=>{function b(){var g;(g=u.current)==null||g.setIsInstantPhase(!1),i.current=null,u.current=null,l.current=c.current,h.clear()}if(i.current&&!n&&i.current===s){if(v(!1),a){const g=s;return h.start(a,()=>{r.select("open")||i.current&&i.current!==g||b()}),()=>{(x.current||i.current!==g)&&h.clear()}}b()}},[n,s,i,l,a,c,u,h,r]),fe(()=>{if(!n)return;const b=u.current,g=i.current;h.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:v},i.current=s,l.current={open:0,close:co(c.current,"close")},g!==null&&g!==s?(v(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,Me(Ed))):(v(!1),b==null||b.setIsInstantPhase(!1))},[n,s,r,i,l,c,u,h]),fe(()=>()=>{if(i.current===s){if(u.current=null,!x.current)return;i.current=null,q2(l,c),h.clear()}},[u,i,l,s,c,h]),S.useMemo(()=>({activeIdRef:i,hasProvider:f,delayRef:l,isInstantPhase:p}),[i,f,l,p])}function ke(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ir(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ni(e,t,n,r){const s=Pn(QS).current;return Q2(s,e,t,n,r)&&XS(s,[e,t,n,r]),s.callback}function G2(e){const t=Pn(QS).current;return X2(t,e)&&XS(t,e),t.callback}function QS(){return{callback:null,cleanup:null,refs:[]}}function Q2(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function X2(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function XS(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}function Ht(e){const t=Pn(Z2,e).current;return t.next=e,fe(t.effect),t}function Z2(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Cg={...mR},Af=Cg.useInsertionEffect,J2=Af&&Af!==Cg.useLayoutEffect?Af:e=>e();function me(e){const t=Pn(eO).current;return t.next=e,J2(t.effect),t.trampoline}function eO(){const e={next:void 0,callback:tO,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function tO(){}const cc=null;class nO{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 s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let uc=new nO;class tr{constructor(){ge(this,"currentId",cc);ge(this,"cancel",()=>{this.currentId!==cc&&(uc.cancel(this.currentId),this.currentId=cc)});ge(this,"disposeEffect",()=>this.cancel)}static create(){return new tr}static request(t){return uc.request(t)}static cancel(t){return uc.cancel(t)}request(t){this.cancel(),this.currentId=uc.request(()=>{this.currentId=cc,t()})}}function Ng(){const e=Pn(tr.create).current;return xg(e.disposeEffect),e}function Fe(e){return(e==null?void 0:e.ownerDocument)||document}const rO={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},sO={...rO,position:"fixed",top:0,left:0},Ri=S.forwardRef(function(t,n){const[r,s]=S.useState();fe(()=>{w2&&wo&&s("button")},[]);const o={tabIndex:0,role:r};return d.jsx("span",{...t,ref:n,style:sO,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Ti=Math.min,Nr=Math.max,Tu=Math.round,dc=Math.floor,Rr=e=>({x:e,y:e}),oO={left:"right",right:"left",bottom:"top",top:"bottom"};function ZS(e,t,n){return Nr(e,Ti(t,n))}function Cs(e,t){return typeof e=="function"?e(t):e}function Nn(e){return e.split("-")[0]}function Ar(e){return e.split("-")[1]}function Rg(e){return e==="x"?"y":"x"}function Tg(e){return e==="y"?"height":"width"}function En(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Pg(e){return Rg(En(e))}function iO(e,t,n){n===void 0&&(n=!1);const r=Ar(e),s=Pg(e),o=Tg(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Pu(i)),[i,Pu(i)]}function lO(e){const t=Pu(e);return[Rp(e),t,Rp(t)]}function Rp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const py=["left","right"],my=["right","left"],aO=["top","bottom"],cO=["bottom","top"];function uO(e,t,n){switch(e){case"top":case"bottom":return n?t?my:py:t?py:my;case"left":case"right":return t?aO:cO;default:return[]}}function dO(e,t,n,r){const s=Ar(e);let o=uO(Nn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Rp)))),o}function Pu(e){const t=Nn(e);return oO[t]+e.slice(t.length)}function fO(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function JS(e){return typeof e!="number"?fO(e):{top:e,right:e,bottom:e,left:e}}function Iu(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function zf(e,t){return t<0||t>=e.length}function hO(e,t){return Rl(e.current,{disabledIndices:t})}function pO(e,t){return Rl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Rl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let o=t;do o+=n?-s:s;while(o>=0&&o<=e.length-1&&Tl(e,o,r));return o}function Tl(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const s=e[t];return s?!Ig(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function mO(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Ig(e,t=e?fn(e):null){return!e||!e.isConnected||!t||mO(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const gO='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function xO(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ci(n)?n.host:null}function Tp(e){for(const t of Array.from(e.children))if(Nt(t)==="summary")return t;return null}function yO(e,t){const n=Tp(t);return!!n&&(e===n||xe(n,e))}function ek(e){const t=e?Nt(e):"";return e!=null&&e.matches(gO)&&(t!=="summary"||e.parentElement!=null&&Nt(e.parentElement)==="details"&&Tp(e.parentElement)===e)&&(t!=="details"||Tp(e)==null)&&(t!=="input"||e.type!=="hidden")}function tk(e){if(!ek(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=xO(t)){const n=t!==e,r=Nt(t)==="slot";if(t.hasAttribute("inert")||n&&Nt(t)==="details"&&!t.open&&!yO(e,t)||t.hasAttribute("hidden")||!r&&!vO(t,n))return!1}return!0}function vO(e,t){const n=fn(e);return t?n.display!=="none":Ig(e,n)}function nk(e){const t=e.tabIndex;if(t<0){const n=Nt(e);if(n==="details"||n==="audio"||n==="video"||Ve(e)&&e.isContentEditable)return 0}return t}function Df(e){if(Nt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function wO(e,t){const n=Df(e);if(!n)return!0;const r=t.find(s=>{const o=Df(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=Df(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function rk(e){if(Ve(e)&&Nt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ve(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function sk(e,t){rk(e).forEach(n=>{ek(n)&&t.push(n),sk(n,t)})}function ok(e,t,n){rk(e).forEach(r=>{Ve(r)&&r.matches(t)&&n.push(r),ok(r,t,n)})}function jg(e){return tk(e)&&nk(e)>=0}function ik(e){const t=[];return sk(e,t),t.filter(tk)}function Ra(e){const t=ik(e);return t.filter(n=>nk(n)>=0&&wO(n,t))}function lk(e,t){const n=Ra(e),r=n.length;if(r===0)return;const s=vn(Fe(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function Og(e){return lk(Fe(e).body,1)||e}function ak(e){return lk(Fe(e).body,-1)||e}function ck(e,t){if(!e)return null;const n=Ra(Fe(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function bO(e){return ck(e,1)}function SO(e){return ck(e,-1)}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!xe(n,r)}function kO(e){Ra(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function gy(e){const t=[];ok(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ns(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var o;return[...!n||(o=s.context)!=null&&o.open?[s]:[],...Ns(e,s.id,n)]})}function xy(e,t){var s;let n=[],r=(s=e.find(o=>o.id===t))==null?void 0:s.parentId;for(;r;){const o=e.find(i=>i.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function Jl(e){return`data-base-ui-${e}`}let fc=0;function $f(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(fc);function o(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return o(),gg;const i=requestAnimationFrame(o);return fc=i,()=>{fc===i&&(cancelAnimationFrame(i),fc=0)}}const Ff={inert:new WeakMap,"aria-hidden":new WeakMap},yy="data-base-ui-inert",Pp={inert:new WeakSet,"aria-hidden":new WeakSet};let sl=new WeakMap,Lf=0;function EO(e){return Pp[e]}function uk(e){return e?Ci(e)?e.host:uk(e.parentNode):null}const vy=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=uk(n);return e.contains(r)?r:null}).filter(n=>n!=null),wy=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},by=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{Nt(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function CO(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,l=null;const a=vy(t,e),c=s?by(t,wy(a),new Set(a)):[],u=[],f=[];if(o){const h=Ff[o],p=EO(o);l=p,i=h;const v=vy(t,Array.from(t.querySelectorAll("[aria-live]"))),x=a.concat(v);by(t,wy(x),new Set(x)).forEach(g=>{const m=g.getAttribute(o),y=m!==null&&m!=="false",w=(h.get(g)||0)+1;h.set(g,w),u.push(g),w===1&&y&&p.add(g),y||g.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(h=>{const p=(sl.get(h)||0)+1;sl.set(h,p),f.push(h),p===1&&h.setAttribute(yy,"")}),Lf+=1,()=>{i&&u.forEach(h=>{const v=(i.get(h)||0)-1;i.set(h,v),v||(!(l!=null&&l.has(h))&&o&&h.removeAttribute(o),l==null||l.delete(h))}),s&&f.forEach(h=>{const p=(sl.get(h)||0)-1;sl.set(h,p),p||h.removeAttribute(yy)}),Lf-=1,Lf||(Ff.inert=new WeakMap,Ff["aria-hidden"]=new WeakMap,Pp.inert=new WeakSet,Pp["aria-hidden"]=new WeakSet,sl=new WeakMap)}}function Sy(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=Fe(e[0]).body;return CO(e,o,n,r,{mark:s})}let ky=0;function NO(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(ky+=1,r(`${t}-${ky}`))},[n,t]),s}const Ey=Cg.useId;function Nd(e,t){if(Ey!==void 0){const n=Ey();return e??(t?`${t}-${n}`:n)}return NO(e,t)}function RO(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(i=>o.searchParams.append("args[]",i)),`${t} error #${r}; visit ${o} for the full message.`}}const tn=RO("https://base-ui.com/production-error","Base UI"),TO=parseInt(S.version,10);function _g(e){return TO>=e}function Cy(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(_g(19)?n==null?void 0:n.ref:t.ref)??null}function Ip(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function PO(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function IO(e,t){return typeof e=="function"?e(t):e}function jO(e,t){return typeof e=="function"?e(t):e}const Mg={};function Rd(e,t,n,r,s){if(!n&&!r&&!e)return ju(t);let o=ju(e);return t&&(o=Bc(o,t)),n&&(o=Bc(o,n)),r&&(o=Bc(o,r)),o}function OO(e){if(e.length===0)return Mg;if(e.length===1)return ju(e[0]);let t=ju(e[0]);for(let n=1;n<e.length;n+=1)t=Bc(t,e[n]);return t}function ju(e){return Ag(e)?{...fk(e,Mg)}:_O(e)}function Bc(e,t){return Ag(t)?fk(t,e):MO(e,t)}function _O(e){const t={...e};for(const n in t){const r=t[n];dk(n,r)&&(t[n]=hk(r))}return t}function MO(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Ip(e.style,r);break}case"className":{e[n]=pk(e.className,r);break}default:dk(n,r)?e[n]=AO(e[n],r):e[n]=r}}return e}function dk(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Ag(e){return typeof e=="function"}function fk(e,t){return Ag(e)?e(t):e??Mg}function AO(e,t){return t?e?(...n)=>{const r=n[0];if(mk(r)){const o=r;Ou(o);const i=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),i}const s=t(...n);return e==null||e(...n),s}:hk(t):e}function hk(e){return e&&((...t)=>{const n=t[0];return mk(n)&&Ou(n),e(...t)})}function Ou(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function pk(e,t){return t?e?t+" "+e:t:e}function mk(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ut(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=FO(r));const s=zO(t,n,r);if(n.enabled===!1)return null;const o=n.state??kt;return LO(e,r,s,o)}function zO(e,t,n){const{className:r,style:s}=e,{state:o=kt,ref:i,props:l,stateAttributesMapping:a,enabled:c=!0}=t,u=c?IO(r,o):void 0,f=c?jO(s,o):void 0,h=c?PO(o,a):kt,p=c&&l?DO(l):void 0,v=c?Ip(h,p)??{}:kt;return typeof document<"u"&&(c?Array.isArray(i)?v.ref=G2([v.ref,Cy(n),...i]):v.ref=Ni(v.ref,Cy(n),i):Ni(null,null)),c?(u!==void 0&&(v.className=pk(v.className,u)),f!==void 0&&(v.style=Ip(v.style,f)),v):kt}function DO(e){return Array.isArray(e)?OO(e):Rd(void 0,e)}const $O=Symbol.for("react.lazy");function FO(e){if((e==null?void 0:e.$$typeof)!==$O)return e;const t=S.Children.toArray(e)[0];return S.isValidElement(t)?t:e}function LO(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Rd(n,t.props);return s.ref=n.ref,S.cloneElement(t,s)}if(e&&typeof e=="string")return HO(e,n);throw new Error(tn(8))}function HO(e,t){return e==="button"?S.createElement("button",{type:"button",...t,key:t.key}):e==="img"?S.createElement("img",{alt:"",...t,key:t.key}):S.createElement(e,t)}const BO=500,VO={style:{transition:"none"}},gk="data-base-ui-click-trigger",xk={fallbackAxisSide:"end"},WO={clipPath:"inset(50%)",position:"fixed",top:0,left:0},yk=S.createContext(null),vk=()=>S.useContext(yk),UO=Jl("portal");function wk(e={}){const{ref:t,container:n,componentProps:r=kt,elementProps:s}=e,o=Nd(),i=vk(),l=i==null?void 0:i.portalNode,[a,c]=S.useState(null),[u,f]=S.useState(null),h=me(b=>{b!==null&&f(b)}),p=S.useRef(null);fe(()=>{if(n===null){p.current&&(p.current=null,f(null),c(null));return}const b=(n&&(yg(n)?n:n.current))??l??document.body;if(b==null){p.current&&(p.current=null,f(null),c(null));return}p.current!==b&&(p.current=b,f(null),c(b))},[n,l]);const v=Ut("div",r,{ref:[t,h],props:[{id:o,[UO]:""},s]}),x=a&&v?dn.createPortal(v,a):null;return{node:u,nodeId:S.isValidElement(v)?v.props.id:void 0,subtree:x}}const bk=S.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:l,portalOwnerRole:a,...c}=t,{node:u,nodeId:f,subtree:h}=wk({container:l,ref:n,componentProps:t,elementProps:c}),p=S.useRef(null),v=S.useRef(null),x=S.useRef(null),b=S.useRef(null),[g,m]=S.useState(null),y=S.useRef(!1),w=g==null?void 0:g.modal,k=g==null?void 0:g.open,N=!!g&&!g.modal&&g.open&&!!u;S.useEffect(()=>{if(!u||w)return;function C(P){u&&P.relatedTarget&&Zo(P)&&(P.type==="focusin"?y.current&&(gy(u),y.current=!1):(kO(u),y.current=!0))}return ir(ke(u,"focusin",C,!0),ke(u,"focusout",C,!0))},[u,w]),fe(()=>{!u||k!==!0||!y.current||(gy(u),y.current=!1)},[k,u]);const E=S.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:v,beforeInsideRef:x,afterInsideRef:b,portalNode:u,setFocusManagerState:m}),[u]);return d.jsxs(S.Fragment,{children:[h,d.jsxs(yk.Provider,{value:E,children:[N&&u&&d.jsx(Ri,{"data-type":"outside",ref:p,onFocus:C=>{var P;if(Zo(C,u))(P=x.current)==null||P.focus();else{const I=g?g.domReference:null,z=ak(I);z==null||z.focus()}}}),N&&u&&d.jsx("span",{role:a,"aria-owns":f,style:WO}),u&&dn.createPortal(i,u),N&&u&&d.jsx(Ri,{"data-type":"outside",ref:v,onFocus:C=>{var P;if(Zo(C,u))(P=b.current)==null||P.focus();else{const I=g?g.domReference:null,z=Og(I);z==null||z.focus(),g!=null&&g.closeOnFocusOut&&(g==null||g.onOpenChange(!1,Me(Zl,C.nativeEvent)))}}})]})]})});function Sk(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class qO{constructor(){ge(this,"nodesRef",{current:[]});ge(this,"events",Sk())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const kk=S.createContext(null),Ek=S.createContext(null),Td=()=>{var e;return((e=S.useContext(kk))==null?void 0:e.id)||null},Bi=e=>{const t=S.useContext(Ek);return e??t};function KO(e){const t=Nd(),n=Bi(e),r=Td();return fe(()=>{if(!t)return;const s={id:t,parentId:r};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,r]),t}function YO(e){const{children:t,id:n}=e,r=Td();return d.jsx(kk.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function GO(e){const{children:t,externalTree:n}=e,r=Pn(()=>n??new qO).current;return d.jsx(Ek.Provider,{value:r,children:t})}function pr(e){return e==null?e:"current"in e?e.current:e}function QO(e,t){const n=ot(Mt(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Ny=20;let cs=[];function zg(){cs=cs.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Ry(e){zg(),e&&Nt(e)!=="body"&&(cs.push(new WeakRef(e)),cs.length>Ny&&(cs=cs.slice(-Ny)))}function Ty(){var e;return zg(),(e=cs[cs.length-1])==null?void 0:e.deref()}function XO(e){return e?jg(e)?e:Ra(e)[0]||e:null}function Py(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=ik(e).filter(o=>{const i=o.getAttribute("data-tabindex")||"";return jg(o)||o.hasAttribute("data-tabindex")&&!i.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ck(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:p,getInsideElements:v}=e,x="rootStore"in t?t.rootStore:t,b=x.useState("open"),g=x.useState("domReferenceElement"),m=x.useState("floatingElement"),{events:y,dataRef:w}=x.context,k=me(()=>{var V;return(V=w.current.floatingContext)==null?void 0:V.nodeId}),N=s===!1,E=cy(g)&&N,C=Ht(s),P=Ht(o),I=Ht(c),z=Ht(b),$=Bi(p),A=vk(),R=S.useRef(!1),j=S.useRef(!1),O=S.useRef(!1),F=S.useRef(null),T=S.useRef(""),M=S.useRef(""),_=S.useRef(null),U=S.useRef(null),L=Ni(_,h,A==null?void 0:A.beforeInsideRef),K=Ni(U,A==null?void 0:A.afterInsideRef),W=Mr(),q=Mr(),H=Ng(),G=A!=null,B=uy(m),Y=me((V=B)=>V?Ra(V):[]),Q=me(()=>(v==null?void 0:v().filter(V=>V!=null))??[]);S.useEffect(()=>{if(r||!l)return;function V(ee){ee.key==="Tab"&&xe(B,vn(Fe(B)))&&Y().length===0&&!E&&b2(ee)}const X=Fe(B);return ke(X,"keydown",V)},[r,B,l,E,Y]),S.useEffect(()=>{if(r||!b)return;const V=Fe(B);function X(){O.current=!1}function ee(Pe){const ce=Mt(Pe),ve=Q(),ue=xe(m,ce)||xe(g,ce)||xe(A==null?void 0:A.portalNode,ce)||ve.some(Re=>Re===ce||xe(Re,ce));O.current=!ue,M.current=Pe.pointerType||"keyboard",ce!=null&&ce.closest(`[${gk}]`)&&(j.current=!0,q.start(0,()=>{j.current=!1}))}function he(){M.current="keyboard"}return ir(ke(V,"pointerdown",ee,!0),ke(V,"pointerup",X,!0),ke(V,"pointercancel",X,!0),ke(V,"keydown",he,!0),X)},[r,m,g,B,b,A,q,Q]),S.useEffect(()=>{if(r||!a)return;const V=Fe(B);function X(){j.current=!0,q.start(0,()=>{j.current=!1})}function ee(ve){const ue=Mt(ve);jg(ue)&&(F.current=ue)}function he(ve){const ue=ve.relatedTarget,Re=ve.currentTarget,ye=Mt(ve);l&&ue==null&&ye!=null&&xe(m,ye)&&Ry(ye),queueMicrotask(()=>{const ze=k(),Ie=x.context.triggerElements,et=Q(),lt=(ue==null?void 0:ue.hasAttribute(Jl("focus-guard")))&&[_.current,U.current,A==null?void 0:A.beforeInsideRef.current,A==null?void 0:A.afterInsideRef.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,pr(f),pr(u)].includes(ue),re=!(xe(g,ue)||xe(m,ue)||xe(ue,m)||xe(A==null?void 0:A.portalNode,ue)||et.some(se=>se===ue||xe(se,ue))||Ie.hasMatchingElement(se=>xe(se,ue))||lt||$&&(Ns($.nodesRef.current,ze).find(se=>{var De,we;return xe((De=se.context)==null?void 0:De.elements.floating,ue)||xe((we=se.context)==null?void 0:we.elements.domReference,ue)})||xy($.nodesRef.current,ze).find(se=>{var De,we,at;return[(De=se.context)==null?void 0:De.elements.floating,uy((we=se.context)==null?void 0:we.elements.floating)].includes(ue)||((at=se.context)==null?void 0:at.elements.domReference)===ue})));if(Re===g&&B&&Py(B),i&&Re!==g&&!Ig(ye)&&vn(V)===V.body){if(Ve(B)&&(B.focus(),i==="popup")){H.request(()=>{B.focus()});return}const se=Y(),De=F.current,we=(De&&se.includes(De)?De:null)||se[se.length-1]||B;Ve(we)&&we.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(E||!l)&&ue&&re&&!j.current&&(E||ue!==Ty())&&(R.current=!0,x.setOpen(!1,Me(Zl,ve)))})}function Pe(){O.current||(w.current.insideReactTree=!0,W.start(0,()=>{w.current.insideReactTree=!1}))}const ce=Ve(g)?g:null;if(!(!m&&!ce))return ir(ce&&ke(ce,"focusout",he),ce&&ke(ce,"pointerdown",X),m&&ke(m,"focusin",ee),m&&ke(m,"focusout",he),m&&A&&ke(m,"focusout",Pe,!0))},[r,g,m,B,l,$,A,x,a,i,Y,E,k,w,W,q,H,u,f,Q]),S.useEffect(()=>{var Re,ye,ze;if(r||!m||!b)return;const V=Array.from(((Re=A==null?void 0:A.portalNode)==null?void 0:Re.querySelectorAll(`[${Jl("portal")}]`))||[]),ee=(ze=(ye=($?xy($.nodesRef.current,k()):[]).find(Ie=>{var et;return cy(((et=Ie.context)==null?void 0:et.elements.domReference)||null)}))==null?void 0:ye.context)==null?void 0:ze.elements.domReference,Pe=[...[m,...V,_.current,U.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,...Q()],ee,pr(f),pr(u),E?g:null].filter(Ie=>Ie!=null),ce=Sy(Pe,{ariaHidden:l||E,mark:!1}),ve=[m,...V].filter(Ie=>Ie!=null),ue=Sy(ve);return()=>{ue(),ce()}},[b,r,g,m,l,A,E,$,k,u,f,Q]),fe(()=>{if(!b||r||!Ve(B))return;T.current="",M.current="";const V=Fe(B),X=vn(V);queueMicrotask(()=>{const ee=C.current,he=typeof ee=="function"?ee(I.current||""):ee;if(he===void 0||he===!1||xe(B,X))return;let ce=null;const ve=()=>(ce==null&&(ce=Y(B)),ce[0]||B);let ue;he===!0||he===null?ue=ve():ue=pr(he),ue=ue||ve();const Re=xe(B,vn(V));$f(ue,{preventScroll:ue===B,shouldFocus(){if(!z.current)return!1;if(Re)return!0;const ye=vn(V);return!(ye!==ue&&xe(B,ye))}})})},[r,b,B,Y,C,I,z]),fe(()=>{if(r||!B)return;const V=Fe(B),X=vn(V),ee=I.current==null;Ry(X);function he(ce){if(ce.open||(T.current=QO(ce.nativeEvent,M.current)),ce.reason===St&&ce.nativeEvent.type==="mouseleave"&&(R.current=!0),ce.reason===qS)if(ce.nested)R.current=!1;else if($S(ce.nativeEvent)||FS(ce.nativeEvent))R.current=!1;else{let ve=!1;Fe(B).createElement("div").focus({get preventScroll(){return ve=!0,!1}}),ve?R.current=!1:R.current=!0}}y.on("openchange",he);function Pe(ce){const ve=P.current;let ue=typeof ve=="function"?ve(ce):ve;if(ue===void 0||ue===!1)return null;ue===null&&(ue=!0);const Re=g!=null&&g.isConnected?g:null,ye=X!=null&&X.isConnected&&Nt(X)!=="body"?X:null;let ze=ee?ye||Re:Re||ye;return ze||(ze=Ty()||null),typeof ue=="boolean"?ze:pr(ue)||ze||null}return()=>{y.off("openchange",he);const ce=vn(V),ve=Q(),ue=xe(m,ce)||ve.some(Ie=>Ie===ce||xe(Ie,ce))||$&&Ns($.nodesRef.current,k(),!1).some(Ie=>{var et;return xe((et=Ie.context)==null?void 0:et.elements.floating,ce)}),Re=P.current,ye=T.current,ze=Pe(ye);queueMicrotask(()=>{const Ie=XO(ze),et=typeof Re!="boolean";if(Re&&!R.current&&Ve(Ie)&&(!(!et&&Ie!==ce&&ce!==V.body)||ue)){const lt={preventScroll:!0};ye==="keyboard"&&(lt.focusVisible=!0),Ie.focus(lt)}R.current=!1})}},[r,m,B,P,I,y,$,g,k,Q]),fe(()=>{if(!wo||b||!m)return;const V=vn(Fe(m));!Ve(V)||!kd(V)||xe(m,V)&&V.blur()},[b,m]),fe(()=>{if(!(r||!A))return A.setFocusManagerState({modal:l,closeOnFocusOut:a,open:b,onOpenChange:x.setOpen,domReference:g}),()=>{A.setFocusManagerState(null)}},[r,A,l,b,x,a,g]),fe(()=>{if(!(r||!B))return Py(B),()=>{queueMicrotask(zg)}},[r,B]);const Z=!r&&(l?!E:!0)&&(G||l);return d.jsxs(S.Fragment,{children:[Z&&d.jsx(Ri,{"data-type":"inside",ref:L,onFocus:V=>{var X;if(l){const ee=Y();$f(ee[ee.length-1])}else if(A!=null&&A.portalNode)if(R.current=!1,Zo(V,A.portalNode)){const ee=Og(g);ee==null||ee.focus()}else(X=pr(f??A.beforeOutsideRef))==null||X.focus()}}),n,Z&&d.jsx(Ri,{"data-type":"inside",ref:K,onFocus:V=>{var X;if(l)$f(Y()[0]);else if(A!=null&&A.portalNode)if(a&&(R.current=!0),Zo(V,A.portalNode)){const ee=ak(g);ee==null||ee.focus()}else(X=pr(u??A.afterOutsideRef))==null||X.focus()}})]})}function ZO(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:o=!1,stickIfOpen:i=!0,touchOpenDelay:l=0,reason:a=Es}=t,c="rootStore"in e?e.rootStore:e,u=c.context.dataRef,f=S.useRef(void 0),h=Ng(),p=Mr(),v=S.useMemo(()=>{function x(g,m,y,w){const k=Me(a,m,y);g&&w==="touch"&&l>0?p.start(l,()=>{c.setOpen(!0,k)}):c.setOpen(g,k)}function b(g,m,y){const w=u.current.openEvent,k=c.select("domReferenceElement")!==m;return g&&k||!g||!s?!0:w&&i?!y(w.type):!1}return{onPointerDown(g){f.current=ys(g.pointerType,!0)&&FS(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){const m=f.current,y=g.nativeEvent,w=c.select("open");if(g.button!==0||r==="click"||ys(m,!0)&&o)return;const k=b(w,g.currentTarget,C=>C==="click"||C==="mousedown"),N=Mt(y);if(kd(N)){x(k,y,N,m);return}const E=g.currentTarget;h.request(()=>{x(k,y,E,m)})},onClick(g){if(r==="mousedown-only")return;const m=f.current;if(r==="mousedown"&&m){f.current=void 0;return}if(ys(m,!0)&&o)return;const y=c.select("open"),w=b(y,g.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");x(w,g.nativeEvent,g.currentTarget,m)},onKeyDown(){f.current=void 0}}},[u,r,o,a,c,i,s,h,p,l]);return S.useMemo(()=>n?{reference:v}:kt,[n,v])}function JO(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var p;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",a=["mouseenter","mousemove"].includes(((p=t.dataRef.current.openEvent)==null?void 0:p.type)||"")&&t.pointerType!=="touch";let c=o.width,u=o.height,f=o.x,h=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),r==null&&t.y&&l&&(r=o.y-t.y),f-=n||0,h-=r||0,c=0,u=0,!s||a?(c=t.axis==="y"?o.width:0,u=t.axis==="x"?o.height:0,f=i&&t.x!=null?t.x:f,h=l&&t.y!=null?t.y:h):s&&!a&&(u=t.axis==="x"?o.height:u,c=t.axis==="y"?o.width:c),s=!0,{width:c,height:u,x:f,y:h,top:h,right:f+c,bottom:h+u,left:f}}}}function Iy(e){return e!=null&&e.clientX!=null}function e_(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),i=s.useState("floatingElement"),l=s.useState("domReferenceElement"),a=s.context.dataRef,c=S.useRef(!1),u=S.useRef(null),[f,h]=S.useState(),[p,v]=S.useState([]),x=me(w=>{s.set("positionReference",w)}),b=me((w,k,N)=>{c.current||a.current.openEvent&&!Iy(a.current.openEvent)||s.set("positionReference",JO(N??l,{x:w,y:k,axis:r,dataRef:a,pointerType:f}))}),g=me(w=>{o?u.current||(b(w.clientX,w.clientY,w.currentTarget),v([])):b(w.clientX,w.clientY,w.currentTarget)}),m=ys(f)?i:o;S.useEffect(()=>{if(!n){x(l);return}if(!m)return;function w(){var E;(E=u.current)==null||E.call(u),u.current=null}const k=ot(i);function N(E){const C=Mt(E);xe(i,C)?w():b(E.clientX,E.clientY)}return!a.current.openEvent||Iy(a.current.openEvent)?u.current=ke(k,"mousemove",N):x(l),w},[m,n,i,a,l,s,b,x,p]),S.useEffect(()=>()=>{s.set("positionReference",null)},[s]),S.useEffect(()=>{n&&!i&&(c.current=!1)},[n,i]),S.useEffect(()=>{!n&&o&&(c.current=!0)},[n,o]);const y=S.useMemo(()=>{function w(k){h(k.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:g,onMouseEnter:g}},[g]);return S.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function t_(){return!1}function n_(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 Dg(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=t_,bubbles:l,externalTree:a}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),f=c.useState("floatingElement"),{dataRef:h,events:p}=c.context,v=Bi(a),x=me(typeof s=="function"?s:()=>!1),b=typeof s=="function"?x:s,g=b!==!1,m=me(()=>o),{escapeKey:y,outsidePress:w}=n_(l),k=S.useRef(!1),N=S.useRef(!1),E=S.useRef(!1),C=S.useRef(!1),P=S.useRef(!1),I=S.useRef(""),z=S.useRef(null),$=Mr(),A=Mr(),R=me(()=>{A.clear(),h.current.insideReactTree=!1}),j=me(W=>{var G;const q=(G=h.current.floatingContext)==null?void 0:G.nodeId;return(v?Ns(v.nodesRef.current,q):[]).some(B=>{var Y;return((Y=B.context)==null?void 0:Y.open)&&!B.context.dataRef.current[W]})}),O=me(W=>Mf(W,c.select("floatingElement"))||Mf(W,c.select("domReferenceElement"))),F=me(W=>{i()&&c.setOpen(!1,Me(Es,W.nativeEvent))}),T=me(W=>{if(!u||!n||!r||W.key!=="Escape"||P.current||!y&&j("__escapeKeyBubbles"))return;const q=S2(W)?W.nativeEvent:W,H=Me(Cd,q);c.setOpen(!1,H),H.isCanceled||W.preventDefault(),!y&&!H.isPropagationAllowed&&W.stopPropagation()}),M=me(()=>{h.current.insideReactTree=!0,A.start(0,R)}),_=me(W=>{if(!u||!n||W.button!==0)return;const q=Mt(W.nativeEvent);xe(c.select("floatingElement"),q)&&(k.current||(k.current=!0,N.current=!1))}),U=me(W=>{!u||!n||(W.defaultPrevented||W.nativeEvent.defaultPrevented)&&k.current&&(N.current=!0)});S.useEffect(()=>{function W(q){q.open||(C.current=!1)}return p.on("openchange",W),()=>{p.off("openchange",W)}},[p]),S.useEffect(()=>{if(!u||!n)return u||(C.current=!1),R;h.current.__escapeKeyBubbles=y,h.current.__outsidePressBubbles=w;const W=new In,q=new In,H=Fe(f);function G(){W.clear(),P.current=!0}function B(){W.start(wo?5:0,()=>{P.current=!1})}function Y(){E.current=!0,q.start(0,()=>{E.current=!1})}function Q(){k.current=!1,N.current=!1}function Z(){const re=I.current,se=re==="pen"||!re?"mouse":re,De=m(),we=typeof De=="function"?De():De;return typeof we=="string"?we:we[se]}function V(re){const se=Z();return se==="intentional"&&re.type!=="click"||se==="sloppy"&&re.type==="click"}function X(re){var we;const se=(we=h.current.floatingContext)==null?void 0:we.nodeId,De=v&&Ns(v.nodesRef.current,se).some(at=>{var nn;return Mf(re,(nn=at.context)==null?void 0:nn.elements.floating)});return O(re)||De}function ee(re){if(V(re)){re.type!=="click"&&!O(re)&&(q.clear(),E.current=!1),R();return}if(h.current.insideReactTree){R();return}const se=Mt(re),De=`[${Jl("inert")}]`,we=Ce(se)?se.getRootNode():null,at=Array.from((Ci(we)?we:Fe(c.select("floatingElement"))).querySelectorAll(De)),nn=c.context.triggerElements;if(se&&(nn.hasElement(se)||nn.hasMatchingElement(ne=>xe(ne,se))))return;let qt=Ce(se)?se:null;for(;qt&&!vs(qt);){const ne=ks(qt);if(vs(ne)||!Ce(ne))break;qt=ne}if(!(at.length&&Ce(se)&&!H2(se)&&!xe(se,c.select("floatingElement"))&&at.every(ne=>!xe(qt,ne)))){if(Ve(se)&&!("touches"in re)){const ne=vs(se),Be=fn(se),je=/auto|scroll/,zt=ne||je.test(Be.overflowX),gn=ne||je.test(Be.overflowY),qn=zt&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,Kn=gn&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,ko=Be.direction==="rtl",Eo=Kn&&(ko?re.offsetX<=se.offsetWidth-se.clientWidth:re.offsetX>se.clientWidth),Co=qn&&re.offsetY>se.clientHeight;if(Eo||Co)return}if(!X(re)){if(Z()==="intentional"){if(re.detail!==0&&!$S(re)&&!C.current)return;if(E.current){q.clear(),E.current=!1;return}}typeof b=="function"&&!b(re)||j("__outsidePressBubbles")||(c.setOpen(!1,Me(qS,re)),R())}}}function he(re){Z()!=="sloppy"||re.pointerType==="touch"||!c.select("open")||!n||O(re)||ee(re)}function Pe(re){if(Z()!=="sloppy"||!c.select("open")||!n||O(re))return;const se=re.touches[0];se&&(z.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{z.current&&(z.current.dismissOnTouchEnd=!1,z.current.dismissOnMouseDown=!1)}))}function ce(re,se){const De=Mt(re);if(!De)return;const we=ke(De,re.type,()=>{se(re),we()})}function ve(re){I.current="touch",ce(re,Pe)}function ue(re){$.clear(),re.type==="pointerdown"&&(re.button===0&&(C.current=!0),I.current=re.pointerType),!(re.type==="mousedown"&&z.current&&!z.current.dismissOnMouseDown)&&ce(re,se=>{se.type==="pointerdown"?he(se):ee(se)})}function Re(re){if(re.type==="pointercancel"&&(C.current=!1),!k.current)return;const se=N.current;if(Q(),Z()==="intentional"){if(re.type==="pointercancel"){se&&Y();return}if(!X(re)){if(se){Y();return}typeof b=="function"&&!b(re)||(q.clear(),E.current=!0,R())}}}function ye(re){if(Z()!=="sloppy"||!z.current||O(re))return;const se=re.touches[0];if(!se)return;const De=Math.abs(se.clientX-z.current.startX),we=Math.abs(se.clientY-z.current.startY),at=Math.sqrt(De*De+we*we);at>5&&(z.current.dismissOnTouchEnd=!0),at>10&&(ee(re),$.clear(),z.current=null)}function ze(re){ce(re,ye)}function Ie(re){Z()!=="sloppy"||!z.current||O(re)||(z.current.dismissOnTouchEnd&&ee(re),$.clear(),z.current=null)}function et(re){ce(re,Ie)}const lt=ir(r&&ir(ke(H,"keydown",T),ke(H,"compositionstart",G),ke(H,"compositionend",B)),g&&ir(ke(H,"click",ue,!0),ke(H,"pointerdown",ue,!0),ke(H,"pointerup",Re,!0),ke(H,"pointercancel",Re,!0),ke(H,"mousedown",ue,!0),ke(H,"mouseup",Re,!0),ke(H,"touchstart",ve,{capture:!0,passive:!0}),ke(H,"touchmove",ze,{capture:!0,passive:!0}),ke(H,"touchend",et,{capture:!0,passive:!0})));return()=>{lt(),W.clear(),q.clear(),Q(),E.current=!1,R()}},[h,f,r,g,b,u,n,y,w,T,R,m,j,O,v,c,$]);const L=S.useMemo(()=>({onKeyDown:T,onPointerDown:F,onClick:F}),[T,F]),K=S.useMemo(()=>({onKeyDown:T,onPointerDown:U,onMouseDown:U,onClickCapture:M,onMouseDownCapture(W){M(),_(W)},onPointerDownCapture(W){M(),_(W)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[T,M,_,U]);return S.useMemo(()=>n?{reference:L,floating:K,trigger:L}:{},[n,L,K])}function jy(e,t,n){let{reference:r,floating:s}=e;const o=En(t),i=Pg(t),l=Tg(i),a=Nn(t),c=o==="y",u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[l]/2-s[l]/2;let p;switch(a){case"top":p={x:u,y:r.y-s.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}const v=Ar(t);return v&&(p[i]+=h*(v==="end"?1:-1)*(n&&c?-1:1)),p}async function r_(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Cs(t,e),v=JS(p),b=l[h?f==="floating"?"reference":"floating":f],g=Iu(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),m=f==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),w=await(o.isElement==null?void 0:o.isElement(y))&&await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1},k=Iu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:m,offsetParent:y,strategy:a}):m);return{top:(g.top-k.top+v.top)/w.y,bottom:(k.bottom-g.bottom+v.bottom)/w.y,left:(g.left-k.left+v.left)/w.x,right:(k.right-g.right+v.right)/w.x}}const s_=50,o_=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:r_},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=jy(c,r,a),h=r,p=0;const v={};for(let x=0;x<o.length;x++){const b=o[x];if(!b)continue;const{name:g,fn:m}=b,{x:y,y:w,data:k,reset:N}=await m({x:u,y:f,initialPlacement:r,placement:h,strategy:s,middlewareData:v,rects:c,platform:l,elements:{reference:e,floating:t}});u=y??u,f=w??f,v[g]={...v[g],...k},N&&p<s_&&(p++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(c=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:f}=jy(c,h,a)),x=-1)}return{x:u,y:f,placement:h,strategy:s,middlewareData:v}},i_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:x=!0,...b}=Cs(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=Nn(s),m=En(l),y=Nn(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),k=h||(y||!x?[Pu(l)]:lO(l)),N=v!=="none";!h&&N&&k.push(...dO(l,x,v,w));const E=[l,...k],C=await a.detectOverflow(t,b),P=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(C[g]),f){const R=iO(s,i,w);P.push(C[R[0]],C[R[1]])}if(I=[...I,{placement:s,overflows:P}],!P.every(R=>R<=0)){var z,$;const R=(((z=o.flip)==null?void 0:z.index)||0)+1,j=E[R];if(j&&(!(f==="alignment"?m!==En(j):!1)||I.every(T=>En(T.placement)===m?T.overflows[0]>0:!0)))return{data:{index:R,overflows:I},reset:{placement:j}};let O=($=I.filter(F=>F.overflows[0]<=0).sort((F,T)=>F.overflows[1]-T.overflows[1])[0])==null?void 0:$.placement;if(!O)switch(p){case"bestFit":{var A;const F=(A=I.filter(T=>{if(N){const M=En(T.placement);return M===m||M==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(M=>M>0).reduce((M,_)=>M+_,0)]).sort((T,M)=>T[1]-M[1])[0])==null?void 0:A[0];F&&(O=F);break}case"initialPlacement":O=l;break}if(s!==O)return{reset:{placement:O}}}return{}}}},Nk=new Set(["left","top"]);async function l_(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Nn(n),l=Ar(n),a=En(n)==="y",c=Nk.has(i)?-1:1,u=o&&a?-1:1,f=Cs(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(p=l==="end"?v*-1:v),a?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const a_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:l}=t,a=await l_(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+a.x,y:o+a.y,data:{...a,placement:i}}}}},c_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...c}=Cs(e,t),u={x:n,y:r},f=await o.detectOverflow(t,c),h=En(s),p=Rg(h);let v=u[p],x=u[h];const b=(m,y)=>ZS(y+f[m==="y"?"top":"left"],y,y-f[m==="y"?"bottom":"right"]);i&&(v=b(p,v)),l&&(x=b(h,x));const g=a.fn({...t,[p]:v,[h]:x});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[h]:l}}}}}},u_=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:o,placement:i,rects:l,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=Cs(e,t),h={x:s,y:o},p=En(i),v=Rg(p);let x=h[v],b=h[p];const g=Cs(c,t),m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(r=g.crossAxis)!=null?r:0};if(u){const k=v==="y"?"height":"width",N=l.reference[v]-l.floating[k]+m.mainAxis,E=l.reference[v]+l.reference[k]-m.mainAxis;x<N?x=N:x>E&&(x=E)}if(f){var y,w;const k=v==="y"?"width":"height",N=Nk.has(Nn(i)),E=l.reference[p]-l.floating[k]+(N&&((y=a.offset)==null?void 0:y[p])||0)+(N?0:m.crossAxis),C=l.reference[p]+l.reference[k]+(N?0:((w=a.offset)==null?void 0:w[p])||0)-(N?m.crossAxis:0);b<E?b=E:b>C&&(b=C)}return{[v]:x,[p]:b}}}},d_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:i=()=>{},...l}=Cs(e,t),a=await s.detectOverflow(t,l),c=Nn(n),u=Ar(n),f=En(n)==="y",{width:h,height:p}=r.floating;let v,x;c==="top"||c==="bottom"?(v=c,x=u===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(x=c,v=u==="end"?"top":"bottom");const b=p-a.top-a.bottom,g=h-a.left-a.right,m=Ti(p-a[v],b),y=Ti(h-a[x],g),w=t.middlewareData.shift,k=!w;let N=m,E=y;w!=null&&w.enabled.x&&(E=g),w!=null&&w.enabled.y&&(N=b),k&&!u&&(f?E=h-2*Nr(a.left,a.right):N=p-2*Nr(a.top,a.bottom)),await i({...t,availableWidth:E,availableHeight:N});const C=await s.getDimensions(o.floating);return h!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function Rk(e){const t=fn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Ve(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=Tu(n)!==o||Tu(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function $g(e){return Ce(e)?e:e.contextElement}function Jo(e){const t=$g(e);if(!Ve(t))return Rr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=Rk(t);let i=(o?Tu(n.width):n.width)/r,l=(o?Tu(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const f_=Rr(0);function Tk(e){const t=ot(e);return!wg()||!t.visualViewport?f_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function h_(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ot(e)}function uo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=$g(e);let i=Rr(1);t&&(r?Ce(r)&&(i=Jo(r)):i=Jo(e));const l=h_(o,n,r)?Tk(o):Rr(0);let a=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,u=s.width/i.x,f=s.height/i.y;if(o&&r){const h=ot(o),p=Ce(r)?ot(r):r;let v=h,x=Ep(v);for(;x&&p!==v;){const b=Jo(x),g=x.getBoundingClientRect(),m=fn(x),y=g.left+(x.clientLeft+parseFloat(m.paddingLeft))*b.x,w=g.top+(x.clientTop+parseFloat(m.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,f*=b.y,a+=y,c+=w,v=ot(x),x=Ep(v)}}return Iu({width:u,height:f,x:a,y:c})}function Pd(e,t){const n=Sd(e).scrollLeft;return t?t.left+n:uo($r(e)).left+n}function Pk(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Pd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function p_(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=$r(r),l=t?bd(t.floating):!1;if(r===i||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=Rr(1);const u=Rr(0),f=Ve(r);if((f||!o)&&((Nt(r)!=="body"||Na(i))&&(a=Sd(r)),f)){const p=uo(r);c=Jo(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const h=i&&!f&&!o?Pk(i,a):Rr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-a.scrollTop*c.y+u.y+h.y}}function m_(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function g_(e){const t=Sd(e),n=e.ownerDocument.body,r=Nr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Nr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Pd(e);const i=-t.scrollTop;return fn(n).direction==="rtl"&&(o+=Nr(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:i}}const x_=25;function y_(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=ot(e),o=$r(e),i=s.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){const h=!wg()||t==="fixed";r?h||(c=-i.offsetLeft,u=-i.offsetTop):(l=i.width,a=i.height,h&&(c=i.offsetLeft,u=i.offsetTop))}if(Pd(o)<=0){const h=o.ownerDocument,p=h.body,v=getComputedStyle(p),x=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(o.clientWidth-p.clientWidth-x),g=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;g<=x_&&(l-=g)}return{width:l,height:a,x:c,y:u}}function v_(e,t){const n=uo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Jo(e),i=e.clientWidth*o.x,l=e.clientHeight*o.y,a=s*o.x,c=r*o.y;return{width:i,height:l,x:a,y:c}}function Oy(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=y_(e,n,t);else if(t==="document")r=g_($r(e));else if(Ce(t))r=v_(t,n);else{const s=Tk(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Iu(r)}function w_(e,t){const n=t.get(e);if(n)return n;let r=Xl(e,[],!1).filter(l=>Ce(l)&&Nt(l)!=="body"),s=null;const o=fn(e).position==="fixed";let i=o?ks(e):e;for(;Ce(i)&&!vs(i);){const l=fn(i),a=vg(i),c=s?s.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(f=>f!==i):s=l,i=ks(i)}return t.set(e,r),r}function b_(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?bd(t)?[]:w_(t,this._c):[].concat(n),r],l=Oy(t,i[0],s);let a=l.top,c=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const p=Oy(t,i[h],s);a=Nr(p.top,a),c=Ti(p.right,c),u=Ti(p.bottom,u),f=Nr(p.left,f)}return{width:c-f,height:u-a,x:f,y:a}}function S_(e){const{width:t,height:n}=Rk(e);return{width:t,height:n}}function k_(e,t,n){const r=Ve(t),s=$r(t),o=n==="fixed",i=uo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=Rr(0);if((r||!o)&&((Nt(t)!=="body"||Na(s))&&(l=Sd(t)),r)){const h=uo(t,!0,o,t);a.x=h.x+t.clientLeft,a.y=h.y+t.clientTop}!r&&s&&(a.x=Pd(s));const c=s&&!r&&!o?Pk(s,l):Rr(0),u=i.left+l.scrollLeft-a.x-c.x,f=i.top+l.scrollTop-a.y-c.y;return{x:u,y:f,width:i.width,height:i.height}}function Hf(e){return fn(e).position==="static"}function _y(e,t){if(!Ve(e)||fn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $r(e)===n&&(n=n.ownerDocument.body),n}function Ik(e,t){const n=ot(e);if(bd(e))return n;if(!Ve(e)){let s=ks(e);for(;s&&!vs(s);){if(Ce(s)&&!Hf(s))return s;s=ks(s)}return n}let r=_y(e,t);for(;r&&E2(r)&&Hf(r);)r=_y(r,t);return r&&vs(r)&&Hf(r)&&!vg(r)?n:r||R2(e)||n}const E_=async function(e){const t=this.getOffsetParent||Ik,n=this.getDimensions,r=await n(e.floating);return{reference:k_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function C_(e){return fn(e).direction==="rtl"}const N_={convertOffsetParentRelativeRectToViewportRelativeRect:p_,getDocumentElement:$r,getClippingRect:b_,getOffsetParent:Ik,getElementRects:E_,getClientRects:m_,getDimensions:S_,getScale:Jo,isElement:Ce,isRTL:C_};function jk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function R_(e,t,n){let r=null,s;const o=$r(e);function i(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function l(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const h=e.getBoundingClientRect(),{left:p,top:v,width:x,height:b}=h;if(u||t(),!x||!b)return;const g=dc(v),m=dc(o.clientWidth-(p+x)),y=dc(o.clientHeight-(v+b)),w=dc(p),N={rootMargin:-g+"px "+-m+"px "+-y+"px "+-w+"px",threshold:Nr(0,Ti(1,f))||1};let E=!0;function C(P){const I=P[0].intersectionRatio;if(!jk(h,e.getBoundingClientRect()))return l();if(I!==f){if(!E)return l();I?l(!1,I):s=setTimeout(()=>{l(!1,1e-7)},1e3)}E=!1}try{r=new IntersectionObserver(C,{...N,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,N)}r.observe(e)}const a=ot(e),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),i()}}function My(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=$g(e),u=s||o?[...c?Xl(c):[],...t?Xl(t):[]]:[];u.forEach(g=>{s&&g.addEventListener("scroll",n),o&&g.addEventListener("resize",n)});const f=c&&l?R_(c,n,o):null;let h=-1,p=null;i&&(p=new ResizeObserver(g=>{let[m]=g;m&&m.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),c&&!a&&p.observe(c),t&&p.observe(t));let v,x=a?uo(e):null;a&&b();function b(){const g=uo(e);x&&!jk(x,g)&&n(),x=g,v=requestAnimationFrame(b)}return n(),()=>{var g;u.forEach(m=>{s&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(g=p)==null||g.disconnect(),p=null,a&&cancelAnimationFrame(v)}}const T_=a_,P_=c_,I_=i_,j_=d_,O_=u_,__=(e,t,n)=>{const r=new Map,s=n??{},o={...N_,...s.platform,_c:r};return o_(e,t,{...s,platform:o})};var M_=typeof document<"u",A_=function(){},Vc=M_?S.useLayoutEffect:A_;function _u(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_u(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!_u(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ok(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ay(e,t){const n=Ok(e);return Math.round(t*n)/n}function Bf(e){const t=S.useRef(e);return Vc(()=>{t.current=e}),t}function z_(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,f]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=S.useState(r);_u(h,r)||p(r);const[v,x]=S.useState(null),[b,g]=S.useState(null),m=S.useCallback(T=>{T!==N.current&&(N.current=T,x(T))},[]),y=S.useCallback(T=>{T!==E.current&&(E.current=T,g(T))},[]),w=o||v,k=i||b,N=S.useRef(null),E=S.useRef(null),C=S.useRef(u),P=a!=null,I=Bf(a),z=Bf(s),$=Bf(c),A=S.useCallback(()=>{if(!N.current||!E.current)return;const T={placement:t,strategy:n,middleware:h};z.current&&(T.platform=z.current),__(N.current,E.current,T).then(M=>{const _={...M,isPositioned:$.current!==!1};R.current&&!_u(C.current,_)&&(C.current=_,dn.flushSync(()=>{f(_)}))})},[h,t,n,z,$]);Vc(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[c]);const R=S.useRef(!1);Vc(()=>(R.current=!0,()=>{R.current=!1}),[]),Vc(()=>{if(w&&(N.current=w),k&&(E.current=k),w&&k){if(I.current)return I.current(w,k,A);A()}},[w,k,A,I,P]);const j=S.useMemo(()=>({reference:N,floating:E,setReference:m,setFloating:y}),[m,y]),O=S.useMemo(()=>({reference:w,floating:k}),[w,k]),F=S.useMemo(()=>{const T={position:n,left:0,top:0};if(!O.floating)return T;const M=Ay(O.floating,u.x),_=Ay(O.floating,u.y);return l?{...T,transform:"translate("+M+"px, "+_+"px)",...Ok(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:_}},[n,l,O.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:A,refs:j,elements:O,floatingStyles:F}),[u,A,j,O,F])}const D_=(e,t)=>{const n=T_(e);return{name:n.name,fn:n.fn,options:[e,t]}},$_=(e,t)=>{const n=P_(e);return{name:n.name,fn:n.fn,options:[e,t]}},F_=(e,t)=>({fn:O_(e).fn,options:[e,t]}),L_=(e,t)=>{const n=I_(e);return{name:n.name,fn:n.fn,options:[e,t]}},H_=(e,t)=>{const n=j_(e);return{name:n.name,fn:n.fn,options:[e,t]}};var _k={exports:{}},Mk={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var Pi=S;function B_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var V_=typeof Object.is=="function"?Object.is:B_,W_=Pi.useState,U_=Pi.useEffect,q_=Pi.useLayoutEffect,K_=Pi.useDebugValue;function Y_(e,t){var n=t(),r=W_({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return q_(function(){s.value=n,s.getSnapshot=t,Vf(s)&&o({inst:s})},[e,n,t]),U_(function(){return Vf(s)&&o({inst:s}),e(function(){Vf(s)&&o({inst:s})})},[e]),K_(n),n}function Vf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!V_(e,n)}catch{return!0}}function G_(e,t){return t()}var Q_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?G_:Y_;Mk.useSyncExternalStore=Pi.useSyncExternalStore!==void 0?Pi.useSyncExternalStore:Q_;_k.exports=Mk;var Id=_k.exports,Ak={exports:{}},zk={};/**
49
+ * @license React
50
+ * use-sync-external-store-shim/with-selector.production.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var jd=S,X_=Id;function Z_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var J_=typeof Object.is=="function"?Object.is:Z_,eM=X_.useSyncExternalStore,tM=jd.useRef,nM=jd.useEffect,rM=jd.useMemo,sM=jd.useDebugValue;zk.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=tM(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=rM(function(){function a(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&i.hasValue){var v=i.value;if(s(v,p))return f=v}return f=p}if(v=f,J_(u,p))return v;var x=r(p);return s!==void 0&&s(v,x)?(u=p,v):(u=p,f=x)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return a(t())},h===null?void 0:function(){return a(h())}]},[t,n,r,s]);var l=eM(e,o[0],o[1]);return nM(function(){i.hasValue=!0,i.value=l},[l]),sM(l),l};Ak.exports=zk;var Dk=Ak.exports;const oM=Pw(Dk),iM=_g(19),lM=iM?cM:uM;function $k(e,t,n,r,s){return lM(e,t,n,r,s)}function aM(e,t,n,r,s){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return Id.useSyncExternalStore(e.subscribe,o,o)}f2({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),Id.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function cM(e,t,n,r,s){const o=d2();if(!o)return aM(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let l;return o.didInitialize?(l=o.syncHooks[i],(l.store!==e||l.selector!==t||!Object.is(l.a1,n)||!Object.is(l.a2,r)||!Object.is(l.a3,s))&&(l.store!==e&&(o.didChangeStore=!0),l.store=e,l.selector=t,l.a1=n,l.a2=r,l.a3=s,l.value=t(e.getSnapshot(),n,r,s))):(l={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(l)),l.value}function uM(e,t,n,r,s){return Dk.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class dM{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 n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return $k(this,t,n,r,s)}}class Od extends dM{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){S.useDebugValue(t);const r=this;fe(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;fe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);fe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){S.useDebugValue(t);const r=this,s=n!==void 0;fe(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return S.useDebugValue(t),$k(this,this.selectors[t],n,r,s)}useContextCallback(t,n){S.useDebugValue(t);const r=me(n??gg);this.context[t]=r}useStateSetter(t){const n=S.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const l=s;s=i,n(i,l,this)}})}}const fM={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 Fk extends Od{constructor(n){const{syncOnly:r,nested:s,onOpenChange:o,triggerElements:i,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Sk(),nested:s,triggerElements:i},fM);ge(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&k2(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});ge(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const s={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",s)});ge(this,"setOpen",(n,r)=>{var s,o,i,l;if(this.syncOnly){(o=(s=this.context).onOpenChange)==null||o.call(s,n,r);return}this.dispatchOpenChange(n,r),(l=(i=this.context).onOpenChange)==null||l.call(i,n,r)});this.syncOnly=r}}function hM(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,l=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,f=i,h=S.useRef(null);r===void 0&&h.current===null&&(h.current=new Fk({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:f,floatingId:s,syncOnly:!0,nested:o}));const p=r??h.current;return t.useSyncedValue("floatingId",s),fe(()=>{const v={open:l,floatingId:s,referenceElement:a,floatingElement:c};Ce(a)&&(v.domReferenceElement=a),p.state.positionReference===p.state.referenceElement&&(v.positionReference=a),p.update(v)},[l,s,a,c,p]),p.context.onOpenChange=f,p.context.nested=o,p}function Lk(e,t=!1,n=!1,r=!1){const[s,o]=S.useState(e&&t?"idle":void 0),[i,l]=S.useState(e&&!r);return e&&!i&&(l(!0),o("starting")),!e&&i&&s!=="ending"&&!n&&o("ending"),!e&&!i&&s==="ending"&&o(void 0),fe(()=>{if(!e&&i&&s!=="ending"&&n){const a=tr.request(()=>{o("ending")});return()=>{tr.cancel(a)}}},[e,i,s,n]),fe(()=>{if(!e||t)return;const a=tr.request(()=>{o(void 0)});return()=>{tr.cancel(a)}},[t,e]),fe(()=>{if(!e||!t)return;e&&i&&s!=="idle"&&o("starting");const a=tr.request(()=>{o("idle")});return()=>{tr.cancel(a)}},[t,e,i,s]),{mounted:i,setMounted:l,transitionStatus:s}}let hc=null;function pM(e){if(!hc){const t=[];hc=t,queueMicrotask(()=>{hc=null,dn.flushSync(()=>{for(const n of t)n()})})}hc.push(e)}function Hk(e,t=!1,n=!1){const r=Ng();return me((s,o=null)=>{r.cancel();const i=pr(e);if(i==null)return;const l=i,a=()=>{if(!n){dn.flushSync(s);return}pM(()=>{o!=null&&o.aborted||s()})};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function c(){Promise.all(l.getAnimations().map(u=>u.finished)).then(()=>{o!=null&&o.aborted||a()},()=>{if(o!=null&&o.aborted)return;if(l.getAnimations().some(f=>f.pending||f.playState!=="finished")){c();return}a()})}if(t){const u=BS;if(!l.hasAttribute(u)){r.request(c);return}const f=new MutationObserver(()=>{l.hasAttribute(u)||(f.disconnect(),c())});f.observe(l,{attributes:!0,attributeFilter:[u]}),o==null||o.addEventListener("abort",()=>f.disconnect(),{once:!0});return}r.request(c)})}function Ta(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:o}=e,i=me(o),l=Hk(r,n,s);S.useEffect(()=>{if(!t)return;const a=new AbortController;return l(i,a.signal),()=>{a.abort()}},[t,n,i,l])}const Fg={tabIndex:-1,[Cp]:""};function Bk(e){return t=>t==="touch"?e.current:!0}function Lg(e,t=!1){const n=Nd(),r=Td()!=null,s=Pn(()=>e(n,r)).current;return hM({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Hg({handle:e,store:t}){return fe(()=>e.attachStore(t),[e,t]),null}function zy(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function mM(e,t){const n=S.useRef(null);return me(r=>{const s=n.current;if(s!==null){if(s.element===r&&s.store===t&&s.id===e)return;n.current=null;const o=s.store;o.context.triggerElements.getById(s.id)===s.element&&(o.context.triggerElements.delete(s.id),zy(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),zy(t))})}function Bg(e,t,n,r=!1){let s=e.preventUnmountingOnClose;t?s=!1:r&&(s=!0);const o=(n==null?void 0:n.id)??null;let i=e.activeTriggerId,l=e.activeTriggerElement;return(o||t)&&(i=o,l=n??null),{open:t,preventUnmountingOnClose:s,activeTriggerId:i,activeTriggerElement:l}}function Vk(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function gM(e,t,n,r={}){var u,f,h;const s=n.reason,o=s===St,i=t&&s===Hc,l=!t&&(s===Es||s===Cd),a=Vk(n);if((f=(u=e.context).onOpenChange)==null||f.call(u,t,n),n.isCanceled)return;(h=r.onBeforeDispatch)==null||h.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const p=Bg(e.state,t,n.trigger,a()),v={...r.extraState,...p};i?v.instantType="focus":l?v.instantType="dismiss":o&&(v.instantType=void 0),e.update(v)};o?dn.flushSync(c):c()}function Wk(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=mM(e,n),i=me(a=>{const c=n.select("open"),u=n.select("activeTriggerId");if(u===e){const f={activeTriggerElement:a,...c?r:null};n.update(f);return}if(u==null&&c){const f={activeTriggerId:e??null,activeTriggerElement:a,...r};n.update(f)}}),l=me(a=>{o(a),a&&i(a)});return fe(()=>(l(t.current),()=>l(null)),[l,t,n,e]),fe(()=>{if(s){const a={activeTriggerElement:t.current,...r};n.update(a)}},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function Vg(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=S.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");fe(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,c={};e.state.triggerCount!==a&&(c.triggerCount=a);const u=e.select("activeTriggerId");let f=null;if(u){const h=e.context.triggerElements.getById(u);if(h)r.current=u,h!==e.state.activeTriggerElement&&(c.activeTriggerElement=h);else{for(const[p,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){c.activeTriggerId=p,c.activeTriggerElement=v,r.current=p;break}c.activeTriggerId===void 0&&(r.current===u?f=u:r.current=null)}}else r.current=null;if(!f&&!u&&a===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[p,v]=h.value;c.activeTriggerId=p,c.activeTriggerElement=v,r.current=p}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=Me(Ed);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,l,n])}function Wg(e,t,n,r){const{mounted:s,setMounted:o,transitionStatus:i}=Lk(e,!1,!1,r),l=t.useState("preventUnmountingOnClose"),a=e?!1:l;t.useSyncedValues({mounted:s,transitionStatus:i,preventUnmountingOnClose:a});const c=me(()=>{var u,f;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(f=(u=t.context).onOpenChangeComplete)==null||f.call(u,!1)});return Ta({enabled:s&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:i}}function Ug(e,t){e.useSyncedValues(t),fe(()=>()=>{e.update({activeTriggerProps:kt,inactiveTriggerProps:kt,popupProps:kt})},[e])}function Uk(e,t){fe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),fe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class qg{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))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}}function Kg(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Fk({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:kt,inactiveTriggerProps:kt,popupProps:kt}}const Pl=e=>e.triggerIdProp??e.activeTriggerId,Yg=e=>e.openProp??e.open,Dy=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function qk(e,t){return t!==void 0&&Yg(e)&&Pl(e)===t}function xM(e,t){return qk(e,t)?!0:t!==void 0&&Yg(e)&&Pl(e)==null&&e.triggerCount===1}const Gg={open:Yg,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Pl,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Dy,isTriggerActive:(e,t)=>t!==void 0&&Pl(e)===t,isOpenedByTrigger:(e,t)=>qk(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Pl(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>xM(e,t)?Dy(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Kk(e){const t=S.useCallback(r=>e===void 0?gg:e.subscribeStore(r),[e]),n=S.useCallback(()=>e===void 0?void 0:e.store,[e]);return Id.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function yM(e){return vM(e,e.rootContext)}function vM(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),o=t.useState("floatingElement"),i=t.useState("domReferenceElement"),l=t.useState("open"),a=t.useState("floatingId"),[c,u]=S.useState(null),[f,h]=S.useState(void 0),[p,v]=S.useState(void 0),x=S.useRef(null),b=Bi(r),g=S.useMemo(()=>({reference:s,floating:o,domReference:i}),[s,o,i]),m=z_({...e,elements:{...g,...c&&{reference:c}}}),y=Ce(f)?f:null,w=p===void 0?t.state.floatingElement:p;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?i:y),t.useSyncedValue("floatingElement",w);const k=S.useCallback(z=>{const $=Ce(z)?{getBoundingClientRect:()=>z.getBoundingClientRect(),getClientRects:()=>z.getClientRects(),contextElement:z}:z;u($),m.refs.setReference($)},[m.refs]),N=S.useCallback(z=>{(Ce(z)||z===null)&&(x.current=z,h(z)),(Ce(m.refs.reference.current)||m.refs.reference.current===null||z!==null&&!Ce(z))&&m.refs.setReference(z)},[m.refs,h]),E=S.useCallback(z=>{v(z),m.refs.setFloating(z)},[m.refs]),C=S.useMemo(()=>({...m.refs,setReference:N,setFloating:E,setPositionReference:k,domReference:x}),[m.refs,N,E,k]),P=S.useMemo(()=>({...m.elements,domReference:i}),[m.elements,i]),I=S.useMemo(()=>({...m,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:a,refs:C,elements:P,nodeId:n,rootStore:t}),[m,C,P,n,t,l,a]);return fe(()=>{i&&(x.current=i)},[i]),fe(()=>{t.context.dataRef.current.floatingContext=I;const z=b==null?void 0:b.nodesRef.current.find($=>$.id===n);z&&(z.context=I)}),S.useMemo(()=>({...m,context:I,refs:C,elements:P,rootStore:t}),[m,C,P,I,t])}const Wf=zS&&wo;function wM(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:o,dataRef:i}=s.context,l=S.useRef(!1),a=S.useRef(null),c=S.useRef(!0),u=Mr();S.useEffect(()=>{const h=s.select("domReferenceElement");if(!n)return;const p=ot(h);function v(){const g=s.select("domReferenceElement");!s.select("open")&&Ve(g)&&g===vn(Fe(g))&&(l.current=!0,a.current=g)}function x(){c.current=!0}function b(){c.current=!1}return ir(ke(p,"blur",v),Wf&&ke(p,"keydown",x,!0),Wf&&ke(p,"pointerdown",b,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function h(p){if(p.reason===Es||p.reason===Cd){const v=s.select("domReferenceElement");Ce(v)&&(a.current=v,l.current=!0)}}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,n,s]);const f=S.useMemo(()=>{function h(){l.current=!1,a.current=null}return{onMouseLeave(){h()},onFocus(p){const v=p.currentTarget;if(l.current){if(a.current===v)return;h()}const x=Mt(p.nativeEvent);if(Ce(x)){if(Wf&&!p.relatedTarget){if(!c.current&&!kd(x))return}else if(!V2(x))return}const b=Ru(p.relatedTarget,s.context.triggerElements),{nativeEvent:g,currentTarget:m}=p,y=typeof r=="function"?r():r;if(s.select("open")&&b||y===0||y===void 0){s.setOpen(!0,Me(Hc,g,m));return}u.start(y,()=>{l.current||s.setOpen(!0,Me(Hc,g,m))})},onBlur(p){h();const v=p.relatedTarget,x=p.nativeEvent,b=Ce(v)&&v.hasAttribute(Jl("focus-guard"))&&v.getAttribute("data-type")==="outside";u.start(0,()=>{var w;const g=s.select("domReferenceElement"),m=vn(Fe(g));!v&&m===g||xe((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,m)||xe(g,m)||b||Ru(v??m,s.context.triggerElements)||s.setOpen(!1,Me(Hc,x))})}}},[i,r,s,u]);return S.useMemo(()=>n?{reference:f,trigger:f}:{},[n,f])}class Qg{constructor(){ge(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});ge(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new In,this.restTimeout=new In,this.handleCloseOptions=void 0}static create(){return new Qg}}const Mu=new WeakMap;function Au(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Mu.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(s=e.pointerEventsFloatingElement)==null||s.style.removeProperty("pointer-events"),Mu.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Yk(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,o=Mu.get(n);o&&o!==e&&Au(o),Au(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,Mu.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function Xg(e){const t=e.context.dataRef.current,n=Pn(()=>t.hoverInteractionState??Qg.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),xg(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Gk(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,o="rootStore"in e?e.rootStore:e,i=o.useState("open"),l=o.useState("floatingElement"),a=o.useState("domReferenceElement"),{dataRef:c}=o.context,u=Bi(),f=Td(),h=Xg(o),p=Mr(),v=me(()=>{var g;return US((g=c.current.openEvent)==null?void 0:g.type,h.interactedInside)}),x=me(()=>{var g;return U2((g=c.current.openEvent)==null?void 0:g.type)}),b=me(()=>{Au(h)});fe(()=>{i||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,b())},[i,h,b]),S.useEffect(()=>b,[b]),fe(()=>{var g,m,y,w,k;if(n&&i&&(g=h.handleCloseOptions)!=null&&g.blockPointerEvents&&x()&&Ce(a)&&l){const N=a,E=l,C=Fe(l),P=(y=(m=u==null?void 0:u.nodesRef.current.find(A=>A.id===f))==null?void 0:m.context)==null?void 0:y.elements.floating;P&&(P.style.pointerEvents="");const I=h.pointerEventsScopeElement!==E?h.pointerEventsScopeElement:null,z=P!==E?P:null,$=((k=(w=h.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:k.call(w))??I??z??N.closest("[data-rootownerid]")??C.body;return Yk(h,{scopeElement:$,referenceElement:N,floatingElement:E}),()=>{b()}}},[n,i,a,l,h,x,u,f,b]),S.useEffect(()=>{if(!n)return;function g(){return!!(u&&f&&Ns(u.nodesRef.current,f).length>0)}function m(C){const P=co(r,"close",h.pointerType),I=()=>{o.setOpen(!1,Me(St,C)),u==null||u.events.emit("floating.closed",C)};P?h.openChangeTimeout.start(P,I):(h.openChangeTimeout.clear(),I())}function y(C){const P=Mt(C);if(!B2(P)){h.interactedInside=!1;return}h.interactedInside=(P==null?void 0:P.closest("[aria-haspopup]"))!=null}function w(){h.openChangeTimeout.clear(),p.clear(),u==null||u.events.off("floating.closed",N),b()}function k(C){var $;if(g()&&u){u.events.on("floating.closed",N);return}if(Ru(C.relatedTarget,o.context.triggerElements))return;const P=(($=c.current.floatingContext)==null?void 0:$.nodeId)??s,I=C.relatedTarget;if(!(u&&P&&Ce(I)&&Ns(u.nodesRef.current,P,!1).some(A=>{var R;return xe((R=A.context)==null?void 0:R.elements.floating,I)}))){if(h.handler){h.handler(C);return}b(),x()&&!v()&&m(C)}}function N(C){!u||!f||g()||p.start(0,()=>{u.events.off("floating.closed",N),o.setOpen(!1,Me(St,C)),u.events.emit("floating.closed",C)})}const E=l;return ir(E&&ke(E,"mouseenter",w),E&&ke(E,"mouseleave",k),E&&ke(E,"pointerdown",y,!0),()=>{u==null||u.events.off("floating.closed",N)})},[n,l,o,c,r,s,x,v,b,h,u,f,p])}const bM={current:null};function Qk(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:o=!1,restMs:i=0,move:l=!0,triggerElementRef:a=bM,externalTree:c,isActiveTrigger:u=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:p,guardStaleOpen:v=!1}=t,x="rootStore"in e?e.rootStore:e,{dataRef:b,events:g}=x.context,m=Bi(c),y=Xg(x),w=S.useRef(!1),k=Ht(s),N=Ht(r),E=Ht(i),C=Ht(n),P=Ht(p),I=Ht(h),z=me(()=>{var O;return US((O=b.current.openEvent)==null?void 0:O.type,y.interactedInside)}),$=me(()=>{var O;return((O=P.current)==null?void 0:O.call(P))!==!1}),A=me((O,F,T)=>{const M=x.context.triggerElements;if(M.hasElement(F))return!O||!xe(O,F);if(!Ce(T))return!1;const _=T;return M.hasMatchingElement(U=>xe(U,_))&&(!O||!xe(O,_))}),R=me(()=>{if(!y.handler)return;Fe(x.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),j=me(()=>{Au(y)});return u&&(y.handleCloseOptions=s==null?void 0:s.__options),S.useEffect(()=>R,[R]),S.useEffect(()=>{if(!n)return;function O(F){F.open?w.current=!1:(w.current=F.reason===St,R(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on("openchange",O),()=>{g.off("openchange",O)}},[n,g,y,R]),S.useEffect(()=>{if(!n)return;function O(L,K=!0){const W=co(N.current,"close",y.pointerType);W?y.openChangeTimeout.start(W,()=>{x.setOpen(!1,Me(St,L)),m==null||m.events.emit("floating.closed",L)}):K&&(y.openChangeTimeout.clear(),x.setOpen(!1,Me(St,L)),m==null||m.events.emit("floating.closed",L))}const F=a.current??(u?x.select("domReferenceElement"):null);if(!Ce(F))return;function T(L){var ce;if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,o&&!ys(y.pointerType))return;const K=dy(E.current),W=co(N.current,"open",y.pointerType),q=Mt(L),H=L.currentTarget??null,G=x.select("domReferenceElement");let B=H;if(Ce(q)&&!x.context.triggerElements.hasElement(q)){for(const ve of x.context.triggerElements.elements())if(xe(ve,q)){B=ve;break}}Ce(H)&&Ce(G)&&!x.context.triggerElements.hasElement(H)&&xe(H,G)&&(B=G);const Y=B==null?!1:A(G,B,q),Q=x.select("open"),Z=((ce=I.current)==null?void 0:ce.call(I))??x.select("transitionStatus")==="ending",V=!Q&&Z&&w.current,X=!Y&&Ce(B)&&Ce(G)&&xe(G,B)&&V,ee=K>0&&!W,he=Y&&(Q||V)||X,Pe=!Q||Y;if(he){$()&&x.setOpen(!0,Me(St,L,B));return}ee||(W?y.openChangeTimeout.start(W,()=>{Pe&&$()&&x.setOpen(!0,Me(St,L,B))}):Pe&&$()&&x.setOpen(!0,Me(St,L,B)))}function M(L){if(z()){j();return}R();const K=x.select("domReferenceElement"),W=Fe(K);y.restTimeout.clear(),y.restTimeoutPending=!1;const q=b.current.floatingContext??(f==null?void 0:f());if(Ru(L.relatedTarget,x.context.triggerElements))return;if(k.current&&q){x.select("open")||y.openChangeTimeout.clear();const G=a.current;y.handler=k.current({...q,tree:m,x:L.clientX,y:L.clientY,onClose(){j(),R(),C.current&&!z()&&G===x.select("domReferenceElement")&&O(L,!0)}}),W.addEventListener("mousemove",y.handler),y.handler(L);return}(y.pointerType==="touch"?!xe(x.select("floatingElement"),L.relatedTarget):!0)&&O(L)}function _(L){xe(F,L.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const U=v?ke(F,"mouseout",_):void 0;return l?ir(ke(F,"mousemove",T,{once:!0}),ke(F,"mouseenter",T),ke(F,"mouseleave",M),U):ir(ke(F,"mouseenter",T),ke(F,"mouseleave",M),U)},[R,j,b,N,x,n,k,y,u,A,z,o,l,E,a,m,C,f,I,$,v]),S.useMemo(()=>{if(!n)return;function O(F){y.pointerType=F.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(F){var q,H,G;const{nativeEvent:T}=F,M=F.currentTarget,_=x.select("domReferenceElement"),U=x.select("open"),L=A(_,M,F.target);if(o&&!ys(y.pointerType))return;if(U&&L&&((q=y.handleCloseOptions)!=null&&q.blockPointerEvents)){const B=x.select("floatingElement");if(B){const Y=((G=(H=y.handleCloseOptions)==null?void 0:H.getScope)==null?void 0:G.call(H))??M.ownerDocument.body;Yk(y,{scopeElement:Y,referenceElement:M,floatingElement:B})}}const K=dy(E.current);if(U&&!L||K===0||!L&&y.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;y.restTimeout.clear();function W(){if(y.restTimeoutPending=!1,z())return;const B=x.select("open");!y.blockMouseMove&&(!B||L)&&$()&&x.setOpen(!0,Me(St,T,M))}y.pointerType==="touch"?dn.flushSync(()=>{W()}):L&&U?W():(y.restTimeoutPending=!0,y.restTimeout.start(K,W))}}},[n,y,z,A,o,x,E,$])}const $y=.1,SM=$y*$y,He=.5;function pc(e,t,n,r,s,o){return r>=t!=o>=t&&e<=(s-n)*(t-r)/(o-r)+n}function mc(e,t,n,r,s,o,i,l,a,c){let u=!1;return pc(e,t,n,r,s,o)&&(u=!u),pc(e,t,s,o,i,l)&&(u=!u),pc(e,t,i,l,a,c)&&(u=!u),pc(e,t,a,c,n,r)&&(u=!u),u}function kM(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function gc(e,t,n,r,s,o){const i=Math.min(n,s),l=Math.max(n,s),a=Math.min(r,o),c=Math.max(r,o);return e>=i&&e<=l&&t>=a&&t<=c}function Xk(e={}){const{blockPointerEvents:t=!1}=e,n=new In,r=({x:s,y:o,placement:i,elements:l,onClose:a,nodeId:c,tree:u})=>{const f=i==null?void 0:i.split("-")[0];let h=!1,p=null,v=null,x=typeof performance<"u"?performance.now():0;function b(m,y){const w=performance.now(),k=w-x;if(p===null||v===null||k===0)return p=m,v=y,x=w,!1;const N=m-p,E=y-v,C=N*N+E*E,P=k*k*SM;return p=m,v=y,x=w,C<P}function g(){n.clear(),a()}return function(y){n.clear();const w=l.domReference,k=l.floating;if(!w||!k||f==null||s==null||o==null)return;const{clientX:N,clientY:E}=y,C=Mt(y),P=y.type==="mouseleave",I=xe(k,C),z=xe(w,C);if(I&&(h=!0,!P))return;if(z&&(h=!1,!P)){h=!0;return}if(P&&Ce(y.relatedTarget)&&xe(k,y.relatedTarget))return;function $(){return!!(u&&Ns(u.nodesRef.current,c).length>0)}function A(){$()||g()}if($())return;const R=w.getBoundingClientRect(),j=k.getBoundingClientRect(),O=s>j.right-j.width/2,F=o>j.bottom-j.height/2,T=j.width>R.width,M=j.height>R.height,_=(T?R:j).left,U=(T?R:j).right,L=(M?R:j).top,K=(M?R:j).bottom;if(f==="top"&&o>=R.bottom-1||f==="bottom"&&o<=R.top+1||f==="left"&&s>=R.right-1||f==="right"&&s<=R.left+1){A();return}let W=!1;switch(f){case"top":W=gc(N,E,_,R.top+1,U,j.bottom-1);break;case"bottom":W=gc(N,E,_,j.top+1,U,R.bottom-1);break;case"left":W=gc(N,E,j.right-1,K,R.left+1,L);break;case"right":W=gc(N,E,R.right-1,K,j.left+1,L);break}if(W)return;if(h&&!kM(N,E,R)){A();return}if(!P&&b(N,E)){A();return}let q=!1;switch(f){case"top":{const H=T?He/2:He*4,G=T||O?s+H:s-H,B=T?s-H:O?s+H:s-H,Y=o+He+1,Q=O||T?j.bottom-He:j.top,Z=O?T?j.bottom-He:j.top:j.bottom-He;q=mc(N,E,G,Y,B,Y,j.left,Q,j.right,Z);break}case"bottom":{const H=T?He/2:He*4,G=T||O?s+H:s-H,B=T?s-H:O?s+H:s-H,Y=o-He,Q=O||T?j.top+He:j.bottom,Z=O?T?j.top+He:j.bottom:j.top+He;q=mc(N,E,G,Y,B,Y,j.left,Q,j.right,Z);break}case"left":{const H=M?He/2:He*4,G=M||F?o+H:o-H,B=M?o-H:F?o+H:o-H,Y=s+He+1,Q=F||M?j.right-He:j.left,Z=F?M?j.right-He:j.left:j.right-He;q=mc(N,E,Q,j.top,Z,j.bottom,Y,G,Y,B);break}case"right":{const H=M?He/2:He*4,G=M||F?o+H:o-H,B=M?o-H:F?o+H:o-H,Y=s-He,Q=F||M?j.left+He:j.right,Z=F?M?j.left+He:j.right:j.left+He;q=mc(N,E,Y,G,Y,B,Q,j.top,Z,j.bottom);break}}q?h||n.start(40,A):A()}};return r.__options={...e,blockPointerEvents:t},r}const Zk=S.createContext(void 0);function Pa(e){const t=S.useContext(Zk);if(t===void 0&&!e)throw new Error(tn(47));return t}const EM={...Gg,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class CM extends Od{constructor(n,r,s){const o=new qg;super(NM(n,o,r,s),RM(o),EM);ge(this,"setOpen",(n,r)=>{var f,h;const s=r.reason===St,o=r.reason===Es&&r.event.detail===0,i=!n&&(r.reason===Cd||r.reason==null),l=Vk(r),a=this.select("activeTriggerId");if(!n&&r.reason===KS&&r.trigger==null&&a!=null&&(r.trigger=this.context.triggerElements.getById(a)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const c=()=>{const p=Bg(this.state,n,r.trigger,l());p.openChangeReason=r.reason,this.update(p)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(BO,()=>{this.set("stickIfOpen",!1)}),dn.flushSync(c)):c();let u;o?u="click":i?u="dismiss":r.reason===Zl&&(u="focus"),this.set("instantType",u)})}}function NM(e,t,n,r=!1){const s={...Kg(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&(e==null?void 0:e.mounted)===void 0&&(s.mounted=!0),s}function RM(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new In,triggerElements:e}}const Fy=xd(function({props:t}){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:i,modal:l=!1,handle:a,triggerId:c,defaultTriggerId:u=null}=t,f=PM(a,{modal:l,open:s,openProp:r,activeTriggerId:u,triggerIdProp:c});f.useControlledProp("openProp",r),f.useControlledProp("triggerIdProp",c);const h=f.useState("open"),p=f.useState("mounted"),v=f.useState("payload");f.useContextCallback("onOpenChange",o),f.useContextCallback("onOpenChangeComplete",i),Uk(f,h),Vg(f);const{forceUnmount:x}=Wg(h,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null})});f.useSyncedValues({modal:l}),S.useEffect(()=>{h||f.context.stickIfOpenTimeout.clear()},[f,h]),S.useImperativeHandle(t.actionsRef,()=>({unmount:x,close:()=>f.setOpen(!1,Me(Eg))}),[x,f]);const b=h||p;return d.jsxs(Zk.Provider,{value:f,children:[a&&d.jsx(Hg,{handle:a,store:f}),b&&d.jsx(IM,{store:f,modal:l}),typeof n=="function"?n({payload:v}):n]})});function TM(e){return Pa(!0)?d.jsx(Fy,{props:e}):d.jsx(GO,{children:d.jsx(Fy,{props:e})})}function PM(e,t){const n=Lg((r,s)=>new CM(t,r,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function IM({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=Dg(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,o=r.floating;return Ug(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}const Jk=S.createContext(void 0);function Zg(e=!1){const t=S.useContext(Jk);if(t===void 0&&!e)throw new Error(tn(16));return t}function jM(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,l=r&&t===!1;return{props:S.useMemo(()=>{const c={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return r||(c.tabIndex=s,!o&&n&&(c.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||l)&&(c.disabled=n),c},[r,n,t,i,l,o,s])}}function Uf(e,t,{detail:n=0}={}){e.dispatchEvent(new(ot(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Jg(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),l=Zg(!0),a=o??l!==void 0,{props:c}=jM({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:s}),u=S.useCallback(()=>{const p=i.current;qf(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);fe(u,[u]);const f=S.useCallback((p={})=>{const{onClick:v,onMouseDown:x,onKeyUp:b,onKeyDown:g,onPointerDown:m,...y}=p;return Rd({onClick(w){if(t){w.preventDefault();return}v==null||v(w)},onMouseDown(w){t||x==null||x(w)},onKeyDown(w){if(t||(Ou(w),g==null||g(w),w.baseUIHandlerPrevented))return;const k=w.target===w.currentTarget,N=w.currentTarget,E=qf(N),C=!s&&OM(N),P=k&&(s?E:!C),I=w.key==="Enter",z=w.key===" ",$=N.getAttribute("role"),A=($==null?void 0:$.startsWith("menuitem"))||$==="option"||$==="gridcell";if(k&&a&&z){if(w.defaultPrevented&&A)return;w.preventDefault(),(!s||E)&&(w.preventBaseUIHandler(),Uf(N,w));return}if(!P||s||!z&&!I){k&&C&&z&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),I&&(w.preventBaseUIHandler(),Uf(N,w)))},onKeyUp(w){if(!t){if(Ou(w),b==null||b(w),w.target===w.currentTarget&&s&&a&&qf(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!s&&!a&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),Uf(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}m==null||m(w)}},s?{type:"button"}:{role:"button"},c,y)},[t,c,a,s]),h=me(p=>{i.current=p,u()});return{getButtonProps:f,buttonRef:h}}function qf(e){return Ve(e)&&e.tagName==="BUTTON"}function OM(e){return Ve(e)&&e.tagName==="A"&&!!e.href}const _M=300;function Vi(e){return Nd(e,"base-ui")}function MM(e,t){const n=S.useRef(null);function r(o){dn.flushSync(()=>{e.setOpen(!1,Me(Zl,o.nativeEvent,o.currentTarget))});const i=SO(n.current);i==null||i.focus()}function s(o){var l;const i=e.select("positionerElement");if(i&&Zo(o,i))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{dn.flushSync(()=>{e.setOpen(!1,Me(Zl,o.nativeEvent,o.currentTarget))});let a=bO(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&xe(i,a);){const c=a;if(a=Og(a),a===c)break}a==null||a.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function AM(e){const t=S.useRef(""),n=S.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:S.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function zM(e,t){const n=me((o,i)=>{(typeof e=="function"?e():e)||t(i||(vd?"touch":""))}),{onClick:r,onPointerDown:s}=AM(n);return S.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}const DM=AS(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,handle:a,payload:c,openOnHover:u=!1,delay:f=_M,closeDelay:h=0,id:p,...v}=t,x=Pa(!0),g=Kk(a)??x;if(!g)throw new Error(tn(74));const m=Vi(p),y=g.useState("isTriggerActive",m),w=g.useState("floatingRootContext"),k=g.useState("isOpenedByTrigger",m),N=g.useState("triggerPopupId",m),E=S.useRef(null),{registerTrigger:C,isMountedByThisTrigger:P}=Wk(m,E,g,{payload:c,disabled:i,openOnHover:u,closeDelay:h}),I=g.useState("openChangeReason"),z=g.useState("stickIfOpen"),$=g.useState("openMethod"),A=g.useState("focusManagerModal"),R=Qk(w,{enabled:!i&&u&&($!=="touch"||I!==Es),mouseOnly:!0,move:!1,handleClose:Xk(),restMs:f,delay:{close:h},triggerElementRef:E,isActiveTrigger:y,isClosing:()=>g.select("transitionStatus")==="ending"}),j=ZO(w,{stickIfOpen:z}),O=zM(()=>g.select("open"),G=>{g.set("openMethod",G)}),F=g.useState("triggerProps",P),{getButtonProps:T,buttonRef:M}=Jg({disabled:i,native:l}),_={open(G){return G&&I===Es?L2.open(G):WS.open(G)}},{preFocusGuardRef:U,handlePreFocusGuardFocus:L,handleFocusTargetFocus:K}=MM(g,E),q=Ut("button",t,{state:{disabled:i,open:k},ref:[M,n,C,E],props:[j.reference,R,F,O,{[gk]:"",id:m,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":N},v,T],stateAttributesMapping:_}),H=d.jsx(S.Fragment,{children:q},m);return P&&!A?d.jsxs(S.Fragment,{children:[d.jsx(Ri,{ref:U,onFocus:L}),H,d.jsx(Ri,{ref:g.context.triggerFocusTargetRef,onFocus:K})]}):H}),eE=S.createContext(void 0);function $M(){const e=S.useContext(eE);if(e===void 0)throw new Error(tn(45));return e}const FM=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Pa().useState("mounted")||r?d.jsx(eE.Provider,{value:r,children:d.jsx(bk,{ref:n,...s})}):null});function e0(e){return _g(19)?e:e?"true":void 0}const tE=S.createContext(void 0);function LM(){const e=S.useContext(tE);if(!e)throw new Error(tn(46));return e}const HM=S.createContext(void 0);function nE(){const e=S.useContext(HM);return(e==null?void 0:e.direction)??"ltr"}const BM=e=>({name:"arrow",options:e,async fn(t){var M,_;const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0,offsetParent:f="real"}=Cs(e,t)||{};if(c==null)return{};const h=JS(u),p={x:n,y:r},v=Pg(s),x=Tg(v),b=await i.getDimensions(c),g=v==="y",m=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",k=o.reference[x]+o.reference[v]-p[v]-o.floating[x],N=p[v]-o.reference[v],E=f==="real"?await((M=i.getOffsetParent)==null?void 0:M.call(i,c)):l.floating;let C=l.floating[w]||o.floating[x];(!C||!await((_=i.isElement)==null?void 0:_.call(i,E)))&&(C=l.floating[w]||o.floating[x]);const P=k/2-N/2,I=C/2-b[x]/2-1,z=Math.min(h[m],I),$=Math.min(h[y],I),A=z,R=C-b[x]-$,j=C/2-b[x]/2+P,O=ZS(A,j,R),F=!a.arrow&&Ar(s)!=null&&j!==O&&o.reference[x]/2-(j<A?z:$)-b[x]/2<0,T=F?j<A?j-A:j-R:0;return{[v]:p[v]+T,data:{[v]:O,centerOffset:j-O-T,...F&&{alignmentOffset:T}},reset:F}}}),VM=(e,t)=>{const{name:n,fn:r}=BM(e);return{name:n,fn:r,options:[e,t]}},WM={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,o=t===0&&n===0&&r===0&&s===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||o}}}},UM={sideX:"left",sideY:"top"},qM="--available-width",KM="--available-height",YM="--anchor-width",GM="--anchor-height",QM="--transform-origin",Ly=qM,Hy=KM;function rE(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function By(e,t,n){const{rects:r,placement:s}=e;return{side:rE(t,Nn(s),n),align:Ar(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function sE(e){return XM(e,yM)}function XM(e,t){var Co,Aa;const{anchor:n,positionMethod:r="absolute",side:s="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,collisionBoundary:a,collisionPadding:c=5,sticky:u=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:p,keepMounted:v=!1,floatingRootContext:x,mounted:b,collisionAvoidance:g,shift:m,nodeId:y,adaptiveOrigin:w,lazyFlip:k=!1,externalTree:N}=e,[E,C]=S.useState(null);!b&&E!==null&&C(null);const P=g.side||"flip",I=g.align||"flip",z=g.fallbackAxisSide||"end",$=(m==null?void 0:m.crossAxis)??!1,A=m==null?void 0:m.rootBoundary,R=typeof n=="function"?n:void 0,j=me(R),O=R?j:n,F=Ht(n),T=Ht(b),_=nE()==="rtl",U=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":_?"left":"right","inline-start":_?"right":"left"}[s],L=i==="center"?U:`${U}-${i}`;let K=c;typeof K=="number"?K={top:K,right:K,bottom:K,left:K}:K&&(K={top:K.top||0,right:K.right||0,bottom:K.bottom||0,left:K.left||0});const W=1,q=s==="bottom"?W:0,H=s==="top"?W:0,G=s==="right"?W:0,B=s==="left"?W:0,Y={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:K},Q=S.useRef(null),Z=Ht(o),V=Ht(l),X=typeof o!="function"?o:0,ee=typeof l!="function"?l:0,he=[];p&&he.push(p),he.push(D_(Ee=>{const yt=By(Ee,s,_),Kt=typeof Z.current=="function"?Z.current(yt):Z.current,Rt=typeof V.current=="function"?V.current(yt):V.current;return{mainAxis:Kt,crossAxis:Rt,alignmentAxis:Rt}},[X,ee,_,s]));const Pe=I==="none"&&P!=="shift",ce=!Pe&&(u||$||P==="shift"),ve=P==="none"?null:L_({...Y,padding:{top:K.top+W+q,right:K.right+W+B,bottom:K.bottom+W+H,left:K.left+W+G},mainAxis:!$&&P==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),ue=Pe?null:$_({...Y,rootBoundary:A,mainAxis:I!=="none",crossAxis:ce,limiter:u||$?void 0:F_(Ee=>{if(!Q.current)return{};const{width:yt,height:Kt}=Q.current.getBoundingClientRect(),Rt=En(Nn(Ee.placement)),xn=Rt==="y"?yt:Kt,rn=Rt==="y"?K.left+K.right:K.top+K.bottom;return{offset:xn/2+rn/2}})},[Y,u,$,A,K,I]);P==="shift"||I==="shift"||i==="center"?he.push(ue,ve):he.push(ve,ue),he.push(H_({...Y,apply({elements:{floating:Ee},availableWidth:yt,availableHeight:Kt,rects:Rt}){if(!T.current)return;const xn=Ee.style;xn.setProperty(Ly,`${yt}px`),xn.setProperty(Hy,`${Kt}px`);const rn=ot(Ee).devicePixelRatio||1,{x:No,y:Hr,width:Ro,height:Yn}=Rt.reference,jn=(Math.round((No+Ro)*rn)-Math.round(No*rn))/rn,js=(Math.round((Hr+Yn)*rn)-Math.round(Hr*rn))/rn;xn.setProperty(YM,`${jn}px`),xn.setProperty(GM,`${js}px`)}}),VM(Ee=>({element:Q.current||Fe(Ee.elements.floating).createElement("div"),padding:Q.current?f:0,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Ee){var za,Da,Ui,qi,$a,Fa;const{elements:{floating:yt},middlewareData:Kt,placement:Rt,platform:xn,rects:rn,y:No}=Ee,Hr=Nn(Rt),Ro=Ar(Rt),Yn=En(Hr)==="y",jn=Q.current,js=typeof o=="function"?o(By(Ee,s,_)):o;let To;if(!jn&&Ro&&Math.abs(Yn?((za=Kt.shift)==null?void 0:za.x)||0:((Da=Kt.shift)==null?void 0:Da.y)||0)<=1)To=Ro==="start"===(Yn&&((Ui=xn.isRTL)==null?void 0:Ui.call(xn,yt))===!0)?"100%":"0%";else{const Xd=Yn?((qi=Kt.arrow)==null?void 0:qi.x)||0:(($a=Kt.arrow)==null?void 0:$a.y)||0,Zd=Yn?(jn==null?void 0:jn.clientWidth)||0:(jn==null?void 0:jn.clientHeight)||0;To=`${Xd+Zd/2}px`}let Wi=Hr==="top"||Hr==="left"?`calc(100% + ${js}px)`:`${-js}px`;return ce&&Yn&&Math.abs(((Fa=Kt.shift)==null?void 0:Fa.y)||0)>js&&(Wi=`${rn.reference.y+rn.reference.height/2-No}px`),yt.style.setProperty(QM,Yn?`${To} ${Wi}`:`${Wi} ${To}`),{}}},WM,w),fe(()=>{!b&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,x]);const Re=S.useMemo(()=>({ancestorScroll:!h,elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:ye,elements:ze,x:Ie,y:et,middlewareData:lt,update:re,placement:se,context:De,isPositioned:we,floatingStyles:at}=t({rootContext:x,open:v?b:void 0,placement:L,middleware:he,strategy:r,whileElementsMounted:v?void 0:(...Ee)=>My(...Ee,Re),nodeId:y,externalTree:N}),{sideX:nn,sideY:qt}=lt.adaptiveOrigin||UM,ne=we?r:"fixed",Be=S.useMemo(()=>{let Ee;return we?w?Ee={position:ne,[nn]:Ie,[qt]:et}:Ee={...at,position:ne}:Ee={position:ne,top:0,left:0},Ee[Ly]="100vw",Ee[Hy]="100vh",we||(Ee.opacity=0),Ee},[w,ne,nn,Ie,qt,et,at,we]),je=S.useRef(null);fe(()=>{if(!b)return;const Ee=F.current,yt=typeof Ee=="function"?Ee():Ee,Rt=(Vy(yt)?yt.current:yt)||null||null;Rt!==je.current&&(ye.setPositionReference(Rt),je.current=Rt)},[b,ye,O,F]),S.useEffect(()=>{if(!b)return;const Ee=F.current;typeof Ee!="function"&&Vy(Ee)&&Ee.current!==je.current&&(ye.setPositionReference(Ee.current),je.current=Ee.current)},[b,ye,O,F]),S.useEffect(()=>{if(v&&b&&ze.reference&&ze.floating)return My(ze.reference,ze.floating,re,Re)},[v,b,ze,re,Re]);const zt=Nn(se),gn=rE(s,zt,_),qn=Ar(se)||"center",Kn=!!((Co=lt.hide)!=null&&Co.referenceHidden);fe(()=>{k&&b&&we&&zt!==U&&C(zt)},[k,b,we,zt,U]);const ko=S.useMemo(()=>{var Ee,yt;return{position:"absolute",top:(Ee=lt.arrow)==null?void 0:Ee.y,left:(yt=lt.arrow)==null?void 0:yt.x}},[lt.arrow]),Eo=((Aa=lt.arrow)==null?void 0:Aa.centerOffset)!==0;return S.useMemo(()=>({positionerStyles:Be,arrowStyles:ko,arrowRef:Q,arrowUncentered:Eo,side:gn,align:qn,physicalSide:zt,anchorHidden:Kn,refs:ye,context:De,isPositioned:we,update:re}),[Be,ko,Q,Eo,gn,qn,zt,Kn,ye,De,we,re])}function Vy(e){return e!=null&&"current"in e}const oE=S.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return d.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function t0(e){return e==="starting"?VO:kt}function iE(e,t,{styles:n,transitionStatus:r,props:s,refs:o,hidden:i,inert:l=!1}){const a={...n};return l&&(a.pointerEvents="none"),Ut("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:i,style:a},t0(r),s],stateAttributesMapping:Sg})}let Wy={},Uy={},qy="";function _d(e,t){return Na(e)?e:t}function Ky(e,t,n){return/hidden|clip/.test(e.getComputedStyle(_d(t,n)).overflowY)}function ZM(e){if(typeof document>"u")return!1;const t=Fe(e);return ot(t).innerWidth-t.documentElement.clientWidth>0}function JM(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Fe(e),r=n.documentElement,s=n.body,o=_d(r,s),i=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const a=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=l,a===c}function eA(e){const t=Fe(e),n=t.documentElement,r=t.body,s=_d(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function tA(e){var p;const t=Fe(e),n=t.documentElement,r=t.body,s=ot(n);let o=0,i=0,l=!1;const a=tr.create();if(wo&&(((p=s.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function c(){const v=s.getComputedStyle(n),x=s.getComputedStyle(r),m=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Wy={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},qy=n.style.scrollBehavior,Uy={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,w=n.scrollWidth>n.clientWidth,k=v.overflowY==="scroll"||x.overflowY==="scroll",N=v.overflowX==="scroll"||x.overflowX==="scroll",E=Math.max(0,s.innerWidth-r.clientWidth),C=Math.max(0,s.innerHeight-r.clientHeight),P=parseFloat(x.marginTop)+parseFloat(x.marginBottom),I=parseFloat(x.marginLeft)+parseFloat(x.marginRight),z=_d(n,r);if(l=JM(e),l){n.style.scrollbarGutter=m,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:m,overflowY:"hidden",overflowX:"hidden"}),(y||k)&&(n.style.overflowY="scroll"),(w||N)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:P||C?`calc(100dvh - ${P+C}px)`:"100dvh",width:I||E?`calc(100vw - ${I+E}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Wy),Object.assign(r.style,Uy),l||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=qy)}function f(){u(),a.request(c)}c();const h=ke(s,"resize",f);return()=>{a.cancel(),u(),typeof s.removeEventListener=="function"&&h()}}class nA{constructor(){ge(this,"lockCount",0);ge(this,"restore",null);ge(this,"timeoutLock",In.create());ge(this,"timeoutUnlock",In.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 n=Fe(t),r=n.documentElement,s=n.body,o=ot(r);if(Ky(o,r,s)){const l=new o.MutationObserver(()=>{Ky(o,r,s)||(l.disconnect(),this.restore=null,this.lock(t))}),a={attributes:!0};l.observe(r,a),l.observe(s,a),this.restore=()=>l.disconnect();return}const i=vd||!ZM(t);this.restore=i?eA(t):tA(t)}}const rA=new nA;function lE(e=!0,t=null){fe(()=>{if(e)return rA.acquire(t)},[e,t])}const sA=20;function oA(e,t,n,r){const[s,o]=S.useState(!1);fe(()=>{if(!e||!t||n==null){o(!1);return}const i=Fe(n).documentElement.clientWidth,l=n.offsetWidth;o(i>0&&l>0&&l>=i-sA)},[e,t,n]),lE(e&&(!t||s),r)}const iA=S.forwardRef(function(t,n){const{render:r,className:s,style:o,anchor:i,positionMethod:l,side:a,align:c,sideOffset:u,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:p,arrowPadding:v,sticky:x,disableAnchorTracking:b=!1,collisionAvoidance:g=xk,...m}=t,y=Pa(),w=$M(),k=KO(),N=y.useState("floatingRootContext"),E=y.useState("mounted"),C=y.useState("open"),P=y.useState("openChangeReason"),I=y.useState("activeTriggerElement"),z=y.useState("modal"),$=y.useState("openMethod"),A=y.useState("positionerElement"),R=y.useState("instantType"),j=y.useState("transitionStatus"),O=y.useState("adaptiveOrigin"),F=S.useRef(null),T=Hk(A),M=sE({anchor:i,floatingRootContext:N,positionMethod:l,mounted:E,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:v,collisionBoundary:h,collisionPadding:p,sticky:x,disableAnchorTracking:b,keepMounted:w,nodeId:k,collisionAvoidance:g,adaptiveOrigin:O}),_=N.useState("domReferenceElement");fe(()=>{const q=_,H=F.current;if(q&&(F.current=q),H&&q&&q!==H){y.set("instantType",void 0);const G=new AbortController;return T(()=>{y.set("instantType","trigger-change")},G.signal),()=>{G.abort()}}},[_,T,y]);const U=z===!0&&P!==St;oA(C&&U,$==="touch",A,I);const L=y.useStateSetter("positionerElement"),K={open:C,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:R},W=iE(t,K,{styles:M.positionerStyles,transitionStatus:j,props:m,refs:[n,L],hidden:!E,inert:!C});return d.jsxs(tE.Provider,{value:M,children:[E&&U&&d.jsx(oE,{inert:e0(!C),cutout:I}),d.jsx(YO,{id:k,children:W})]})}),jp="ArrowUp",Op="ArrowDown",_p="ArrowLeft",Mp="ArrowRight",Ap="Home",zp="End",n0=new Set([jp,Op,_p,Mp,Ap,zp]),lA="Shift",aA=[lA,"Control","Alt","Meta"];function cA(e){return Ve(e)&&e.tagName==="INPUT"}function Yy(e){return!!(cA(e)&&e.selectionStart!=null||Ve(e)&&e.tagName==="TEXTAREA")}function Gy(e,t,n,r){if(!e||!t||!t.scrollTo)return;let s=e.scrollLeft,o=e.scrollTop;const i=e.clientWidth<e.scrollWidth,l=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const a=Qy(e,t,"left"),c=xc(e),u=xc(t);n==="ltr"&&(a+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight?s=a+t.offsetWidth+u.scrollMarginRight-e.clientWidth+c.scrollPaddingRight:a-u.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft&&(s=a-u.scrollMarginLeft-c.scrollPaddingLeft)),n==="rtl"&&(a-u.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft?s=a-u.scrollMarginLeft-c.scrollPaddingLeft:a+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight&&(s=a+t.offsetWidth+u.scrollMarginRight-e.clientWidth+c.scrollPaddingRight))}if(l&&r!=="horizontal"){const a=Qy(e,t,"top"),c=xc(e),u=xc(t);a-u.scrollMarginTop<e.scrollTop+c.scrollPaddingTop?o=a-u.scrollMarginTop-c.scrollPaddingTop:a+t.offsetHeight+u.scrollMarginBottom>e.scrollTop+e.clientHeight-c.scrollPaddingBottom&&(o=a+t.offsetHeight+u.scrollMarginBottom-e.clientHeight+c.scrollPaddingBottom)}e.scrollTo({left:s,top:o,behavior:"auto"})}function Qy(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[r],t.offsetParent!==e);)t=t.offsetParent;return s}function xc(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const uA=S.createContext(void 0);function dA(e){return S.useContext(uA)}const fA=S.createContext(void 0);function hA(){const[e,t]=S.useState(0),n=me(()=>(t(s=>s+1),()=>{t(s=>Math.max(0,s-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const pA=S.forwardRef(function(t,n){const{render:r,className:s,style:o,initialFocus:i,finalFocus:l,...a}=t,c=Pa(),u=LM(),f=dA()!=null,{context:h,hasClosePart:p}=hA(),v=c.useState("open"),x=c.useState("openMethod"),b=c.useState("instantType"),g=c.useState("transitionStatus"),m=c.useState("popupProps"),y=c.useState("titleElementId"),w=c.useState("descriptionElementId"),k=c.useState("modal"),N=c.useState("mounted"),E=c.useState("openChangeReason"),C=c.useState("activeTriggerElement"),P=c.useState("floatingRootContext"),I=P.useState("floatingId"),z=c.useState("disabled"),$=c.useState("openOnHover"),A=c.useState("closeDelay");Ta({open:v,ref:c.context.popupRef,onComplete(){var M,_;v&&((_=(M=c.context).onOpenChangeComplete)==null||_.call(M,!0))}}),Gk(P,{enabled:$&&!z,closeDelay:A});const R=i===void 0?Bk(c.context.popupRef):i,j=k!==!1&&p;c.useSyncedValue("focusManagerModal",j);const O=c.useStateSetter("popupElement"),F={open:v,side:u.side,align:u.align,instant:b,transitionStatus:g},T=Ut("div",t,{state:F,ref:[n,c.context.popupRef,O],props:[m,{id:I,role:"dialog",...Fg,"aria-labelledby":y,"aria-describedby":w,onKeyDown(M){f&&n0.has(M.key)&&M.stopPropagation()}},t0(g),a],stateAttributesMapping:kg});return d.jsx(Ck,{context:P,openInteractionType:x,modal:j,disabled:!N||E===St,initialFocus:R,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Ve(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:d.jsx(fA.Provider,{value:h,children:T})})}),Ii=TM,ji=DM,fo=S.forwardRef(({className:e,side:t="bottom",align:n="end",sideOffset:r=4,...s},o)=>d.jsx(FM,{children:d.jsx(iA,{side:t,align:n,sideOffset:r,collisionPadding:8,className:"z-40",children:d.jsx(pA,{ref:o,className:st("rise w-72 overflow-hidden rounded-md border border-line bg-popover/95 text-zinc-300 shadow-xl backdrop-blur focus-visible:outline-none",e),...s})})}));fo.displayName="PopoverContent";const mA=48,gA=60,xA=24;function yA({glyph:e,label:t,placeholder:n,value:r,onChange:s,options:o,loading:i,failed:l,search:a,onSearchChange:c,hasMore:u,loadingMore:f,onLoadMore:h,allowCustom:p=!0,title:v}){const[x,b]=S.useState(!1),[g,m]=S.useState(""),y=c!==void 0,w=y?a??"":g,k=y?c:m,N=S.useMemo(()=>{const j=w.trim().toLowerCase(),O=j&&!y?o.filter(T=>T.value.toLowerCase().includes(j)):o;return[...r.filter(T=>!O.some(M=>M.value===T)).filter(T=>!j||T.toLowerCase().includes(j)).map(T=>({value:T,count:0})),...O]},[o,w,y,r]),E=S.useRef(null),C=()=>{const j=E.current;!j||!u||f||!h||j.scrollTop+j.clientHeight>=j.scrollHeight-mA&&h()},P=j=>{s(r.includes(j)?r.filter(O=>O!==j):[...r,j])},I=N.length>gA,z=lg({count:N.length,getScrollElement:()=>E.current,estimateSize:()=>xA,overscan:8,enabled:I}),$=j=>{const O=r.includes(j.value);return d.jsxs("button",{type:"button",role:"option","aria-selected":O,onClick:()=>P(j.value),className:st("mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-zinc-800",O?"text-zinc-100":"text-zinc-400"),children:[d.jsx("span",{className:"w-3 shrink-0",children:O&&d.jsx(ug,{width:12,height:12})}),d.jsx("span",{className:"truncate",children:j.value}),d.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-zinc-600",children:j.count})]},j.value)},A=w.trim(),R=p&&A!==""&&!N.some(j=>j.value===A)&&!r.includes(A);return d.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-zinc-600",children:[e!==void 0&&d.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:e}),d.jsxs(Ii,{open:x,onOpenChange:b,children:[d.jsx(ji,{render:d.jsx("button",{type:"button","aria-label":t,title:v??t,className:"mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-zinc-200 focus:outline-none"}),children:r.length===0?d.jsx("span",{className:"text-zinc-600",children:n}):r.map(j=>d.jsx(Xe,{className:"mono max-w-[10rem] truncate",children:j},j))}),d.jsxs(fo,{align:"start",className:"w-72 p-0",children:[d.jsx("div",{className:"border-b border-line px-2",children:d.jsx(mg,{autoFocus:!0,value:w,onChange:j=>k(j.target.value),placeholder:p?"search, or type a value…":"search…",onKeyDown:j=>{j.key!=="Enter"||!R||(j.preventDefault(),P(A),k(""))}})}),d.jsxs("div",{ref:E,onScroll:C,className:"max-h-64 overflow-auto py-1",role:"listbox",tabIndex:-1,"aria-multiselectable":!0,"aria-label":t,children:[R&&d.jsxs("button",{type:"button","aria-label":`use ${A} as typed`,onClick:()=>{P(A),k("")},className:"mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs text-zinc-300 hover:bg-zinc-800",children:[d.jsx("span",{className:"w-3 shrink-0 text-zinc-600",children:"+"}),d.jsx("span",{className:"truncate",children:A}),d.jsx("span",{className:"ml-auto text-[10px] text-zinc-600",children:"use as typed"})]}),f&&N.length>0&&d.jsx("p",{className:"px-2 py-1 text-[10px] text-zinc-600",children:"loading more…"}),N.length===0&&!R&&d.jsx("p",{className:st("px-2 py-2 text-[11px]",l?"text-rose-300":"text-zinc-600"),children:l?"couldn't load values — type one instead":i?"loading…":"no values here"}),I?d.jsx("div",{className:"relative w-full",style:{height:`${z.getTotalSize()}px`},children:z.getVirtualItems().map(j=>{var O;return d.jsx("div",{ref:z.measureElement,"data-index":j.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${j.start}px)`},children:$(N[j.index])},((O=N[j.index])==null?void 0:O.value)??j.key)})}):N.map($)]})]})]}),r.length>0&&d.jsx(Se,{variant:"ghost",size:"icon",onClick:()=>s([]),title:`clear ${t}`,"aria-label":`clear ${t}`,className:"h-4 w-4",children:d.jsx(Ss,{width:12,height:12})})]})}const Xy=50,vA=200;function wA(e,t){const[n,r]=S.useState(e);return S.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function bA(e){return e.filter(t=>t.value!==null).map(t=>({value:t.value,count:t.count}))}function zu({field:e,scope:t,value:n,onChange:r,glyph:s,label:o,placeholder:i,title:l,single:a}){const[c,u]=S.useState(""),f=wA(c,vA),h=ZR({queryKey:["run-values",e,t,f],queryFn:({pageParam:v})=>$e.values(e,t,{limit:Xy,offset:v,search:f}),initialPageParam:0,getNextPageParam:(v,x)=>v.length<Xy?void 0:x.reduce((b,g)=>b+g.length,0),staleTime:1e4}),p=S.useMemo(()=>{var v;return bA(((v=h.data)==null?void 0:v.pages.flat())??[])},[h.data]);return d.jsx(yA,{label:o,placeholder:i,...l!==void 0&&{title:l},...s!==void 0&&{glyph:s},value:n,onChange:v=>r(a?v.slice(-1):v),options:p,search:c,onSearchChange:u,loading:h.isLoading,failed:h.isError,hasMore:h.hasNextPage,loadingMore:h.isFetchingNextPage,onLoadMore:()=>void h.fetchNextPage()})}const aE=[{op:"eq",label:"is"},{op:"in",label:"is any of"},{op:"ne",label:"is not"},{op:"gte",label:"≥"},{op:"gt",label:">"},{op:"lte",label:"≤"},{op:"lt",label:"<"}];function SA(e){const[t,n,...r]=e.split(":");return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(":")}}function yc(e){var r;const t=SA(e);if(!t)return e;const n=((r=aE.find(s=>s.op===t.op))==null?void 0:r.label)??t.op;return`${t.key} ${n} ${t.operand.split("|").join(", ")}`}function kA({value:e,onChange:t,scope:n}){const[r,s]=S.useState(!1),[o,i]=S.useState(""),[l,a]=S.useState("eq"),[c,u]=S.useState([]),[f,h]=S.useState(""),p=l==="eq"||l==="in",v=p?c.join("|"):f.trim(),x=o!==""&&v!=="",b=()=>{i(""),a("eq"),u([]),h("")},g=()=>{if(!x)return;const m=l==="in"&&c.length===1?"eq":l;t([...e,`${o}:${m}:${v}`]),b(),s(!1)};return d.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-zinc-600",children:[d.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"⛃"}),d.jsxs(Ii,{open:r,onOpenChange:m=>{s(m),m||b()},children:[d.jsx(ji,{render:d.jsx("button",{type:"button","aria-label":"filter by search attribute",title:"Typed search attributes (WorkflowRun.searchAttributes)",className:"mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-zinc-200 focus:outline-none"}),children:e.length===0?d.jsx("span",{className:"text-zinc-600",children:"filter by attribute…"}):e.map(m=>d.jsx(Xe,{variant:"attr",className:"mono max-w-[12rem] truncate",children:yc(m)},m))}),d.jsx(fo,{align:"start",className:"w-80 p-2",children:d.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1 border-b border-line pb-1.5",children:e.map(m=>d.jsxs(Xe,{variant:"attr",className:"mono gap-1 py-0.5",children:[yc(m),d.jsx(Se,{variant:"ghost",size:"icon",className:"h-3 w-3 text-indigo-300/70 hover:text-indigo-100",title:`remove ${yc(m)}`,"aria-label":`remove ${yc(m)}`,onClick:()=>t(e.filter(y=>y!==m)),children:d.jsx(Ss,{width:10,height:10})})]},m))}),d.jsx(zu,{field:"attr",scope:n,glyph:"⛃",label:"attribute key",placeholder:"key…",single:!0,value:o?[o]:[],onChange:m=>{i(m.at(-1)??""),u([])}}),d.jsx("select",{"aria-label":"operator",value:l,onChange:m=>a(m.target.value),className:"mono rounded-md border border-line bg-transparent px-2 py-1.5 text-xs text-zinc-200 focus:border-zinc-600 focus:outline-none",children:aE.map(m=>d.jsx("option",{value:m.op,className:"bg-zinc-900",children:m.label},m.op))}),p?d.jsx(zu,{field:`attr.${o}`,scope:n,glyph:"=",label:"attribute value",placeholder:o?"value…":"pick a key first",...l!=="in"&&{single:!0},value:c,onChange:u}):d.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-line px-2 focus-within:border-zinc-600",children:[d.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"="}),d.jsx(mg,{value:f,onChange:m=>h(m.target.value),placeholder:"value…","aria-label":"attribute value",onKeyDown:m=>{m.key==="Enter"&&g()}})]}),d.jsx(Se,{variant:"brand",size:"chip",className:"mono self-end rounded",disabled:!x,onClick:g,children:"add filter"})]})})]}),e.length>0&&d.jsx(Se,{variant:"ghost",size:"icon",onClick:()=>t([]),title:"clear attribute filters","aria-label":"clear attribute filters",className:"h-4 w-4",children:d.jsx(Ss,{width:12,height:12})})]})}const cE={workflow:d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"3",y:"4",width:"6",height:"6",rx:"1.5"}),d.jsx("rect",{x:"15",y:"14",width:"6",height:"6",rx:"1.5"}),d.jsx("path",{d:"M9 7h4a2 2 0 0 1 2 2v5"})]}),telescope:d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"m4 14 13-6 2 4-13 6z"}),d.jsx("path",{d:"m10 16 2 5M14 15l-2 6M17 8l1-3 3 1-1 3"})]}),media:d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),d.jsx("circle",{cx:"9",cy:"10",r:"2"}),d.jsx("path",{d:"m21 16-5-5-9 9"})]}),payments:d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"2.5",y:"5",width:"19",height:"14",rx:"2"}),d.jsx("path",{d:"M2.5 10h19M6.5 15h4"})]}),agent:d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"5",y:"8",width:"14",height:"11",rx:"3"}),d.jsx("path",{d:"M12 8V4M9 13h.01M15 13h.01M9.5 16.5h5"}),d.jsx("circle",{cx:"12",cy:"3.5",r:"0.5"})]}),identity:d.jsxs(d.Fragment,{children:[d.jsx("path",{d:"M12 3 4.5 6v5.5c0 4.5 3.2 8.2 7.5 9.5 4.3-1.3 7.5-5 7.5-9.5V6z"}),d.jsx("circle",{cx:"12",cy:"10",r:"2.5"}),d.jsx("path",{d:"M8 16a4.5 4.5 0 0 1 8 0"})]}),generic:d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),d.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]})};function uE(e){return typeof e=="string"&&Object.hasOwn(cE,e)?e:"generic"}function Zy({icon:e,className:t}){const n=uE(e);return d.jsx("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true","data-icon":n,children:cE[n]})}function dE(e){return typeof e=="string"&&e.startsWith("/")&&!e.startsWith("//")}function EA(e){if(typeof document>"u")return;const t=document.getElementById(e);if(t!==null)try{const n=JSON.parse(t.textContent??""),r=n==null?void 0:n.switcher;return!r||!dE(r.endpoint)||typeof r.others!="number"||r.others<=0?void 0:{endpoint:r.endpoint,others:r.others}}catch{return}}function CA(e){return Array.isArray(e)?e.flatMap(t=>{if(typeof t!="object"||t===null)return[];const n=t;return typeof n.id!="string"||typeof n.title!="string"||!dE(n.href)?[]:[{id:n.id,title:n.title,icon:uE(n.icon),href:n.href}]}):[]}let ol;function NA(e){if((ol==null?void 0:ol.endpoint)===e.endpoint)return ol.result;const t=fetch(e.endpoint,{headers:{accept:"application/json"},credentials:"same-origin"}).then(async n=>{var r;return n.ok?CA((r=await n.json())==null?void 0:r.consoles):[]}).catch(()=>[]);return ol={endpoint:e.endpoint,result:t},t}function RA({brand:e,current:t,config:n}){const[r,s]=S.useState([]),[o,i]=S.useState(!1),l=S.useRef(null),a=S.useRef(null),c=S.useRef(null);S.useEffect(()=>{if(!n)return;let x=!0;return NA(n).then(b=>{x&&s(b)}),()=>{x=!1}},[n]);const u=S.useCallback(x=>{var b;i(!1),x&&((b=a.current)==null||b.focus())},[]);S.useEffect(()=>{if(!o)return;const x=b=>{l.current&&!l.current.contains(b.target)&&u(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o,u]);const f=()=>{var x;return Array.from(((x=c.current)==null?void 0:x.querySelectorAll('[role="menuitem"]'))??[])},h=x=>{var g;const b=f();b.length>0&&((g=b[(x+b.length)%b.length])==null||g.focus())};if(S.useEffect(()=>{var x,b;o&&((b=(x=c.current)==null?void 0:x.querySelector('[role="menuitem"]'))==null||b.focus())},[o]),!n||r.length===0)return d.jsx(d.Fragment,{children:e});const p=x=>{const b=f().indexOf(document.activeElement),m={ArrowDown:()=>h(b+1),ArrowUp:()=>h(b-1),Home:()=>h(0),End:()=>h(-1),Escape:()=>u(!0)}[x.key];m?(x.preventDefault(),m()):x.key==="Tab"&&u(!1)},v="flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-foreground outline-none focus:bg-panel";return d.jsxs("div",{ref:l,className:"relative","data-aviary-switcher":"",children:[d.jsxs("button",{ref:a,type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-label":`${t.title}: switch console`,className:"flex items-center gap-1.5 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>i(x=>!x),onKeyDown:x=>{(x.key==="ArrowDown"||x.key==="Enter"||x.key===" ")&&(x.preventDefault(),i(!0))},children:[e,d.jsx("svg",{viewBox:"0 0 24 24",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:2,className:"text-muted-foreground","aria-hidden":"true",children:d.jsx("path",{d:"m6 9 6 6 6-6"})})]}),o&&d.jsxs("div",{ref:c,role:"menu","aria-label":"Consoles",tabIndex:-1,onKeyDown:p,className:"fixed inset-x-0 top-14 z-50 border-y border-line bg-popover p-1 shadow-lg shadow-black/50 sm:absolute sm:inset-x-auto sm:left-0 sm:top-full sm:mt-2 sm:w-60 sm:rounded-lg sm:border",children:[d.jsxs("div",{role:"menuitem","aria-current":"page","aria-disabled":"true",tabIndex:-1,className:v,children:[d.jsx(Zy,{icon:t.icon,className:"text-brand"}),d.jsx("span",{className:"truncate",children:t.title}),d.jsx("svg",{viewBox:"0 0 24 24",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:2,className:"ml-auto text-brand","aria-hidden":"true",children:d.jsx("path",{d:"m5 12 5 5 9-10"})})]}),r.map(x=>d.jsxs("a",{role:"menuitem",href:x.href,tabIndex:-1,className:`${v} hover:bg-panel`,children:[d.jsx(Zy,{icon:x.icon,className:"text-muted-foreground"}),d.jsx("span",{className:"truncate",children:x.title})]},x.id))]})]})}function TA({facets:e,value:t,onChange:n}){return e.length===0||!BI(e)&&t.kind==="all"?null:d.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5",children:[d.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-zinc-600",children:"origin"}),e.map(r=>{const s=FI(t,r.filter);return d.jsxs(Se,{variant:"ghost",size:"chip","aria-pressed":s,title:r.title,onClick:()=>n(r.filter),className:st("mono max-w-full gap-1 rounded-md",r.filter.kind==="unknown"&&"italic text-zinc-500",s&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[d.jsx("span",{className:"truncate",children:r.label}),d.jsx("span",{className:"tnum shrink-0 text-zinc-600",children:r.count})]},fS(r.filter))})]})}function Md(e){return`#/workflow/${encodeURIComponent(e)}`}function Jy(e){const t=e.match(/^#\/workflow\/(.+)$/);return t!=null&&t[1]?decodeURIComponent(t[1]):void 0}function PA(e){const t=[];return e.where&&t.push("where"),e.input&&t.push("input"),e.coalesce&&t.push(e.coalesce.keyed?`${e.coalesce.mode} by key`:e.coalesce.mode),e.local||t.push("announced"),t}function ev(e,t){const n=e==null?void 0:e[t];if(n)return n.failed>0?`${n.triggered} started · ${n.failed} failed`:`${n.triggered} started`}function tv({title:e,empty:t,links:n,counts:r}){return d.jsxs("section",{"aria-label":e,className:"min-w-0",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:e}),n.length===0?d.jsx("p",{className:"mt-1 text-[11px] text-zinc-600",children:t}):d.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:n.map(s=>{var o;return d.jsxs("li",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsx("a",{href:Md(s.workflow),className:"mono text-[12px] text-zinc-200 underline-offset-2 hover:underline",children:s.workflow}),d.jsxs(Xe,{className:s.kind==="failed"?"s-failed":"s-completed",children:["on ",s.kind]}),PA(s).map(i=>d.jsx(Xe,{children:i},i)),ev(r,s.workflow)&&d.jsx("span",{className:`mono text-[10px] ${(o=r==null?void 0:r[s.workflow])!=null&&o.failed?"text-bad":"text-zinc-500"}`,title:"Counted by this dashboard's server process since it started",children:ev(r,s.workflow)})]},`${s.workflow}:${s.kind}`)})})]})}function fE({links:e,counts:t}){return d.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[d.jsx(tv,{title:"Starts when it settles",empty:"No workflow starts when it settles.",links:e.startsOnSettle,counts:t}),d.jsx(tv,{title:"Started by",empty:"No workflow's settling starts it.",links:e.startedBy})]})}function IA({workflow:e}){const{data:t,error:n,isPending:r}=Xt({queryKey:["workflow-lifecycle",e],queryFn:()=>$e.workflowLifecycle(e),refetchInterval:1e4});return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"border-b border-line px-7 py-5",children:[d.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e}),d.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Lifecycle events: registered here and announced by live workers."})]}),d.jsx("div",{className:"px-7 py-5",children:n?d.jsx("p",{className:"text-[11px] text-bad",children:n instanceof Error?n.message:String(n)}):r||!t?d.jsx("p",{className:"text-[11px] text-zinc-600",children:"Loading…"}):d.jsx(fE,{links:t,counts:t.triggerCounts})})]})}function bo(e){const t="spawn:",n="signal:child:";if(e.name.startsWith(t))return e.name.slice(t.length);if(e.name.startsWith(n))return e.name.slice(n.length)}function jA(e){const t="signal:runwait:",n="timeout:run:";if(e.name.startsWith(n))return e.name.slice(n.length)||void 0;if(!e.name.startsWith(t))return;const r=e.name.slice(t.length),s=`#${e.runId}#`,o=r.lastIndexOf(s);return o>0?r.slice(0,o):void 0}const hE=50;function r0(e,t=hE){const n=new Set;for(const r of e){if(n.size>=t)break;const s=bo(r);s!==void 0&&n.add(s)}return[...n]}function pE(e,t){const n=`${t}.`;return`child ${e.startsWith(n)?e.slice(n.length):e}`}const OA=12;function _A(e,t,n=OA){const r=e.slice(0,n);return{shown:r,more:Math.max(0,(t??e.length)-r.length)}}function MA(e){return{...e.triggeredBy?{startedBy:{...e.triggeredBy}}:{},triggered:[...e.triggered??[]]}}function mE(e){const t={};for(const n of e)n.data&&(t[n.data.run.id]=n.data);return t}function AA(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString().slice(11,23)}function zA(e,t){if(e.type==="run.triggered")return e.triggeredRunId?[{label:"started",runId:e.triggeredRunId}]:[];if(e.type.startsWith("step.")&&e.name){const n=bo({name:e.name});return n?[{label:"child",runId:n}]:[]}return e.type==="run.started"?[...t.sourceRunId?[{label:"started by",runId:t.sourceRunId}]:[],...t.parentRunId?[{label:"parent",runId:t.parentRunId}]:[]]:[]}function DA(e){return e==="run.failed"||e==="step.failed"||e==="run.trigger_failed"?"text-bad":e==="run.completed"||e==="step.completed"||e==="run.triggered"?"text-emerald-300":"text-zinc-300"}function $A({tail:e,sourceRunId:t,parentRunId:n,onOpenRun:r}){const s=S.useSyncExternalStore(e.subscribe,e.snapshot,e.snapshot);return d.jsxs("section",{"aria-label":"Events",className:"mt-3",children:[d.jsxs("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:["Events ",d.jsx("span",{className:"normal-case tracking-normal text-zinc-600",children:"(live)"})]}),s.length===0?d.jsxs("p",{className:"mt-1 text-[11px] text-zinc-600","data-testid":"events-empty",children:["No events yet. This shows the engine events of this run that arrive while the page is open (the last ",e.limit,"); they are not stored."]}):d.jsx("ol",{className:"mt-1 flex max-h-60 flex-col gap-0.5 overflow-y-auto",children:[...s].reverse().map(({id:o,event:i})=>{var l;return d.jsxs("li",{className:"flex flex-wrap items-center gap-1.5 text-[11px]","data-type":i.type,children:[d.jsx("span",{className:"mono text-zinc-600",title:i.at,children:AA(i.at)}),d.jsx("span",{className:`mono ${DA(i.type)}`,children:i.type}),i.name&&(i.type==="run.triggered"||i.type==="run.trigger_failed"?d.jsx("a",{href:Md(i.name),className:"mono text-zinc-200 underline-offset-2 hover:underline",children:i.name}):d.jsx("span",{className:"mono text-zinc-400",children:i.name})),i.seq!=null&&d.jsxs(Xe,{className:"text-[10px]",children:["#",i.seq]}),zA(i,{sourceRunId:t,parentRunId:n}).map(a=>d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-[10px] text-zinc-600",children:a.label}),d.jsx(Se,{variant:"chip",size:"xs",onClick:()=>r(a.runId),className:"mono max-w-[24rem] truncate px-1.5 py-0",title:a.runId,children:a.runId})]},`${a.label}:${a.runId}`)),((l=i.error)==null?void 0:l.message)&&d.jsx("span",{className:"text-bad",children:i.error.message}),i.reason&&d.jsx("span",{className:"text-zinc-500",children:i.reason})]},o)})})]})}const pl=100;function FA(e,t,n=pl){if(e===void 0||t===void 0)return[0];const r=[];for(let s=Math.floor(e/n);s<=Math.floor(t/n);s+=1)r.push(s);return r}const LA="fan:";function Dp(e){var n;if(!e.name.startsWith(LA))return;const t=(n=e.output)==null?void 0:n.values;return Array.isArray(t)?t.length:void 0}function gE(e){const t=Dp(e);return t===void 0?e.name:`${t} child run${t===1?"":"s"}`}function HA(e){if(e.length===0)return"";let t=e[0]??"";for(const n of e.slice(1)){let r=0;for(;r<t.length&&r<n.length&&t[r]===n[r];)r+=1;t=t.slice(0,r)}return t.replace(/[\s._:-]+$/,"")}function BA(e){if(e.some(n=>Dp(n)!==void 0))return`child runs ×${e.reduce((r,s)=>r+(Dp(s)??1),0)}`;const t=HA(e.map(n=>n.name));return`${t.length>=2?t:"parallel"} ×${e.length}`}function VA(e){var t;return e.kind==="single"?e.step.seq:e.kind==="fan"?((t=e.steps[0])==null?void 0:t.seq)??Number.POSITIVE_INFINITY:e.fan.firstSeq}function xE(e,t=[]){const n=WA(e);if(t.length===0)return n;const r=[...t].sort((i,l)=>i.firstSeq-l.firstSeq),s=[];let o=0;for(const i of n){const l=VA(i);for(;o<r.length&&r[o].firstSeq<l;)s.push({kind:"summary",fan:r[o]}),o+=1;s.push(i)}for(;o<r.length;o+=1)s.push({kind:"summary",fan:r[o]});return s}function WA(e){var r;const t=[];let n=0;for(;n<e.length;){const s=e[n];if(s===void 0){n+=1;continue}const o=s.parallelGroup;if(o===void 0||o===""){t.push({kind:"single",step:s}),n+=1;continue}const i=[];let l=n;for(;l<e.length&&((r=e[l])==null?void 0:r.parallelGroup)===o;){const a=e[l];a!==void 0&&i.push(a),l+=1}i.length<=1?t.push({kind:"single",step:i[0]??s}):t.push({kind:"fan",group:o,steps:i,label:BA(i)}),n=l}return t}function s0(e,t=!1){const n=e.counts.running??0,r=e.counts.pending??0,s=e.notStarted??0;return{completed:e.counts.completed??0,failed:e.counts.failed??0,running:t?0:n,pending:t?0:r,interrupted:t?n+r:0,notStarted:t?0:s,skipped:t?s:0,started:e.size,total:e.total??e.size}}function o0(e,t=!1){const n=s0(e,t);return n.running>0?"running":n.pending>0||n.notStarted>0?"pending":n.failed>0||n.interrupted>0?"failed":"completed"}function yE(e){return e.started<e.total?`${e.started} of ${e.total}`:`×${e.total}`}const UA=new Set(["completed","failed","cancelled","dead"]);function $p(e){return UA.has(e)}const Du=[{key:"completed",className:"bg-emerald-500/60",text:"text-emerald-300",label:"done"},{key:"failed",className:"bg-red-500/70",text:"text-red-300",label:"failed"},{key:"running",className:"bg-live/70",text:"text-live",label:"running"},{key:"pending",className:"bg-zinc-500/60",text:"text-zinc-300",label:"pending"},{key:"interrupted",className:"bg-amber-500/60",text:"text-amber-300",label:"interrupted"},{key:"notStarted",className:"bg-zinc-700/70",text:"text-zinc-400",label:"not started"},{key:"skipped",className:"bg-zinc-700/40",text:"text-zinc-500",label:"never ran"}],qA=9e4;function KA(e,t,n){var o;const r=((t==null?void 0:t.liveWorkers)??[]).filter(i=>n-i.lastBeatAt<=qA).sort((i,l)=>l.lastBeatAt-i.lastBeatAt)[0];if(r)return{kind:"working",instanceId:r.instanceId,beatAgoS:Math.max(0,Math.round((n-r.lastBeatAt)/1e3)),inFlight:(o=r.status)==null?void 0:o.inFlight};const s=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return{kind:"lost",minutes:Math.round((n-s)/6e4)}}const vE=[];function YA(e){const t=S.useMemo(()=>r0(e),[e]);return gm({queries:t.map(n=>({queryKey:["run",n],queryFn:()=>$e.run(n)})),combine:mE})}function wE(e,t,n){var i;if(t){const l=new Date(t.run.createdAt).getTime(),c=t.run.status==="running"||t.run.status==="suspended"?n:new Date(t.run.updatedAt).getTime();return[l,Math.max(c,l)]}const{subs:r}=ag(e.events??[]);let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(const l of r){l.startedAt!==void 0&&(s=Math.min(s,l.startedAt));const a=((i=l.terminal)==null?void 0:i.at)??l.startedAt;a!==void 0&&(o=Math.max(o,a))}return s!==Number.POSITIVE_INFINITY&&o!==Number.NEGATIVE_INFINITY?[s,o]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function bE(e,t,n){const r=e.status==="running"||e.status==="suspended",s=Date.now();let o=new Date(e.createdAt).getTime(),i=Number.NEGATIVE_INFINITY;for(const[l,a]of t)o=Math.min(o,l),i=Math.max(i,a);for(const l of n)l.startedAt&&(o=Math.min(o,new Date(l.startedAt).getTime())),l.finishedAt&&(i=Math.max(i,new Date(l.finishedAt).getTime()));return i=Math.max(i,r?s:o+1),{t0:o,span:Math.max(i-o,1),liveNow:s}}function i0(e,t,n,r=wE(e,t,n.liveNow)){const{t0:s,span:o}=n,[i,l]=r,{subs:a}=ag(e.events??[]),c=a.map(u=>{var p;const f=u.startedAt??i,h=((p=u.terminal)==null?void 0:p.at)??f;return{key:u.id,name:u.name,status:u.status??"ok",left:(f-s)/o*100,width:Math.max((h-f)/o*100,.8),ms:u.durationMs??Math.max(h-f,0)}});return{step:e,childId:bo(e),childRun:t,left:(i-s)/o*100,width:Math.max((l-i)/o*100,.8),ms:l-i,subRows:c}}function $u(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const GA={ok:"bg-emerald-500/40 ring-1 ring-emerald-500/50",failed:"bg-red-500/40 ring-1 ring-red-500/50",skipped:"bg-amber-500/35 ring-1 ring-amber-500/45"},QA={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Ad({row:e,run:t,childRuns:n,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:l,expanded:a,collapsedSubs:c,toggleSubs:u}){var z;const{step:f,left:h,width:p,ms:v,subRows:x}=e,b=f.status==="failed",g=bo(f),m=!!g,y=m?dg:fg(f.kind),w=s===`${f.runId}#${f.seq}`,k=m&&g!==void 0&&a.has(g),N=x.length>0&&!m,E=c.has(f.seq),C=GI(f,Date.now()),{data:P}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:1e4,enabled:C}),I=C?KA(f,P==null?void 0:P.find($=>$.group===f.workerGroup),Date.now()):void 0;return d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>o(f,t),title:m?"Child workflow — click for its detail (↗ opens its run)":void 0,className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${w?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[d.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[m&&g!==void 0&&d.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),l(g)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:k?"Collapse child run":"Expand child run inline",children:d.jsx("span",{className:"inline-block transition-transform",style:{transform:k?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),N&&d.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),u(f.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:E?`Show ${x.length} sub-process(es)`:"Hide sub-processes",children:d.jsx("span",{className:"inline-block transition-transform",style:{transform:E?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),d.jsx("span",{className:b?"text-red-400":m?"text-indigo-300":"text-emerald-400",children:d.jsx(y,{width:12,height:12})}),d.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:g!==void 0?((z=n[g])==null?void 0:z.run.workflow)??pE(g,f.runId):gE(f)}),m&&g!==void 0&&d.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),i(g)},title:"Open the child run",className:"shrink-0 text-indigo-300 transition-colors hover:text-indigo-100",children:"↗"})]}),d.jsxs("span",{className:"relative h-5",children:[d.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),d.jsx("span",{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] transition-all duration-500 ease-out ${b?"bg-red-500/35 ring-1 ring-red-500/50":w?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${h}%`,width:`${p}%`}}),d.jsx("span",{className:"mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-zinc-500",style:{left:`min(${h+p}%, calc(100% - 44px))`},children:$u(v)})]})]}),(I==null?void 0:I.kind)==="working"&&d.jsxs("div",{className:"mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] text-emerald-500/80",title:"A live worker holds this dispatch — its heartbeat is fresh. Long steps are expected to sit here; only re-dispatch if the heartbeat goes stale.",children:[d.jsx("span",{"aria-hidden":!0,children:"⚙"}),"being worked by ",I.instanceId," — heartbeat ",I.beatAgoS,"s ago",I.inFlight!==void 0?` · ${I.inFlight} in flight`:""]}),(I==null?void 0:I.kind)==="lost"&&d.jsxs("div",{className:"mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] s-stale",title:"No live worker heartbeat on this step's group — reconcile-wake can't recover a stuck `pending` step; re-dispatch it from the run actions above",children:[d.jsx("span",{"aria-hidden":!0,children:"⚠"}),"awaiting worker result — dispatched ",I.minutes,"m ago, no live worker (possibly lost)"]}),x.length>0&&!E&&d.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2",children:x.map($=>d.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${$.name} — ${$.status}`,children:[d.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[d.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${QA[$.status]}`}),d.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:$.name})]}),d.jsxs("span",{className:"relative h-3",children:[d.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),d.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${GA[$.status]}`,style:{left:`${$.left}%`,width:`${$.width}%`}}),d.jsx("span",{className:"mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[9px] text-zinc-600",style:{left:`min(${$.left+$.width}%, calc(100% - 38px))`},children:$u($.ms)})]})]},$.key))}),m&&g!==void 0&&k&&d.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2",children:d.jsx(ez,{id:g,depth:r+1,selectedKey:s,onSelect:o,onOpenRun:i,expanded:a,onToggleChild:l})})]})}function XA({label:e,fanFailed:t,memberRows:n,rowProps:r}){return d.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[d.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[d.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out (ctx.gather / ctx.all)",children:"⑃"}),d.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.15em] text-zinc-500",children:"parallel"}),d.jsx("span",{className:`text-[11px] ${t?"text-red-400":"text-zinc-300"}`,children:e})]}),d.jsx("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:n.map(s=>d.jsx(Ad,{row:s,...r},s.step.seq))})]})}const nv=28;function ZA({fan:e,frame:t,rowProps:n}){const[r,s]=S.useState(!1),[o,i]=S.useState(!1),l=$p(n.run.status),a=s0(e,l),c=o0(e,l),u=c==="running"||c==="pending",f=n.run.status==="running"||n.run.status==="suspended",h=e.startedAt?new Date(e.startedAt).getTime():void 0,p=e.finishedAt?new Date(e.finishedAt).getTime():u&&f?t.liveNow:h,v=S.useMemo(()=>e.failures.map(x=>i0(x,void 0,t)),[e.failures,t]);return d.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[d.jsxs("div",{className:"grid grid-cols-[150px_1fr] items-center gap-3 px-2 py-1",children:[d.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[d.jsx("button",{type:"button",onClick:()=>s(x=>!x),className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:r?"Hide the members":`List the ${e.size} members started`,children:d.jsx("span",{className:"inline-block transition-transform",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),d.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out, summarized",children:"⑃"}),d.jsxs("span",{className:`truncate text-[12px] ${c==="failed"?"text-red-400":"text-zinc-300"}`,title:e.group,children:[e.label," ×",a.total]})]}),d.jsxs("span",{className:"relative h-5",children:[d.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),h!==void 0&&p!==void 0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:`absolute top-1/2 h-3.5 -translate-y-1/2 rounded-[3px] ${c==="failed"?"bg-red-500/25 ring-1 ring-red-500/40":"bg-indigo-500/20 ring-1 ring-indigo-500/40"} ${u?"pulse":""}`,style:{left:`${(h-t.t0)/t.span*100}%`,width:`${Math.max((p-h)/t.span*100,.8)}%`}}),d.jsx("span",{className:"mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-zinc-500",style:{left:`min(${(p-t.t0)/t.span*100}%, calc(100% - 44px))`},children:$u(p-h)})]})]})]}),d.jsxs("div",{className:"flex items-center gap-3 px-2 pb-1.5 pl-[26px]",children:[d.jsx("span",{className:"flex h-1.5 w-40 shrink-0 overflow-hidden rounded-full bg-zinc-800",children:Du.map(x=>a[x.key]>0?d.jsx("span",{className:x.className,style:{width:`${a[x.key]/Math.max(a.total,1)*100}%`}},x.key):null)}),d.jsxs("span",{className:"mono tnum flex flex-wrap gap-2 text-[10px]",children:[a.started<a.total&&d.jsxs("span",{className:"text-zinc-400",children:[yE(a)," started"]}),Du.map(x=>a[x.key]>0?d.jsxs("span",{className:x.text,children:[a[x.key]," ",x.label,x.key==="skipped"&&e.failFast?" (failFast)":""]},x.key):null)]})]}),v.length>0&&!r&&d.jsxs("div",{className:"ml-[10px] border-l border-red-500/30 pl-1",children:[d.jsx("div",{className:"mono px-2 text-[10px] text-red-300/70",children:a.failed>v.length?`first ${v.length} of ${a.failed} failed`:`${v.length} failed`}),v.map(x=>d.jsx(Ad,{row:x,...n},x.step.seq))]}),r&&d.jsxs("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:[d.jsx("div",{className:"flex items-center gap-2 px-2 py-0.5",children:d.jsx("button",{type:"button",onClick:()=>i(x=>!x),className:`mono rounded border px-1.5 text-[10px] transition-colors ${o?"border-red-500/40 bg-red-500/15 text-red-300":"border-line text-zinc-500 hover:text-zinc-300"}`,children:"failed only"})}),d.jsx(JA,{group:e.group,failedOnly:o,live:u&&f,frame:t,rowProps:n},o?"failed":"all")]})]})}function JA({group:e,failedOnly:t,live:n,frame:r,rowProps:s}){var b,g,m,y;const o=s.run.id,i=S.useRef(null),[l,a]=S.useState(),c=lg({count:l??0,getScrollElement:()=>i.current,estimateSize:()=>nv,measureElement:w=>w.getBoundingClientRect().height,overscan:10}),u=c.getVirtualItems(),f=FA((b=u[0])==null?void 0:b.index,(g=u[u.length-1])==null?void 0:g.index),h=gm({queries:f.map(w=>({queryKey:["fan",o,e,t,w],queryFn:()=>$e.fanMembers(o,e,{offset:w*pl,limit:pl,failed:t}),refetchInterval:n?5e3:!1}))}),p=(y=(m=h.find(w=>w.data!==void 0))==null?void 0:m.data)==null?void 0:y.total;S.useEffect(()=>{p!==void 0&&a(p)},[p]);const v=w=>{var E,C;const k=Math.floor(w/pl),N=f.indexOf(k);return N<0||(C=(E=h[N])==null?void 0:E.data)==null?void 0:C.items[w%pl]},x=h.find(w=>w.isError);return l===void 0&&x?d.jsxs("div",{className:"mono px-2 py-1 text-[10px] text-red-400",children:["couldn't load members:"," ",x.error instanceof Error?x.error.message:String(x.error)]}):l===void 0?d.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading members…"}):l===0?d.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:t?"no failed members":"no members"}):d.jsx("div",{ref:i,className:"max-h-[320px] overflow-auto",children:d.jsx("div",{className:"relative w-full",style:{height:c.getTotalSize()},children:u.map(w=>{const k=v(w.index);return d.jsx("div",{"data-index":w.index,ref:c.measureElement,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${w.start}px)`},children:k?d.jsx(Ad,{row:i0(k,void 0,r),...s}):d.jsxs("div",{className:"mono px-2 text-[10px] leading-7 text-zinc-700",style:{height:nv},children:["#",w.index+1," loading…"]})},w.key)})})})}function l0({run:e,timeline:t,fans:n=vE,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=YA(t),{frame:u,rows:f}=S.useMemo(()=>{const m=Date.now(),y=t.map(N=>{const E=bo(N),C=E!==void 0?c[E]:void 0;return{step:N,childRun:C,window:wE(N,C,m)}}),w=bE(e,y.map(N=>N.window),n),k=y.map(N=>i0(N.step,N.childRun,w,N.window));return{frame:w,rows:k}},[e,t,n,c]),h=S.useMemo(()=>xE(t,n),[t,n]),p=S.useMemo(()=>{const m=new Map;for(const y of f)m.set(y.step.seq,y);return m},[f]),[v,x]=S.useState(new Set),g={run:e,childRuns:c,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:a,expanded:l,collapsedSubs:v,toggleSubs:m=>x(y=>{const w=new Set(y);return w.has(m)?w.delete(m):w.add(m),w})};return d.jsx(d.Fragment,{children:h.map(m=>{if(m.kind==="single"){const w=p.get(m.step.seq);return w?d.jsx(Ad,{row:w,...g},w.step.seq):null}if(m.kind==="summary")return d.jsx(ZA,{fan:m.fan,frame:u,rowProps:g},`fan:${m.fan.group}`);const y=m.steps.map(w=>p.get(w.seq)).filter(w=>w!==void 0);return d.jsx(XA,{label:m.label,fanFailed:m.steps.some(w=>w.status==="failed"),memberRows:y,rowProps:g},`fan:${m.group}`)})})}function ez({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const{data:l}=Xt({queryKey:["run",e],queryFn:()=>$e.run(e)});return t>6?null:l?d.jsxs("div",{className:"my-1 rounded-md border border-line bg-black/15",children:[d.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[d.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),d.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),d.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),d.jsx("button",{type:"button",onClick:()=>s(e),className:"ml-auto rounded border border-line px-1.5 text-zinc-400 hover:text-zinc-200",children:"open ↗"})]}),d.jsx(l0,{run:l.run,timeline:l.timeline,fans:l.fans,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i})]}):d.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}const tz=S.memo(function({run:t,timeline:n,fans:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=S.useMemo(()=>bE(t,n.map(h=>[new Date(h.startedAt).getTime(),new Date(h.finishedAt).getTime()]),r??vE).span,[t,n,r]),u=l??new Set,f=a??(()=>{});return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[d.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),d.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",$u(c)]})]}),d.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:d.jsx(l0,{run:t,timeline:n,fans:r,depth:0,selectedKey:s,onSelect:o,onOpenRun:i,expanded:u,onToggleChild:f})})]})});function Fu(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function rv(e,t){return Fu(new Date(t).getTime()-new Date(e).getTime())}function sv(e){return a0(new Date(e).getTime())}function a0(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const SE={ok:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",failed:"border-red-500/25 bg-red-500/10 text-red-300",skipped:"border-amber-500/25 bg-amber-500/10 text-amber-300"},nz={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},rz=["ok","failed","skipped"];function kE({e}){return d.jsxs("div",{className:"flex gap-2 py-0.5",children:[d.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:a0(e.at)}),d.jsx("span",{className:`shrink-0 uppercase ${nz[e.level]}`,children:e.level}),d.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function ov({sub:e,showGroup:t=!0}){var l,a;const n=((l=e.terminal)==null?void 0:l.message)!==void 0&&e.terminal.message!==e.name,r=e.phases.length>0||e.logs.length>0||n,[s,o]=S.useState(e.status==="failed"),i=e.status?SE[e.status]:"border-amber-500/25 bg-amber-500/10 text-amber-300";return d.jsxs("li",{className:`rounded-md border ${i}`,children:[d.jsxs("button",{type:"button",disabled:!r,onClick:()=>o(c=>!c),className:"flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[11.5px] disabled:cursor-default","aria-expanded":r?s:void 0,children:[d.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r&&d.jsx("span",{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${s?"":"-rotate-90"}`,children:"▼"}),d.jsx("span",{className:"mono truncate text-zinc-200",children:e.name}),t&&e.group&&d.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500",children:e.group})]}),d.jsxs("span",{className:"mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider",children:[e.durationMs!==void 0&&d.jsx("span",{className:"tnum text-zinc-400",children:Fu(e.durationMs)}),d.jsx("span",{children:e.status??"running"})]})]}),s&&d.jsxs("div",{className:"border-t border-line/60 px-2.5 py-2",children:[e.phases.length>0&&d.jsx("ul",{className:"mono mb-2 flex flex-col gap-0.5 text-[10.5px]",children:e.phases.map((c,u)=>d.jsxs("li",{className:"flex gap-2",children:[d.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:a0(c.at)}),d.jsx("span",{className:"text-zinc-400",children:c.phase}),e.startedAt!==void 0&&d.jsxs("span",{className:"text-zinc-600 tnum",children:["+",Fu(c.at-e.startedAt)]})]},`${c.at}-${c.phase}-${u}`))}),((a=e.terminal)==null?void 0:a.message)&&e.terminal.message!==e.name&&d.jsx("div",{className:`mono mb-2 rounded border p-2 text-[11px] ${e.status==="failed"?"border-red-500/25 bg-red-500/10 text-red-200":"border-line bg-black/20 text-zinc-300"}`,children:e.terminal.message}),e.logs.length>0&&d.jsx("div",{className:"mono flex flex-col gap-0.5 text-[11px]",children:e.logs.map((c,u)=>d.jsx(kE,{e:c},`${c.at}-${u}`))})]})]})}function sz({events:e}){const{subs:t,stepLogs:n}=ag(e),r=rz.map(o=>[o,t.filter(i=>i.status===o).length]).filter(([,o])=>o>0),s=t.some(o=>o.group);return d.jsxs(d.Fragment,{children:[t.length>0&&d.jsxs("section",{className:"rise",children:[d.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[d.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),d.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([o,i])=>d.jsxs("span",{className:SE[o].split(" ").pop(),children:[i," ",o]},o))})]}),s?Object.entries(t.reduce((o,i)=>{const l=i.group??"—";return o[l]===void 0&&(o[l]=[]),o[l].push(i),o},{})).sort(([o],[i])=>o==="—"?1:i==="—"?-1:o.localeCompare(i)).map(([o,i])=>d.jsxs("div",{className:"mb-2",children:[d.jsx("div",{className:"mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500",children:o}),d.jsx("ul",{className:"flex flex-col gap-1",children:i.map(l=>d.jsx(ov,{sub:l,showGroup:!1},l.id))})]},o)):d.jsx("ul",{className:"flex flex-col gap-1",children:t.map(o=>d.jsx(ov,{sub:o},o.id))})]}),n.length>0&&d.jsxs("section",{className:"rise",children:[d.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),d.jsx("div",{className:"mono max-h-64 overflow-auto rounded-lg border border-line bg-black/40 p-2.5 text-[11px] leading-relaxed",children:n.map((o,i)=>d.jsx(kE,{e:o},`${o.at}-${i}`))})]})]})}function EE({value:e}){const[t,n]=S.useState(!1);return d.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200",onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1200)}catch{}},children:[t?d.jsx(ug,{width:11,height:11}):d.jsx(gj,{width:11,height:11}),t?"copied":"copy"]})}function ea({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return d.jsxs("section",{className:"rise",children:[d.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[d.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),d.jsx(EE,{value:n})]}),d.jsx("pre",{className:"mono max-h-64 overflow-auto rounded-lg border border-line bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300",children:n})]})}function CE({error:e}){return d.jsxs(d.Fragment,{children:[d.jsxs("section",{className:"rise",children:[d.jsxs("div",{className:"mono mb-1.5 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:[d.jsx("span",{children:"error"}),e.code&&d.jsx("span",{className:"rounded border border-red-500/30 px-1.5 py-px normal-case tracking-normal text-red-300",children:e.code})]}),d.jsx("div",{className:"mono rounded-lg border border-red-500/25 bg-red-500/10 p-3 text-[11.5px] leading-relaxed text-red-200",children:e.message})]}),e.details!==void 0&&d.jsx(ea,{label:"error details",value:e.details})]})}function dr({k:e,v:t,mono:n=!0}){return d.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[d.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),d.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function oz({id:e,onOpenRun:t}){const{data:n}=Xt({queryKey:["run",e],queryFn:()=>$e.run(e)}),[r,s]=S.useState(new Set),o=i=>s(l=>{const a=new Set(l);return a.has(i)?a.delete(i):a.add(i),a});return n?n.timeline.length===0?d.jsxs("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:["no steps recorded yet — child ",n.run.status]}):d.jsx("div",{className:"mt-2 max-h-80 space-y-1 overflow-auto rounded-md border border-line bg-black/20 p-1.5",children:d.jsx(l0,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:o})}):d.jsx("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:"loading child run…"})}function iz({step:e,run:t,onClose:n,onOpenRun:r}){const s=bo(e),o=jA(e),[i,l]=S.useState(!1),a=e.status==="failed",c=e.status==="pending"||e.status==="running",u=fg(e.kind),f=rv(t.createdAt,e.startedAt),h=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return d.jsxs("aside",{className:"absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${a?"bg-red-500/15 text-red-300":c?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,children:d.jsx(u,{width:13,height:13})}),d.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),d.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",vp[e.kind]??e.kind]})]}),d.jsx("button",{type:"button",onClick:n,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:d.jsx(Ss,{})})]}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[d.jsxs("div",{className:"rounded-lg border border-line bg-black/20 px-3.5 py-1",children:[d.jsx(dr,{k:"seq",v:`#${e.seq}`}),h>=1&&d.jsx(dr,{k:"queued",v:d.jsx("span",{className:"text-sky-300",children:Fu(h)})}),d.jsx(dr,{k:"duration",v:c?d.jsx("span",{className:"text-amber-300",children:"running…"}):rv(e.startedAt,e.finishedAt)}),d.jsx(dr,{k:"attempts",v:d.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&d.jsx(Cu,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&d.jsx(dr,{k:"worker",v:`@${e.workerGroup}`}),o&&d.jsx(dr,{k:"waited for run",v:r?d.jsx("button",{type:"button",onClick:()=>r(o),className:"mono text-sky-300 underline-offset-2 hover:underline",children:o}):d.jsx("span",{className:"mono",children:o})}),d.jsx(dr,{k:"started",v:sv(e.startedAt)}),!c&&d.jsx(dr,{k:"finished",v:sv(e.finishedAt)}),d.jsx(dr,{k:"offset",v:`+${f}`})]}),a&&e.error&&d.jsx(CE,{error:e.error}),e.events&&e.events.length>0&&d.jsx(sz,{events:e.events}),s&&d.jsxs("section",{className:"rise",children:[d.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[d.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&d.jsx("button",{type:"button",onClick:()=>r(s),className:"mono rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200",children:"open ↗"})]}),d.jsxs("button",{type:"button",onClick:()=>l(p=>!p),className:"flex w-full items-center gap-2 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-2.5 py-1.5 text-left transition-colors hover:bg-indigo-500/20",title:i?"Collapse child run":"Expand child run inline",children:[d.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:i?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),d.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:s})]}),i&&d.jsx(oz,{id:s,onOpenRun:r})]}),e.input!==void 0&&d.jsx(ea,{label:"input",value:e.input}),e.output!==void 0&&d.jsx(ea,{label:"output",value:e.output})]})]})}function lz({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return d.jsxs("aside",{className:"absolute inset-y-0 right-0 z-30 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),d.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),d.jsx("button",{type:"button",onClick:t,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:d.jsx(Ss,{})})]}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&d.jsx(CE,{error:e.error}),e.input!==void 0&&d.jsx(ea,{label:"input",value:e.input}),e.output!==void 0&&d.jsx(ea,{label:"output",value:e.output}),n&&d.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}const Kf="durable:lifecycle:pending";function iv(e){const t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;const n=Math.round(t/60);if(n<60)return`${n}m`;const r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function az(e,t){switch(e.state){case"started":return"started";case"owed":{const n=e.owedSince!==void 0?`owed for ${iv(t-e.owedSince)}`:"owed";return e.orphanAt!==void 0?`${n} · orphan in ${iv(e.orphanAt-t)}`:n}case"coalesced":return"coalesced";case"failed":return"failed";default:return"not started"}}const cz="No run and nothing owed: its `where` declined the event, or it subscribed after the run settled.",uz="Its start failed: its `where` threw, its input was rejected, its start threw, or no live instance had it. The run.trigger_failed event carries the reason; republish to retry.",dz="No live instance registers or announces this subscriber; the lifecycle sweep drops it then and reports run.trigger_failed.";function Lu({status:e}){return e?d.jsx(Xe,{variant:"status",className:`s-${e} text-[10px]`,children:e}):null}function Hu({runId:e,onOpenRun:t}){return d.jsx(Se,{variant:"chip",size:"xs",onClick:()=>t(e),className:"mono max-w-[28rem] truncate px-1.5 py-0",title:e,children:e})}function fz({source:e,onOpenRun:t}){return d.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1","data-testid":"lifecycle-source",children:[d.jsx("span",{className:"text-[10px] text-zinc-600",children:"started by"}),d.jsx(Hu,{runId:e.runId,onOpenRun:t}),d.jsx("span",{className:"text-[10px] text-zinc-600",children:"on"}),d.jsx(Xe,{className:st("text-[10px]",e.kind==="failed"?"s-failed":"s-completed"),children:e.kind}),d.jsx(Lu,{status:e.status}),e.traceId&&d.jsxs("span",{className:"ml-1 flex items-center gap-1",children:[d.jsx("span",{className:"text-[10px] text-zinc-600",children:"trace"}),d.jsx("span",{className:"mono text-[10px] text-zinc-400",title:"The source run's trace id",children:e.traceId}),d.jsx(EE,{value:e.traceId})]})]})}function hz({waitsFor:e=[],awaitedBy:t=[],onOpenRun:n}){return e.length===0&&t.length===0?null:d.jsxs("div",{className:"mt-1.5 flex flex-col gap-1",children:[e.map(r=>d.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"waits-for",children:[d.jsx("span",{className:"text-[10px] text-amber-300/80",children:"Waiting for run"}),d.jsx(Hu,{runId:r.runId,onOpenRun:n}),d.jsx(Lu,{status:r.status})]},`${r.runId}#${r.seq}`)),t.length>0&&d.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"awaited-by",children:[d.jsx("span",{className:"text-[10px] text-zinc-600",children:"Awaited by"}),t.map(r=>d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(Hu,{runId:r.runId,onOpenRun:n}),d.jsx(Lu,{status:r.status})]},`${r.runId}#${r.seq}`))]})]})}function pz({deliveries:e,now:t=Date.now(),onOpenRun:n,onRepublish:r,republishing:s=!1}){return e.length===0?null:d.jsxs("section",{"aria-label":"Lifecycle subscribers",className:"mt-3",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"Lifecycle subscribers"}),d.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:e.map(o=>d.jsxs("li",{className:"flex flex-wrap items-center gap-1.5","data-state":o.state,children:[d.jsx("a",{href:Md(o.subscriber),className:"mono text-[12px] text-zinc-200 underline-offset-2 hover:underline",children:o.subscriber}),d.jsx(Xe,{variant:o.state==="owed"?"warn":o.state==="failed"?"danger":"outline",className:"text-[10px]",title:o.state==="not-started"?cz:o.state==="failed"&&o.error===void 0?uz:o.orphanAt!==void 0?dz:void 0,children:az(o,t)}),o.runId&&d.jsx(Hu,{runId:o.runId,onOpenRun:n}),o.state==="started"&&d.jsx(Lu,{status:o.status}),o.state==="failed"&&o.error!==void 0&&d.jsx("span",{className:"mono text-[11px] text-bad",children:o.error}),o.state==="failed"&&r&&d.jsx(Se,{variant:"info",size:"xs",disabled:s,onClick:()=>r(o.subscriber),title:`Start ${o.subscriber} from this run again`,children:"Republish"})]},o.subscriber))})]})}function mz(e,t){return e.some(n=>n.state==="failed"&&!n.error&&t[n.subscriber])?e.map(n=>{const r=t[n.subscriber];return n.state==="failed"&&!n.error&&r?{...n,error:r}:n}):e}function gz({tags:e,onChange:t}){const n=e.includes(Kf);return d.jsx(Se,{variant:"ghost",size:"xs","aria-pressed":n,title:"Settled runs whose lifecycle event is still owed to a subscriber (tag durable:lifecycle:pending)",onClick:()=>t(n?e.filter(r=>r!==Kf):[...e,Kf]),className:st("mono rounded-md border-line",n&&"border-amber-500/40 bg-amber-500/10 text-amber-200 hover:text-amber-100"),children:"lifecycle pending"})}function xz(e){if(e.cron)return e.timezone&&e.timezone!=="UTC"?`${e.cron} · ${e.timezone}`:e.cron;const t=e.everyMs??0;return t%864e5===0?`every ${t/864e5}d`:t%36e5===0?`every ${t/36e5}h`:t%6e4===0?`every ${t/6e4}m`:t%1e3===0?`every ${t/1e3}s`:`every ${t}ms`}function lv(e,t=Date.now()){const n=Date.parse(e)-t,r=Math.round(Math.abs(n)/1e3),s=r<60?`${r}s`:r<3600?`${Math.round(r/60)}m`:r<86400?`${Math.round(r/3600)}h`:`${Math.round(r/86400)}d`;return n>=0?`in ${s}`:`${s} ago`}function yz(){const e=mo(),{data:t}=Xt({queryKey:["schedules"],queryFn:()=>$e.schedules(),refetchInterval:1e4}),n=mr({mutationFn:({id:s,action:o})=>o==="pause"?$e.pauseSchedule(s):o==="resume"?$e.resumeSchedule(s):$e.triggerSchedule(s),onSettled:()=>{e.invalidateQueries({queryKey:["schedules"]}),e.invalidateQueries({queryKey:["runs"]})}});if(!t||t.length===0)return null;const r=t.filter(s=>s.paused).length;return d.jsxs(Ii,{children:[d.jsx(ji,{render:d.jsxs(Se,{variant:"chip",size:"xs",className:"mono gap-1",children:[d.jsx("span",{className:"uppercase tracking-wide",children:"schedules"}),d.jsxs("span",{className:"tnum text-zinc-500",children:[t.length,r?` · ${r} paused`:""]})]})}),d.jsx(fo,{className:"w-[34rem] max-h-[60vh] overflow-y-auto",children:d.jsxs("table",{className:"mono w-full text-[10px]",children:[d.jsx("thead",{className:"sticky top-0 bg-popover text-left text-zinc-500",children:d.jsxs("tr",{children:[d.jsx("th",{className:"px-2 py-1.5 font-normal",children:"schedule"}),d.jsx("th",{className:"px-2 py-1.5 font-normal",children:"cadence"}),d.jsx("th",{className:"px-2 py-1.5 font-normal",children:"next"}),d.jsx("th",{className:"px-2 py-1.5 font-normal",children:"last"}),d.jsx("th",{className:"px-2 py-1.5"})]})}),d.jsx("tbody",{children:t.map(s=>d.jsxs("tr",{className:"border-t border-line align-top",children:[d.jsxs("td",{className:"max-w-[10rem] px-2 py-1.5",children:[d.jsx("div",{className:"truncate text-zinc-200",title:s.id,children:s.id}),d.jsxs("div",{className:"truncate text-zinc-500",title:s.workflow,children:[s.workflow,s.namespace!=="default"?` @${s.namespace}`:""]})]}),d.jsx("td",{className:"px-2 py-1.5 text-zinc-400",children:xz(s)}),d.jsx("td",{className:st("px-2 py-1.5",s.paused?"text-amber-400/80":"text-zinc-300"),children:s.paused?"paused":s.nextFireAt?lv(s.nextFireAt):"—"}),d.jsxs("td",{className:"max-w-[9rem] px-2 py-1.5 text-zinc-500",children:[s.lastFireAt?lv(s.lastFireAt):"never",s.lastError&&d.jsx("div",{className:"truncate text-red-400/80",title:s.lastError,children:s.lastError})]}),d.jsxs("td",{className:"whitespace-nowrap px-2 py-1.5 text-right",children:[d.jsx(Se,{variant:"ghost",size:"xs",disabled:n.isPending,onClick:()=>n.mutate({id:s.id,action:s.paused?"resume":"pause"}),children:s.paused?"resume":"pause"}),d.jsx(Se,{variant:"ghost",size:"xs",disabled:n.isPending,onClick:()=>n.mutate({id:s.id,action:"trigger"}),children:"run now"})]})]},s.id))})]})})]})}function dt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=dt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var vz={value:()=>{}};function zd(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Wc(n)}function Wc(e){this._=e}function wz(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Wc.prototype=zd.prototype={constructor:Wc,on:function(e,t){var n=this._,r=wz(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=bz(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(s=(e=r[o]).type)n[s]=av(n[s],e.name,t);else if(t==null)for(s in n)n[s]=av(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Wc(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function bz(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function av(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=vz,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Fp="http://www.w3.org/1999/xhtml";const cv={svg:"http://www.w3.org/2000/svg",xhtml:Fp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Dd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),cv.hasOwnProperty(t)?{space:cv[t],local:e}:e}function Sz(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Fp&&t.documentElement.namespaceURI===Fp?t.createElement(e):t.createElementNS(n,e)}}function kz(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function NE(e){var t=Dd(e);return(t.local?kz:Sz)(t)}function Ez(){}function c0(e){return e==null?Ez:function(){return this.querySelector(e)}}function Cz(e){typeof e!="function"&&(e=c0(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=new Array(i),a,c,u=0;u<i;++u)(a=o[u])&&(c=e.call(a,a.__data__,u,o))&&("__data__"in a&&(c.__data__=a.__data__),l[u]=c);return new hn(r,this._parents)}function Nz(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rz(){return[]}function RE(e){return e==null?Rz:function(){return this.querySelectorAll(e)}}function Tz(e){return function(){return Nz(e.apply(this,arguments))}}function Pz(e){typeof e=="function"?e=Tz(e):e=RE(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,a,c=0;c<l;++c)(a=i[c])&&(r.push(e.call(a,a.__data__,c,i)),s.push(a));return new hn(r,s)}function TE(e){return function(){return this.matches(e)}}function PE(e){return function(t){return t.matches(e)}}var Iz=Array.prototype.find;function jz(e){return function(){return Iz.call(this.children,e)}}function Oz(){return this.firstElementChild}function _z(e){return this.select(e==null?Oz:jz(typeof e=="function"?e:PE(e)))}var Mz=Array.prototype.filter;function Az(){return Array.from(this.children)}function zz(e){return function(){return Mz.call(this.children,e)}}function Dz(e){return this.selectAll(e==null?Az:zz(typeof e=="function"?e:PE(e)))}function $z(e){typeof e!="function"&&(e=TE(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],a,c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new hn(r,this._parents)}function IE(e){return new Array(e.length)}function Fz(){return new hn(this._enter||this._groups.map(IE),this._parents)}function Bu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bu.prototype={constructor:Bu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Lz(e){return function(){return e}}function Hz(e,t,n,r,s,o){for(var i=0,l,a=t.length,c=o.length;i<c;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new Bu(e,o[i]);for(;i<a;++i)(l=t[i])&&(s[i]=l)}function Bz(e,t,n,r,s,o,i){var l,a,c=new Map,u=t.length,f=o.length,h=new Array(u),p;for(l=0;l<u;++l)(a=t[l])&&(h[l]=p=i.call(a,a.__data__,l,t)+"",c.has(p)?s[l]=a:c.set(p,a));for(l=0;l<f;++l)p=i.call(e,o[l],l,o)+"",(a=c.get(p))?(r[l]=a,a.__data__=o[l],c.delete(p)):n[l]=new Bu(e,o[l]);for(l=0;l<u;++l)(a=t[l])&&c.get(h[l])===a&&(s[l]=a)}function Vz(e){return e.__data__}function Wz(e,t){if(!arguments.length)return Array.from(this,Vz);var n=t?Bz:Hz,r=this._parents,s=this._groups;typeof e!="function"&&(e=Lz(e));for(var o=s.length,i=new Array(o),l=new Array(o),a=new Array(o),c=0;c<o;++c){var u=r[c],f=s[c],h=f.length,p=Uz(e.call(u,u&&u.__data__,c,r)),v=p.length,x=l[c]=new Array(v),b=i[c]=new Array(v),g=a[c]=new Array(h);n(u,f,x,b,g,p,t);for(var m=0,y=0,w,k;m<v;++m)if(w=x[m]){for(m>=y&&(y=m+1);!(k=b[y])&&++y<v;);w._next=k||null}}return i=new hn(i,r),i._enter=l,i._exit=a,i}function Uz(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qz(){return new hn(this._exit||this._groups.map(IE),this._parents)}function Kz(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function Yz(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),a=0;a<i;++a)for(var c=n[a],u=r[a],f=c.length,h=l[a]=new Array(f),p,v=0;v<f;++v)(p=c[v]||u[v])&&(h[v]=p);for(;a<s;++a)l[a]=n[a];return new hn(l,this._parents)}function Gz(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],i;--s>=0;)(i=r[s])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function Qz(e){e||(e=Xz);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,a=s[o]=new Array(l),c,u=0;u<l;++u)(c=i[u])&&(a[u]=c);a.sort(t)}return new hn(s,this._parents).order()}function Xz(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Zz(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Jz(){return Array.from(this)}function e5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var i=r[s];if(i)return i}return null}function t5(){let e=0;for(const t of this)++e;return e}function n5(){return!this.node()}function r5(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,l;o<i;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function s5(e){return function(){this.removeAttribute(e)}}function o5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function i5(e,t){return function(){this.setAttribute(e,t)}}function l5(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function a5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function c5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function u5(e,t){var n=Dd(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?o5:s5:typeof t=="function"?n.local?c5:a5:n.local?l5:i5)(n,t))}function jE(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function d5(e){return function(){this.style.removeProperty(e)}}function f5(e,t,n){return function(){this.style.setProperty(e,t,n)}}function h5(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function p5(e,t,n){return arguments.length>1?this.each((t==null?d5:typeof t=="function"?h5:f5)(e,t,n??"")):Oi(this.node(),e)}function Oi(e,t){return e.style.getPropertyValue(t)||jE(e).getComputedStyle(e,null).getPropertyValue(t)}function m5(e){return function(){delete this[e]}}function g5(e,t){return function(){this[e]=t}}function x5(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function y5(e,t){return arguments.length>1?this.each((t==null?m5:typeof t=="function"?x5:g5)(e,t)):this.node()[e]}function OE(e){return e.trim().split(/^|\s+/)}function u0(e){return e.classList||new _E(e)}function _E(e){this._node=e,this._names=OE(e.getAttribute("class")||"")}_E.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ME(e,t){for(var n=u0(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function AE(e,t){for(var n=u0(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function v5(e){return function(){ME(this,e)}}function w5(e){return function(){AE(this,e)}}function b5(e,t){return function(){(t.apply(this,arguments)?ME:AE)(this,e)}}function S5(e,t){var n=OE(e+"");if(arguments.length<2){for(var r=u0(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?b5:t?v5:w5)(n,t))}function k5(){this.textContent=""}function E5(e){return function(){this.textContent=e}}function C5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function N5(e){return arguments.length?this.each(e==null?k5:(typeof e=="function"?C5:E5)(e)):this.node().textContent}function R5(){this.innerHTML=""}function T5(e){return function(){this.innerHTML=e}}function P5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function I5(e){return arguments.length?this.each(e==null?R5:(typeof e=="function"?P5:T5)(e)):this.node().innerHTML}function j5(){this.nextSibling&&this.parentNode.appendChild(this)}function O5(){return this.each(j5)}function _5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M5(){return this.each(_5)}function A5(e){var t=typeof e=="function"?e:NE(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function z5(){return null}function D5(e,t){var n=typeof e=="function"?e:NE(e),r=t==null?z5:typeof t=="function"?t:c0(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function $5(){var e=this.parentNode;e&&e.removeChild(this)}function F5(){return this.each($5)}function L5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function H5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function B5(e){return this.select(e?H5:L5)}function V5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function W5(e){return function(t){e.call(this,t,this.__data__)}}function U5(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function q5(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function K5(e,t,n){return function(){var r=this.__on,s,o=W5(t);if(r){for(var i=0,l=r.length;i<l;++i)if((s=r[i]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function Y5(e,t,n){var r=U5(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,c=l.length,u;a<c;++a)for(s=0,u=l[a];s<o;++s)if((i=r[s]).type===u.type&&i.name===u.name)return u.value}return}for(l=t?K5:q5,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function zE(e,t,n){var r=jE(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function G5(e,t){return function(){return zE(this,e,t)}}function Q5(e,t){return function(){return zE(this,e,t.apply(this,arguments))}}function X5(e,t){return this.each((typeof t=="function"?Q5:G5)(e,t))}function*Z5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,i;s<o;++s)(i=r[s])&&(yield i)}var DE=[null];function hn(e,t){this._groups=e,this._parents=t}function Ia(){return new hn([[document.documentElement]],DE)}function J5(){return this}hn.prototype=Ia.prototype={constructor:hn,select:Cz,selectAll:Pz,selectChild:_z,selectChildren:Dz,filter:$z,data:Wz,enter:Fz,exit:qz,join:Kz,merge:Yz,selection:J5,order:Gz,sort:Qz,call:Zz,nodes:Jz,node:e5,size:t5,empty:n5,each:r5,attr:u5,style:p5,property:y5,classed:S5,text:N5,html:I5,raise:O5,lower:M5,append:A5,insert:D5,remove:F5,clone:B5,datum:V5,on:Y5,dispatch:X5,[Symbol.iterator]:Z5};function ln(e){return typeof e=="string"?new hn([[document.querySelector(e)]],[document.documentElement]):new hn([[e]],DE)}function eD(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Dn(e,t){if(e=eD(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const tD={passive:!1},ta={capture:!0,passive:!1};function Yf(e){e.stopImmediatePropagation()}function ei(e){e.preventDefault(),e.stopImmediatePropagation()}function $E(e){var t=e.document.documentElement,n=ln(e).on("dragstart.drag",ei,ta);"onselectstart"in t?n.on("selectstart.drag",ei,ta):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function FE(e,t){var n=e.document.documentElement,r=ln(e).on("dragstart.drag",null);t&&(r.on("click.drag",ei,ta),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const vc=e=>()=>e;function Lp(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:a,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Lp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nD(e){return!e.ctrlKey&&!e.button}function rD(){return this.parentNode}function sD(e,t){return t??{x:e.x,y:e.y}}function oD(){return navigator.maxTouchPoints||"ontouchstart"in this}function LE(){var e=nD,t=rD,n=sD,r=oD,s={},o=zd("start","drag","end"),i=0,l,a,c,u,f=0;function h(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",g,tD).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,k){if(!(u||!e.call(this,w,k))){var N=y(this,t.call(this,w,k),w,k,"mouse");N&&(ln(w.view).on("mousemove.drag",v,ta).on("mouseup.drag",x,ta),$E(w.view),Yf(w),c=!1,l=w.clientX,a=w.clientY,N("start",w))}}function v(w){if(ei(w),!c){var k=w.clientX-l,N=w.clientY-a;c=k*k+N*N>f}s.mouse("drag",w)}function x(w){ln(w.view).on("mousemove.drag mouseup.drag",null),FE(w.view,c),ei(w),s.mouse("end",w)}function b(w,k){if(e.call(this,w,k)){var N=w.changedTouches,E=t.call(this,w,k),C=N.length,P,I;for(P=0;P<C;++P)(I=y(this,E,w,k,N[P].identifier,N[P]))&&(Yf(w),I("start",w,N[P]))}}function g(w){var k=w.changedTouches,N=k.length,E,C;for(E=0;E<N;++E)(C=s[k[E].identifier])&&(ei(w),C("drag",w,k[E]))}function m(w){var k=w.changedTouches,N=k.length,E,C;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),E=0;E<N;++E)(C=s[k[E].identifier])&&(Yf(w),C("end",w,k[E]))}function y(w,k,N,E,C,P){var I=o.copy(),z=Dn(P||N,k),$,A,R;if((R=n.call(w,new Lp("beforestart",{sourceEvent:N,target:h,identifier:C,active:i,x:z[0],y:z[1],dx:0,dy:0,dispatch:I}),E))!=null)return $=R.x-z[0]||0,A=R.y-z[1]||0,function j(O,F,T){var M=z,_;switch(O){case"start":s[C]=j,_=i++;break;case"end":delete s[C],--i;case"drag":z=Dn(T||F,k),_=i;break}I.call(O,w,new Lp(O,{sourceEvent:F,subject:R,target:h,identifier:C,active:_,x:z[0]+$,y:z[1]+A,dx:z[0]-M[0],dy:z[1]-M[1],dispatch:I}),E)}}return h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:vc(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:vc(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:vc(w),h):n},h.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:vc(!!w),h):r},h.on=function(){var w=o.on.apply(o,arguments);return w===o?h:w},h.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,h):Math.sqrt(f)},h}function d0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function HE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ja(){}var na=.7,Vu=1/na,ti="\\s*([+-]?\\d+)\\s*",ra="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iD=/^#([0-9a-f]{3,8})$/,lD=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),aD=new RegExp(`^rgb\\(${lr},${lr},${lr}\\)$`),cD=new RegExp(`^rgba\\(${ti},${ti},${ti},${ra}\\)$`),uD=new RegExp(`^rgba\\(${lr},${lr},${lr},${ra}\\)$`),dD=new RegExp(`^hsl\\(${ra},${lr},${lr}\\)$`),fD=new RegExp(`^hsla\\(${ra},${lr},${lr},${ra}\\)$`),uv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};d0(ja,sa,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dv,formatHex:dv,formatHex8:hD,formatHsl:pD,formatRgb:fv,toString:fv});function dv(){return this.rgb().formatHex()}function hD(){return this.rgb().formatHex8()}function pD(){return BE(this).formatHsl()}function fv(){return this.rgb().formatRgb()}function sa(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=iD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?hv(t):n===3?new Qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=lD.exec(e))?new Qt(t[1],t[2],t[3],1):(t=aD.exec(e))?new Qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cD.exec(e))?wc(t[1],t[2],t[3],t[4]):(t=uD.exec(e))?wc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dD.exec(e))?gv(t[1],t[2]/100,t[3]/100,1):(t=fD.exec(e))?gv(t[1],t[2]/100,t[3]/100,t[4]):uv.hasOwnProperty(e)?hv(uv[e]):e==="transparent"?new Qt(NaN,NaN,NaN,0):null}function hv(e){return new Qt(e>>16&255,e>>8&255,e&255,1)}function wc(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qt(e,t,n,r)}function mD(e){return e instanceof ja||(e=sa(e)),e?(e=e.rgb(),new Qt(e.r,e.g,e.b,e.opacity)):new Qt}function Hp(e,t,n,r){return arguments.length===1?mD(e):new Qt(e,t,n,r??1)}function Qt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}d0(Qt,Hp,HE(ja,{brighter(e){return e=e==null?Vu:Math.pow(Vu,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?na:Math.pow(na,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qt(to(this.r),to(this.g),to(this.b),Wu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:pv,formatHex:pv,formatHex8:gD,formatRgb:mv,toString:mv}));function pv(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}`}function gD(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}${Hs((isNaN(this.opacity)?1:this.opacity)*255)}`}function mv(){const e=Wu(this.opacity);return`${e===1?"rgb(":"rgba("}${to(this.r)}, ${to(this.g)}, ${to(this.b)}${e===1?")":`, ${e})`}`}function Wu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function to(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hs(e){return e=to(e),(e<16?"0":"")+e.toString(16)}function gv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fn(e,t,n,r)}function BE(e){if(e instanceof Fn)return new Fn(e.h,e.s,e.l,e.opacity);if(e instanceof ja||(e=sa(e)),!e)return new Fn;if(e instanceof Fn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,l=o-s,a=(o+s)/2;return l?(t===o?i=(n-r)/l+(n<r)*6:n===o?i=(r-t)/l+2:i=(t-n)/l+4,l/=a<.5?o+s:2-o-s,i*=60):l=a>0&&a<1?0:i,new Fn(i,l,a,e.opacity)}function xD(e,t,n,r){return arguments.length===1?BE(e):new Fn(e,t,n,r??1)}function Fn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}d0(Fn,xD,HE(ja,{brighter(e){return e=e==null?Vu:Math.pow(Vu,e),new Fn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?na:Math.pow(na,e),new Fn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Qt(Gf(e>=240?e-240:e+120,s,r),Gf(e,s,r),Gf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Fn(xv(this.h),bc(this.s),bc(this.l),Wu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wu(this.opacity);return`${e===1?"hsl(":"hsla("}${xv(this.h)}, ${bc(this.s)*100}%, ${bc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xv(e){return e=(e||0)%360,e<0?e+360:e}function bc(e){return Math.max(0,Math.min(1,e||0))}function Gf(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const VE=e=>()=>e;function yD(e,t){return function(n){return e+n*t}}function vD(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function wD(e){return(e=+e)==1?WE:function(t,n){return n-t?vD(t,n,e):VE(isNaN(t)?n:t)}}function WE(e,t){var n=t-e;return n?yD(e,n):VE(isNaN(e)?t:e)}const yv=function e(t){var n=wD(t);function r(s,o){var i=n((s=Hp(s)).r,(o=Hp(o)).r),l=n(s.g,o.g),a=n(s.b,o.b),c=WE(s.opacity,o.opacity);return function(u){return s.r=i(u),s.g=l(u),s.b=a(u),s.opacity=c(u),s+""}}return r.gamma=e,r}(1);function Gr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Bp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qf=new RegExp(Bp.source,"g");function bD(e){return function(){return e}}function SD(e){return function(t){return e(t)+""}}function kD(e,t){var n=Bp.lastIndex=Qf.lastIndex=0,r,s,o,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Bp.exec(e))&&(s=Qf.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),l[i]?l[i]+=o:l[++i]=o),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,a.push({i,x:Gr(r,s)})),n=Qf.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?a[0]?SD(a[0].x):bD(t):(t=a.length,function(c){for(var u=0,f;u<t;++u)l[(f=a[u]).i]=f.x(c);return l.join("")})}var vv=180/Math.PI,Vp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function UE(e,t,n,r,s,o){var i,l,a;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*vv,skewX:Math.atan(a)*vv,scaleX:i,scaleY:l}}var Sc;function ED(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Vp:UE(t.a,t.b,t.c,t.d,t.e,t.f)}function CD(e){return e==null||(Sc||(Sc=document.createElementNS("http://www.w3.org/2000/svg","g")),Sc.setAttribute("transform",e),!(e=Sc.transform.baseVal.consolidate()))?Vp:(e=e.matrix,UE(e.a,e.b,e.c,e.d,e.e,e.f))}function qE(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,u,f,h,p,v){if(c!==f||u!==h){var x=p.push("translate(",null,t,null,n);v.push({i:x-4,x:Gr(c,f)},{i:x-2,x:Gr(u,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function i(c,u,f,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:Gr(c,u)})):u&&f.push(s(f)+"rotate("+u+r)}function l(c,u,f,h){c!==u?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:Gr(c,u)}):u&&f.push(s(f)+"skewX("+u+r)}function a(c,u,f,h,p,v){if(c!==f||u!==h){var x=p.push(s(p)+"scale(",null,",",null,")");v.push({i:x-4,x:Gr(c,f)},{i:x-2,x:Gr(u,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(c,u){var f=[],h=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,h),i(c.rotate,u.rotate,f,h),l(c.skewX,u.skewX,f,h),a(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,h),c=u=null,function(p){for(var v=-1,x=h.length,b;++v<x;)f[(b=h[v]).i]=b.x(p);return f.join("")}}}var ND=qE(ED,"px, ","px)","deg)"),RD=qE(CD,", ",")",")"),TD=1e-12;function wv(e){return((e=Math.exp(e))+1/e)/2}function PD(e){return((e=Math.exp(e))-1/e)/2}function ID(e){return((e=Math.exp(2*e))-1)/(e+1)}const jD=function e(t,n,r){function s(o,i){var l=o[0],a=o[1],c=o[2],u=i[0],f=i[1],h=i[2],p=u-l,v=f-a,x=p*p+v*v,b,g;if(x<TD)g=Math.log(h/c)/t,b=function(E){return[l+E*p,a+E*v,c*Math.exp(t*E*g)]};else{var m=Math.sqrt(x),y=(h*h-c*c+r*x)/(2*c*n*m),w=(h*h-c*c-r*x)/(2*h*n*m),k=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(w*w+1)-w);g=(N-k)/t,b=function(E){var C=E*g,P=wv(k),I=c/(n*m)*(P*ID(t*C+k)-PD(k));return[l+I*p,a+I*v,c*P/wv(t*C+k)]}}return b.duration=g*1e3*t/Math.SQRT2,b}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,a=l*l;return e(i,l,a)},s}(Math.SQRT2,2,4);var _i=0,ml=0,il=0,KE=1e3,Uu,gl,qu=0,ho=0,$d=0,oa=typeof performance=="object"&&performance.now?performance:Date,YE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function f0(){return ho||(YE(OD),ho=oa.now()+$d)}function OD(){ho=0}function Ku(){this._call=this._time=this._next=null}Ku.prototype=GE.prototype={constructor:Ku,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?f0():+n)+(t==null?0:+t),!this._next&&gl!==this&&(gl?gl._next=this:Uu=this,gl=this),this._call=e,this._time=n,Wp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wp())}};function GE(e,t,n){var r=new Ku;return r.restart(e,t,n),r}function _D(){f0(),++_i;for(var e=Uu,t;e;)(t=ho-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_i}function bv(){ho=(qu=oa.now())+$d,_i=ml=0;try{_D()}finally{_i=0,AD(),ho=0}}function MD(){var e=oa.now(),t=e-qu;t>KE&&($d-=t,qu=e)}function AD(){for(var e,t=Uu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Uu=n);gl=e,Wp(r)}function Wp(e){if(!_i){ml&&(ml=clearTimeout(ml));var t=e-ho;t>24?(e<1/0&&(ml=setTimeout(bv,e-oa.now()-$d)),il&&(il=clearInterval(il))):(il||(qu=oa.now(),il=setInterval(MD,KE)),_i=1,YE(bv))}}function Sv(e,t,n){var r=new Ku;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var zD=zd("start","end","cancel","interrupt"),DD=[],QE=0,kv=1,Up=2,Uc=3,Ev=4,qp=5,qc=6;function Fd(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;$D(e,n,{name:t,index:r,group:s,on:zD,tween:DD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:QE})}function h0(e,t){var n=Un(e,t);if(n.state>QE)throw new Error("too late; already scheduled");return n}function cr(e,t){var n=Un(e,t);if(n.state>Uc)throw new Error("too late; already running");return n}function Un(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function $D(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=GE(o,0,n.time);function o(c){n.state=kv,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var u,f,h,p;if(n.state!==kv)return a();for(u in r)if(p=r[u],p.name===n.name){if(p.state===Uc)return Sv(i);p.state===Ev?(p.state=qc,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=qc,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Sv(function(){n.state===Uc&&(n.state=Ev,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Up,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Up){for(n.state=Uc,s=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(s[++f]=p);s.length=f+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=qp,1),f=-1,h=s.length;++f<h;)s[f].call(e,u);n.state===qp&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=qc,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Kc(e,t){var n=e.__transition,r,s,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}s=r.state>Up&&r.state<qp,r.state=qc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function FD(e){return this.each(function(){Kc(this,e)})}function LD(e,t){var n,r;return function(){var s=cr(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function HD(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=cr(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var l={name:t,value:n},a=0,c=s.length;a<c;++a)if(s[a].name===t){s[a]=l;break}a===c&&s.push(l)}o.tween=s}}function BD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Un(this.node(),n).tween,s=0,o=r.length,i;s<o;++s)if((i=r[s]).name===e)return i.value;return null}return this.each((t==null?LD:HD)(n,e,t))}function p0(e,t,n){var r=e._id;return e.each(function(){var s=cr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Un(s,r).value[t]}}function XE(e,t){var n;return(typeof t=="number"?Gr:t instanceof sa?yv:(n=sa(t))?(t=n,yv):kD)(e,t)}function VD(e){return function(){this.removeAttribute(e)}}function WD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UD(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttribute(e);return i===s?null:i===r?o:o=t(r=i,n)}}function qD(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===s?null:i===r?o:o=t(r=i,n)}}function KD(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function YD(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function GD(e,t){var n=Dd(e),r=n==="transform"?RD:XE;return this.attrTween(e,typeof t=="function"?(n.local?YD:KD)(n,r,p0(this,"attr."+e,t)):t==null?(n.local?WD:VD)(n):(n.local?qD:UD)(n,r,t))}function QD(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function XD(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ZD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&XD(e,o)),n}return s._value=t,s}function JD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&QD(e,o)),n}return s._value=t,s}function e$(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Dd(e);return this.tween(n,(r.local?ZD:JD)(r,t))}function t$(e,t){return function(){h0(this,e).delay=+t.apply(this,arguments)}}function n$(e,t){return t=+t,function(){h0(this,e).delay=t}}function r$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?t$:n$)(t,e)):Un(this.node(),t).delay}function s$(e,t){return function(){cr(this,e).duration=+t.apply(this,arguments)}}function o$(e,t){return t=+t,function(){cr(this,e).duration=t}}function i$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?s$:o$)(t,e)):Un(this.node(),t).duration}function l$(e,t){if(typeof t!="function")throw new Error;return function(){cr(this,e).ease=t}}function a$(e){var t=this._id;return arguments.length?this.each(l$(t,e)):Un(this.node(),t).ease}function c$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;cr(this,e).ease=n}}function u$(e){if(typeof e!="function")throw new Error;return this.each(c$(this._id,e))}function d$(e){typeof e!="function"&&(e=TE(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],a,c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new zr(r,this._parents,this._name,this._id)}function f$(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var a=t[l],c=n[l],u=a.length,f=i[l]=new Array(u),h,p=0;p<u;++p)(h=a[p]||c[p])&&(f[p]=h);for(;l<r;++l)i[l]=t[l];return new zr(i,this._parents,this._name,this._id)}function h$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function p$(e,t,n){var r,s,o=h$(t)?h0:cr;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function m$(e,t){var n=this._id;return arguments.length<2?Un(this.node(),n).on.on(e):this.each(p$(n,e,t))}function g$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function x$(){return this.on("end.remove",g$(this._id))}function y$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=c0(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],a=l.length,c=o[i]=new Array(a),u,f,h=0;h<a;++h)(u=l[h])&&(f=e.call(u,u.__data__,h,l))&&("__data__"in u&&(f.__data__=u.__data__),c[h]=f,Fd(c[h],t,n,h,c,Un(u,n)));return new zr(o,this._parents,t,n)}function v$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=RE(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var a=r[l],c=a.length,u,f=0;f<c;++f)if(u=a[f]){for(var h=e.call(u,u.__data__,f,a),p,v=Un(u,n),x=0,b=h.length;x<b;++x)(p=h[x])&&Fd(p,t,n,x,h,v);o.push(h),i.push(u)}return new zr(o,i,t,n)}var w$=Ia.prototype.constructor;function b$(){return new w$(this._groups,this._parents)}function S$(e,t){var n,r,s;return function(){var o=Oi(this,e),i=(this.style.removeProperty(e),Oi(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function ZE(e){return function(){this.style.removeProperty(e)}}function k$(e,t,n){var r,s=n+"",o;return function(){var i=Oi(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function E$(e,t,n){var r,s,o;return function(){var i=Oi(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Oi(this,e))),i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l))}}function C$(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var a=cr(this,e),c=a.on,u=a.value[o]==null?l||(l=ZE(t)):void 0;(c!==n||s!==u)&&(r=(n=c).copy()).on(i,s=u),a.on=r}}function N$(e,t,n){var r=(e+="")=="transform"?ND:XE;return t==null?this.styleTween(e,S$(e,r)).on("end.style."+e,ZE(e)):typeof t=="function"?this.styleTween(e,E$(e,r,p0(this,"style."+e,t))).each(C$(this._id,e)):this.styleTween(e,k$(e,r,t),n).on("end.style."+e,null)}function R$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function T$(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&R$(e,i,n)),r}return o._value=t,o}function P$(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,T$(e,t,n??""))}function I$(e){return function(){this.textContent=e}}function j$(e){return function(){var t=e(this);this.textContent=t??""}}function O$(e){return this.tween("text",typeof e=="function"?j$(p0(this,"text",e)):I$(e==null?"":e+""))}function _$(e){return function(t){this.textContent=e.call(this,t)}}function M$(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&_$(s)),t}return r._value=e,r}function A$(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,M$(e))}function z$(){for(var e=this._name,t=this._id,n=JE(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,a,c=0;c<l;++c)if(a=i[c]){var u=Un(a,t);Fd(a,e,n,c,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new zr(r,this._parents,e,n)}function D$(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},a={value:function(){--s===0&&o()}};n.each(function(){var c=cr(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),c.on=t}),s===0&&o()})}var $$=0;function zr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function JE(){return++$$}var fr=Ia.prototype;zr.prototype={constructor:zr,select:y$,selectAll:v$,selectChild:fr.selectChild,selectChildren:fr.selectChildren,filter:d$,merge:f$,selection:b$,transition:z$,call:fr.call,nodes:fr.nodes,node:fr.node,size:fr.size,empty:fr.empty,each:fr.each,on:m$,attr:GD,attrTween:e$,style:N$,styleTween:P$,text:O$,textTween:A$,remove:x$,tween:BD,delay:r$,duration:i$,ease:a$,easeVarying:u$,end:D$,[Symbol.iterator]:fr[Symbol.iterator]};function F$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var L$={time:null,delay:0,duration:250,ease:F$};function H$(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function B$(e){var t,n;e instanceof zr?(t=e._id,e=e._name):(t=JE(),(n=L$).time=f0(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,a,c=0;c<l;++c)(a=i[c])&&Fd(a,e,t,c,i,n||H$(a,t));return new zr(r,this._parents,e,t)}Ia.prototype.interrupt=FD;Ia.prototype.transition=B$;const kc=e=>()=>e;function V$(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Er(e,t,n){this.k=e,this.x=t,this.y=n}Er.prototype={constructor:Er,scale:function(e){return e===1?this:new Er(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Er(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ld=new Er(1,0,0);eC.prototype=Er.prototype;function eC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ld;return e.__zoom}function Xf(e){e.stopImmediatePropagation()}function ll(e){e.preventDefault(),e.stopImmediatePropagation()}function W$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function U$(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Cv(){return this.__zoom||Ld}function q$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function K$(){return navigator.maxTouchPoints||"ontouchstart"in this}function Y$(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function tC(){var e=W$,t=U$,n=Y$,r=q$,s=K$,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=jD,c=zd("start","zoom","end"),u,f,h,p=500,v=150,x=0,b=10;function g(R){R.property("__zoom",Cv).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",z).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(R,j,O,F){var T=R.selection?R.selection():R;T.property("__zoom",Cv),R!==T?k(R,j,O,F):T.interrupt().each(function(){N(this,arguments).event(F).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(R,j,O,F){g.scaleTo(R,function(){var T=this.__zoom.k,M=typeof j=="function"?j.apply(this,arguments):j;return T*M},O,F)},g.scaleTo=function(R,j,O,F){g.transform(R,function(){var T=t.apply(this,arguments),M=this.__zoom,_=O==null?w(T):typeof O=="function"?O.apply(this,arguments):O,U=M.invert(_),L=typeof j=="function"?j.apply(this,arguments):j;return n(y(m(M,L),_,U),T,i)},O,F)},g.translateBy=function(R,j,O,F){g.transform(R,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof O=="function"?O.apply(this,arguments):O),t.apply(this,arguments),i)},null,F)},g.translateTo=function(R,j,O,F,T){g.transform(R,function(){var M=t.apply(this,arguments),_=this.__zoom,U=F==null?w(M):typeof F=="function"?F.apply(this,arguments):F;return n(Ld.translate(U[0],U[1]).scale(_.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof O=="function"?-O.apply(this,arguments):-O),M,i)},F,T)};function m(R,j){return j=Math.max(o[0],Math.min(o[1],j)),j===R.k?R:new Er(j,R.x,R.y)}function y(R,j,O){var F=j[0]-O[0]*R.k,T=j[1]-O[1]*R.k;return F===R.x&&T===R.y?R:new Er(R.k,F,T)}function w(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function k(R,j,O,F){R.on("start.zoom",function(){N(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(F).end()}).tween("zoom",function(){var T=this,M=arguments,_=N(T,M).event(F),U=t.apply(T,M),L=O==null?w(U):typeof O=="function"?O.apply(T,M):O,K=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),W=T.__zoom,q=typeof j=="function"?j.apply(T,M):j,H=a(W.invert(L).concat(K/W.k),q.invert(L).concat(K/q.k));return function(G){if(G===1)G=q;else{var B=H(G),Y=K/B[2];G=new Er(Y,L[0]-B[0]*Y,L[1]-B[1]*Y)}_.zoom(null,G)}})}function N(R,j,O){return!O&&R.__zooming||new E(R,j)}function E(R,j){this.that=R,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,j),this.taps=0}E.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,j){return this.mouse&&R!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var j=ln(this.that).datum();c.call(R,this.that,new V$(R,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),j)}};function C(R,...j){if(!e.apply(this,arguments))return;var O=N(this,j).event(R),F=this.__zoom,T=Math.max(o[0],Math.min(o[1],F.k*Math.pow(2,r.apply(this,arguments)))),M=Dn(R);if(O.wheel)(O.mouse[0][0]!==M[0]||O.mouse[0][1]!==M[1])&&(O.mouse[1]=F.invert(O.mouse[0]=M)),clearTimeout(O.wheel);else{if(F.k===T)return;O.mouse=[M,F.invert(M)],Kc(this),O.start()}ll(R),O.wheel=setTimeout(_,v),O.zoom("mouse",n(y(m(F,T),O.mouse[0],O.mouse[1]),O.extent,i));function _(){O.wheel=null,O.end()}}function P(R,...j){if(h||!e.apply(this,arguments))return;var O=R.currentTarget,F=N(this,j,!0).event(R),T=ln(R.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",K,!0),M=Dn(R,O),_=R.clientX,U=R.clientY;$E(R.view),Xf(R),F.mouse=[M,this.__zoom.invert(M)],Kc(this),F.start();function L(W){if(ll(W),!F.moved){var q=W.clientX-_,H=W.clientY-U;F.moved=q*q+H*H>x}F.event(W).zoom("mouse",n(y(F.that.__zoom,F.mouse[0]=Dn(W,O),F.mouse[1]),F.extent,i))}function K(W){T.on("mousemove.zoom mouseup.zoom",null),FE(W.view,F.moved),ll(W),F.event(W).end()}}function I(R,...j){if(e.apply(this,arguments)){var O=this.__zoom,F=Dn(R.changedTouches?R.changedTouches[0]:R,this),T=O.invert(F),M=O.k*(R.shiftKey?.5:2),_=n(y(m(O,M),F,T),t.apply(this,j),i);ll(R),l>0?ln(this).transition().duration(l).call(k,_,F,R):ln(this).call(g.transform,_,F,R)}}function z(R,...j){if(e.apply(this,arguments)){var O=R.touches,F=O.length,T=N(this,j,R.changedTouches.length===F).event(R),M,_,U,L;for(Xf(R),_=0;_<F;++_)U=O[_],L=Dn(U,this),L=[L,this.__zoom.invert(L),U.identifier],T.touch0?!T.touch1&&T.touch0[2]!==L[2]&&(T.touch1=L,T.taps=0):(T.touch0=L,M=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),M&&(T.taps<2&&(f=L[0],u=setTimeout(function(){u=null},p)),Kc(this),T.start())}}function $(R,...j){if(this.__zooming){var O=N(this,j).event(R),F=R.changedTouches,T=F.length,M,_,U,L;for(ll(R),M=0;M<T;++M)_=F[M],U=Dn(_,this),O.touch0&&O.touch0[2]===_.identifier?O.touch0[0]=U:O.touch1&&O.touch1[2]===_.identifier&&(O.touch1[0]=U);if(_=O.that.__zoom,O.touch1){var K=O.touch0[0],W=O.touch0[1],q=O.touch1[0],H=O.touch1[1],G=(G=q[0]-K[0])*G+(G=q[1]-K[1])*G,B=(B=H[0]-W[0])*B+(B=H[1]-W[1])*B;_=m(_,Math.sqrt(G/B)),U=[(K[0]+q[0])/2,(K[1]+q[1])/2],L=[(W[0]+H[0])/2,(W[1]+H[1])/2]}else if(O.touch0)U=O.touch0[0],L=O.touch0[1];else return;O.zoom("touch",n(y(_,U,L),O.extent,i))}}function A(R,...j){if(this.__zooming){var O=N(this,j).event(R),F=R.changedTouches,T=F.length,M,_;for(Xf(R),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),M=0;M<T;++M)_=F[M],O.touch0&&O.touch0[2]===_.identifier?delete O.touch0:O.touch1&&O.touch1[2]===_.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(_=Dn(_,this),Math.hypot(f[0]-_[0],f[1]-_[1])<b)){var U=ln(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return g.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:kc(+R),g):r},g.filter=function(R){return arguments.length?(e=typeof R=="function"?R:kc(!!R),g):e},g.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:kc(!!R),g):s},g.extent=function(R){return arguments.length?(t=typeof R=="function"?R:kc([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),g):t},g.scaleExtent=function(R){return arguments.length?(o[0]=+R[0],o[1]=+R[1],g):[o[0],o[1]]},g.translateExtent=function(R){return arguments.length?(i[0][0]=+R[0][0],i[1][0]=+R[1][0],i[0][1]=+R[0][1],i[1][1]=+R[1][1],g):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},g.constrain=function(R){return arguments.length?(n=R,g):n},g.duration=function(R){return arguments.length?(l=+R,g):l},g.interpolate=function(R){return arguments.length?(a=R,g):a},g.on=function(){var R=c.on.apply(c,arguments);return R===c?g:R},g.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,g):Math.sqrt(x)},g.tapDistance=function(R){return arguments.length?(b=+R,g):b},g}const Fr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},ia=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nC=["Enter"," ","Escape"];var Mi;(function(e){e.Strict="strict",e.Loose="loose"})(Mi||(Mi={}));var no;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(no||(no={}));var la;(function(e){e.Partial="partial",e.Full="full"})(la||(la={}));const rC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Zr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zr||(Zr={}));var Yu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Yu||(Yu={}));var de;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(de||(de={}));const Nv={[de.Left]:de.Right,[de.Right]:de.Left,[de.Top]:de.Bottom,[de.Bottom]:de.Top};function sC(e){return e===null?null:e?"valid":"invalid"}const oC=e=>"id"in e&&"source"in e&&"target"in e,G$=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),m0=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Oa=(e,t=[0,0])=>{const{width:n,height:r}=Lr(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},Q$=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let i=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(i=o?t.nodeLookup.get(s):m0(s)?s:t.nodeLookup.get(s.id));const l=i?Gu(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Hd(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Bd(n)},_a=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const s=Gu(r);n=Hd(n,s)}}),Bd(n)},iC=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...Ma(t,[n,r,s]),width:t.width/s,height:t.height/s},a=[];for(const c of e.values()){const{measured:u,selectable:f=!0,hidden:h=!1}=c;if(i&&!f||h)continue;const p=u.width??c.width??c.initialWidth??null,v=u.height??c.height??c.initialHeight??null,x=aa(l,zi(c)),b=(p??0)*(v??0),g=o&&x>0;(!c.internals.handleBounds||g||x>=b||c.dragging)&&a.push(c)}return a},X$=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Kp(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Yp({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!1);const l=_a(e),a=g0(l,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(a,{duration:i==null?void 0:i.duration}),Promise.resolve(!0)}function lC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:a,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},u=i.origin??r;let f=s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",Fr.error005());else{const p=l.measured.width,v=l.measured.height;p&&v&&(f=[[a,c],[a+p,c+v]])}else l&&Di(i.extent)&&(f=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const h=Di(f)?po(t,f,i.measured):t;return{position:{x:h.x-a+i.measured.width*u[0],y:h.y-c+i.measured.height*u[1]},positionAbsolute:h}}async function Z$({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(h=>h.id)),i=[];for(const h of n){if(h.deletable===!1)continue;const p=o.has(h.id),v=!p&&h.parentId&&i.find(x=>x.id===h.parentId);(p||v)&&i.push(h)}const l=new Set(t.map(h=>h.id)),a=r.filter(h=>h.deletable!==!1),u=X$(i,a);for(const h of a)l.has(h.id)&&!u.find(v=>v.id===h.id)&&u.push(h);if(!s)return{edges:u,nodes:i};const f=await s({nodes:i,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:i}:{edges:[],nodes:[]}:f}const Ai=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),po=(e={x:0,y:0},t,n)=>({x:Ai(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ai(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function aC(e,t,n){const{width:r,height:s}=Lr(n),{x:o,y:i}=n.internals.positionAbsolute;return po(e,[[o,i],[o+r,i+s]],t)}const Rv=(e,t,n)=>e<t?Ai(Math.abs(e-t),1,t)/t:e>n?-Ai(Math.abs(e-n),1,t)/t:0,cC=(e,t,n=15,r=40)=>{const s=Rv(e.x,r,t.width-r)*n,o=Rv(e.y,r,t.height-r)*n;return[s,o]},Hd=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Gp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Bd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zi=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=m0(e)?e.internals.positionAbsolute:Oa(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Gu=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=m0(e)?e.internals.positionAbsolute:Oa(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},uC=(e,t)=>Bd(Hd(Gp(e),Gp(t))),aa=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Tv=e=>Ln(e.width)&&Ln(e.height)&&Ln(e.x)&&Ln(e.y),Ln=e=>!isNaN(e)&&isFinite(e),J$=(e,t)=>{},Vd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ma=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Vd(l,i):l},dC=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),g0=(e,t,n,r,s,o)=>{const i=t/(e.width*(1+o)),l=n/(e.height*(1+o)),a=Math.min(i,l),c=Ai(a,r,s),u=e.x+e.width/2,f=e.y+e.height/2,h=t/2-u*c,p=n/2-f*c;return{x:h,y:p,zoom:c}},Qu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Di(e){return e!==void 0&&e!=="parent"}function Lr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function fC(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function hC(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const l=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function Il(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Tr(e),l=Ma({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:a,y:c}=n?Vd(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const Wd=e=>({width:e.offsetWidth,height:e.offsetHeight}),pC=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},eF=["INPUT","SELECT","TEXTAREA"];function Qp(e){var r,s,o;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return eF.includes(t==null?void 0:t.nodeName)||((o=t==null?void 0:t.hasAttribute)==null?void 0:o.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const mC=e=>"clientX"in e,Tr=(e,t)=>{var o,i;const n=mC(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Pv=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Wd(i)}})};function gC({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const a=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+l*.375+r*.125,u=Math.abs(a-e),f=Math.abs(c-t);return[a,c,u,f]}function Ec(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Iv({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case de.Left:return[t-Ec(t-r,o),n];case de.Right:return[t+Ec(r-t,o),n];case de.Top:return[t,n-Ec(n-s,o)];case de.Bottom:return[t,n+Ec(s-n,o)]}}function xC({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top,curvature:i=.25}){const[l,a]=Iv({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,u]=Iv({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[f,h,p,v]=gC({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${a} ${c},${u} ${r},${s}`,f,h,p,v]}function yC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[o,l,s,i]}function tF({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1}){if(!s)return r;const o=n||t.selected||e.selected,i=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?i:0)}function nF({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Hd(Gu(e),Gu(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return aa(i,Bd(o))>0}const rF=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,sF=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),oF=(e,t)=>{if(!e.source||!e.target)return t;let n;return oC(e)?n={...e}:n={...e,id:rF(e)},sF(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function vC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=yC({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const jv={[de.Left]:{x:-1,y:0},[de.Right]:{x:1,y:0},[de.Top]:{x:0,y:-1},[de.Bottom]:{x:0,y:1}},iF=({source:e,sourcePosition:t=de.Bottom,target:n})=>t===de.Left||t===de.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Ov=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function lF({source:e,sourcePosition:t=de.Bottom,target:n,targetPosition:r=de.Top,center:s,offset:o}){const i=jv[t],l=jv[r],a={x:e.x+i.x*o,y:e.y+i.y*o},c={x:n.x+l.x*o,y:n.y+l.y*o},u=iF({source:a,sourcePosition:t,target:c}),f=u.x!==0?"x":"y",h=u[f];let p=[],v,x;const b={x:0,y:0},g={x:0,y:0},[m,y,w,k]=yC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[f]*l[f]===-1){v=s.x??m,x=s.y??y;const E=[{x:v,y:a.y},{x:v,y:c.y}],C=[{x:a.x,y:x},{x:c.x,y:x}];i[f]===h?p=f==="x"?E:C:p=f==="x"?C:E}else{const E=[{x:a.x,y:c.y}],C=[{x:c.x,y:a.y}];if(f==="x"?p=i.x===h?C:E:p=i.y===h?E:C,t===r){const A=Math.abs(e[f]-n[f]);if(A<=o){const R=Math.min(o-1,o-A);i[f]===h?b[f]=(a[f]>e[f]?-1:1)*R:g[f]=(c[f]>n[f]?-1:1)*R}}if(t!==r){const A=f==="x"?"y":"x",R=i[f]===l[A],j=a[A]>c[A],O=a[A]<c[A];(i[f]===1&&(!R&&j||R&&O)||i[f]!==1&&(!R&&O||R&&j))&&(p=f==="x"?E:C)}const P={x:a.x+b.x,y:a.y+b.y},I={x:c.x+g.x,y:c.y+g.y},z=Math.max(Math.abs(P.x-p[0].x),Math.abs(I.x-p[0].x)),$=Math.max(Math.abs(P.y-p[0].y),Math.abs(I.y-p[0].y));z>=$?(v=(P.x+I.x)/2,x=p[0].y):(v=p[0].x,x=(P.y+I.y)/2)}return[[e,{x:a.x+b.x,y:a.y+b.y},...p,{x:c.x+g.x,y:c.y+g.y},n],v,x,w,k]}function aF(e,t,n,r){const s=Math.min(Ov(e,t)/2,Ov(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+s*c},${i}Q ${o},${i} ${o},${i+s*u}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${o},${i+s*a}Q ${o},${i} ${o+s*l},${i}`}function Xp({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20}){const[u,f,h,p,v]=lF({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:a},offset:c});return[u.reduce((b,g,m)=>{let y="";return m>0&&m<u.length-1?y=aF(u[m-1],g,u[m+1],i):y=`${m===0?"M":"L"}${g.x} ${g.y}`,b+=y,b},""),f,h,p,v]}function _v(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function cF(e){var f;const{sourceNode:t,targetNode:n}=e;if(!_v(t)||!_v(n))return null;const r=t.internals.handleBounds||Mv(t.handles),s=n.internals.handleBounds||Mv(n.handles),o=Av((r==null?void 0:r.source)??[],e.sourceHandle),i=Av(e.connectionMode===Mi.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(f=e.onError)==null||f.call(e,"008",Fr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||de.Bottom,a=(i==null?void 0:i.position)||de.Top,c=ca(t,o,l),u=ca(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:a}}function Mv(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ca(e,t,n=de.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??Lr(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case de.Top:return{x:s+i/2,y:o};case de.Right:return{x:s+i,y:o+l/2};case de.Bottom:return{x:s+i/2,y:o+l};case de.Left:return{x:s,y:o+l/2}}}function Av(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Zp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function uF(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||s].forEach(a=>{if(a&&typeof a=="object"){const c=Zp(a,t);o.has(c)||(i.push({id:c,color:a.color||n,...a}),o.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const x0={nodeOrigin:[0,0],nodeExtent:ia,elevateNodesOnSelect:!0,defaults:{}},dF={...x0,checkEquality:!0};function y0(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function fF(e,t,n){const r=y0(x0,n);for(const s of e.values())if(s.parentId)v0(s,e,t,r);else{const o=Oa(s,r.nodeOrigin),i=Di(s.extent)?s.extent:r.nodeExtent,l=po(o,i,Lr(s));s.internals.positionAbsolute=l}}function Jp(e,t,n,r){var l,a;const s=y0(dF,r),o=new Map(t),i=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let u=o.get(c.id);if(s.checkEquality&&c===(u==null?void 0:u.internals.userNode))t.set(c.id,u);else{const f=Oa(c,s.nodeOrigin),h=Di(c.extent)?c.extent:s.nodeExtent,p=po(f,h,Lr(c));u={...s.defaults,...c,measured:{width:(l=c.measured)==null?void 0:l.width,height:(a=c.measured)==null?void 0:a.height},internals:{positionAbsolute:p,handleBounds:c.measured?u==null?void 0:u.internals.handleBounds:void 0,z:wC(c,i),userNode:c}},t.set(c.id,u)}c.parentId&&v0(u,t,n,r)}}function hF(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function v0(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:i}=y0(x0,r),l=e.parentId,a=t.get(l);if(!a){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}hF(e,n);const c=s?1e3:0,{x:u,y:f,z:h}=pF(e,a,o,i,c),{positionAbsolute:p}=e.internals,v=u!==p.x||f!==p.y;(v||h!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:v?{x:u,y:f}:p,z:h})}function wC(e,t){return(Ln(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function pF(e,t,n,r,s){const{x:o,y:i}=t.internals.positionAbsolute,l=Lr(e),a=Oa(e,n),c=Di(e.extent)?po(a,e.extent,l):a;let u=po({x:o+c.x,y:i+c.y},r,l);e.extent==="parent"&&(u=aC(u,l,t));const f=wC(e,s),h=t.internals.z??0;return{x:u.x,y:u.y,z:h>f?h:f}}function w0(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??zi(a),u=uC(c,l.rect);o.set(l.parentId,{expandedRect:u,parent:a})}return o.size>0&&o.forEach(({expandedRect:l,parent:a},c)=>{var y;const u=a.internals.positionAbsolute,f=Lr(a),h=a.origin??r,p=l.x<u.x?Math.round(Math.abs(u.x-l.x)):0,v=l.y<u.y?Math.round(Math.abs(u.y-l.y)):0,x=Math.max(f.width,Math.round(l.width)),b=Math.max(f.height,Math.round(l.height)),g=(x-f.width)*h[0],m=(b-f.height)*h[1];(p>0||v>0||g||m)&&(s.push({id:c,type:"position",position:{x:a.position.x-p+g,y:a.position.y-v+m}}),(y=n.get(c))==null||y.forEach(w=>{e.some(k=>k.id===w.id)||s.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+v}})})),(f.width<l.width||f.height<l.height||p||v)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:x+(p?h[0]*p-g:0),height:b+(v?h[1]*v-m:0)}})}),s}function mF(e,t,n,r,s,o){const i=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!i)return{changes:[],updatedInternals:l};const a=[],c=window.getComputedStyle(i),{m22:u}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const h of e.values()){const p=t.get(h.id);if(p)if(p.hidden)p.internals={...p.internals,handleBounds:void 0},l=!0;else{const v=Wd(h.nodeElement),x=p.measured.width!==v.width||p.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!p.internals.handleBounds||h.force))){const g=h.nodeElement.getBoundingClientRect(),m=Di(p.extent)?p.extent:o;let{positionAbsolute:y}=p.internals;p.parentId&&p.extent==="parent"?y=aC(y,v,t.get(p.parentId)):m&&(y=po(y,m,v)),p.measured=v,p.internals={...p.internals,positionAbsolute:y,handleBounds:{source:Pv("source",h.nodeElement,g,u,p.id),target:Pv("target",h.nodeElement,g,u,p.id)}},p.parentId&&v0(p,t,n,{nodeOrigin:s}),l=!0,x&&(a.push({id:p.id,type:"dimensions",dimensions:v}),p.expandParent&&p.parentId&&f.push({id:p.id,parentId:p.parentId,rect:zi(p,s)}))}}}if(f.length>0){const h=w0(f,t,n,s);a.push(...h)}return{changes:a,updatedInternals:l}}async function gF({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function bC(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,a=`${s}-source-${i}`,c=`${o}-target-${l}`,u=e.get(a)||new Map,f=e.get(c)||new Map,h={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l};t.set(r.id,r),e.set(a,u.set(`${o}-${l}`,h)),e.set(c,f.set(`${s}-${i}`,h))}}function SC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:SC(n,t):!1}function zv(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function xF(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!SC(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(o);l&&s.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Zf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const s=[];for(const[c,u]of t){const f=(i=n.get(c))==null?void 0:i.internals.userNode;f&&s.push({...f,position:u.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((a=t.get(e))==null?void 0:a.position)||o.position,dragging:r}:s[0],s]}function yF({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,a=!1,c={x:0,y:0},u=null,f=!1,h=null,p=!1;function v({noDragClassName:b,handleSelector:g,domNode:m,isSelectable:y,nodeId:w,nodeClickDistance:k=0}){h=ln(m);function N({x:I,y:z},$){const{nodeLookup:A,nodeExtent:R,snapGrid:j,snapToGrid:O,nodeOrigin:F,onNodeDrag:T,onSelectionDrag:M,onError:_,updateNodePositions:U}=t();o={x:I,y:z};let L=!1,K={x:0,y:0,x2:0,y2:0};if(l.size>1&&R){const W=_a(l);K=Gp(W)}for(const[W,q]of l){if(!A.has(W))continue;let H={x:I-q.distance.x,y:z-q.distance.y};O&&(H=Vd(H,j));let G=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(l.size>1&&R&&!q.extent){const{positionAbsolute:Q}=q.internals,Z=Q.x-K.x+R[0][0],V=Q.x+q.measured.width-K.x2+R[1][0],X=Q.y-K.y+R[0][1],ee=Q.y+q.measured.height-K.y2+R[1][1];G=[[Z,X],[V,ee]]}const{position:B,positionAbsolute:Y}=lC({nodeId:W,nextPosition:H,nodeLookup:A,nodeExtent:G,nodeOrigin:F,onError:_});L=L||q.position.x!==B.x||q.position.y!==B.y,q.position=B,q.internals.positionAbsolute=Y}if(L&&(U(l,!0),$&&(r||T||!w&&M))){const[W,q]=Zf({nodeId:w,dragItems:l,nodeLookup:A});r==null||r($,l,W,q),T==null||T($,W,q),w||M==null||M($,q)}}async function E(){if(!u)return;const{transform:I,panBy:z,autoPanSpeed:$}=t(),[A,R]=cC(c,u,$);(A!==0||R!==0)&&(o.x=(o.x??0)-A/I[2],o.y=(o.y??0)-R/I[2],await z({x:A,y:R})&&N(o,null)),i=requestAnimationFrame(E)}function C(I){var L;const{nodeLookup:z,multiSelectionActive:$,nodesDraggable:A,transform:R,snapGrid:j,snapToGrid:O,selectNodesOnDrag:F,onNodeDragStart:T,onSelectionDragStart:M,unselectNodesAndEdges:_}=t();f=!0,(!F||!y)&&!$&&w&&((L=z.get(w))!=null&&L.selected||_()),y&&F&&w&&(e==null||e(w));const U=Il(I.sourceEvent,{transform:R,snapGrid:j,snapToGrid:O,containerBounds:u});if(o=U,l=xF(z,A,U,w),l.size>0&&(n||T||!w&&M)){const[K,W]=Zf({nodeId:w,dragItems:l,nodeLookup:z});n==null||n(I.sourceEvent,l,K,W),T==null||T(I.sourceEvent,K,W),w||M==null||M(I.sourceEvent,W)}}const P=LE().clickDistance(k).on("start",I=>{const{domNode:z,nodeDragThreshold:$,transform:A,snapGrid:R,snapToGrid:j}=t();u=(z==null?void 0:z.getBoundingClientRect())||null,p=!1,$===0&&C(I),o=Il(I.sourceEvent,{transform:A,snapGrid:R,snapToGrid:j,containerBounds:u}),c=Tr(I.sourceEvent,u)}).on("drag",I=>{const{autoPanOnNodeDrag:z,transform:$,snapGrid:A,snapToGrid:R,nodeDragThreshold:j,nodeLookup:O}=t(),F=Il(I.sourceEvent,{transform:$,snapGrid:A,snapToGrid:R,containerBounds:u});if((I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||w&&!O.has(w))&&(p=!0),!p){if(!a&&z&&f&&(a=!0,E()),!f){const T=F.xSnapped-(o.x??0),M=F.ySnapped-(o.y??0);Math.sqrt(T*T+M*M)>j&&C(I)}(o.x!==F.xSnapped||o.y!==F.ySnapped)&&l&&f&&(c=Tr(I.sourceEvent,u),N(F,I.sourceEvent))}}).on("end",I=>{if(!(!f||p)&&(a=!1,f=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:z,updateNodePositions:$,onNodeDragStop:A,onSelectionDragStop:R}=t();if($(l,!1),s||A||!w&&R){const[j,O]=Zf({nodeId:w,dragItems:l,nodeLookup:z,dragging:!1});s==null||s(I.sourceEvent,l,j,O),A==null||A(I.sourceEvent,j,O),w||R==null||R(I.sourceEvent,O)}}}).filter(I=>{const z=I.target;return!I.button&&(!b||!zv(z,`.${b}`,m))&&(!g||zv(z,g,m))});h.call(P)}function x(){h==null||h.on(".drag",null)}return{update:v,destroy:x}}function vF(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())aa(s,zi(o))>0&&r.push(o);return r}const wF=250;function bF(e,t,n,r){var l,a;let s=[],o=1/0;const i=vF(e,n,t+wF);for(const c of i){const u=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((a=c.internals.handleBounds)==null?void 0:a.target)??[]];for(const f of u){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=ca(c,f,f.position,!0),v=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));v>t||(v<o?(s=[{...f,x:h,y:p}],o=v):v===o&&s.push({...f,x:h,y:p}))}}if(!s.length)return null;if(s.length>1){const c=r.type==="source"?"target":"source";return s.find(u=>u.type===c)??s[0]}return s[0]}function kC(e,t,n,r,s,o=!1){var c,u,f;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((u=i.internals.handleBounds)==null?void 0:u.source)??[],...((f=i.internals.handleBounds)==null?void 0:f.target)??[]],a=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return a&&o?{...a,...ca(i,a,a.position,!0)}:a}function EC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function SF(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const CC=()=>!0;function kF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:u,flowId:f,panBy:h,cancelConnection:p,onConnectStart:v,onConnect:x,onConnectEnd:b,isValidConnection:g=CC,onReconnectEnd:m,updateConnection:y,getTransform:w,getFromHandle:k,autoPanSpeed:N}){const E=pC(e.target);let C=0,P;const{x:I,y:z}=Tr(e),$=E==null?void 0:E.elementFromPoint(I,z),A=EC(o,$),R=l==null?void 0:l.getBoundingClientRect();if(!R||!A)return;const j=kC(s,A,r,a,t);if(!j)return;let O=Tr(e,R),F=!1,T=null,M=!1,_=null;function U(){if(!u||!R)return;const[Y,Q]=cC(O,R,N);h({x:Y,y:Q}),C=requestAnimationFrame(U)}const L={...j,nodeId:s,type:A,position:j.position},K=a.get(s),q={inProgress:!0,isValid:null,from:ca(K,L,de.Left,!0),fromHandle:L,fromPosition:L.position,fromNode:K,to:O,toHandle:null,toPosition:Nv[L.position],toNode:null};y(q);let H=q;v==null||v(e,{nodeId:s,handleId:r,handleType:A});function G(Y){if(!k()||!L){B(Y);return}const Q=w();O=Tr(Y,R),P=bF(Ma(O,Q,!1,[1,1]),n,a,L),F||(U(),F=!0);const Z=NC(Y,{handle:P,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:g,doc:E,lib:c,flowId:f,nodeLookup:a});_=Z.handleDomNode,T=Z.connection,M=SF(!!P,Z.isValid);const V={...H,isValid:M,to:P&&M?dC({x:P.x,y:P.y},Q):O,toHandle:Z.toHandle,toPosition:M&&Z.toHandle?Z.toHandle.position:Nv[L.position],toNode:Z.toHandle?a.get(Z.toHandle.nodeId):null};M&&P&&H.toHandle&&V.toHandle&&H.toHandle.type===V.toHandle.type&&H.toHandle.nodeId===V.toHandle.nodeId&&H.toHandle.id===V.toHandle.id&&H.to.x===V.to.x&&H.to.y===V.to.y||(y(V),H=V)}function B(Y){(P||_)&&T&&M&&(x==null||x(T));const{inProgress:Q,...Z}=H,V={...Z,toPosition:H.toHandle?H.toPosition:null};b==null||b(Y,V),o&&(m==null||m(Y,V)),p(),cancelAnimationFrame(C),F=!1,M=!1,T=null,_=null,E.removeEventListener("mousemove",G),E.removeEventListener("mouseup",B),E.removeEventListener("touchmove",G),E.removeEventListener("touchend",B)}E.addEventListener("mousemove",G),E.addEventListener("mouseup",B),E.addEventListener("touchmove",G),E.addEventListener("touchend",B)}function NC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:a,isValidConnection:c=CC,nodeLookup:u}){const f=o==="target",h=t?i.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:v}=Tr(e),x=i.elementFromPoint(p,v),b=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:h,g={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const m=EC(void 0,b),y=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),k=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!y||!m)return g;const E={source:f?y:r,sourceHandle:f?w:s,target:f?r:y,targetHandle:f?s:w};g.connection=E;const P=k&&N&&(n===Mi.Strict?f&&m==="source"||!f&&m==="target":y!==r||w!==s);g.isValid=P&&c(E),g.toHandle=kC(y,m,w,u,n,!1)}return g}const em={onPointerDown:kF,isValid:NC};function EF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=ln(e);function o({translateExtent:l,width:a,height:c,zoomStep:u=10,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const v=y=>{const w=n();if(y.sourceEvent.type!=="wheel"||!t)return;const k=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*u,N=w[2]*Math.pow(2,k);t.scaleTo(N)};let x=[0,0];const b=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(x=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},g=y=>{const w=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const k=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[k[0]-x[0],k[1]-x[1]];x=k;const E=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),C={x:w[0]-N[0]*E,y:w[1]-N[1]*E},P=[[0,0],[a,c]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},P,l)},m=tC().on("start",b).on("zoom",f?g:null).on("zoom.wheel",h?v:null);s.call(m,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:Dn}}const CF=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ud=e=>({x:e.x,y:e.y,zoom:e.k}),Jf=({x:e,y:t,zoom:n})=>Ld.translate(e,t).scale(n),Wo=(e,t)=>e.target.closest(`.${t}`),RC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),eh=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},TC=e=>{const t=e.ctrlKey&&Qu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function NF({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}){return u=>{if(Wo(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&i){const b=Dn(u),g=TC(u),m=f*Math.pow(2,g);r.scaleTo(n,m,b,u);return}const h=u.deltaMode===1?20:1;let p=s===no.Vertical?0:u.deltaX*h,v=s===no.Horizontal?0:u.deltaY*h;!Qu()&&u.shiftKey&&s!==no.Vertical&&(p=u.deltaY*h,v=0),r.translateBy(n,-(p/f)*o,-(v/f)*o,{internal:!0});const x=Ud(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(u,x)),e.isPanScrolling&&(a==null||a(u,x),e.panScrollTimeout=setTimeout(()=>{c==null||c(u,x),e.isPanScrolling=!1},150))}}function RF({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){if(!t&&r.type==="wheel"&&!r.ctrlKey||Wo(r,e))return null;r.preventDefault(),n.call(this,r,s)}}function TF({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Ud(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function PF({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&RC(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((l=o.sourceEvent)!=null&&l.internal)&&(s==null||s(o.sourceEvent,Ud(o.transform)))}}function IF({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&RC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&CF(e.prevViewport,i.transform))){const a=Ud(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,a)},n?150:0)}}}function jF({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:a,lib:c}){return u=>{var v;const f=e||t,h=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Wo(u,`${c}-flow__node`)||Wo(u,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||Wo(u,l)&&u.type==="wheel"||Wo(u,a)&&(u.type!=="wheel"||s&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&((v=u.touches)==null?void 0:v.length)>1)return u.preventDefault(),!1;if(!f&&!s&&!h&&u.type==="wheel"||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const p=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&p}}function OF({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:o,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:a,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),h=tC().clickDistance(!Ln(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),p=ln(e).call(h);y({x:o.x,y:o.y,zoom:Ai(o.zoom,t,n)},[[0,0],[f.width,f.height]],s);const v=p.on("wheel.zoom"),x=p.on("dblclick.zoom");h.wheelDelta(TC);function b($,A){return p?new Promise(R=>{h==null||h.transform(eh(p,A==null?void 0:A.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function g({noWheelClassName:$,noPanClassName:A,onPaneContextMenu:R,userSelectionActive:j,panOnScroll:O,panOnDrag:F,panOnScrollMode:T,panOnScrollSpeed:M,preventScrolling:_,zoomOnPinch:U,zoomOnScroll:L,zoomOnDoubleClick:K,zoomActivationKeyPressed:W,lib:q,onTransformChange:H}){j&&!u.isZoomingOrPanning&&m();const B=O&&!W&&!j?NF({zoomPanValues:u,noWheelClassName:$,d3Selection:p,d3Zoom:h,panOnScrollMode:T,panOnScrollSpeed:M,zoomOnPinch:U,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:a}):RF({noWheelClassName:$,preventScrolling:_,d3ZoomHandler:v});if(p.on("wheel.zoom",B,{passive:!1}),!j){const Q=TF({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:l});h.on("start",Q);const Z=PF({zoomPanValues:u,panOnDrag:F,onPaneContextMenu:!!R,onPanZoom:i,onTransformChange:H});h.on("zoom",Z);const V=IF({zoomPanValues:u,panOnDrag:F,panOnScroll:O,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:c});h.on("end",V)}const Y=jF({zoomActivationKeyPressed:W,panOnDrag:F,zoomOnScroll:L,panOnScroll:O,zoomOnDoubleClick:K,zoomOnPinch:U,userSelectionActive:j,noPanClassName:A,noWheelClassName:$,lib:q});h.filter(Y),K?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function m(){h.on("zoom",null)}async function y($,A,R){const j=Jf($),O=h==null?void 0:h.constrain()(j,A,R);return O&&await b(O),new Promise(F=>F(O))}async function w($,A){const R=Jf($);return await b(R,A),new Promise(j=>j(R))}function k($){if(p){const A=Jf($),R=p.property("__zoom");(R.k!==$.zoom||R.x!==$.x||R.y!==$.y)&&(h==null||h.transform(p,A,null,{sync:!0}))}}function N(){const $=p?eC(p.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function E($,A){return p?new Promise(R=>{h==null||h.scaleTo(eh(p,A==null?void 0:A.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function C($,A){return p?new Promise(R=>{h==null||h.scaleBy(eh(p,A==null?void 0:A.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function P($){h==null||h.scaleExtent($)}function I($){h==null||h.translateExtent($)}function z($){const A=!Ln($)||$<0?0:$;h==null||h.clickDistance(A)}return{update:g,destroy:m,setViewport:w,setViewportConstrained:y,getViewport:N,scaleTo:E,scaleBy:C,setScaleExtent:P,setTranslateExtent:I,syncViewport:k,setClickDistance:z}}var jl;(function(e){e.Line="line",e.Handle="handle"})(jl||(jl={}));function _F({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,a=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(a[0]=a[0]*-1),l&&o&&(a[1]=a[1]*-1),a}function MF(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function Wr(e,t){return Math.max(0,t-e)}function Ur(e,t){return Math.max(0,e-t)}function Cc(e,t,n){return Math.max(0,t-e,e-n)}function Dv(e,t){return e?!t:t}function AF(e,t,n,r,s,o,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:u,isVertical:f}=t,h=u&&f,{xSnapped:p,ySnapped:v}=n,{minWidth:x,maxWidth:b,minHeight:g,maxHeight:m}=r,{x:y,y:w,width:k,height:N,aspectRatio:E}=e;let C=Math.floor(u?p-e.pointerX:0),P=Math.floor(f?v-e.pointerY:0);const I=k+(a?-C:C),z=N+(c?-P:P),$=-o[0]*k,A=-o[1]*N;let R=Cc(I,x,b),j=Cc(z,g,m);if(i){let T=0,M=0;a&&C<0?T=Wr(y+C+$,i[0][0]):!a&&C>0&&(T=Ur(y+I+$,i[1][0])),c&&P<0?M=Wr(w+P+A,i[0][1]):!c&&P>0&&(M=Ur(w+z+A,i[1][1])),R=Math.max(R,T),j=Math.max(j,M)}if(l){let T=0,M=0;a&&C>0?T=Ur(y+C,l[0][0]):!a&&C<0&&(T=Wr(y+I,l[1][0])),c&&P>0?M=Ur(w+P,l[0][1]):!c&&P<0&&(M=Wr(w+z,l[1][1])),R=Math.max(R,T),j=Math.max(j,M)}if(s){if(u){const T=Cc(I/E,g,m)*E;if(R=Math.max(R,T),i){let M=0;!a&&!c||a&&!c&&h?M=Ur(w+A+I/E,i[1][1])*E:M=Wr(w+A+(a?C:-C)/E,i[0][1])*E,R=Math.max(R,M)}if(l){let M=0;!a&&!c||a&&!c&&h?M=Wr(w+I/E,l[1][1])*E:M=Ur(w+(a?C:-C)/E,l[0][1])*E,R=Math.max(R,M)}}if(f){const T=Cc(z*E,x,b)/E;if(j=Math.max(j,T),i){let M=0;!a&&!c||c&&!a&&h?M=Ur(y+z*E+$,i[1][0])/E:M=Wr(y+(c?P:-P)*E+$,i[0][0])/E,j=Math.max(j,M)}if(l){let M=0;!a&&!c||c&&!a&&h?M=Wr(y+z*E,l[1][0])/E:M=Ur(y+(c?P:-P)*E,l[0][0])/E,j=Math.max(j,M)}}}P=P+(P<0?j:-j),C=C+(C<0?R:-R),s&&(h?I>z*E?P=(Dv(a,c)?-C:C)/E:C=(Dv(a,c)?-P:P)*E:u?(P=C/E,c=a):(C=P*E,a=c));const O=a?y+C:y,F=c?w+P:w;return{width:k+(a?-C:C),height:N+(c?-P:P),x:o[0]*C*(a?-1:1)+O,y:o[1]*P*(c?-1:1)+F}}const PC={width:0,height:0,x:0,y:0},zF={...PC,pointerX:0,pointerY:0,aspectRatio:1};function DF(e){return[[0,0],[e.measured.width,e.measured.height]]}function $F(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,l=n[0]*o,a=n[1]*i;return[[r-l,s-a],[r+o-l,s+i-a]]}function FF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=ln(e);function i({controlPosition:a,boundaries:c,keepAspectRatio:u,onResizeStart:f,onResize:h,onResizeEnd:p,shouldResize:v}){let x={...PC},b={...zF};const g=MF(a);let m,y=null,w=[],k,N,E;const C=LE().on("start",P=>{const{nodeLookup:I,transform:z,snapGrid:$,snapToGrid:A,nodeOrigin:R,paneDomNode:j}=n();if(m=I.get(t),!m)return;y=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:F}=Il(P.sourceEvent,{transform:z,snapGrid:$,snapToGrid:A,containerBounds:y});x={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},b={...x,pointerX:O,pointerY:F,aspectRatio:x.width/x.height},k=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(k=I.get(m.parentId),N=k&&m.extent==="parent"?DF(k):void 0),w=[],E=void 0;for(const[T,M]of I)if(M.parentId===t&&(w.push({id:T,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const _=$F(M,m,M.origin??R);E?E=[[Math.min(_[0][0],E[0][0]),Math.min(_[0][1],E[0][1])],[Math.max(_[1][0],E[1][0]),Math.max(_[1][1],E[1][1])]]:E=_}f==null||f(P,{...x})}).on("drag",P=>{const{transform:I,snapGrid:z,snapToGrid:$,nodeOrigin:A}=n(),R=Il(P.sourceEvent,{transform:I,snapGrid:z,snapToGrid:$,containerBounds:y}),j=[];if(!m)return;const{x:O,y:F,width:T,height:M}=x,_={},U=m.origin??A,{width:L,height:K,x:W,y:q}=AF(b,g,R,c,u,U,N,E),H=L!==T,G=K!==M,B=W!==O&&H,Y=q!==F&&G;if(!B&&!Y&&!H&&!G)return;if((B||Y||U[0]===1||U[1]===1)&&(_.x=B?W:x.x,_.y=Y?q:x.y,x.x=_.x,x.y=_.y,w.length>0)){const X=W-O,ee=q-F;for(const he of w)he.position={x:he.position.x-X+U[0]*(L-T),y:he.position.y-ee+U[1]*(K-M)},j.push(he)}if((H||G)&&(_.width=H?L:x.width,_.height=G?K:x.height,x.width=_.width,x.height=_.height),k&&m.expandParent){const X=U[0]*(_.width??0);_.x&&_.x<X&&(x.x=X,b.x=b.x-(_.x-X));const ee=U[1]*(_.height??0);_.y&&_.y<ee&&(x.y=ee,b.y=b.y-(_.y-ee))}const Q=_F({width:x.width,prevWidth:T,height:x.height,prevHeight:M,affectsX:g.affectsX,affectsY:g.affectsY}),Z={...x,direction:Q};(v==null?void 0:v(P,Z))!==!1&&(h==null||h(P,Z),r(_,j))}).on("end",P=>{p==null||p(P,{...x}),s==null||s()});o.call(C)}function l(){o.on(".drag",null)}return{update:i,destroy:l}}const LF={},$v=e=>{let t;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(v=>v(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(LF?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,a);return a},HF=e=>e?$v(e):$v,{useDebugValue:BF}=Lw,{useSyncExternalStoreWithSelector:VF}=oM,WF=e=>e;function IC(e,t=WF,n){const r=VF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return BF(r),r}const Fv=(e,t)=>{const n=HF(e),r=(s,o=t)=>IC(n,s,o);return Object.assign(r,n),r},UF=(e,t)=>e?Fv(e,t):Fv;function it(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const qd=S.createContext(null),qF=qd.Provider,jC=Fr.error001();function _e(e,t){const n=S.useContext(qd);if(n===null)throw new Error(jC);return IC(n,e,t)}function Ye(){const e=S.useContext(qd);if(e===null)throw new Error(jC);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Lv={display:"none"},KF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},OC="react-flow__node-desc",_C="react-flow__edge-desc",YF="react-flow__aria-live",GF=e=>e.ariaLiveMessage;function QF({rfId:e}){const t=_e(GF);return d.jsx("div",{id:`${YF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:KF,children:t})}function XF({rfId:e,disableKeyboardA11y:t}){return d.jsxs(d.Fragment,{children:[d.jsxs("div",{id:`${OC}-${e}`,style:Lv,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),d.jsx("div",{id:`${_C}-${e}`,style:Lv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&d.jsx(QF,{rfId:e})]})}const ZF=e=>e.userSelectionActive?"none":"all",b0=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=_e(ZF),l=`${e}`.split("-");return d.jsx("div",{className:dt(["react-flow__panel",n,...l]),style:{...r,pointerEvents:i},ref:o,...s,children:t})});function JF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(b0,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:d.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const e3=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Nc=e=>e.id;function t3(e,t){return it(e.selectedNodes.map(Nc),t.selectedNodes.map(Nc))&&it(e.selectedEdges.map(Nc),t.selectedEdges.map(Nc))}function n3({onSelectionChange:e}){const t=Ye(),{selectedNodes:n,selectedEdges:r}=_e(e3,t3);return S.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const r3=e=>!!e.onSelectionChangeHandlers;function s3({onSelectionChange:e}){const t=_e(r3);return e||t?d.jsx(n3,{onSelectionChange:e}):null}const MC=[0,0],o3={x:0,y:0,zoom:1},i3=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],Hv=[...i3,"rfId"],l3=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),Bv={translateExtent:ia,nodeOrigin:MC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function a3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:c}=_e(l3,it),u=Ye();S.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{f.current=Bv,l()}),[]);const f=S.useRef(Bv);return S.useEffect(()=>{for(const h of Hv){const p=e[h],v=f.current[h];p!==v&&(typeof e[h]>"u"||(h==="nodes"?t(p):h==="edges"?n(p):h==="minZoom"?r(p):h==="maxZoom"?s(p):h==="translateExtent"?o(p):h==="nodeExtent"?i(p):h==="paneClickDistance"?c(p):h==="fitView"?u.setState({fitViewOnInit:p}):h==="fitViewOptions"?u.setState({fitViewOnInitOptions:p}):u.setState({[h]:p})))}f.current=e},Hv.map(h=>e[h])),null}function Vv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function c3(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const s=Vv(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=Vv())!=null&&r.matches?"dark":"light"}const Wv=typeof document<"u"?document:null;function ua(e=null,t={target:Wv,actInsideInputWithModifier:!0}){const[n,r]=S.useState(!1),s=S.useRef(!1),o=S.useRef(new Set([])),[i,l]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),u=c.reduce((f,h)=>f.concat(...h),[]);return[c,u]}return[[],[]]},[e]);return S.useEffect(()=>{const a=(t==null?void 0:t.target)||Wv;if(e!==null){const c=h=>{if(s.current=h.ctrlKey||h.metaKey||h.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&Qp(h))return!1;const v=qv(h.code,l);o.current.add(h[v]),Uv(i,o.current,!1)&&(h.preventDefault(),r(!0))},u=h=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&Qp(h))return!1;const v=qv(h.code,l);Uv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[v]),h.key==="Meta"&&o.current.clear(),s.current=!1},f=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",u),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",u),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function Uv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function qv(e,t){return t.includes(e)?"code":"key"}const u3=()=>{const e=Ye();return S.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:s,panZoom:o,domNode:i}=e.getState();if(!o||!i)return Promise.resolve(!1);const l=Kp(n,t),{width:a,height:c}=Wd(i);return Yp({nodes:l,width:a,height:c,minZoom:r,maxZoom:s,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:s,height:o,maxZoom:i,panZoom:l}=e.getState(),a=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:i,c=s/2-t*a,u=o/2-n*a;return l?(await l.setViewport({x:c,y:u,zoom:a},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),a=g0(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:i,y:l}=o.getBoundingClientRect(),a={x:t.x-i,y:t.y-l};return Ma(a,r,n.snapToGrid,s)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=dC(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function AC(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const i=r.get(o.id);i?i.push(o):r.set(o.id,[o])}for(const o of t){const i=r.get(o.id);if(!i){n.push(o);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...o};for(const a of i)d3(a,l);n.push(l)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function d3(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function f3(e,t){return AC(e,t)}function h3(e,t){return AC(e,t)}function zs(e,t){return{id:e,type:"select",selected:t}}function Uo(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const i=t.has(s);!(o.selected===void 0&&!i)&&o.selected!==i&&(n&&(o.selected=i),r.push(zs(o.id,i)))}return r}function Kv({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,i]of e.entries()){const l=t.get(i.id),a=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Yv(e){return{id:e.id,type:"remove"}}const Gv=e=>G$(e),p3=e=>oC(e);function zC(e){return S.forwardRef(e)}const m3=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Qv(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>g3(()=>n(s=>s+BigInt(1))));return m3(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function g3(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const DC=S.createContext(null);function x3({children:e}){const t=Ye(),n=S.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:u,onNodesChange:f,nodeLookup:h}=t.getState();let p=a;for(const v of l)p=typeof v=="function"?v(p):v;u?c(p):f&&f(Kv({items:p,lookup:h}))},[]),r=Qv(n),s=S.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:h}=t.getState();let p=a;for(const v of l)p=typeof v=="function"?v(p):v;u?c(p):f&&f(Kv({items:p,lookup:h}))},[]),o=Qv(s),i=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return d.jsx(DC.Provider,{value:i,children:e})}function y3(){const e=S.useContext(DC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const v3=e=>!!e.panZoom;function S0(){const e=u3(),t=Ye(),n=y3(),r=_e(v3),s=S.useMemo(()=>{const o=f=>t.getState().nodeLookup.get(f),i=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},a=f=>{var g,m;const{nodeLookup:h,nodeOrigin:p}=t.getState(),v=Gv(f)?f:h.get(f.id),x=v.parentId?hC(v.position,v.measured,v.parentId,h,p):v.position,b={...v,position:x,width:((g=v.measured)==null?void 0:g.width)??v.width,height:((m=v.measured)==null?void 0:m.height)??v.height};return zi(b)},c=(f,h,p={replace:!1})=>{i(v=>v.map(x=>{if(x.id===f){const b=typeof h=="function"?h(x):h;return p.replace&&Gv(b)?b:{...x,...b}}return x}))},u=(f,h,p={replace:!1})=>{l(v=>v.map(x=>{if(x.id===f){const b=typeof h=="function"?h(x):h;return p.replace&&p3(b)?b:{...x,...b}}return x}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=o(f))==null?void 0:h.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:i,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[v,x,b]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:v,y:x,zoom:b}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:v,onNodesDelete:x,onEdgesDelete:b,triggerNodeChanges:g,triggerEdgeChanges:m,onDelete:y,onBeforeDelete:w}=t.getState(),{nodes:k,edges:N}=await Z$({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:v,onBeforeDelete:w}),E=N.length>0,C=k.length>0;if(E){const P=N.map(Yv);b==null||b(N),m(P)}if(C){const P=k.map(Yv);x==null||x(k),g(P)}return(C||E)&&(y==null||y({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const v=Tv(f),x=v?f:a(f),b=p!==void 0;return x?(p||t.getState().nodes).filter(g=>{const m=t.getState().nodeLookup.get(g.id);if(m&&!v&&(g.id===f.id||!m.internals.positionAbsolute))return!1;const y=zi(b?g:m),w=aa(y,x);return h&&w>0||w>=x.width*x.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const x=Tv(f)?f:a(f);if(!x)return!1;const b=aa(x,h);return p&&b>0||b>=x.width*x.height},updateNode:c,updateNodeData:(f,h,p={replace:!1})=>{c(f,v=>{const x=typeof h=="function"?h(v):h;return p.replace?{...v,data:x}:{...v,data:{...v.data,...x}}},p)},updateEdge:u,updateEdgeData:(f,h,p={replace:!1})=>{u(f,v=>{const x=typeof h=="function"?h(v):h;return p.replace?{...v,data:x}:{...v,data:{...v.data,...x}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Q$(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${p}-${f}-${h??null}`))==null?void 0:v.values())??[])}}},[]);return S.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Xv=e=>e.selected,w3={actInsideInputWithModifier:!1},b3=typeof window<"u"?window:void 0;function S3({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ye(),{deleteElements:r}=S0(),s=ua(e,w3),o=ua(t,{target:b3});S.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(Xv),edges:i.filter(Xv)}),n.setState({nodesSelectionActive:!1})}},[s]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function k3(e){const t=Ye();S.useEffect(()=>{const n=()=>{var s,o;if(!e.current)return!1;const r=Wd(e.current);(r.height===0||r.width===0)&&((o=(s=t.getState()).onError)==null||o.call(s,"004",Fr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Kd={position:"absolute",width:"100%",height:"100%",top:0,left:0},E3=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function C3({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=no.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:c,minZoom:u,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:v,noWheelClassName:x,noPanClassName:b,onViewportChange:g,isControlledViewport:m,paneClickDistance:y}){const w=Ye(),k=S.useRef(null),{userSelectionActive:N,lib:E}=_e(E3,it),C=ua(h),P=S.useRef();k3(k);const I=S.useCallback(z=>{g==null||g({x:z[0],y:z[1],zoom:z[2]}),m||w.setState({transform:z})},[g,m]);return S.useEffect(()=>{if(k.current){P.current=OF({domNode:k.current,minZoom:u,maxZoom:f,translateExtent:c,viewport:a,paneClickDistance:y,onDraggingChange:R=>w.setState({paneDragging:R}),onPanZoomStart:(R,j)=>{const{onViewportChangeStart:O,onMoveStart:F}=w.getState();F==null||F(R,j),O==null||O(j)},onPanZoom:(R,j)=>{const{onViewportChange:O,onMove:F}=w.getState();F==null||F(R,j),O==null||O(j)},onPanZoomEnd:(R,j)=>{const{onViewportChangeEnd:O,onMoveEnd:F}=w.getState();F==null||F(R,j),O==null||O(j)}});const{x:z,y:$,zoom:A}=P.current.getViewport();return w.setState({panZoom:P.current,transform:[z,$,A],domNode:k.current.closest(".react-flow")}),()=>{var R;(R=P.current)==null||R.destroy()}}},[]),S.useEffect(()=>{var z;(z=P.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:C,preventScrolling:p,noPanClassName:b,userSelectionActive:N,noWheelClassName:x,lib:E,onTransformChange:I})},[e,t,n,r,s,o,i,l,C,p,b,N,x,E,I]),d.jsx("div",{className:"react-flow__renderer",ref:k,style:Kd,children:v})}const N3=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function R3(){const{userSelectionActive:e,userSelectionRect:t}=_e(N3,it);return e&&t?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const th=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},T3=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function P3({isSelecting:e,selectionKeyPressed:t,selectionMode:n=la.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:a,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:f,onPaneMouseLeave:h,children:p}){const v=S.useRef(null),x=Ye(),b=S.useRef(0),g=S.useRef(0),m=S.useRef(),y=S.useRef(new Map),{userSelectionActive:w,elementsSelectable:k,dragging:N}=_e(T3,it),E=k&&(e||w),C=S.useRef(!1),P=S.useRef(!1),I=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,g.current=0},z=T=>{if(C.current){C.current=!1;return}l==null||l(T),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},$=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}a==null||a(T)},A=c?T=>c(T):void 0,R=T=>{var W,q,H,G;const{resetSelectedElements:M,domNode:_,edgeLookup:U}=x.getState();if(m.current=_==null?void 0:_.getBoundingClientRect(),!k||!e||T.button!==0||T.target!==v.current||!m.current)return;(q=(W=T.target)==null?void 0:W.setPointerCapture)==null||q.call(W,T.pointerId),P.current=!0,C.current=!1,y.current=new Map;for(const[B,Y]of U)y.current.set(Y.source,((H=y.current.get(Y.source))==null?void 0:H.add(B))||new Set([B])),y.current.set(Y.target,((G=y.current.get(Y.target))==null?void 0:G.add(B))||new Set([B]));const{x:L,y:K}=Tr(T.nativeEvent,m.current);M(),x.setState({userSelectionRect:{width:0,height:0,startX:L,startY:K,x:L,y:K}}),o==null||o(T)},j=T=>{const{userSelectionRect:M,edgeLookup:_,transform:U,nodeLookup:L,triggerNodeChanges:K,triggerEdgeChanges:W}=x.getState();if(!m.current||!M)return;C.current=!0;const{x:q,y:H}=Tr(T.nativeEvent,m.current),{startX:G,startY:B}=M,Y={startX:G,startY:B,x:q<G?q:G,y:H<B?H:B,width:Math.abs(q-G),height:Math.abs(H-B)},Q=iC(L,Y,U,n===la.Partial,!0),Z=new Set,V=new Set;for(const X of Q){V.add(X.id);const ee=y.current.get(X.id);if(ee)for(const he of ee)Z.add(he)}if(b.current!==V.size){b.current=V.size;const X=Uo(L,V,!0);K(X)}if(g.current!==Z.size){g.current=Z.size;const X=Uo(_,Z);W(X)}x.setState({userSelectionRect:Y,userSelectionActive:!0,nodesSelectionActive:!1})},O=T=>{var _,U;if(T.button!==0||!P.current)return;(U=(_=T.target)==null?void 0:_.releasePointerCapture)==null||U.call(_,T.pointerId);const{userSelectionRect:M}=x.getState();!w&&M&&T.target===v.current&&(z==null||z(T)),b.current>0&&x.setState({nodesSelectionActive:!0}),I(),i==null||i(T),(t||s)&&(C.current=!1),P.current=!1},F=r===!0||Array.isArray(r)&&r.includes(0);return d.jsxs("div",{className:dt(["react-flow__pane",{draggable:F,dragging:N,selection:e}]),onClick:E?void 0:th(z,v),onContextMenu:th($,v),onWheel:th(A,v),onPointerEnter:E?void 0:u,onPointerDown:E?R:f,onPointerMove:E?j:f,onPointerUp:E?O:void 0,onPointerLeave:h,ref:v,style:Kd,children:[p,d.jsx(R3,{})]})}function tm({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:l,onError:a}=t.getState(),c=l.get(e);if(!c){a==null||a("012",Fr.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):s([e])}function $C({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=Ye(),[a,c]=S.useState(!1),u=S.useRef();return S.useEffect(()=>{u.current=yF({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{tm({id:f,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),S.useEffect(()=>{var f,h;if(t)(f=u.current)==null||f.destroy();else if(e.current)return(h=u.current)==null||h.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i}),()=>{var p;(p=u.current)==null||p.destroy()}},[n,r,t,o,e,s]),a}const I3=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function FC(){const e=Ye();return S.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:a,nodeLookup:c,nodeOrigin:u}=e.getState(),f=new Map,h=I3(i),p=s?o[0]:5,v=s?o[1]:5,x=n.direction.x*p*n.factor,b=n.direction.y*v*n.factor;for(const[,g]of c){if(!h(g))continue;let m={x:g.internals.positionAbsolute.x+x,y:g.internals.positionAbsolute.y+b};s&&(m=Vd(m,o));const{position:y,positionAbsolute:w}=lC({nodeId:g.id,nextPosition:m,nodeLookup:c,nodeExtent:r,nodeOrigin:u,onError:l});g.position=y,g.internals.positionAbsolute=w,f.set(g.id,g)}a(f)},[])}const k0=S.createContext(null),j3=k0.Provider;k0.Consumer;const LC=()=>S.useContext(k0),O3=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),_3=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:a,isValid:c}=i,u=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:u,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===Mi.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,valid:u&&c}};function M3({type:e="source",position:t=de.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:u,onTouchStart:f,...h},p){var R,j;const v=i||null,x=e==="target",b=Ye(),g=LC(),{connectOnClick:m,noPanClassName:y,rfId:w}=_e(O3,it),{connectingFrom:k,connectingTo:N,clickConnecting:E,isPossibleEndHandle:C,connectionInProcess:P,valid:I}=_e(_3(g,v,e),it);g||(j=(R=b.getState()).onError)==null||j.call(R,"010",Fr.error010());const z=O=>{const{defaultEdgeOptions:F,onConnect:T,hasDefaultEdges:M}=b.getState(),_={...F,...O};if(M){const{edges:U,setEdges:L}=b.getState();L(oF(_,U))}T==null||T(_),l==null||l(_)},$=O=>{if(!g)return;const F=mC(O.nativeEvent);if(s&&(F&&O.button===0||!F)){const T=b.getState();em.onPointerDown(O.nativeEvent,{autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:x,handleId:v,nodeId:g,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:T.onConnectEnd,updateConnection:T.updateConnection,onConnect:z,isValidConnection:n||T.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed})}F?u==null||u(O):f==null||f(O)},A=O=>{const{onClickConnectStart:F,onClickConnectEnd:T,connectionClickStartHandle:M,connectionMode:_,isValidConnection:U,lib:L,rfId:K,nodeLookup:W,connection:q}=b.getState();if(!g||!M&&!s)return;if(!M){F==null||F(O.nativeEvent,{nodeId:g,handleId:v,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:g,type:e,id:v}});return}const H=pC(O.target),G=n||U,{connection:B,isValid:Y}=em.isValid(O.nativeEvent,{handle:{nodeId:g,id:v,type:e},connectionMode:_,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:G,flowId:K,doc:H,lib:L,nodeLookup:W});Y&&B&&z(B);const Q=structuredClone(q);delete Q.inProgress,Q.toPosition=Q.toHandle?Q.toHandle.position:null,T==null||T(O,Q),b.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":v,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${v}-${e}`,className:dt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,c,{source:!x,target:x,connectable:r,connectablestart:s,connectableend:o,clickconnecting:E,connectingfrom:k,connectingto:N,valid:I,connectionindicator:r&&(!P||C)&&(P?o:s)}]),onMouseDown:$,onTouchStart:$,onClick:m?A:void 0,ref:p,...h,children:a})}const ar=S.memo(zC(M3));function A3({data:e,isConnectable:t,sourcePosition:n=de.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(ar,{type:"source",position:n,isConnectable:t})]})}function z3({data:e,isConnectable:t,targetPosition:n=de.Top,sourcePosition:r=de.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(ar,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,d.jsx(ar,{type:"source",position:r,isConnectable:t})]})}function D3(){return null}function $3({data:e,isConnectable:t,targetPosition:n=de.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(ar,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Xu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Zv={input:A3,default:z3,output:$3,group:D3};function F3(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const L3=e=>{const{width:t,height:n,x:r,y:s}=_a(e.nodeLookup,{filter:o=>!!o.selected});return{width:Ln(t)?t:null,height:Ln(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function H3({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ye(),{width:s,height:o,transformString:i,userSelectionActive:l}=_e(L3,it),a=FC(),c=S.useRef(null);if(S.useEffect(()=>{var h;n||(h=c.current)==null||h.focus({preventScroll:!0})},[n]),$C({nodeRef:c}),l||!s||!o)return null;const u=e?h=>{const p=r.getState().nodes.filter(v=>v.selected);e(h,p)}:void 0,f=h=>{Object.prototype.hasOwnProperty.call(Xu,h.key)&&(h.preventDefault(),a({direction:Xu[h.key],factor:h.shiftKey?4:1}))};return d.jsx("div",{className:dt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:d.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:s,height:o}})})}const Jv=typeof window<"u"?window:void 0,B3=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function HC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:u,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:v,panActivationKeyCode:x,zoomActivationKeyCode:b,elementsSelectable:g,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:E,panOnDrag:C,defaultViewport:P,translateExtent:I,minZoom:z,maxZoom:$,preventScrolling:A,onSelectionContextMenu:R,noWheelClassName:j,noPanClassName:O,disableKeyboardA11y:F,onViewportChange:T,isControlledViewport:M}){const{nodesSelectionActive:_,userSelectionActive:U}=_e(B3),L=ua(c,{target:Jv}),K=ua(x,{target:Jv}),W=K||C,q=K||w,H=u&&W!==!0,G=L||U||H;return S3({deleteKeyCode:a,multiSelectionKeyCode:v}),d.jsx(C3,{onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:q,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:E,panOnDrag:!L&&W,defaultViewport:P,translateExtent:I,minZoom:z,maxZoom:$,zoomActivationKeyCode:b,preventScrolling:A,noWheelClassName:j,noPanClassName:O,onViewportChange:T,isControlledViewport:M,paneClickDistance:l,children:d.jsxs(P3,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:W,isSelecting:!!G,selectionMode:f,selectionKeyPressed:L,selectionOnDrag:H,children:[e,_&&d.jsx(H3,{onSelectionContextMenu:R,noPanClassName:O,disableKeyboardA11y:F})]})})}HC.displayName="FlowRenderer";const V3=S.memo(HC),W3=e=>t=>e?iC(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function U3(e){return _e(S.useCallback(W3(e),[e]),it)}const q3=e=>e.updateNodeInternals;function K3(){const e=_e(q3),[t]=S.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return S.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Y3({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Ye(),o=S.useRef(null),i=S.useRef(null),l=S.useRef(e.sourcePosition),a=S.useRef(e.targetPosition),c=S.useRef(t),u=n&&!!e.internals.handleBounds;return S.useEffect(()=>{o.current&&!e.hidden&&(!u||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[u,e.hidden]),S.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),S.useEffect(()=>{if(o.current){const f=c.current!==t,h=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(f||h||p)&&(c.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function G3({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:u,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:v,rfId:x,nodeTypes:b,nodeExtent:g,nodeClickDistance:m,onError:y}){const{node:w,internals:k,isParent:N}=_e(B=>{const Y=B.nodeLookup.get(e),Q=B.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:Q}},it);let E=w.type||"default",C=(b==null?void 0:b[E])||Zv[E];C===void 0&&(y==null||y("003",Fr.error003(E)),E="default",C=Zv.default);const P=!!(w.draggable||l&&typeof w.draggable>"u"),I=!!(w.selectable||a&&typeof w.selectable>"u"),z=!!(w.connectable||c&&typeof w.connectable>"u"),$=!!(w.focusable||u&&typeof w.focusable>"u"),A=Ye(),R=fC(w),j=Y3({node:w,nodeType:E,hasDimensions:R,resizeObserver:f}),O=$C({nodeRef:j,disabled:w.hidden||!P,noDragClassName:h,handleSelector:w.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:m}),F=FC();if(w.hidden)return null;const T=Lr(w),M=F3(w),_=I||P||t||n||r||s,U=n?B=>n(B,{...k.userNode}):void 0,L=r?B=>r(B,{...k.userNode}):void 0,K=s?B=>s(B,{...k.userNode}):void 0,W=o?B=>o(B,{...k.userNode}):void 0,q=i?B=>i(B,{...k.userNode}):void 0,H=B=>{const{selectNodesOnDrag:Y,nodeDragThreshold:Q}=A.getState();I&&(!Y||!P||Q>0)&&tm({id:e,store:A,nodeRef:j}),t&&t(B,{...k.userNode})},G=B=>{if(!(Qp(B.nativeEvent)||v))if(nC.includes(B.key)&&I){const Y=B.key==="Escape";tm({id:e,store:A,unselect:Y,nodeRef:j})}else P&&w.selected&&Object.prototype.hasOwnProperty.call(Xu,B.key)&&(B.preventDefault(),A.setState({ariaLiveMessage:`Moved selected node ${B.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.positionAbsolute.x}, y: ${~~k.positionAbsolute.y}`}),F({direction:Xu[B.key],factor:B.shiftKey?4:1}))};return d.jsx("div",{className:dt(["react-flow__node",`react-flow__node-${E}`,{[p]:P},w.className,{selected:w.selected,selectable:I,parent:N,draggable:P,dragging:O}]),ref:j,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:_?"all":"none",visibility:R?"visible":"hidden",...w.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:L,onMouseLeave:K,onContextMenu:W,onClick:H,onDoubleClick:q,onKeyDown:$?G:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":v?void 0:`${OC}-${x}`,"aria-label":w.ariaLabel,children:d.jsx(j3,{value:e,children:d.jsx(C,{id:e,data:w.data,type:E,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:w.selected,selectable:I,draggable:P,deletable:w.deletable??!0,isConnectable:z,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:O,dragHandle:w.dragHandle,zIndex:k.z,parentId:w.parentId,...T})})})}const Q3=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function BC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=_e(Q3,it),i=U3(e.onlyRenderVisibleElements),l=K3();return d.jsx("div",{className:"react-flow__nodes",style:Kd,children:i.map(a=>d.jsx(G3,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},a))})}BC.displayName="NodeRenderer";const X3=S.memo(BC);function Z3(e){return _e(S.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),i=n.nodeLookup.get(s.target);o&&i&&nF({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),it)}const J3=({color:e="none",strokeWidth:t=1})=>d.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),eL=({color:e="none",strokeWidth:t=1})=>d.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),ew={[Yu.Arrow]:J3,[Yu.ArrowClosed]:eL};function tL(e){const t=Ye();return S.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(ew,e)?ew[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Fr.error009(e)),null)},[e])}const nL=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const a=tL(t);return a?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:d.jsx(a,{color:n,strokeWidth:i})}):null},VC=({defaultColor:e,rfId:t})=>{const n=_e(o=>o.edges),r=_e(o=>o.defaultEdgeOptions),s=S.useMemo(()=>uF(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?d.jsx("svg",{className:"react-flow__marker",children:d.jsx("defs",{children:s.map(o=>d.jsx(nL,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};VC.displayName="MarkerDefinitions";var rL=S.memo(VC);function WC({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:o={},labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:a,className:c,...u}){const[f,h]=S.useState({x:1,y:0,width:0,height:0}),p=dt(["react-flow__edge-textwrapper",c]),v=S.useRef(null);return S.useEffect(()=>{if(v.current){const x=v.current.getBBox();h({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),typeof n>"u"||!n?null:d.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...u,children:[s&&d.jsx("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),d.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:v,style:r,children:n}),a]})}WC.displayName="EdgeText";const sL=S.memo(WC);function Yd({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:c=20,...u}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...u,d:e,fill:"none",className:dt(["react-flow__edge-path",u.className])}),c&&d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}),r&&Ln(t)&&Ln(n)?d.jsx(sL,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function tw({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===de.Left||e===de.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function UC({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top}){const[i,l]=tw({pos:n,x1:e,y1:t,x2:r,y2:s}),[a,c]=tw({pos:o,x1:r,y1:s,x2:e,y2:t}),[u,f,h,p]=gC({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:a,targetControlY:c});return[`M${e},${t} C${i},${l} ${a},${c} ${r},${s}`,u,f,h,p]}function qC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=de.Bottom,targetPosition:l=de.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:v,markerEnd:x,markerStart:b,interactionWidth:g})=>{const[m,y,w]=UC({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),k=e.isInternal?void 0:t;return d.jsx(Yd,{id:k,path:m,labelX:y,labelY:w,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:v,markerEnd:x,markerStart:b,interactionWidth:g})})}const oL=qC({isInternal:!1}),KC=qC({isInternal:!0});oL.displayName="SimpleBezierEdge";KC.displayName="SimpleBezierEdgeInternal";function YC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:h,sourcePosition:p=de.Bottom,targetPosition:v=de.Top,markerEnd:x,markerStart:b,pathOptions:g,interactionWidth:m})=>{const[y,w,k]=Xp({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:o,targetPosition:v,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset}),N=e.isInternal?void 0:t;return d.jsx(Yd,{id:N,path:y,labelX:w,labelY:k,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:h,markerEnd:x,markerStart:b,interactionWidth:m})})}const GC=YC({isInternal:!1}),QC=YC({isInternal:!0});GC.displayName="SmoothStepEdge";QC.displayName="SmoothStepEdgeInternal";function XC(e){return S.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return d.jsx(GC,{...n,id:r,pathOptions:S.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const iL=XC({isInternal:!1}),ZC=XC({isInternal:!0});iL.displayName="StepEdge";ZC.displayName="StepEdgeInternal";function JC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:v,interactionWidth:x})=>{const[b,g,m]=vC({sourceX:n,sourceY:r,targetX:s,targetY:o}),y=e.isInternal?void 0:t;return d.jsx(Yd,{id:y,path:b,labelX:g,labelY:m,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:v,interactionWidth:x})})}const lL=JC({isInternal:!1}),eN=JC({isInternal:!0});lL.displayName="StraightEdge";eN.displayName="StraightEdgeInternal";function tN(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=de.Bottom,targetPosition:l=de.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:v,markerEnd:x,markerStart:b,pathOptions:g,interactionWidth:m})=>{const[y,w,k]=xC({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:g==null?void 0:g.curvature}),N=e.isInternal?void 0:t;return d.jsx(Yd,{id:N,path:y,labelX:w,labelY:k,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:v,markerEnd:x,markerStart:b,interactionWidth:m})})}const aL=tN({isInternal:!1}),nN=tN({isInternal:!0});aL.displayName="BezierEdge";nN.displayName="BezierEdgeInternal";const nw={default:nN,straight:eN,step:ZC,smoothstep:QC,simplebezier:KC},rw={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},cL=(e,t,n)=>n===de.Left?e-t:n===de.Right?e+t:e,uL=(e,t,n)=>n===de.Top?e-t:n===de.Bottom?e+t:e,sw="react-flow__edgeupdater";function ow({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return d.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:dt([sw,`${sw}-${l}`]),cx:cL(t,r,e),cy:uL(n,r,e),r,stroke:"transparent",fill:"transparent"})}function dL({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:u,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const v=Ye(),x=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:E,isValidConnection:C,connectionMode:P,connectionRadius:I,lib:z,onConnectStart:$,onConnectEnd:A,cancelConnection:R,nodeLookup:j,rfId:O,panBy:F,updateConnection:T}=v.getState(),M=k.type==="target";h(!0),u==null||u(w,n,k.type);const _=(L,K)=>{h(!1),f==null||f(L,n,k.type,K)},U=L=>c==null?void 0:c(n,L);em.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:P,connectionRadius:I,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:j,isTarget:M,edgeUpdaterType:k.type,lib:z,flowId:O,cancelConnection:R,panBy:F,isValidConnection:C,onConnect:U,onConnectStart:$,onConnectEnd:A,onReconnectEnd:_,updateConnection:T,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle})},b=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>p(!0),y=()=>p(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(ow,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:m,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&d.jsx(ow,{position:a,centerX:o,centerY:i,radius:t,onMouseDown:g,onMouseEnter:m,onMouseOut:y,type:"target"})]})}function fL({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:v,edgeTypes:x,noPanClassName:b,onError:g,disableKeyboardA11y:m}){let y=_e(V=>V.edgeLookup.get(e));const w=_e(V=>V.defaultEdgeOptions);y=w?{...w,...y}:y;let k=y.type||"default",N=(x==null?void 0:x[k])||nw[k];N===void 0&&(g==null||g("011",Fr.error011(k)),k="default",N=nw.default);const E=!!(y.focusable||t&&typeof y.focusable>"u"),C=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),P=!!(y.selectable||r&&typeof y.selectable>"u"),I=S.useRef(null),[z,$]=S.useState(!1),[A,R]=S.useState(!1),j=Ye(),{zIndex:O,sourceX:F,sourceY:T,targetX:M,targetY:_,sourcePosition:U,targetPosition:L}=_e(S.useCallback(V=>{const X=V.nodeLookup.get(y.source),ee=V.nodeLookup.get(y.target);if(!X||!ee)return{zIndex:y.zIndex,...rw};const he=cF({id:e,sourceNode:X,targetNode:ee,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:V.connectionMode,onError:g});return{zIndex:tF({selected:y.selected,zIndex:y.zIndex,sourceNode:X,targetNode:ee,elevateOnSelect:V.elevateEdgesOnSelect}),...he||rw}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),it),K=S.useMemo(()=>y.markerStart?`url('#${Zp(y.markerStart,v)}')`:void 0,[y.markerStart,v]),W=S.useMemo(()=>y.markerEnd?`url('#${Zp(y.markerEnd,v)}')`:void 0,[y.markerEnd,v]);if(y.hidden||F===null||T===null||M===null||_===null)return null;const q=V=>{var Pe;const{addSelectedEdges:X,unselectNodesAndEdges:ee,multiSelectionActive:he}=j.getState();P&&(j.setState({nodesSelectionActive:!1}),y.selected&&he?(ee({nodes:[],edges:[y]}),(Pe=I.current)==null||Pe.blur()):X([e])),s&&s(V,y)},H=o?V=>{o(V,{...y})}:void 0,G=i?V=>{i(V,{...y})}:void 0,B=l?V=>{l(V,{...y})}:void 0,Y=a?V=>{a(V,{...y})}:void 0,Q=c?V=>{c(V,{...y})}:void 0,Z=V=>{var X;if(!m&&nC.includes(V.key)&&P){const{unselectNodesAndEdges:ee,addSelectedEdges:he}=j.getState();V.key==="Escape"?((X=I.current)==null||X.blur(),ee({edges:[y]})):he([e])}};return d.jsx("svg",{style:{zIndex:O},children:d.jsxs("g",{className:dt(["react-flow__edge",`react-flow__edge-${k}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!P&&!s,updating:z,selectable:P}]),onClick:q,onDoubleClick:H,onContextMenu:G,onMouseEnter:B,onMouseMove:Y,onMouseLeave:Q,onKeyDown:E?Z:void 0,tabIndex:E?0:void 0,role:E?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":E?`${_C}-${v}`:void 0,ref:I,children:[!A&&d.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:P,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:F,sourceY:T,targetX:M,targetY:_,sourcePosition:U,targetPosition:L,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:W,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),C&&d.jsx(dL,{edge:y,isReconnectable:C,reconnectRadius:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:F,sourceY:T,targetX:M,targetY:_,sourcePosition:U,targetPosition:L,setUpdateHover:$,setReconnecting:R})]})})}const hL=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function rN({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:v,disableKeyboardA11y:x}){const{edgesFocusable:b,edgesReconnectable:g,elementsSelectable:m,onError:y}=_e(hL,it),w=Z3(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(rL,{defaultColor:e,rfId:n}),w.map(k=>d.jsx(fL,{id:k,edgesFocusable:b,edgesReconnectable:g,elementsSelectable:m,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:u,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:v,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:x},k))]})}rN.displayName="EdgeRenderer";const pL=S.memo(rN),mL=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function gL({children:e}){const t=_e(mL);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function xL(e){const t=S0(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const yL=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function vL(e){const t=_e(yL),n=Ye();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function wL(e){return e.connection.inProgress?{...e.connection,to:Ma(e.connection.to,e.transform)}:{...e.connection}}function bL(e){return wL}function SL(e){const t=bL();return _e(t,it)}const kL=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function EL({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:a}=_e(kL,it);return!(o&&s&&a)?null:d.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:dt(["react-flow__connection",sC(l)]),children:d.jsx(sN,{style:t,type:n,CustomComponent:r,isValid:l})})})}const sN=({style:e,type:t=Zr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:u,toHandle:f,toPosition:h}=SL();if(!s)return;if(n)return d.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:a,toPosition:h,connectionStatus:sC(r),toNode:u,toHandle:f});let p="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:h};switch(t){case Zr.Bezier:[p]=xC(v);break;case Zr.SimpleBezier:[p]=UC(v);break;case Zr.Step:[p]=Xp({...v,borderRadius:0});break;case Zr.SmoothStep:[p]=Xp(v);break;default:[p]=vC(v)}return d.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};sN.displayName="ConnectionLine";const CL={};function iw(e=CL){S.useRef(e),Ye(),S.useEffect(()=>{},[e])}function NL(){Ye(),S.useRef(!1),S.useEffect(()=>{},[])}function oN({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:v,connectionLineStyle:x,connectionLineComponent:b,connectionLineContainerStyle:g,selectionKeyCode:m,selectionOnDrag:y,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:E,deleteKeyCode:C,onlyRenderVisibleElements:P,elementsSelectable:I,defaultViewport:z,translateExtent:$,minZoom:A,maxZoom:R,preventScrolling:j,defaultMarkerColor:O,zoomOnScroll:F,zoomOnPinch:T,panOnScroll:M,panOnScrollSpeed:_,panOnScrollMode:U,zoomOnDoubleClick:L,panOnDrag:K,onPaneClick:W,onPaneMouseEnter:q,onPaneMouseMove:H,onPaneMouseLeave:G,onPaneScroll:B,onPaneContextMenu:Y,paneClickDistance:Q,nodeClickDistance:Z,onEdgeContextMenu:V,onEdgeMouseEnter:X,onEdgeMouseMove:ee,onEdgeMouseLeave:he,reconnectRadius:Pe,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:ue,noDragClassName:Re,noWheelClassName:ye,noPanClassName:ze,disableKeyboardA11y:Ie,nodeExtent:et,rfId:lt,viewport:re,onViewportChange:se}){return iw(e),iw(t),NL(),xL(n),vL(re),d.jsx(V3,{onPaneClick:W,onPaneMouseEnter:q,onPaneMouseMove:H,onPaneMouseLeave:G,onPaneContextMenu:Y,onPaneScroll:B,paneClickDistance:Q,deleteKeyCode:C,selectionKeyCode:m,selectionOnDrag:y,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:E,elementsSelectable:I,zoomOnScroll:F,zoomOnPinch:T,zoomOnDoubleClick:L,panOnScroll:M,panOnScrollSpeed:_,panOnScrollMode:U,panOnDrag:K,defaultViewport:z,translateExtent:$,minZoom:A,maxZoom:R,onSelectionContextMenu:f,preventScrolling:j,noDragClassName:Re,noWheelClassName:ye,noPanClassName:ze,disableKeyboardA11y:Ie,onViewportChange:se,isControlledViewport:!!re,children:d.jsxs(gL,{children:[d.jsx(pL,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:ue,onlyRenderVisibleElements:P,onEdgeContextMenu:V,onEdgeMouseEnter:X,onEdgeMouseMove:ee,onEdgeMouseLeave:he,reconnectRadius:Pe,defaultMarkerColor:O,noPanClassName:ze,disableKeyboardA11y:Ie,rfId:lt}),d.jsx(EL,{style:x,type:v,component:b,containerStyle:g}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(X3,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Z,onlyRenderVisibleElements:P,noPanClassName:ze,noDragClassName:Re,disableKeyboardA11y:Ie,nodeExtent:et,rfId:lt}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}oN.displayName="GraphView";const RL=S.memo(oN),lw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}={})=>{const c=new Map,u=new Map,f=new Map,h=new Map,p=r??t??[],v=n??e??[],x=l??[0,0],b=a??ia;bC(f,h,p),Jp(v,c,u,{nodeOrigin:x,nodeExtent:b,elevateNodesOnSelect:!1});let g=[0,0,1];if(i&&s&&o){const m=_a(c,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x:y,y:w,zoom:k}=g0(m,s,o,.5,2,.1);g=[y,w,k]}return{rfId:"1",width:0,height:0,transform:g,nodes:v,nodeLookup:c,parentLookup:u,edges:p,edgeLookup:h,connectionLookup:f,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:ia,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...rC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:J$,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},TL=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a})=>UF((c,u)=>({...lw({nodes:e,edges:t,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:f=>{const{nodeLookup:h,parentLookup:p,nodeOrigin:v,elevateNodesOnSelect:x}=u();Jp(f,h,p,{nodeOrigin:v,nodeExtent:a,elevateNodesOnSelect:x,checkEquality:!0}),c({nodes:f})},setEdges:f=>{const{connectionLookup:h,edgeLookup:p}=u();bC(h,p,f),c({edges:f})},setDefaultNodesAndEdges:(f,h)=>{if(f){const{setNodes:p}=u();p(f),c({hasDefaultNodes:!0})}if(h){const{setEdges:p}=u();p(h),c({hasDefaultEdges:!0})}},updateNodeInternals:(f,h={triggerFitView:!0})=>{const{triggerNodeChanges:p,nodeLookup:v,parentLookup:x,fitViewOnInit:b,fitViewDone:g,fitViewOnInitOptions:m,domNode:y,nodeOrigin:w,nodeExtent:k,debug:N,fitViewSync:E}=u(),{changes:C,updatedInternals:P}=mF(f,v,x,y,w,k);if(P){if(fF(v,x,{nodeOrigin:w,nodeExtent:k}),h.triggerFitView){let I=g;!g&&b&&(I=E({...m,nodes:m==null?void 0:m.nodes})),c({fitViewDone:I})}else c({});(C==null?void 0:C.length)>0&&(N&&console.log("React Flow: trigger node changes",C),p==null||p(C))}},updateNodePositions:(f,h=!1)=>{const p=[],v=[];for(const[x,b]of f){const g=!!(b!=null&&b.expandParent&&(b!=null&&b.parentId)&&(b!=null&&b.position)),m={id:x,type:"position",position:g?{x:Math.max(0,b.position.x),y:Math.max(0,b.position.y)}:b.position,dragging:h};g&&p.push({id:x,parentId:b.parentId,rect:{...b.internals.positionAbsolute,width:b.measured.width,height:b.measured.height}}),v.push(m)}if(p.length>0){const{nodeLookup:x,parentLookup:b,nodeOrigin:g}=u(),m=w0(p,x,b,g);v.push(...m)}u().triggerNodeChanges(v)},triggerNodeChanges:f=>{const{onNodesChange:h,setNodes:p,nodes:v,hasDefaultNodes:x,debug:b}=u();if(f!=null&&f.length){if(x){const g=f3(f,v);p(g)}b&&console.log("React Flow: trigger node changes",f),h==null||h(f)}},triggerEdgeChanges:f=>{const{onEdgesChange:h,setEdges:p,edges:v,hasDefaultEdges:x,debug:b}=u();if(f!=null&&f.length){if(x){const g=h3(f,v);p(g)}b&&console.log("React Flow: trigger edge changes",f),h==null||h(f)}},addSelectedNodes:f=>{const{multiSelectionActive:h,edgeLookup:p,nodeLookup:v,triggerNodeChanges:x,triggerEdgeChanges:b}=u();if(h){const g=f.map(m=>zs(m,!0));x(g);return}x(Uo(v,new Set([...f]),!0)),b(Uo(p))},addSelectedEdges:f=>{const{multiSelectionActive:h,edgeLookup:p,nodeLookup:v,triggerNodeChanges:x,triggerEdgeChanges:b}=u();if(h){const g=f.map(m=>zs(m,!0));b(g);return}b(Uo(p,new Set([...f]))),x(Uo(v,new Set,!0))},unselectNodesAndEdges:({nodes:f,edges:h}={})=>{const{edges:p,nodes:v,nodeLookup:x,triggerNodeChanges:b,triggerEdgeChanges:g}=u(),m=f||v,y=h||p,w=m.map(N=>{const E=x.get(N.id);return E&&(E.selected=!1),zs(N.id,!1)}),k=y.map(N=>zs(N.id,!1));b(w),g(k)},setMinZoom:f=>{const{panZoom:h,maxZoom:p}=u();h==null||h.setScaleExtent([f,p]),c({minZoom:f})},setMaxZoom:f=>{const{panZoom:h,minZoom:p}=u();h==null||h.setScaleExtent([p,f]),c({maxZoom:f})},setTranslateExtent:f=>{var h;(h=u().panZoom)==null||h.setTranslateExtent(f),c({translateExtent:f})},setPaneClickDistance:f=>{var h;(h=u().panZoom)==null||h.setClickDistance(f)},resetSelectedElements:()=>{const{edges:f,nodes:h,triggerNodeChanges:p,triggerEdgeChanges:v}=u(),x=h.reduce((g,m)=>m.selected?[...g,zs(m.id,!1)]:g,[]),b=f.reduce((g,m)=>m.selected?[...g,zs(m.id,!1)]:g,[]);p(x),v(b)},setNodeExtent:f=>{const{nodes:h,nodeLookup:p,parentLookup:v,nodeOrigin:x,elevateNodesOnSelect:b,nodeExtent:g}=u();f[0][0]===g[0][0]&&f[0][1]===g[0][1]&&f[1][0]===g[1][0]&&f[1][1]===g[1][1]||(Jp(h,p,v,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:b,checkEquality:!1}),c({nodeExtent:f}))},panBy:f=>{const{transform:h,width:p,height:v,panZoom:x,translateExtent:b}=u();return gF({delta:f,panZoom:x,transform:h,translateExtent:b,width:p,height:v})},fitView:f=>{const{panZoom:h,width:p,height:v,minZoom:x,maxZoom:b,nodeLookup:g}=u();if(!h)return Promise.resolve(!1);const m=Kp(g,f);return Yp({nodes:m,width:p,height:v,panZoom:h,minZoom:x,maxZoom:b},f)},fitViewSync:f=>{const{panZoom:h,width:p,height:v,minZoom:x,maxZoom:b,nodeLookup:g}=u();if(!h)return!1;const m=Kp(g,f);return Yp({nodes:m,width:p,height:v,panZoom:h,minZoom:x,maxZoom:b},f),m.size>0},cancelConnection:()=>{c({connection:{...rC}})},updateConnection:f=>{c({connection:f})},reset:()=>c({...lw()})}),Object.is);function PL({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:i,nodeOrigin:l,nodeExtent:a,children:c}){const[u]=S.useState(()=>TL({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}));return d.jsx(qF,{value:u,children:d.jsx(x3,{children:c})})}function IL({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,nodeOrigin:a,nodeExtent:c}){return S.useContext(qd)?d.jsx(d.Fragment,{children:e}):d.jsx(PL,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,nodeOrigin:a,nodeExtent:c,children:e})}const jL={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function OL({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:v,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:g,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:z,onDelete:$,onSelectionChange:A,onSelectionDragStart:R,onSelectionDrag:j,onSelectionDragStop:O,onSelectionContextMenu:F,onSelectionStart:T,onSelectionEnd:M,onBeforeDelete:_,connectionMode:U,connectionLineType:L=Zr.Bezier,connectionLineStyle:K,connectionLineComponent:W,connectionLineContainerStyle:q,deleteKeyCode:H="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:B=!1,selectionMode:Y=la.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:Z=Qu()?"Meta":"Control",zoomActivationKeyCode:V=Qu()?"Meta":"Control",snapToGrid:X,snapGrid:ee,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:Pe,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:ue,nodeOrigin:Re=MC,edgesFocusable:ye,edgesReconnectable:ze,elementsSelectable:Ie=!0,defaultViewport:et=o3,minZoom:lt=.5,maxZoom:re=2,translateExtent:se=ia,preventScrolling:De=!0,nodeExtent:we,defaultMarkerColor:at="#b1b1b7",zoomOnScroll:nn=!0,zoomOnPinch:qt=!0,panOnScroll:ne=!1,panOnScrollSpeed:Be=.5,panOnScrollMode:je=no.Free,zoomOnDoubleClick:zt=!0,panOnDrag:gn=!0,onPaneClick:qn,onPaneMouseEnter:Kn,onPaneMouseMove:ko,onPaneMouseLeave:Eo,onPaneScroll:Co,onPaneContextMenu:Aa,paneClickDistance:Ee=0,nodeClickDistance:yt=0,children:Kt,onReconnect:Rt,onReconnectStart:xn,onReconnectEnd:rn,onEdgeContextMenu:No,onEdgeDoubleClick:Hr,onEdgeMouseEnter:Ro,onEdgeMouseMove:Yn,onEdgeMouseLeave:jn,reconnectRadius:js=10,onNodesChange:To,onEdgesChange:Wi,noDragClassName:za="nodrag",noWheelClassName:Da="nowheel",noPanClassName:Ui="nopan",fitView:qi,fitViewOptions:$a,connectOnClick:Fa,attributionPosition:Xd,proOptions:Zd,defaultEdgeOptions:jN,elevateNodesOnSelect:ON,elevateEdgesOnSelect:_N,disableKeyboardA11y:R0=!1,autoPanOnConnect:MN,autoPanOnNodeDrag:AN,autoPanSpeed:zN,connectionRadius:DN,isValidConnection:$N,onError:FN,style:LN,id:T0,nodeDragThreshold:HN,viewport:BN,onViewportChange:VN,width:WN,height:UN,colorMode:qN="light",debug:KN,...YN},GN){const Jd=T0||"1",QN=c3(qN);return d.jsx("div",{"data-testid":"rf__wrapper",...YN,style:{...LN,...jL},ref:GN,className:dt(["react-flow",s,QN]),id:T0,children:d.jsxs(IL,{nodes:e,edges:t,width:WN,height:UN,fitView:qi,nodeOrigin:Re,nodeExtent:we,children:[d.jsx(RL,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:o,edgeTypes:i,connectionLineType:L,connectionLineStyle:K,connectionLineComponent:W,connectionLineContainerStyle:q,selectionKeyCode:G,selectionOnDrag:B,selectionMode:Y,deleteKeyCode:H,multiSelectionKeyCode:Z,panActivationKeyCode:Q,zoomActivationKeyCode:V,onlyRenderVisibleElements:he,defaultViewport:et,translateExtent:se,minZoom:lt,maxZoom:re,preventScrolling:De,zoomOnScroll:nn,zoomOnPinch:qt,zoomOnDoubleClick:zt,panOnScroll:ne,panOnScrollSpeed:Be,panOnScrollMode:je,panOnDrag:gn,onPaneClick:qn,onPaneMouseEnter:Kn,onPaneMouseMove:ko,onPaneMouseLeave:Eo,onPaneScroll:Co,onPaneContextMenu:Aa,paneClickDistance:Ee,nodeClickDistance:yt,onSelectionContextMenu:F,onSelectionStart:T,onSelectionEnd:M,onReconnect:Rt,onReconnectStart:xn,onReconnectEnd:rn,onEdgeContextMenu:No,onEdgeDoubleClick:Hr,onEdgeMouseEnter:Ro,onEdgeMouseMove:Yn,onEdgeMouseLeave:jn,reconnectRadius:js,defaultMarkerColor:at,noDragClassName:za,noWheelClassName:Da,noPanClassName:Ui,rfId:Jd,disableKeyboardA11y:R0,nodeExtent:we,viewport:BN,onViewportChange:VN}),d.jsx(a3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:v,onConnectEnd:x,onClickConnectStart:b,onClickConnectEnd:g,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:ue,edgesFocusable:ye,edgesReconnectable:ze,elementsSelectable:Ie,elevateNodesOnSelect:ON,elevateEdgesOnSelect:_N,minZoom:lt,maxZoom:re,nodeExtent:we,onNodesChange:To,onEdgesChange:Wi,snapToGrid:X,snapGrid:ee,connectionMode:U,translateExtent:se,connectOnClick:Fa,defaultEdgeOptions:jN,fitView:qi,fitViewOptions:$a,onNodesDelete:I,onEdgesDelete:z,onDelete:$,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:P,onSelectionDrag:j,onSelectionDragStart:R,onSelectionDragStop:O,onMove:u,onMoveStart:f,onMoveEnd:h,noPanClassName:Ui,nodeOrigin:Re,rfId:Jd,autoPanOnConnect:MN,autoPanOnNodeDrag:AN,autoPanSpeed:zN,onError:FN,connectionRadius:DN,isValidConnection:$N,selectNodesOnDrag:Pe,nodeDragThreshold:HN,onBeforeDelete:_,paneClickDistance:Ee,debug:KN}),d.jsx(s3,{onSelectionChange:A}),Kt,d.jsx(JF,{proOptions:Zd,position:Xd}),d.jsx(XF,{rfId:Jd,disableKeyboardA11y:R0})]})})}var _L=zC(OL);function ML({dimensions:e,lineWidth:t,variant:n,className:r}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:dt(["react-flow__background-pattern",n,r])})}function AL({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:dt(["react-flow__background-pattern","dots",t])})}var Pr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pr||(Pr={}));const zL={[Pr.Dots]:1,[Pr.Lines]:1,[Pr.Cross]:6},DL=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function iN({id:e,variant:t=Pr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:a,className:c,patternClassName:u}){const f=S.useRef(null),{transform:h,patternId:p}=_e(DL,it),v=r||zL[t],x=t===Pr.Dots,b=t===Pr.Cross,g=Array.isArray(n)?n:[n,n],m=[g[0]*h[2]||1,g[1]*h[2]||1],y=v*h[2],w=Array.isArray(o)?o:[o,o],k=b?[y,y]:m,N=[w[0]*h[2]||1+k[0]/2,w[1]*h[2]||1+k[1]/2],E=`${p}${e||""}`;return d.jsxs("svg",{className:dt(["react-flow__background",c]),style:{...a,...Kd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:f,"data-testid":"rf__background",children:[d.jsx("pattern",{id:E,x:h[0]%m[0],y:h[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:x?d.jsx(AL,{radius:y/2,className:u}):d.jsx(ML,{dimensions:k,lineWidth:s,variant:t,className:u})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}iN.displayName="Background";const $L=S.memo(iN);function FL(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function LL(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function HL(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function BL(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function VL(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Rc({children:e,className:t,...n}){return d.jsx("button",{type:"button",className:dt(["react-flow__controls-button",t]),...n,children:e})}const WL=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function lN({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:a,className:c,children:u,position:f="bottom-left",orientation:h="vertical","aria-label":p="React Flow controls"}){const v=Ye(),{isInteractive:x,minZoomReached:b,maxZoomReached:g}=_e(WL,it),{zoomIn:m,zoomOut:y,fitView:w}=S0(),k=()=>{m(),o==null||o()},N=()=>{y(),i==null||i()},E=()=>{w(s),l==null||l()},C=()=>{v.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},P=h==="horizontal"?"horizontal":"vertical";return d.jsxs(b0,{className:dt(["react-flow__controls",P,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":p,children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(Rc,{onClick:k,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:g,children:d.jsx(FL,{})}),d.jsx(Rc,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:d.jsx(LL,{})})]}),n&&d.jsx(Rc,{className:"react-flow__controls-fitview",onClick:E,title:"fit view","aria-label":"fit view",children:d.jsx(HL,{})}),r&&d.jsx(Rc,{className:"react-flow__controls-interactive",onClick:C,title:"toggle interactivity","aria-label":"toggle interactivity",children:x?d.jsx(VL,{}):d.jsx(BL,{})}),u]})}lN.displayName="Controls";const UL=S.memo(lN);function qL({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:u,shapeRendering:f,selected:h,onClick:p}){const{background:v,backgroundColor:x}=o||{},b=i||v||x;return d.jsx("rect",{className:dt(["react-flow__minimap-node",{selected:h},c]),x:t,y:n,rx:u,ry:u,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:a},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const KL=S.memo(qL),YL=e=>e.nodes.map(t=>t.id),nh=e=>e instanceof Function?e:()=>e;function GL({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=KL,onClick:i}){const l=_e(YL,it),a=nh(t),c=nh(e),u=nh(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:l.map(h=>d.jsx(XL,{id:h,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:f},h))})}function QL({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:u,y:f,width:h,height:p}=_e(v=>{const x=v.nodeLookup.get(e),{x:b,y:g}=x.internals.positionAbsolute,{width:m,height:y}=Lr(x);return{node:x,x:b,y:g,width:m,height:y}},it);return!c||c.hidden||!fC(c)?null:d.jsx(l,{x:u,y:f,width:h,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:s,strokeColor:n(c),strokeWidth:o,shapeRendering:i,onClick:a,id:c.id})}const XL=S.memo(QL);var ZL=S.memo(GL);const JL=200,e4=150,t4=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?uC(_a(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},n4="react-flow__minimap-desc";function aN({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:u,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:v,pannable:x=!1,zoomable:b=!1,ariaLabel:g="React Flow mini map",inversePan:m,zoomStep:y=10,offsetScale:w=5}){const k=Ye(),N=S.useRef(null),{boundingRect:E,viewBB:C,rfId:P,panZoom:I,translateExtent:z,flowWidth:$,flowHeight:A}=_e(t4,it),R=(e==null?void 0:e.width)??JL,j=(e==null?void 0:e.height)??e4,O=E.width/R,F=E.height/j,T=Math.max(O,F),M=T*R,_=T*j,U=w*T,L=E.x-(M-E.width)/2-U,K=E.y-(_-E.height)/2-U,W=M+U*2,q=_+U*2,H=`${n4}-${P}`,G=S.useRef(0),B=S.useRef();G.current=T,S.useEffect(()=>{if(N.current&&I)return B.current=EF({domNode:N.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>G.current}),()=>{var Z;(Z=B.current)==null||Z.destroy()}},[I]),S.useEffect(()=>{var Z;(Z=B.current)==null||Z.update({translateExtent:z,width:$,height:A,inversePan:m,pannable:x,zoomStep:y,zoomable:b})},[x,b,m,y,z,$,A]);const Y=p?Z=>{var ee;const[V,X]=((ee=B.current)==null?void 0:ee.pointer(Z))||[0,0];p(Z,{x:V,y:X})}:void 0,Q=v?S.useCallback((Z,V)=>{const X=k.getState().nodeLookup.get(V);v(Z,X)},[]):void 0;return d.jsx(b0,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*T:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof i=="string"?i:void 0},className:dt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:R,height:j,viewBox:`${L} ${K} ${W} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":H,ref:N,onClick:Y,children:[g&&d.jsx("title",{id:H,children:g}),d.jsx(ZL,{onClick:Q,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-U},${K-U}h${W+U*2}v${q+U*2}h${-W-U*2}z
62
+ M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}aN.displayName="MiniMap";S.memo(aN);function r4({nodeId:e,position:t,variant:n=jl.Handle,className:r,style:s={},children:o,color:i,minWidth:l=10,minHeight:a=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:f=!1,shouldResize:h,onResizeStart:p,onResize:v,onResizeEnd:x}){const b=LC(),g=typeof e=="string"?e:b,m=Ye(),y=S.useRef(null),w=n===jl.Line?"right":"bottom-right",k=t??w,N=S.useRef(null);S.useEffect(()=>{if(!(!y.current||!g))return N.current||(N.current=FF({domNode:y.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:I,transform:z,snapGrid:$,snapToGrid:A,nodeOrigin:R,domNode:j}=m.getState();return{nodeLookup:I,transform:z,snapGrid:$,snapToGrid:A,nodeOrigin:R,paneDomNode:j}},onChange:(I,z)=>{const{triggerNodeChanges:$,nodeLookup:A,parentLookup:R,nodeOrigin:j}=m.getState(),O=[],F={x:I.x,y:I.y},T=A.get(g);if(T&&T.expandParent&&T.parentId){const M=T.origin??j,_=I.width??T.measured.width,U=I.height??T.measured.height,L={id:T.id,parentId:T.parentId,rect:{width:_,height:U,...hC({x:I.x??T.position.x,y:I.y??T.position.y},{width:_,height:U},T.parentId,A,M)}},K=w0([L],A,R,j);O.push(...K),F.x=I.x?Math.max(M[0]*_,I.x):void 0,F.y=I.y?Math.max(M[1]*U,I.y):void 0}if(F.x!==void 0&&F.y!==void 0){const M={id:g,type:"position",position:{...F}};O.push(M)}if(I.width!==void 0&&I.height!==void 0){const M={id:g,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:I.width,height:I.height}};O.push(M)}for(const M of z){const _={...M,type:"position"};O.push(_)}$(O)},onEnd:()=>{const I={id:g,type:"dimensions",resizing:!1};m.getState().triggerNodeChanges([I])}})),N.current.update({controlPosition:k,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:u},keepAspectRatio:f,onResizeStart:p,onResize:v,onResizeEnd:x,shouldResize:h}),()=>{var I;(I=N.current)==null||I.destroy()}},[k,l,a,c,u,f,p,v,x,h]);const E=k.split("-"),C=n===jl.Line?"borderColor":"backgroundColor",P=i?{...s,[C]:i}:s;return d.jsx("div",{className:dt(["react-flow__resize-control","nodrag",...E,n,r]),ref:y,style:P,children:o})}S.memo(r4);const s4=new Set,aw=[];function o4(e){return e.startsWith("signal:child:")}function i4(e){const t=mo(),n=(()=>{const r=new Set(e),s=e.size+hE,o=[...e];for(;o.length>0&&r.size<s;){const i=o.shift();if(i===void 0)continue;const l=t.getQueryData(["run",i]);if(l!==void 0)for(const a of r0(l.timeline)){if(r.size>=s)break;r.has(a)||(r.add(a),o.push(a))}}return[...r].sort()})();return gm({queries:n.map(r=>({queryKey:["run",r],queryFn:()=>$e.run(r)})),combine:mE})}function l4({data:e}){const t=e.status==="failed",n=e.status==="pending"||e.status==="running",r=!!e.childRunId,s=!!e.collapsed,o=r&&!s,i=o?dg:fg(e.kind),l=t?{rail:"bg-red-400",badge:"bg-red-500/15 text-red-300",pill:"bg-red-500/20 text-red-300"}:n?{rail:"bg-live",badge:"bg-live/15 text-live",pill:"bg-live/20 text-live"}:{rail:"bg-emerald-400",badge:"bg-emerald-500/15 text-emerald-300",pill:"bg-emerald-500/20 text-emerald-300"};return d.jsxs("div",{title:o?vp.child:vp[e.kind]??e.kind,className:`group relative w-[208px] cursor-pointer overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur transition-all duration-150 hover:-translate-y-0.5 ${e.selected?"border-brand/60 ring-2 ring-brand/30":t?"border-red-500/40 hover:border-red-400/60":o?"border-indigo-500/40 hover:border-indigo-400/60":"border-line hover:border-zinc-600"}`,children:[d.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${l.rail} ${n?"animate-pulse":""}`}),d.jsx(ar,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),d.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${l.badge}`,children:d.jsx(i,{width:12,height:12})}),d.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),d.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${l.pill} ${n?"animate-pulse":""}`,children:t?d.jsx(Ss,{width:9,height:9}):n?d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):d.jsx(ug,{width:9,height:9})})]}),d.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?d.jsxs("span",{className:"flex items-center gap-1",children:[!s&&d.jsx("button",{type:"button",onClick:a=>{var c;a.stopPropagation(),e.childRunId&&((c=e.onToggleChild)==null||c.call(e,e.childRunId))},title:e.childExpanded?"Collapse child flow":"Expand child flow inline",className:"grid h-4 w-4 place-items-center rounded border border-indigo-500/30 bg-indigo-500/10 text-indigo-300 transition-colors hover:border-indigo-400/60 hover:bg-indigo-500/20 hover:text-indigo-200",children:d.jsx("span",{className:"inline-block text-[9px] transition-transform",style:{transform:e.childExpanded?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),d.jsx("button",{type:"button",onClick:a=>{var c;a.stopPropagation(),e.childRunId&&((c=e.onOpenRun)==null||c.call(e,e.childRunId))},title:"Open the child run",className:"rounded border border-indigo-500/30 bg-indigo-500/10 px-1 text-indigo-300 transition-colors hover:border-indigo-400/60 hover:bg-indigo-500/20 hover:text-indigo-200",children:"child ↗"})]}):d.jsx("span",{className:"rounded border border-line px-1 text-zinc-400",children:e.kind}),e.attempts>1&&d.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[d.jsx(Cu,{width:9,height:9}),e.attempts]}),e.workerGroup&&d.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),d.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&d.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&d.jsxs("div",{className:"mono mt-1.5 flex items-center gap-2 border-t border-line pt-1.5 text-[10px]",children:[e.subs.ok>0&&d.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&d.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&d.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),d.jsx(ar,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}function a4({data:e}){const{fan:t}=e,n=s0(t,e.runFinished),r=o0(t,e.runFinished),s=r==="failed",o=r==="pending"||r==="running",i=s?"bg-red-400":o?"bg-live":"bg-emerald-400",l=a=>`${a/Math.max(n.total,1)*100}%`;return d.jsxs("div",{title:`parallel fan ${t.group}`,className:`relative w-[208px] overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur ${s?"border-red-500/40":"border-indigo-500/40"}`,children:[d.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${i} ${o?"animate-pulse":""}`}),d.jsx(ar,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),d.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded bg-indigo-500/15 text-[11px] text-indigo-300",children:"⑃"}),d.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:t.label}),d.jsx("span",{className:"mono tnum ml-auto shrink-0 text-[11px] text-zinc-400",children:yE(n)})]}),d.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-full bg-zinc-800",children:Du.map(a=>d.jsx("span",{className:a.className,style:{width:l(n[a.key])}},a.key))}),d.jsxs("div",{className:"mono tnum mt-1.5 flex flex-wrap items-center gap-2 text-[10px]",children:[Du.map(a=>n[a.key]>0?d.jsxs("span",{className:a.text,children:[n[a.key]," ",a.label,a.key==="skipped"&&t.failFast?" (failFast)":""]},a.key):null),d.jsxs("span",{className:"ml-auto text-zinc-500",children:["#",t.firstSeq,"–",t.lastSeq]})]})]}),d.jsx(ar,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}function c4({data:e}){const t=e.status==="running"||e.status==="awaiting";return d.jsxs("div",{className:`s-${e.status} flex items-center gap-2 rounded-full border border-current/30 bg-panel px-3.5 py-1.5`,children:[d.jsx(ar,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),d.jsx("span",{className:`dot ${t?"pulse":""}`}),d.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),d.jsx(ar,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}const u4={step:l4,fan:a4,terminal:c4};function d4(e){var n;const t=(n=e.events)==null?void 0:n.filter(r=>r.status);if(!(!t||t.length===0))return{ok:t.filter(r=>r.status==="ok").length,failed:t.filter(r=>r.status==="failed").length,skipped:t.filter(r=>r.status==="skipped").length}}const f4=S.memo(function({run:t,timeline:n,fans:r=aw,endStatus:s,selectedKey:o,onSelect:i,onOpenRun:l,fmtDuration:a,expanded:c,onToggleChild:u}){const f=c??s4,h=S.useMemo(()=>{const g=new Set(f);for(const m of r0(n))g.add(m);return g},[f,n]),p=i4(h),{nodes:v,edges:x}=S.useMemo(()=>{const w=[],k=[],N=t.status==="running"||t.status==="suspended",E=(j,O,F)=>({id:`${j}->${O}`,source:j,target:O,style:{stroke:F?"#f87171":"var(--line)",strokeWidth:1.5}}),C=(j,O)=>({id:`${j}=>${O}`,source:j,target:O,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function P(j,O,F,T,M,_){const U=`${M}s${j.seq}`,L=bo(j),K=L!==void 0?p[L]:void 0,W=K!==void 0&&K.timeline.length===1&&K.timeline[0]?{step:K.timeline[0],run:K.run}:void 0,q=W!==void 0,H=!q&&L!==void 0&&f.has(L),G=W?W.step:j,B=W?W.run:_,Y=W?W.step.name:L!==void 0?(K==null?void 0:K.run.workflow)??pE(L,j.runId):gE(j),Q=G.status==="failed";w.push({id:U,type:"step",draggable:!1,position:{x:O,y:F},data:{seq:G.seq,name:Y,kind:G.kind,status:G.status,workerGroup:G.workerGroup,attempts:G.attempts,duration:a(G.startedAt,G.finishedAt),subs:d4(G),selected:o===`${G.runId}#${G.seq}`,childRunId:L,onOpenRun:l,childExpanded:H,onToggleChild:u,collapsed:q,depth:T,step:G,laneRun:B}});const Z=H?K:void 0;if(Z){const V=I(Z.timeline,Z.fans??aw,T+1,O+248,F+150,`${L}:`,Z.run);for(const ee of V.firstIds)k.push(C(U,ee));const X=o4(j.name)&&V.connectors.length>0?V.connectors:[{id:U,failed:Q}];return{id:U,exits:X,nextX:Math.max(O+248,V.nextX),bottomY:Math.max(F,V.bottomY)}}return{id:U,exits:[{id:U,failed:Q}],nextX:O+248,bottomY:F}}function I(j,O,F,T,M,_,U){let L=T;const K=[];let W=[],q=M;for(const H of xE(j,O)){if(H.kind==="summary"){const V=`${_}fan:${H.fan.group}`;w.push({id:V,type:"fan",draggable:!1,position:{x:L,y:M},data:{fan:H.fan,runFinished:$p(U.status),depth:F}}),K.length===0&&K.push(V);for(const X of W)k.push(E(X.id,V,X.failed));W=[{id:V,failed:o0(H.fan,$p(U.status))==="failed"}],L+=248;continue}const G=H.kind==="single"?[H.step]:H.steps,B=K.length===0,Y=[];let Q=M,Z=L;for(const V of G){const X=P(V,L,Q,F,_,U);B&&K.push(X.id);for(const ee of W)k.push(E(ee.id,X.id,ee.failed));Y.push(...X.exits),Z=Math.max(Z,X.nextX),Q=X.bottomY+96}W=Y,L=Z,q=Math.max(q,Q-96)}return{firstIds:K,connectors:W,nextX:L,bottomY:q}}const z=248;w.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:t.workflow}});const $=I(n,r,0,z,0,"",t);for(const j of $.firstIds)k.push({id:`start->${j}`,source:"start",target:j});const A=s??ej(t,n);w.push({id:"end",type:"terminal",position:{x:Math.max($.nextX,z),y:0},draggable:!1,data:{status:A,label:A}});const R=$.connectors.length>0?$.connectors:[{id:"start",failed:!1}];for(const j of R)k.push({id:`${j.id}->end`,source:j.id,target:"end",animated:N,style:{stroke:N?"var(--live)":"var(--line)",strokeWidth:N?2:1.5}});return{nodes:w,edges:k}},[t,n,r,s,o,l,a,f,u,p]),b=S.useCallback((g,m)=>{if(m.type!=="step")return;const y=m.data;y.step&&y.laneRun&&i(y.step,y.laneRun)},[i]);return d.jsxs(_L,{nodes:v,edges:x,nodeTypes:u4,onNodeClick:b,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,onlyRenderVisibleElements:!0,children:[d.jsx($L,{variant:Pr.Dots,gap:22,size:1,color:"#1c1c22"}),d.jsx(UL,{showInteractive:!1,position:"bottom-right"})]})});function nm(e,t){var n;return((n=e==null?void 0:e.capabilities)==null?void 0:n[t])!==!1}function cN(){const{data:e}=Xt({queryKey:["topology"],queryFn:()=>$e.topology(),staleTime:Number.POSITIVE_INFINITY});return e}function uN(){const e=cN();return t=>nm(e,t)}function h4(e){return!e.hasMore||e.loading||e.requestedAtCount===e.loadedCount?!1:e.lastRenderedIndex>=e.loadedCount-1-e.loadAhead}function Yc(e){const t=e.lastIndexOf("~retry~");return t===-1?void 0:e.slice(0,t)}function Tc(e){const n=(Yc(e)??e).match(/^(.*)\.(?:child\.\d+|onError\.\d+)$/);return(n==null?void 0:n[1])||void 0}function p4(e,t){var n;return((n=e[t])==null?void 0:n.id)??t}function m4(e){return JSON.stringify([e.status,e.tag,e.attrs,e.namespace,e.origin])}const dN=S.createContext(void 0);function So(e){const t=S.useContext(dN);if(!e&&t===void 0)throw new Error(tn(27));return t}const g4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,forceRender:i=!1,...l}=t,a=So(),c=a.useState("open"),u=a.useState("nested"),f=a.useState("mounted"),h=a.useState("transitionStatus");return Ut("div",t,{state:{open:c,transitionStatus:h},ref:[a.context.backdropRef,n],stateAttributesMapping:kg,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!u})}),x4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,...a}=t,c=So(),u=c.useState("open"),{getButtonProps:f,buttonRef:h}=Jg({disabled:i,native:l}),p={disabled:i};function v(x){u&&c.setOpen(!1,Me(KS,x.nativeEvent))}return Ut("button",t,{state:p,ref:[n,h],props:[{onClick:v},a,f]})}),y4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=So(),c=Vi(i);return a.useSyncedValueWithCleanup("descriptionElementId",c),Ut("p",t,{ref:n,props:[{id:c},l]})}),fN=S.createContext(void 0);function v4(){const e=S.useContext(fN);if(e===void 0)throw new Error(tn(26));return e}const w4="--nested-dialogs",b4="data-nested-dialog-open",S4={...Sg,...bg,nestedDialogOpen(e){return e?{[b4]:""}:null}},k4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:i,initialFocus:l,...a}=t,c=So(),u=c.useState("descriptionElementId"),f=c.useState("disablePointerDismissal"),h=c.useState("floatingRootContext"),p=c.useState("popupProps"),v=c.useState("modal"),x=c.useState("mounted"),b=c.useState("nested"),g=c.useState("nestedOpenDialogCount"),m=c.useState("open"),y=c.useState("openMethod"),w=c.useState("titleElementId"),k=c.useState("transitionStatus"),N=c.useState("role"),E=h.useState("floatingId");v4(),Ta({open:m,ref:c.context.popupRef,onComplete(){var A,R;m&&((R=(A=c.context).onOpenChangeComplete)==null||R.call(A,!0))}});const C=l===void 0?Bk(c.context.popupRef):l,P=g>0,I=c.useStateSetter("popupElement"),$=Ut("div",t,{state:{open:m,nested:b,transitionStatus:k,nestedDialogOpen:P},props:[p,{id:E,"aria-labelledby":w,"aria-describedby":u,role:N,...Fg,hidden:!x,onKeyDown(A){n0.has(A.key)&&A.stopPropagation()},style:{[w4]:g}},a],ref:[n,c.context.popupRef,I],stateAttributesMapping:S4});return d.jsx(Ck,{context:h,openInteractionType:y,disabled:!x,closeOnFocusOut:!f,initialFocus:C,returnFocus:i,modal:v!==!1,restoreFocus:"popup",children:$})}),E4=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,o=So(),i=o.useState("mounted"),l=o.useState("modal"),a=o.useState("open");return i||r?d.jsx(fN.Provider,{value:r,children:d.jsxs(bk,{ref:n,...s,children:[i&&l===!0&&d.jsx(oE,{ref:o.context.internalBackdropRef,inert:e0(!a)}),t.children]})}):null});function C4({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),o=e.useState("modal"),i=e.useState("popupElement"),l=e.useState("floatingRootContext"),[a,c]=S.useState(0),[u,f]=S.useState(0),h=a===0,p=Dg(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(v){if(!e.context.outsidePressEnabledRef.current||"button"in v&&v.button!==0)return!1;if("touches"in v){if(v.type==="touchend"){if(v.changedTouches.length!==1||v.touches.length!==0)return!1}else if(v.touches.length!==1)return!1}const x=Mt(v);if(h&&!s){if(o){const b=e.context.internalBackdropRef.current,g=e.context.backdropRef.current;return b||g?b===x||g===x||xe(x,i)&&!(x!=null&&x.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return lE(r&&o===!0,i),e.useContextCallback("onNestedDialogOpen",(v,x)=>{c(v),f(x)}),fe(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(a+1,u+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,a,u,t]),Ug(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:a,nestedOpenDrawerCount:u}),null}const N4={...Gg,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 R4 extends Od{constructor(n,r,s){const o=new qg,i=T4(n,o,r,s);super(i,P4(o),N4);ge(this,"setOpen",(n,r)=>{var s,o;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(Bg(this.state,n,r.trigger)))})}}function T4(e,t,n,r=!1){return{...Kg(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function P4(e){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function I4(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:i,disablePointerDismissal:l=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:f,defaultTriggerId:h=null}=t,p=e==="drawer",v=a,x=l,b="dialog",g=So(!0),m=g!=null,y={modal:v,disablePointerDismissal:x,nested:m,role:b},w=Lg((I,z)=>new R4({open:s,openProp:r,activeTriggerId:h,triggerIdProp:f,...y},I,z),!0);w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",f),w.useSyncedValues(y),w.useContextCallback("onOpenChange",o),w.useContextCallback("onOpenChangeComplete",i);const k=w.useState("open"),N=w.useState("mounted"),E=w.useState("payload");Uk(w,k),Vg(w);const{forceUnmount:C}=Wg(k,w);S.useImperativeHandle(c,()=>({unmount:C,close:()=>w.setOpen(!1,Me(Eg))}),[C,w]);const P=k||N;return d.jsxs(dN.Provider,{value:w,children:[u&&d.jsx(Hg,{handle:u,store:w}),P&&d.jsx(C4,{store:w,parentContext:g==null?void 0:g.context,isDrawer:p}),typeof n=="function"?n({payload:E}):n]})}const j4=xd(function(t){return I4("dialog",t)}),O4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=So(),c=Vi(i);return a.useSyncedValueWithCleanup("titleElementId",c),Ut("h2",t,{ref:n,props:[{id:c},l]})}),_4=j4,M4=x4;function cw({open:e,onOpenChange:t,title:n,subtitle:r,footer:s,children:o,className:i}){return d.jsx(_4,{open:e,onOpenChange:t,children:d.jsxs(E4,{children:[d.jsx(g4,{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm"}),d.jsxs(k4,{className:st("rise fixed left-1/2 top-1/2 z-50 w-[min(560px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-line bg-panel-2 text-foreground shadow-2xl focus-visible:outline-none",i),children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx(O4,{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:n}),r&&d.jsx(y4,{className:"mono mt-1 text-[11px] text-zinc-500",children:r})]}),d.jsx(M4,{render:d.jsx(Se,{variant:"quiet",size:"icon","aria-label":"Close",children:d.jsx(Ss,{})})})]}),d.jsx("div",{className:"px-5 py-4",children:o}),s&&d.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:s})]})]})})}function A4({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=S.useRef(e!==void 0),[o,i]=S.useState(t),l=s&&e!==void 0?e:o,a=S.useCallback(c=>{s||i(c)},[]);return[l,a]}const hN=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function z4(){return S.useContext(hN)}function pN(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=me(s),[,i]=S.useState(!1),l=Pn($4).current,a=Pn(D4).current,c=S.useRef(0),u=S.useRef(!0),f=S.useRef(null),h=S.useRef(null),p=me(()=>{u.current||(u.current=!0,i(k=>!k))}),v=me((k,N)=>{a.set(k,N),p()}),x=me(k=>{a.delete(k),p()}),b=me(k=>{const N=new Map;return n.current.length=0,r&&(r.current.length=0),k.forEach(E=>{var C,P;N.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,r&&(r.current[E.index]=E.registration.label!==void 0?E.registration.label:((P=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:P.textContent)??E.element.textContent)}),c.current=n.current.length,N});function g(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const N=new MutationObserver(P=>{if(!H4(P))return;let I=null;for(const z of k)if(z.isConnected){if(I&&mN(I,z)>0){N.disconnect(),p();return}I=z}});h.current=N;const E=new Set;for(let P=1;P<k.length;P+=1){const I=L4(k[P-1],k[P]);I&&E.add(I)}E.forEach(P=>N.observe(P,{childList:!0}))}const m=me(()=>{const[k,N]=F4(a),E=b(k),C=f.current,P=!C||C.length!==k.length||k.some((I,z)=>{const $=C[z];return I.index!==$.index||I.element!==$.element||I.registration.index!==$.registration.index||I.registration.metadata!==$.registration.metadata});g(N),f.current=k,u.current=!1,P&&(l.forEach(I=>I(E)),o(E))});fe(()=>(!u.current&&f.current&&b(f.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,b]),fe(()=>{u.current&&m()}),fe(()=>()=>{var k;(k=h.current)==null||k.disconnect(),u.current=!0},[]);const y=me(k=>(l.add(k),()=>{l.delete(k)})),w=S.useMemo(()=>({register:v,unregister:x,subscribeMapChange:y,nextIndexRef:c}),[v,x,y,c]);return d.jsx(hN.Provider,{value:w,children:t})}function D4(){return new Map}function $4(){return new Set}function F4(e){const t=new Set,n=[],r=[];e.forEach((o,i)=>{if(!i.isConnected)return;const l=o.index,a={index:l??-1,element:i,registration:o};l===null?r.push(a):l>=0&&(t.add(l),n.push(a))});let s=0;return r.sort((o,i)=>mN(o.element,i.element)),r.forEach(o=>{for(;t.has(s);)s+=1;o.index=s,n.push(o),s+=1}),t.size>0&&n.sort((o,i)=>o.index-i.index),[n,r.map(o=>o.element)]}function L4(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function H4(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function mN(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const gN=S.createContext(void 0);function E0(){const e=S.useContext(gN);if(e===void 0)throw new Error(tn(64));return e}const B4="data-activation-direction",Gd={tabActivationDirection:e=>({[B4]:e})},V4=S.forwardRef(function(t,n){const{className:r,defaultValue:s=0,onValueChange:o,orientation:i="horizontal",render:l,value:a,style:c,...u}=t,f=t.defaultValue!==void 0,h=S.useRef([]),[p,v]=S.useState(()=>new Map),[x,b]=A4({controlled:a,default:s,name:"Tabs",state:"value"}),g=a!==void 0,[m,y]=S.useState(()=>new Map),w=S.useRef(void 0),k=S.useCallback(B=>rm(m,B),[m]),[N,E]=S.useState(()=>({previousValue:x,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:P}=N;let I=P,z=!1;C!==x&&(I=uw(C,x,i,m),z=C!=null&&x!=null&&k(x)==null);const $=z?C:x,A=C!==$||P!==I;fe(()=>{A&&E({previousValue:$,tabActivationDirection:I})},[$,A,I]);const R=me((B,Y)=>{const Q=uw(x,B,i,m);Y.activationDirection=Q,o==null||o(B,Y),!Y.isCanceled&&b(B)}),j=me((B,Y)=>{o==null||o(B,Me(Y,void 0,void 0,{activationDirection:"none"}))}),O=me((B,Y)=>(v(Q=>{const Z=new Map(Q);return Z.set(B,Y),Z}),()=>{v(Q=>{if(Q.get(B)!==Y)return Q;const Z=new Map(Q);return Z.delete(B),Z})})),F=S.useCallback(B=>p.get(B),[p]),T=S.useCallback(B=>{for(const Y of m.values())if(B===Y.value)return Y.id},[m]),M=S.useMemo(()=>({getTabElementBySelectedValue:k,getTabIdByPanelValue:T,getTabPanelIdByValue:F,onValueChange:R,orientation:i,registerMountedTabPanel:O,setTabMap:y,tabActivationDirection:I,value:x}),[k,T,F,R,i,O,y,I,x]),_=S.useMemo(()=>{for(const B of m.values())if(B.value===x)return B},[m,x]),U=S.useMemo(()=>{for(const B of m.values())if(!B.disabled)return B.value},[m]),L=S.useRef(!f),K=S.useRef(s),W=S.useRef(f),q=S.useRef(!1);fe(()=>{var V;if(g)return;function B(X,ee){b(X),E({previousValue:X,tabActivationDirection:"none"}),j(X,ee),L.current=!1}if(m.size===0){q.current&&x!==null&&!((V=w.current)!=null&&V.isConnected)&&B(null,fy);return}q.current=!0,w.current=m.keys().next().value;const Y=_==null?void 0:_.disabled,Q=_==null&&x!==null;if(!Y&&x===K.current&&(W.current=!1),W.current&&Y&&x===K.current)return;const Z=L.current;if(Y||Q){const X=U??null;if(x===X){L.current=!1;return}let ee=fy;Z?ee=hy:Y&&(ee=YS),B(X,ee);return}Z&&_!=null&&(j(x,hy),L.current=!1)},[U,g,j,_,b,m,x]);const G=Ut("div",t,{state:{orientation:i,tabActivationDirection:I},ref:n,props:u,stateAttributesMapping:Gd});return d.jsx(gN.Provider,{value:M,children:d.jsx(pN,{elementsRef:h,children:G})})});function rm(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function uw(e,t,n,r){if(e==null||t==null)return"none";const[s,o,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],l=rm(r,e),a=rm(r,t);if(l==null||a==null)return l!==a&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:o:"none";const c=l.getBoundingClientRect()[s],u=a.getBoundingClientRect()[s];return u<c?o:u>c?i:"none"}const C0="data-composite-item-active";function xN(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:o}=e,{register:i,unregister:l,subscribeMapChange:a,nextIndexRef:c}=z4(),u=S.useRef(-1),[f,h]=S.useState(o==null&&t?()=>{if(u.current===-1){const b=c.current;c.current+=1,u.current=b}return u.current}:-1),p=o??f,v=S.useRef(null),x=S.useCallback(b=>{const g=v.current;g&&l(g),v.current=b,b&&i(b,{metadata:r??null,index:o??null,label:n,textRef:s})},[o,i,l,r,n,s]);return fe(()=>{if(o==null)return a(b=>{var m;const g=v.current?(m=b.get(v.current))==null?void 0:m.index:null;g!=null&&h(g)})},[o,a]),{ref:x,index:p}}function W4(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Zg(),{ref:s,index:o}=xN(e),i=n===o,l=S.useRef(null),a=Ni(s,l);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(o)},onMouseMove(){const u=l.current;if(!t||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!f&&u.focus()}},compositeRef:a,index:o}}const yN=S.createContext(void 0);function U4(){const e=S.useContext(yN);if(e===void 0)throw new Error(tn(65));return e}const q4=S.forwardRef(function(t,n){const{className:r,disabled:s=!1,render:o,value:i,id:l,nativeButton:a=!0,style:c,...u}=t,{value:f,getTabPanelIdByValue:h,onValueChange:p,orientation:v,tabActivationDirection:x}=E0(),{activateOnFocus:b,registerTabResizeObserverElement:g,tabsListElement:m}=U4(),{highlightedIndex:y,onHighlightedIndexChange:w}=Zg(),k=Vi(l),N=S.useMemo(()=>({disabled:s,id:k,value:i}),[s,k,i]),{compositeProps:E,compositeRef:C,index:P}=W4({metadata:N}),I=i===f,z=S.useRef(!1),$=S.useRef(null),A=me(q=>{var H;(H=$.current)==null||H.call($),$.current=q?g(q):null});fe(()=>{if(z.current){z.current=!1;return}if(!(I&&P>-1&&y!==P))return;const q=m;if(q!=null){const H=vn(Fe(q));if(H&&xe(q,H))return}s||w(P)},[I,P,y,w,s,m]);const{getButtonProps:R,buttonRef:j}=Jg({disabled:s,native:a,focusableWhenDisabled:!0}),O=h(i),F=S.useRef(!1),T=S.useRef(!1);function M(q){p(i,Me(Ed,q.nativeEvent,void 0,{activationDirection:"none"}))}function _(q){I||s||M(q)}function U(q){I||s||b&&(!F.current||T.current)&&M(q)}function L(q){if(I||s)return;F.current=!0,T.current=q.button===0;const H=Fe(q.currentTarget);function G(){F.current=!1,T.current=!1,H.removeEventListener("pointerup",G),H.removeEventListener("pointercancel",G)}H.addEventListener("pointerup",G),H.addEventListener("pointercancel",G)}return Ut("button",t,{state:{disabled:s,active:I,orientation:v,tabActivationDirection:x},ref:[n,j,C,A],props:[E,{role:"tab","aria-controls":O,"aria-selected":I,id:k,onClick:_,onFocus:U,onPointerDown:L,[C0]:I?"":void 0,onKeyDownCapture(){z.current=!0}},u,R],stateAttributesMapping:Gd})}),K4="data-index",Y4={...Gd,...bg},G4=S.forwardRef(function(t,n){const{className:r,value:s,render:o,keepMounted:i=!1,style:l,...a}=t,{value:c,getTabIdByPanelValue:u,orientation:f,tabActivationDirection:h,registerMountedTabPanel:p}=E0(),v=Vi(),{ref:x,index:b}=xN(),g=s===c,{mounted:m,transitionStatus:y,setMounted:w}=Lk(g),k=!m,N=u(s),E={hidden:k,orientation:f,tabActivationDirection:h,transitionStatus:y},C=S.useRef(null),P=Ut("div",t,{state:E,ref:[n,x,C],props:[{"aria-labelledby":N,hidden:k,id:v,role:"tabpanel",tabIndex:g?0:-1,inert:e0(!g),[K4]:b},a],stateAttributesMapping:Y4});return Ta({open:g,ref:C,onComplete(){g||w(!1)}}),fe(()=>{if(!(v==null||k&&!i))return p(s,v)},[k,i,s,v,p]),i||m?P:null});function Q4(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function X4(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:s,direction:o,highlightedIndex:i,onHighlightedIndexChange:l,rootRef:a,enableHomeAndEndKeys:c=!1,stopEventPropagation:u,disabledIndices:f,modifierKeys:h=Gl}=e,[p,v]=S.useState(0),x=r!=null,b=S.useRef(null),g=Ni(b,a),m=S.useRef([]),y=S.useRef(!1),w=S.useRef(null),k=i??p,N=me((z,$=!1)=>{if(w.current=m.current[z]??null,(l??v)(z),$){const A=m.current[z];Gy(b.current,A,o,n)}}),E=me(z=>{var j;if(z.size===0)return;if(y.current){const O=m.current,F=O.indexOf(w.current);if(F===-1){const T=O[k];!T||Tl(O,k,f)?N(Z4(O,f)):w.current=T}else F!==k&&N(F);return}y.current=!0;const $=Array.from(z.keys()),A=$.find(O=>O==null?void 0:O.hasAttribute(C0))??null,R=A?((j=z.get(A))==null?void 0:j.index)??-1:-1;if(R!==-1)N(R);else if(Tl($,k,f)){const O=Rl($,{disabledIndices:f});zf($,O)||N(O)}Gy(b.current,A,o,n)});fe(()=>{if(f==null||i!=null||!y.current)return;const z=m.current;if(Tl(z,k,f)){const $=Rl(z,{disabledIndices:f});zf(z,$)||N($)}},[f,i,k,m,N]);const C=me((z,$,A)=>s?s(z,$,A,m):A),P=me(z=>{const $=z.key===Ap||z.key===zp;if(!n0.has(z.key)||!c&&$||J4(z,h)||!b.current)return;const R=o==="rtl",j=R?_p:Mp,O=R?Mp:_p,F=n==="vertical"?Op:j,T=n==="vertical"?jp:O,M=Mt(z.nativeEvent);if(M!=null&&Yy(M)&&!Q4(M)){const q=M.selectionStart,H=M.selectionEnd,G=M.value;if(q==null||z.shiftKey||q!==H||z.key!==T&&q<G.length||z.key!==F&&q>0)return}let _=k;const U=hO(m,f),L=pO(m,f);r!=null&&(_=r({disabledIndices:f,elementsRef:m,event:z,highlightedIndex:k,loopFocus:t,maxIndex:L,minIndex:U,onLoop:C,orientation:n,rtl:R}));const K=n!=="vertical"&&z.key===j||n!=="horizontal"&&z.key===Op,W=n!=="vertical"&&z.key===O||n!=="horizontal"&&z.key===jp;c&&(z.key===Ap?_=U:z.key===zp&&(_=L)),_===k&&(K||W)&&(t&&_===L&&K?(_=U,s&&(_=s(z,k,_,m))):t&&_===U&&W?(_=L,s&&(_=s(z,k,_,m))):_=Rl(m.current,{startingIndex:_,decrement:W,disabledIndices:f})),_!==k&&!zf(m.current,_)&&(u&&z.stopPropagation(),(x||$||K||W)&&z.preventDefault(),N(_,!0),queueMicrotask(()=>{var q;(q=m.current[_])==null||q.focus()}))});return{props:{ref:g,onFocus(z){const $=b.current,A=Mt(z.nativeEvent);!$||A==null||!Yy(A)||A.setSelectionRange(0,A.value.length)},onKeyDown:P},highlightedIndex:k,onHighlightedIndexChange:N,elementsRef:m,onMapChange:E,relayKeyboardEvent:P}}function Z4(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const s=e[r];if(!(!s||Tl(e,r,t))){if(s.hasAttribute(C0))return r;n===-1&&(n=r)}}return Math.max(n,0)}function J4(e,t){for(const n of aA)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function e6(e){const{render:t,className:n,style:r,refs:s=Gl,props:o=Gl,state:i=kt,stateAttributesMapping:l,highlightedIndex:a,onHighlightedIndexChange:c,orientation:u,grid:f,loopFocus:h,onLoop:p,enableHomeAndEndKeys:v,onMapChange:x,stopEventPropagation:b=!0,rootRef:g,disabledIndices:m,modifierKeys:y,highlightItemOnHover:w=!1,tag:k="div",...N}=e,E=nE(),{props:C,highlightedIndex:P,onHighlightedIndexChange:I,elementsRef:z,onMapChange:$,relayKeyboardEvent:A}=X4({grid:f,loopFocus:h,onLoop:p,orientation:u,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:g,stopEventPropagation:b,enableHomeAndEndKeys:v,direction:E,disabledIndices:m,modifierKeys:y}),R=Ut(k,e,{state:i,ref:s,props:[C,...o,N],stateAttributesMapping:l}),j=S.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:I,highlightItemOnHover:w,relayKeyboardEvent:A}),[P,I,w,A]);return d.jsx(Jk.Provider,{value:j,children:d.jsx(pN,{elementsRef:z,onMapChange:O=>{x==null||x(O),$(O)},children:R})})}const t6=S.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:s,loopFocus:o=!0,render:i,style:l,...a}=t,{orientation:c,setTabMap:u,tabActivationDirection:f}=E0(),[h,p]=S.useState(0),[v,x]=S.useState(null),b=S.useRef(new Set),g=S.useRef(new Set),m=S.useRef(null);fe(()=>{if(typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>{b.current.forEach(P=>{P()})});return m.current=C,v&&C.observe(v),g.current.forEach(P=>{C.observe(P)}),()=>{C.disconnect(),m.current=null}},[v]);const y=me(C=>(b.current.add(C),()=>{b.current.delete(C)})),w=me(C=>{var P;return g.current.add(C),(P=m.current)==null||P.observe(C),()=>{var I;g.current.delete(C),(I=m.current)==null||I.unobserve(C)}}),k={orientation:c,tabActivationDirection:f},N={"aria-orientation":c==="vertical"?"vertical":void 0,role:"tablist"},E=S.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:w,tabsListElement:v}),[r,y,w,v]);return d.jsx(yN.Provider,{value:E,children:d.jsx(e6,{render:i,className:s,style:l,state:k,refs:[n,x],props:[N,a],stateAttributesMapping:Gd,highlightedIndex:h,enableHomeAndEndKeys:!0,loopFocus:o,orientation:c,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:Gl})})}),n6=V4,vN=S.forwardRef(({className:e,...t},n)=>d.jsx(t6,{ref:n,className:st("flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5",e),...t}));vN.displayName="TabsList";const wN=S.forwardRef(({className:e,...t},n)=>d.jsx(q4,{ref:n,className:st("mono cursor-pointer rounded px-1.5 py-0.5 text-[10px] text-zinc-500 transition-colors hover:text-zinc-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[active]:bg-zinc-700 data-[active]:text-zinc-100",e),...t}));wN.displayName="TabsTab";const Gc=S.forwardRef(({className:e,...t},n)=>d.jsx(G4,{ref:n,className:st("focus-visible:outline-none",e),...t}));Gc.displayName="TabsPanel";const bN=S.createContext(void 0);function Qd(e){const t=S.useContext(bN);if(t===void 0&&!e)throw new Error(tn(72));return t}const r6={...Gg,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class s6 extends Od{constructor(n,r,s){const o=new qg;super(o6(n,o,r,s),i6(o),r6);ge(this,"setOpen",(n,r)=>{gM(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,Me(Es,n))}}function o6(e,t,n,r=!1){return{...Kg(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function i6(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const l6=xd(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:i="none",actionsRef:l,onOpenChange:a,onOpenChangeComplete:c,handle:u,triggerId:f,defaultTriggerId:h=null,children:p}=t,v=Lg((z,$)=>new s6({open:r,openProp:s,activeTriggerId:h,triggerIdProp:f},z,$));v.useControlledProp("openProp",s),v.useControlledProp("triggerIdProp",f),v.useContextCallback("onOpenChange",a),v.useContextCallback("onOpenChangeComplete",c);const x=v.useState("open"),b=!n&&x,g=v.useState("activeTriggerId"),m=v.useState("mounted"),y=v.useState("payload");v.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:o,disabled:n}),Vg(v,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:w,transitionStatus:k}=Wg(b,v),N=v.useState("isInstantPhase"),E=v.useState("instantType"),C=v.useState("lastOpenChangeReason"),P=S.useRef(null);fe(()=>{x&&n&&v.setOpen(!1,Me(YS))},[x,n,v]),fe(()=>{k==="ending"&&C===Ed||k!=="ending"&&N?(E!=="delay"&&(P.current=E),v.set("instantType","delay")):P.current!==null&&(v.set("instantType",P.current),P.current=null)},[k,N,C,E,v]),fe(()=>{b&&g==null&&v.set("payload",void 0)},[v,g,b]),S.useImperativeHandle(l,()=>({unmount:w,close:()=>v.setOpen(!1,Me(Eg))}),[w,v]);const I=b||m||!n&&i!=="none";return d.jsxs(bN.Provider,{value:v,children:[u&&d.jsx(Hg,{handle:u,store:v}),I&&d.jsx(a6,{store:v,disabled:n,trackCursorAxis:i}),typeof p=="function"?p({payload:y}):p]})});function a6({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Dg(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=e_(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=S.useMemo(()=>Rd(o.reference,s.reference),[o.reference,s.reference]);return Ug(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:s.floating??kt}),null}const SN=S.createContext(void 0);function c6(){return S.useContext(SN)}const u6=600,kN="data-base-ui-tooltip-trigger";function dw(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(Ce(s))return s}}const t=e.target;return Ce(t)?t:null}function d6(e){let t=e;for(;t;){const n=t.closest(`[${kN}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Ce(r.host)?r.host:null}return null}const f6=AS(function(t,n){const{render:r,className:s,style:o,handle:i,payload:l,disabled:a,delay:c,closeOnClick:u=!0,closeDelay:f,id:h,...p}=t,v=Qd(!0),b=Kk(i)??v;if(!b)throw new Error(tn(82));const g=Vi(h),m=b.useState("isTriggerActive",g),y=b.useState("isOpenedByTrigger",g),w=b.useState("floatingRootContext"),k=S.useRef(null),N=f??0,{registerTrigger:E,isMountedByThisTrigger:C}=Wk(g,k,b,{payload:l,closeOnClick:u,closeDelay:N}),P=c6(),{activeIdRef:I,delayRef:z,isInstantPhase:$,hasProvider:A}=Y2(w,{open:y}),R=Xg(w);b.useSyncedValue("isInstantPhase",$);const j=b.useState("disabled"),O=a??j,F=Ht(O),T=b.useState("trackCursorAxis"),M=b.useState("disableHoverablePopup"),_=S.useRef(!1),U=Mr(),L=S.useRef(void 0);function K(){return A&&I.current!=null?0:c??P??u6}function W(X){const ee=k.current;if(!ee||!X)return!1;const he=d6(X);return he!==null&&he!==ee&&xe(ee,he)}function q(X){const ee=W(X);return _.current=ee,ee&&(R.openChangeTimeout.clear(),R.restTimeout.clear(),R.restTimeoutPending=!1,U.clear()),ee}const H=Qk(w,{enabled:!O,mouseOnly:!0,move:!1,handleClose:!M&&T!=="both"?Xk():null,restMs:K,delay(){return f==null&&A?{close:co(z.current,"close")}:{close:N}},triggerElementRef:k,isActiveTrigger:m,isClosing:()=>b.select("transitionStatus")==="ending",shouldOpen(){return!_.current}}),G=wM(w,{enabled:!O}).reference,B=X=>{const ee=_.current,he=dw(X),Pe=q(he),ce=k.current,ve=ce&&he&&xe(ce,he);if(Pe&&b.select("open")&&b.select("lastOpenChangeReason")===St){b.setOpen(!1,Me(St,X));return}if(ee&&!Pe&&ve&&!F.current&&!b.select("open")&&ce&&ys(L.current)){const ue=()=>{!_.current&&!F.current&&!b.select("open")&&b.setOpen(!0,Me(St,X,ce))},Re=K();Re===0?(U.clear(),ue()):U.start(Re,ue)}},Y=b.useState("triggerProps",C);return Ut("button",t,{state:{open:y},ref:[n,E,k],props:[H,G,C||T!=="none"?Y:void 0,{onMouseOver(X){B(X.nativeEvent)},onFocus(X){W(dw(X.nativeEvent))&&X.preventBaseUIHandler()},onMouseLeave(){_.current=!1,U.clear(),L.current=void 0},onPointerEnter(X){L.current=X.pointerType},onPointerDown(X){L.current=X.pointerType,b.set("closeOnClick",u),u&&!b.select("open")&&b.cancelPendingOpen(X.nativeEvent)},onClick(X){u&&!b.select("open")&&b.cancelPendingOpen(X.nativeEvent)},id:g,[Np]:O?"":void 0,[kN]:O?void 0:""},p],stateAttributesMapping:WS})}),EN=S.createContext(void 0);function h6(){const e=S.useContext(EN);if(e===void 0)throw new Error(tn(70));return e}const p6=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,style:l,...a}=t,{node:c,subtree:u}=wk({container:s,ref:n,componentProps:t,elementProps:a});return!u&&!c?null:d.jsxs(S.Fragment,{children:[u,c&&dn.createPortal(r,c)]})}),m6=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Qd().useState("mounted")||r?d.jsx(EN.Provider,{value:r,children:d.jsx(p6,{ref:n,...s})}):null}),CN=S.createContext(void 0);function g6(){const e=S.useContext(CN);if(e===void 0)throw new Error(tn(71));return e}const x6=S.forwardRef(function(t,n){const{render:r,className:s,anchor:o,positionMethod:i="absolute",side:l="top",align:a="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:h=5,arrowPadding:p=5,sticky:v=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=xk,style:g,...m}=t,y=Qd(),w=h6(),k=y.useState("open"),N=y.useState("mounted"),E=y.useState("trackCursorAxis"),C=y.useState("disableHoverablePopup"),P=y.useState("floatingRootContext"),I=y.useState("instantType"),z=y.useState("transitionStatus"),$=y.useState("adaptiveOrigin"),A=sE({anchor:o,positionMethod:i,floatingRootContext:P,mounted:N,side:l,sideOffset:c,align:a,alignOffset:u,collisionBoundary:f,collisionPadding:h,sticky:v,arrowPadding:p,disableAnchorTracking:x,keepMounted:w,collisionAvoidance:b,adaptiveOrigin:$}),R=S.useMemo(()=>({open:k,side:A.side,align:A.align,anchorHidden:A.anchorHidden,instant:E!=="none"?"tracking-cursor":I}),[k,A.side,A.align,A.anchorHidden,E,I]),j=iE(t,R,{styles:A.positionerStyles,transitionStatus:z,props:m,refs:[n,y.useStateSetter("positionerElement")],hidden:!N,inert:!k||E==="both"||C});return d.jsx(CN.Provider,{value:A,children:j})}),y6=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,l=Qd(),{side:a,align:c}=g6(),u=l.useState("open"),f=l.useState("instantType"),h=l.useState("transitionStatus"),p=l.useState("popupProps"),v=l.useState("floatingRootContext"),x=l.useState("disabled"),b=l.useState("closeDelay");Ta({open:u,ref:l.context.popupRef,onComplete(){var w,k;u&&((k=(w=l.context).onOpenChangeComplete)==null||k.call(w,!0))}}),Gk(v,{enabled:!x,closeDelay:b});const g=l.useStateSetter("popupElement");return Ut("div",t,{state:{open:u,side:a,align:c,instant:f,transitionStatus:h},ref:[n,l.context.popupRef,g],props:[Fg,p,t0(h),i],stateAttributesMapping:kg})}),v6=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,o=S.useMemo(()=>({open:n,close:r}),[n,r]);return d.jsx(SN.Provider,{value:n,children:d.jsx(K2,{delay:o,timeoutMs:s,children:t.children})})};function w6({children:e,...t}){return d.jsx(v6,{delay:150,closeDelay:80,...t,children:e})}const b6=l6,S6=f6,k6="z-50 max-w-[280px] whitespace-pre-line rounded-md border border-line bg-popover/95 px-2 py-1 text-left text-[10px] leading-relaxed text-zinc-300 shadow-xl backdrop-blur";function Zu({label:e,suppressed:t,side:n="bottom",align:r="end",children:s}){return d.jsxs(b6,{disabled:t??!1,children:[d.jsx(S6,{render:s}),d.jsx(m6,{children:d.jsx(x6,{side:n,align:r,sideOffset:4,collisionPadding:8,children:d.jsx(y6,{className:st(k6),children:e})})})]})}const E6=EA("durable-dashboard-config");function NN({className:e}){return d.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:e,role:"img","aria-label":"durable",children:[d.jsx("title",{children:"durable"}),d.jsx("path",{d:"M12 2.5 21.5 12 12 21.5 2.5 12z",opacity:.35}),d.jsx("circle",{cx:"6.4",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"12",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"17.6",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),d.jsx("path",{d:"M8.1 12h2.2M13.7 12h2.2"})]})}const C6=["pending","running","suspended","completed","failed","cancelling","cancelled","dead"];function N6(e){const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const s=Math.round(r/60);return s<24?`${s}h ago`:`${Math.round(s/24)}d ago`}function R6(e,t){const n=new Date(t).getTime()-new Date(e).getTime();return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function N0({status:e}){const t=e==="running"||e==="awaiting"||e==="cancelling";return d.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function RN({status:e}){return d.jsxs(Xe,{variant:"status",className:`s-${e} text-[11px]`,children:[d.jsx(N0,{status:e}),e]})}function T6({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((a,c)=>a+c,0),s=(a,c,u)=>d.jsxs(Se,{variant:"ghost",size:"chip","aria-pressed":t===a,onClick:()=>n(a),className:st("rounded-md",t===a&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[a!=="all"&&d.jsx(N0,{status:a}),d.jsx("span",{className:"uppercase tracking-wide",children:c}),d.jsx("span",{className:"mono tnum text-zinc-600",children:u})]},a),o=cN(),i=(o==null?void 0:o.role)==="tenant",l=o?o.engine?o.engine:i?o.tenant?`tenant · ${o.tenant}`:"tenant":"control plane":"";return d.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-line px-5 py-3",children:[d.jsx(RA,{config:E6,current:{title:"Workflows",icon:"workflow"},brand:d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-brand/30 bg-brand/10",children:d.jsx(NN,{className:"h-4 w-4 text-brand"})}),d.jsxs("div",{className:"leading-none",children:[d.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),d.jsx("div",{className:`mono text-[10px] uppercase tracking-[0.2em] ${i?"text-amber-400/80":"text-zinc-600"}`,title:i?`Tenant deployment — partition ${(o==null?void 0:o.tenant)??"(unnamed)"}`:"Control-plane deployment",children:l})]})]})}),d.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[s("all","all",r),C6.map(a=>s(a,a,e[a]??0))]}),nm(o,"workers")&&d.jsx(j6,{}),!i&&nm(o,"schedules")&&d.jsx(yz,{}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[d.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function P6(e){const t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.round(t/60);if(n<60)return`${n}m ago`;const r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function TN({status:e}){const t=e==null?void 0:e.concurrency;if(!e||!t)return d.jsx("span",{className:"mono text-[9px] text-zinc-600",children:"no status"});const n=t.limit>0&&e.inFlight>=t.limit*.8;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-zinc-500",children:[d.jsx("span",{className:`shrink-0 rounded border px-1 text-[9px] uppercase tracking-wider ${t.mode==="adaptive"?"border-sky-500/40 bg-sky-500/10 text-sky-300":"border-zinc-600/50 bg-zinc-800/60 text-zinc-400"}`,children:t.mode==="adaptive"?`adaptive ${t.min??1}–${t.max??32}`:"fixed"}),d.jsxs("span",{className:n?"text-amber-300":"text-zinc-400",children:["in-flight"," ",d.jsxs("span",{className:"tnum",children:[e.inFlight,"/",t.limit]})]}),typeof e.rssPct=="number"&&d.jsxs("span",{className:e.rssPct>=85?"text-rose-300":"",children:["ram ",d.jsxs("span",{className:"tnum",children:[Math.round(e.rssPct),"%"]})]}),typeof e.cpuPct=="number"&&d.jsxs("span",{children:["cpu ",d.jsxs("span",{className:"tnum",children:[Math.round(e.cpuPct),"%"]})]}),typeof e.throughputPerMin=="number"&&d.jsxs("span",{children:[d.jsx("span",{className:"tnum",children:Math.round(e.throughputPerMin)}),"/min"]}),typeof e.p95Ms=="number"&&d.jsxs("span",{children:["p95 ",d.jsxs("span",{className:"tnum",children:[Math.round(e.p95Ms),"ms"]})]})]}),e.lastAdjust&&d.jsxs("div",{className:"mono text-[10px] text-zinc-500",children:[e.lastAdjust.reason," ",d.jsxs("span",{className:"tnum text-zinc-400",children:[e.lastAdjust.from,"→",e.lastAdjust.to]})," ",P6(e.lastAdjust.at)]})]})}function I6({workers:e}){return d.jsx("div",{className:"flex flex-col divide-y divide-line-soft",children:e.map(t=>d.jsxs("div",{className:"flex flex-col gap-1 px-2.5 py-2",children:[d.jsx("span",{className:"mono truncate text-[10px] text-zinc-400",children:t.instanceId}),d.jsx(TN,{status:t.status})]},t.instanceId))})}function j6(){const{data:e}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:1e4}),[t,n]=S.useState("workers");if(!e||e.length===0)return null;const r=dj(e),s={workers:"pods",partitions:"parts",alerts:"alerts"};return d.jsxs(n6,{value:t,onValueChange:o=>n(o),className:"ml-auto flex flex-nowrap items-center gap-1.5",children:[d.jsx(vN,{children:["workers","partitions","alerts"].map(o=>d.jsxs(wN,{value:o,children:[s[o],o==="alerts"&&r.starved.length>0&&d.jsx("span",{className:"tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white",children:r.starved.length})]},o))}),d.jsxs("div",{className:"flex w-[300px] flex-nowrap items-center justify-end gap-1.5",children:[d.jsx(Gc,{value:"workers",className:"flex flex-nowrap items-center gap-1.5",children:d.jsx(O6,{workers:cj(e)})}),d.jsx(Gc,{value:"partitions",className:"flex flex-nowrap items-center gap-1.5",children:d.jsx(_6,{groups:e})}),d.jsx(Gc,{value:"alerts",className:"flex flex-nowrap items-center gap-1.5",children:d.jsx(M6,{summary:r})})]})]})}const fw="__overflow__";function hw(e){var n;const t=(n=e.status)==null?void 0:n.concurrency;return e.status&&t?`${e.status.inFlight}/${t.limit}`:void 0}function pw({w:e}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-2.5 py-2",children:d.jsx(TN,{status:e.status})}),d.jsxs("div",{className:"max-h-48 overflow-auto border-t border-line-soft px-2.5 py-1.5",children:[d.jsxs("div",{className:"mono mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:[e.handlers.length," handlers"]}),e.handlers.map(t=>d.jsx("div",{className:"mono truncate text-[10px] text-zinc-400",children:t},t))]})]})}function O6({workers:e}){const[t,n]=S.useState(void 0),[r,s]=S.useState(void 0),o=2,i=e.slice(0,o),l=e.slice(o),a=t===fw;return d.jsxs(d.Fragment,{children:[i.map(c=>{const u=t===c.instanceId,f=hw(c);return d.jsxs(Ii,{open:u,onOpenChange:h=>n(h?c.instanceId:void 0),children:[d.jsx(Zu,{suppressed:u,label:`${c.instanceId}
63
+ ${c.handlers.length} handlers · ${c.partition}${f?` · ${f} in-flight`:""}`,children:d.jsx(ji,{render:d.jsxs(Se,{variant:"chip",size:"xs",className:st("mono max-w-[120px] gap-1",u&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:[d.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),d.jsx("span",{className:"truncate",children:c.instanceId}),c.partition!=="default"&&d.jsxs("span",{className:"shrink-0 text-zinc-500",children:["@",c.partition]}),d.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.handlers.length,"h",f?` · ${f}`:""]})]})})}),d.jsxs(fo,{children:[d.jsxs("div",{className:"mono flex items-center justify-between gap-2 border-b border-line px-2.5 py-1.5 text-[10px] text-zinc-500",children:[d.jsx("span",{className:"truncate text-zinc-300",children:c.instanceId}),d.jsxs("span",{className:"shrink-0",children:[c.runtime??"node"," · ",c.partition]})]}),d.jsx(pw,{w:c})]})]},c.instanceId)}),l.length>0&&d.jsxs(Ii,{open:a,onOpenChange:c=>{n(c?fw:void 0),s(void 0)},children:[d.jsx(ji,{render:d.jsxs(Se,{variant:"chip",size:"xs",className:st("mono shrink-0",a&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:["+",l.length]})}),d.jsxs(fo,{children:[d.jsxs("div",{className:"mono border-b border-line px-2.5 py-1.5 text-[9px] uppercase tracking-wider text-zinc-600",children:[l.length," more ",l.length===1?"pod":"pods"]}),d.jsx("div",{className:"max-h-80 divide-y divide-line-soft overflow-auto",children:l.map(c=>{const u=hw(c),f=r===c.instanceId;return d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>s(f?void 0:c.instanceId),className:st("mono flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[10px] hover:bg-zinc-800/50",f?"bg-zinc-800/40 text-zinc-200":"text-zinc-300"),children:[d.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[d.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),d.jsx("span",{className:"truncate",children:c.instanceId})]}),d.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.partition!=="default"?`@${c.partition} · `:"",c.handlers.length,"h",u?` · ${u}`:""]})]}),f&&d.jsx("div",{className:"border-t border-line-soft bg-zinc-900/40",children:d.jsx(pw,{w:c})})]},c.instanceId)})})]})]})]})}function _6({groups:e}){const[t,n]=S.useState(void 0),r=ij(e);function s(o){const i=new Map;for(const l of e)if(ku(l.group)===o)for(const a of l.liveWorkers)i.has(a.instanceId)||i.set(a.instanceId,a);return[...i.values()]}return d.jsx(d.Fragment,{children:r.map(o=>{const i=o.starvedCount>0,l=t===o.partition;return d.jsxs(Ii,{open:l&&o.workerCount>0,onOpenChange:a=>n(a?o.partition:void 0),children:[d.jsx(Zu,{suppressed:l,label:`${o.partition}
64
+ ${o.workerCount} workers · ${o.handlerCount} handlers · ${o.totalDepth} queued${i?` · ${o.starvedCount} starved`:""}`,children:d.jsx(ji,{render:d.jsxs(Se,{variant:"chip",size:"xs",disabled:o.workerCount===0,className:st("mono gap-1",i&&"border-rose-500/50 bg-rose-500/15 text-rose-300",!i&&l&&"border-zinc-500 bg-zinc-800 text-zinc-200",o.workerCount>0?"cursor-pointer":"cursor-default"),children:[d.jsx("span",{className:`dot ${i?"s-failed":o.workerCount>0?"s-completed":""}`,"aria-hidden":!0}),o.partition,d.jsxs("span",{className:"tnum text-zinc-500",children:[o.workerCount,"w ",o.handlerCount,"h",o.totalDepth>0?` ${o.totalDepth}q`:"",i?` ${o.starvedCount}!`:""]})]})})}),d.jsxs(fo,{children:[d.jsxs("div",{className:"mono flex items-center justify-between border-b border-line px-2.5 py-1.5 text-[10px] text-zinc-500",children:[d.jsx("span",{className:"text-zinc-300",children:o.partition}),d.jsxs("span",{className:"tnum",children:[o.workerCount," worker(s) · ",o.totalDepth," queued"]})]}),d.jsx(I6,{workers:s(o.partition)})]})]},o.partition)})})}function M6({summary:e}){const t=(n,r)=>`${n} ${n===1?r:`${r}s`}`;return d.jsxs(d.Fragment,{children:[d.jsx(Zu,{label:`Route-by-handler: each @Workflow & @Step is served as its own queue.
65
+ ${e.queueCount} queues across ${t(e.workerCount,"worker")}.`,children:d.jsxs("span",{className:"mono tnum text-[10px] text-zinc-500",children:[t(e.workflowCount,"workflow")," · ",t(e.stepCount,"step")," ·"," ",t(e.workerCount,"worker")," ·"," ",e.allDraining?d.jsx("span",{className:"text-good",children:"all draining"}):d.jsxs("span",{className:"text-rose-300",children:[e.starved.length," starved"]})]})}),e.starved.map(n=>d.jsx(Zu,{label:`${n.group}
66
+ ${n.depth} queued, no worker consuming`,children:d.jsxs(Xe,{variant:"danger",className:"mono gap-1 border-rose-500/50 bg-rose-500/15 py-0.5",children:[d.jsx("span",{className:"dot s-failed","aria-hidden":!0}),d.jsx("span",{className:"max-w-[180px] truncate",children:n.group}),d.jsxs("span",{className:"tnum shrink-0",children:[n.depth,"q · 0w"]})]})},n.group))]})}function A6(){return d.jsx("ul",{className:"divide-y divide-line-soft","aria-hidden":!0,children:[0,1,2,3,4,5].map(e=>d.jsxs("li",{className:"flex flex-col gap-2 px-4 py-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("div",{className:"h-3.5 w-32 animate-pulse rounded bg-zinc-800"}),d.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-zinc-800/70"})]}),d.jsx("div",{className:"h-2.5 w-48 animate-pulse rounded bg-zinc-800/50"})]},e))})}const z6=S.memo(function({run:t,siblings:n,health:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a}){const c=pS(t,{runs:n,health:r}),u=t.namespace&&t.namespace!=="default"?t.namespace:void 0,f=Hi(t.origin);return d.jsxs("button",{type:"button",onClick:()=>o(t.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${s?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[d.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:t.workflow}),u&&d.jsx(Xe,{variant:"tenant",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-sky-400/60 hover:text-sky-200",title:`Tenant / worker-pool partition — click to show only ${u}`,onClick:h=>{h.stopPropagation(),l(u)},children:u}),f&&d.jsx(Xe,{variant:"origin",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal-400/60 hover:text-teal-200",title:`Declared by ${f} — click to show only this library's runs`,onClick:h=>{h.stopPropagation(),a({kind:"origin",origin:f})},children:Ca(f)}),t.id.startsWith("dlq:")&&d.jsx(Xe,{variant:"danger",className:"mono shrink-0 px-1 text-[9px] uppercase tracking-wider",children:"dlq"})]}),d.jsx(RN,{status:c.status})]}),c.detail&&d.jsx("div",{className:`mono truncate text-[11px] s-${c.status}`,children:c.detail}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:t.id}),d.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:N6(t.updatedAt)})]}),t.tags&&t.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:t.tags.map(h=>d.jsxs("span",{onClick:p=>{p.stopPropagation(),i(h)},className:st(MS({variant:"outline"}),"mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200"),children:["#",h]},h))})]})}),D6=86,$6=12;function F6({runs:e,siblings:t,health:n,loading:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a,total:c,onLoadMore:u,loadingMore:f,emptyNotice:h}){var w;const p=S.useRef(null),v=S.useCallback(k=>p4(e,k),[e]),x=lg({count:e.length,getScrollElement:()=>p.current,estimateSize:()=>D6,getItemKey:v,measureElement:k=>k.getBoundingClientRect().height,overscan:8}),b=x.getVirtualItems(),g=c>e.length,m=b.length>0?((w=b[b.length-1])==null?void 0:w.index)??-1:-1,y=S.useRef(-1);return S.useEffect(()=>{h4({hasMore:g,loading:!!f,lastRenderedIndex:m,loadedCount:e.length,requestedAtCount:y.current,loadAhead:$6})&&(y.current=e.length,u())},[g,f,m,e.length,u]),r&&e.length===0?d.jsx(A6,{}):e.length===0?d.jsxs("div",{className:"flex flex-col items-start gap-2 p-6 text-sm text-zinc-600",children:[d.jsx("span",{children:h.message}),h.unclassified!==void 0&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"text-[11px] text-zinc-500",children:[h.unclassified," run",h.unclassified===1?"":"s"," here"," ",h.unclassified===1?"is":"are"," the app's own (no package origin), so no package filter can match ",h.unclassified===1?"it":"them","."]}),d.jsx(Se,{variant:"chip",size:"xs",className:"mono rounded",title:cg,onClick:()=>a({kind:"unknown"}),children:"show app runs"})]})]}):d.jsxs("div",{ref:p,className:"min-h-0 flex-1 overflow-auto",children:[d.jsx("ul",{className:"relative",style:{height:x.getTotalSize()},children:b.map(k=>{const N=e[k.index];return N?d.jsx("li",{"data-index":k.index,ref:x.measureElement,className:"absolute left-0 top-0 w-full border-b border-line-soft",style:{transform:`translateY(${k.start}px)`},children:d.jsx(z6,{run:N,siblings:t,health:n,selected:s===N.id,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a})},N.id):null})}),d.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2","aria-live":"polite","aria-busy":g&&f,children:[d.jsxs("span",{className:"mono text-[10px] text-zinc-600",children:[e.length," of ",c]}),g&&d.jsx("span",{className:"mono ml-auto text-[10px] text-zinc-600",children:f?"loading…":"scroll for more"})]})]})}function L6({compensations:e,selKey:t,onSelect:n}){return d.jsxs("div",{className:"shrink-0 border-t border-amber-500/20 bg-black/20 px-7 py-3",children:[d.jsx("div",{className:"mono mb-2 text-[10px] uppercase tracking-[0.18em] text-amber-400/80",children:"compensation · unwind order"}),d.jsx("ul",{className:"flex flex-col gap-1",children:e.map(r=>{const s=`${r.runId}#${r.seq}`;return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>n(r),className:`mono flex w-full items-center gap-2 rounded-md border px-2.5 py-1.5 text-left text-[11.5px] transition-colors ${s===t?"border-amber-500/50 bg-amber-500/15":"border-amber-500/20 bg-amber-500/5 hover:border-amber-500/40"}`,children:[d.jsx(N0,{status:r.status}),d.jsx("span",{className:"truncate text-amber-100",children:UI(r.name)}),d.jsx("span",{className:"ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70",children:r.status})]})},s)})})]})}const H6=[],B6=S.memo(function({id:t,onOpenRun:n}){const r=mo(),{data:s}=Xt({queryKey:["run",t],queryFn:async()=>lj(r.getQueryData(["run",t]),await $e.run(t)),refetchInterval:ne=>{var je;const Be=(je=ne.state.data)==null?void 0:je.run.status;return Be==="running"||Be==="suspended"?1500:!1}}),{data:o=[]}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),i=s==null?void 0:s.run,l=IN(i!==void 0&&PN([i])),a=(s==null?void 0:s.run.status)==="dead"?`dlq:${t}`:void 0,{data:c}=Xt({queryKey:["run",a],queryFn:()=>$e.run(a),enabled:!!a,retry:!1}),u=()=>{r.invalidateQueries({queryKey:["run",t]}),r.invalidateQueries({queryKey:["runs"]})},f=s==null?void 0:s.run.status,h=f==="running"||f==="suspended",p=S.useRef(h);p.current=h;const[v]=S.useState(()=>new oj),[x,b]=S.useState({});S.useEffect(()=>{const ne=fj(()=>r.invalidateQueries({queryKey:["run",t]}),1500),Be=$e.streamRun(t,je=>{var zt;if(v.push(je),je.type==="run.trigger_failed"&&je.name&&((zt=je.error)!=null&&zt.message)){const{name:gn,error:qn}=je;b(Kn=>({...Kn,[gn]:qn.message}))}if(je.type==="step.progress"&&je.event&&je.seq!=null){const gn=je.seq,qn=je.event;r.setQueryData(["run",t],Kn=>aj(Kn,gn,qn));return}(p.current||je.type==="run.triggered"||je.type==="run.trigger_failed")&&ne.call()});return()=>{ne.cancel(),Be()}},[t,v,r]);const g=mr({mutationFn:()=>$e.retry(t),onSuccess:u}),m=mr({mutationFn:ne=>$e.cancel(t,ne!==void 0?{compensate:ne}:{}),onSuccess:u}),y=mr({mutationFn:()=>$e.continue(t),onSuccess:u}),w=uN(),k=mr({mutationFn:()=>$e.redispatch(t),onSuccess:u}),[N,E]=S.useState(!1),C=mr({mutationFn:()=>$e.republishLifecycle(t),onSuccess:u}),P=mr({mutationFn:ne=>$e.republishLifecycle(t,ne),onSuccess:u}),I=mr({mutationFn:ne=>$e.retryWithInput(t,ne),onSuccess:ne=>{r.invalidateQueries({queryKey:["runs"]}),n(ne.runId)}}),[z,$]=S.useState(!1),[A,R]=S.useState(""),[j,O]=S.useState(),F=()=>{R(JSON.stringify((s==null?void 0:s.run.input)??{},null,2)),O(void 0),$(!0)},T=()=>{let ne;try{ne=JSON.parse(A)}catch(Be){O(Be instanceof Error?Be.message:"Invalid JSON");return}$(!1),I.mutate(ne)},[M,_]=S.useState(),[U,L]=S.useState(!1),[K,W]=S.useState(new Set),[q,H]=S.useState(240);function G(ne){ne.preventDefault(),ne.currentTarget.setPointerCapture(ne.pointerId);const Be=zt=>H(gn=>Math.max(120,Math.min(720,gn-zt.movementY))),je=()=>{window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",je)};window.addEventListener("pointermove",Be),window.addEventListener("pointerup",je)}const B=S.useCallback(ne=>{W(Be=>{const je=new Set(Be);return je.has(ne)?je.delete(ne):je.add(ne),je})},[]),Y=S.useCallback((ne,Be)=>{_({step:ne,run:Be})},[]),Q=S.useMemo(()=>qI((s==null?void 0:s.timeline)??[]),[s==null?void 0:s.timeline]),Z=(s==null?void 0:s.fans)??H6;if(!s)return d.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:V}=s,{body:X,compensations:ee}=Q,he=Z.reduce((ne,Be)=>ne+Be.size,X.length),Pe=X.length>0||Z.length>0,ce=_A(s.children??[],s.childCount),ve=MA(s),ue=ve.startedBy,Re=s.lifecycleSubscribers??[],ye=KI(ee),ze=V.id.startsWith("dlq:"),Ie=ze?{id:V.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${V.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:c?{id:`dlq:${V.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,et=ee.length>0?(()=>{const ne=ye.failed>0?` ${ye.failed} undo${ye.failed===1?"":"s"} failed after retries — check ${ye.failed===1?"it":"them"} below.`:"";return ye.pending>0?{title:"Compensating",subtitle:`undoing completed steps in reverse (${ye.done} of ${ye.total} done).${ne}`}:V.status==="cancelled"?{title:"Cancelled with compensation",subtitle:`completed steps were undone before cancelling.${ne}`}:{title:"Saga compensated",subtitle:`the run failed and its ${ye.total} completed step${ye.total===1?"":"s"} were undone in reverse.${ne}`}})():void 0,lt=V.status==="failed"||V.status==="suspended",re=V.status==="running"||V.status==="suspended",se=V.status==="suspended"||V.status==="running",De=X.some(ne=>ne.status==="pending"&&ne.kind==="signal"&&ne.name.startsWith("breakpoint")),we=M?`${M.step.runId}#${M.step.seq}`:void 0,at=pS(V,{runs:l,health:o,timeline:X}),nn=V.namespace&&V.namespace!=="default"?V.namespace:void 0,qt=Hi(V.origin);return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-7 py-5",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:d.jsx("a",{href:Md(V.workflow),className:"underline-offset-4 hover:underline",title:"Open this workflow's page: who starts when it settles, and who starts it",children:V.workflow})}),Tc(V.id)!==void 0&&d.jsx(Se,{variant:"alt",size:"xs",onClick:()=>n(Tc(V.id)),className:"mono uppercase tracking-wider",title:`Open the parent run (${Tc(V.id)}) — the macro view this child belongs to`,children:"↑ parent"}),Yc(V.id)!==void 0&&d.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(Yc(V.id)),className:"mono uppercase tracking-wider text-zinc-300",title:`This is a retry-with-input of ${Yc(V.id)} — open the original run`,children:"↩ original"}),ze&&d.jsx(Xe,{variant:"danger",className:"mono py-0.5 uppercase tracking-wider",children:"dlq"}),d.jsx(RN,{status:at.status}),at.detail&&d.jsx("span",{className:`mono text-[11px] s-${at.status}`,children:at.detail}),nn&&d.jsx(Xe,{variant:"tenant",className:"mono py-0.5",title:"Tenant / worker-pool partition this run belongs to",children:nn}),qt?d.jsx(Xe,{variant:"origin",className:"mono py-0.5",title:`Declared by ${qt}`,children:Ca(qt)}):d.jsxs(Xe,{variant:"origin-unknown",className:"mono py-0.5",title:cg,children:["origin ",gd]}),ee.length>0&&d.jsx(Xe,{variant:"warn",className:st("mono py-0.5 uppercase tracking-wider",ye.pending>0&&"pulse"),title:ye.pending>0?`compensating: ${ye.done} of ${ye.total} undone`:`${ye.total} step${ye.total===1?"":"s"} compensated`,children:ye.pending>0?"compensating":"compensated"}),d.jsxs(Xe,{className:"mono bg-transparent py-0.5 text-zinc-500",children:["v",V.workflowVersion]}),d.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[he," ",he===1?"step":"steps"]})]}),d.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:V.id}),V.tags&&V.tags.length>0&&d.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:V.tags.map(ne=>d.jsxs(Xe,{className:"mono",children:["#",ne]},ne))}),V.searchAttributes&&Object.keys(V.searchAttributes).length>0&&d.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(V.searchAttributes).map(([ne,Be])=>d.jsxs(Xe,{variant:"attr",className:"mono",title:"search attribute",children:[ne,"=",String(Be)]},ne))}),ce.shown.length>0?d.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[d.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),ce.shown.map(ne=>d.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(ne),className:"mono px-1.5 py-0",children:ne},ne)),ce.more>0&&d.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:["+",ce.more," more"]})]}):null,ue?d.jsx(fz,{source:ue,onOpenRun:n}):null,d.jsx(hz,{waitsFor:s.waitsFor,awaitedBy:s.awaitedBy,onOpenRun:n}),ve.triggered.length>0?d.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[d.jsx("span",{className:"text-[10px] text-zinc-600",children:"triggered:"}),ve.triggered.map(ne=>d.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(ne),className:"mono px-1.5 py-0",children:ne},ne))]}):null,s.lifecycleDeliveries?d.jsx(pz,{deliveries:mz(s.lifecycleDeliveries,x),onOpenRun:n,onRepublish:ne=>P.mutate(ne),republishing:P.isPending}):null,s.workflowLifecycle?d.jsx("div",{className:"mt-3",children:d.jsx(fE,{links:s.workflowLifecycle})}):null,d.jsx($A,{tail:v,sourceRunId:ue==null?void 0:ue.runId,parentRunId:Tc(V.id),onOpenRun:n})]}),d.jsxs("div",{className:"flex shrink-0 gap-2",children:[d.jsx(Se,{onClick:()=>L(!0),className:"mono px-2.5 normal-case tracking-normal text-zinc-400",title:"Run input / output",children:"{ }"}),De&&w("breakpoints")&&d.jsxs(Se,{variant:"warn",disabled:y.isPending,onClick:()=>y.mutate(),children:[d.jsx(xj,{width:12,height:12}),"Continue"]}),d.jsxs(Se,{variant:"brand",disabled:!lt||g.isPending,onClick:()=>g.mutate(),children:[d.jsx(jf,{width:12,height:12}),"Retry"]}),se&&w("redispatch")&&d.jsxs(Se,{variant:"info",disabled:k.isPending,onClick:()=>k.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[d.jsx(Cu,{width:12,height:12}),"Re-dispatch"]}),Re.length>0&&w("republishLifecycle")&&d.jsxs(Se,{variant:"info",disabled:C.isPending,onClick:()=>{C.reset(),E(!0)},title:"Start the lifecycle-event subscribers that have not started from this run",children:[d.jsx(Cu,{width:12,height:12}),"Republish lifecycle event"]}),(V.status==="dead"||V.status==="failed")&&d.jsxs(Se,{variant:"alt",disabled:I.isPending,onClick:F,title:"Edit the input and re-run as a fresh linked run",children:[d.jsx(jf,{width:12,height:12}),"Fix & replay"]}),re&&d.jsxs(Se,{variant:"warn",disabled:m.isPending,onClick:()=>m.mutate(!0),title:"Cancel and run saga compensations (undo completed steps in reverse)",className:"bg-transparent",children:[d.jsx(jf,{width:12,height:12}),"Cancel + Undo"]}),d.jsxs(Se,{className:"border-zinc-700",disabled:!re||m.isPending,onClick:()=>m.mutate(!1),children:[d.jsx(Ss,{width:12,height:12}),"Cancel"]})]})]}),Ie&&d.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[d.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-rose-500/40 bg-rose-500/15 text-sm text-rose-300","aria-hidden":!0,children:"⚠"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:Ie.title}),d.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:Ie.subtitle})]}),d.jsx(Se,{variant:"danger",onClick:()=>n(Ie.id),className:"mono shrink-0 border-rose-500/40 bg-rose-500/15 px-2.5 text-[11px] normal-case tracking-normal text-rose-200 enabled:hover:bg-rose-500/25",children:Ie.cta})]}),et&&d.jsxs("div",{className:"flex items-center gap-3 border-b border-amber-500/30 bg-amber-500/10 px-7 py-3",children:[d.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-amber-500/40 bg-amber-500/15 text-sm text-amber-300","aria-hidden":!0,children:"↺"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"text-[13px] font-medium text-amber-200",children:et.title}),d.jsx("div",{className:"mono truncate text-[11px] text-amber-300/70",children:et.subtitle})]})]}),d.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:Pe?`1fr ${q}px`:"1fr"},children:[d.jsxs("div",{className:"relative min-h-0",children:[Pe?d.jsx(f4,{run:V,timeline:X,fans:Z,endStatus:at.status,selectedKey:we,onSelect:Y,onOpenRun:n,fmtDuration:R6,expanded:K,onToggleChild:B}):d.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}),(V.status==="failed"||V.status==="cancelled")&&V.error&&d.jsx("div",{className:"mono absolute inset-x-6 bottom-6 rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-300 backdrop-blur",children:V.error.message})]}),Pe&&d.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-line bg-black/20",children:[d.jsx("div",{onPointerDown:G,className:"absolute inset-x-0 top-0 z-10 h-1.5 -translate-y-1/2 cursor-row-resize hover:bg-brand/40",title:"Drag to resize"}),d.jsx(tz,{run:V,timeline:X,fans:Z,selectedKey:we,onSelect:Y,onOpenRun:n,expanded:K,onToggleChild:B})]}),M&&d.jsx(iz,{step:M.step,run:M.run,onClose:()=>_(void 0),onOpenRun:n}),U&&d.jsx(lz,{run:V,onClose:()=>L(!1)})]}),ee.length>0&&d.jsx(L6,{compensations:ee,selKey:we,onSelect:ne=>_({step:ne,run:V})}),d.jsxs(cw,{open:N,onOpenChange:E,title:"Republish lifecycle event",subtitle:`publishes ${V.id}'s ${V.status==="completed"?"run.completed":"run.failed"} event again`,footer:C.isSuccess||C.isError?d.jsx(Se,{onClick:()=>E(!1),children:"Close"}):d.jsxs(d.Fragment,{children:[d.jsx(Se,{onClick:()=>E(!1),children:"Cancel"}),d.jsx(Se,{variant:"info",disabled:C.isPending,onClick:()=>C.mutate(),children:"Republish"})]}),children:[d.jsxs("p",{className:"text-[12px] text-zinc-400",children:["Subscribers: ",d.jsx("span",{className:"mono text-zinc-300",children:Re.join(", ")}),". The ones already started from this run are not started again."]}),C.isSuccess&&d.jsxs("div",{className:"mono mt-3 space-y-1 text-[11.5px] text-zinc-300",children:[d.jsxs("p",{children:["started ",C.data.started," subscriber run",C.data.started===1?"":"s"]}),C.data.failed.map(ne=>d.jsxs("p",{className:"rounded border border-bad/25 bg-bad/10 px-2 py-1 text-bad",children:[ne.subscriber,": ",ne.error]},ne.subscriber))]}),C.isError&&d.jsx("p",{className:"mono mt-3 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:C.error instanceof Error?C.error.message:String(C.error)})]}),d.jsxs(cw,{open:z,onOpenChange:$,title:"Fix & replay",subtitle:`re-runs ${V.id} as a fresh linked run`,footer:d.jsxs(d.Fragment,{children:[d.jsx(Se,{onClick:()=>$(!1),children:"Cancel"}),d.jsx(Se,{variant:"alt",disabled:I.isPending,onClick:T,children:"Replay"})]}),children:[d.jsx("label",{className:"mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500",htmlFor:"fix-replay-input",children:"input"}),d.jsx("textarea",{id:"fix-replay-input",value:A,spellCheck:!1,onChange:ne=>{R(ne.target.value),O(void 0)},className:"mono h-64 w-full resize-y rounded-lg border border-line bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300 focus:border-zinc-600 focus:outline-none"}),j&&d.jsx("p",{className:"mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:j})]})]})});function mw(){if(typeof window>"u")return;const e=window.location.hash.match(/^#\/run\/(.+)$/),t=e==null?void 0:e[1];return t?decodeURIComponent(t):void 0}function PN(e){return e.some(t=>{var n;return t.status==="suspended"&&((n=t.tags)==null?void 0:n.some(r=>r.startsWith("singleton:")))})}function IN(e){const{data:t=[]}=Xt({queryKey:["runs","in-flight"],queryFn:()=>$e.runs(void 0,void 0,void 0,{statuses:hS,limit:500}),enabled:e,refetchInterval:5e3});return t}const V6=100;function G6(){const e=uN(),[t,n]=S.useState("all"),[r,s]=S.useState([]),[o,i]=S.useState([]),[l,a]=S.useState([]),[c,u]=S.useState(dS),[f,h]=S.useState(()=>mw()),[p,v]=S.useState(()=>typeof window>"u"?void 0:Jy(window.location.hash)),x=S.useCallback(Q=>{if(h(Q),v(void 0),typeof window>"u")return;const Z=Q?`#/run/${encodeURIComponent(Q)}`:"",V=Z||window.location.pathname+window.location.search;window.location.hash!==Z&&window.history.pushState(null,"",V)},[]);S.useEffect(()=>{const Q=()=>{h(mw()),v(Jy(window.location.hash))};return window.addEventListener("hashchange",Q),window.addEventListener("popstate",Q),()=>{window.removeEventListener("hashchange",Q),window.removeEventListener("popstate",Q)}},[]);const[b,g]=S.useState({key:"",pages:1}),m=mo(),y=o,w=y.join("|"),k=c.kind==="origin"?c.origin:c.kind==="unknown"?null:void 0,N=fS(c),E=m4({status:t,tag:r.join("|"),attrs:w,namespace:l.join("|"),origin:N}),C=b.key===E?b.pages:1,P=V6*C,{data:I=[],isPending:z,isFetching:$}=Xt({queryKey:["runs",t,r,w,l,N,P],queryFn:()=>$e.runs(t==="all"?void 0:t,r,y.length?y:void 0,{namespace:l,origin:k,limit:P}),refetchInterval:3e3,placeholderData:PR}),{data:A=[]}=Xt({queryKey:["run-facets",r,w,l],queryFn:()=>$e.facets(r,y.length?y:void 0,l),refetchInterval:5e3}),R=c.kind==="unknown"?null:c.kind==="origin"?c.origin:void 0,j=S.useMemo(()=>({namespace:l,attr:o,origin:R}),[l,o,R]),O=S.useMemo(()=>({tag:r,attr:o,origin:R}),[r,o,R]),F=S.useMemo(()=>({tag:r,namespace:l,origin:R}),[r,l,R]),{data:T=[]}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),M=mr({mutationFn:Q=>$e.bulk(Q,{status:t!=="all"?t:void 0,tag:r,attr:y.length?y:void 0,namespace:l,origin:k}),onSuccess:()=>m.invalidateQueries({queryKey:["runs"]})}),_=S.useMemo(()=>{const Q={};for(const Z of A)LI({origin:Z.origin??void 0},c)&&(Q[Z.status]=(Q[Z.status]??0)+Z.count);return Q},[A,c]),U=S.useMemo(()=>VI(A),[A]),L=S.useMemo(()=>t==="all"?Object.values(_).reduce((Q,Z)=>Q+Z,0):_[t]??0,[_,t]),K=t!=="all"||r.length>0||l.length>0||y.length>0||c.kind!=="all",W=S.useMemo(()=>HI(A),[A]),q=S.useMemo(()=>uj(T),[T]),H=IN(S.useMemo(()=>PN(I),[I])),G=S.useCallback(Q=>{s(Z=>Z.includes(Q)?Z:[...Z,Q])},[]),B=S.useCallback(Q=>{a(Z=>Z.includes(Q)?Z:[...Z,Q])},[]),Y=S.useCallback(()=>{g(Q=>({key:E,pages:Q.key===E?Q.pages+1:2}))},[E]);return d.jsxs(w6,{children:[d.jsx("div",{className:"app-bg"}),d.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[d.jsx(T6,{counts:_,filter:t,onFilter:n}),q.length>0&&d.jsxs("div",{className:"flex items-center gap-2 border-b border-amber-500/30 bg-amber-500/10 px-4 py-1.5 text-[11px] text-amber-200",children:[d.jsx("span",{className:"s-no-worker inline-flex items-center gap-1.5",children:d.jsx("span",{className:"dot s-no-worker","aria-hidden":!0})}),d.jsxs("span",{children:["Runs waiting on handlers with no live worker:"," ",d.jsx("span",{className:"mono text-amber-100",children:q.join(", ")}),". Start a worker to unblock."]})]}),d.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[d.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-line",children:[d.jsxs("div",{className:"border-b border-line p-2",children:[d.jsx(zu,{field:"tag",scope:j,glyph:"#",label:"filter by tag",placeholder:"filter by tag…",value:r,onChange:s,title:"Tags carried by a run (WorkflowRun.tags). Several match ANY of them."}),d.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e("tags")&&d.jsx(gz,{tags:r,onChange:s})}),d.jsx("div",{className:e("namespaces")?"mt-1.5":"hidden",children:d.jsx(zu,{field:"namespace",scope:O,glyph:"@",label:"filter by tenant",placeholder:"filter by tenant / namespace…",value:l,onChange:a,title:"Tenant / worker-pool partition (WorkflowRun.namespace). None selected shows every tenant."})}),e("searchAttributes")&&d.jsx(kA,{value:o,onChange:i,scope:F})]}),e("origins")&&d.jsx(TA,{facets:W,value:c,onChange:u}),K&&L>0&&d.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5",children:[d.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[L," ",t!=="all"?t:"",r.length>0&&` #${r.join(", ")}`,l.length>0&&` @${l.join(", ")}`,c.kind==="origin"&&` ⬡${Ca(c.origin)}`,c.kind==="unknown"&&` ⬡${gd}`,y.length>0&&` ⛃${y.length}`]}),d.jsx(Se,{variant:"brand",size:"xs",disabled:M.isPending,onClick:()=>M.mutate("retry"),className:"mono ml-auto rounded",children:"retry all"}),d.jsx(Se,{variant:"danger",size:"xs",disabled:M.isPending,onClick:()=>M.mutate("cancel"),className:"mono rounded",children:"cancel all"})]}),d.jsx(F6,{runs:I,siblings:H,health:T,loading:z,selected:f,onSelect:x,onSelectTag:G,onSelectNamespace:B,onSelectOrigin:u,total:L,onLoadMore:Y,loadingMore:$,emptyNotice:WI({anyFilter:K,origin:c,unknownCount:U})},E)]}),d.jsx("main",{className:"min-h-0",children:f?d.jsx(B6,{id:f,onOpenRun:x},f):p?d.jsx(IA,{workflow:p},p):d.jsx("div",{className:"grid h-full place-items-center text-center",children:d.jsxs("div",{className:"flex flex-col items-center",children:[d.jsx(NN,{className:"h-10 w-10 text-zinc-800"}),d.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}export{G6 as A,U6 as Q,l0 as R,K6 as a,rI as c,d as j,Y6 as o,S as r};